Просмотр исходного кода

mv PageListMeta and PagePathLabel to @growi/ui

Yuki Takei 4 лет назад
Родитель
Сommit
b5b1153df1

+ 2 - 3
packages/app/src/components/PageList/Page.jsx

@@ -1,9 +1,8 @@
 import React from 'react';
 import PropTypes from 'prop-types';
 
-import { UserPicture } from '@growi/ui';
-import PageListMeta from './PageListMeta';
-import PagePathLabel from './PagePathLabel';
+import { UserPicture, PageListMeta, PagePathLabel } from '@growi/ui';
+
 
 export default class Page extends React.Component {
 

+ 0 - 24
packages/app/src/components/PageList/PagePath.jsx

@@ -1,24 +0,0 @@
-import React from 'react';
-import PropTypes from 'prop-types';
-
-import PagePathLabel from './PagePathLabel';
-
-/**
- * !!DEPRECATED!!
- *
- * maintained for backward compatibility for growi-lsx-plugin(<= 3.1.1)
- */
-const PagePath = props => (
-  <PagePathLabel isLatterOnly={props.isShortPathOnly} {...props} />
-);
-
-PagePath.propTypes = {
-  isShortPathOnly: PropTypes.bool,
-  ...PagePathLabel.propTypes,
-};
-
-PagePath.defaultProps = {
-  ...PagePathLabel.defaultProps,
-};
-
-export default PagePath;

+ 1 - 3
packages/app/src/components/SearchTypeahead.jsx

@@ -4,10 +4,8 @@ import PropTypes from 'prop-types';
 import { noop } from 'lodash/noop';
 import { AsyncTypeahead } from 'react-bootstrap-typeahead';
 
-import { UserPicture } from '@growi/ui';
+import { UserPicture, PageListMeta, PagePathLabel } from '@growi/ui';
 
-import PageListMeta from './PageList/PageListMeta';
-import PagePathLabel from './PageList/PagePathLabel';
 import AppContainer from '~/client/services/AppContainer';
 import { withUnstatedContainers } from './UnstatedUtils';
 

+ 1 - 1
packages/plugin-lsx/src/client/js/components/LsxPageList/LsxPage.jsx

@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
 
 import { pathUtils } from 'growi-commons';
 
-import PageListMeta from '@client/js/components/PageList/PageListMeta';
+import { PageListMeta } from '@growi/ui';
 
 import { LsxContext } from '../../util/LsxContext';
 import { PageNode } from '../PageNode';

+ 2 - 2
packages/plugin-lsx/src/client/js/components/LsxPageList/PagePathWrapper.jsx

@@ -1,7 +1,7 @@
 import React from 'react';
 import PropTypes from 'prop-types';
 
-import PagePath from '@client/js/components/PageList/PagePath';
+import { PagePathLabel } from '@growi/ui';
 
 export class PagePathWrapper extends React.Component {
 
@@ -13,7 +13,7 @@ export class PagePathWrapper extends React.Component {
     }
 
     return (
-      <PagePath page={{ path: this.props.pagePath }} isShortPathOnly={true} additionalClassNames={classNames} />
+      <PagePathLabel page={{ path: this.props.pagePath }} isLatterOnly additionalClassNames={classNames} />
     );
   }
 

+ 1 - 1
packages/plugin-lsx/src/meta.js

@@ -1,7 +1,7 @@
 const path = require('path');
 
 module.exports = {
-  pluginSchemaVersion: 2,
+  pluginSchemaVersion: 3,
   serverEntries: [
     path.join(__dirname, 'server-entry.js'),
   ],

+ 3 - 0
packages/plugin-lsx/tsconfig.json

@@ -0,0 +1,3 @@
+{
+  "extends": "../../tsconfig.base.json"
+}

+ 2 - 3
packages/app/src/components/PageList/PageListMeta.jsx → packages/ui/src/components/PagePath/PageListMeta.jsx

@@ -1,11 +1,10 @@
 import React from 'react';
 import PropTypes from 'prop-types';
-import { pagePathUtils } from '@growi/core';
-import templateChecker from '~/utils/template-checker';
+import { templateChecker, pagePathUtils } from '@growi/core';
 
 const { isTopPage } = pagePathUtils;
 
-export default class PageListMeta extends React.Component {
+export class PageListMeta extends React.Component {
 
   render() {
     const { page } = this.props;

+ 2 - 4
packages/app/src/components/PageList/PagePathLabel.jsx → packages/ui/src/components/PagePath/PagePathLabel.jsx

@@ -1,9 +1,9 @@
 import React from 'react';
 import PropTypes from 'prop-types';
 
-import DevidedPagePath from '~/models/devided-page-path';
+import { DevidedPagePath } from '@growi/core';
 
-const PagePathLabel = (props) => {
+export const PagePathLabel = (props) => {
 
   const dPagePath = new DevidedPagePath(props.page.path, false, true);
 
@@ -30,5 +30,3 @@ PagePathLabel.propTypes = {
 PagePathLabel.defaultProps = {
   additionalClassNames: [],
 };
-
-export default PagePathLabel;

+ 2 - 0
packages/ui/src/index.ts

@@ -1,2 +1,4 @@
 export * from './components/Attachment/Attachment';
+export * from './components/PagePath/PageListMeta';
+export * from './components/PagePath/PagePathLabel';
 export * from './components/User/UserPicture';