From 6d0a596496e230568086290b163a608c6b94648c Mon Sep 17 00:00:00 2001 From: fantasticit Date: Wed, 27 Apr 2022 22:25:01 +0800 Subject: [PATCH] tiptap: remove unused code --- .../components/resizeable/style.module.scss | 6 +- .../src/tiptap/wrappers/attachment/index.tsx | 80 +++++++++---------- .../src/tiptap/wrappers/katex/index.tsx | 2 +- .../client/src/tiptap/wrappers/loading.tsx | 2 +- .../src/tiptap/wrappers/status/index.tsx | 4 +- 5 files changed, 45 insertions(+), 49 deletions(-) diff --git a/packages/client/src/components/resizeable/style.module.scss b/packages/client/src/components/resizeable/style.module.scss index 6fe9b6d5..3ab04426 100644 --- a/packages/client/src/components/resizeable/style.module.scss +++ b/packages/client/src/components/resizeable/style.module.scss @@ -8,12 +8,12 @@ .cloneNodeWrap { position: absolute; - background-color: rgb(179 212 255 / 30%); display: flex; - align-items: center; - justify-content: center; font-size: 14px; color: #333; + background-color: rgb(179 212 255 / 30%); + align-items: center; + justify-content: center; user-select: none; } diff --git a/packages/client/src/tiptap/wrappers/attachment/index.tsx b/packages/client/src/tiptap/wrappers/attachment/index.tsx index 39767284..9df42f7e 100644 --- a/packages/client/src/tiptap/wrappers/attachment/index.tsx +++ b/packages/client/src/tiptap/wrappers/attachment/index.tsx @@ -1,6 +1,6 @@ import { useEffect, useRef } from 'react'; import cls from 'classnames'; -import { NodeViewWrapper, NodeViewContent } from '@tiptap/react'; +import { NodeViewWrapper } from '@tiptap/react'; import { Button, Typography, Spin, Collapsible, Space } from '@douyinfe/semi-ui'; import { IconDownload, IconPlayCircle, IconClose } from '@douyinfe/semi-icons'; import { Tooltip } from 'components/tooltip'; @@ -68,47 +68,45 @@ export const AttachmentWrapper = ({ editor, node, updateAttributes }) => { if (url) { return ( - <> -
-
- - {getFileTypeIcon(fileType)} - - {fileName}.{fileExt} - ({normalizeFileSize(fileSize)}) - - - - -
- {url ? ( - - - - ) : null} +
+
+ + {getFileTypeIcon(fileType)} + + {fileName}.{fileExt} + ({normalizeFileSize(fileSize)}) + + + + +
- + {url ? ( + + + + ) : null} +
); } diff --git a/packages/client/src/tiptap/wrappers/katex/index.tsx b/packages/client/src/tiptap/wrappers/katex/index.tsx index 972345e7..5bf64ff9 100644 --- a/packages/client/src/tiptap/wrappers/katex/index.tsx +++ b/packages/client/src/tiptap/wrappers/katex/index.tsx @@ -1,4 +1,4 @@ -import { NodeViewWrapper, NodeViewContent } from '@tiptap/react'; +import { NodeViewWrapper } from '@tiptap/react'; import { useMemo, useCallback, useEffect, useRef } from 'react'; import cls from 'classnames'; import { Popover, TextArea, Typography, Space } from '@douyinfe/semi-ui'; diff --git a/packages/client/src/tiptap/wrappers/loading.tsx b/packages/client/src/tiptap/wrappers/loading.tsx index ff5deb11..1261256a 100644 --- a/packages/client/src/tiptap/wrappers/loading.tsx +++ b/packages/client/src/tiptap/wrappers/loading.tsx @@ -1,7 +1,7 @@ import { NodeViewWrapper } from '@tiptap/react'; import { Spin } from '@douyinfe/semi-ui'; -export const LoadingWrapper = ({ editor, node, updateAttributes }) => { +export const LoadingWrapper = ({ editor, node }) => { const isEditable = editor.isEditable; const { text } = node.attrs; diff --git a/packages/client/src/tiptap/wrappers/status/index.tsx b/packages/client/src/tiptap/wrappers/status/index.tsx index c8d7aa14..5c4f22a4 100644 --- a/packages/client/src/tiptap/wrappers/status/index.tsx +++ b/packages/client/src/tiptap/wrappers/status/index.tsx @@ -1,4 +1,4 @@ -import { NodeViewWrapper, NodeViewContent } from '@tiptap/react'; +import { NodeViewWrapper } from '@tiptap/react'; import { Button, Collapsible, Space, Popover, Tag, Input } from '@douyinfe/semi-ui'; import cls from 'classnames'; import { useCallback, useEffect, useRef } from 'react'; @@ -90,7 +90,6 @@ export const StatusWrapper = ({ editor, node, updateAttributes }) => { return ( - {isEditable ? ( { ) : ( content )} - ); };