import React from 'react'; import { f } from '@src/resource/string'; import { getCache } from '@src/utils/cacheUtils'; import { Menu } from 'antd'; import { IconBtn } from '../docs/plugins/Components'; import { ELTYPE } from '../docs/plugins/config'; import { insertEditLink } from '../docs/plugins/EditLink'; import { isSameLineSelection } from '../docs/plugins/pluginsUtils/selectionUtils'; import { BlockIconButton, TabButton, TocButton, ToolbarButton, VersionButton } from '../docs/plugins/StaticToolbar/buttons'; import { ReactEditor } from '../slate-packages/slate-react'; export default (props: any) => { const { editor, editorSelection, setCardMenuVisible, cardMenuVisible, docWidth, modalState, setValue, isShowAnchor, setIsShowAnchor, isDisabled, hasSelCells, } = props; const isInElectron: boolean = getCache(editor?.docId, 'options')?.isInElectron; return ( { e.preventDefault(); }} style={{ width: '302px' }} data-ignore-slate >
} /> } /> } /> } /> } style={{ cursor: editor && editor.selection && ReactEditor.hasRange(editor, editor.selection) && !isSameLineSelection(editor.selection) ? 'not-allowed' : null, opacity: editor && editor.selection && ReactEditor.hasRange(editor, editor.selection) && !isSameLineSelection(editor.selection) ? '0.4' : null, }} isDisabled={ isDisabled || (editor && editor.selection && ReactEditor.hasRange(editor, editor.selection) && !isSameLineSelection(editor.selection)) || hasSelCells } onMouseDown={e => { if (editor && editor.selection && ReactEditor.hasRange(editor, editor.selection) && !isSameLineSelection(editor.selection)) { return; } insertEditLink(editor, '', editor.selection); return; }} /> } editor={editor} />} /> } editor={editor} />} /> {} {!isInElectron && ( } editor={editor} setValue={setValue} />} /> )} } editor={editor} setIsShowAnchor={setIsShowAnchor} isShowAnchor={isShowAnchor} /> } />
); };