@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,512 +0,0 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
5
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
6
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
7
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
9
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
|
-
import { Plugin, TextSelection } from '@tiptap/pm/state';
|
|
11
|
-
import { CellSelection, moveTableColumn, moveTableRow, TableMap } from '@tiptap/pm/tables';
|
|
12
|
-
import { clamp, domCellAround, getCellIndicesFromDOM, getIndexCoordinates, getTableFromDOM, isHTMLElement, isTableNode, safeClosest, selectCellsByCoords } from "../../../utils/table";
|
|
13
|
-
import { setTableHandleRuntime, tableHandlePluginKey } from "./shared";
|
|
14
|
-
import { buildTableDragDecorations } from "./decorations";
|
|
15
|
-
import { buildCellHoverState, buildWrapperHoverState } from "./hover-state";
|
|
16
|
-
import { getCachedHandleRects, getLastEdgeReferences, getNearestRowReference, isPointerNearHandle, preserveCellRectSize } from "./positioning";
|
|
17
|
-
import { syncTableHandleState } from "./state-sync";
|
|
18
|
-
function hideElements(selector, rootEl) {
|
|
19
|
-
rootEl.querySelectorAll(selector).forEach(function (el) {
|
|
20
|
-
el.style.visibility = 'hidden';
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
var TableHandleView = /*#__PURE__*/function () {
|
|
24
|
-
function TableHandleView(editor, editorView, emitUpdate) {
|
|
25
|
-
var _this = this;
|
|
26
|
-
_classCallCheck(this, TableHandleView);
|
|
27
|
-
_defineProperty(this, "editor", void 0);
|
|
28
|
-
_defineProperty(this, "editorView", void 0);
|
|
29
|
-
_defineProperty(this, "state", undefined);
|
|
30
|
-
_defineProperty(this, "menuFrozen", false);
|
|
31
|
-
_defineProperty(this, "mouseState", 'up');
|
|
32
|
-
_defineProperty(this, "tableId", void 0);
|
|
33
|
-
_defineProperty(this, "tablePos", void 0);
|
|
34
|
-
_defineProperty(this, "tableElement", void 0);
|
|
35
|
-
_defineProperty(this, "emitUpdate", void 0);
|
|
36
|
-
_defineProperty(this, "viewMousedownHandler", function (event) {
|
|
37
|
-
_this.mouseState = 'down';
|
|
38
|
-
var _this$editor = _this.editor,
|
|
39
|
-
state = _this$editor.state,
|
|
40
|
-
view = _this$editor.view;
|
|
41
|
-
if (!(state.selection instanceof CellSelection) || _this.editor.isFocused) return;
|
|
42
|
-
var posInfo = view.posAtCoords({
|
|
43
|
-
left: event.clientX,
|
|
44
|
-
top: event.clientY
|
|
45
|
-
});
|
|
46
|
-
if (!posInfo) return;
|
|
47
|
-
var $pos = state.doc.resolve(posInfo.pos);
|
|
48
|
-
var nodes = state.schema.nodes;
|
|
49
|
-
var paraDepth = -1;
|
|
50
|
-
var inTableCell = false;
|
|
51
|
-
for (var d = $pos.depth; d >= 0; d--) {
|
|
52
|
-
var node = $pos.node(d);
|
|
53
|
-
if (!inTableCell && (node.type === nodes.tableCell || node.type === nodes.tableHeader)) {
|
|
54
|
-
inTableCell = true;
|
|
55
|
-
}
|
|
56
|
-
if (paraDepth === -1 && node.type === nodes.paragraph) {
|
|
57
|
-
paraDepth = d;
|
|
58
|
-
}
|
|
59
|
-
if (inTableCell && paraDepth !== -1) break;
|
|
60
|
-
}
|
|
61
|
-
if (!inTableCell || paraDepth === -1) return;
|
|
62
|
-
var from = $pos.start(paraDepth);
|
|
63
|
-
var to = $pos.end(paraDepth);
|
|
64
|
-
var nextSel = TextSelection.create(state.doc, from, to);
|
|
65
|
-
if (state.selection.eq(nextSel)) return;
|
|
66
|
-
view.dispatch(state.tr.setSelection(nextSel));
|
|
67
|
-
view.focus();
|
|
68
|
-
});
|
|
69
|
-
_defineProperty(this, "mouseUpHandler", function (event) {
|
|
70
|
-
_this.mouseState = 'up';
|
|
71
|
-
_this.mouseMoveHandler(event);
|
|
72
|
-
});
|
|
73
|
-
_defineProperty(this, "mouseMoveHandler", function (event) {
|
|
74
|
-
if (_this.menuFrozen || _this.mouseState === 'selecting') return;
|
|
75
|
-
var target = event.target;
|
|
76
|
-
// 鼠标不在编辑器内时不处理,避免拖拽出界导致状态被清空
|
|
77
|
-
if (!isHTMLElement(target) || !_this.editorView.dom.contains(target)) return;
|
|
78
|
-
|
|
79
|
-
// 判断是否悬停在手柄或扩展按钮上
|
|
80
|
-
var elementTarget = target;
|
|
81
|
-
var isOverHandle = elementTarget.closest('.tiptap-table-handle-menu') !== null;
|
|
82
|
-
var isOverExtendButton = elementTarget.closest('.tiptap-table-extend-row-column-button, .tiptap-table-add-button') !== null;
|
|
83
|
-
|
|
84
|
-
// 悬停其上时保持显示
|
|
85
|
-
if (isOverHandle || isOverExtendButton) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
var handleRects = getCachedHandleRects({
|
|
89
|
-
root: _this.editorView.root,
|
|
90
|
-
state: _this.state
|
|
91
|
-
});
|
|
92
|
-
if (isPointerNearHandle(event, handleRects)) {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
_this._handleMouseMoveNow(event);
|
|
96
|
-
});
|
|
97
|
-
_defineProperty(this, "dragOverHandler", function (event) {
|
|
98
|
-
var _this$state;
|
|
99
|
-
if (((_this$state = _this.state) === null || _this$state === void 0 ? void 0 : _this$state.draggingState) === undefined) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
event.preventDefault();
|
|
103
|
-
event.dataTransfer.dropEffect = 'move';
|
|
104
|
-
hideElements('.prosemirror-dropcursor-block, .prosemirror-dropcursor-inline', _this.editorView.root);
|
|
105
|
-
|
|
106
|
-
// 将鼠标坐标限制在表格包围框内
|
|
107
|
-
var _this$state$reference = _this.state.referencePosTable,
|
|
108
|
-
tableLeft = _this$state$reference.left,
|
|
109
|
-
tableRight = _this$state$reference.right,
|
|
110
|
-
tableTop = _this$state$reference.top,
|
|
111
|
-
tableBottom = _this$state$reference.bottom;
|
|
112
|
-
var boundedMouseCoords = {
|
|
113
|
-
left: clamp(event.clientX, tableLeft + 1, tableRight - 1),
|
|
114
|
-
top: clamp(event.clientY, tableTop + 1, tableBottom - 1)
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
// 获取所在位置的单元格元素
|
|
118
|
-
var tableCellElements = _this.editorView.root.elementsFromPoint(boundedMouseCoords.left, boundedMouseCoords.top).filter(function (element) {
|
|
119
|
-
return element.tagName === 'TD' || element.tagName === 'TH';
|
|
120
|
-
});
|
|
121
|
-
if (tableCellElements.length === 0) {
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
var tableCellElement = tableCellElements[0];
|
|
125
|
-
if (!isHTMLElement(tableCellElement)) {
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
var cellPosition = getCellIndicesFromDOM(tableCellElement, _this.state.block, _this.editor);
|
|
129
|
-
if (!cellPosition) return;
|
|
130
|
-
var rowIndex = cellPosition.rowIndex,
|
|
131
|
-
colIndex = cellPosition.colIndex;
|
|
132
|
-
|
|
133
|
-
// 判断被拖动的索引是否改变
|
|
134
|
-
var oldIndex = _this.state.draggingState.draggedCellOrientation === 'row' ? _this.state.rowIndex : _this.state.colIndex;
|
|
135
|
-
var newIndex = _this.state.draggingState.draggedCellOrientation === 'row' ? rowIndex : colIndex;
|
|
136
|
-
var dispatchDecorationsTransaction = newIndex !== oldIndex;
|
|
137
|
-
var mousePos = _this.state.draggingState.draggedCellOrientation === 'row' ? boundedMouseCoords.top : boundedMouseCoords.left;
|
|
138
|
-
|
|
139
|
-
// 仅在单元格或鼠标位置变化时更新
|
|
140
|
-
var cellChanged = _this.state.rowIndex !== rowIndex || _this.state.colIndex !== colIndex;
|
|
141
|
-
var mousePosChanged = _this.state.draggingState.mousePos !== mousePos;
|
|
142
|
-
if (cellChanged || mousePosChanged) {
|
|
143
|
-
var _this$state$draggingS;
|
|
144
|
-
var preservedCellRect = preserveCellRectSize({
|
|
145
|
-
rect: tableCellElement.getBoundingClientRect(),
|
|
146
|
-
originalSize: (_this$state$draggingS = _this.state.draggingState) === null || _this$state$draggingS === void 0 ? void 0 : _this$state$draggingS.originalCellSize
|
|
147
|
-
});
|
|
148
|
-
_this.state = _objectSpread(_objectSpread({}, _this.state), {}, {
|
|
149
|
-
rowIndex: rowIndex,
|
|
150
|
-
colIndex: colIndex,
|
|
151
|
-
referencePosCell: preservedCellRect,
|
|
152
|
-
draggingState: _objectSpread(_objectSpread({}, _this.state.draggingState), {}, {
|
|
153
|
-
mousePos: mousePos
|
|
154
|
-
})
|
|
155
|
-
});
|
|
156
|
-
_this.emitUpdate();
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
// 如需刷新拖拽装饰则派发事务
|
|
160
|
-
if (dispatchDecorationsTransaction) {
|
|
161
|
-
_this.editor.view.dispatch(_this.editor.state.tr.setMeta(tableHandlePluginKey, true));
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
_defineProperty(this, "dropHandler", function () {
|
|
165
|
-
_this.mouseState = 'up';
|
|
166
|
-
var st = _this.state;
|
|
167
|
-
if (!(st !== null && st !== void 0 && st.draggingState)) return false;
|
|
168
|
-
var draggingState = st.draggingState,
|
|
169
|
-
rowIndex = st.rowIndex,
|
|
170
|
-
colIndex = st.colIndex,
|
|
171
|
-
blockPos = st.blockPos;
|
|
172
|
-
if (typeof blockPos !== 'number' || blockPos < 0) return false;
|
|
173
|
-
if (draggingState.draggedCellOrientation === 'row' && rowIndex === undefined || draggingState.draggedCellOrientation === 'col' && colIndex === undefined) {
|
|
174
|
-
throw new Error('Attempted to drop table row or column, but no table block was hovered prior.');
|
|
175
|
-
}
|
|
176
|
-
var isRow = draggingState.draggedCellOrientation === 'row';
|
|
177
|
-
var orientation = isRow ? 'row' : 'column';
|
|
178
|
-
var destIndex = isRow ? rowIndex : colIndex;
|
|
179
|
-
var cellCoords = getIndexCoordinates({
|
|
180
|
-
editor: _this.editor,
|
|
181
|
-
index: draggingState.originalIndex,
|
|
182
|
-
orientation: orientation,
|
|
183
|
-
tablePos: blockPos
|
|
184
|
-
});
|
|
185
|
-
if (!cellCoords) return false;
|
|
186
|
-
var stateWithCellSel = selectCellsByCoords(_this.editor, blockPos, cellCoords, {
|
|
187
|
-
mode: 'state'
|
|
188
|
-
});
|
|
189
|
-
if (!stateWithCellSel) return false;
|
|
190
|
-
|
|
191
|
-
// mode 为 state 时 selectCellsByCoords 返回 EditorState,这里的断言是安全的
|
|
192
|
-
var editorState = stateWithCellSel;
|
|
193
|
-
var dispatch = function dispatch(tr) {
|
|
194
|
-
return _this.editor.view.dispatch(tr);
|
|
195
|
-
};
|
|
196
|
-
if (isRow) {
|
|
197
|
-
moveTableRow({
|
|
198
|
-
from: draggingState.originalIndex,
|
|
199
|
-
to: destIndex,
|
|
200
|
-
select: true,
|
|
201
|
-
pos: blockPos + 1
|
|
202
|
-
})(editorState, dispatch);
|
|
203
|
-
} else {
|
|
204
|
-
moveTableColumn({
|
|
205
|
-
from: draggingState.originalIndex,
|
|
206
|
-
to: destIndex,
|
|
207
|
-
select: true,
|
|
208
|
-
pos: blockPos + 1
|
|
209
|
-
})(editorState, dispatch);
|
|
210
|
-
}
|
|
211
|
-
_this.state = _objectSpread(_objectSpread({}, st), {}, {
|
|
212
|
-
draggingState: undefined
|
|
213
|
-
});
|
|
214
|
-
_this.emitUpdate();
|
|
215
|
-
_this.editor.view.dispatch(_this.editor.state.tr.setMeta(tableHandlePluginKey, null));
|
|
216
|
-
return true;
|
|
217
|
-
});
|
|
218
|
-
_defineProperty(this, "scrollHandler", function () {
|
|
219
|
-
var _this$state2, _this$tableElement;
|
|
220
|
-
// 滚动时若手柄可见则重新计算位置
|
|
221
|
-
if ((_this$state2 = _this.state) !== null && _this$state2 !== void 0 && _this$state2.show && (_this$tableElement = _this.tableElement) !== null && _this$tableElement !== void 0 && _this$tableElement.isConnected) {
|
|
222
|
-
// 强制刷新定位
|
|
223
|
-
_this.updatePositions();
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
this.editor = editor;
|
|
227
|
-
this.editorView = editorView;
|
|
228
|
-
this.emitUpdate = function () {
|
|
229
|
-
return _this.state && emitUpdate(_this.state);
|
|
230
|
-
};
|
|
231
|
-
this.editorView.dom.addEventListener('mousemove', this.mouseMoveHandler);
|
|
232
|
-
this.editorView.dom.addEventListener('mousedown', this.viewMousedownHandler);
|
|
233
|
-
window.addEventListener('mouseup', this.mouseUpHandler);
|
|
234
|
-
this.editorView.root.addEventListener('dragover', this.dragOverHandler);
|
|
235
|
-
this.editorView.root.addEventListener('drop', this.dropHandler);
|
|
236
|
-
|
|
237
|
-
// 监听滚动事件以更新手柄位置
|
|
238
|
-
window.addEventListener('scroll', this.scrollHandler, true);
|
|
239
|
-
// 同时监听窗口尺寸变化
|
|
240
|
-
window.addEventListener('resize', this.scrollHandler);
|
|
241
|
-
}
|
|
242
|
-
_createClass(TableHandleView, [{
|
|
243
|
-
key: "hideHandles",
|
|
244
|
-
value: function hideHandles() {
|
|
245
|
-
var _this$state3;
|
|
246
|
-
if (!((_this$state3 = this.state) !== null && _this$state3 !== void 0 && _this$state3.show)) return;
|
|
247
|
-
|
|
248
|
-
// 拖拽进行中保持手柄显示,保留拖拽状态
|
|
249
|
-
if (this.state.draggingState) return;
|
|
250
|
-
this.state = _objectSpread(_objectSpread({}, this.state), {}, {
|
|
251
|
-
show: false,
|
|
252
|
-
showAddOrRemoveRowsButton: false,
|
|
253
|
-
showAddOrRemoveColumnsButton: false,
|
|
254
|
-
colIndex: undefined,
|
|
255
|
-
rowIndex: undefined,
|
|
256
|
-
referencePosCell: undefined,
|
|
257
|
-
referencePosLastRow: undefined,
|
|
258
|
-
referencePosLastCol: undefined
|
|
259
|
-
});
|
|
260
|
-
this.emitUpdate();
|
|
261
|
-
}
|
|
262
|
-
}, {
|
|
263
|
-
key: "_handleMouseMoveNow",
|
|
264
|
-
value: function _handleMouseMoveNow(event) {
|
|
265
|
-
var _this$state4;
|
|
266
|
-
var around = domCellAround(event.target);
|
|
267
|
-
|
|
268
|
-
// 在单元格内拖拽选区时隐藏手柄
|
|
269
|
-
if ((around === null || around === void 0 ? void 0 : around.type) === 'cell' && this.mouseState === 'down' && !((_this$state4 = this.state) !== null && _this$state4 !== void 0 && _this$state4.draggingState)) {
|
|
270
|
-
this.mouseState = 'selecting';
|
|
271
|
-
this.hideHandles();
|
|
272
|
-
return;
|
|
273
|
-
}
|
|
274
|
-
if (!around || !this.editor.isEditable) {
|
|
275
|
-
this.hideHandles();
|
|
276
|
-
return;
|
|
277
|
-
}
|
|
278
|
-
var tbody = around.tbodyNode;
|
|
279
|
-
if (!tbody) return;
|
|
280
|
-
var tableRect = tbody.getBoundingClientRect();
|
|
281
|
-
var coords = this.editor.view.posAtCoords({
|
|
282
|
-
left: event.clientX,
|
|
283
|
-
top: event.clientY
|
|
284
|
-
});
|
|
285
|
-
if (!coords) return;
|
|
286
|
-
|
|
287
|
-
// 基于坐标解析当前所在的表格节点
|
|
288
|
-
var $pos = this.editor.view.state.doc.resolve(coords.pos);
|
|
289
|
-
var blockInfo;
|
|
290
|
-
for (var d = $pos.depth; d >= 0; d--) {
|
|
291
|
-
var node = $pos.node(d);
|
|
292
|
-
if (isTableNode(node)) {
|
|
293
|
-
blockInfo = {
|
|
294
|
-
node: node,
|
|
295
|
-
pos: d === 0 ? 0 : $pos.before(d)
|
|
296
|
-
};
|
|
297
|
-
break;
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
if (!blockInfo || blockInfo.node.type.name !== 'table') return;
|
|
301
|
-
this.tableElement = this.editor.view.nodeDOM(blockInfo.pos);
|
|
302
|
-
this.tablePos = blockInfo.pos;
|
|
303
|
-
this.tableId = blockInfo.node.attrs.id;
|
|
304
|
-
var wrapper = safeClosest(around.domNode, '.tableWrapper');
|
|
305
|
-
var widgetContainer = wrapper === null || wrapper === void 0 ? void 0 : wrapper.querySelector(':scope > .table-controls');
|
|
306
|
-
|
|
307
|
-
// 悬停在表格外围(非单元格区域)
|
|
308
|
-
if (around.type === 'wrapper') {
|
|
309
|
-
var _this$state5;
|
|
310
|
-
var below = event.clientY >= tableRect.bottom - 1 && event.clientY < tableRect.bottom + 20;
|
|
311
|
-
var right = event.clientX >= tableRect.right - 1 && event.clientX < tableRect.right + 20;
|
|
312
|
-
var cursorBeyondRightOrBottom = event.clientX > tableRect.right || event.clientY > tableRect.bottom;
|
|
313
|
-
var _ref = below || right ? getLastEdgeReferences({
|
|
314
|
-
tableBody: tbody,
|
|
315
|
-
tableNode: blockInfo.node,
|
|
316
|
-
includeLastRow: below,
|
|
317
|
-
includeLastColumn: right
|
|
318
|
-
}) : {
|
|
319
|
-
referencePosLastRow: undefined,
|
|
320
|
-
referencePosLastCol: undefined
|
|
321
|
-
},
|
|
322
|
-
referencePosLastRow = _ref.referencePosLastRow,
|
|
323
|
-
referencePosLastCol = _ref.referencePosLastCol;
|
|
324
|
-
var nearestReference = !cursorBeyondRightOrBottom ? getNearestRowReference(tbody, event.clientY) : {};
|
|
325
|
-
this.state = buildWrapperHoverState({
|
|
326
|
-
previousState: this.state,
|
|
327
|
-
tableRect: tableRect,
|
|
328
|
-
referencePosLastRow: referencePosLastRow,
|
|
329
|
-
referencePosLastCol: referencePosLastCol,
|
|
330
|
-
block: blockInfo.node,
|
|
331
|
-
blockPos: blockInfo.pos,
|
|
332
|
-
widgetContainer: widgetContainer,
|
|
333
|
-
keepColIndex: (_this$state5 = this.state) === null || _this$state5 === void 0 ? void 0 : _this$state5.colIndex,
|
|
334
|
-
nextRowIndex: nearestReference.rowIndex,
|
|
335
|
-
nextReferencePosCell: nearestReference.cellRect,
|
|
336
|
-
resetIndices: cursorBeyondRightOrBottom
|
|
337
|
-
});
|
|
338
|
-
} else {
|
|
339
|
-
var _blockInfo$node$conte, _blockInfo$node$conte2, _this$state6;
|
|
340
|
-
// 悬停在单元格上
|
|
341
|
-
var cellPosition = getCellIndicesFromDOM(around.domNode, blockInfo.node, this.editor);
|
|
342
|
-
if (!cellPosition) return;
|
|
343
|
-
var tbodyEl = around.tbodyNode;
|
|
344
|
-
if (!tbodyEl) return;
|
|
345
|
-
var rowIndex = cellPosition.rowIndex,
|
|
346
|
-
colIndex = cellPosition.colIndex;
|
|
347
|
-
|
|
348
|
-
// 如果单元格跨行,map 计算的 rowIndex 会指向起始行;这里用 DOM 行索引兜底,保证手柄定位在实际行
|
|
349
|
-
var trEl = safeClosest(around.domNode, 'tr');
|
|
350
|
-
if (tbodyEl && trEl) {
|
|
351
|
-
var domRowIndex = Array.from(tbodyEl.children).indexOf(trEl);
|
|
352
|
-
if (domRowIndex >= 0 && domRowIndex !== rowIndex) {
|
|
353
|
-
rowIndex = domRowIndex;
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
var cellRect = around.domNode.getBoundingClientRect();
|
|
357
|
-
var map = TableMap.get(blockInfo.node);
|
|
358
|
-
var cellIndex = rowIndex * map.width + colIndex;
|
|
359
|
-
var cellOffset = map.map[cellIndex];
|
|
360
|
-
var rect = cellOffset !== undefined ? map.findCell(cellOffset) : null;
|
|
361
|
-
var effectiveCellRect = cellRect;
|
|
362
|
-
|
|
363
|
-
// 如果单元格跨行,按鼠标所在行拆分高度,句柄高度限定为单行高度
|
|
364
|
-
if (rect && rect.bottom - rect.top > 1) {
|
|
365
|
-
var span = rect.bottom - rect.top;
|
|
366
|
-
var unitHeight = cellRect.height / span;
|
|
367
|
-
var clampedY = clamp(event.clientY, cellRect.top, cellRect.bottom);
|
|
368
|
-
var rowOffset = Math.min(span - 1, Math.max(0, Math.floor((clampedY - cellRect.top) / unitHeight)));
|
|
369
|
-
var rowTop = cellRect.top + unitHeight * rowOffset;
|
|
370
|
-
rowIndex = rect.top + rowOffset;
|
|
371
|
-
effectiveCellRect = new DOMRect(cellRect.x, rowTop, cellRect.width, unitHeight);
|
|
372
|
-
} else if (trEl) {
|
|
373
|
-
var trRect = trEl.getBoundingClientRect();
|
|
374
|
-
effectiveCellRect = new DOMRect(cellRect.x, trRect.y, cellRect.width, trRect.height);
|
|
375
|
-
}
|
|
376
|
-
var lastRowIndex = blockInfo.node.content.childCount - 1;
|
|
377
|
-
var lastColIndex = ((_blockInfo$node$conte = (_blockInfo$node$conte2 = blockInfo.node.content.firstChild) === null || _blockInfo$node$conte2 === void 0 ? void 0 : _blockInfo$node$conte2.content.childCount) !== null && _blockInfo$node$conte !== void 0 ? _blockInfo$node$conte : 0) - 1;
|
|
378
|
-
|
|
379
|
-
// 与上次同一单元格则跳过
|
|
380
|
-
if ((_this$state6 = this.state) !== null && _this$state6 !== void 0 && _this$state6.show && this.tableId === blockInfo.node.attrs.id && this.state.rowIndex === rowIndex && this.state.colIndex === colIndex) {
|
|
381
|
-
return;
|
|
382
|
-
}
|
|
383
|
-
var _ref2 = rowIndex === lastRowIndex || colIndex === lastColIndex ? getLastEdgeReferences({
|
|
384
|
-
tableBody: tbodyEl,
|
|
385
|
-
tableNode: blockInfo.node,
|
|
386
|
-
includeLastRow: rowIndex === lastRowIndex,
|
|
387
|
-
includeLastColumn: colIndex === lastColIndex
|
|
388
|
-
}) : {
|
|
389
|
-
referencePosLastRow: undefined,
|
|
390
|
-
referencePosLastCol: undefined
|
|
391
|
-
},
|
|
392
|
-
_referencePosLastRow = _ref2.referencePosLastRow,
|
|
393
|
-
_referencePosLastCol = _ref2.referencePosLastCol;
|
|
394
|
-
this.state = buildCellHoverState({
|
|
395
|
-
tableRect: tableRect,
|
|
396
|
-
referencePosLastRow: _referencePosLastRow,
|
|
397
|
-
referencePosLastCol: _referencePosLastCol,
|
|
398
|
-
block: blockInfo.node,
|
|
399
|
-
blockPos: blockInfo.pos,
|
|
400
|
-
widgetContainer: widgetContainer,
|
|
401
|
-
draggingState: undefined,
|
|
402
|
-
referencePosCell: effectiveCellRect,
|
|
403
|
-
colIndex: colIndex,
|
|
404
|
-
rowIndex: rowIndex
|
|
405
|
-
});
|
|
406
|
-
}
|
|
407
|
-
this.emitUpdate();
|
|
408
|
-
return false;
|
|
409
|
-
}
|
|
410
|
-
}, {
|
|
411
|
-
key: "update",
|
|
412
|
-
value: function update(view) {
|
|
413
|
-
var _this$state7, _this$tableElement2, _this$tableElement3;
|
|
414
|
-
var pluginState = tableHandlePluginKey.getState(view.state);
|
|
415
|
-
if (pluginState !== undefined && pluginState !== this.menuFrozen) {
|
|
416
|
-
this.menuFrozen = pluginState;
|
|
417
|
-
}
|
|
418
|
-
if (!((_this$state7 = this.state) !== null && _this$state7 !== void 0 && _this$state7.show)) return;
|
|
419
|
-
if (!((_this$tableElement2 = this.tableElement) !== null && _this$tableElement2 !== void 0 && _this$tableElement2.isConnected)) {
|
|
420
|
-
this.hideHandles();
|
|
421
|
-
return;
|
|
422
|
-
}
|
|
423
|
-
var tableInfo = getTableFromDOM(this.tableElement, this.editor);
|
|
424
|
-
if (!tableInfo) {
|
|
425
|
-
this.hideHandles();
|
|
426
|
-
return;
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
// 检查表格是否已变更
|
|
430
|
-
var blockChanged = this.state.block !== tableInfo.node || this.state.blockPos !== tableInfo.pos;
|
|
431
|
-
if (!tableInfo.node || tableInfo.node.type.name !== 'table' || !((_this$tableElement3 = this.tableElement) !== null && _this$tableElement3 !== void 0 && _this$tableElement3.isConnected)) {
|
|
432
|
-
this.hideHandles();
|
|
433
|
-
return;
|
|
434
|
-
}
|
|
435
|
-
var syncResult = syncTableHandleState({
|
|
436
|
-
editor: this.editor,
|
|
437
|
-
tableElement: this.tableElement,
|
|
438
|
-
state: this.state
|
|
439
|
-
});
|
|
440
|
-
if (!syncResult) {
|
|
441
|
-
this.hideHandles();
|
|
442
|
-
return;
|
|
443
|
-
}
|
|
444
|
-
if (blockChanged || syncResult.indicesChanged || syncResult.refPosChanged) {
|
|
445
|
-
this.state = syncResult.nextState;
|
|
446
|
-
this.emitUpdate();
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
}, {
|
|
450
|
-
key: "updatePositions",
|
|
451
|
-
value: function updatePositions() {
|
|
452
|
-
var _this$state8, _this$tableElement4;
|
|
453
|
-
if (!((_this$state8 = this.state) !== null && _this$state8 !== void 0 && _this$state8.show) || !((_this$tableElement4 = this.tableElement) !== null && _this$tableElement4 !== void 0 && _this$tableElement4.isConnected)) return;
|
|
454
|
-
var syncResult = syncTableHandleState({
|
|
455
|
-
editor: this.editor,
|
|
456
|
-
tableElement: this.tableElement,
|
|
457
|
-
state: this.state
|
|
458
|
-
});
|
|
459
|
-
if (!syncResult) return;
|
|
460
|
-
if (syncResult.refPosChanged) {
|
|
461
|
-
this.state = syncResult.nextState;
|
|
462
|
-
this.emitUpdate();
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
}, {
|
|
466
|
-
key: "destroy",
|
|
467
|
-
value: function destroy() {
|
|
468
|
-
this.editorView.dom.removeEventListener('mousemove', this.mouseMoveHandler);
|
|
469
|
-
window.removeEventListener('mouseup', this.mouseUpHandler);
|
|
470
|
-
this.editorView.dom.removeEventListener('mousedown', this.viewMousedownHandler);
|
|
471
|
-
this.editorView.root.removeEventListener('dragover', this.dragOverHandler);
|
|
472
|
-
this.editorView.root.removeEventListener('drop', this.dropHandler);
|
|
473
|
-
window.removeEventListener('scroll', this.scrollHandler, true);
|
|
474
|
-
window.removeEventListener('resize', this.scrollHandler);
|
|
475
|
-
setTableHandleRuntime(null);
|
|
476
|
-
}
|
|
477
|
-
}]);
|
|
478
|
-
return TableHandleView;
|
|
479
|
-
}();
|
|
480
|
-
var tableHandleView = null;
|
|
481
|
-
export function TableHandlePlugin(editor, emitUpdate) {
|
|
482
|
-
return new Plugin({
|
|
483
|
-
key: tableHandlePluginKey,
|
|
484
|
-
state: {
|
|
485
|
-
init: function init() {
|
|
486
|
-
return false;
|
|
487
|
-
},
|
|
488
|
-
apply: function apply(tr, frozen) {
|
|
489
|
-
var meta = tr.getMeta(tableHandlePluginKey);
|
|
490
|
-
return meta !== undefined ? meta : frozen;
|
|
491
|
-
}
|
|
492
|
-
},
|
|
493
|
-
view: function view(editorView) {
|
|
494
|
-
tableHandleView = new TableHandleView(editor, editorView, emitUpdate);
|
|
495
|
-
setTableHandleRuntime(tableHandleView);
|
|
496
|
-
return tableHandleView;
|
|
497
|
-
},
|
|
498
|
-
props: {
|
|
499
|
-
decorations: function decorations(state) {
|
|
500
|
-
var _tableHandleView$stat;
|
|
501
|
-
if (!tableHandleView || !((_tableHandleView$stat = tableHandleView.state) !== null && _tableHandleView$stat !== void 0 && _tableHandleView$stat.draggingState)) {
|
|
502
|
-
return null;
|
|
503
|
-
}
|
|
504
|
-
return buildTableDragDecorations({
|
|
505
|
-
editor: editor,
|
|
506
|
-
doc: state.doc,
|
|
507
|
-
tableState: tableHandleView.state
|
|
508
|
-
});
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
});
|
|
512
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { Node as TiptapNode } from '@tiptap/pm/model';
|
|
2
|
-
import type { TableHandlesState } from './shared';
|
|
3
|
-
export declare const getCachedHandleRects: ({ root, state, }: {
|
|
4
|
-
root: Document | ShadowRoot;
|
|
5
|
-
state?: TableHandlesState | undefined;
|
|
6
|
-
}) => DOMRect[];
|
|
7
|
-
export declare const isPointerNearHandle: (event: MouseEvent, rects: DOMRect[]) => boolean;
|
|
8
|
-
export declare const getNearestRowReference: (tbody: HTMLElement, clientY: number) => {
|
|
9
|
-
rowIndex?: number | undefined;
|
|
10
|
-
cellRect?: DOMRect | undefined;
|
|
11
|
-
};
|
|
12
|
-
export declare const getLastEdgeReferences: ({ tableBody, tableNode, includeLastRow, includeLastColumn, }: {
|
|
13
|
-
tableBody: HTMLElement;
|
|
14
|
-
tableNode: TiptapNode;
|
|
15
|
-
includeLastRow: boolean;
|
|
16
|
-
includeLastColumn: boolean;
|
|
17
|
-
}) => {
|
|
18
|
-
referencePosLastRow: DOMRect | undefined;
|
|
19
|
-
referencePosLastCol: DOMRect | undefined;
|
|
20
|
-
};
|
|
21
|
-
export declare const preserveCellRectSize: ({ rect, originalSize, }: {
|
|
22
|
-
rect: DOMRect;
|
|
23
|
-
originalSize?: {
|
|
24
|
-
width: number;
|
|
25
|
-
height: number;
|
|
26
|
-
} | undefined;
|
|
27
|
-
}) => DOMRect;
|
|
28
|
-
export declare const getReferenceCellRect: ({ tableBody, rowIndex, colIndex, originalSize, }: {
|
|
29
|
-
tableBody: HTMLElement;
|
|
30
|
-
rowIndex?: number | undefined;
|
|
31
|
-
colIndex?: number | undefined;
|
|
32
|
-
originalSize?: {
|
|
33
|
-
width: number;
|
|
34
|
-
height: number;
|
|
35
|
-
} | undefined;
|
|
36
|
-
}) => DOMRect | undefined;
|
|
37
|
-
export declare const didReferencePositionsChange: ({ previous, next, }: {
|
|
38
|
-
previous: Pick<TableHandlesState, 'referencePosCell' | 'referencePosTable' | 'referencePosLastRow' | 'referencePosLastCol'>;
|
|
39
|
-
next: Pick<TableHandlesState, 'referencePosCell' | 'referencePosTable' | 'referencePosLastRow' | 'referencePosLastCol'>;
|
|
40
|
-
}) => boolean;
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { isHTMLElement } from "../../../utils/table";
|
|
2
|
-
var HANDLE_SELECTOR = '.tiptap-table-handle-menu, .tiptap-table-extend-row-column-button, .tiptap-table-add-button';
|
|
3
|
-
export var getCachedHandleRects = function getCachedHandleRects(_ref) {
|
|
4
|
-
var root = _ref.root,
|
|
5
|
-
state = _ref.state;
|
|
6
|
-
var now = Date.now();
|
|
7
|
-
if (state !== null && state !== void 0 && state._cachedHandleRects && state._cachedHandleRectsTime && now - state._cachedHandleRectsTime < 100) {
|
|
8
|
-
return state._cachedHandleRects;
|
|
9
|
-
}
|
|
10
|
-
var rects = Array.from(root.querySelectorAll(HANDLE_SELECTOR)).filter(isHTMLElement).map(function (element) {
|
|
11
|
-
return element.getBoundingClientRect();
|
|
12
|
-
});
|
|
13
|
-
if (state) {
|
|
14
|
-
state._cachedHandleRects = rects;
|
|
15
|
-
state._cachedHandleRectsTime = now;
|
|
16
|
-
}
|
|
17
|
-
return rects;
|
|
18
|
-
};
|
|
19
|
-
export var isPointerNearHandle = function isPointerNearHandle(event, rects) {
|
|
20
|
-
return rects.some(function (rect) {
|
|
21
|
-
var expandedRect = new DOMRect(rect.left - 10, rect.top - 10, rect.width + 20, rect.height + 20);
|
|
22
|
-
return event.clientX >= expandedRect.left && event.clientX <= expandedRect.right && event.clientY >= expandedRect.top && event.clientY <= expandedRect.bottom;
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
export var getNearestRowReference = function getNearestRowReference(tbody, clientY) {
|
|
26
|
-
var rows = Array.from(tbody.children);
|
|
27
|
-
var rowIndex;
|
|
28
|
-
var cellRect;
|
|
29
|
-
var minDistance = Number.POSITIVE_INFINITY;
|
|
30
|
-
rows.forEach(function (rowElement, index) {
|
|
31
|
-
var rowRect = rowElement.getBoundingClientRect();
|
|
32
|
-
var distance = Math.abs(clientY - (rowRect.top + rowRect.height / 2));
|
|
33
|
-
if (distance < minDistance) {
|
|
34
|
-
var _firstCell$getBoundin;
|
|
35
|
-
minDistance = distance;
|
|
36
|
-
rowIndex = index;
|
|
37
|
-
var firstCell = rowElement.children[0];
|
|
38
|
-
cellRect = (_firstCell$getBoundin = firstCell === null || firstCell === void 0 ? void 0 : firstCell.getBoundingClientRect()) !== null && _firstCell$getBoundin !== void 0 ? _firstCell$getBoundin : rowRect;
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
return {
|
|
42
|
-
rowIndex: rowIndex,
|
|
43
|
-
cellRect: cellRect
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
export var getLastEdgeReferences = function getLastEdgeReferences(_ref2) {
|
|
47
|
-
var _tableNode$content$fi, _tableNode$content$fi2;
|
|
48
|
-
var tableBody = _ref2.tableBody,
|
|
49
|
-
tableNode = _ref2.tableNode,
|
|
50
|
-
includeLastRow = _ref2.includeLastRow,
|
|
51
|
-
includeLastColumn = _ref2.includeLastColumn;
|
|
52
|
-
var referencePosLastRow;
|
|
53
|
-
var referencePosLastCol;
|
|
54
|
-
var lastRowIndex = tableNode.content.childCount - 1;
|
|
55
|
-
var lastColIndex = ((_tableNode$content$fi = (_tableNode$content$fi2 = tableNode.content.firstChild) === null || _tableNode$content$fi2 === void 0 ? void 0 : _tableNode$content$fi2.content.childCount) !== null && _tableNode$content$fi !== void 0 ? _tableNode$content$fi : 0) - 1;
|
|
56
|
-
if (includeLastRow) {
|
|
57
|
-
var lastRow = tableBody.children[lastRowIndex];
|
|
58
|
-
if (lastRow) {
|
|
59
|
-
referencePosLastRow = lastRow.getBoundingClientRect();
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
if (includeLastColumn) {
|
|
63
|
-
var maxRight = 0;
|
|
64
|
-
var lastColRect = null;
|
|
65
|
-
for (var i = 0; i < tableBody.children.length; i += 1) {
|
|
66
|
-
var row = tableBody.children[i];
|
|
67
|
-
if (!row || !row.children[lastColIndex]) continue;
|
|
68
|
-
var cellRect = row.children[lastColIndex].getBoundingClientRect();
|
|
69
|
-
if (cellRect.right > maxRight) {
|
|
70
|
-
maxRight = cellRect.right;
|
|
71
|
-
lastColRect = cellRect;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
if (lastColRect) {
|
|
75
|
-
var firstRow = tableBody.children[0];
|
|
76
|
-
var _lastRow = tableBody.children[lastRowIndex];
|
|
77
|
-
var firstCell = firstRow === null || firstRow === void 0 ? void 0 : firstRow.children[lastColIndex];
|
|
78
|
-
if (firstCell && _lastRow) {
|
|
79
|
-
var firstRect = firstCell.getBoundingClientRect();
|
|
80
|
-
referencePosLastCol = new DOMRect(lastColRect.right, firstRect.top, 0, _lastRow.getBoundingClientRect().bottom - firstRect.top);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return {
|
|
85
|
-
referencePosLastRow: referencePosLastRow,
|
|
86
|
-
referencePosLastCol: referencePosLastCol
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
export var preserveCellRectSize = function preserveCellRectSize(_ref3) {
|
|
90
|
-
var rect = _ref3.rect,
|
|
91
|
-
originalSize = _ref3.originalSize;
|
|
92
|
-
if (!originalSize) {
|
|
93
|
-
return rect;
|
|
94
|
-
}
|
|
95
|
-
return new DOMRect(rect.x, rect.y, originalSize.width, originalSize.height);
|
|
96
|
-
};
|
|
97
|
-
export var getReferenceCellRect = function getReferenceCellRect(_ref4) {
|
|
98
|
-
var tableBody = _ref4.tableBody,
|
|
99
|
-
rowIndex = _ref4.rowIndex,
|
|
100
|
-
colIndex = _ref4.colIndex,
|
|
101
|
-
originalSize = _ref4.originalSize;
|
|
102
|
-
if (rowIndex === undefined || colIndex === undefined) {
|
|
103
|
-
return undefined;
|
|
104
|
-
}
|
|
105
|
-
var rowElement = tableBody.children[rowIndex];
|
|
106
|
-
var cellElement = rowElement === null || rowElement === void 0 ? void 0 : rowElement.children[colIndex];
|
|
107
|
-
if (!cellElement) {
|
|
108
|
-
return undefined;
|
|
109
|
-
}
|
|
110
|
-
return preserveCellRectSize({
|
|
111
|
-
rect: cellElement.getBoundingClientRect(),
|
|
112
|
-
originalSize: originalSize
|
|
113
|
-
});
|
|
114
|
-
};
|
|
115
|
-
export var didReferencePositionsChange = function didReferencePositionsChange(_ref5) {
|
|
116
|
-
var previous = _ref5.previous,
|
|
117
|
-
next = _ref5.next;
|
|
118
|
-
var sameRect = function sameRect(left, right) {
|
|
119
|
-
if (!left && !right) return true;
|
|
120
|
-
if (!left || !right) return false;
|
|
121
|
-
return left.x === right.x && left.y === right.y && left.width === right.width && left.height === right.height;
|
|
122
|
-
};
|
|
123
|
-
return !(sameRect(previous.referencePosCell, next.referencePosCell) && sameRect(previous.referencePosTable, next.referencePosTable) && sameRect(previous.referencePosLastRow, next.referencePosLastRow) && sameRect(previous.referencePosLastCol, next.referencePosLastCol));
|
|
124
|
-
};
|