@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,161 @@
|
|
|
1
|
+
@import 'highlight.js/styles/atom-one-dark.css';
|
|
2
|
+
@import 'katex/dist/katex.min.css';
|
|
3
|
+
|
|
4
|
+
:root {
|
|
5
|
+
--mui-shape-borderRadius: 10px;
|
|
6
|
+
--mui-spacing-unit: 8px;
|
|
7
|
+
|
|
8
|
+
--mui-transitions-duration-short: 250ms;
|
|
9
|
+
--mui-transitions-duration-standard: 300ms;
|
|
10
|
+
--mui-transitions-easing-easeOut: cubic-bezier(0.0, 0, 0.2, 1);
|
|
11
|
+
--mui-transitions-easing-easeInOut: cubic-bezier(0.4, 0, 0.2, 1);
|
|
12
|
+
|
|
13
|
+
overflow-wrap: break-word;
|
|
14
|
+
text-size-adjust: none;
|
|
15
|
+
text-rendering: optimizeLegibility;
|
|
16
|
+
-webkit-font-smoothing: antialiased;
|
|
17
|
+
-moz-osx-font-smoothing: grayscale;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
* {
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.tiptap.ProseMirror {
|
|
25
|
+
padding: 0.25rem;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.tiptap.ProseMirror label:has(input[type="checkbox"]) {
|
|
29
|
+
line-height: 1;
|
|
30
|
+
padding-top: 0.5rem;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.tiptap.ProseMirror input[type="checkbox"] {
|
|
34
|
+
appearance: none;
|
|
35
|
+
-webkit-appearance: none;
|
|
36
|
+
-moz-appearance: none;
|
|
37
|
+
width: 1rem;
|
|
38
|
+
height: 1rem;
|
|
39
|
+
border: 2px solid var(--mui-palette-divider);
|
|
40
|
+
border-radius: 4px;
|
|
41
|
+
background-color: var(--mui-palette-background-default);
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
position: relative;
|
|
44
|
+
transition: all var(--mui-transitions-duration-short) var(--mui-transitions-easing-easeOut);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.tiptap.ProseMirror input[type="checkbox"]:checked {
|
|
48
|
+
background-color: var(--mui-palette-background-paper);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.tiptap.ProseMirror input[type="checkbox"]:checked::after {
|
|
52
|
+
content: "";
|
|
53
|
+
width: 100%;
|
|
54
|
+
height: 100%;
|
|
55
|
+
position: absolute;
|
|
56
|
+
left: 50%;
|
|
57
|
+
top: 50%;
|
|
58
|
+
transform: translate(-50%, -50%);
|
|
59
|
+
background-color: var(--mui-palette-primary-main);
|
|
60
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22currentColor%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21.4142%204.58579C22.1953%205.36683%2022.1953%206.63317%2021.4142%207.41421L10.4142%2018.4142C9.63317%2019.1953%208.36684%2019.1953%207.58579%2018.4142L2.58579%2013.4142C1.80474%2012.6332%201.80474%2011.3668%202.58579%2010.5858C3.36683%209.80474%204.63317%209.80474%205.41421%2010.5858L9%2014.1716L18.5858%204.58579C19.3668%203.80474%2020.6332%203.80474%2021.4142%204.58579Z%22%20fill%3D%22currentColor%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat;
|
|
61
|
+
mask: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22currentColor%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21.4142%204.58579C22.1953%205.36683%2022.1953%206.63317%2021.4142%207.41421L10.4142%2018.4142C9.63317%2019.1953%208.36684%2019.1953%207.58579%2018.4142L2.58579%2013.4142C1.80474%2012.6332%201.80474%2011.3668%202.58579%2010.5858C3.36683%209.80474%204.63317%209.80474%205.41421%2010.5858L9%2014.1716L18.5858%204.58579C19.3668%203.80474%2020.6332%203.80474%2021.4142%204.58579Z%22%20fill%3D%22currentColor%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.tiptap.ProseMirror input[type="checkbox"]:focus {
|
|
65
|
+
outline: none;
|
|
66
|
+
box-shadow: 0 0 0 2px var(--mui-palette-action-selected);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.tiptap.ProseMirror input[type="checkbox"]:disabled {
|
|
70
|
+
opacity: 0.5;
|
|
71
|
+
cursor: not-allowed;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.tiptap.ProseMirror input[type="checkbox"]:disabled:checked {
|
|
75
|
+
background-color: var(--mui-palette-text-disabled);
|
|
76
|
+
border-color: var(--mui-palette-text-disabled);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.tiptap.ProseMirror .react-renderer {
|
|
80
|
+
margin-bottom: 1rem;
|
|
81
|
+
line-height: 1;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.tiptap.ProseMirror .react-renderer.node-image,
|
|
85
|
+
.tiptap.ProseMirror .react-renderer.node-inlineLink,
|
|
86
|
+
.tiptap.ProseMirror .react-renderer.node-inlineAttachment,
|
|
87
|
+
.tiptap.ProseMirror .react-renderer.node-inlineMath {
|
|
88
|
+
display: inline-block;
|
|
89
|
+
margin: 0 0.25rem;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.tiptap.ProseMirror .react-renderer.node-blockLink:has(.block-link-wrapper),
|
|
93
|
+
.tiptap.ProseMirror .react-renderer.node-attachment:has(.block-attachment-wrapper) {
|
|
94
|
+
display: block;
|
|
95
|
+
margin: 0 0 1rem 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.tiptap.ProseMirror p :first-child:is(.react-renderer.node-image),
|
|
99
|
+
.tiptap.ProseMirror p :first-child:is(.react-renderer.node-inlineMath) {
|
|
100
|
+
margin-left: 0;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.tiptap.ProseMirror .audio-wrapper,
|
|
104
|
+
.tiptap.ProseMirror .video-wrapper,
|
|
105
|
+
.tiptap.ProseMirror .image-wrapper {
|
|
106
|
+
line-height: 0;
|
|
107
|
+
margin: 0 0.25rem;
|
|
108
|
+
padding: 0.25rem;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.tiptap.ProseMirror .video-wrapper,
|
|
112
|
+
.tiptap.ProseMirror .image-wrapper {
|
|
113
|
+
display: inline-block;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.tiptap.ProseMirror .audio-wrapper.ProseMirror-selectednode>div,
|
|
117
|
+
.tiptap.ProseMirror .video-wrapper.ProseMirror-selectednode>div,
|
|
118
|
+
.tiptap.ProseMirror .image-wrapper.ProseMirror-selectednode>span {
|
|
119
|
+
border-color: var(--mui-palette-primary-main);
|
|
120
|
+
background-color: color-mix(in srgb, var(--mui-palette-primary-main) 5%, transparent);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.tiptap.ProseMirror .image-wrapper img {
|
|
124
|
+
vertical-align: middle;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.tiptap.ProseMirror .custom-placeholder-node {
|
|
128
|
+
position: relative;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.tiptap p.is-editor-empty:first-child::before {
|
|
132
|
+
color: #adb5bd;
|
|
133
|
+
content: attr(data-placeholder);
|
|
134
|
+
float: left;
|
|
135
|
+
height: 0;
|
|
136
|
+
pointer-events: none;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
.tiptap.ProseMirror .custom-placeholder-node:not(.is-editor-empty:first-child)::before {
|
|
141
|
+
color: #adb5bd;
|
|
142
|
+
content: attr(data-placeholder);
|
|
143
|
+
float: left;
|
|
144
|
+
height: 0;
|
|
145
|
+
pointer-events: none;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.tiptap.ProseMirror .node-codeBlock.custom-placeholder-node:not(.is-editor-empty:first-child)::before {
|
|
149
|
+
position: absolute;
|
|
150
|
+
height: 1.5rem;
|
|
151
|
+
top: 32px;
|
|
152
|
+
left: 16px;
|
|
153
|
+
z-index: 1;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.tiptap.ProseMirror ul[data-type="taskList"].custom-placeholder-node:not(.is-editor-empty:first-child)::before {
|
|
157
|
+
position: absolute;
|
|
158
|
+
height: 1.5rem;
|
|
159
|
+
left: 32px;
|
|
160
|
+
z-index: 1;
|
|
161
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<?xml version="1.0" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg t="1749731788924" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3658" width="16" height="16"><path d="M430.4 825.15199999l191.168-163.84000001a28.16 28.16 0 0 0 1e-8-42.688l-191.16800001-163.84A28.16 28.16 0 0 0 384 476.15999998l0 327.68a28.16 28.16 0 0 0 46.4 21.31200001z" p-id="3659" fill="#999999"></path></svg>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/react';
|
|
2
|
+
import { MenuItem } from "../../type";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export interface SelectionTextProps {
|
|
5
|
+
editor: Editor;
|
|
6
|
+
more?: MenuItem[];
|
|
7
|
+
}
|
|
8
|
+
declare const SelectionText: ({ editor, more }: SelectionTextProps) => React.JSX.Element | null;
|
|
9
|
+
export default SelectionText;
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { Box, IconButton, Paper, Stack, useTheme } from '@mui/material';
|
|
8
|
+
import { BubbleMenu } from '@tiptap/react/menus';
|
|
9
|
+
import { BoldIcon, CodeLineIcon, ItalicIcon, LinkIcon, ResetLeftFillIcon, StrikethroughIcon, SubscriptIcon, SuperscriptIcon, UnderlineIcon } from "../Icons";
|
|
10
|
+
import React, { useEffect, useState } from 'react';
|
|
11
|
+
import { ToolbarItem } from "../Toolbar";
|
|
12
|
+
var SelectionText = function SelectionText(_ref) {
|
|
13
|
+
var editor = _ref.editor,
|
|
14
|
+
more = _ref.more;
|
|
15
|
+
var theme = useTheme();
|
|
16
|
+
var THEME_TEXT_COLOR = [theme.palette.primary.main, theme.palette.success.main, theme.palette.warning.main, theme.palette.error.main, '#D8A47F', '#73B5F0', '#CDDFA0', theme.palette.text.primary, theme.palette.text.secondary, theme.palette.text.disabled, theme.palette.common.white];
|
|
17
|
+
var THEME_TEXT_BG_COLOR = ['#e7bdff', '#FFE0B2', '#F8BBD0', '#FFCDD2', '#FFECB3', '#FFCCBC', '#B3E5FC', '#C8E6C9', '#B2EBF2', '#BBDEFB', '#DCEDC8'];
|
|
18
|
+
var _useState = useState({
|
|
19
|
+
quote: false,
|
|
20
|
+
bold: false,
|
|
21
|
+
italic: false,
|
|
22
|
+
strike: false,
|
|
23
|
+
underline: false,
|
|
24
|
+
code: false,
|
|
25
|
+
superscript: false,
|
|
26
|
+
subscript: false
|
|
27
|
+
}),
|
|
28
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
29
|
+
active = _useState2[0],
|
|
30
|
+
setActive = _useState2[1];
|
|
31
|
+
// const [showColorPicker, setShowColorPicker] = useState(false)
|
|
32
|
+
|
|
33
|
+
var updateSelection = function updateSelection() {
|
|
34
|
+
setActive({
|
|
35
|
+
quote: editor.isActive('blockquote'),
|
|
36
|
+
bold: editor.isActive('bold'),
|
|
37
|
+
italic: editor.isActive('italic'),
|
|
38
|
+
strike: editor.isActive('strike'),
|
|
39
|
+
underline: editor.isActive('underline'),
|
|
40
|
+
code: editor.isActive('code'),
|
|
41
|
+
superscript: editor.isActive('superscript'),
|
|
42
|
+
subscript: editor.isActive('subscript')
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
useEffect(function () {
|
|
46
|
+
editor.on('selectionUpdate', updateSelection);
|
|
47
|
+
editor.on('transaction', updateSelection);
|
|
48
|
+
return function () {
|
|
49
|
+
editor.off('selectionUpdate', updateSelection);
|
|
50
|
+
editor.off('transaction', updateSelection);
|
|
51
|
+
};
|
|
52
|
+
}, [editor]);
|
|
53
|
+
if (!editor.isEditable) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
return /*#__PURE__*/React.createElement(BubbleMenu, {
|
|
57
|
+
editor: editor,
|
|
58
|
+
pluginKey: 'bubble-menu',
|
|
59
|
+
options: {
|
|
60
|
+
placement: 'bottom',
|
|
61
|
+
offset: 8
|
|
62
|
+
},
|
|
63
|
+
shouldShow: function shouldShow(_ref2) {
|
|
64
|
+
var editorProps = _ref2.editor,
|
|
65
|
+
from = _ref2.from,
|
|
66
|
+
to = _ref2.to;
|
|
67
|
+
if (editorProps.state.selection.empty || editorProps.isActive('code') || editorProps.isActive('image') || editorProps.isActive('video') || editorProps.isActive('audio') || editorProps.isActive('emoji') || editorProps.isActive('codeBlock') || editorProps.isActive('blockLink') || editorProps.isActive('inlineLink') || editorProps.isActive('blockAttachment') || editorProps.isActive('inlineAttachment')) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
}, /*#__PURE__*/React.createElement(Paper, {
|
|
73
|
+
sx: {
|
|
74
|
+
p: 0.5,
|
|
75
|
+
borderRadius: 'var(--mui-shape-borderRadius)'
|
|
76
|
+
}
|
|
77
|
+
}, /*#__PURE__*/React.createElement(Stack, {
|
|
78
|
+
direction: 'row',
|
|
79
|
+
alignItems: 'center',
|
|
80
|
+
justifyContent: 'space-between'
|
|
81
|
+
}, /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
82
|
+
tip: "\u52A0\u7C97",
|
|
83
|
+
icon: /*#__PURE__*/React.createElement(BoldIcon, {
|
|
84
|
+
sx: {
|
|
85
|
+
fontSize: '1rem'
|
|
86
|
+
}
|
|
87
|
+
}),
|
|
88
|
+
onClick: function onClick() {
|
|
89
|
+
return editor.chain().focus().toggleBold().run();
|
|
90
|
+
},
|
|
91
|
+
className: active.bold ? "tool-active" : ""
|
|
92
|
+
}), /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
93
|
+
tip: "\u659C\u4F53",
|
|
94
|
+
icon: /*#__PURE__*/React.createElement(ItalicIcon, {
|
|
95
|
+
sx: {
|
|
96
|
+
fontSize: '1rem'
|
|
97
|
+
}
|
|
98
|
+
}),
|
|
99
|
+
onClick: function onClick() {
|
|
100
|
+
return editor.chain().focus().toggleItalic().run();
|
|
101
|
+
},
|
|
102
|
+
className: active.italic ? "tool-active" : ""
|
|
103
|
+
}), /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
104
|
+
tip: "\u5220\u9664\u7EBF",
|
|
105
|
+
icon: /*#__PURE__*/React.createElement(StrikethroughIcon, {
|
|
106
|
+
sx: {
|
|
107
|
+
fontSize: '1rem'
|
|
108
|
+
}
|
|
109
|
+
}),
|
|
110
|
+
onClick: function onClick() {
|
|
111
|
+
return editor.chain().focus().toggleStrike().run();
|
|
112
|
+
},
|
|
113
|
+
className: active.strike ? "tool-active" : ""
|
|
114
|
+
}), /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
115
|
+
tip: "\u4E0B\u5212\u7EBF",
|
|
116
|
+
icon: /*#__PURE__*/React.createElement(UnderlineIcon, {
|
|
117
|
+
sx: {
|
|
118
|
+
fontSize: '1rem'
|
|
119
|
+
}
|
|
120
|
+
}),
|
|
121
|
+
onClick: function onClick() {
|
|
122
|
+
return editor.chain().focus().toggleUnderline().run();
|
|
123
|
+
},
|
|
124
|
+
className: active.underline ? "tool-active" : ""
|
|
125
|
+
}), /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
126
|
+
tip: "\u4E0A\u6807",
|
|
127
|
+
icon: /*#__PURE__*/React.createElement(SuperscriptIcon, {
|
|
128
|
+
sx: {
|
|
129
|
+
fontSize: '1rem'
|
|
130
|
+
}
|
|
131
|
+
}),
|
|
132
|
+
onClick: function onClick() {
|
|
133
|
+
return editor.chain().focus().toggleSuperscript().run();
|
|
134
|
+
},
|
|
135
|
+
className: active.superscript ? "tool-active" : ""
|
|
136
|
+
}), /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
137
|
+
tip: "\u4E0B\u6807",
|
|
138
|
+
icon: /*#__PURE__*/React.createElement(SubscriptIcon, {
|
|
139
|
+
sx: {
|
|
140
|
+
fontSize: '1rem'
|
|
141
|
+
}
|
|
142
|
+
}),
|
|
143
|
+
onClick: function onClick() {
|
|
144
|
+
return editor.chain().focus().toggleSubscript().run();
|
|
145
|
+
},
|
|
146
|
+
className: active.subscript ? "tool-active" : ""
|
|
147
|
+
}), /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
148
|
+
tip: "\u4EE3\u7801",
|
|
149
|
+
icon: /*#__PURE__*/React.createElement(CodeLineIcon, {
|
|
150
|
+
sx: {
|
|
151
|
+
fontSize: '1rem'
|
|
152
|
+
}
|
|
153
|
+
}),
|
|
154
|
+
onClick: function onClick() {
|
|
155
|
+
return editor.chain().focus().toggleCode().run();
|
|
156
|
+
},
|
|
157
|
+
className: active.code ? "tool-active" : ""
|
|
158
|
+
}), /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
159
|
+
tip: "\u63D2\u5165\u94FE\u63A5",
|
|
160
|
+
icon: /*#__PURE__*/React.createElement(LinkIcon, {
|
|
161
|
+
sx: {
|
|
162
|
+
fontSize: '1rem'
|
|
163
|
+
}
|
|
164
|
+
}),
|
|
165
|
+
onClick: function onClick() {
|
|
166
|
+
var selection = editor.state.selection;
|
|
167
|
+
var start = selection.from;
|
|
168
|
+
var end = selection.to;
|
|
169
|
+
var text = editor.state.doc.textBetween(start, end, '');
|
|
170
|
+
editor.chain().focus().setInlineLink({
|
|
171
|
+
href: '',
|
|
172
|
+
title: text
|
|
173
|
+
}).run();
|
|
174
|
+
}
|
|
175
|
+
}), more === null || more === void 0 ? void 0 : more.map(function (item) {
|
|
176
|
+
return /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
177
|
+
key: item.key,
|
|
178
|
+
tip: item.label,
|
|
179
|
+
icon: item.icon || /*#__PURE__*/React.createElement(React.Fragment, null),
|
|
180
|
+
onClick: item.onClick
|
|
181
|
+
});
|
|
182
|
+
})), /*#__PURE__*/React.createElement(Box, {
|
|
183
|
+
sx: {
|
|
184
|
+
mt: 0.5,
|
|
185
|
+
p: 1.5,
|
|
186
|
+
borderTop: '1px solid',
|
|
187
|
+
borderColor: 'divider',
|
|
188
|
+
boxSizing: 'border-box'
|
|
189
|
+
}
|
|
190
|
+
}, /*#__PURE__*/React.createElement(Stack, {
|
|
191
|
+
direction: 'row',
|
|
192
|
+
alignItems: 'center',
|
|
193
|
+
sx: {
|
|
194
|
+
fontSize: 14,
|
|
195
|
+
mb: 0.5
|
|
196
|
+
}
|
|
197
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
198
|
+
sx: {
|
|
199
|
+
color: 'text.secondary'
|
|
200
|
+
}
|
|
201
|
+
}, "\u6587\u5B57\u989C\u8272"), /*#__PURE__*/React.createElement(IconButton, {
|
|
202
|
+
size: "small",
|
|
203
|
+
onClick: function onClick() {
|
|
204
|
+
editor.chain().focus().setColor('').run();
|
|
205
|
+
},
|
|
206
|
+
sx: {
|
|
207
|
+
color: 'text.disabled',
|
|
208
|
+
':hover': {
|
|
209
|
+
color: 'primary.main'
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}, /*#__PURE__*/React.createElement(ResetLeftFillIcon, {
|
|
213
|
+
sx: {
|
|
214
|
+
fontSize: '1rem'
|
|
215
|
+
}
|
|
216
|
+
}))), /*#__PURE__*/React.createElement(Stack, {
|
|
217
|
+
direction: 'row',
|
|
218
|
+
flexWrap: 'wrap',
|
|
219
|
+
gap: 0.5
|
|
220
|
+
}, THEME_TEXT_COLOR.map(function (c) {
|
|
221
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
222
|
+
key: c,
|
|
223
|
+
sx: {
|
|
224
|
+
width: '1.5rem',
|
|
225
|
+
height: '1.5rem',
|
|
226
|
+
cursor: 'pointer',
|
|
227
|
+
border: '1px solid',
|
|
228
|
+
borderColor: c === theme.palette.common.white ? 'divider' : c,
|
|
229
|
+
boxSizing: 'border-box',
|
|
230
|
+
borderRadius: 'var(--mui-shape-borderRadius)',
|
|
231
|
+
bgcolor: c,
|
|
232
|
+
transition: 'transform 0.3s',
|
|
233
|
+
'&:hover': {
|
|
234
|
+
transform: 'scale(1.05)'
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
onClick: function onClick() {
|
|
238
|
+
editor.chain().focus().setColor(c).run();
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
})), /*#__PURE__*/React.createElement(Stack, {
|
|
242
|
+
direction: 'row',
|
|
243
|
+
alignItems: 'center',
|
|
244
|
+
sx: {
|
|
245
|
+
fontSize: 14,
|
|
246
|
+
mb: 0.5,
|
|
247
|
+
mt: 2
|
|
248
|
+
}
|
|
249
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
250
|
+
sx: {
|
|
251
|
+
color: 'text.secondary'
|
|
252
|
+
}
|
|
253
|
+
}, "\u80CC\u666F\u989C\u8272"), /*#__PURE__*/React.createElement(IconButton, {
|
|
254
|
+
size: "small",
|
|
255
|
+
onClick: function onClick() {
|
|
256
|
+
editor.chain().focus().setBackgroundColor('').run();
|
|
257
|
+
},
|
|
258
|
+
sx: {
|
|
259
|
+
color: 'text.disabled',
|
|
260
|
+
':hover': {
|
|
261
|
+
color: 'primary.main'
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}, /*#__PURE__*/React.createElement(ResetLeftFillIcon, {
|
|
265
|
+
sx: {
|
|
266
|
+
fontSize: '1rem'
|
|
267
|
+
}
|
|
268
|
+
}))), /*#__PURE__*/React.createElement(Stack, {
|
|
269
|
+
direction: 'row',
|
|
270
|
+
flexWrap: 'wrap',
|
|
271
|
+
gap: 0.5
|
|
272
|
+
}, THEME_TEXT_BG_COLOR.map(function (c) {
|
|
273
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
274
|
+
key: c,
|
|
275
|
+
sx: {
|
|
276
|
+
width: '1.5rem',
|
|
277
|
+
height: '1.5rem',
|
|
278
|
+
cursor: 'pointer',
|
|
279
|
+
border: '1px solid',
|
|
280
|
+
borderColor: c === theme.palette.common.white ? 'divider' : c,
|
|
281
|
+
boxSizing: 'border-box',
|
|
282
|
+
borderRadius: 'var(--mui-shape-borderRadius)',
|
|
283
|
+
bgcolor: c,
|
|
284
|
+
transition: 'transform 0.3s',
|
|
285
|
+
'&:hover': {
|
|
286
|
+
transform: 'scale(1.05)'
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
onClick: function onClick() {
|
|
290
|
+
editor.chain().focus().setBackgroundColor(c).run();
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
})))));
|
|
294
|
+
};
|
|
295
|
+
export default SelectionText;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/react';
|
|
2
|
+
import { MenuItem, OnTipFunction } from "../../type";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
declare const CustomDragHandle: ({ editor, more, onTip }: {
|
|
5
|
+
editor: Editor;
|
|
6
|
+
more?: MenuItem[] | undefined;
|
|
7
|
+
onTip?: OnTipFunction | undefined;
|
|
8
|
+
}) => React.JSX.Element;
|
|
9
|
+
export default CustomDragHandle;
|