@ctzhian/tiptap 3.0.0 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{app/editor/Editor → Editor}/demo.d.ts +1 -1
- package/dist/{app/editor/Editor → Editor}/demo.js +2 -5
- package/dist/{app/editor/Editor → Editor}/index.d.ts +1 -1
- package/dist/{app/editor/Editor → Editor}/index.js +9 -10
- package/dist/{app/editor/EditorDiff → EditorDiff}/demo.d.ts +1 -1
- package/dist/{app/editor/EditorDiff → EditorDiff}/demo.js +2 -3
- package/dist/{app/editor/EditorDiff → EditorDiff}/index.js +2 -2
- package/dist/{features/markdown → EditorMarkdown}/Toolbar.d.ts +1 -2
- package/dist/EditorMarkdown/Toolbar.js +942 -0
- package/dist/{app/editor/EditorMarkdown → EditorMarkdown}/demo.d.ts +1 -1
- package/dist/{app/editor/EditorMarkdown → EditorMarkdown}/demo.js +2 -4
- package/dist/{features/markdown → EditorMarkdown}/index.d.ts +3 -3
- package/dist/EditorMarkdown/index.js +566 -0
- package/dist/{app/editor/EditorThemeProvider → EditorThemeProvider}/index.d.ts +1 -1
- package/dist/{app/editor/EditorThemeProvider → EditorThemeProvider}/index.js +2 -2
- package/dist/{features/toolbar → EditorToolbar}/index.d.ts +1 -1
- package/dist/EditorToolbar/index.js +361 -0
- package/dist/{components → component}/ActionDropdown/index.d.ts +1 -1
- package/dist/{components → component}/ActionDropdown/index.js +37 -23
- package/dist/{components → component}/CustomBubbleMenu/index.d.ts +1 -1
- package/dist/{components → component}/CustomBubbleMenu/index.js +3 -4
- package/dist/{features/drag-handle → component/CustomDragHandle}/index.d.ts +1 -1
- package/dist/component/CustomDragHandle/index.js +1372 -0
- package/dist/component/FloatingPopover/index.js +120 -0
- package/dist/component/HoverPopover/index.js +162 -0
- package/dist/{components → component}/Menu/NestedList.d.ts +1 -1
- package/dist/{components → component}/Menu/NestedList.js +41 -19
- package/dist/{components → component}/Menu/index.d.ts +1 -1
- package/dist/{components → component}/Menu/index.js +21 -13
- package/dist/component/Toolbar/EditorAlignSelect.js +187 -0
- package/dist/component/Toolbar/EditorCode.js +161 -0
- package/dist/{components → component}/Toolbar/EditorHeading.js +1 -1
- package/dist/component/Toolbar/EditorInsert/index.js +491 -0
- package/dist/component/Toolbar/EditorListSelect.js +174 -0
- package/dist/{components/Toolbar/CommandSelect.js → component/Toolbar/EditorMath.js} +84 -54
- package/dist/{components → component}/Toolbar/EditorMore/NotificationDialog.js +2 -2
- package/dist/{components → component}/Toolbar/EditorMore/index.d.ts +1 -1
- package/dist/{components → component}/Toolbar/EditorMore/index.js +11 -6
- package/dist/component/Toolbar/EditorScript.js +161 -0
- package/dist/component/Toolbar/EditorVerticalAlignSelect.js +174 -0
- package/dist/{components → component}/Toolbar/Item.js +1 -1
- package/dist/{components → component}/Toolbar/TableSizePicker.js +1 -1
- package/dist/{components → component}/Toolbar/index.d.ts +0 -1
- package/dist/{components → component}/Toolbar/index.js +0 -1
- package/dist/{constants → contants}/enums.d.ts +0 -2
- package/dist/{constants → contants}/enums.js +5 -19
- package/dist/{constants → contants}/slash-commands.js +1 -1
- package/dist/{editor-core/extensions → extension}/component/Alert/index.js +3 -3
- package/dist/{editor-core/extensions → extension}/component/Attachment/AttachmentContent.js +2 -2
- package/dist/{editor-core/extensions → extension}/component/Attachment/Insert.d.ts +1 -1
- package/dist/{editor-core/extensions → extension}/component/Attachment/Insert.js +58 -50
- package/dist/{editor-core/extensions → extension}/component/Attachment/index.d.ts +1 -1
- package/dist/{editor-core/extensions → extension}/component/Attachment/index.js +28 -20
- package/dist/{editor-core/extensions → extension}/component/Audio/AudioPlayer.d.ts +1 -1
- package/dist/{editor-core/extensions → extension}/component/Audio/AudioPlayer.js +4 -13
- package/dist/{editor-core/extensions → extension}/component/Audio/Insert.d.ts +2 -2
- package/dist/{editor-core/extensions → extension}/component/Audio/Insert.js +249 -85
- package/dist/extension/component/Audio/index.d.ts +14 -0
- package/dist/{editor-core/extensions → extension}/component/Audio/index.js +208 -111
- package/dist/{editor-core/extensions/component/CodeBlock/shared.js → extension/component/CodeBlock/Readonly.js} +134 -42
- package/dist/extension/component/CodeBlock/index.js +374 -0
- package/dist/{editor-core/extensions → extension}/component/DrawPanel/index.d.ts +1 -1
- package/dist/{editor-core/extensions → extension}/component/DrawPanel/index.js +2 -2
- package/dist/{editor-core/extensions → extension}/component/FlipGrid/ColumnView.js +3 -3
- package/dist/{editor-core/extensions → extension}/component/Flow/Edit.js +1 -1
- package/dist/{editor-core/extensions → extension}/component/Flow/Insert.js +2 -2
- package/dist/{editor-core/extensions → extension}/component/Flow/index.d.ts +1 -1
- package/dist/{editor-core/extensions → extension}/component/Flow/index.js +4 -4
- package/dist/{features/media/iframe → extension/component/Iframe}/Insert.d.ts +1 -1
- package/dist/{features/media/iframe → extension/component/Iframe}/Insert.js +52 -21
- package/dist/{features/media/iframe → extension/component/Iframe}/index.d.ts +1 -1
- package/dist/{features/media/iframe → extension/component/Iframe}/index.js +393 -97
- package/dist/{features/media/image → extension/component/Image}/Crop.d.ts +1 -1
- package/dist/{features/media/image → extension/component/Image}/Insert.d.ts +1 -1
- package/dist/{features/media/image → extension/component/Image}/Insert.js +107 -35
- package/dist/{features/media/image → extension/component/Image}/Readonly.js +1 -1
- package/dist/{features/media/image → extension/component/Image}/index.d.ts +1 -1
- package/dist/{features/media/image → extension/component/Image}/index.js +296 -102
- package/dist/{editor-core/extensions → extension}/component/Link/Insert.d.ts +1 -1
- package/dist/extension/component/Link/Insert.js +252 -0
- package/dist/{editor-core/extensions → extension}/component/Link/LinkContent.d.ts +1 -1
- package/dist/{editor-core/extensions → extension}/component/Link/LinkContent.js +9 -6
- package/dist/{editor-core/extensions → extension}/component/Link/Markdown.js +1 -1
- package/dist/{editor-core/extensions → extension}/component/Link/index.d.ts +8 -0
- package/dist/{editor-core/extensions → extension}/component/Link/index.js +124 -72
- package/dist/{editor-core/extensions → extension}/component/Mathematics/block/Readonly.d.ts +1 -1
- package/dist/{editor-core/extensions → extension}/component/Mathematics/block/index.d.ts +4 -3
- package/dist/{editor-core/extensions → extension}/component/Mathematics/block/index.js +39 -18
- package/dist/{editor-core/extensions → extension}/component/Mathematics/inline/Readonly.d.ts +1 -1
- package/dist/{editor-core/extensions → extension}/component/Mathematics/inline/index.d.ts +4 -3
- package/dist/{editor-core/extensions → extension}/component/Mathematics/inline/index.js +40 -17
- package/dist/{editor-core/extensions → extension}/component/SlashCommandsList/Overlay.d.ts +1 -1
- package/dist/{editor-core/extensions → extension}/component/SlashCommandsList/Overlay.js +1 -1
- package/dist/{editor-core/extensions → extension}/component/SlashCommandsList/index.d.ts +1 -1
- package/dist/{editor-core/extensions → extension}/component/SlashCommandsList/index.js +5 -5
- package/dist/extension/component/TableCellHandleMenu/index.js +512 -0
- package/dist/{features/table → extension/component}/TableExtendButton/index.d.ts +1 -1
- package/dist/{features/table → extension/component}/TableExtendButton/index.js +2 -2
- package/dist/{features/table → extension/component}/TableHandle/TableHandleAddButton.d.ts +1 -1
- package/dist/{features/table → extension/component}/TableHandle/TableHandleAddButton.js +2 -2
- package/dist/{features/table → extension/component}/TableHandle/TableHandleMenu.d.ts +1 -1
- package/dist/{features/table → extension/component}/TableHandle/TableHandleMenu.js +265 -48
- package/dist/{features/table → extension/component}/TableHandle/index.d.ts +12 -0
- package/dist/extension/component/TableHandle/index.js +140 -0
- package/dist/{features/table → extension/component}/TableHandle/use-table-handle-positioning.js +1 -1
- package/dist/{features/table → extension/component}/TableHandle/use-table-handle-state.d.ts +1 -1
- package/dist/{features/table → extension/component}/TableSelectionOverlay/index.js +1 -1
- package/dist/{editor-core/extensions → extension}/component/Tooltip/EditPopover.js +22 -12
- package/dist/{editor-core/extensions → extension}/component/Tooltip/index.js +1 -1
- package/dist/{editor-core/extensions → extension}/component/UploadProgress/Inline.d.ts +1 -2
- package/dist/{editor-core/extensions/component/UploadProgress/shared.js → extension/component/UploadProgress/Inline.js} +50 -39
- package/dist/{editor-core/extensions → extension}/component/UploadProgress/index.d.ts +3 -2
- package/dist/extension/component/UploadProgress/index.js +111 -0
- package/dist/{features/media/video → extension/component/Video}/Insert.d.ts +1 -1
- package/dist/{features/media/video → extension/component/Video}/Insert.js +111 -35
- package/dist/{features/media/video → extension/component/Video}/index.d.ts +1 -1
- package/dist/{features/media/video → extension/component/Video}/index.js +379 -86
- package/dist/extension/extension/ImeComposition.d.ts +2 -0
- package/dist/{editor-core/extensions → extension}/extension/ImeComposition.js +23 -10
- package/dist/{editor-core/extensions → extension}/extension/StructuredDiff.js +2 -1
- package/dist/extension/index.d.ts +2 -0
- package/dist/{editor-core/extensions/builders.js → extension/index.js} +92 -126
- package/dist/{editor-core/extensions → extension}/node/Attachment.d.ts +1 -1
- package/dist/{editor-core/extensions → extension}/node/Attachment.js +3 -15
- package/dist/{editor-core/extensions → extension}/node/Audio.d.ts +1 -1
- package/dist/{editor-core/extensions → extension}/node/Audio.js +19 -11
- package/dist/{editor-core/extensions → extension}/node/CodeBlockLowlight.js +33 -6
- package/dist/{editor-core/extensions → extension}/node/DrawPanel.d.ts +1 -1
- package/dist/{editor-core/extensions → extension}/node/FileHandler.d.ts +2 -2
- package/dist/{editor-core/extensions → extension}/node/FileHandler.js +2 -2
- package/dist/{editor-core/extensions → extension}/node/Flow/index.d.ts +1 -1
- package/dist/{editor-core/extensions → extension}/node/Iframe.d.ts +1 -1
- package/dist/{editor-core/extensions → extension}/node/Iframe.js +1 -1
- package/dist/{editor-core/extensions → extension}/node/Image.d.ts +1 -1
- package/dist/{editor-core/extensions → extension}/node/Image.js +2 -2
- package/dist/{editor-core/extensions → extension}/node/Link/index.js +5 -11
- package/dist/extension/node/ListKit.js +23 -0
- package/dist/{editor-core/extensions → extension}/node/Mathematics.d.ts +1 -1
- package/dist/extension/node/Mathematics.js +97 -0
- package/dist/{editor-core/extensions → extension}/node/Mention.d.ts +1 -1
- package/dist/{editor-core/extensions → extension}/node/Table.js +1 -1
- package/dist/{features/table/plugin → extension/node/TableHandler}/index.d.ts +1 -3
- package/dist/{features/table/plugin → extension/node/TableHandler}/index.js +2 -5
- package/dist/{features/table/plugin/shared.d.ts → extension/node/TableHandler/plugin.d.ts} +16 -8
- package/dist/extension/node/TableHandler/plugin.js +1083 -0
- package/dist/{editor-core/extensions → extension}/node/TableOfContents/index.d.ts +1 -1
- package/dist/{editor-core/extensions → extension}/node/TableOfContents/index.js +1 -1
- package/dist/{editor-core/extensions → extension}/node/TableOfContents/plugin.js +3 -2
- package/dist/{editor-core/extensions → extension}/node/Video.d.ts +1 -1
- package/dist/{editor-core/extensions → extension}/node/Video.js +2 -2
- package/dist/{editor-core/extensions → extension}/suggestion/mention.d.ts +1 -1
- package/dist/{editor-core/extensions → extension}/suggestion/mention.js +1 -1
- package/dist/{editor-core/extensions → extension}/suggestion/slash.d.ts +1 -1
- package/dist/{editor-core/extensions → extension}/suggestion/slash.js +1 -1
- package/dist/{hooks → hook}/fn.d.ts +1 -1
- package/dist/{hooks → hook}/fn.js +1 -1
- package/dist/{hooks → hook}/index.d.ts +1 -1
- package/dist/{hooks → hook}/index.js +13 -23
- package/dist/index.d.ts +10 -10
- package/dist/index.js +10 -10
- package/dist/themes/componentStyleOverrides.js +1 -1
- package/dist/themes/index.d.ts +1 -1
- package/dist/{utils → util}/fileHandler.d.ts +2 -2
- package/dist/util/fileHandler.js +82 -0
- package/dist/util/index.d.ts +35 -0
- package/dist/util/index.js +165 -0
- package/dist/{utils → util}/resourceExtractor.d.ts +1 -1
- package/dist/{utils → util}/resourceExtractor.js +1 -1
- package/dist/{utils → util}/shortcutKey.js +1 -1
- package/package.json +32 -36
- package/dist/app/editor/EditorMarkdown/index.d.ts +0 -1
- package/dist/app/editor/EditorMarkdown/index.js +0 -1
- package/dist/components/FloatingPopover/index.js +0 -66
- package/dist/components/HoverPopover/index.js +0 -56
- package/dist/components/Toolbar/CommandSelect.d.ts +0 -20
- package/dist/components/Toolbar/EditorAlignSelect.js +0 -76
- package/dist/components/Toolbar/EditorCode.js +0 -50
- package/dist/components/Toolbar/EditorInsert/index.js +0 -40
- package/dist/components/Toolbar/EditorInsert/menu-builders.d.ts +0 -3
- package/dist/components/Toolbar/EditorInsert/menu-builders.js +0 -407
- package/dist/components/Toolbar/EditorListSelect.js +0 -62
- package/dist/components/Toolbar/EditorMath.js +0 -54
- package/dist/components/Toolbar/EditorMore/menu-builders.d.ts +0 -5
- package/dist/components/Toolbar/EditorMore/menu-builders.js +0 -13
- package/dist/components/Toolbar/EditorScript.js +0 -50
- package/dist/components/Toolbar/EditorVerticalAlignSelect.js +0 -64
- package/dist/components/shared/menu-item-content.d.ts +0 -7
- package/dist/components/shared/menu-item-content.js +0 -23
- package/dist/components/shared/menu-surface.d.ts +0 -13
- package/dist/components/shared/menu-surface.js +0 -35
- package/dist/components/shared/use-floating-popover.d.ts +0 -16
- package/dist/components/shared/use-floating-popover.js +0 -79
- package/dist/components/shared/use-hover-popover.d.ts +0 -15
- package/dist/components/shared/use-hover-popover.js +0 -96
- package/dist/components/shared/use-popover-anchor.d.ts +0 -8
- package/dist/components/shared/use-popover-anchor.js +0 -26
- package/dist/editor-core/extensions/builders.d.ts +0 -13
- package/dist/editor-core/extensions/catalog.d.ts +0 -22
- package/dist/editor-core/extensions/catalog.js +0 -326
- package/dist/editor-core/extensions/component/Audio/index.d.ts +0 -5
- package/dist/editor-core/extensions/component/Audio/shared.d.ts +0 -12
- package/dist/editor-core/extensions/component/Audio/shared.js +0 -48
- package/dist/editor-core/extensions/component/Audio/use-audio-upload-fields.d.ts +0 -21
- package/dist/editor-core/extensions/component/Audio/use-audio-upload-fields.js +0 -48
- package/dist/editor-core/extensions/component/CodeBlock/Readonly.js +0 -124
- package/dist/editor-core/extensions/component/CodeBlock/index.js +0 -330
- package/dist/editor-core/extensions/component/CodeBlock/shared.d.ts +0 -15
- package/dist/editor-core/extensions/component/Link/Insert.js +0 -162
- package/dist/editor-core/extensions/component/Link/shared.d.ts +0 -26
- package/dist/editor-core/extensions/component/Link/shared.js +0 -74
- package/dist/editor-core/extensions/component/Mathematics/shared.d.ts +0 -18
- package/dist/editor-core/extensions/component/Mathematics/shared.js +0 -64
- package/dist/editor-core/extensions/component/UploadProgress/Inline.js +0 -28
- package/dist/editor-core/extensions/component/UploadProgress/file-meta.d.ts +0 -4
- package/dist/editor-core/extensions/component/UploadProgress/file-meta.js +0 -42
- package/dist/editor-core/extensions/component/UploadProgress/index.js +0 -19
- package/dist/editor-core/extensions/component/UploadProgress/shared.d.ts +0 -10
- package/dist/editor-core/extensions/component/shared/edit-popover.d.ts +0 -27
- package/dist/editor-core/extensions/component/shared/edit-popover.js +0 -82
- package/dist/editor-core/extensions/component/shared/insert-popover.d.ts +0 -34
- package/dist/editor-core/extensions/component/shared/insert-popover.js +0 -160
- package/dist/editor-core/extensions/component/shared/resource-form.d.ts +0 -26
- package/dist/editor-core/extensions/component/shared/resource-form.js +0 -78
- package/dist/editor-core/extensions/component/shared/upload-flow.d.ts +0 -25
- package/dist/editor-core/extensions/component/shared/upload-flow.js +0 -143
- package/dist/editor-core/extensions/extension/ImeComposition.d.ts +0 -12
- package/dist/editor-core/extensions/extension/ime-shared.d.ts +0 -11
- package/dist/editor-core/extensions/extension/ime-shared.js +0 -20
- package/dist/editor-core/extensions/index.d.ts +0 -4
- package/dist/editor-core/extensions/index.js +0 -6
- package/dist/editor-core/extensions/node/ListKit.js +0 -18
- package/dist/editor-core/extensions/node/Mathematics.js +0 -58
- package/dist/editor-core/extensions/node/code-block-lowlight-shared.d.ts +0 -14
- package/dist/editor-core/extensions/node/code-block-lowlight-shared.js +0 -34
- package/dist/editor-core/extensions/node/list-shared.d.ts +0 -18
- package/dist/editor-core/extensions/node/list-shared.js +0 -18
- package/dist/editor-core/extensions/node/mathematics-shared.d.ts +0 -7
- package/dist/editor-core/extensions/node/mathematics-shared.js +0 -40
- package/dist/editor-core/extensions/node/resource-shared.d.ts +0 -13
- package/dist/editor-core/extensions/node/resource-shared.js +0 -45
- package/dist/editor-core/extensions/plugin-keys.d.ts +0 -2
- package/dist/editor-core/extensions/plugin-keys.js +0 -2
- package/dist/features/drag-handle/action-count-badge.d.ts +0 -5
- package/dist/features/drag-handle/action-count-badge.js +0 -23
- package/dist/features/drag-handle/action-groups.d.ts +0 -13
- package/dist/features/drag-handle/action-groups.js +0 -49
- package/dist/features/drag-handle/convert-builders.d.ts +0 -8
- package/dist/features/drag-handle/convert-builders.js +0 -201
- package/dist/features/drag-handle/download-builders.d.ts +0 -7
- package/dist/features/drag-handle/download-builders.js +0 -237
- package/dist/features/drag-handle/drag-handle-header.d.ts +0 -17
- package/dist/features/drag-handle/drag-handle-header.js +0 -233
- package/dist/features/drag-handle/index.js +0 -210
- package/dist/features/drag-handle/insert-builders.d.ts +0 -3
- package/dist/features/drag-handle/insert-builders.js +0 -81
- package/dist/features/drag-handle/menu-builders.d.ts +0 -4
- package/dist/features/drag-handle/menu-builders.js +0 -4
- package/dist/features/drag-handle/menu-shared.d.ts +0 -11
- package/dist/features/drag-handle/menu-shared.js +0 -102
- package/dist/features/drag-handle/node-actions.d.ts +0 -5
- package/dist/features/drag-handle/node-actions.js +0 -57
- package/dist/features/drag-handle/style-builders.d.ts +0 -8
- package/dist/features/drag-handle/style-builders.js +0 -197
- package/dist/features/drag-handle/types.d.ts +0 -27
- package/dist/features/drag-handle/types.js +0 -1
- package/dist/features/drag-handle/use-current-node-context.d.ts +0 -11
- package/dist/features/drag-handle/use-current-node-context.js +0 -109
- package/dist/features/markdown/Toolbar.js +0 -81
- package/dist/features/markdown/index.js +0 -284
- package/dist/features/markdown/toolbar-actions.d.ts +0 -82
- package/dist/features/markdown/toolbar-actions.js +0 -734
- package/dist/features/markdown/toolbar-menu.d.ts +0 -9
- package/dist/features/markdown/toolbar-menu.js +0 -87
- package/dist/features/markdown/toolbar-tool-list.d.ts +0 -12
- package/dist/features/markdown/toolbar-tool-list.js +0 -24
- package/dist/features/markdown/use-ace-composition.d.ts +0 -5
- package/dist/features/markdown/use-ace-composition.js +0 -39
- package/dist/features/markdown/use-display-mode.d.ts +0 -8
- package/dist/features/markdown/use-display-mode.js +0 -28
- package/dist/features/markdown/use-markdown-file-inputs.d.ts +0 -10
- package/dist/features/markdown/use-markdown-file-inputs.js +0 -69
- package/dist/features/markdown/use-markdown-sync.d.ts +0 -13
- package/dist/features/markdown/use-markdown-sync.js +0 -56
- package/dist/features/markdown/use-markdown-transfer.d.ts +0 -18
- package/dist/features/markdown/use-markdown-transfer.js +0 -123
- package/dist/features/markdown/use-markdown-upload.d.ts +0 -13
- package/dist/features/markdown/use-markdown-upload.js +0 -98
- package/dist/features/media/shared/media-edit-popover.d.ts +0 -26
- package/dist/features/media/shared/media-edit-popover.js +0 -105
- package/dist/features/media/shared/media-hover-toolbar.d.ts +0 -18
- package/dist/features/media/shared/media-hover-toolbar.js +0 -140
- package/dist/features/media/shared/media-resize-handles.d.ts +0 -8
- package/dist/features/media/shared/media-resize-handles.js +0 -70
- package/dist/features/media/shared/use-media-resize.d.ts +0 -20
- package/dist/features/media/shared/use-media-resize.js +0 -88
- package/dist/features/media/shared/use-media-width.d.ts +0 -14
- package/dist/features/media/shared/use-media-width.js +0 -76
- package/dist/features/table/TableCellHandleMenu/index.js +0 -234
- package/dist/features/table/TableHandle/index.js +0 -73
- package/dist/features/table/TableHandle/menu-builders.d.ts +0 -14
- package/dist/features/table/TableHandle/menu-builders.js +0 -242
- package/dist/features/table/TableHandle/table-handle-group.d.ts +0 -16
- package/dist/features/table/TableHandle/table-handle-group.js +0 -84
- package/dist/features/table/TableHandle/use-table-handle-visibility.d.ts +0 -14
- package/dist/features/table/TableHandle/use-table-handle-visibility.js +0 -47
- package/dist/features/table/TableHandle/use-table-menu-open.d.ts +0 -12
- package/dist/features/table/TableHandle/use-table-menu-open.js +0 -39
- package/dist/features/table/plugin/decorations.d.ts +0 -9
- package/dist/features/table/plugin/decorations.js +0 -80
- package/dist/features/table/plugin/drag-helpers.d.ts +0 -11
- package/dist/features/table/plugin/drag-helpers.js +0 -188
- package/dist/features/table/plugin/hover-state.d.ts +0 -27
- package/dist/features/table/plugin/hover-state.js +0 -60
- package/dist/features/table/plugin/plugin.d.ts +0 -4
- package/dist/features/table/plugin/plugin.js +0 -512
- package/dist/features/table/plugin/positioning.d.ts +0 -40
- package/dist/features/table/plugin/positioning.js +0 -124
- package/dist/features/table/plugin/shared.js +0 -9
- package/dist/features/table/plugin/state-sync.d.ts +0 -12
- package/dist/features/table/plugin/state-sync.js +0 -75
- package/dist/features/toolbar/index.js +0 -179
- package/dist/features/toolbar/toolbar-config.d.ts +0 -32
- package/dist/features/toolbar/toolbar-config.js +0 -209
- package/dist/features/toolbar/toolbar-divider.d.ts +0 -3
- package/dist/features/toolbar/toolbar-divider.js +0 -14
- package/dist/features/toolbar/toolbar-sections.d.ts +0 -23
- package/dist/features/toolbar/toolbar-sections.js +0 -107
- package/dist/utils/color.d.ts +0 -1
- package/dist/utils/color.js +0 -18
- package/dist/utils/diff/index.d.ts +0 -2
- package/dist/utils/diff/index.js +0 -2
- package/dist/utils/editor.d.ts +0 -6
- package/dist/utils/editor.js +0 -29
- package/dist/utils/embed.d.ts +0 -2
- package/dist/utils/embed.js +0 -27
- package/dist/utils/file/index.d.ts +0 -3
- package/dist/utils/file/index.js +0 -3
- package/dist/utils/file.d.ts +0 -3
- package/dist/utils/file.js +0 -20
- package/dist/utils/fileHandler.js +0 -69
- package/dist/utils/index.d.ts +0 -10
- package/dist/utils/index.js +0 -10
- package/dist/utils/link.d.ts +0 -5
- package/dist/utils/link.js +0 -25
- package/dist/utils/resource.d.ts +0 -2
- package/dist/utils/resource.js +0 -38
- package/dist/utils/table/index.d.ts +0 -1
- package/dist/utils/table/index.js +0 -1
- /package/dist/{app/editor/EditorDiff → EditorDiff}/index.d.ts +0 -0
- /package/dist/{features/markdown → EditorMarkdown}/UploadProgress.d.ts +0 -0
- /package/dist/{features/markdown → EditorMarkdown}/UploadProgress.js +0 -0
- /package/dist/{features/markdown → EditorMarkdown}/util.d.ts +0 -0
- /package/dist/{features/markdown → EditorMarkdown}/util.js +0 -0
- /package/dist/{components → component}/CustomFloatingMenu/index.d.ts +0 -0
- /package/dist/{components → component}/CustomFloatingMenu/index.js +0 -0
- /package/dist/{components → component}/FloatingPopover/index.d.ts +0 -0
- /package/dist/{components → component}/HoverPopover/index.d.ts +0 -0
- /package/dist/{components → component}/Icons/add-circle-fill-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/add-circle-fill-icon.js +0 -0
- /package/dist/{components → component}/Icons/add-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/add-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/ai-generate-2-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/ai-generate-2-icon.js +0 -0
- /package/dist/{components → component}/Icons/ai-generate-text-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/ai-generate-text-icon.js +0 -0
- /package/dist/{components → component}/Icons/align-bottom-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/align-bottom-icon.js +0 -0
- /package/dist/{components → component}/Icons/align-center-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/align-center-icon.js +0 -0
- /package/dist/{components → component}/Icons/align-justify-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/align-justify-icon.js +0 -0
- /package/dist/{components → component}/Icons/align-left-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/align-left-icon.js +0 -0
- /package/dist/{components → component}/Icons/align-right-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/align-right-icon.js +0 -0
- /package/dist/{components → component}/Icons/align-top-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/align-top-icon.js +0 -0
- /package/dist/{components → component}/Icons/align-vertically-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/align-vertically-icon.js +0 -0
- /package/dist/{components → component}/Icons/anticlockwise-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/anticlockwise-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/arrow-down-s-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/arrow-down-s-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/arrow-go-back-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/arrow-go-back-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/arrow-go-forward-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/arrow-go-forward-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/arrow-left-wide-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/arrow-left-wide-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/at-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/at-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/attachment-2-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/attachment-2-icon.js +0 -0
- /package/dist/{components → component}/Icons/attachment-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/attachment-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/bilibili-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/bilibili-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/bold-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/bold-icon.js +0 -0
- /package/dist/{components → component}/Icons/brush-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/brush-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/carousel-view-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/carousel-view-icon.js +0 -0
- /package/dist/{components → component}/Icons/checkbox-blank-circle-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/checkbox-blank-circle-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/checkbox-circle-fill-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/checkbox-circle-fill-icon.js +0 -0
- /package/dist/{components → component}/Icons/checkbox-circle-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/checkbox-circle-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/chrome-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/chrome-icon.js +0 -0
- /package/dist/{components → component}/Icons/clockwise-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/clockwise-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/close-circle-fill-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/close-circle-fill-icon.js +0 -0
- /package/dist/{components → component}/Icons/code-box-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/code-box-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/code-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/code-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/code-s-slash-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/code-s-slash-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/collapse-horizontal-line.d.ts +0 -0
- /package/dist/{components → component}/Icons/collapse-horizontal-line.js +0 -0
- /package/dist/{components → component}/Icons/collapse-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/collapse-icon.js +0 -0
- /package/dist/{components → component}/Icons/command-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/command-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/copy-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/copy-icon.js +0 -0
- /package/dist/{components → component}/Icons/custom-size-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/custom-size-icon.js +0 -0
- /package/dist/{components → component}/Icons/delete-back-2-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/delete-back-2-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/delete-column-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/delete-column-icon.js +0 -0
- /package/dist/{components → component}/Icons/delete-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/delete-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/delete-row-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/delete-row-icon.js +0 -0
- /package/dist/{components → component}/Icons/double-quotes-l-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/double-quotes-l-icon.js +0 -0
- /package/dist/{components → component}/Icons/download-2-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/download-2-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/download-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/download-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/draggable-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/draggable-icon.js +0 -0
- /package/dist/{components → component}/Icons/edit-box-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/edit-box-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/edit-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/edit-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/emotion-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/emotion-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/eraser-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/eraser-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/error-warning-fill-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/error-warning-fill-icon.js +0 -0
- /package/dist/{components → component}/Icons/expand-horizontal-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/expand-horizontal-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/expend-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/expend-icon.js +0 -0
- /package/dist/{components → component}/Icons/export-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/export-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/eye-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/eye-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/file-copy-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/file-copy-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/file-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/file-icon.js +0 -0
- /package/dist/{components → component}/Icons/file-upload-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/file-upload-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/flip-grid-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/flip-grid-icon.js +0 -0
- /package/dist/{components → component}/Icons/flip-left-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/flip-left-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/flip-right-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/flip-right-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/flow-chart-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/flow-chart-icon.js +0 -0
- /package/dist/{components → component}/Icons/folder-2-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/folder-2-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/font-color-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/font-color-icon.js +0 -0
- /package/dist/{components → component}/Icons/font-family-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/font-family-icon.js +0 -0
- /package/dist/{components → component}/Icons/font-size-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/font-size-icon.js +0 -0
- /package/dist/{components → component}/Icons/format-clear-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/format-clear-icon.js +0 -0
- /package/dist/{components → component}/Icons/formula-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/formula-icon.js +0 -0
- /package/dist/{components → component}/Icons/fullscreen-exit-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/fullscreen-exit-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/fullscreen-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/fullscreen-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/functions-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/functions-icon.js +0 -0
- /package/dist/{components → component}/Icons/game-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/game-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/h-1-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/h-1-icon.js +0 -0
- /package/dist/{components → component}/Icons/h-2-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/h-2-icon.js +0 -0
- /package/dist/{components → component}/Icons/h-3-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/h-3-icon.js +0 -0
- /package/dist/{components → component}/Icons/h-4-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/h-4-icon.js +0 -0
- /package/dist/{components → component}/Icons/h-5-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/h-5-icon.js +0 -0
- /package/dist/{components → component}/Icons/h-6-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/h-6-icon.js +0 -0
- /package/dist/{components → component}/Icons/heading-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/heading-icon.js +0 -0
- /package/dist/{components → component}/Icons/image-add-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/image-add-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/image-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/image-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/import-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/import-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/indent-decrease-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/indent-decrease-icon.js +0 -0
- /package/dist/{components → component}/Icons/indent-increase-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/indent-increase-icon.js +0 -0
- /package/dist/{components → component}/Icons/index.d.ts +0 -0
- /package/dist/{components → component}/Icons/index.js +0 -0
- /package/dist/{components → component}/Icons/information-2-fill-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/information-2-fill-icon.js +0 -0
- /package/dist/{components → component}/Icons/information-2-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/information-2-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/insert-column-left-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/insert-column-left-icon.js +0 -0
- /package/dist/{components → component}/Icons/insert-column-right-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/insert-column-right-icon.js +0 -0
- /package/dist/{components → component}/Icons/insert-row-bottom-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/insert-row-bottom-icon.js +0 -0
- /package/dist/{components → component}/Icons/insert-row-top-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/insert-row-top-icon.js +0 -0
- /package/dist/{components → component}/Icons/italic-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/italic-icon.js +0 -0
- /package/dist/{components → component}/Icons/keyboard-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/keyboard-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/layout-left-2-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/layout-left-2-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/layout-top-2-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/layout-top-2-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/link-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/link-icon.js +0 -0
- /package/dist/{components → component}/Icons/link-unlink-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/link-unlink-icon.js +0 -0
- /package/dist/{components → component}/Icons/list-check-2-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/list-check-2-icon.js +0 -0
- /package/dist/{components → component}/Icons/list-check-3-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/list-check-3-icon.js +0 -0
- /package/dist/{components → component}/Icons/list-ordered-2-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/list-ordered-2-icon.js +0 -0
- /package/dist/{components → component}/Icons/list-unordered-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/list-unordered-icon.js +0 -0
- /package/dist/{components → component}/Icons/mark-pen-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/mark-pen-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/markdown-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/markdown-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/markup-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/markup-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/menu-fold-2-fill-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/menu-fold-2-fill-icon.js +0 -0
- /package/dist/{components → component}/Icons/merge-cells-horizontal-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/merge-cells-horizontal-icon.js +0 -0
- /package/dist/{components → component}/Icons/merge-cells-vertical-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/merge-cells-vertical-icon.js +0 -0
- /package/dist/{components → component}/Icons/mind-map-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/mind-map-icon.js +0 -0
- /package/dist/{components → component}/Icons/more-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/more-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/movie-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/movie-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/music-2-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/music-2-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/node-tree-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/node-tree-icon.js +0 -0
- /package/dist/{components → component}/Icons/notification-3-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/notification-3-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/organization-chart-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/organization-chart-icon.js +0 -0
- /package/dist/{components → component}/Icons/pause-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/pause-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/play-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/play-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/question-fill-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/question-fill-icon.js +0 -0
- /package/dist/{components → component}/Icons/quote-text-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/quote-text-icon.js +0 -0
- /package/dist/{components → component}/Icons/repeat-2-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/repeat-2-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/reset-left-fill-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/reset-left-fill-icon.js +0 -0
- /package/dist/{components → component}/Icons/scissors-cut-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/scissors-cut-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/screenshot-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/screenshot-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/scroll-to-bottom-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/scroll-to-bottom-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/separator-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/separator-icon.js +0 -0
- /package/dist/{components → component}/Icons/share-box-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/share-box-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/sketching-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/sketching-icon.js +0 -0
- /package/dist/{components → component}/Icons/skip-down-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/skip-down-icon.js +0 -0
- /package/dist/{components → component}/Icons/skip-left-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/skip-left-icon.js +0 -0
- /package/dist/{components → component}/Icons/skip-right-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/skip-right-icon.js +0 -0
- /package/dist/{components → component}/Icons/skip-up-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/skip-up-icon.js +0 -0
- /package/dist/{components → component}/Icons/slash-commands-2-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/slash-commands-2-icon.js +0 -0
- /package/dist/{components → component}/Icons/speed-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/speed-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/split-cells-horizontal-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/split-cells-horizontal-icon.js +0 -0
- /package/dist/{components → component}/Icons/split-cells-vertical-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/split-cells-vertical-icon.js +0 -0
- /package/dist/{components → component}/Icons/square-root-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/square-root-icon.js +0 -0
- /package/dist/{components → component}/Icons/strikethrough-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/strikethrough-icon.js +0 -0
- /package/dist/{components → component}/Icons/subscript-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/subscript-icon.js +0 -0
- /package/dist/{components → component}/Icons/superscript-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/superscript-icon.js +0 -0
- /package/dist/{components → component}/Icons/table-2-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/table-2-icon.js +0 -0
- /package/dist/{components → component}/Icons/table-view-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/table-view-icon.js +0 -0
- /package/dist/{components → component}/Icons/text-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/text-icon.js +0 -0
- /package/dist/{components → component}/Icons/text-wrap-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/text-wrap-icon.js +0 -0
- /package/dist/{components → component}/Icons/title-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/title-icon.js +0 -0
- /package/dist/{components → component}/Icons/tooltip-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/tooltip-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/underline-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/underline-icon.js +0 -0
- /package/dist/{components → component}/Icons/upload-cloud-2-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/upload-cloud-2-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/upload-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/upload-icon.js +0 -0
- /package/dist/{components → component}/Icons/user-smile-fill-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/user-smile-fill-icon.js +0 -0
- /package/dist/{components → component}/Icons/volume-down-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/volume-down-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/volume-mute-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/volume-mute-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/volume-up-line-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/volume-up-line-icon.js +0 -0
- /package/dist/{components → component}/Icons/window-fill-icon.d.ts +0 -0
- /package/dist/{components → component}/Icons/window-fill-icon.js +0 -0
- /package/dist/{components → component}/ImageViewer/Item.d.ts +0 -0
- /package/dist/{components → component}/ImageViewer/Item.js +0 -0
- /package/dist/{components → component}/ImageViewer/Provider.d.ts +0 -0
- /package/dist/{components → component}/ImageViewer/Provider.js +0 -0
- /package/dist/{components → component}/ImageViewer/Toolbar.d.ts +0 -0
- /package/dist/{components → component}/ImageViewer/Toolbar.js +0 -0
- /package/dist/{components → component}/ImageViewer/context.d.ts +0 -0
- /package/dist/{components → component}/ImageViewer/context.js +0 -0
- /package/dist/{components → component}/ImageViewer/index.d.ts +0 -0
- /package/dist/{components → component}/ImageViewer/index.js +0 -0
- /package/dist/{components → component}/ImageViewer/styles.d.ts +0 -0
- /package/dist/{components → component}/ImageViewer/styles.js +0 -0
- /package/dist/{components → component}/ImageViewer/types.d.ts +0 -0
- /package/dist/{components → component}/ImageViewer/types.js +0 -0
- /package/dist/{components → component}/Toolbar/EditorAlignSelect.d.ts +0 -0
- /package/dist/{components → component}/Toolbar/EditorCode.d.ts +0 -0
- /package/dist/{components → component}/Toolbar/EditorFontBgColor.d.ts +0 -0
- /package/dist/{components → component}/Toolbar/EditorFontBgColor.js +0 -0
- /package/dist/{components → component}/Toolbar/EditorFontColor.d.ts +0 -0
- /package/dist/{components → component}/Toolbar/EditorFontColor.js +0 -0
- /package/dist/{components → component}/Toolbar/EditorFontSize.d.ts +0 -0
- /package/dist/{components → component}/Toolbar/EditorFontSize.js +0 -0
- /package/dist/{components → component}/Toolbar/EditorHeading.d.ts +0 -0
- /package/dist/{components → component}/Toolbar/EditorInsert/index.d.ts +0 -0
- /package/dist/{components → component}/Toolbar/EditorListSelect.d.ts +0 -0
- /package/dist/{components → component}/Toolbar/EditorMath.d.ts +0 -0
- /package/dist/{components → component}/Toolbar/EditorMore/NotificationDialog.d.ts +0 -0
- /package/dist/{components → component}/Toolbar/EditorScript.d.ts +0 -0
- /package/dist/{components → component}/Toolbar/EditorVerticalAlignSelect.d.ts +0 -0
- /package/dist/{components → component}/Toolbar/Item.d.ts +0 -0
- /package/dist/{components → component}/Toolbar/TableSizePicker.d.ts +0 -0
- /package/dist/{components → component}/index.d.ts +0 -0
- /package/dist/{components → component}/index.js +0 -0
- /package/dist/{constants → contants}/highlight.d.ts +0 -0
- /package/dist/{constants → contants}/highlight.js +0 -0
- /package/dist/{constants → contants}/markdown-placeholder.d.ts +0 -0
- /package/dist/{constants → contants}/markdown-placeholder.js +0 -0
- /package/dist/{constants → contants}/placeholder.d.ts +0 -0
- /package/dist/{constants → contants}/placeholder.js +0 -0
- /package/dist/{constants → contants}/shortcut-key.d.ts +0 -0
- /package/dist/{constants → contants}/shortcut-key.js +0 -0
- /package/dist/{constants → contants}/slash-commands.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/component/Alert/index.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/component/Attachment/AttachmentContent.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/component/CodeBlock/Readonly.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/component/CodeBlock/index.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/component/DrawPanel/ExcalidrawEditor.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/component/DrawPanel/ExcalidrawEditor.js +0 -0
- /package/dist/{editor-core/extensions → extension}/component/DrawPanel/Modal.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/component/DrawPanel/Modal.js +0 -0
- /package/dist/{editor-core/extensions → extension}/component/EmojiList/index.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/component/EmojiList/index.js +0 -0
- /package/dist/{editor-core/extensions → extension}/component/FlipGrid/ColumnView.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/component/FlipGrid/index.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/component/FlipGrid/index.js +0 -0
- /package/dist/{editor-core/extensions → extension}/component/FlipGrid/utils.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/component/FlipGrid/utils.js +0 -0
- /package/dist/{editor-core/extensions → extension}/component/Flow/Edit.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/component/Flow/FlowDiagram.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/component/Flow/FlowDiagram.js +0 -0
- /package/dist/{editor-core/extensions → extension}/component/Flow/Insert.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/component/Flow/Readonly.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/component/Flow/Readonly.js +0 -0
- /package/dist/{editor-core/extensions → extension}/component/Flow/useMermaidRender.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/component/Flow/useMermaidRender.js +0 -0
- /package/dist/{editor-core/extensions → extension}/component/Flow/utils.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/component/Flow/utils.js +0 -0
- /package/dist/{features/media/iframe → extension/component/Iframe}/Readonly.d.ts +0 -0
- /package/dist/{features/media/iframe → extension/component/Iframe}/Readonly.js +0 -0
- /package/dist/{features/media/image → extension/component/Image}/Crop.js +0 -0
- /package/dist/{features/media/image → extension/component/Image}/Readonly.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/component/Link/Markdown.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/component/Mathematics/block/Readonly.js +0 -0
- /package/dist/{editor-core/extensions → extension}/component/Mathematics/index.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/component/Mathematics/index.js +0 -0
- /package/dist/{editor-core/extensions → extension}/component/Mathematics/inline/Readonly.js +0 -0
- /package/dist/{editor-core/extensions → extension}/component/MentionList/index.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/component/MentionList/index.js +0 -0
- /package/dist/{features/table → extension/component}/TableCellHandleMenu/index.d.ts +0 -0
- /package/dist/{features/table → extension/component}/TableExtendButton/TableExtendButton.css +0 -0
- /package/dist/{features/table → extension/component}/TableExtendButton/use-table-extend-row-column.d.ts +0 -0
- /package/dist/{features/table → extension/component}/TableExtendButton/use-table-extend-row-column.js +0 -0
- /package/dist/{features/table → extension/component}/TableHandle/TableHandleMenu.css +0 -0
- /package/dist/{features/table → extension/component}/TableHandle/use-table-handle-positioning.d.ts +0 -0
- /package/dist/{features/table → extension/component}/TableHandle/use-table-handle-state.js +0 -0
- /package/dist/{features/table → extension/component}/TableSelectionOverlay/index.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/component/Tooltip/EditPopover.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/component/Tooltip/index.d.ts +0 -0
- /package/dist/{features/media/video → extension/component/Video}/Readonly.d.ts +0 -0
- /package/dist/{features/media/video → extension/component/Video}/Readonly.js +0 -0
- /package/dist/{editor-core/extensions → extension}/extension/AiWriting.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/extension/AiWriting.js +0 -0
- /package/dist/{editor-core/extensions → extension}/extension/SlashCommands.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/extension/SlashCommands.js +0 -0
- /package/dist/{editor-core/extensions → extension}/extension/StructuredDiff.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/extension/index.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/extension/index.js +0 -0
- /package/dist/{editor-core/extensions → extension}/mark/Code.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/mark/Code.js +0 -0
- /package/dist/{editor-core/extensions → extension}/mark/Tooltip.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/mark/Tooltip.js +0 -0
- /package/dist/{editor-core/extensions → extension}/node/Alert.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/node/Alert.js +0 -0
- /package/dist/{editor-core/extensions → extension}/node/CodeBlockLowlight.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/node/Details.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/node/Details.js +0 -0
- /package/dist/{editor-core/extensions → extension}/node/DrawPanel.js +0 -0
- /package/dist/{editor-core/extensions → extension}/node/Emoji.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/node/Emoji.js +0 -0
- /package/dist/{editor-core/extensions → extension}/node/FlipGrid.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/node/FlipGrid.js +0 -0
- /package/dist/{editor-core/extensions → extension}/node/Flow/index.js +0 -0
- /package/dist/{editor-core/extensions → extension}/node/HorizontalRule.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/node/HorizontalRule.js +0 -0
- /package/dist/{editor-core/extensions → extension}/node/Indent.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/node/Indent.js +0 -0
- /package/dist/{editor-core/extensions → extension}/node/InlineUploadProgress.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/node/InlineUploadProgress.js +0 -0
- /package/dist/{editor-core/extensions → extension}/node/Link/helpers/autolink.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/node/Link/helpers/autolink.js +0 -0
- /package/dist/{editor-core/extensions → extension}/node/Link/helpers/clickHandler.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/node/Link/helpers/clickHandler.js +0 -0
- /package/dist/{editor-core/extensions → extension}/node/Link/helpers/pasteHandler.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/node/Link/helpers/pasteHandler.js +0 -0
- /package/dist/{editor-core/extensions → extension}/node/Link/helpers/whitespace.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/node/Link/helpers/whitespace.js +0 -0
- /package/dist/{editor-core/extensions → extension}/node/Link/index.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/node/ListKit.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/node/Mention.js +0 -0
- /package/dist/{editor-core/extensions → extension}/node/Script.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/node/Script.js +0 -0
- /package/dist/{editor-core/extensions → extension}/node/Table.d.ts +0 -0
- /package/dist/{features/table/plugin → extension/node/TableHandler}/create-image.d.ts +0 -0
- /package/dist/{features/table/plugin → extension/node/TableHandler}/create-image.js +0 -0
- /package/dist/{editor-core/extensions → extension}/node/TableOfContents/plugin.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/node/TableOfContents/types.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/node/TableOfContents/types.js +0 -0
- /package/dist/{editor-core/extensions → extension}/node/TableOfContents/util.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/node/TableOfContents/util.js +0 -0
- /package/dist/{editor-core/extensions → extension}/node/UploadProgress.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/node/UploadProgress.js +0 -0
- /package/dist/{editor-core/extensions → extension}/node/VerticalAlign.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/node/VerticalAlign.js +0 -0
- /package/dist/{editor-core/extensions → extension}/node/YamlFormat.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/node/YamlFormat.js +0 -0
- /package/dist/{editor-core/extensions → extension}/node/Youtube.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/node/Youtube.js +0 -0
- /package/dist/{editor-core/extensions → extension}/node/index.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/node/index.js +0 -0
- /package/dist/{editor-core/extensions → extension}/suggestion/emoji.d.ts +0 -0
- /package/dist/{editor-core/extensions → extension}/suggestion/emoji.js +0 -0
- /package/dist/{types → type}/index.d.ts +0 -0
- /package/dist/{types → type}/index.js +0 -0
- /package/dist/{utils → util}/decorations.d.ts +0 -0
- /package/dist/{utils → util}/decorations.js +0 -0
- /package/dist/{utils → util}/fileDownload.d.ts +0 -0
- /package/dist/{utils → util}/fileDownload.js +0 -0
- /package/dist/{utils → util}/floating.d.ts +0 -0
- /package/dist/{utils → util}/floating.js +0 -0
- /package/dist/{utils → util}/linewiseConvert.d.ts +0 -0
- /package/dist/{utils → util}/linewiseConvert.js +0 -0
- /package/dist/{utils → util}/shortcutKey.d.ts +0 -0
- /package/dist/{utils → util}/structuredDiff.d.ts +0 -0
- /package/dist/{utils → util}/structuredDiff.js +0 -0
- /package/dist/{utils → util}/table-utils.d.ts +0 -0
- /package/dist/{utils → util}/table-utils.js +0 -0
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
var getNumericWidth = function getNumericWidth(width) {
|
|
3
|
-
return typeof width === 'number' ? width : undefined;
|
|
4
|
-
};
|
|
5
|
-
export var useMediaWidth = function useMediaWidth(_ref) {
|
|
6
|
-
var editor = _ref.editor,
|
|
7
|
-
contentRef = _ref.contentRef,
|
|
8
|
-
nodeClassName = _ref.nodeClassName,
|
|
9
|
-
width = _ref.width,
|
|
10
|
-
elementRef = _ref.elementRef;
|
|
11
|
-
var isPercentWidth = React.useCallback(function () {
|
|
12
|
-
if (!width) return true;
|
|
13
|
-
return typeof width === 'string' && width.endsWith('%');
|
|
14
|
-
}, [width]);
|
|
15
|
-
var getCurrentWidthPercent = React.useCallback(function () {
|
|
16
|
-
if (isPercentWidth()) {
|
|
17
|
-
if (!width) return '100';
|
|
18
|
-
if (typeof width === 'string' && width.endsWith('%')) {
|
|
19
|
-
return width.replace('%', '');
|
|
20
|
-
}
|
|
21
|
-
return '100';
|
|
22
|
-
}
|
|
23
|
-
return 'pixel';
|
|
24
|
-
}, [isPercentWidth, width]);
|
|
25
|
-
var getEditorWidth = React.useCallback(function () {
|
|
26
|
-
var _editor$view;
|
|
27
|
-
if (contentRef.current) {
|
|
28
|
-
var current = contentRef.current;
|
|
29
|
-
while (current) {
|
|
30
|
-
var _current$classList;
|
|
31
|
-
if ((_current$classList = current.classList) !== null && _current$classList !== void 0 && _current$classList.contains(nodeClassName)) {
|
|
32
|
-
var style = window.getComputedStyle(current);
|
|
33
|
-
var paddingLeft = parseFloat(style.paddingLeft) || 0;
|
|
34
|
-
var paddingRight = parseFloat(style.paddingRight) || 0;
|
|
35
|
-
return current.clientWidth - paddingLeft - paddingRight;
|
|
36
|
-
}
|
|
37
|
-
current = current.parentElement;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
if (editor !== null && editor !== void 0 && (_editor$view = editor.view) !== null && _editor$view !== void 0 && _editor$view.dom) {
|
|
41
|
-
var editorElement = editor.view.dom;
|
|
42
|
-
var _style = window.getComputedStyle(editorElement);
|
|
43
|
-
var _paddingLeft = parseFloat(_style.paddingLeft) || 0;
|
|
44
|
-
var _paddingRight = parseFloat(_style.paddingRight) || 0;
|
|
45
|
-
var editorWidth = editorElement.clientWidth - _paddingLeft - _paddingRight;
|
|
46
|
-
if (editorWidth > 0) {
|
|
47
|
-
return editorWidth;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return 800;
|
|
51
|
-
}, [contentRef, editor, nodeClassName]);
|
|
52
|
-
var getCurrentDisplayWidth = React.useCallback(function () {
|
|
53
|
-
if (!elementRef.current) {
|
|
54
|
-
return getEditorWidth();
|
|
55
|
-
}
|
|
56
|
-
var computedStyle = window.getComputedStyle(elementRef.current);
|
|
57
|
-
var displayWidth = elementRef.current.offsetWidth;
|
|
58
|
-
if (typeof width === 'string' && width.endsWith('%')) {
|
|
59
|
-
return displayWidth;
|
|
60
|
-
}
|
|
61
|
-
var numericWidth = getNumericWidth(width);
|
|
62
|
-
if (numericWidth !== undefined) {
|
|
63
|
-
if (computedStyle.maxWidth === '100%' && displayWidth < numericWidth) {
|
|
64
|
-
return displayWidth;
|
|
65
|
-
}
|
|
66
|
-
return numericWidth;
|
|
67
|
-
}
|
|
68
|
-
return getEditorWidth();
|
|
69
|
-
}, [elementRef, getEditorWidth, width]);
|
|
70
|
-
return {
|
|
71
|
-
isPercentWidth: isPercentWidth,
|
|
72
|
-
getCurrentWidthPercent: getCurrentWidthPercent,
|
|
73
|
-
getEditorWidth: getEditorWidth,
|
|
74
|
-
getCurrentDisplayWidth: getCurrentDisplayWidth
|
|
75
|
-
};
|
|
76
|
-
};
|
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
var _excluded = ["editor", "onOpenChange", "className", "onResizeStart"];
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
|
-
import { Menu } from "../../../components";
|
|
6
|
-
import { ArrowDownSLineIcon, DeleteLineIcon, MergeCellsVerticalIcon, MoreLineIcon, SplitCellsVerticalIcon } from "../../../components/Icons";
|
|
7
|
-
import { DeleteBack2LineIcon } from "../../../components/Icons/delete-back-2-line-icon";
|
|
8
|
-
import { Box } from '@mui/material';
|
|
9
|
-
import { useTheme } from '@mui/material/styles';
|
|
10
|
-
import { CellSelection, cellAround, deleteCellSelection, mergeCells, splitCell } from '@tiptap/pm/tables';
|
|
11
|
-
import { useEditorState } from '@tiptap/react';
|
|
12
|
-
import React, { forwardRef } from 'react';
|
|
13
|
-
import { buildTableAlignMenu, buildTableColorMenu, createTableMenuDivider } from "../TableHandle/menu-builders";
|
|
14
|
-
import { useTableMenuOpen } from "../TableHandle/use-table-menu-open";
|
|
15
|
-
export var TableCellHandleMenu = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
16
|
-
var editor = _ref.editor,
|
|
17
|
-
onOpenChange = _ref.onOpenChange,
|
|
18
|
-
className = _ref.className,
|
|
19
|
-
onResizeStart = _ref.onResizeStart,
|
|
20
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
-
var theme = useTheme();
|
|
22
|
-
var editorState = useEditorState({
|
|
23
|
-
editor: editor,
|
|
24
|
-
selector: function selector(context) {
|
|
25
|
-
if (!context.editor) return null;
|
|
26
|
-
return {
|
|
27
|
-
selection: context.editor.state.selection,
|
|
28
|
-
isEditable: context.editor.isEditable
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
var _useTableMenuOpen = useTableMenuOpen({
|
|
33
|
-
editor: editor,
|
|
34
|
-
onOpenChange: onOpenChange
|
|
35
|
-
}),
|
|
36
|
-
isMenuOpen = _useTableMenuOpen.isMenuOpen,
|
|
37
|
-
handleMenuToggle = _useTableMenuOpen.handleMenuToggle;
|
|
38
|
-
var menuList = React.useMemo(function () {
|
|
39
|
-
if (!editor || !editor.isEditable) return [];
|
|
40
|
-
var canMerge = function () {
|
|
41
|
-
try {
|
|
42
|
-
return mergeCells(editor.state, undefined);
|
|
43
|
-
} catch (_unused) {
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
}();
|
|
47
|
-
var canSplit = function () {
|
|
48
|
-
try {
|
|
49
|
-
return splitCell(editor.state, undefined);
|
|
50
|
-
} catch (_unused2) {
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
}();
|
|
54
|
-
var menuItems = [];
|
|
55
|
-
if (canMerge || canSplit) {
|
|
56
|
-
if (canMerge) {
|
|
57
|
-
menuItems.push({
|
|
58
|
-
key: 'merge-cells',
|
|
59
|
-
label: '合并单元格',
|
|
60
|
-
icon: /*#__PURE__*/React.createElement(MergeCellsVerticalIcon, {
|
|
61
|
-
sx: {
|
|
62
|
-
fontSize: '1rem'
|
|
63
|
-
}
|
|
64
|
-
}),
|
|
65
|
-
onClick: function onClick() {
|
|
66
|
-
var state = editor.state,
|
|
67
|
-
view = editor.view;
|
|
68
|
-
mergeCells(state, view.dispatch.bind(view));
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
if (canSplit) {
|
|
73
|
-
menuItems.push({
|
|
74
|
-
key: 'split-cell',
|
|
75
|
-
label: '拆分单元格',
|
|
76
|
-
icon: /*#__PURE__*/React.createElement(SplitCellsVerticalIcon, {
|
|
77
|
-
sx: {
|
|
78
|
-
fontSize: '1rem'
|
|
79
|
-
}
|
|
80
|
-
}),
|
|
81
|
-
onClick: function onClick() {
|
|
82
|
-
var state = editor.state,
|
|
83
|
-
view = editor.view;
|
|
84
|
-
splitCell(state, view.dispatch.bind(view));
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
menuItems.push(createTableMenuDivider('divider1'));
|
|
89
|
-
}
|
|
90
|
-
menuItems.push(buildTableColorMenu({
|
|
91
|
-
editor: editor,
|
|
92
|
-
theme: theme
|
|
93
|
-
}), buildTableAlignMenu({
|
|
94
|
-
editor: editor
|
|
95
|
-
}));
|
|
96
|
-
menuItems.push({
|
|
97
|
-
key: 'clear-content',
|
|
98
|
-
label: '清空单元格内容',
|
|
99
|
-
icon: /*#__PURE__*/React.createElement(DeleteBack2LineIcon, {
|
|
100
|
-
sx: {
|
|
101
|
-
fontSize: '1rem'
|
|
102
|
-
}
|
|
103
|
-
}),
|
|
104
|
-
onClick: function onClick() {
|
|
105
|
-
if (!editor) return;
|
|
106
|
-
var state = editor.state,
|
|
107
|
-
view = editor.view;
|
|
108
|
-
if (state.selection instanceof CellSelection) {
|
|
109
|
-
deleteCellSelection(state, view.dispatch.bind(view));
|
|
110
|
-
} else {
|
|
111
|
-
var $anchor = state.selection.$anchor;
|
|
112
|
-
var cell = cellAround($anchor);
|
|
113
|
-
if (cell) {
|
|
114
|
-
var cellNode = state.doc.nodeAt(cell.pos);
|
|
115
|
-
if (cellNode) {
|
|
116
|
-
var from = cell.pos + 1;
|
|
117
|
-
var to = cell.pos + cellNode.nodeSize - 1;
|
|
118
|
-
if (from < to) {
|
|
119
|
-
view.dispatch(state.tr.delete(from, to));
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
attrs: function () {
|
|
126
|
-
if (!editor) return {
|
|
127
|
-
disabled: true
|
|
128
|
-
};
|
|
129
|
-
var selection = editor.state.selection;
|
|
130
|
-
if (selection instanceof CellSelection) {
|
|
131
|
-
var hasContent = false;
|
|
132
|
-
selection.forEachCell(function (cell) {
|
|
133
|
-
if (cell.content.size > 0) {
|
|
134
|
-
hasContent = true;
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
return hasContent ? {} : {
|
|
138
|
-
disabled: true
|
|
139
|
-
};
|
|
140
|
-
} else {
|
|
141
|
-
var $anchor = selection.$anchor;
|
|
142
|
-
var cell = cellAround($anchor);
|
|
143
|
-
if (cell) {
|
|
144
|
-
var cellNode = editor.state.doc.nodeAt(cell.pos);
|
|
145
|
-
return cellNode && cellNode.content.size > 0 ? {} : {
|
|
146
|
-
disabled: true
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
return {
|
|
150
|
-
disabled: true
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
}()
|
|
154
|
-
}, {
|
|
155
|
-
key: 'delete-table',
|
|
156
|
-
label: '删除表格',
|
|
157
|
-
icon: /*#__PURE__*/React.createElement(DeleteLineIcon, {
|
|
158
|
-
sx: {
|
|
159
|
-
fontSize: '1rem'
|
|
160
|
-
}
|
|
161
|
-
}),
|
|
162
|
-
onClick: function onClick() {
|
|
163
|
-
if (!editor) return;
|
|
164
|
-
editor.chain().focus().deleteTable().run();
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
return menuItems;
|
|
168
|
-
}, [editor, theme, editorState]);
|
|
169
|
-
var handleButton = /*#__PURE__*/React.createElement(Box, _extends({
|
|
170
|
-
component: "button",
|
|
171
|
-
ref: ref,
|
|
172
|
-
className: className,
|
|
173
|
-
"aria-label": "Table cells option",
|
|
174
|
-
"aria-haspopup": "menu",
|
|
175
|
-
"aria-expanded": isMenuOpen,
|
|
176
|
-
onMouseDown: function onMouseDown(e) {
|
|
177
|
-
e.stopPropagation();
|
|
178
|
-
if (onResizeStart) {
|
|
179
|
-
onResizeStart('br')(e);
|
|
180
|
-
}
|
|
181
|
-
},
|
|
182
|
-
sx: {
|
|
183
|
-
position: 'absolute',
|
|
184
|
-
top: '50%',
|
|
185
|
-
right: '-8px',
|
|
186
|
-
transform: 'translateY(-50%)',
|
|
187
|
-
border: 'none',
|
|
188
|
-
display: 'flex',
|
|
189
|
-
alignItems: 'center',
|
|
190
|
-
justifyContent: 'center',
|
|
191
|
-
borderRadius: 'var(--mui-shape-borderRadius)',
|
|
192
|
-
cursor: 'pointer',
|
|
193
|
-
padding: '4px',
|
|
194
|
-
width: '14px',
|
|
195
|
-
height: '14px',
|
|
196
|
-
zIndex: 4,
|
|
197
|
-
backgroundColor: 'var(--mui-palette-primary-main)',
|
|
198
|
-
'& .MuiSvgIcon-root': {
|
|
199
|
-
color: 'var(--mui-palette-common-white)'
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
}, props), /*#__PURE__*/React.createElement(MoreLineIcon, {
|
|
203
|
-
sx: {
|
|
204
|
-
width: '0.75rem',
|
|
205
|
-
height: '0.75rem'
|
|
206
|
-
}
|
|
207
|
-
}));
|
|
208
|
-
return /*#__PURE__*/React.createElement(Menu, {
|
|
209
|
-
width: 216,
|
|
210
|
-
context: handleButton,
|
|
211
|
-
list: menuList,
|
|
212
|
-
anchorOrigin: {
|
|
213
|
-
vertical: 'bottom',
|
|
214
|
-
horizontal: 'left'
|
|
215
|
-
},
|
|
216
|
-
transformOrigin: {
|
|
217
|
-
vertical: 'top',
|
|
218
|
-
horizontal: 'left'
|
|
219
|
-
},
|
|
220
|
-
onOpen: function onOpen() {
|
|
221
|
-
return handleMenuToggle(true);
|
|
222
|
-
},
|
|
223
|
-
onClose: function onClose() {
|
|
224
|
-
return handleMenuToggle(false);
|
|
225
|
-
},
|
|
226
|
-
arrowIcon: /*#__PURE__*/React.createElement(ArrowDownSLineIcon, {
|
|
227
|
-
sx: {
|
|
228
|
-
fontSize: '1rem',
|
|
229
|
-
transform: 'rotate(-90deg)'
|
|
230
|
-
}
|
|
231
|
-
})
|
|
232
|
-
});
|
|
233
|
-
});
|
|
234
|
-
TableCellHandleMenu.displayName = 'TableCellHandleMenu';
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { FloatingPortal } from '@floating-ui/react';
|
|
2
|
-
import React, { useMemo } from 'react';
|
|
3
|
-
import { colDragStart, rowDragStart } from "../plugin/drag-helpers";
|
|
4
|
-
import { TableHandleGroup } from "./table-handle-group";
|
|
5
|
-
import { useTableHandlePositioning } from "./use-table-handle-positioning";
|
|
6
|
-
import { useTableHandleState } from "./use-table-handle-state";
|
|
7
|
-
import { useTableHandleVisibility } from "./use-table-handle-visibility";
|
|
8
|
-
/** 负责行/列手柄、扩展按钮与菜单的定位与渲染 */
|
|
9
|
-
export function TableHandle(_ref) {
|
|
10
|
-
var providedEditor = _ref.editor;
|
|
11
|
-
var editor = providedEditor;
|
|
12
|
-
var state = useTableHandleState({
|
|
13
|
-
editor: editor
|
|
14
|
-
});
|
|
15
|
-
var draggingState = useMemo(function () {
|
|
16
|
-
if (!(state !== null && state !== void 0 && state.draggingState)) return undefined;
|
|
17
|
-
return {
|
|
18
|
-
draggedCellOrientation: state.draggingState.draggedCellOrientation,
|
|
19
|
-
mousePos: state.draggingState.mousePos,
|
|
20
|
-
initialOffset: state.draggingState.initialOffset
|
|
21
|
-
};
|
|
22
|
-
}, [state === null || state === void 0 ? void 0 : state.draggingState]);
|
|
23
|
-
var _useTableHandlePositi = useTableHandlePositioning((state === null || state === void 0 ? void 0 : state.show) || false, (state === null || state === void 0 ? void 0 : state.referencePosCell) || null, (state === null || state === void 0 ? void 0 : state.referencePosTable) || null, draggingState),
|
|
24
|
-
rowHandle = _useTableHandlePositi.rowHandle,
|
|
25
|
-
colHandle = _useTableHandlePositi.colHandle;
|
|
26
|
-
var hasValidRowIndex = typeof (state === null || state === void 0 ? void 0 : state.rowIndex) === 'number';
|
|
27
|
-
var hasValidColIndex = typeof (state === null || state === void 0 ? void 0 : state.colIndex) === 'number';
|
|
28
|
-
var _useTableHandleVisibi = useTableHandleVisibility({
|
|
29
|
-
hasValidRowIndex: hasValidRowIndex,
|
|
30
|
-
hasValidColIndex: hasValidColIndex,
|
|
31
|
-
rowMounted: rowHandle.isMounted,
|
|
32
|
-
colMounted: colHandle.isMounted
|
|
33
|
-
}),
|
|
34
|
-
shouldShowRow = _useTableHandleVisibi.shouldShowRow,
|
|
35
|
-
shouldShowColumn = _useTableHandleVisibi.shouldShowColumn,
|
|
36
|
-
toggleRowVisibility = _useTableHandleVisibi.toggleRowVisibility,
|
|
37
|
-
toggleColumnVisibility = _useTableHandleVisibi.toggleColumnVisibility,
|
|
38
|
-
handleMenuOpenChange = _useTableHandleVisibi.handleMenuOpenChange;
|
|
39
|
-
if (!editor || !state) return null;
|
|
40
|
-
var rootElement = state.widgetContainer || document.body;
|
|
41
|
-
return /*#__PURE__*/React.createElement(FloatingPortal, {
|
|
42
|
-
root: rootElement
|
|
43
|
-
}, shouldShowRow && /*#__PURE__*/React.createElement("div", {
|
|
44
|
-
ref: rowHandle.ref,
|
|
45
|
-
style: rowHandle.style
|
|
46
|
-
}, /*#__PURE__*/React.createElement(TableHandleGroup, {
|
|
47
|
-
editor: editor,
|
|
48
|
-
orientation: "row",
|
|
49
|
-
index: state.rowIndex,
|
|
50
|
-
tablePos: state.blockPos,
|
|
51
|
-
tableNode: state.block,
|
|
52
|
-
onToggleOtherHandle: toggleColumnVisibility,
|
|
53
|
-
dragStart: rowDragStart,
|
|
54
|
-
onOpenChange: function onOpenChange(open) {
|
|
55
|
-
return handleMenuOpenChange('row', open);
|
|
56
|
-
}
|
|
57
|
-
})), shouldShowColumn && /*#__PURE__*/React.createElement("div", {
|
|
58
|
-
ref: colHandle.ref,
|
|
59
|
-
style: colHandle.style
|
|
60
|
-
}, /*#__PURE__*/React.createElement(TableHandleGroup, {
|
|
61
|
-
editor: editor,
|
|
62
|
-
orientation: "column",
|
|
63
|
-
index: state.colIndex,
|
|
64
|
-
tablePos: state.blockPos,
|
|
65
|
-
tableNode: state.block,
|
|
66
|
-
onToggleOtherHandle: toggleRowVisibility,
|
|
67
|
-
dragStart: colDragStart,
|
|
68
|
-
onOpenChange: function onOpenChange(open) {
|
|
69
|
-
return handleMenuOpenChange('column', open);
|
|
70
|
-
}
|
|
71
|
-
})));
|
|
72
|
-
}
|
|
73
|
-
TableHandle.displayName = 'TableHandle';
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { MenuItem } from '../../../types';
|
|
2
|
-
import type { Theme } from '@mui/material/styles';
|
|
3
|
-
import type { Editor } from '@tiptap/react';
|
|
4
|
-
interface TableMenuBuilderOptions {
|
|
5
|
-
editor?: Editor | null;
|
|
6
|
-
beforeApply?: () => void;
|
|
7
|
-
}
|
|
8
|
-
interface TableColorMenuBuilderOptions extends TableMenuBuilderOptions {
|
|
9
|
-
theme: Theme;
|
|
10
|
-
}
|
|
11
|
-
export declare const createTableMenuDivider: (key: string) => MenuItem;
|
|
12
|
-
export declare const buildTableColorMenu: ({ editor, theme, beforeApply, }: TableColorMenuBuilderOptions) => MenuItem;
|
|
13
|
-
export declare const buildTableAlignMenu: ({ editor, beforeApply, }: TableMenuBuilderOptions) => MenuItem;
|
|
14
|
-
export {};
|
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
7
|
-
import { AlignBottomIcon, AlignCenterIcon, AlignJustifyIcon, AlignLeftIcon, AlignRightIcon, AlignTopIcon, BrushLineIcon } from "../../../components/Icons";
|
|
8
|
-
import { getThemeTextBgColor, getThemeTextColor } from "../../../constants/enums";
|
|
9
|
-
import { Box, Divider, Typography } from '@mui/material';
|
|
10
|
-
import { TextSelection } from '@tiptap/pm/state';
|
|
11
|
-
import { CellSelection, cellAround } from '@tiptap/pm/tables';
|
|
12
|
-
import React from 'react';
|
|
13
|
-
var deferTableAction = function deferTableAction(editor, action, beforeApply) {
|
|
14
|
-
if (!editor) return;
|
|
15
|
-
beforeApply === null || beforeApply === void 0 || beforeApply();
|
|
16
|
-
window.setTimeout(function () {
|
|
17
|
-
if (editor.isDestroyed) return;
|
|
18
|
-
action();
|
|
19
|
-
}, 0);
|
|
20
|
-
};
|
|
21
|
-
var createMenuSectionLabel = function createMenuSectionLabel(key, label) {
|
|
22
|
-
return {
|
|
23
|
-
key: key,
|
|
24
|
-
customLabel: /*#__PURE__*/React.createElement(Typography, {
|
|
25
|
-
sx: {
|
|
26
|
-
p: 1,
|
|
27
|
-
fontSize: '0.75rem',
|
|
28
|
-
color: 'text.secondary',
|
|
29
|
-
fontWeight: 'bold'
|
|
30
|
-
}
|
|
31
|
-
}, label)
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
export var createTableMenuDivider = function createTableMenuDivider(key) {
|
|
35
|
-
return {
|
|
36
|
-
key: key,
|
|
37
|
-
customLabel: /*#__PURE__*/React.createElement(Divider, {
|
|
38
|
-
sx: {
|
|
39
|
-
my: 0.5
|
|
40
|
-
}
|
|
41
|
-
})
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
var createColorIcon = function createColorIcon(color, theme, withTransparentBorder) {
|
|
45
|
-
return /*#__PURE__*/React.createElement(Box, {
|
|
46
|
-
sx: {
|
|
47
|
-
width: '1rem',
|
|
48
|
-
height: '1rem',
|
|
49
|
-
borderRadius: '50%',
|
|
50
|
-
bgcolor: color,
|
|
51
|
-
border: '1px solid',
|
|
52
|
-
borderColor: withTransparentBorder ? color === theme.palette.common.white ? 'divider' : 'transparent' : 'divider'
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
var applyTextColorToTableSelection = function applyTextColorToTableSelection(editor, color, beforeApply) {
|
|
57
|
-
if (!editor) return;
|
|
58
|
-
if (editor.state.storedMarks) {
|
|
59
|
-
var textStyleMarkType = editor.schema.marks.textStyle;
|
|
60
|
-
if (textStyleMarkType) {
|
|
61
|
-
editor.view.dispatch(editor.state.tr.removeStoredMark(textStyleMarkType));
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
deferTableAction(editor, function () {
|
|
65
|
-
var _editor$state = editor.state,
|
|
66
|
-
selection = _editor$state.selection,
|
|
67
|
-
doc = _editor$state.doc;
|
|
68
|
-
var textStyleMark = editor.schema.marks.textStyle;
|
|
69
|
-
if (!textStyleMark) return;
|
|
70
|
-
if (selection instanceof CellSelection) {
|
|
71
|
-
var tr = editor.state.tr;
|
|
72
|
-
var hasContent = false;
|
|
73
|
-
selection.forEachCell(function (cellNode, cellPos) {
|
|
74
|
-
if (cellNode.content.size === 0) return;
|
|
75
|
-
var from = cellPos + 1;
|
|
76
|
-
var to = cellPos + cellNode.nodeSize - 1;
|
|
77
|
-
if (from >= to) return;
|
|
78
|
-
hasContent = true;
|
|
79
|
-
var mark = textStyleMark.create({
|
|
80
|
-
color: color
|
|
81
|
-
});
|
|
82
|
-
tr = tr.addMark(from, to, mark);
|
|
83
|
-
});
|
|
84
|
-
if (hasContent) {
|
|
85
|
-
editor.view.dispatch(tr);
|
|
86
|
-
editor.commands.focus();
|
|
87
|
-
}
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
var $anchor = selection.$anchor;
|
|
91
|
-
var cell = cellAround($anchor);
|
|
92
|
-
if (cell) {
|
|
93
|
-
var cellNode = doc.nodeAt(cell.pos);
|
|
94
|
-
if (cellNode && cellNode.content.size > 0) {
|
|
95
|
-
var from = cell.pos + 1;
|
|
96
|
-
var to = cell.pos + cellNode.nodeSize - 1;
|
|
97
|
-
if (from < to) {
|
|
98
|
-
var $from = doc.resolve(from);
|
|
99
|
-
var $to = doc.resolve(to);
|
|
100
|
-
var newSelection = TextSelection.between($from, $to, 1);
|
|
101
|
-
if (newSelection) {
|
|
102
|
-
editor.view.dispatch(editor.state.tr.setSelection(newSelection));
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
editor.chain().focus().toggleMark('textStyle', {
|
|
108
|
-
color: color
|
|
109
|
-
}).run();
|
|
110
|
-
}, beforeApply);
|
|
111
|
-
};
|
|
112
|
-
var applyCellAttribute = function applyCellAttribute(editor, attribute, value, beforeApply) {
|
|
113
|
-
if (!editor) return;
|
|
114
|
-
deferTableAction(editor, function () {
|
|
115
|
-
editor.chain().focus().setCellAttribute(attribute, value).run();
|
|
116
|
-
}, beforeApply);
|
|
117
|
-
};
|
|
118
|
-
export var buildTableColorMenu = function buildTableColorMenu(_ref) {
|
|
119
|
-
var editor = _ref.editor,
|
|
120
|
-
theme = _ref.theme,
|
|
121
|
-
beforeApply = _ref.beforeApply;
|
|
122
|
-
return {
|
|
123
|
-
key: 'color',
|
|
124
|
-
label: '颜色',
|
|
125
|
-
icon: /*#__PURE__*/React.createElement(BrushLineIcon, {
|
|
126
|
-
sx: {
|
|
127
|
-
fontSize: '1rem'
|
|
128
|
-
}
|
|
129
|
-
}),
|
|
130
|
-
children: [createMenuSectionLabel('text-color', '文字颜色')].concat(_toConsumableArray(getThemeTextColor(theme).map(function (it) {
|
|
131
|
-
return {
|
|
132
|
-
key: "text-color-".concat(it.value),
|
|
133
|
-
label: it.label,
|
|
134
|
-
icon: createColorIcon(it.value, theme, true),
|
|
135
|
-
onClick: function onClick() {
|
|
136
|
-
return applyTextColorToTableSelection(editor, it.value, beforeApply);
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
})), [createMenuSectionLabel('background-color', '背景颜色')], _toConsumableArray(getThemeTextBgColor(theme).map(function (it) {
|
|
140
|
-
return {
|
|
141
|
-
key: "background-color-".concat(it.value),
|
|
142
|
-
label: it.label,
|
|
143
|
-
icon: createColorIcon(it.value, theme, false),
|
|
144
|
-
onClick: function onClick() {
|
|
145
|
-
var bgColor = it.value === 'transparent' || it.value === 'var(--mui-palette-background-paper)' ? 'transparent' : it.value;
|
|
146
|
-
applyCellAttribute(editor, 'bgcolor', bgColor, beforeApply);
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
})))
|
|
150
|
-
};
|
|
151
|
-
};
|
|
152
|
-
export var buildTableAlignMenu = function buildTableAlignMenu(_ref2) {
|
|
153
|
-
var editor = _ref2.editor,
|
|
154
|
-
beforeApply = _ref2.beforeApply;
|
|
155
|
-
return {
|
|
156
|
-
key: 'align',
|
|
157
|
-
label: '对齐方式',
|
|
158
|
-
icon: /*#__PURE__*/React.createElement(AlignLeftIcon, {
|
|
159
|
-
sx: {
|
|
160
|
-
fontSize: '1rem'
|
|
161
|
-
}
|
|
162
|
-
}),
|
|
163
|
-
children: [createMenuSectionLabel('align-horizontal', '水平对齐方式'), {
|
|
164
|
-
key: 'align-horizontal-left',
|
|
165
|
-
label: '左侧对齐',
|
|
166
|
-
icon: /*#__PURE__*/React.createElement(AlignLeftIcon, {
|
|
167
|
-
sx: {
|
|
168
|
-
fontSize: '1rem'
|
|
169
|
-
}
|
|
170
|
-
}),
|
|
171
|
-
onClick: function onClick() {
|
|
172
|
-
return applyCellAttribute(editor, 'textAlign', 'left', beforeApply);
|
|
173
|
-
}
|
|
174
|
-
}, {
|
|
175
|
-
key: 'align-horizontal-center',
|
|
176
|
-
label: '居中对齐',
|
|
177
|
-
icon: /*#__PURE__*/React.createElement(AlignCenterIcon, {
|
|
178
|
-
sx: {
|
|
179
|
-
fontSize: '1rem'
|
|
180
|
-
}
|
|
181
|
-
}),
|
|
182
|
-
onClick: function onClick() {
|
|
183
|
-
return applyCellAttribute(editor, 'textAlign', 'center', beforeApply);
|
|
184
|
-
}
|
|
185
|
-
}, {
|
|
186
|
-
key: 'align-horizontal-right',
|
|
187
|
-
label: '右侧对齐',
|
|
188
|
-
icon: /*#__PURE__*/React.createElement(AlignRightIcon, {
|
|
189
|
-
sx: {
|
|
190
|
-
fontSize: '1rem'
|
|
191
|
-
}
|
|
192
|
-
}),
|
|
193
|
-
onClick: function onClick() {
|
|
194
|
-
return applyCellAttribute(editor, 'textAlign', 'right', beforeApply);
|
|
195
|
-
}
|
|
196
|
-
}, {
|
|
197
|
-
key: 'align-horizontal-justify',
|
|
198
|
-
label: '两端对齐',
|
|
199
|
-
icon: /*#__PURE__*/React.createElement(AlignJustifyIcon, {
|
|
200
|
-
sx: {
|
|
201
|
-
fontSize: '1rem'
|
|
202
|
-
}
|
|
203
|
-
}),
|
|
204
|
-
onClick: function onClick() {
|
|
205
|
-
return applyCellAttribute(editor, 'textAlign', 'justify', beforeApply);
|
|
206
|
-
}
|
|
207
|
-
}, createMenuSectionLabel('align-vertical', '垂直对齐方式'), {
|
|
208
|
-
key: 'align-vertical-top',
|
|
209
|
-
label: '顶部对齐',
|
|
210
|
-
icon: /*#__PURE__*/React.createElement(AlignTopIcon, {
|
|
211
|
-
sx: {
|
|
212
|
-
fontSize: '1rem'
|
|
213
|
-
}
|
|
214
|
-
}),
|
|
215
|
-
onClick: function onClick() {
|
|
216
|
-
return applyCellAttribute(editor, 'verticalAlign', 'top', beforeApply);
|
|
217
|
-
}
|
|
218
|
-
}, {
|
|
219
|
-
key: 'align-vertical-center',
|
|
220
|
-
label: '居中对齐',
|
|
221
|
-
icon: /*#__PURE__*/React.createElement(AlignCenterIcon, {
|
|
222
|
-
sx: {
|
|
223
|
-
fontSize: '1rem'
|
|
224
|
-
}
|
|
225
|
-
}),
|
|
226
|
-
onClick: function onClick() {
|
|
227
|
-
return applyCellAttribute(editor, 'verticalAlign', 'middle', beforeApply);
|
|
228
|
-
}
|
|
229
|
-
}, {
|
|
230
|
-
key: 'align-vertical-bottom',
|
|
231
|
-
label: '底部对齐',
|
|
232
|
-
icon: /*#__PURE__*/React.createElement(AlignBottomIcon, {
|
|
233
|
-
sx: {
|
|
234
|
-
fontSize: '1rem'
|
|
235
|
-
}
|
|
236
|
-
}),
|
|
237
|
-
onClick: function onClick() {
|
|
238
|
-
return applyCellAttribute(editor, 'verticalAlign', 'bottom', beforeApply);
|
|
239
|
-
}
|
|
240
|
-
}]
|
|
241
|
-
};
|
|
242
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Node } from '@tiptap/pm/model';
|
|
2
|
-
import type { Editor } from '@tiptap/react';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import type { Orientation } from '../../../utils/table';
|
|
5
|
-
interface TableHandleGroupProps {
|
|
6
|
-
editor: Editor;
|
|
7
|
-
orientation: Orientation;
|
|
8
|
-
index?: number;
|
|
9
|
-
tablePos?: number;
|
|
10
|
-
tableNode?: Node;
|
|
11
|
-
onToggleOtherHandle?: (visible: boolean) => void;
|
|
12
|
-
onOpenChange?: (open: boolean) => void;
|
|
13
|
-
dragStart?: (e: React.DragEvent) => void;
|
|
14
|
-
}
|
|
15
|
-
export declare function TableHandleGroup({ editor, orientation, index, tablePos, tableNode, onToggleOtherHandle, onOpenChange, dragStart, }: TableHandleGroupProps): React.JSX.Element;
|
|
16
|
-
export {};
|