@ctzhian/tiptap 0.4.0
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/LICENSE +21 -0
- package/README.md +43 -0
- package/dist/Editor/demo.d.ts +4 -0
- package/dist/Editor/demo.js +150 -0
- package/dist/Editor/index.d.ts +4 -0
- package/dist/Editor/index.js +21 -0
- package/dist/EditorThemeProvider/index.d.ts +11 -0
- package/dist/EditorThemeProvider/index.js +90 -0
- package/dist/EditorToolbar/index.d.ts +9 -0
- package/dist/EditorToolbar/index.js +286 -0
- package/dist/asset/css/index.css +161 -0
- package/dist/asset/images/disk.png +0 -0
- package/dist/asset/images/down.svg +3 -0
- package/dist/component/CustomBubbleMenu/SelectionText.d.ts +9 -0
- package/dist/component/CustomBubbleMenu/SelectionText.js +295 -0
- package/dist/component/CustomDragHandle/index.d.ts +9 -0
- package/dist/component/CustomDragHandle/index.js +1172 -0
- package/dist/component/CustomFloatingMenu/index.d.ts +0 -0
- package/dist/component/CustomFloatingMenu/index.js +85 -0
- package/dist/component/FloatingPopover/index.d.ts +13 -0
- package/dist/component/FloatingPopover/index.js +104 -0
- package/dist/component/Icons/ai-generate-2-icon.d.ts +6 -0
- package/dist/component/Icons/ai-generate-2-icon.js +13 -0
- package/dist/component/Icons/ai-generate-text-icon.d.ts +6 -0
- package/dist/component/Icons/ai-generate-text-icon.js +13 -0
- package/dist/component/Icons/align-bottom-icon.d.ts +6 -0
- package/dist/component/Icons/align-bottom-icon.js +13 -0
- package/dist/component/Icons/align-center-icon.d.ts +6 -0
- package/dist/component/Icons/align-center-icon.js +13 -0
- package/dist/component/Icons/align-justify-icon.d.ts +6 -0
- package/dist/component/Icons/align-justify-icon.js +13 -0
- package/dist/component/Icons/align-left-icon.d.ts +6 -0
- package/dist/component/Icons/align-left-icon.js +13 -0
- package/dist/component/Icons/align-right-icon.d.ts +6 -0
- package/dist/component/Icons/align-right-icon.js +13 -0
- package/dist/component/Icons/align-top-icon.d.ts +6 -0
- package/dist/component/Icons/align-top-icon.js +13 -0
- package/dist/component/Icons/align-vertically-icon.d.ts +6 -0
- package/dist/component/Icons/align-vertically-icon.js +13 -0
- package/dist/component/Icons/anticlockwise-line-icon.d.ts +6 -0
- package/dist/component/Icons/anticlockwise-line-icon.js +13 -0
- package/dist/component/Icons/arrow-down-s-line-icon.d.ts +6 -0
- package/dist/component/Icons/arrow-down-s-line-icon.js +13 -0
- package/dist/component/Icons/arrow-go-back-line-icon.d.ts +6 -0
- package/dist/component/Icons/arrow-go-back-line-icon.js +13 -0
- package/dist/component/Icons/arrow-go-forward-line-icon.d.ts +6 -0
- package/dist/component/Icons/arrow-go-forward-line-icon.js +13 -0
- package/dist/component/Icons/arrow-left-wide-line-icon.d.ts +6 -0
- package/dist/component/Icons/arrow-left-wide-line-icon.js +13 -0
- package/dist/component/Icons/at-line-icon.d.ts +6 -0
- package/dist/component/Icons/at-line-icon.js +13 -0
- package/dist/component/Icons/attachment-2-icon.d.ts +6 -0
- package/dist/component/Icons/attachment-2-icon.js +13 -0
- package/dist/component/Icons/attachment-line-icon.d.ts +6 -0
- package/dist/component/Icons/attachment-line-icon.js +13 -0
- package/dist/component/Icons/bold-icon.d.ts +6 -0
- package/dist/component/Icons/bold-icon.js +13 -0
- package/dist/component/Icons/brush-line-icon.d.ts +6 -0
- package/dist/component/Icons/brush-line-icon.js +13 -0
- package/dist/component/Icons/carousel-view-icon.d.ts +6 -0
- package/dist/component/Icons/carousel-view-icon.js +13 -0
- package/dist/component/Icons/checkbox-blank-circle-line-icon.d.ts +6 -0
- package/dist/component/Icons/checkbox-blank-circle-line-icon.js +13 -0
- package/dist/component/Icons/checkbox-circle-line-icon.d.ts +6 -0
- package/dist/component/Icons/checkbox-circle-line-icon.js +13 -0
- package/dist/component/Icons/clockwise-line-icon.d.ts +6 -0
- package/dist/component/Icons/clockwise-line-icon.js +13 -0
- package/dist/component/Icons/code-box-line-icon.d.ts +6 -0
- package/dist/component/Icons/code-box-line-icon.js +13 -0
- package/dist/component/Icons/code-line-icon.d.ts +6 -0
- package/dist/component/Icons/code-line-icon.js +13 -0
- package/dist/component/Icons/code-s-slash-line-icon.d.ts +6 -0
- package/dist/component/Icons/code-s-slash-line-icon.js +13 -0
- package/dist/component/Icons/copy-icon.d.ts +6 -0
- package/dist/component/Icons/copy-icon.js +13 -0
- package/dist/component/Icons/custom-size-icon.d.ts +6 -0
- package/dist/component/Icons/custom-size-icon.js +13 -0
- package/dist/component/Icons/delete-column-icon.d.ts +6 -0
- package/dist/component/Icons/delete-column-icon.js +13 -0
- package/dist/component/Icons/delete-line-icon.d.ts +6 -0
- package/dist/component/Icons/delete-line-icon.js +13 -0
- package/dist/component/Icons/delete-row-icon.d.ts +6 -0
- package/dist/component/Icons/delete-row-icon.js +13 -0
- package/dist/component/Icons/double-quotes-l-icon.d.ts +6 -0
- package/dist/component/Icons/double-quotes-l-icon.js +13 -0
- package/dist/component/Icons/download-line-icon.d.ts +6 -0
- package/dist/component/Icons/download-line-icon.js +13 -0
- package/dist/component/Icons/draggable-icon.d.ts +6 -0
- package/dist/component/Icons/draggable-icon.js +13 -0
- package/dist/component/Icons/edit-box-line-icon.d.ts +6 -0
- package/dist/component/Icons/edit-box-line-icon.js +13 -0
- package/dist/component/Icons/export-line-icon.d.ts +6 -0
- package/dist/component/Icons/export-line-icon.js +13 -0
- package/dist/component/Icons/file-copy-line-icon.d.ts +6 -0
- package/dist/component/Icons/file-copy-line-icon.js +13 -0
- package/dist/component/Icons/file-upload-line-icon.d.ts +6 -0
- package/dist/component/Icons/file-upload-line-icon.js +13 -0
- package/dist/component/Icons/flow-chart-icon.d.ts +6 -0
- package/dist/component/Icons/flow-chart-icon.js +13 -0
- package/dist/component/Icons/font-color-icon.d.ts +6 -0
- package/dist/component/Icons/font-color-icon.js +13 -0
- package/dist/component/Icons/font-family-icon.d.ts +6 -0
- package/dist/component/Icons/font-family-icon.js +13 -0
- package/dist/component/Icons/font-size-icon.d.ts +6 -0
- package/dist/component/Icons/font-size-icon.js +13 -0
- package/dist/component/Icons/format-clear-icon.d.ts +6 -0
- package/dist/component/Icons/format-clear-icon.js +13 -0
- package/dist/component/Icons/formula-icon.d.ts +6 -0
- package/dist/component/Icons/formula-icon.js +13 -0
- package/dist/component/Icons/fullscreen-exit-line-icon.d.ts +6 -0
- package/dist/component/Icons/fullscreen-exit-line-icon.js +13 -0
- package/dist/component/Icons/fullscreen-line-icon.d.ts +6 -0
- package/dist/component/Icons/fullscreen-line-icon.js +13 -0
- package/dist/component/Icons/functions-icon.d.ts +6 -0
- package/dist/component/Icons/functions-icon.js +13 -0
- package/dist/component/Icons/game-line-icon.d.ts +6 -0
- package/dist/component/Icons/game-line-icon.js +13 -0
- package/dist/component/Icons/h-1-icon.d.ts +6 -0
- package/dist/component/Icons/h-1-icon.js +13 -0
- package/dist/component/Icons/h-2-icon.d.ts +6 -0
- package/dist/component/Icons/h-2-icon.js +13 -0
- package/dist/component/Icons/h-3-icon.d.ts +6 -0
- package/dist/component/Icons/h-3-icon.js +13 -0
- package/dist/component/Icons/h-4-icon.d.ts +6 -0
- package/dist/component/Icons/h-4-icon.js +13 -0
- package/dist/component/Icons/h-5-icon.d.ts +6 -0
- package/dist/component/Icons/h-5-icon.js +13 -0
- package/dist/component/Icons/h-6-icon.d.ts +6 -0
- package/dist/component/Icons/h-6-icon.js +13 -0
- package/dist/component/Icons/heading-icon.d.ts +6 -0
- package/dist/component/Icons/heading-icon.js +13 -0
- package/dist/component/Icons/image-add-line-icon.d.ts +6 -0
- package/dist/component/Icons/image-add-line-icon.js +13 -0
- package/dist/component/Icons/image-line-icon.d.ts +6 -0
- package/dist/component/Icons/image-line-icon.js +13 -0
- package/dist/component/Icons/import-line-icon.d.ts +6 -0
- package/dist/component/Icons/import-line-icon.js +13 -0
- package/dist/component/Icons/index.d.ts +110 -0
- package/dist/component/Icons/index.js +113 -0
- package/dist/component/Icons/insert-column-left-icon.d.ts +6 -0
- package/dist/component/Icons/insert-column-left-icon.js +13 -0
- package/dist/component/Icons/insert-column-right-icon.d.ts +6 -0
- package/dist/component/Icons/insert-column-right-icon.js +13 -0
- package/dist/component/Icons/insert-row-bottom-icon.d.ts +6 -0
- package/dist/component/Icons/insert-row-bottom-icon.js +13 -0
- package/dist/component/Icons/insert-row-top-icon.d.ts +6 -0
- package/dist/component/Icons/insert-row-top-icon.js +13 -0
- package/dist/component/Icons/italic-icon.d.ts +6 -0
- package/dist/component/Icons/italic-icon.js +13 -0
- package/dist/component/Icons/layout-left-2-line-icon.d.ts +6 -0
- package/dist/component/Icons/layout-left-2-line-icon.js +13 -0
- package/dist/component/Icons/layout-top-2-line-icon.d.ts +6 -0
- package/dist/component/Icons/layout-top-2-line-icon.js +13 -0
- package/dist/component/Icons/link-icon.d.ts +6 -0
- package/dist/component/Icons/link-icon.js +13 -0
- package/dist/component/Icons/link-unlink-icon.d.ts +6 -0
- package/dist/component/Icons/link-unlink-icon.js +13 -0
- package/dist/component/Icons/list-check-2-icon.d.ts +6 -0
- package/dist/component/Icons/list-check-2-icon.js +13 -0
- package/dist/component/Icons/list-check-3-icon.d.ts +6 -0
- package/dist/component/Icons/list-check-3-icon.js +13 -0
- package/dist/component/Icons/list-ordered-2-icon.d.ts +6 -0
- package/dist/component/Icons/list-ordered-2-icon.js +13 -0
- package/dist/component/Icons/list-unordered-icon.d.ts +6 -0
- package/dist/component/Icons/list-unordered-icon.js +13 -0
- package/dist/component/Icons/markdown-line-icon.d.ts +6 -0
- package/dist/component/Icons/markdown-line-icon.js +13 -0
- package/dist/component/Icons/markup-line-icon.d.ts +6 -0
- package/dist/component/Icons/markup-line-icon.js +13 -0
- package/dist/component/Icons/menu-fold-2-fill-icon.d.ts +6 -0
- package/dist/component/Icons/menu-fold-2-fill-icon.js +13 -0
- package/dist/component/Icons/merge-cells-horizontal-icon.d.ts +6 -0
- package/dist/component/Icons/merge-cells-horizontal-icon.js +13 -0
- package/dist/component/Icons/merge-cells-vertical-icon.d.ts +6 -0
- package/dist/component/Icons/merge-cells-vertical-icon.js +13 -0
- package/dist/component/Icons/mind-map-icon.d.ts +6 -0
- package/dist/component/Icons/mind-map-icon.js +13 -0
- package/dist/component/Icons/more-line-icon.d.ts +6 -0
- package/dist/component/Icons/more-line-icon.js +13 -0
- package/dist/component/Icons/movie-line-icon.d.ts +6 -0
- package/dist/component/Icons/movie-line-icon.js +13 -0
- package/dist/component/Icons/music-2-line-icon.d.ts +6 -0
- package/dist/component/Icons/music-2-line-icon.js +13 -0
- package/dist/component/Icons/node-tree-icon.d.ts +6 -0
- package/dist/component/Icons/node-tree-icon.js +13 -0
- package/dist/component/Icons/notification-3-line-icon.d.ts +6 -0
- package/dist/component/Icons/notification-3-line-icon.js +13 -0
- package/dist/component/Icons/organization-chart-icon.d.ts +6 -0
- package/dist/component/Icons/organization-chart-icon.js +13 -0
- package/dist/component/Icons/pause-line-icon.d.ts +6 -0
- package/dist/component/Icons/pause-line-icon.js +13 -0
- package/dist/component/Icons/play-line-icon.d.ts +6 -0
- package/dist/component/Icons/play-line-icon.js +13 -0
- package/dist/component/Icons/quote-text-icon.d.ts +6 -0
- package/dist/component/Icons/quote-text-icon.js +13 -0
- package/dist/component/Icons/repeat-2-line-icon.d.ts +6 -0
- package/dist/component/Icons/repeat-2-line-icon.js +13 -0
- package/dist/component/Icons/reset-left-fill-icon.d.ts +6 -0
- package/dist/component/Icons/reset-left-fill-icon.js +13 -0
- package/dist/component/Icons/scissors-cut-line-icon.d.ts +6 -0
- package/dist/component/Icons/scissors-cut-line-icon.js +13 -0
- package/dist/component/Icons/screenshot-line-icon.d.ts +6 -0
- package/dist/component/Icons/screenshot-line-icon.js +13 -0
- package/dist/component/Icons/scroll-to-bottom-line-icon.d.ts +6 -0
- package/dist/component/Icons/scroll-to-bottom-line-icon.js +13 -0
- package/dist/component/Icons/separator-icon.d.ts +6 -0
- package/dist/component/Icons/separator-icon.js +13 -0
- package/dist/component/Icons/share-box-line-icon.d.ts +6 -0
- package/dist/component/Icons/share-box-line-icon.js +13 -0
- package/dist/component/Icons/slash-commands-2-icon.d.ts +3 -0
- package/dist/component/Icons/slash-commands-2-icon.js +13 -0
- package/dist/component/Icons/speed-line-icon.d.ts +6 -0
- package/dist/component/Icons/speed-line-icon.js +13 -0
- package/dist/component/Icons/split-cells-horizontal-icon.d.ts +6 -0
- package/dist/component/Icons/split-cells-horizontal-icon.js +13 -0
- package/dist/component/Icons/split-cells-vertical-icon.d.ts +6 -0
- package/dist/component/Icons/split-cells-vertical-icon.js +13 -0
- package/dist/component/Icons/square-root-icon.d.ts +6 -0
- package/dist/component/Icons/square-root-icon.js +13 -0
- package/dist/component/Icons/strikethrough-icon.d.ts +6 -0
- package/dist/component/Icons/strikethrough-icon.js +13 -0
- package/dist/component/Icons/subscript-icon.d.ts +6 -0
- package/dist/component/Icons/subscript-icon.js +13 -0
- package/dist/component/Icons/superscript-icon.d.ts +6 -0
- package/dist/component/Icons/superscript-icon.js +13 -0
- package/dist/component/Icons/table-2-icon.d.ts +6 -0
- package/dist/component/Icons/table-2-icon.js +13 -0
- package/dist/component/Icons/text-icon.d.ts +6 -0
- package/dist/component/Icons/text-icon.js +13 -0
- package/dist/component/Icons/text-wrap-icon.d.ts +6 -0
- package/dist/component/Icons/text-wrap-icon.js +13 -0
- package/dist/component/Icons/title-icon.d.ts +6 -0
- package/dist/component/Icons/title-icon.js +13 -0
- package/dist/component/Icons/underline-icon.d.ts +6 -0
- package/dist/component/Icons/underline-icon.js +13 -0
- package/dist/component/Icons/upload-cloud-2-line-icon.d.ts +6 -0
- package/dist/component/Icons/upload-cloud-2-line-icon.js +13 -0
- package/dist/component/Icons/upload-icon.d.ts +6 -0
- package/dist/component/Icons/upload-icon.js +13 -0
- package/dist/component/Icons/volume-mute-line-icon.d.ts +6 -0
- package/dist/component/Icons/volume-mute-line-icon.js +13 -0
- package/dist/component/Icons/volume-up-line-icon.d.ts +6 -0
- package/dist/component/Icons/volume-up-line-icon.js +13 -0
- package/dist/component/ListHover/index.d.ts +7 -0
- package/dist/component/ListHover/index.js +367 -0
- package/dist/component/Menu/index.d.ts +4 -0
- package/dist/component/Menu/index.js +189 -0
- package/dist/component/Toolbar/EditorAlignSelect.d.ts +7 -0
- package/dist/component/Toolbar/EditorAlignSelect.js +176 -0
- package/dist/component/Toolbar/EditorCode.d.ts +7 -0
- package/dist/component/Toolbar/EditorCode.js +150 -0
- package/dist/component/Toolbar/EditorFontBgColor.d.ts +7 -0
- package/dist/component/Toolbar/EditorFontBgColor.js +244 -0
- package/dist/component/Toolbar/EditorFontColor.d.ts +7 -0
- package/dist/component/Toolbar/EditorFontColor.js +246 -0
- package/dist/component/Toolbar/EditorFontSize.d.ts +7 -0
- package/dist/component/Toolbar/EditorFontSize.js +137 -0
- package/dist/component/Toolbar/EditorHeading.d.ts +7 -0
- package/dist/component/Toolbar/EditorHeading.js +174 -0
- package/dist/component/Toolbar/EditorInsert/index.d.ts +7 -0
- package/dist/component/Toolbar/EditorInsert/index.js +186 -0
- package/dist/component/Toolbar/EditorListSelect.d.ts +7 -0
- package/dist/component/Toolbar/EditorListSelect.js +163 -0
- package/dist/component/Toolbar/EditorMath.d.ts +7 -0
- package/dist/component/Toolbar/EditorMath.js +148 -0
- package/dist/component/Toolbar/EditorMore/NotificationDialog.d.ts +7 -0
- package/dist/component/Toolbar/EditorMore/NotificationDialog.js +72 -0
- package/dist/component/Toolbar/EditorMore/index.d.ts +7 -0
- package/dist/component/Toolbar/EditorMore/index.js +101 -0
- package/dist/component/Toolbar/EditorScript.d.ts +7 -0
- package/dist/component/Toolbar/EditorScript.js +150 -0
- package/dist/component/Toolbar/EditorVerticalAlignSelect.d.ts +7 -0
- package/dist/component/Toolbar/EditorVerticalAlignSelect.js +163 -0
- package/dist/component/Toolbar/Item.d.ts +15 -0
- package/dist/component/Toolbar/Item.js +69 -0
- package/dist/component/Toolbar/index.d.ts +13 -0
- package/dist/component/Toolbar/index.js +13 -0
- package/dist/component/index.d.ts +1 -0
- package/dist/component/index.js +1 -0
- package/dist/contants/enums.d.ts +30 -0
- package/dist/contants/enums.js +98 -0
- package/dist/contants/highlight.d.ts +4 -0
- package/dist/contants/highlight.js +580 -0
- package/dist/contants/placeholder.d.ts +16 -0
- package/dist/contants/placeholder.js +16 -0
- package/dist/contants/shortcut-key.d.ts +48 -0
- package/dist/contants/shortcut-key.js +224 -0
- package/dist/contants/slash-commands.d.ts +13 -0
- package/dist/contants/slash-commands.js +313 -0
- package/dist/extension/component/Attachment/Insert.d.ts +13 -0
- package/dist/extension/component/Attachment/Insert.js +222 -0
- package/dist/extension/component/Attachment/Readonly.d.ts +9 -0
- package/dist/extension/component/Attachment/Readonly.js +93 -0
- package/dist/extension/component/Attachment/index.d.ts +13 -0
- package/dist/extension/component/Attachment/index.js +317 -0
- package/dist/extension/component/Audio/Insert.d.ts +10 -0
- package/dist/extension/component/Audio/Insert.js +351 -0
- package/dist/extension/component/Audio/Readonly.d.ts +8 -0
- package/dist/extension/component/Audio/Readonly.js +428 -0
- package/dist/extension/component/Audio/index.d.ts +14 -0
- package/dist/extension/component/Audio/index.js +740 -0
- package/dist/extension/component/CodeBlock/Readonly.d.ts +4 -0
- package/dist/extension/component/CodeBlock/Readonly.js +135 -0
- package/dist/extension/component/CodeBlock/index.d.ts +4 -0
- package/dist/extension/component/CodeBlock/index.js +296 -0
- package/dist/extension/component/CustomLink/Insert.d.ts +0 -0
- package/dist/extension/component/CustomLink/Insert.js +176 -0
- package/dist/extension/component/CustomLink/Readonly.d.ts +0 -0
- package/dist/extension/component/CustomLink/Readonly.js +106 -0
- package/dist/extension/component/CustomLink/index.d.ts +0 -0
- package/dist/extension/component/CustomLink/index.js +440 -0
- package/dist/extension/component/EmojiList/index.d.ts +14 -0
- package/dist/extension/component/EmojiList/index.js +104 -0
- package/dist/extension/component/Image/Crop.d.ts +12 -0
- package/dist/extension/component/Image/Crop.js +218 -0
- package/dist/extension/component/Image/Insert.d.ts +10 -0
- package/dist/extension/component/Image/Insert.js +309 -0
- package/dist/extension/component/Image/Readonly.d.ts +8 -0
- package/dist/extension/component/Image/Readonly.js +52 -0
- package/dist/extension/component/Image/index.d.ts +21 -0
- package/dist/extension/component/Image/index.js +372 -0
- package/dist/extension/component/Link/Insert.d.ts +10 -0
- package/dist/extension/component/Link/Insert.js +253 -0
- package/dist/extension/component/Link/Readonly.d.ts +8 -0
- package/dist/extension/component/Link/Readonly.js +102 -0
- package/dist/extension/component/Link/index.d.ts +12 -0
- package/dist/extension/component/Link/index.js +510 -0
- package/dist/extension/component/Mathematics/block/Readonly.d.ts +9 -0
- package/dist/extension/component/Mathematics/block/Readonly.js +36 -0
- package/dist/extension/component/Mathematics/block/index.d.ts +8 -0
- package/dist/extension/component/Mathematics/block/index.js +149 -0
- package/dist/extension/component/Mathematics/index.d.ts +3 -0
- package/dist/extension/component/Mathematics/index.js +3 -0
- package/dist/extension/component/Mathematics/inline/Readonly.d.ts +9 -0
- package/dist/extension/component/Mathematics/inline/Readonly.js +34 -0
- package/dist/extension/component/Mathematics/inline/index.d.ts +8 -0
- package/dist/extension/component/Mathematics/inline/index.js +148 -0
- package/dist/extension/component/MentionList/index.d.ts +13 -0
- package/dist/extension/component/MentionList/index.js +92 -0
- package/dist/extension/component/SlashCommandsList/index.d.ts +4 -0
- package/dist/extension/component/SlashCommandsList/index.js +121 -0
- package/dist/extension/component/Table/ContextMenu.d.ts +10 -0
- package/dist/extension/component/Table/ContextMenu.js +228 -0
- package/dist/extension/component/Table/TableContextMenuPlugin.d.ts +9 -0
- package/dist/extension/component/Table/TableContextMenuPlugin.js +272 -0
- package/dist/extension/component/Table/index.d.ts +2 -0
- package/dist/extension/component/Table/index.js +2 -0
- package/dist/extension/component/UploadProgress/index.d.ts +10 -0
- package/dist/extension/component/UploadProgress/index.js +103 -0
- package/dist/extension/component/Video/Insert.d.ts +10 -0
- package/dist/extension/component/Video/Insert.js +257 -0
- package/dist/extension/component/Video/Readonly.d.ts +8 -0
- package/dist/extension/component/Video/Readonly.js +41 -0
- package/dist/extension/component/Video/index.d.ts +14 -0
- package/dist/extension/component/Video/index.js +166 -0
- package/dist/extension/extension/SlashCommands.d.ts +3 -0
- package/dist/extension/extension/SlashCommands.js +25 -0
- package/dist/extension/extension/index.d.ts +1 -0
- package/dist/extension/extension/index.js +1 -0
- package/dist/extension/index.d.ts +2 -0
- package/dist/extension/index.js +176 -0
- package/dist/extension/mark/Link.d.ts +0 -0
- package/dist/extension/mark/Link.js +58 -0
- package/dist/extension/mark/index.d.ts +0 -0
- package/dist/extension/mark/index.js +1 -0
- package/dist/extension/node/Attachment.d.ts +28 -0
- package/dist/extension/node/Attachment.js +227 -0
- package/dist/extension/node/Audio.d.ts +23 -0
- package/dist/extension/node/Audio.js +194 -0
- package/dist/extension/node/CodeBlockLowlight.d.ts +1 -0
- package/dist/extension/node/CodeBlockLowlight.js +40 -0
- package/dist/extension/node/Details.d.ts +3 -0
- package/dist/extension/node/Details.js +39 -0
- package/dist/extension/node/Emoji.d.ts +1 -0
- package/dist/extension/node/Emoji.js +7 -0
- package/dist/extension/node/FileHandler.d.ts +4 -0
- package/dist/extension/node/FileHandler.js +294 -0
- package/dist/extension/node/Image.d.ts +3 -0
- package/dist/extension/node/Image.js +38 -0
- package/dist/extension/node/Link/helpers/autolink.d.ts +15 -0
- package/dist/extension/node/Link/helpers/autolink.js +162 -0
- package/dist/extension/node/Link/helpers/clickHandler.d.ts +10 -0
- package/dist/extension/node/Link/helpers/clickHandler.js +46 -0
- package/dist/extension/node/Link/helpers/pasteHandler.d.ts +10 -0
- package/dist/extension/node/Link/helpers/pasteHandler.js +32 -0
- package/dist/extension/node/Link/helpers/whitespace.d.ts +4 -0
- package/dist/extension/node/Link/helpers/whitespace.js +6 -0
- package/dist/extension/node/Link/index.d.ts +162 -0
- package/dist/extension/node/Link/index.js +461 -0
- package/dist/extension/node/ListKit.d.ts +2 -0
- package/dist/extension/node/ListKit.js +23 -0
- package/dist/extension/node/Mathematics.d.ts +27 -0
- package/dist/extension/node/Mathematics.js +97 -0
- package/dist/extension/node/Mention.d.ts +2 -0
- package/dist/extension/node/Mention.js +10 -0
- package/dist/extension/node/Table.d.ts +5 -0
- package/dist/extension/node/Table.js +174 -0
- package/dist/extension/node/TableOfContents/index.d.ts +9 -0
- package/dist/extension/node/TableOfContents/index.js +391 -0
- package/dist/extension/node/TableOfContents/plugin.d.ts +6 -0
- package/dist/extension/node/TableOfContents/plugin.js +58 -0
- package/dist/extension/node/TableOfContents/type.d.ts +45 -0
- package/dist/extension/node/TableOfContents/type.js +1 -0
- package/dist/extension/node/TableOfContents/utils.d.ts +6 -0
- package/dist/extension/node/TableOfContents/utils.js +70 -0
- package/dist/extension/node/UploadProgress.d.ts +21 -0
- package/dist/extension/node/UploadProgress.js +135 -0
- package/dist/extension/node/VerticalAlign.d.ts +49 -0
- package/dist/extension/node/VerticalAlign.js +88 -0
- package/dist/extension/node/Video.d.ts +23 -0
- package/dist/extension/node/Video.js +195 -0
- package/dist/extension/node/Youtube.d.ts +3 -0
- package/dist/extension/node/Youtube.js +14 -0
- package/dist/extension/node/index.d.ts +17 -0
- package/dist/extension/node/index.js +17 -0
- package/dist/extension/suggestion/emoji.d.ts +3 -0
- package/dist/extension/suggestion/emoji.js +57 -0
- package/dist/extension/suggestion/mention.d.ts +4 -0
- package/dist/extension/suggestion/mention.js +88 -0
- package/dist/extension/suggestion/slash.d.ts +34 -0
- package/dist/extension/suggestion/slash.js +63 -0
- package/dist/hook/fn.d.ts +13 -0
- package/dist/hook/fn.js +37 -0
- package/dist/hook/index.d.ts +4 -0
- package/dist/hook/index.js +110 -0
- package/dist/index.css +372 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +7 -0
- package/dist/themes/color.d.ts +5 -0
- package/dist/themes/color.js +4 -0
- package/dist/themes/componentStyleOverrides.d.ts +396 -0
- package/dist/themes/componentStyleOverrides.js +431 -0
- package/dist/themes/custom.d.ts +5 -0
- package/dist/themes/custom.js +4 -0
- package/dist/themes/dark.d.ts +86 -0
- package/dist/themes/dark.js +86 -0
- package/dist/themes/index.d.ts +19 -0
- package/dist/themes/index.js +37 -0
- package/dist/themes/light.d.ts +86 -0
- package/dist/themes/light.js +86 -0
- package/dist/themes/palette.d.ts +94 -0
- package/dist/themes/palette.js +24 -0
- package/dist/themes/shadows.d.ts +2 -0
- package/dist/themes/shadows.js +3 -0
- package/dist/themes/themeContext.d.ts +8 -0
- package/dist/themes/themeContext.js +3 -0
- package/dist/themes/typography.d.ts +6 -0
- package/dist/themes/typography.js +8 -0
- package/dist/type/index.d.ts +112 -0
- package/dist/type/index.js +1 -0
- package/dist/types/images.d.ts +19 -0
- package/dist/util/fileDownload.d.ts +16 -0
- package/dist/util/fileDownload.js +268 -0
- package/dist/util/fileHandler.d.ts +7 -0
- package/dist/util/fileHandler.js +79 -0
- package/dist/util/floating.d.ts +2 -0
- package/dist/util/floating.js +22 -0
- package/dist/util/index.d.ts +11 -0
- package/dist/util/index.js +39 -0
- package/dist/util/migrateMathStrings.d.ts +73 -0
- package/dist/util/migrateMathStrings.js +192 -0
- package/dist/util/resourceExtractor.d.ts +15 -0
- package/dist/util/resourceExtractor.js +62 -0
- package/dist/util/shortcutKey.d.ts +2 -0
- package/dist/util/shortcutKey.js +9 -0
- package/package.json +135 -0
|
@@ -0,0 +1,174 @@
|
|
|
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 _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; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
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); }
|
|
7
|
+
// @ts-nocheck
|
|
8
|
+
|
|
9
|
+
import { Extension } from '@tiptap/core';
|
|
10
|
+
import { Table, TableCell, TableHeader, TableRow } from '@tiptap/extension-table';
|
|
11
|
+
import { TextSelection } from '@tiptap/pm/state';
|
|
12
|
+
import { createTableContextMenuPlugin } from "../component/Table";
|
|
13
|
+
export var TableExtension = function TableExtension(_ref) {
|
|
14
|
+
var editable = _ref.editable;
|
|
15
|
+
return [Table.configure({
|
|
16
|
+
handleWidth: 5,
|
|
17
|
+
cellMinWidth: 100,
|
|
18
|
+
resizable: editable,
|
|
19
|
+
lastColumnResizable: editable,
|
|
20
|
+
allowTableNodeSelection: editable
|
|
21
|
+
}).extend({
|
|
22
|
+
addCommands: function addCommands() {
|
|
23
|
+
var _this$parent;
|
|
24
|
+
return _objectSpread(_objectSpread({}, (_this$parent = this.parent) === null || _this$parent === void 0 ? void 0 : _this$parent.call(this)), {}, {
|
|
25
|
+
cancelSelection: function cancelSelection() {
|
|
26
|
+
return function (_ref2) {
|
|
27
|
+
var state = _ref2.state,
|
|
28
|
+
dispatch = _ref2.dispatch;
|
|
29
|
+
if (dispatch) {
|
|
30
|
+
var selection = state.selection;
|
|
31
|
+
var $from = selection.$from;
|
|
32
|
+
|
|
33
|
+
// 找到当前单元格的起始和结束位置
|
|
34
|
+
var cellStart = $from.pos;
|
|
35
|
+
var cellEnd = $from.pos;
|
|
36
|
+
var depth = $from.depth;
|
|
37
|
+
|
|
38
|
+
// 向上查找直到找到表格单元格
|
|
39
|
+
while (depth > 0) {
|
|
40
|
+
var node = $from.node(depth);
|
|
41
|
+
if (node.type.name === 'tableCell' || node.type.name === 'tableHeader') {
|
|
42
|
+
cellStart = $from.start(depth);
|
|
43
|
+
cellEnd = $from.end(depth);
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
depth--;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// 设置选区为单元格的最后位置(不选中文本)
|
|
50
|
+
var newSelection = TextSelection.create(state.doc, cellEnd - 1);
|
|
51
|
+
dispatch(state.tr.setSelection(newSelection));
|
|
52
|
+
}
|
|
53
|
+
return true;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
addKeyboardShortcuts: function addKeyboardShortcuts() {
|
|
59
|
+
var _this = this;
|
|
60
|
+
return {
|
|
61
|
+
'Mod-9': function Mod9() {
|
|
62
|
+
return _this.editor.commands.insertTable({
|
|
63
|
+
rows: 3,
|
|
64
|
+
cols: 4,
|
|
65
|
+
withHeaderRow: true
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
},
|
|
70
|
+
renderHTML: function renderHTML(_ref3) {
|
|
71
|
+
var _this$parent2;
|
|
72
|
+
var node = _ref3.node,
|
|
73
|
+
HTMLAttributes = _ref3.HTMLAttributes;
|
|
74
|
+
var originalRender = (_this$parent2 = this.parent) === null || _this$parent2 === void 0 ? void 0 : _this$parent2.call(this, {
|
|
75
|
+
node: node,
|
|
76
|
+
HTMLAttributes: HTMLAttributes
|
|
77
|
+
});
|
|
78
|
+
var wrapper = ['div', {
|
|
79
|
+
class: 'tableWrapper'
|
|
80
|
+
}, originalRender];
|
|
81
|
+
return wrapper;
|
|
82
|
+
}
|
|
83
|
+
}), TableHeader.configure({
|
|
84
|
+
HTMLAttributes: {
|
|
85
|
+
class: 'table-header'
|
|
86
|
+
}
|
|
87
|
+
}), TableRow.configure({
|
|
88
|
+
HTMLAttributes: {
|
|
89
|
+
class: 'table-row'
|
|
90
|
+
}
|
|
91
|
+
}), TableCell.extend({
|
|
92
|
+
addAttributes: function addAttributes() {
|
|
93
|
+
var _this$parent3;
|
|
94
|
+
return _objectSpread(_objectSpread({}, (_this$parent3 = this.parent) === null || _this$parent3 === void 0 ? void 0 : _this$parent3.call(this)), {}, {
|
|
95
|
+
bgcolor: {
|
|
96
|
+
default: 'transparent',
|
|
97
|
+
parseHTML: function parseHTML(element) {
|
|
98
|
+
return element.getAttribute('data-background-color') || element.style.backgroundColor;
|
|
99
|
+
},
|
|
100
|
+
renderHTML: function renderHTML(attributes) {
|
|
101
|
+
return {
|
|
102
|
+
'data-background-color': attributes.bgcolor,
|
|
103
|
+
style: "background-color: ".concat(attributes.bgcolor)
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
textAlign: {
|
|
108
|
+
default: null,
|
|
109
|
+
parseHTML: function parseHTML(element) {
|
|
110
|
+
return element.getAttribute('data-text-align') || element.style.textAlign;
|
|
111
|
+
},
|
|
112
|
+
renderHTML: function renderHTML(attributes) {
|
|
113
|
+
if (!attributes.textAlign) return {};
|
|
114
|
+
return {
|
|
115
|
+
style: "text-align: ".concat(attributes.textAlign),
|
|
116
|
+
'data-text-align': attributes.textAlign
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
fontSize: {
|
|
121
|
+
default: null,
|
|
122
|
+
parseHTML: function parseHTML(element) {
|
|
123
|
+
return element.getAttribute('data-font-size') || element.style.fontSize;
|
|
124
|
+
},
|
|
125
|
+
renderHTML: function renderHTML(attributes) {
|
|
126
|
+
if (!attributes.fontSize) return {};
|
|
127
|
+
return {
|
|
128
|
+
style: "font-size: ".concat(attributes.fontSize),
|
|
129
|
+
'data-font-size': attributes.fontSize
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
fontWeight: {
|
|
134
|
+
default: null,
|
|
135
|
+
parseHTML: function parseHTML(element) {
|
|
136
|
+
return element.getAttribute('data-font-weight') || element.style.fontWeight;
|
|
137
|
+
},
|
|
138
|
+
renderHTML: function renderHTML(attributes) {
|
|
139
|
+
if (!attributes.fontWeight) return {};
|
|
140
|
+
return {
|
|
141
|
+
style: "font-weight: ".concat(attributes.fontWeight),
|
|
142
|
+
'data-font-weight': attributes.fontWeight
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
},
|
|
148
|
+
addKeyboardShortcuts: function addKeyboardShortcuts() {
|
|
149
|
+
var _this2 = this;
|
|
150
|
+
return {
|
|
151
|
+
Tab: function Tab() {
|
|
152
|
+
if (_this2.editor.commands.goToNextCell()) {
|
|
153
|
+
return _this2.editor.chain().cancelSelection().run();
|
|
154
|
+
} else if (!_this2.editor.can().addRowAfter()) {
|
|
155
|
+
return false;
|
|
156
|
+
} else {
|
|
157
|
+
return _this2.editor.chain().addRowAfter().goToNextCell().cancelSelection().run();
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
'Shift-Tab': function ShiftTab() {
|
|
161
|
+
return _this2.editor.chain().goToPreviousCell().cancelSelection().run();
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
}),
|
|
166
|
+
// 表格右键菜单插件
|
|
167
|
+
Extension.create({
|
|
168
|
+
name: 'tableContextMenu',
|
|
169
|
+
addProseMirrorPlugins: function addProseMirrorPlugins() {
|
|
170
|
+
return editable ? [createTableContextMenuPlugin(this.editor)] : [];
|
|
171
|
+
}
|
|
172
|
+
})];
|
|
173
|
+
};
|
|
174
|
+
export default TableExtension;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
import { TocList } from "../../../type";
|
|
3
|
+
import type { TableOfContentsOptions, TableOfContentsStorage } from './type';
|
|
4
|
+
export * from './type';
|
|
5
|
+
export declare const TableOfContentsExtension: Extension<TableOfContentsOptions, TableOfContentsStorage>;
|
|
6
|
+
export declare const TableOfContents: ({ onTocUpdate }: {
|
|
7
|
+
onTocUpdate?: ((toc: TocList) => void) | undefined;
|
|
8
|
+
}) => Extension<TableOfContentsOptions, TableOfContentsStorage>;
|
|
9
|
+
export default TableOfContents;
|
|
@@ -0,0 +1,391 @@
|
|
|
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 _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; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
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); }
|
|
7
|
+
import { Extension } from '@tiptap/core';
|
|
8
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
9
|
+
import { TableOfContentsPlugin } from "./plugin";
|
|
10
|
+
import { getHeadlineLevel, getHierarchicalIndexes, getLinearIndexes } from "./utils";
|
|
11
|
+
export * from "./type";
|
|
12
|
+
|
|
13
|
+
// 全局组合状态管理,避免在 IME 组合期间触发 TOC 更新
|
|
14
|
+
var globalCompositionState = false;
|
|
15
|
+
var globalCompositionEndTimer = null;
|
|
16
|
+
var globalInputTimer = null;
|
|
17
|
+
var lastInputTime = 0;
|
|
18
|
+
|
|
19
|
+
// 全局监听组合状态和输入事件
|
|
20
|
+
if (typeof document !== 'undefined') {
|
|
21
|
+
document.addEventListener('compositionstart', function () {
|
|
22
|
+
globalCompositionState = true;
|
|
23
|
+
}, {
|
|
24
|
+
passive: true
|
|
25
|
+
});
|
|
26
|
+
document.addEventListener('compositionend', function () {
|
|
27
|
+
globalCompositionState = false;
|
|
28
|
+
// 组合结束后,延迟刷新所有 TOC 实例
|
|
29
|
+
if (globalCompositionEndTimer) {
|
|
30
|
+
clearTimeout(globalCompositionEndTimer);
|
|
31
|
+
}
|
|
32
|
+
globalCompositionEndTimer = setTimeout(function () {
|
|
33
|
+
// 这里会通过 editor 实例来触发刷新
|
|
34
|
+
// 具体实现在 onTransaction 中处理
|
|
35
|
+
}, 200);
|
|
36
|
+
}, {
|
|
37
|
+
passive: true
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// 监听所有输入事件,记录最后输入时间
|
|
41
|
+
document.addEventListener('input', function () {
|
|
42
|
+
lastInputTime = Date.now();
|
|
43
|
+
}, {
|
|
44
|
+
passive: true
|
|
45
|
+
});
|
|
46
|
+
document.addEventListener('keydown', function () {
|
|
47
|
+
lastInputTime = Date.now();
|
|
48
|
+
}, {
|
|
49
|
+
passive: true
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
var addTocActiveStatesAndGetItems = function addTocActiveStatesAndGetItems(content, options) {
|
|
53
|
+
var editor = options.editor;
|
|
54
|
+
var headlines = [];
|
|
55
|
+
var scrolledOverIds = [];
|
|
56
|
+
var activeId = null;
|
|
57
|
+
if (editor.isDestroyed) {
|
|
58
|
+
return content;
|
|
59
|
+
}
|
|
60
|
+
editor.state.doc.descendants(function (node, pos) {
|
|
61
|
+
var _options$anchorTypes;
|
|
62
|
+
var isValidType = (_options$anchorTypes = options.anchorTypes) === null || _options$anchorTypes === void 0 ? void 0 : _options$anchorTypes.includes(node.type.name);
|
|
63
|
+
if (!isValidType) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
headlines.push({
|
|
67
|
+
node: node,
|
|
68
|
+
pos: pos
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
headlines.forEach(function (headline) {
|
|
72
|
+
var domElement = editor.view.domAtPos(headline.pos + 1).node;
|
|
73
|
+
var scrolledOver = options.storage.scrollPosition >= domElement.offsetTop;
|
|
74
|
+
if (scrolledOver) {
|
|
75
|
+
activeId = headline.node.attrs.id;
|
|
76
|
+
scrolledOverIds.push(headline.node.attrs.id);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
return content.map(function (heading) {
|
|
80
|
+
return _objectSpread(_objectSpread({}, heading), {}, {
|
|
81
|
+
isActive: heading.id === activeId,
|
|
82
|
+
isScrolledOver: scrolledOverIds.includes(heading.id)
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
var setTocData = function setTocData(options) {
|
|
87
|
+
var editor = options.editor,
|
|
88
|
+
onUpdate = options.onUpdate;
|
|
89
|
+
if (editor.isDestroyed) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
var headlines = [];
|
|
93
|
+
var anchors = [];
|
|
94
|
+
var anchorEls = [];
|
|
95
|
+
editor.state.doc.descendants(function (node, pos) {
|
|
96
|
+
var _options$anchorTypes2;
|
|
97
|
+
var isValidType = (_options$anchorTypes2 = options.anchorTypes) === null || _options$anchorTypes2 === void 0 ? void 0 : _options$anchorTypes2.includes(node.type.name);
|
|
98
|
+
if (!isValidType) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
headlines.push({
|
|
102
|
+
node: node,
|
|
103
|
+
pos: pos
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
headlines.forEach(function (headline, i) {
|
|
107
|
+
if (headline.node.textContent.length === 0) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
var domElement = editor.view.domAtPos(headline.pos + 1).node;
|
|
111
|
+
var scrolledOver = options.storage.scrollPosition >= domElement.offsetTop;
|
|
112
|
+
anchorEls.push(domElement);
|
|
113
|
+
var originalLevel = headline.node.attrs.level;
|
|
114
|
+
var level = options.getLevelFn(headline, anchors);
|
|
115
|
+
var itemIndex = options.getIndexFn(headline, anchors, level);
|
|
116
|
+
anchors.push({
|
|
117
|
+
itemIndex: itemIndex,
|
|
118
|
+
id: headline.node.attrs.id || options.getId(headline.node.textContent),
|
|
119
|
+
originalLevel: originalLevel,
|
|
120
|
+
level: level,
|
|
121
|
+
textContent: headline.node.textContent,
|
|
122
|
+
pos: headline.pos,
|
|
123
|
+
editor: editor,
|
|
124
|
+
isActive: false,
|
|
125
|
+
isScrolledOver: scrolledOver,
|
|
126
|
+
node: headline.node,
|
|
127
|
+
dom: domElement
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
// 计算 active 和 scrolledOver 状态
|
|
132
|
+
anchors = addTocActiveStatesAndGetItems(anchors, {
|
|
133
|
+
editor: options.editor,
|
|
134
|
+
anchorTypes: options.anchorTypes,
|
|
135
|
+
storage: options.storage
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
// 更新存储
|
|
139
|
+
options.storage.anchors = anchorEls;
|
|
140
|
+
options.storage.content = anchors;
|
|
141
|
+
|
|
142
|
+
// 调用回调
|
|
143
|
+
if (onUpdate) {
|
|
144
|
+
var isInitialCreation = options.storage.content.length === 0;
|
|
145
|
+
onUpdate(anchors, isInitialCreation);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
export var TableOfContentsExtension = Extension.create({
|
|
149
|
+
name: 'tableOfContents',
|
|
150
|
+
addStorage: function addStorage() {
|
|
151
|
+
return {
|
|
152
|
+
content: [],
|
|
153
|
+
anchors: [],
|
|
154
|
+
scrollHandler: function scrollHandler() {
|
|
155
|
+
return null;
|
|
156
|
+
},
|
|
157
|
+
scrollPosition: 0
|
|
158
|
+
};
|
|
159
|
+
},
|
|
160
|
+
addGlobalAttributes: function addGlobalAttributes() {
|
|
161
|
+
return [{
|
|
162
|
+
types: this.options.anchorTypes || ['heading'],
|
|
163
|
+
attributes: {
|
|
164
|
+
id: {
|
|
165
|
+
default: null,
|
|
166
|
+
renderHTML: function renderHTML(attributes) {
|
|
167
|
+
return {
|
|
168
|
+
id: attributes.id
|
|
169
|
+
};
|
|
170
|
+
},
|
|
171
|
+
parseHTML: function parseHTML(element) {
|
|
172
|
+
return element.id || null;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}];
|
|
177
|
+
},
|
|
178
|
+
addOptions: function addOptions() {
|
|
179
|
+
var defaultScrollParent = typeof window !== 'undefined' ? function () {
|
|
180
|
+
return window;
|
|
181
|
+
} : undefined;
|
|
182
|
+
return {
|
|
183
|
+
// eslint-disable-next-line
|
|
184
|
+
onUpdate: function onUpdate() {},
|
|
185
|
+
// eslint-disable-next-line
|
|
186
|
+
getId: function getId(_textContent) {
|
|
187
|
+
return uuidv4();
|
|
188
|
+
},
|
|
189
|
+
scrollParent: defaultScrollParent,
|
|
190
|
+
anchorTypes: ['heading']
|
|
191
|
+
};
|
|
192
|
+
},
|
|
193
|
+
addCommands: function addCommands() {
|
|
194
|
+
var _this = this;
|
|
195
|
+
return {
|
|
196
|
+
updateTableOfContents: function updateTableOfContents() {
|
|
197
|
+
return function (_ref) {
|
|
198
|
+
var dispatch = _ref.dispatch;
|
|
199
|
+
if (dispatch) {
|
|
200
|
+
var _this$options$onUpdat;
|
|
201
|
+
setTocData({
|
|
202
|
+
editor: _this.editor,
|
|
203
|
+
storage: _this.storage,
|
|
204
|
+
onUpdate: (_this$options$onUpdat = _this.options.onUpdate) === null || _this$options$onUpdat === void 0 ? void 0 : _this$options$onUpdat.bind(_this),
|
|
205
|
+
getIndexFn: _this.options.getIndex || getLinearIndexes,
|
|
206
|
+
getLevelFn: _this.options.getLevel || getHeadlineLevel,
|
|
207
|
+
anchorTypes: _this.options.anchorTypes,
|
|
208
|
+
getId: _this.options.getId || function (textContent) {
|
|
209
|
+
return uuidv4();
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
return true;
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
},
|
|
218
|
+
onTransaction: function onTransaction(_ref2) {
|
|
219
|
+
var _this2 = this;
|
|
220
|
+
var transaction = _ref2.transaction;
|
|
221
|
+
if (!transaction.docChanged) return;
|
|
222
|
+
var now = Date.now();
|
|
223
|
+
var timeSinceLastInput = now - lastInputTime;
|
|
224
|
+
|
|
225
|
+
// 组合期间完全不处理 TOC 更新,避免打断输入
|
|
226
|
+
if (globalCompositionState || this.editor.view.composing) {
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// 如果最近有输入(1秒内),延迟处理
|
|
231
|
+
if (timeSinceLastInput < 1000) {
|
|
232
|
+
if (globalInputTimer) {
|
|
233
|
+
clearTimeout(globalInputTimer);
|
|
234
|
+
}
|
|
235
|
+
globalInputTimer = setTimeout(function () {
|
|
236
|
+
// 再次检查组合状态
|
|
237
|
+
if (!globalCompositionState && !_this2.editor.view.composing) {
|
|
238
|
+
var _this2$options$onUpda;
|
|
239
|
+
setTocData({
|
|
240
|
+
editor: _this2.editor,
|
|
241
|
+
storage: _this2.storage,
|
|
242
|
+
onUpdate: (_this2$options$onUpda = _this2.options.onUpdate) === null || _this2$options$onUpda === void 0 ? void 0 : _this2$options$onUpda.bind(_this2),
|
|
243
|
+
getIndexFn: _this2.options.getIndex || getLinearIndexes,
|
|
244
|
+
getLevelFn: _this2.options.getLevel || getHeadlineLevel,
|
|
245
|
+
anchorTypes: _this2.options.anchorTypes,
|
|
246
|
+
getId: _this2.options.getId || function (textContent) {
|
|
247
|
+
return uuidv4();
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
}, 1000 - timeSinceLastInput + 200);
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// 非组合期间且无最近输入,使用 setTimeout 确保有足够延迟
|
|
256
|
+
setTimeout(function () {
|
|
257
|
+
// 再次检查,确保组合状态没有变化
|
|
258
|
+
if (!globalCompositionState && !_this2.editor.view.composing) {
|
|
259
|
+
var _this2$options$onUpda2;
|
|
260
|
+
setTocData({
|
|
261
|
+
editor: _this2.editor,
|
|
262
|
+
storage: _this2.storage,
|
|
263
|
+
onUpdate: (_this2$options$onUpda2 = _this2.options.onUpdate) === null || _this2$options$onUpda2 === void 0 ? void 0 : _this2$options$onUpda2.bind(_this2),
|
|
264
|
+
getIndexFn: _this2.options.getIndex || getLinearIndexes,
|
|
265
|
+
getLevelFn: _this2.options.getLevel || getHeadlineLevel,
|
|
266
|
+
anchorTypes: _this2.options.anchorTypes,
|
|
267
|
+
getId: _this2.options.getId || function (textContent) {
|
|
268
|
+
return uuidv4();
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
}, 100);
|
|
273
|
+
},
|
|
274
|
+
onCreate: function onCreate() {
|
|
275
|
+
var _this3 = this;
|
|
276
|
+
var tr = this.editor.state.tr;
|
|
277
|
+
var existingIds = [];
|
|
278
|
+
if (this.options.scrollParent && typeof this.options.scrollParent !== 'function') {
|
|
279
|
+
console.warn("[Tiptap Table of Contents Deprecation Notice]: The 'scrollParent' option must now be provided as a callback function that returns the 'scrollParent' element. The ability to pass this option directly will be deprecated in future releases.");
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// 异步处理初始 ID 分配,避免与初始输入竞争
|
|
283
|
+
requestAnimationFrame(function () {
|
|
284
|
+
_this3.editor.state.doc.descendants(function (node, pos) {
|
|
285
|
+
var _this3$options$anchor;
|
|
286
|
+
var nodeId = node.attrs.id;
|
|
287
|
+
var isValidType = (_this3$options$anchor = _this3.options.anchorTypes) === null || _this3$options$anchor === void 0 ? void 0 : _this3$options$anchor.includes(node.type.name);
|
|
288
|
+
if (!isValidType || node.textContent.length === 0) {
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
if (nodeId === null || nodeId === undefined || existingIds.includes(nodeId)) {
|
|
292
|
+
var id = '';
|
|
293
|
+
if (_this3.options.getId) {
|
|
294
|
+
id = _this3.options.getId(node.textContent);
|
|
295
|
+
} else {
|
|
296
|
+
id = uuidv4();
|
|
297
|
+
}
|
|
298
|
+
tr.setNodeMarkup(pos, undefined, _objectSpread(_objectSpread({}, node.attrs), {}, {
|
|
299
|
+
id: id
|
|
300
|
+
}));
|
|
301
|
+
}
|
|
302
|
+
existingIds.push(nodeId);
|
|
303
|
+
});
|
|
304
|
+
_this3.editor.view.dispatch(tr);
|
|
305
|
+
|
|
306
|
+
// 延迟初始化 TOC 数据
|
|
307
|
+
setTimeout(function () {
|
|
308
|
+
var _this3$options$onUpda;
|
|
309
|
+
setTocData({
|
|
310
|
+
editor: _this3.editor,
|
|
311
|
+
storage: _this3.storage,
|
|
312
|
+
onUpdate: (_this3$options$onUpda = _this3.options.onUpdate) === null || _this3$options$onUpda === void 0 ? void 0 : _this3$options$onUpda.bind(_this3),
|
|
313
|
+
getIndexFn: _this3.options.getIndex || getLinearIndexes,
|
|
314
|
+
getLevelFn: _this3.options.getLevel || getHeadlineLevel,
|
|
315
|
+
anchorTypes: _this3.options.anchorTypes,
|
|
316
|
+
getId: _this3.options.getId || function (textContent) {
|
|
317
|
+
return uuidv4();
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
}, 100);
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
// 防抖的 scroll handler,避免滚动期间频繁触发回调
|
|
324
|
+
var scrollTimer = null;
|
|
325
|
+
this.storage.scrollHandler = function () {
|
|
326
|
+
if (!_this3.options.scrollParent) {
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
var scrollParent = typeof _this3.options.scrollParent === 'function' ? _this3.options.scrollParent() : _this3.options.scrollParent;
|
|
330
|
+
var scrollPosition = scrollParent instanceof HTMLElement ? scrollParent.scrollTop : scrollParent.scrollY;
|
|
331
|
+
_this3.storage.scrollPosition = scrollPosition || 0;
|
|
332
|
+
if (scrollTimer) clearTimeout(scrollTimer);
|
|
333
|
+
scrollTimer = setTimeout(function () {
|
|
334
|
+
var _this3$options$onUpda2, _this3$options;
|
|
335
|
+
var updatedItems = addTocActiveStatesAndGetItems(_this3.storage.content, {
|
|
336
|
+
editor: _this3.editor,
|
|
337
|
+
anchorTypes: _this3.options.anchorTypes,
|
|
338
|
+
storage: _this3.storage
|
|
339
|
+
});
|
|
340
|
+
_this3.storage.content = updatedItems;
|
|
341
|
+
// 调用 onUpdate 回调
|
|
342
|
+
(_this3$options$onUpda2 = (_this3$options = _this3.options).onUpdate) === null || _this3$options$onUpda2 === void 0 || _this3$options$onUpda2.call(_this3$options, updatedItems, false);
|
|
343
|
+
}, 100);
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
// 添加滚动监听
|
|
347
|
+
if (this.options.scrollParent) {
|
|
348
|
+
var scrollParent = typeof this.options.scrollParent === 'function' ? this.options.scrollParent() : this.options.scrollParent;
|
|
349
|
+
if (scrollParent) {
|
|
350
|
+
scrollParent.addEventListener('scroll', this.storage.scrollHandler);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
onDestroy: function onDestroy() {
|
|
355
|
+
if (this.options.scrollParent) {
|
|
356
|
+
var scrollParent = typeof this.options.scrollParent === 'function' ? this.options.scrollParent() : this.options.scrollParent;
|
|
357
|
+
if (scrollParent) {
|
|
358
|
+
scrollParent.removeEventListener('scroll', this.storage.scrollHandler);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
addProseMirrorPlugins: function addProseMirrorPlugins() {
|
|
363
|
+
return [TableOfContentsPlugin({
|
|
364
|
+
getId: this.options.getId,
|
|
365
|
+
anchorTypes: this.options.anchorTypes
|
|
366
|
+
})];
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
export var TableOfContents = function TableOfContents(_ref3) {
|
|
370
|
+
var onTocUpdate = _ref3.onTocUpdate;
|
|
371
|
+
return TableOfContentsExtension.configure({
|
|
372
|
+
getIndex: getHierarchicalIndexes,
|
|
373
|
+
onUpdate: function onUpdate(data) {
|
|
374
|
+
setTimeout(function () {
|
|
375
|
+
onTocUpdate === null || onTocUpdate === void 0 || onTocUpdate(data.map(function (content) {
|
|
376
|
+
return {
|
|
377
|
+
id: content.id,
|
|
378
|
+
isActive: content.isActive,
|
|
379
|
+
isScrolledOver: content.isScrolledOver,
|
|
380
|
+
itemIndex: content.itemIndex,
|
|
381
|
+
level: content.level,
|
|
382
|
+
originalLevel: content.originalLevel,
|
|
383
|
+
pos: content.pos,
|
|
384
|
+
textContent: content.textContent
|
|
385
|
+
};
|
|
386
|
+
}));
|
|
387
|
+
}, 0);
|
|
388
|
+
}
|
|
389
|
+
});
|
|
390
|
+
};
|
|
391
|
+
export default TableOfContents;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { NodeType } from '@tiptap/pm/model';
|
|
2
|
+
import { Plugin } from '@tiptap/pm/state';
|
|
3
|
+
export declare const TableOfContentsPlugin: ({ getId, anchorTypes, }: {
|
|
4
|
+
getId?: ((textContent: string) => string) | undefined;
|
|
5
|
+
anchorTypes?: (string | NodeType)[] | undefined;
|
|
6
|
+
}) => Plugin<any>;
|
|
@@ -0,0 +1,58 @@
|
|
|
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 _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; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
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); }
|
|
7
|
+
import { Plugin, PluginKey } from '@tiptap/pm/state';
|
|
8
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
9
|
+
export var TableOfContentsPlugin = function TableOfContentsPlugin(_ref) {
|
|
10
|
+
var getId = _ref.getId,
|
|
11
|
+
_ref$anchorTypes = _ref.anchorTypes,
|
|
12
|
+
anchorTypes = _ref$anchorTypes === void 0 ? ['heading'] : _ref$anchorTypes;
|
|
13
|
+
return new Plugin({
|
|
14
|
+
key: new PluginKey('tableOfContent'),
|
|
15
|
+
appendTransaction: function appendTransaction(transactions, oldState, newState) {
|
|
16
|
+
var _view;
|
|
17
|
+
// 若处于组合输入,完全避免在此事务中写入 id,交由扩展层异步生成
|
|
18
|
+
if ((_view = newState.view) !== null && _view !== void 0 && _view.composing || typeof document !== 'undefined' && document.composing || typeof window !== 'undefined' && window.compositionState) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// 检查是否有任何事务包含组合相关的变化
|
|
23
|
+
var hasCompositionChanges = transactions.some(function (tr) {
|
|
24
|
+
return tr.getMeta('composition') || tr.getMeta('compositionend') || tr.getMeta('compositionstart');
|
|
25
|
+
});
|
|
26
|
+
if (hasCompositionChanges) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
var tr = newState.tr;
|
|
30
|
+
var modified = false;
|
|
31
|
+
if (transactions.some(function (transaction) {
|
|
32
|
+
return transaction.docChanged;
|
|
33
|
+
}) && !oldState.doc.eq(newState.doc)) {
|
|
34
|
+
var existingIds = [];
|
|
35
|
+
newState.doc.descendants(function (node, pos) {
|
|
36
|
+
var nodeId = node.attrs.id;
|
|
37
|
+
if (!anchorTypes.includes(node.type.name) || node.textContent.length === 0) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (nodeId === null || nodeId === undefined || existingIds.includes(nodeId)) {
|
|
41
|
+
var id = '';
|
|
42
|
+
if (getId) {
|
|
43
|
+
id = getId(node.textContent);
|
|
44
|
+
} else {
|
|
45
|
+
id = uuidv4();
|
|
46
|
+
}
|
|
47
|
+
tr.setNodeMarkup(pos, undefined, _objectSpread(_objectSpread({}, node.attrs), {}, {
|
|
48
|
+
id: id
|
|
49
|
+
}));
|
|
50
|
+
modified = true;
|
|
51
|
+
}
|
|
52
|
+
existingIds.push(nodeId);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return modified ? tr : null;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/core';
|
|
2
|
+
import type { Node } from '@tiptap/pm/model';
|
|
3
|
+
export type GetTableOfContentLevelFunction = (headline: {
|
|
4
|
+
node: Node;
|
|
5
|
+
pos: number;
|
|
6
|
+
}, previousItems: TableOfContentDataItem[]) => number;
|
|
7
|
+
export type GetTableOfContentIndexFunction = (headline: {
|
|
8
|
+
node: Node;
|
|
9
|
+
pos: number;
|
|
10
|
+
}, previousItems: TableOfContentDataItem[], currentLevel?: number) => number;
|
|
11
|
+
export type TableOfContentsOptions = {
|
|
12
|
+
getId?: (textContent: string) => string;
|
|
13
|
+
onUpdate?: (data: TableOfContentData, isCreate?: boolean) => void;
|
|
14
|
+
getLevel?: GetTableOfContentLevelFunction;
|
|
15
|
+
getIndex?: GetTableOfContentIndexFunction;
|
|
16
|
+
scrollParent?: (() => HTMLElement | Window) | HTMLElement | Window;
|
|
17
|
+
anchorTypes?: Array<string>;
|
|
18
|
+
};
|
|
19
|
+
export type TableOfContentsStorage = {
|
|
20
|
+
content: TableOfContentData;
|
|
21
|
+
anchors: Array<HTMLHeadingElement | HTMLElement>;
|
|
22
|
+
scrollHandler: () => void;
|
|
23
|
+
scrollPosition: number;
|
|
24
|
+
};
|
|
25
|
+
export type TableOfContentData = Array<TableOfContentDataItem>;
|
|
26
|
+
export type TableOfContentDataItem = {
|
|
27
|
+
dom: HTMLHeadingElement;
|
|
28
|
+
editor: Editor;
|
|
29
|
+
id: string;
|
|
30
|
+
isActive: boolean;
|
|
31
|
+
isScrolledOver: boolean;
|
|
32
|
+
itemIndex: number;
|
|
33
|
+
level: number;
|
|
34
|
+
node: Node;
|
|
35
|
+
originalLevel: number;
|
|
36
|
+
pos: number;
|
|
37
|
+
textContent: string;
|
|
38
|
+
};
|
|
39
|
+
declare module '@tiptap/core' {
|
|
40
|
+
interface Commands<ReturnType> {
|
|
41
|
+
tableOfContents: {
|
|
42
|
+
updateTableOfContents: () => ReturnType;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|