tiptap: remove unused code

This commit is contained in:
fantasticit 2022-04-27 22:25:01 +08:00
parent 733a4910e9
commit 6d0a596496
5 changed files with 45 additions and 49 deletions

View File

@ -8,12 +8,12 @@
.cloneNodeWrap { .cloneNodeWrap {
position: absolute; position: absolute;
background-color: rgb(179 212 255 / 30%);
display: flex; display: flex;
align-items: center;
justify-content: center;
font-size: 14px; font-size: 14px;
color: #333; color: #333;
background-color: rgb(179 212 255 / 30%);
align-items: center;
justify-content: center;
user-select: none; user-select: none;
} }

View File

@ -1,6 +1,6 @@
import { useEffect, useRef } from 'react'; import { useEffect, useRef } from 'react';
import cls from 'classnames'; 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 { Button, Typography, Spin, Collapsible, Space } from '@douyinfe/semi-ui';
import { IconDownload, IconPlayCircle, IconClose } from '@douyinfe/semi-icons'; import { IconDownload, IconPlayCircle, IconClose } from '@douyinfe/semi-icons';
import { Tooltip } from 'components/tooltip'; import { Tooltip } from 'components/tooltip';
@ -68,7 +68,6 @@ export const AttachmentWrapper = ({ editor, node, updateAttributes }) => {
if (url) { if (url) {
return ( return (
<>
<div className={cls(styles.wrap, visible && styles.isPreviewing, 'render-wrapper')} onClick={selectFile}> <div className={cls(styles.wrap, visible && styles.isPreviewing, 'render-wrapper')} onClick={selectFile}>
<div> <div>
<Space> <Space>
@ -108,7 +107,6 @@ export const AttachmentWrapper = ({ editor, node, updateAttributes }) => {
</Collapsible> </Collapsible>
) : null} ) : null}
</div> </div>
</>
); );
} }

View File

@ -1,4 +1,4 @@
import { NodeViewWrapper, NodeViewContent } from '@tiptap/react'; import { NodeViewWrapper } from '@tiptap/react';
import { useMemo, useCallback, useEffect, useRef } from 'react'; import { useMemo, useCallback, useEffect, useRef } from 'react';
import cls from 'classnames'; import cls from 'classnames';
import { Popover, TextArea, Typography, Space } from '@douyinfe/semi-ui'; import { Popover, TextArea, Typography, Space } from '@douyinfe/semi-ui';

View File

@ -1,7 +1,7 @@
import { NodeViewWrapper } from '@tiptap/react'; import { NodeViewWrapper } from '@tiptap/react';
import { Spin } from '@douyinfe/semi-ui'; import { Spin } from '@douyinfe/semi-ui';
export const LoadingWrapper = ({ editor, node, updateAttributes }) => { export const LoadingWrapper = ({ editor, node }) => {
const isEditable = editor.isEditable; const isEditable = editor.isEditable;
const { text } = node.attrs; const { text } = node.attrs;

View File

@ -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 { Button, Collapsible, Space, Popover, Tag, Input } from '@douyinfe/semi-ui';
import cls from 'classnames'; import cls from 'classnames';
import { useCallback, useEffect, useRef } from 'react'; import { useCallback, useEffect, useRef } from 'react';
@ -90,7 +90,6 @@ export const StatusWrapper = ({ editor, node, updateAttributes }) => {
return ( return (
<NodeViewWrapper as="span" className={cls(styles.wrap, 'status')}> <NodeViewWrapper as="span" className={cls(styles.wrap, 'status')}>
<NodeViewContent />
{isEditable ? ( {isEditable ? (
<Popover <Popover
showArrow showArrow
@ -130,7 +129,6 @@ export const StatusWrapper = ({ editor, node, updateAttributes }) => {
) : ( ) : (
content content
)} )}
<NodeViewContent />
</NodeViewWrapper> </NodeViewWrapper>
); );
}; };