Przeglądaj źródła

fix import lines for @growi/ui

Yuki Takei 3 lat temu
rodzic
commit
5d0bba11df
34 zmienionych plików z 62 dodań i 45 usunięć
  1. 17 1
      apps/app/src/client/services/activate-plugin.ts
  2. 1 15
      apps/app/src/client/services/renderer/renderer.tsx
  3. 1 1
      apps/app/src/components/Admin/AuditLog/ActivityTable.tsx
  4. 1 1
      apps/app/src/components/Admin/UserGroupDetail/UserGroupUserFormByInput.jsx
  5. 1 1
      apps/app/src/components/Admin/UserGroupDetail/UserGroupUserTable.tsx
  6. 1 1
      apps/app/src/components/Admin/Users/UserTable.tsx
  7. 1 1
      apps/app/src/components/InAppNotification/InAppNotificationElm.tsx
  8. 1 1
      apps/app/src/components/InAppNotification/PageNotification/PageModelNotification.tsx
  9. 1 1
      apps/app/src/components/Navbar/AuthorInfo.tsx
  10. 1 1
      apps/app/src/components/Navbar/PersonalDropdown.jsx
  11. 1 1
      apps/app/src/components/PageAlert/TrashPageAlert.tsx
  12. 1 1
      apps/app/src/components/PageAttachment/DeleteAttachmentModal.tsx
  13. 1 1
      apps/app/src/components/PageAttachment/PageAttachmentList.tsx
  14. 1 1
      apps/app/src/components/PageComment/Comment.tsx
  15. 1 1
      apps/app/src/components/PageComment/CommentEditor.tsx
  16. 1 1
      apps/app/src/components/PageComment/DeleteCommentModal.tsx
  17. 1 1
      apps/app/src/components/PageEditor/ConflictDiffModal.tsx
  18. 1 1
      apps/app/src/components/PageHistory/Revision.tsx
  19. 2 1
      apps/app/src/components/PageList/PageListItemL.tsx
  20. 3 1
      apps/app/src/components/PageList/PageListItemS.tsx
  21. 1 1
      apps/app/src/components/PagePresentationModal.tsx
  22. 3 1
      apps/app/src/components/SearchTypeahead.tsx
  23. 2 1
      apps/app/src/components/Sidebar/RecentChanges.tsx
  24. 1 1
      apps/app/src/components/User/SeenUserInfo.tsx
  25. 1 1
      apps/app/src/components/User/UserInfo.tsx
  26. 1 1
      apps/app/src/components/User/UserPictureList.jsx
  27. 2 1
      apps/app/src/stores/ui.tsx
  28. 2 0
      apps/app/src/styles/style-app.scss
  29. 1 1
      apps/app/tsconfig.build.client.json
  30. 1 1
      apps/app/tsconfig.json
  31. 1 1
      packages-obsolete/plugin-attachment-refs/src/client/js/components/AttachmentList.jsx
  32. 2 1
      packages/remark-lsx/src/components/LsxPageList/LsxPage.tsx
  33. 1 0
      packages/remark-lsx/vite.client.config.ts
  34. 4 0
      turbo.json

+ 17 - 1
apps/app/src/client/services/activate-plugin.ts

@@ -1,6 +1,10 @@
-import { initializeGrowiFacade } from '~/utils/growi-facade';
+import { isClient } from '@growi/core/dist/utils/browser-utils';
+
+import { initializeGrowiFacade, registerGrowiFacade } from '~/utils/growi-facade';
 import loggerFactory from '~/utils/logger';
 
+import { generateViewOptions, generatePreviewOptions } from './renderer/renderer';
+
 
 declare global {
   // eslint-disable-next-line vars-on-top, no-var
@@ -32,3 +36,15 @@ export class ActivatePluginService {
   }
 
 }
+
+// register to facade
+if (isClient()) {
+  registerGrowiFacade({
+    markdownRenderer: {
+      optionsGenerators: {
+        generateViewOptions,
+        generatePreviewOptions,
+      },
+    },
+  });
+}

+ 1 - 15
apps/app/src/client/services/renderer/renderer.tsx

@@ -1,6 +1,5 @@
 import assert from 'assert';
 
-import { isClient } from '@growi/core';
 import * as drawioPlugin from '@growi/remark-drawio';
 // eslint-disable-next-line import/extensions
 import * as lsxGrowiPlugin from '@growi/remark-lsx/dist/client/index.mjs';
@@ -30,7 +29,6 @@ import * as xsvToTable from '~/services/renderer/remark-plugins/xsv-to-table';
 import {
   commonSanitizeOption, generateCommonOptions, injectCustomSanitizeOption, verifySanitizePlugin,
 } from '~/services/renderer/renderer';
-import { registerGrowiFacade } from '~/utils/growi-facade';
 import loggerFactory from '~/utils/logger';
 
 // import EasyGrid from './PreProcessor/EasyGrid';
@@ -40,7 +38,7 @@ import loggerFactory from '~/utils/logger';
 const logger = loggerFactory('growi:cli:services:renderer');
 
 
-assert(isClient(), 'This module must be loaded only from client modules.');
+// assert(isClient(), 'This module must be loaded only from client modules.');
 
 
 export const generateViewOptions = (
@@ -259,15 +257,3 @@ export const generatePreviewOptions = (config: RendererConfig, pagePath: string)
   }
   return options;
 };
-
-// register to facade
-if (isClient()) {
-  registerGrowiFacade({
-    markdownRenderer: {
-      optionsGenerators: {
-        generateViewOptions,
-        generatePreviewOptions,
-      },
-    },
-  });
-}

+ 1 - 1
apps/app/src/components/Admin/AuditLog/ActivityTable.tsx

@@ -1,7 +1,7 @@
 import React, { FC, useState, useCallback } from 'react';
 
 import { pagePathUtils } from '@growi/core';
-import { UserPicture } from '@growi/ui';
+import { UserPicture } from '@growi/ui/dist/components/User/UserPicture';
 import { format } from 'date-fns';
 import { CopyToClipboard } from 'react-copy-to-clipboard';
 import { useTranslation } from 'react-i18next';

+ 1 - 1
apps/app/src/components/Admin/UserGroupDetail/UserGroupUserFormByInput.jsx

@@ -1,6 +1,6 @@
 import React from 'react';
 
-import { UserPicture } from '@growi/ui';
+import { UserPicture } from '@growi/ui/dist/components/User/UserPicture';
 import { useTranslation } from 'next-i18next';
 import PropTypes from 'prop-types';
 import { AsyncTypeahead } from 'react-bootstrap-typeahead';

+ 1 - 1
apps/app/src/components/Admin/UserGroupDetail/UserGroupUserTable.tsx

@@ -1,6 +1,6 @@
 import React from 'react';
 
-import { UserPicture } from '@growi/ui';
+import { UserPicture } from '@growi/ui/dist/components/User/UserPicture';
 import dateFnsFormat from 'date-fns/format';
 import { useTranslation } from 'next-i18next';
 

+ 1 - 1
apps/app/src/components/Admin/Users/UserTable.tsx

@@ -1,7 +1,7 @@
 import React, { useCallback } from 'react';
 
 import type { IUserHasId } from '@growi/core';
-import { UserPicture } from '@growi/ui';
+import { UserPicture } from '@growi/ui/dist/components/User/UserPicture';
 import dateFnsFormat from 'date-fns/format';
 import { useTranslation } from 'next-i18next';
 

+ 1 - 1
apps/app/src/components/InAppNotification/InAppNotificationElm.tsx

@@ -3,7 +3,7 @@ import React, {
 } from 'react';
 
 import { HasObjectId } from '@growi/core';
-import { UserPicture } from '@growi/ui';
+import { UserPicture } from '@growi/ui/dist/components/User/UserPicture';
 import { DropdownItem } from 'reactstrap';
 
 import { IInAppNotificationOpenable } from '~/client/interfaces/in-app-notification-openable';

+ 1 - 1
apps/app/src/components/InAppNotification/PageNotification/PageModelNotification.tsx

@@ -3,7 +3,7 @@ import React, {
 } from 'react';
 
 import { HasObjectId } from '@growi/core';
-import { PagePathLabel } from '@growi/ui';
+import { PagePathLabel } from '@growi/ui/dist/components/PagePath/PagePathLabel';
 import { useRouter } from 'next/router';
 
 import type { IInAppNotificationOpenable } from '~/client/interfaces/in-app-notification-openable';

+ 1 - 1
apps/app/src/components/Navbar/AuthorInfo.tsx

@@ -2,7 +2,7 @@ import React from 'react';
 
 import { pagePathUtils } from '@growi/core';
 import type { IUser } from '@growi/core';
-import { UserPicture } from '@growi/ui';
+import { UserPicture } from '@growi/ui/dist/components/User/UserPicture';
 import { format } from 'date-fns';
 import Link from 'next/link';
 

+ 1 - 1
apps/app/src/components/Navbar/PersonalDropdown.jsx

@@ -1,6 +1,6 @@
 import React, { useRef } from 'react';
 
-import { UserPicture } from '@growi/ui';
+import { UserPicture } from '@growi/ui/dist/components/User/UserPicture';
 import { useTranslation } from 'next-i18next';
 import Link from 'next/link';
 import { useRipple } from 'react-use-ripple';

+ 1 - 1
apps/app/src/components/PageAlert/TrashPageAlert.tsx

@@ -1,6 +1,6 @@
 import React, { useCallback } from 'react';
 
-import { UserPicture } from '@growi/ui';
+import { UserPicture } from '@growi/ui/dist/components/User/UserPicture';
 import { format } from 'date-fns';
 import { useRouter } from 'next/router';
 import { useTranslation } from 'react-i18next';

+ 1 - 1
apps/app/src/components/PageAttachment/DeleteAttachmentModal.tsx

@@ -2,7 +2,7 @@
 import React, { useCallback } from 'react';
 
 import { HasObjectId, IAttachment } from '@growi/core';
-import { UserPicture } from '@growi/ui';
+import { UserPicture } from '@growi/ui/dist/components/User/UserPicture';
 import {
   Button,
   Modal, ModalHeader, ModalBody, ModalFooter,

+ 1 - 1
apps/app/src/components/PageAttachment/PageAttachmentList.tsx

@@ -1,7 +1,7 @@
 import React from 'react';
 
 import { HasObjectId, IAttachment } from '@growi/core';
-import { Attachment } from '@growi/ui';
+import { Attachment } from '@growi/ui/dist/components/Attachment';
 import { useTranslation } from 'next-i18next';
 
 type Props = {

+ 1 - 1
apps/app/src/components/PageComment/Comment.tsx

@@ -1,7 +1,7 @@
 import React, { useEffect, useMemo, useState } from 'react';
 
 import { IUser, pathUtils } from '@growi/core';
-import { UserPicture } from '@growi/ui';
+import { UserPicture } from '@growi/ui/dist/components/User/UserPicture';
 import { format, parseISO } from 'date-fns';
 import { useTranslation } from 'next-i18next';
 import Link from 'next/link';

+ 1 - 1
apps/app/src/components/PageComment/CommentEditor.tsx

@@ -2,7 +2,7 @@ import React, {
   useCallback, useState, useRef, useEffect,
 } from 'react';
 
-import { UserPicture } from '@growi/ui';
+import { UserPicture } from '@growi/ui/dist/components/User/UserPicture';
 import dynamic from 'next/dynamic';
 import {
   Button, TabContent, TabPane,

+ 1 - 1
apps/app/src/components/PageComment/DeleteCommentModal.tsx

@@ -1,6 +1,6 @@
 import React from 'react';
 
-import { UserPicture } from '@growi/ui';
+import { UserPicture } from '@growi/ui/dist/components/User/UserPicture';
 import { format } from 'date-fns';
 import {
   Button, Modal, ModalHeader, ModalBody, ModalFooter,

+ 1 - 1
apps/app/src/components/PageEditor/ConflictDiffModal.tsx

@@ -2,7 +2,7 @@ import React, {
   useState, useEffect, useRef, useMemo, useCallback,
 } from 'react';
 
-import { UserPicture } from '@growi/ui';
+import { UserPicture } from '@growi/ui/dist/components/User/UserPicture';
 import CodeMirror from 'codemirror/lib/codemirror';
 import { format, parseISO } from 'date-fns';
 import { useTranslation } from 'next-i18next';

+ 1 - 1
apps/app/src/components/PageHistory/Revision.tsx

@@ -1,7 +1,7 @@
 import React from 'react';
 
 import { IRevisionHasId, pathUtils } from '@growi/core';
-import { UserPicture } from '@growi/ui';
+import { UserPicture } from '@growi/ui/dist/components/User/UserPicture';
 import { useTranslation } from 'next-i18next';
 import Link from 'next/link';
 import urljoin from 'url-join';

+ 2 - 1
apps/app/src/components/PageList/PageListItemL.tsx

@@ -5,7 +5,8 @@ import React, {
 
 
 import { DevidedPagePath, pathUtils } from '@growi/core';
-import { UserPicture, PageListMeta } from '@growi/ui';
+import { PageListMeta } from '@growi/ui/dist/components/PagePath/PageListMeta';
+import { UserPicture } from '@growi/ui/dist/components/User/UserPicture';
 import { format } from 'date-fns';
 import { useTranslation } from 'next-i18next';
 import Link from 'next/link';

+ 3 - 1
apps/app/src/components/PageList/PageListItemS.tsx

@@ -1,6 +1,8 @@
 import React from 'react';
 
-import { UserPicture, PageListMeta, PagePathLabel } from '@growi/ui';
+import { PageListMeta } from '@growi/ui/dist/components/PagePath/PageListMeta';
+import { PagePathLabel } from '@growi/ui/dist/components/PagePath/PagePathLabel';
+import { UserPicture } from '@growi/ui/dist/components/User/UserPicture';
 
 import { IPageHasId } from '~/interfaces/page';
 

+ 1 - 1
apps/app/src/components/PagePresentationModal.tsx

@@ -1,7 +1,7 @@
 import React, { useCallback } from 'react';
 
 import type { PresentationProps } from '@growi/presentation';
-import { useFullScreen } from '@growi/ui';
+import { useFullScreen } from '@growi/ui/dist/utils';
 import dynamic from 'next/dynamic';
 import type { ReactMarkdownOptions } from 'react-markdown/lib/react-markdown';
 import {

+ 3 - 1
apps/app/src/components/SearchTypeahead.tsx

@@ -3,7 +3,9 @@ import React, {
   KeyboardEvent, useCallback, useRef, useState, MouseEvent, useEffect,
 } from 'react';
 
-import { UserPicture, PageListMeta, PagePathLabel } from '@growi/ui';
+import { PageListMeta } from '@growi/ui/dist/components/PagePath/PageListMeta';
+import { PagePathLabel } from '@growi/ui/dist/components/PagePath/PagePathLabel';
+import { UserPicture } from '@growi/ui/dist/components/User/UserPicture';
 import { AsyncTypeahead, Menu, MenuItem } from 'react-bootstrap-typeahead';
 
 import { IFocusable } from '~/client/interfaces/focusable';

+ 2 - 1
apps/app/src/components/Sidebar/RecentChanges.tsx

@@ -3,7 +3,8 @@ import React, {
 } from 'react';
 
 import { DevidedPagePath, isPopulated } from '@growi/core';
-import { UserPicture, FootstampIcon } from '@growi/ui';
+import { FootstampIcon } from '@growi/ui/dist/components/FootstampIcon';
+import { UserPicture } from '@growi/ui/dist/components/User/UserPicture';
 import { useTranslation } from 'next-i18next';
 import Link from 'next/link';
 

+ 1 - 1
apps/app/src/components/User/SeenUserInfo.tsx

@@ -1,6 +1,6 @@
 import React, { FC, useState } from 'react';
 
-import { FootstampIcon } from '@growi/ui';
+import { FootstampIcon } from '@growi/ui/dist/components/FootstampIcon';
 import { useTranslation } from 'next-i18next';
 import { UncontrolledTooltip, Popover, PopoverBody } from 'reactstrap';
 

+ 1 - 1
apps/app/src/components/User/UserInfo.tsx

@@ -1,7 +1,7 @@
 import React from 'react';
 
 import type { IUserHasId } from '@growi/core';
-import { UserPicture } from '@growi/ui';
+import { UserPicture } from '@growi/ui/dist/components/User/UserPicture';
 
 import styles from './UserInfo.module.scss';
 

+ 1 - 1
apps/app/src/components/User/UserPictureList.jsx

@@ -1,7 +1,7 @@
 import React from 'react';
 import PropTypes from 'prop-types';
 
-import { UserPicture } from '@growi/ui';
+import { UserPicture } from '@growi/ui/dist/components/User/UserPicture';
 
 export default class UserPictureList extends React.Component {
 

+ 2 - 1
apps/app/src/stores/ui.tsx

@@ -4,7 +4,8 @@ import {
   isClient, isServer, pagePathUtils, PageGrant, withUtils,
 } from '@growi/core';
 import type { Nullable, SWRResponseWithUtils } from '@growi/core';
-import { Breakpoint, addBreakpointListener, cleanupBreakpointListener } from '@growi/ui';
+import { Breakpoint } from '@growi/ui/dist/interfaces/breakpoints';
+import { addBreakpointListener, cleanupBreakpointListener } from '@growi/ui/dist/utils';
 import type { HtmlElementNode } from 'rehype-toc';
 import type SimpleBar from 'simplebar-react';
 import {

+ 2 - 0
apps/app/src/styles/style-app.scss

@@ -16,6 +16,8 @@
 // KaTeX
 @import '~katex/dist/katex.min';
 
+@import '~@growi/remark-lsx/dist/client/style.css';
+
 // icons
 
 // DO NOT CHANGE THER OERDER OF font-awesome AND simple-line-icons.

+ 1 - 1
apps/app/tsconfig.build.client.json

@@ -19,7 +19,7 @@
       // "@growi/remark-lsx": ["../../packages/remark-lsx/src"],
       // "@growi/remark-lsx/*": ["../../packages/remark-lsx/src/*"],
       // "@growi/slack": ["../../packages/slack/src"],
-      "@growi/ui": ["../../packages/ui/src"],
+      // "@growi/ui": ["../../packages/ui/src"],
 
       "debug": ["./src/server/utils/logger/alias-for-debug"]
     }

+ 1 - 1
apps/app/tsconfig.json

@@ -19,7 +19,7 @@
       // "@growi/remark-lsx": ["../../packages/remark-lsx/src"],
       // "@growi/remark-lsx/*": ["../../packages/remark-lsx/src/*"],
       // "@growi/slack": ["../../packages/slack/src"],
-      "@growi/ui": ["../../packages/ui/src"],
+      // "@growi/ui": ["../../packages/ui/src"],
 
       "debug": ["./src/server/utils/logger/alias-for-debug"]
     }

+ 1 - 1
packages-obsolete/plugin-attachment-refs/src/client/js/components/AttachmentList.jsx

@@ -1,6 +1,6 @@
 import React from 'react';
 
-import { Attachment } from '@growi/ui';
+import { Attachment } from '@growi/ui/dist/components/Attachment';
 import axios from 'axios'; // import axios from growi dependencies
 import PropTypes from 'prop-types';
 

+ 2 - 1
packages/remark-lsx/src/components/LsxPageList/LsxPage.tsx

@@ -1,7 +1,8 @@
 import React, { useMemo } from 'react';
 
 import { pathUtils } from '@growi/core';
-import { PagePathLabel, PageListMeta } from '@growi/ui';
+import { PageListMeta } from '@growi/ui/dist/components/PagePath/PageListMeta';
+import { PagePathLabel } from '@growi/ui/dist/components/PagePath/PagePathLabel';
 import Link from 'next/link';
 
 import type { PageNode } from '../../interfaces/page-node';

+ 1 - 0
packages/remark-lsx/vite.client.config.ts

@@ -19,6 +19,7 @@ export default defineConfig({
     },
     rollupOptions: {
       external: [
+        'react', 'react-dom',
         'assert',
         'axios',
         'http-errors',

+ 4 - 0
turbo.json

@@ -32,6 +32,10 @@
       "outputs": ["tmp/cache/migration-status.out"],
       "inputs": ["src/migration/*.js"]
     },
+    "@growi/remark-lsx#dev": {
+      "dependsOn": ["@growi/core#dev", "@growi/remark-growi-directive#dev", "@growi/ui#dev"],
+      "outputs": ["dist/**", "types/**"]
+    },
     "@growi/app#dev": {
       "dependsOn": ["^dev", "@growi/app#dev:migrate"],
       "cache": false,