mirror of https://github.com/fantasticit/think.git
fix lint
This commit is contained in:
parent
4f89e8951e
commit
00b52c5e15
|
@ -54,7 +54,21 @@ module.exports = {
|
|||
'react/react-in-jsx-scope': 'off',
|
||||
'react/prop-types': 'off',
|
||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||
'simple-import-sort/imports': 'error',
|
||||
'simple-import-sort/imports': [
|
||||
'error',
|
||||
{
|
||||
groups: [
|
||||
['react'],
|
||||
['@douyinfe(.*)$'],
|
||||
['(@)?think(.*)$'],
|
||||
['(@)?tiptap(.*)$'],
|
||||
['^@?\\w'],
|
||||
['@/(.*)'],
|
||||
['^[./]'],
|
||||
['(.*).module.scss'],
|
||||
],
|
||||
},
|
||||
],
|
||||
'simple-import-sort/exports': 'error',
|
||||
},
|
||||
ignorePatterns: ['dist/', 'node_modules', 'scripts', 'examples'],
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { TabPane, Tabs } from '@douyinfe/semi-ui';
|
||||
import React from 'react';
|
||||
|
||||
import { TabPane, Tabs } from '@douyinfe/semi-ui';
|
||||
|
||||
import { Mail } from './mail';
|
||||
import { System } from './system';
|
||||
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
import React, { useCallback } from 'react';
|
||||
|
||||
import { Banner, Button, Form, Toast } from '@douyinfe/semi-ui';
|
||||
|
||||
import { DataRender } from 'components/data-render';
|
||||
import { useSystemConfig } from 'data/user';
|
||||
import { useToggle } from 'hooks/use-toggle';
|
||||
import React, { useCallback } from 'react';
|
||||
|
||||
export const Mail = () => {
|
||||
const { data, loading, error, sendTestEmail, updateSystemConfig } = useSystemConfig();
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
import React, { useCallback } from 'react';
|
||||
|
||||
import { IconHelpCircle } from '@douyinfe/semi-icons';
|
||||
import { Banner, Button, Form, Toast, Tooltip } from '@douyinfe/semi-ui';
|
||||
|
||||
import { DataRender } from 'components/data-render';
|
||||
import { useSystemConfig } from 'data/user';
|
||||
import { useToggle } from 'hooks/use-toggle';
|
||||
import React, { useCallback } from 'react';
|
||||
|
||||
export const System = () => {
|
||||
const { data, loading, error, updateSystemConfig } = useSystemConfig();
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
import React, { useEffect, useRef } from 'react';
|
||||
|
||||
import { IconClose } from '@douyinfe/semi-icons';
|
||||
import { Banner as SemiBanner } from '@douyinfe/semi-ui';
|
||||
import { BannerProps } from '@douyinfe/semi-ui/banner';
|
||||
|
||||
import { useToggle } from 'hooks/use-toggle';
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
|
||||
interface IProps extends BannerProps {
|
||||
duration?: number;
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import React, { useMemo } from 'react';
|
||||
|
||||
import { Dropdown, SideSheet, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { IsOnMobile } from 'hooks/use-on-mobile';
|
||||
import { useToggle } from 'hooks/use-toggle';
|
||||
import React, { useMemo } from 'react';
|
||||
|
||||
import styles from './style.module.scss';
|
||||
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import { Spin, Typography } from '@douyinfe/semi-ui';
|
||||
import { Empty } from 'illustrations/empty';
|
||||
import React, { useMemo } from 'react';
|
||||
|
||||
import { Spin, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { Empty } from 'illustrations/empty';
|
||||
|
||||
const { Text } = Typography;
|
||||
|
||||
export const defaultLoading = (
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import deepEqual from 'deep-equal';
|
||||
import React from 'react';
|
||||
|
||||
import deepEqual from 'deep-equal';
|
||||
|
||||
import { defaultEmpty, defaultLoading, defaultRenderError, Render } from './constant';
|
||||
import { LoadingWrap } from './loading';
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { useToggle } from 'hooks/use-toggle';
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
|
||||
import { useToggle } from 'hooks/use-toggle';
|
||||
|
||||
import { Render } from './constant';
|
||||
|
||||
export const LoadingWrap = ({ loading, delay = 200, loadingContent, normalContent }) => {
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
import React from 'react';
|
||||
|
||||
import { Button } from '@douyinfe/semi-ui';
|
||||
|
||||
import { DocumentCreator as DocumenCreatorForm } from 'components/document/create';
|
||||
import { useRouterQuery } from 'hooks/use-router-query';
|
||||
import { useToggle } from 'hooks/use-toggle';
|
||||
import React from 'react';
|
||||
|
||||
interface IProps {
|
||||
onCreateDocument?: () => void;
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
import React, { useCallback } from 'react';
|
||||
|
||||
import { IconArticle, IconBranch, IconExport, IconHistory, IconMore, IconPlus, IconStar } from '@douyinfe/semi-icons';
|
||||
import { Button, Dropdown, Space, Typography } from '@douyinfe/semi-ui';
|
||||
import { ButtonProps } from '@douyinfe/semi-ui/button/Button';
|
||||
|
||||
import { IDocument, IOrganization, IWiki } from '@think/domains';
|
||||
|
||||
import cls from 'classnames';
|
||||
import { DocumentCreator } from 'components/document/create';
|
||||
import { DocumentDeletor } from 'components/document/delete';
|
||||
|
@ -12,7 +16,6 @@ import { DocumentStar } from 'components/document/star';
|
|||
import { DocumentStyle } from 'components/document/style';
|
||||
import { DocumentVersionTrigger } from 'components/document/version';
|
||||
import { useToggle } from 'hooks/use-toggle';
|
||||
import React, { useCallback } from 'react';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
import { useCallback } from 'react';
|
||||
|
||||
import { IconEdit, IconUser } from '@douyinfe/semi-icons';
|
||||
import { Avatar, Button, Skeleton, Space, Tooltip, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import type { IDocument } from '@think/domains';
|
||||
|
||||
import { DocumentShare } from 'components/document/share';
|
||||
import { DocumentStar } from 'components/document/star';
|
||||
import { IconDocument } from 'components/icons/IconDocument';
|
||||
import { LocaleTime } from 'components/locale-time';
|
||||
import Link from 'next/link';
|
||||
import Router from 'next/router';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
|
||||
import { IconUserAdd } from '@douyinfe/semi-icons';
|
||||
import { Avatar, AvatarGroup, Button, Dropdown, Modal, Popover, Toast, Tooltip, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { Members } from 'components/members';
|
||||
import { useDoumentMembers } from 'data/document';
|
||||
import { useUser } from 'data/user';
|
||||
import { event, JOIN_USER } from 'event';
|
||||
import { IsOnMobile } from 'hooks/use-on-mobile';
|
||||
import { useToggle } from 'hooks/use-toggle';
|
||||
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
|
||||
interface IProps {
|
||||
wikiId: string;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import type { IComment } from '@think/domains';
|
||||
import React from 'react';
|
||||
|
||||
import type { IComment } from '@think/domains';
|
||||
|
||||
import { CommentItem } from './item';
|
||||
|
||||
interface IProps {
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
import React from 'react';
|
||||
|
||||
import { IconUser } from '@douyinfe/semi-icons';
|
||||
import { Avatar, Popconfirm, Skeleton, Space, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import type { IComment, IUser } from '@think/domains';
|
||||
|
||||
import { LocaleTime } from 'components/locale-time';
|
||||
import { useUser } from 'data/user';
|
||||
import React from 'react';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
||||
|
|
|
@ -1,13 +1,17 @@
|
|||
import React, { useCallback, useRef, useState } from 'react';
|
||||
|
||||
import { Avatar, Banner, Button, Pagination, Space, Spin, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { EditorContent, useEditor } from 'tiptap/core';
|
||||
import { CommentKit, CommentMenuBar } from 'tiptap/editor';
|
||||
|
||||
import { DataRender } from 'components/data-render';
|
||||
import { useComments } from 'data/comment';
|
||||
import { useUser } from 'data/user';
|
||||
import { useToggle } from 'hooks/use-toggle';
|
||||
import React, { useCallback, useRef, useState } from 'react';
|
||||
import { EditorContent, useEditor } from 'tiptap/core';
|
||||
import { CommentKit, CommentMenuBar } from 'tiptap/editor';
|
||||
|
||||
import { Comments } from './comments';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
||||
interface IProps {
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
import { Dispatch, SetStateAction, useCallback, useEffect, useState } from 'react';
|
||||
|
||||
import { Checkbox, Modal, TabPane, Tabs } from '@douyinfe/semi-ui';
|
||||
|
||||
import { IDocument, IWiki } from '@think/domains';
|
||||
|
||||
import { TemplateCardEmpty } from 'components/template/card';
|
||||
import { TemplateList } from 'components/template/list';
|
||||
import { useCreateDocument } from 'data/document';
|
||||
import { useOwnTemplates, usePublicTemplates } from 'data/template';
|
||||
import { useRouterQuery } from 'hooks/use-router-query';
|
||||
import Router from 'next/router';
|
||||
import { Dispatch, SetStateAction, useCallback, useEffect, useState } from 'react';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
import React, { useCallback, useMemo } from 'react';
|
||||
|
||||
import { IconDelete } from '@douyinfe/semi-icons';
|
||||
import { Popconfirm, Space, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { useDeleteDocument } from 'data/document';
|
||||
import { useRouterQuery } from 'hooks/use-router-query';
|
||||
import Router from 'next/router';
|
||||
import React, { useCallback, useMemo } from 'react';
|
||||
|
||||
interface IProps {
|
||||
wikiId: string;
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
import React, { useEffect, useRef } from 'react';
|
||||
|
||||
import { IAuthority, ILoginUser } from '@think/domains';
|
||||
|
||||
import { CollaborationEditor, ICollaborationRefProps } from 'tiptap/editor';
|
||||
|
||||
import cls from 'classnames';
|
||||
import { event, triggerChangeDocumentTitle, triggerJoinUser, USE_DOCUMENT_VERSION } from 'event';
|
||||
import { useMount } from 'hooks/use-mount';
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
import { CollaborationEditor, ICollaborationRefProps } from 'tiptap/editor';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
|
||||
import { IconChevronLeft } from '@douyinfe/semi-icons';
|
||||
import { Button, Nav, Skeleton, Space, Tooltip, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { DataRender } from 'components/data-render';
|
||||
import { Divider } from 'components/divider';
|
||||
import { DocumentCollaboration } from 'components/document/collaboration';
|
||||
|
@ -16,10 +19,10 @@ import { IsOnMobile } from 'hooks/use-on-mobile';
|
|||
import { useWindowSize } from 'hooks/use-window-size';
|
||||
import { SecureDocumentIllustration } from 'illustrations/secure-document';
|
||||
import Router from 'next/router';
|
||||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
|
||||
import { DocumentActions } from '../actions';
|
||||
import { Editor } from './editor';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
||||
const { Text } = Typography;
|
||||
|
|
|
@ -1,18 +1,23 @@
|
|||
import React, { useCallback, useEffect, useMemo } from 'react';
|
||||
|
||||
import { Badge, Button, Dropdown, Modal, Space, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { IDocument } from '@think/domains';
|
||||
|
||||
import { createEditor } from 'tiptap/core';
|
||||
import { AllExtensions } from 'tiptap/core/all-kit';
|
||||
import { prosemirrorToMarkdown } from 'tiptap/markdown/prosemirror-to-markdown';
|
||||
|
||||
import { IconJSON, IconMarkdown, IconPDF, IconWord } from 'components/icons';
|
||||
import { useDocumentDetail } from 'data/document';
|
||||
import FileSaver from 'file-saver';
|
||||
import { safeJSONParse, safeJSONStringify } from 'helpers/json';
|
||||
import { IsOnMobile } from 'hooks/use-on-mobile';
|
||||
import { useToggle } from 'hooks/use-toggle';
|
||||
import React, { useCallback, useEffect, useMemo } from 'react';
|
||||
import { createEditor } from 'tiptap/core';
|
||||
import { AllExtensions } from 'tiptap/core/all-kit';
|
||||
import { prosemirrorToMarkdown } from 'tiptap/markdown/prosemirror-to-markdown';
|
||||
|
||||
import { printEditorContent } from './pdf';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
import { printEditorContent } from './pdf';
|
||||
|
||||
const { Text } = Typography;
|
||||
|
||||
|
|
|
@ -1,15 +1,18 @@
|
|||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { FullScreen, useFullScreenHandle } from 'react-full-screen';
|
||||
|
||||
import { IconShrinkScreenStroked } from '@douyinfe/semi-icons';
|
||||
import { Button, Space, Tooltip, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { EditorContent, useEditor } from '@tiptap/react';
|
||||
import { CollaborationKit, Document } from 'tiptap/editor';
|
||||
|
||||
import cls from 'classnames';
|
||||
import { IconFullscreen } from 'components/icons/IconFullscreen';
|
||||
import { IconPencil } from 'components/icons/IconPencil';
|
||||
import { safeJSONParse } from 'helpers/json';
|
||||
import { useDrawingCursor } from 'hooks/use-cursor';
|
||||
import { useToggle } from 'hooks/use-toggle';
|
||||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { FullScreen, useFullScreenHandle } from 'react-full-screen';
|
||||
import { CollaborationKit, Document } from 'tiptap/editor';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
import React, { useCallback } from 'react';
|
||||
|
||||
import { IconLink } from '@douyinfe/semi-icons';
|
||||
import { Space, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { IDocument, IOrganization, IWiki } from '@think/domains';
|
||||
|
||||
import { copy } from 'helpers/copy';
|
||||
import { buildUrl } from 'helpers/url';
|
||||
import React, { useCallback } from 'react';
|
||||
|
||||
interface IProps {
|
||||
organizationId: IOrganization['id'];
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
import React from 'react';
|
||||
|
||||
import { IconUser } from '@douyinfe/semi-icons';
|
||||
import { Avatar, Space } from '@douyinfe/semi-ui';
|
||||
|
||||
import { IDocument } from '@think/domains';
|
||||
|
||||
import { LocaleTime } from 'components/locale-time';
|
||||
import React from 'react';
|
||||
|
||||
interface IProps {
|
||||
document: IDocument;
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
import React, { useCallback, useMemo } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
|
||||
import { IconEdit } from '@douyinfe/semi-icons';
|
||||
import { Button, Layout, Nav, Skeleton, Space, Spin, Tooltip, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { CollaborationEditor } from 'tiptap/editor';
|
||||
|
||||
import { DataRender } from 'components/data-render';
|
||||
import { DocumentCollaboration } from 'components/document/collaboration';
|
||||
import { DocumentStar } from 'components/document/star';
|
||||
|
@ -13,13 +19,11 @@ import { useMount } from 'hooks/use-mount';
|
|||
import { IsOnMobile } from 'hooks/use-on-mobile';
|
||||
import { useWindowSize } from 'hooks/use-window-size';
|
||||
import Router from 'next/router';
|
||||
import React, { useCallback, useMemo } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
import { CollaborationEditor } from 'tiptap/editor';
|
||||
|
||||
import { DocumentActions } from '../actions';
|
||||
import { DocumentFullscreen } from '../fullscreen';
|
||||
import { Author } from './author';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
||||
const { Header } = Layout;
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
|
||||
import { IconLink } from '@douyinfe/semi-icons';
|
||||
import { Button, Dropdown, Input, Modal, Space, Toast, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { isPublicDocument } from '@think/domains';
|
||||
|
||||
import { useDocumentDetail } from 'data/document';
|
||||
import { getDocumentShareURL } from 'helpers/url';
|
||||
import { IsOnMobile } from 'hooks/use-on-mobile';
|
||||
import { useToggle } from 'hooks/use-toggle';
|
||||
import { ShareIllustration } from 'illustrations/share';
|
||||
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
|
||||
interface IProps {
|
||||
documentId: string;
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
import { IconStar } from '@douyinfe/semi-icons';
|
||||
import { Button, Tooltip } from '@douyinfe/semi-ui';
|
||||
import { IDocument, IOrganization, IWiki } from '@think/domains';
|
||||
import { useDocumentStarToggle } from 'data/star';
|
||||
import { useToggle } from 'hooks/use-toggle';
|
||||
import React, { useCallback } from 'react';
|
||||
import VisibilitySensor from 'react-visibility-sensor';
|
||||
|
||||
import { IconStar } from '@douyinfe/semi-icons';
|
||||
import { Button, Tooltip } from '@douyinfe/semi-ui';
|
||||
|
||||
import { IDocument, IOrganization, IWiki } from '@think/domains';
|
||||
|
||||
import { useDocumentStarToggle } from 'data/star';
|
||||
import { useToggle } from 'hooks/use-toggle';
|
||||
|
||||
interface IProps {
|
||||
organizationId: IOrganization['id'];
|
||||
wikiId: IWiki['id'];
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
import React, { useMemo } from 'react';
|
||||
|
||||
import { IconArticle } from '@douyinfe/semi-icons';
|
||||
import { Button, Dropdown, Radio, RadioGroup, Slider, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { throttle } from 'helpers/throttle';
|
||||
import { useDocumentStyle } from 'hooks/use-document-style';
|
||||
import { IsOnMobile } from 'hooks/use-on-mobile';
|
||||
import { useToggle } from 'hooks/use-toggle';
|
||||
import React, { useMemo } from 'react';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
|
||||
import { IconChevronLeft } from '@douyinfe/semi-icons';
|
||||
import { Button, Modal, Select, Space, Tag, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { EditorContent, useEditor } from '@tiptap/react';
|
||||
import { CollaborationKit } from 'tiptap/editor';
|
||||
|
||||
import cls from 'classnames';
|
||||
import { DataRender } from 'components/data-render';
|
||||
import { LocaleTime } from 'components/locale-time';
|
||||
|
@ -9,8 +14,6 @@ import { generateDiffHtml } from 'helpers/generate-html';
|
|||
import { safeJSONParse } from 'helpers/json';
|
||||
import { DocumentVersionControl } from 'hooks/use-document-version';
|
||||
import { IsOnMobile } from 'hooks/use-on-mobile';
|
||||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import { CollaborationKit } from 'tiptap/editor';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
|
||||
import { Button, Popover, SideSheet, TabPane, Tabs } from '@douyinfe/semi-ui';
|
||||
|
||||
import { createKeysLocalStorageLRUCache } from 'helpers/lru-cache';
|
||||
import { IsOnMobile } from 'hooks/use-on-mobile';
|
||||
import { useToggle } from 'hooks/use-toggle';
|
||||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
|
||||
import { ACTIVITIES, EXPRESSIONES, GESTURES, OBJECTS, SKY_WEATHER, SYMBOLS } from './constants';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
||||
const emojiLocalStorageLRUCache = createKeysLocalStorageLRUCache('EMOJI_PICKER', 20);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { Typography } from '@douyinfe/semi-ui';
|
||||
import React from 'react';
|
||||
|
||||
import { Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
interface IProps {
|
||||
illustration?: React.ReactNode;
|
||||
message: React.ReactNode;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { Typography } from '@douyinfe/semi-ui';
|
||||
import React, { useCallback, useMemo, useState } from 'react';
|
||||
|
||||
import { Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { GridCell } from './grid-cell';
|
||||
|
||||
const { Text } = Typography;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { Icon } from '@douyinfe/semi-ui';
|
||||
import React from 'react';
|
||||
|
||||
import { Icon } from '@douyinfe/semi-ui';
|
||||
|
||||
export const IconDocument: React.FC<{ style?: React.CSSProperties }> = ({ style = {} }) => {
|
||||
return (
|
||||
<Icon
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { Icon } from '@douyinfe/semi-ui';
|
||||
import React from 'react';
|
||||
|
||||
import { Icon } from '@douyinfe/semi-ui';
|
||||
|
||||
export const IconDocumentFill: React.FC<{ style?: React.CSSProperties }> = ({ style = {} }) => {
|
||||
return (
|
||||
<Icon
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { Icon } from '@douyinfe/semi-ui';
|
||||
import React from 'react';
|
||||
|
||||
import { Icon } from '@douyinfe/semi-ui';
|
||||
|
||||
export const IconMessage: React.FC<{ style?: React.CSSProperties }> = ({ style = {} }) => {
|
||||
return (
|
||||
<Icon
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { Icon } from '@douyinfe/semi-ui';
|
||||
import React from 'react';
|
||||
|
||||
import { Icon } from '@douyinfe/semi-ui';
|
||||
|
||||
export const IconOverview: React.FC<{ style?: React.CSSProperties }> = ({ style = {} }) => {
|
||||
return (
|
||||
<Icon
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { Icon } from '@douyinfe/semi-ui';
|
||||
import React from 'react';
|
||||
|
||||
import { Icon } from '@douyinfe/semi-ui';
|
||||
|
||||
export const IconSearch: React.FC<{ style?: React.CSSProperties }> = ({ style = {} }) => {
|
||||
return (
|
||||
<Icon
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { Icon } from '@douyinfe/semi-ui';
|
||||
import React from 'react';
|
||||
|
||||
import { Icon } from '@douyinfe/semi-ui';
|
||||
|
||||
export const IconSetting: React.FC<{ style?: React.CSSProperties }> = ({ style = {} }) => {
|
||||
return (
|
||||
<Icon
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { Icon } from '@douyinfe/semi-ui';
|
||||
import React from 'react';
|
||||
|
||||
import { Icon } from '@douyinfe/semi-ui';
|
||||
|
||||
export const IconShare: React.FC<{ style?: React.CSSProperties }> = ({ style = {} }) => {
|
||||
return (
|
||||
<Icon
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
import React, { useCallback, useMemo, useState } from 'react';
|
||||
import { LazyLoadImage } from 'react-lazy-load-image-component';
|
||||
|
||||
import { Button, ButtonGroup, Col, Popover, Row, SideSheet, Skeleton, Space, TabPane, Tabs } from '@douyinfe/semi-ui';
|
||||
|
||||
import { Upload } from 'components/upload';
|
||||
import { chunk } from 'helpers/chunk';
|
||||
import { IsOnMobile } from 'hooks/use-on-mobile';
|
||||
import { useToggle } from 'hooks/use-toggle';
|
||||
import React, { useCallback, useMemo, useState } from 'react';
|
||||
import { LazyLoadImage } from 'react-lazy-load-image-component';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { useEffect } from 'react';
|
||||
|
||||
import Viewer from 'viewerjs';
|
||||
|
||||
interface IProps {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
||||
|
||||
import * as timeagojs from 'timeago.js';
|
||||
|
||||
type Props = {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import Link from 'next/link';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import { Banner, Input, Popconfirm, Select, Space } from '@douyinfe/semi-ui';
|
||||
import { AuthEnum, AuthEnumArray } from '@think/domains';
|
||||
import React, { useCallback, useState } from 'react';
|
||||
|
||||
import { Banner, Input, Popconfirm, Select, Space } from '@douyinfe/semi-ui';
|
||||
|
||||
import { AuthEnum, AuthEnumArray } from '@think/domains';
|
||||
|
||||
interface IProps {
|
||||
onOk: (arg) => any;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import { Banner, Popconfirm, Select, Toast } from '@douyinfe/semi-ui';
|
||||
import { AuthEnum, AuthEnumArray, IAuth, IUser } from '@think/domains';
|
||||
import React, { useCallback, useState } from 'react';
|
||||
|
||||
import { Banner, Popconfirm, Select, Toast } from '@douyinfe/semi-ui';
|
||||
|
||||
import { AuthEnum, AuthEnumArray, IAuth, IUser } from '@think/domains';
|
||||
|
||||
interface IProps {
|
||||
userWithAuth: { user: IUser; auth: IAuth };
|
||||
updateUser: (arg) => any;
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
import React from 'react';
|
||||
|
||||
import { IconDelete, IconEdit } from '@douyinfe/semi-icons';
|
||||
import { Banner, Button, Popconfirm, Table, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { AuthEnumTextMap } from '@think/domains';
|
||||
|
||||
import { DataRender } from 'components/data-render';
|
||||
import { LocaleTime } from 'components/locale-time';
|
||||
import React from 'react';
|
||||
|
||||
import { AddUser } from './add';
|
||||
import { EditUser } from './edit';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
||||
interface IProps {
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
import React, { useCallback, useMemo } from 'react';
|
||||
|
||||
import { Badge, Button, Dropdown, Modal, Pagination, TabPane, Tabs, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { DataRender } from 'components/data-render';
|
||||
import { Empty } from 'components/empty';
|
||||
import { IconMessage } from 'components/icons/IconMessage';
|
||||
|
@ -8,10 +11,10 @@ import { IsOnMobile } from 'hooks/use-on-mobile';
|
|||
import { useToggle } from 'hooks/use-toggle';
|
||||
import { EmptyBoxIllustration } from 'illustrations/empty-box';
|
||||
import Link from 'next/link';
|
||||
import React, { useCallback, useMemo } from 'react';
|
||||
|
||||
import { Placeholder } from './placeholder';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
import { Placeholder } from './placeholder';
|
||||
|
||||
const { Text } = Typography;
|
||||
const PAGE_SIZE = 6;
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
import React, { useCallback } from 'react';
|
||||
|
||||
import { IconDelete } from '@douyinfe/semi-icons';
|
||||
import { Modal, Space, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { IOrganization } from '@think/domains';
|
||||
|
||||
import { useOrganizationDetail } from 'data/organization';
|
||||
import { useRouterQuery } from 'hooks/use-router-query';
|
||||
import Router from 'next/router';
|
||||
import React, { useCallback } from 'react';
|
||||
|
||||
interface IProps {
|
||||
organizationId: IOrganization['id'];
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { Typography } from '@douyinfe/semi-ui';
|
||||
import { Avatar } from '@douyinfe/semi-ui';
|
||||
|
||||
import { DataRender } from 'components/data-render';
|
||||
import { useOrganizationDetail } from 'data/organization';
|
||||
import { useRouterQuery } from 'hooks/use-router-query';
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
import { Space } from '@douyinfe/semi-ui';
|
||||
|
||||
import { LogoImage, LogoText } from 'components/logo';
|
||||
import { useUser } from 'data/user';
|
||||
import { useWindowSize } from 'hooks/use-window-size';
|
||||
|
||||
import { UserOrganizationsSwitcher } from '../switcher';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
||||
export const OrganizationPublicSwitcher = () => {
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
|
||||
import { Avatar, Button, Form, Toast } from '@douyinfe/semi-ui';
|
||||
import { FormApi } from '@douyinfe/semi-ui/lib/es/form';
|
||||
|
||||
import { ORGANIZATION_LOGOS } from '@think/constants';
|
||||
import { IOrganization } from '@think/domains';
|
||||
|
||||
import { DataRender } from 'components/data-render';
|
||||
import { ImageUploader } from 'components/image-uploader';
|
||||
import { useOrganizationDetail } from 'data/organization';
|
||||
import { useToggle } from 'hooks/use-toggle';
|
||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
import { TabPane, Tabs } from '@douyinfe/semi-ui';
|
||||
import { IOrganization } from '@think/domains';
|
||||
import { Seo } from 'components/seo';
|
||||
import React from 'react';
|
||||
|
||||
import { TabPane, Tabs } from '@douyinfe/semi-ui';
|
||||
|
||||
import { IOrganization } from '@think/domains';
|
||||
|
||||
import { Seo } from 'components/seo';
|
||||
|
||||
import { Base } from './base';
|
||||
import { OrganizationMembers } from './members';
|
||||
import { More } from './more';
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import React from 'react';
|
||||
|
||||
import { IOrganization } from '@think/domains';
|
||||
|
||||
import { Members } from 'components/members';
|
||||
import { useOrganizationMembers } from 'data/organization';
|
||||
import React from 'react';
|
||||
|
||||
interface IProps {
|
||||
organizationId: IOrganization['id'];
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { Banner, Button, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { OrganizationDeletor } from 'components/organization/delete';
|
||||
|
||||
const { Paragraph } = Typography;
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
import { useMemo } from 'react';
|
||||
|
||||
import { IconAppCenter, IconApps, IconSmallTriangleDown } from '@douyinfe/semi-icons';
|
||||
import { Button, Dropdown, Space, Typography } from '@douyinfe/semi-ui';
|
||||
import { Avatar } from '@douyinfe/semi-ui';
|
||||
|
||||
import { DataRender } from 'components/data-render';
|
||||
import { useOrganizationDetail, useUserOrganizations } from 'data/organization';
|
||||
import { useRouterQuery } from 'hooks/use-router-query';
|
||||
import Link from 'next/link';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import React, { useEffect, useRef } from 'react';
|
||||
|
||||
import cls from 'classnames';
|
||||
import { useClickOutside } from 'hooks/use-click-outside';
|
||||
import interact from 'interactjs';
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
|
||||
import styles from './style.module.scss';
|
||||
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
|
||||
import { IconSearch as SemiIconSearch } from '@douyinfe/semi-icons';
|
||||
import { Button, Dropdown, Input, Modal, Spin, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { IDocument } from '@think/domains';
|
||||
|
||||
import { DataRender } from 'components/data-render';
|
||||
import { DocumentStar } from 'components/document/star';
|
||||
import { Empty } from 'components/empty';
|
||||
|
@ -14,7 +18,6 @@ import { useRouterQuery } from 'hooks/use-router-query';
|
|||
import { useToggle } from 'hooks/use-toggle';
|
||||
import Link from 'next/link';
|
||||
import Router from 'next/router';
|
||||
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { HttpClient } from 'services/http-client';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { useCallback, useRef } from 'react';
|
||||
|
||||
import { Button, Dropdown, Form } from '@douyinfe/semi-ui';
|
||||
import { FormApi } from '@douyinfe/semi-ui/lib/es/form';
|
||||
import { useCallback, useRef } from 'react';
|
||||
|
||||
type ISize = { width: number | string; height: number | string };
|
||||
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
import { useCallback } from 'react';
|
||||
|
||||
import { IconEdit, IconPlus, IconUser } from '@douyinfe/semi-icons';
|
||||
import { Avatar, Button, Modal, Skeleton, Space, Tooltip, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import type { ITemplate } from '@think/domains';
|
||||
|
||||
import cls from 'classnames';
|
||||
import { IconDocument } from 'components/icons/IconDocument';
|
||||
import { TemplateReader } from 'components/template/reader';
|
||||
import { useUser } from 'data/user';
|
||||
import { useToggle } from 'hooks/use-toggle';
|
||||
import Router from 'next/router';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
|
||||
import { IconChevronLeft } from '@douyinfe/semi-icons';
|
||||
import { Button, Nav, Popconfirm, Space, Switch, Tooltip, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { CollaborationEditor } from 'tiptap/editor';
|
||||
|
||||
import { DocumentStyle } from 'components/document/style';
|
||||
import { Seo } from 'components/seo';
|
||||
import { Theme } from 'components/theme';
|
||||
|
@ -10,8 +15,6 @@ import { useDocumentStyle } from 'hooks/use-document-style';
|
|||
import { useMount } from 'hooks/use-mount';
|
||||
import { useWindowSize } from 'hooks/use-window-size';
|
||||
import Router from 'next/router';
|
||||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { CollaborationEditor } from 'tiptap/editor';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
import React, { useEffect, useMemo, useState } from 'react';
|
||||
|
||||
import { List, Pagination } from '@douyinfe/semi-ui';
|
||||
|
||||
import { DataRender } from 'components/data-render';
|
||||
import { Empty } from 'components/empty';
|
||||
import { IProps as ITemplateCardProps, TemplateCard, TemplateCardPlaceholder } from 'components/template/card';
|
||||
import React, { useEffect, useMemo, useState } from 'react';
|
||||
|
||||
const grid = {
|
||||
gutter: 16,
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
import React from 'react';
|
||||
|
||||
import { Spin } from '@douyinfe/semi-ui';
|
||||
|
||||
import { ReaderEditor } from 'tiptap/editor';
|
||||
|
||||
import { DataRender } from 'components/data-render';
|
||||
import { Seo } from 'components/seo';
|
||||
import { useTemplate } from 'data/template';
|
||||
import React from 'react';
|
||||
import { ReaderEditor } from 'tiptap/editor';
|
||||
|
||||
interface IProps {
|
||||
templateId: string;
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import React, { useCallback } from 'react';
|
||||
|
||||
import { IconDesktop, IconMoon, IconSun } from '@douyinfe/semi-icons';
|
||||
import { Button, Dropdown } from '@douyinfe/semi-ui';
|
||||
|
||||
import { Theme as ThemeState, ThemeEnum } from 'hooks/use-theme';
|
||||
import React, { useCallback } from 'react';
|
||||
|
||||
export const Theme = () => {
|
||||
const { userPrefer, theme, toggle } = ThemeState.useHook();
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import React from 'react';
|
||||
|
||||
import { Tooltip as SemiTooltip } from '@douyinfe/semi-ui';
|
||||
import { Position } from '@douyinfe/semi-ui/tooltip';
|
||||
|
||||
import { useToggle } from 'hooks/use-toggle';
|
||||
import React from 'react';
|
||||
|
||||
interface IProps {
|
||||
content: React.ReactNode;
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import React from 'react';
|
||||
|
||||
import { IconUpload } from '@douyinfe/semi-icons';
|
||||
import { Button, Toast, Upload as SemiUpload } from '@douyinfe/semi-ui';
|
||||
|
||||
import { useAsyncLoading } from 'hooks/use-async-loading';
|
||||
import React from 'react';
|
||||
import { uploadFile } from 'services/file';
|
||||
|
||||
interface IProps {
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
import React, { useCallback } from 'react';
|
||||
|
||||
import { IconSpin } from '@douyinfe/semi-icons';
|
||||
import { Avatar, Button, Dropdown, Modal, Toast, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { useUser } from 'data/user';
|
||||
import { useToggle } from 'hooks/use-toggle';
|
||||
import Router from 'next/router';
|
||||
import React, { useCallback } from 'react';
|
||||
|
||||
import { ResetPassword } from './reset-password';
|
||||
import { UserSetting } from './setting';
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
import React, { useCallback, useState } from 'react';
|
||||
|
||||
import { Button, Col, Form, Row, Toast } from '@douyinfe/semi-ui';
|
||||
|
||||
import { useResetPassword, useSystemPublicConfig, useUser, useVerifyCode } from 'data/user';
|
||||
import { useInterval } from 'hooks/use-interval';
|
||||
import { useToggle } from 'hooks/use-toggle';
|
||||
import React, { useCallback, useState } from 'react';
|
||||
|
||||
export const ResetPassword = ({ onSuccess }) => {
|
||||
const [email, setEmail] = useState('');
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
import { Dispatch, SetStateAction, useCallback, useEffect, useRef, useState } from 'react';
|
||||
|
||||
import { Avatar, Button, Col, Form, Modal, Row, Space, Toast } from '@douyinfe/semi-ui';
|
||||
import { FormApi } from '@douyinfe/semi-ui/lib/es/form';
|
||||
|
||||
import { Upload } from 'components/upload';
|
||||
import { useSystemPublicConfig, useUser, useVerifyCode } from 'data/user';
|
||||
import { useInterval } from 'hooks/use-interval';
|
||||
import { useToggle } from 'hooks/use-toggle';
|
||||
import { Dispatch, SetStateAction, useCallback, useEffect, useRef, useState } from 'react';
|
||||
|
||||
interface IProps {
|
||||
visible: boolean;
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import React from 'react';
|
||||
|
||||
import { Button } from '@douyinfe/semi-ui';
|
||||
|
||||
import { WikiCreator as WikiCreatorForm } from 'components/wiki/create';
|
||||
import { useToggle } from 'hooks/use-toggle';
|
||||
import React from 'react';
|
||||
|
||||
export const WikiCreator: React.FC = ({ children }) => {
|
||||
const [visible, toggleVisible] = useToggle(false);
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
import React from 'react';
|
||||
|
||||
import { IconPlus } from '@douyinfe/semi-icons';
|
||||
import { Button, Dropdown } from '@douyinfe/semi-ui';
|
||||
|
||||
import { DocumentCreator } from 'components/document/create';
|
||||
import { WikiCreator } from 'components/wiki/create';
|
||||
import { useRouterQuery } from 'hooks/use-router-query';
|
||||
import { useToggle } from 'hooks/use-toggle';
|
||||
import React from 'react';
|
||||
|
||||
interface IProps {
|
||||
onCreateDocument?: () => void;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { IconUser } from '@douyinfe/semi-icons';
|
||||
import { Avatar, Skeleton, Space, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { IconDocument } from 'components/icons/IconDocument';
|
||||
import { LocaleTime } from 'components/locale-time';
|
||||
import { WikiStar } from 'components/wiki/star';
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
import { Dispatch, SetStateAction, useRef } from 'react';
|
||||
|
||||
import { Form, Modal } from '@douyinfe/semi-ui';
|
||||
import { FormApi } from '@douyinfe/semi-ui/lib/es/form';
|
||||
|
||||
import type { IWiki } from '@think/domains';
|
||||
|
||||
import { ICreateWiki, useOwnWikis } from 'data/wiki';
|
||||
import { useRouterQuery } from 'hooks/use-router-query';
|
||||
import Router from 'next/router';
|
||||
import { Dispatch, SetStateAction, useRef } from 'react';
|
||||
|
||||
interface IProps {
|
||||
visible: boolean;
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
import React, { useCallback } from 'react';
|
||||
|
||||
import { IconDelete } from '@douyinfe/semi-icons';
|
||||
import { Modal, Space, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { useOwnWikis } from 'data/wiki';
|
||||
import { useRouterQuery } from 'hooks/use-router-query';
|
||||
import Router from 'next/router';
|
||||
import React, { useCallback } from 'react';
|
||||
|
||||
interface IProps {
|
||||
wikiId: string;
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
|
||||
import { IconClose } from '@douyinfe/semi-icons';
|
||||
import { Banner, Button, Checkbox, Toast, Transfer, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { isPublicDocument } from '@think/domains';
|
||||
|
||||
import { flattenTree2Array } from 'components/wiki/tocs/utils';
|
||||
import { useWikiDetail, useWikiTocs } from 'data/wiki';
|
||||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import { Avatar, Skeleton, Space, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { IWiki } from '@think/domains';
|
||||
|
||||
import { IconDocument } from 'components/icons/IconDocument';
|
||||
import { LocaleTime } from 'components/locale-time';
|
||||
import { WikiStar } from 'components/wiki/star';
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { Skeleton } from '@douyinfe/semi-ui';
|
||||
import React from 'react';
|
||||
|
||||
import { Skeleton } from '@douyinfe/semi-ui';
|
||||
|
||||
export const WorkspacePlaceholder = () => {
|
||||
const placeholder = (
|
||||
<div
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
|
||||
import { Avatar, Button, Form, Toast } from '@douyinfe/semi-ui';
|
||||
import { FormApi } from '@douyinfe/semi-ui/lib/es/form';
|
||||
|
||||
import { WIKI_AVATARS } from '@think/constants';
|
||||
import type { IWiki } from '@think/domains';
|
||||
|
||||
import { ImageUploader } from 'components/image-uploader';
|
||||
import { pick } from 'helpers/pick';
|
||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
|
||||
import { Button, Toast, Typography, Upload } from '@douyinfe/semi-ui';
|
||||
|
||||
import type { IWiki } from '@think/domains';
|
||||
|
||||
import { useCreateDocument } from 'data/document';
|
||||
import { useRouterQuery } from 'hooks/use-router-query';
|
||||
import { useToggle } from 'hooks/use-toggle';
|
||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
|
||||
import { createMarkdownParser, MarkdownParse } from './parser';
|
||||
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
import { Toast } from '@douyinfe/semi-ui';
|
||||
import { safeJSONStringify } from 'helpers/json';
|
||||
|
||||
import { createEditor } from 'tiptap/core';
|
||||
import { AllExtensions } from 'tiptap/core/all-kit';
|
||||
import { Collaboration } from 'tiptap/core/extensions/collaboration';
|
||||
import { prosemirrorJSONToYDoc } from 'tiptap/core/thritypart/y-prosemirror/y-prosemirror';
|
||||
import { markdownToProsemirror } from 'tiptap/markdown/markdown-to-prosemirror';
|
||||
|
||||
import { safeJSONStringify } from 'helpers/json';
|
||||
import * as Y from 'yjs';
|
||||
|
||||
export interface MarkdownParse {
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
import React from 'react';
|
||||
|
||||
import { TabPane, Tabs } from '@douyinfe/semi-ui';
|
||||
|
||||
import { IWiki } from '@think/domains';
|
||||
|
||||
import { Seo } from 'components/seo';
|
||||
import { WikiTocsManager } from 'components/wiki/tocs/manager';
|
||||
import { useWikiDetail } from 'data/wiki';
|
||||
import React from 'react';
|
||||
|
||||
import { Base } from './base';
|
||||
import { Import } from './import';
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { Banner, Button, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { WikiDeletor } from 'components/wiki/delete';
|
||||
|
||||
interface IProps {
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
|
||||
import { IconClose } from '@douyinfe/semi-icons';
|
||||
import { Banner, Button, Checkbox, Radio, RadioGroup, Toast, Transfer, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { isPublicDocument, isPublicWiki, WIKI_STATUS_LIST } from '@think/domains';
|
||||
|
||||
import { flattenTree2Array } from 'components/wiki/tocs/utils';
|
||||
import { useWikiDetail, useWikiTocs } from 'data/wiki';
|
||||
import { buildUrl } from 'helpers/url';
|
||||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import React from 'react';
|
||||
|
||||
import { Members } from 'components/members';
|
||||
import { useWikiMembers } from 'data/wiki';
|
||||
import React from 'react';
|
||||
|
||||
interface IProps {
|
||||
wikiId: string;
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
import React from 'react';
|
||||
|
||||
import { IconStar } from '@douyinfe/semi-icons';
|
||||
import { Button, Tooltip } from '@douyinfe/semi-ui';
|
||||
|
||||
import { IOrganization, IWiki } from '@think/domains';
|
||||
|
||||
import { useWikiStarToggle } from 'data/star';
|
||||
import React from 'react';
|
||||
|
||||
interface IProps {
|
||||
organizationId: IOrganization['id'];
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
import { useMemo } from 'react';
|
||||
|
||||
import { IconPlus, IconSmallTriangleDown } from '@douyinfe/semi-icons';
|
||||
import { Avatar, Button, Dropdown, Skeleton, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { IDocument } from '@think/domains';
|
||||
|
||||
import cls from 'classnames';
|
||||
import { DataRender } from 'components/data-render';
|
||||
import { IconOverview, IconSetting } from 'components/icons';
|
||||
|
@ -9,10 +13,10 @@ import { useWikiDetail, useWikiTocs } from 'data/wiki';
|
|||
import { triggerCreateDocument } from 'event';
|
||||
import Link from 'next/link';
|
||||
import { useRouter } from 'next/router';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
import { Tree } from './tree';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
import { Tree } from './tree';
|
||||
|
||||
interface IProps {
|
||||
wikiId: string;
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
|
||||
import { Banner, Button, Toast, Tree, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { DataRender } from 'components/data-render';
|
||||
import { useWikiTocs } from 'data/wiki';
|
||||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import React from 'react';
|
||||
|
||||
import cls from 'classnames';
|
||||
import Link from 'next/link';
|
||||
import React from 'react';
|
||||
import type { UrlObject } from 'url';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
|
|
@ -1,18 +1,22 @@
|
|||
import React from 'react';
|
||||
|
||||
import { IconPlus } from '@douyinfe/semi-icons';
|
||||
import { Avatar, Skeleton, Space, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { IDocument } from '@think/domains';
|
||||
|
||||
import { DataRender } from 'components/data-render';
|
||||
import { IconOverview } from 'components/icons';
|
||||
import { LogoImage, LogoText } from 'components/logo';
|
||||
import { Seo } from 'components/seo';
|
||||
import { usePublicWikiDetail, usePublicWikiTocs } from 'data/wiki';
|
||||
import { useRouter } from 'next/router';
|
||||
import React from 'react';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
import { NavItem } from './nav-item';
|
||||
import { Tree } from './tree';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
||||
interface IProps {
|
||||
wikiId: string;
|
||||
docAsLink?: string;
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||
|
||||
import { IconPlus } from '@douyinfe/semi-icons';
|
||||
import { Button, Tree as SemiTree, Typography } from '@douyinfe/semi-ui';
|
||||
|
||||
import { DocumentActions } from 'components/document/actions';
|
||||
import { DocumentCreator as DocumenCreatorForm } from 'components/document/create';
|
||||
import deepEqual from 'deep-equal';
|
||||
|
@ -7,12 +10,12 @@ import { CREATE_DOCUMENT, event, triggerCreateDocument } from 'event';
|
|||
import { useToggle } from 'hooks/use-toggle';
|
||||
import Link from 'next/link';
|
||||
import { useRouter } from 'next/router';
|
||||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import scrollIntoView from 'scroll-into-view-if-needed';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
import { findParents } from './utils';
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
||||
const Actions = ({ node }) => {
|
||||
const createDocument = useCallback(
|
||||
(e) => {
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import { CommentApiDefinition, IComment } from '@think/domains';
|
||||
import { useCallback, useState } from 'react';
|
||||
import { useQuery } from 'react-query';
|
||||
|
||||
import { CommentApiDefinition, IComment } from '@think/domains';
|
||||
|
||||
import { HttpClient } from 'services/http-client';
|
||||
|
||||
export type CreateCommentDto = Pick<IComment, 'parentCommentId' | 'html' | 'replyUserId'>;
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
import { DocumentApiDefinition, IAuthority, IDocument, IUser, IWiki } from '@think/domains';
|
||||
import { triggerRefreshTocs } from 'event';
|
||||
import { useAsyncLoading } from 'hooks/use-async-loading';
|
||||
import { useCallback, useState } from 'react';
|
||||
import { QueriesOptions, useQuery, UseQueryOptions } from 'react-query';
|
||||
|
||||
import { DocumentApiDefinition, IAuthority, IDocument, IUser, IWiki } from '@think/domains';
|
||||
|
||||
import { triggerRefreshTocs } from 'event';
|
||||
import { useAsyncLoading } from 'hooks/use-async-loading';
|
||||
import { HttpClient } from 'services/http-client';
|
||||
|
||||
type IDocumentWithVisitedAt = IDocument & { visitedAt: string };
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import { IMessage, MessageApiDefinition } from '@think/domains';
|
||||
import { useCallback, useState } from 'react';
|
||||
import { useQuery } from 'react-query';
|
||||
|
||||
import { IMessage, MessageApiDefinition } from '@think/domains';
|
||||
|
||||
import { HttpClient } from 'services/http-client';
|
||||
|
||||
const getMessagesApi =
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
import { IAuth, IOrganization, IUser, OrganizationApiDefinition } from '@think/domains';
|
||||
import { event, REFRESH_ORGANIZATIONS, triggerRefreshOrganizations } from 'event';
|
||||
import { useAsyncLoading } from 'hooks/use-async-loading';
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
import { useQuery } from 'react-query';
|
||||
|
||||
import { IAuth, IOrganization, IUser, OrganizationApiDefinition } from '@think/domains';
|
||||
|
||||
import { event, REFRESH_ORGANIZATIONS, triggerRefreshOrganizations } from 'event';
|
||||
import { useAsyncLoading } from 'hooks/use-async-loading';
|
||||
import { HttpClient } from 'services/http-client';
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import { IDocument, IWiki, StarApiDefinition } from '@think/domains';
|
||||
import { event, TOGGLE_STAR_DOUCMENT, TOGGLE_STAR_WIKI, triggerToggleStarDocument, triggerToggleStarWiki } from 'event';
|
||||
import { useCallback, useEffect } from 'react';
|
||||
import { useQuery, UseQueryOptions } from 'react-query';
|
||||
|
||||
import { IDocument, IWiki, StarApiDefinition } from '@think/domains';
|
||||
|
||||
import { event, TOGGLE_STAR_DOUCMENT, TOGGLE_STAR_WIKI, triggerToggleStarDocument, triggerToggleStarWiki } from 'event';
|
||||
import { HttpClient } from 'services/http-client';
|
||||
|
||||
export type IWikiWithIsMember = IWiki & { isMember?: boolean };
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import { ITemplate, TemplateApiDefinition } from '@think/domains';
|
||||
import { useCallback, useState } from 'react';
|
||||
import { useQuery } from 'react-query';
|
||||
|
||||
import { ITemplate, TemplateApiDefinition } from '@think/domains';
|
||||
|
||||
import { HttpClient } from 'services/http-client';
|
||||
|
||||
export const getPublicTemplates = (
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
import { useCallback, useEffect } from 'react';
|
||||
import { useQuery } from 'react-query';
|
||||
|
||||
import { Toast } from '@douyinfe/semi-ui';
|
||||
|
||||
import { ILoginUser, ISystemConfig, IUser, SystemApiDefinition, UserApiDefinition } from '@think/domains';
|
||||
|
||||
import { getStorage, setStorage } from 'helpers/storage';
|
||||
import { useAsyncLoading } from 'hooks/use-async-loading';
|
||||
import Router, { useRouter } from 'next/router';
|
||||
import { useCallback, useEffect } from 'react';
|
||||
import { useQuery } from 'react-query';
|
||||
import { HttpClient } from 'services/http-client';
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import { IAuth, IDocument, IUser, IWiki, WikiApiDefinition } from '@think/domains';
|
||||
import { event, REFRESH_TOCS } from 'event';
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
import { useQuery } from 'react-query';
|
||||
|
||||
import { IAuth, IDocument, IUser, IWiki, WikiApiDefinition } from '@think/domains';
|
||||
|
||||
import { event, REFRESH_TOCS } from 'event';
|
||||
import { HttpClient } from 'services/http-client';
|
||||
|
||||
export type ICreateWiki = Pick<IWiki, 'name' | 'description'>;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { IDocument, IUser, IWiki } from '@think/domains';
|
||||
|
||||
import { EventEmitter } from 'helpers/event-emitter';
|
||||
|
||||
export const event = new EventEmitter();
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import { generateHTML } from '@tiptap/core';
|
||||
import HtmlDiff from 'htmldiff-js';
|
||||
import { CollaborationKit } from 'tiptap/editor';
|
||||
|
||||
import HtmlDiff from 'htmldiff-js';
|
||||
|
||||
const json2html = (json) => generateHTML(json, CollaborationKit);
|
||||
export const generateDiffHtml = (selected, other) => {
|
||||
const selectedHtml = json2html(selected);
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import { getStorage, setStorage } from 'helpers/storage';
|
||||
import { useCallback, useEffect } from 'react';
|
||||
import { useQuery } from 'react-query';
|
||||
|
||||
import { getStorage, setStorage } from 'helpers/storage';
|
||||
|
||||
export enum Width {
|
||||
'standardWidth' = 'standardWidth',
|
||||
'fullWidth' = 'fullWidth',
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue