@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,101 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
4
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
5
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
+
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."); }
|
|
7
|
+
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); }
|
|
8
|
+
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; }
|
|
9
|
+
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; } }
|
|
10
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
import { Box, MenuItem, Select, Stack } from "@mui/material";
|
|
12
|
+
import { MoreLineIcon, Notification3LineIcon } from "../../Icons";
|
|
13
|
+
import ToolbarItem from "../Item";
|
|
14
|
+
import React, { useState } from "react";
|
|
15
|
+
import NotificationDialog from "./NotificationDialog";
|
|
16
|
+
var EditorMore = function EditorMore(_ref) {
|
|
17
|
+
var _ref$more = _ref.more,
|
|
18
|
+
more = _ref$more === void 0 ? [] : _ref$more;
|
|
19
|
+
var _useState = useState(''),
|
|
20
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
21
|
+
showDialog = _useState2[0],
|
|
22
|
+
setShowDialog = _useState2[1];
|
|
23
|
+
var options = [{
|
|
24
|
+
id: 'notification',
|
|
25
|
+
icon: /*#__PURE__*/React.createElement(Notification3LineIcon, {
|
|
26
|
+
sx: {
|
|
27
|
+
fontSize: '1rem'
|
|
28
|
+
}
|
|
29
|
+
}),
|
|
30
|
+
label: '查看快捷键'
|
|
31
|
+
}];
|
|
32
|
+
var handleChange = function handleChange(e) {
|
|
33
|
+
var value = e.target.value;
|
|
34
|
+
if (value === 'notification') {
|
|
35
|
+
setShowDialog('notification');
|
|
36
|
+
} else {
|
|
37
|
+
var _more$find, _more$find$onClick;
|
|
38
|
+
(_more$find = more.find(function (it) {
|
|
39
|
+
return it.id === value;
|
|
40
|
+
})) === null || _more$find === void 0 || (_more$find$onClick = _more$find.onClick) === null || _more$find$onClick === void 0 || _more$find$onClick.call(_more$find);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Select, {
|
|
44
|
+
value: 'none',
|
|
45
|
+
onChange: handleChange,
|
|
46
|
+
renderValue: function renderValue() {
|
|
47
|
+
return /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
48
|
+
tip: '更多',
|
|
49
|
+
icon: /*#__PURE__*/React.createElement(Stack, {
|
|
50
|
+
direction: 'row',
|
|
51
|
+
alignItems: 'center',
|
|
52
|
+
justifyContent: "center",
|
|
53
|
+
sx: {
|
|
54
|
+
mr: 0.5
|
|
55
|
+
}
|
|
56
|
+
}, /*#__PURE__*/React.createElement(MoreLineIcon, {
|
|
57
|
+
sx: {
|
|
58
|
+
fontSize: '1rem'
|
|
59
|
+
}
|
|
60
|
+
}))
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
IconComponent: function IconComponent() {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
}, /*#__PURE__*/React.createElement(MenuItem, {
|
|
67
|
+
key: 'none',
|
|
68
|
+
value: 'none',
|
|
69
|
+
sx: {
|
|
70
|
+
display: 'none'
|
|
71
|
+
}
|
|
72
|
+
}, /*#__PURE__*/React.createElement(MoreLineIcon, {
|
|
73
|
+
sx: {
|
|
74
|
+
fontSize: '1rem'
|
|
75
|
+
}
|
|
76
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
77
|
+
sx: {
|
|
78
|
+
ml: 1
|
|
79
|
+
}
|
|
80
|
+
}, "\u65E0")), [].concat(_toConsumableArray(more), options).map(function (it) {
|
|
81
|
+
return /*#__PURE__*/React.createElement(MenuItem, {
|
|
82
|
+
key: it.id,
|
|
83
|
+
value: it.id
|
|
84
|
+
}, /*#__PURE__*/React.createElement(Stack, {
|
|
85
|
+
direction: 'row',
|
|
86
|
+
alignItems: 'center',
|
|
87
|
+
justifyContent: "center",
|
|
88
|
+
gap: 1
|
|
89
|
+
}, it.icon, /*#__PURE__*/React.createElement(Box, {
|
|
90
|
+
sx: {
|
|
91
|
+
fontSize: '0.875rem'
|
|
92
|
+
}
|
|
93
|
+
}, it.label)));
|
|
94
|
+
})), /*#__PURE__*/React.createElement(NotificationDialog, {
|
|
95
|
+
open: showDialog === 'notification',
|
|
96
|
+
onClose: function onClose() {
|
|
97
|
+
return setShowDialog('');
|
|
98
|
+
}
|
|
99
|
+
}));
|
|
100
|
+
};
|
|
101
|
+
export default EditorMore;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
var _excluded = ["className"];
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
+
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."); }
|
|
7
|
+
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); }
|
|
8
|
+
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; }
|
|
9
|
+
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; } }
|
|
10
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
import { Box, MenuItem, Select, Stack, Tooltip } from "@mui/material";
|
|
12
|
+
import { getShortcutKeyText } from "../../util";
|
|
13
|
+
import React, { useEffect, useState } from "react";
|
|
14
|
+
import { ArrowDownSLineIcon, SubscriptIcon, SuperscriptIcon } from "../Icons";
|
|
15
|
+
import ToolbarItem from "./Item";
|
|
16
|
+
var EditorScript = function EditorScript(_ref) {
|
|
17
|
+
var editor = _ref.editor;
|
|
18
|
+
var _useState = useState("none"),
|
|
19
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
20
|
+
selectedValue = _useState2[0],
|
|
21
|
+
setSelectedValue = _useState2[1];
|
|
22
|
+
var ScriptOptions = [{
|
|
23
|
+
id: 'superscript',
|
|
24
|
+
icon: /*#__PURE__*/React.createElement(SuperscriptIcon, {
|
|
25
|
+
sx: {
|
|
26
|
+
fontSize: '1rem'
|
|
27
|
+
}
|
|
28
|
+
}),
|
|
29
|
+
label: '上标',
|
|
30
|
+
shortcutKey: ['ctrl', '.']
|
|
31
|
+
}, {
|
|
32
|
+
id: 'subscript',
|
|
33
|
+
icon: /*#__PURE__*/React.createElement(SubscriptIcon, {
|
|
34
|
+
sx: {
|
|
35
|
+
fontSize: '1rem'
|
|
36
|
+
}
|
|
37
|
+
}),
|
|
38
|
+
label: '下标',
|
|
39
|
+
shortcutKey: ['ctrl', ',']
|
|
40
|
+
}];
|
|
41
|
+
var handleScriptAction = function handleScriptAction(scriptType) {
|
|
42
|
+
if (scriptType === 'superscript') {
|
|
43
|
+
editor.chain().focus().toggleSuperscript().run();
|
|
44
|
+
} else if (scriptType === 'subscript') {
|
|
45
|
+
editor.chain().focus().toggleSubscript().run();
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
var handleChange = function handleChange(e) {
|
|
49
|
+
var value = e.target.value;
|
|
50
|
+
setSelectedValue(value);
|
|
51
|
+
};
|
|
52
|
+
var updateSelection = function updateSelection() {
|
|
53
|
+
if (editor.isActive('superscript')) {
|
|
54
|
+
setSelectedValue('superscript');
|
|
55
|
+
} else if (editor.isActive('subscript')) {
|
|
56
|
+
setSelectedValue('subscript');
|
|
57
|
+
} else {
|
|
58
|
+
setSelectedValue('none');
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
useEffect(function () {
|
|
62
|
+
editor.on('selectionUpdate', updateSelection);
|
|
63
|
+
editor.on('transaction', updateSelection);
|
|
64
|
+
return function () {
|
|
65
|
+
editor.off('selectionUpdate', updateSelection);
|
|
66
|
+
editor.off('transaction', updateSelection);
|
|
67
|
+
};
|
|
68
|
+
}, [editor]);
|
|
69
|
+
return /*#__PURE__*/React.createElement(Select, {
|
|
70
|
+
value: selectedValue,
|
|
71
|
+
className: ['superscript', 'subscript'].includes(selectedValue) ? "tool-active" : "",
|
|
72
|
+
onChange: handleChange,
|
|
73
|
+
renderValue: function renderValue(value) {
|
|
74
|
+
var _ScriptOptions$find;
|
|
75
|
+
return /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
76
|
+
tip: '上标/下标',
|
|
77
|
+
icon: /*#__PURE__*/React.createElement(Stack, {
|
|
78
|
+
direction: 'row',
|
|
79
|
+
alignItems: 'center',
|
|
80
|
+
sx: {
|
|
81
|
+
mr: 0.5,
|
|
82
|
+
width: '1.5rem'
|
|
83
|
+
}
|
|
84
|
+
}, ((_ScriptOptions$find = ScriptOptions.find(function (it) {
|
|
85
|
+
return it.id === value;
|
|
86
|
+
})) === null || _ScriptOptions$find === void 0 ? void 0 : _ScriptOptions$find.icon) || /*#__PURE__*/React.createElement(SuperscriptIcon, {
|
|
87
|
+
sx: {
|
|
88
|
+
fontSize: '1rem'
|
|
89
|
+
}
|
|
90
|
+
}))
|
|
91
|
+
});
|
|
92
|
+
},
|
|
93
|
+
IconComponent: function IconComponent(_ref2) {
|
|
94
|
+
var className = _ref2.className,
|
|
95
|
+
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
96
|
+
return /*#__PURE__*/React.createElement(ArrowDownSLineIcon, _extends({
|
|
97
|
+
sx: {
|
|
98
|
+
position: 'absolute',
|
|
99
|
+
right: 2,
|
|
100
|
+
flexSelf: 'center',
|
|
101
|
+
fontSize: '1rem',
|
|
102
|
+
flexShrink: 0,
|
|
103
|
+
mr: 0,
|
|
104
|
+
color: 'text.disabled',
|
|
105
|
+
transform: className !== null && className !== void 0 && className.includes('MuiSelect-iconOpen') ? 'rotate(-180deg)' : 'none',
|
|
106
|
+
transition: 'transform 0.3s',
|
|
107
|
+
cursor: 'pointer',
|
|
108
|
+
pointerEvents: 'none'
|
|
109
|
+
}
|
|
110
|
+
}, rest));
|
|
111
|
+
}
|
|
112
|
+
}, /*#__PURE__*/React.createElement(MenuItem, {
|
|
113
|
+
key: 'none',
|
|
114
|
+
value: 'none',
|
|
115
|
+
sx: {
|
|
116
|
+
display: 'none'
|
|
117
|
+
}
|
|
118
|
+
}, /*#__PURE__*/React.createElement(SuperscriptIcon, {
|
|
119
|
+
sx: {
|
|
120
|
+
fontSize: '1rem'
|
|
121
|
+
}
|
|
122
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
123
|
+
sx: {
|
|
124
|
+
ml: 1
|
|
125
|
+
}
|
|
126
|
+
}, "\u65E0")), ScriptOptions.map(function (it) {
|
|
127
|
+
return /*#__PURE__*/React.createElement(MenuItem, {
|
|
128
|
+
key: it.id,
|
|
129
|
+
value: it.id,
|
|
130
|
+
onClick: function onClick(e) {
|
|
131
|
+
e.stopPropagation();
|
|
132
|
+
handleScriptAction(it.id);
|
|
133
|
+
}
|
|
134
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
135
|
+
arrow: true,
|
|
136
|
+
title: getShortcutKeyText(it.shortcutKey || []),
|
|
137
|
+
placement: "right"
|
|
138
|
+
}, /*#__PURE__*/React.createElement(Stack, {
|
|
139
|
+
direction: 'row',
|
|
140
|
+
alignItems: 'center',
|
|
141
|
+
justifyContent: "center",
|
|
142
|
+
gap: 1
|
|
143
|
+
}, it.icon, /*#__PURE__*/React.createElement(Box, {
|
|
144
|
+
sx: {
|
|
145
|
+
fontSize: '0.875rem'
|
|
146
|
+
}
|
|
147
|
+
}, it.label))));
|
|
148
|
+
}));
|
|
149
|
+
};
|
|
150
|
+
export default EditorScript;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Editor } from "@tiptap/react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
interface EditorVerticalAlignSelectProps {
|
|
4
|
+
editor: Editor;
|
|
5
|
+
}
|
|
6
|
+
declare const EditorVerticalAlignSelect: ({ editor }: EditorVerticalAlignSelectProps) => React.JSX.Element;
|
|
7
|
+
export default EditorVerticalAlignSelect;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
var _excluded = ["className"];
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
+
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."); }
|
|
7
|
+
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); }
|
|
8
|
+
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; }
|
|
9
|
+
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; } }
|
|
10
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
import { Box, MenuItem, Select, Stack, Tooltip } from "@mui/material";
|
|
12
|
+
import { getShortcutKeyText } from "../../util";
|
|
13
|
+
import React, { useEffect, useState } from "react";
|
|
14
|
+
import { AlignBottomIcon, AlignTopIcon, AlignVerticallyIcon, ArrowDownSLineIcon } from "../Icons";
|
|
15
|
+
import ToolbarItem from "./Item";
|
|
16
|
+
var EditorVerticalAlignSelect = function EditorVerticalAlignSelect(_ref) {
|
|
17
|
+
var editor = _ref.editor;
|
|
18
|
+
var _useState = useState("none"),
|
|
19
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
20
|
+
selectedValue = _useState2[0],
|
|
21
|
+
setSelectedValue = _useState2[1];
|
|
22
|
+
var VerticalAlignOptions = [{
|
|
23
|
+
id: 'top',
|
|
24
|
+
icon: /*#__PURE__*/React.createElement(AlignTopIcon, {
|
|
25
|
+
sx: {
|
|
26
|
+
fontSize: '1rem'
|
|
27
|
+
}
|
|
28
|
+
}),
|
|
29
|
+
label: '顶部对齐',
|
|
30
|
+
shortcutKey: ['ctrl', 'alt', 'T']
|
|
31
|
+
}, {
|
|
32
|
+
id: 'middle',
|
|
33
|
+
icon: /*#__PURE__*/React.createElement(AlignVerticallyIcon, {
|
|
34
|
+
sx: {
|
|
35
|
+
fontSize: '1rem'
|
|
36
|
+
}
|
|
37
|
+
}),
|
|
38
|
+
label: '中间对齐',
|
|
39
|
+
shortcutKey: ['ctrl', 'alt', 'M']
|
|
40
|
+
}, {
|
|
41
|
+
id: 'bottom',
|
|
42
|
+
icon: /*#__PURE__*/React.createElement(AlignBottomIcon, {
|
|
43
|
+
sx: {
|
|
44
|
+
fontSize: '1rem'
|
|
45
|
+
}
|
|
46
|
+
}),
|
|
47
|
+
label: '底部对齐',
|
|
48
|
+
shortcutKey: ['ctrl', 'alt', 'B']
|
|
49
|
+
}];
|
|
50
|
+
var updateSelection = function updateSelection() {
|
|
51
|
+
if (editor.isActive('textStyle', {
|
|
52
|
+
verticalAlign: 'top'
|
|
53
|
+
})) {
|
|
54
|
+
setSelectedValue('top');
|
|
55
|
+
} else if (editor.isActive('textStyle', {
|
|
56
|
+
verticalAlign: 'middle'
|
|
57
|
+
})) {
|
|
58
|
+
setSelectedValue('middle');
|
|
59
|
+
} else if (editor.isActive('textStyle', {
|
|
60
|
+
verticalAlign: 'bottom'
|
|
61
|
+
})) {
|
|
62
|
+
setSelectedValue('bottom');
|
|
63
|
+
} else {
|
|
64
|
+
setSelectedValue('none'); // 默认无垂直对齐
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
var handleVerticalAlignAction = function handleVerticalAlignAction(alignType) {
|
|
68
|
+
editor.chain().focus().toggleVerticalAlign(alignType).run();
|
|
69
|
+
};
|
|
70
|
+
var handleChange = function handleChange(e) {
|
|
71
|
+
var value = e.target.value;
|
|
72
|
+
setSelectedValue(value);
|
|
73
|
+
};
|
|
74
|
+
useEffect(function () {
|
|
75
|
+
editor.on('selectionUpdate', updateSelection);
|
|
76
|
+
editor.on('transaction', updateSelection);
|
|
77
|
+
return function () {
|
|
78
|
+
editor.off('selectionUpdate', updateSelection);
|
|
79
|
+
editor.off('transaction', updateSelection);
|
|
80
|
+
};
|
|
81
|
+
}, [editor]);
|
|
82
|
+
return /*#__PURE__*/React.createElement(Select, {
|
|
83
|
+
value: selectedValue,
|
|
84
|
+
className: ['top', 'middle', 'bottom'].includes(selectedValue) ? "tool-active" : "",
|
|
85
|
+
onChange: handleChange,
|
|
86
|
+
renderValue: function renderValue(value) {
|
|
87
|
+
var _VerticalAlignOptions;
|
|
88
|
+
return /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
89
|
+
tip: '垂直对齐方式',
|
|
90
|
+
icon: /*#__PURE__*/React.createElement(Stack, {
|
|
91
|
+
direction: 'row',
|
|
92
|
+
alignItems: 'center',
|
|
93
|
+
sx: {
|
|
94
|
+
mr: 0.5,
|
|
95
|
+
width: '1.5rem'
|
|
96
|
+
}
|
|
97
|
+
}, ((_VerticalAlignOptions = VerticalAlignOptions.find(function (it) {
|
|
98
|
+
return it.id === value;
|
|
99
|
+
})) === null || _VerticalAlignOptions === void 0 ? void 0 : _VerticalAlignOptions.icon) || /*#__PURE__*/React.createElement(AlignVerticallyIcon, {
|
|
100
|
+
sx: {
|
|
101
|
+
fontSize: '1rem'
|
|
102
|
+
}
|
|
103
|
+
}))
|
|
104
|
+
});
|
|
105
|
+
},
|
|
106
|
+
IconComponent: function IconComponent(_ref2) {
|
|
107
|
+
var className = _ref2.className,
|
|
108
|
+
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
109
|
+
return /*#__PURE__*/React.createElement(ArrowDownSLineIcon, _extends({
|
|
110
|
+
sx: {
|
|
111
|
+
position: 'absolute',
|
|
112
|
+
right: 2,
|
|
113
|
+
flexSelf: 'center',
|
|
114
|
+
fontSize: '1rem',
|
|
115
|
+
flexShrink: 0,
|
|
116
|
+
mr: 0,
|
|
117
|
+
color: 'text.disabled',
|
|
118
|
+
transform: className !== null && className !== void 0 && className.includes('MuiSelect-iconOpen') ? 'rotate(-180deg)' : 'none',
|
|
119
|
+
transition: 'transform 0.3s',
|
|
120
|
+
cursor: 'pointer',
|
|
121
|
+
pointerEvents: 'none'
|
|
122
|
+
}
|
|
123
|
+
}, rest));
|
|
124
|
+
}
|
|
125
|
+
}, /*#__PURE__*/React.createElement(MenuItem, {
|
|
126
|
+
key: 'none',
|
|
127
|
+
value: 'none',
|
|
128
|
+
sx: {
|
|
129
|
+
display: 'none'
|
|
130
|
+
}
|
|
131
|
+
}, /*#__PURE__*/React.createElement(AlignVerticallyIcon, {
|
|
132
|
+
sx: {
|
|
133
|
+
fontSize: '1rem'
|
|
134
|
+
}
|
|
135
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
136
|
+
sx: {
|
|
137
|
+
ml: 1
|
|
138
|
+
}
|
|
139
|
+
}, "\u65E0")), VerticalAlignOptions.map(function (it) {
|
|
140
|
+
return /*#__PURE__*/React.createElement(MenuItem, {
|
|
141
|
+
key: it.id,
|
|
142
|
+
value: it.id,
|
|
143
|
+
onClick: function onClick(e) {
|
|
144
|
+
e.stopPropagation();
|
|
145
|
+
handleVerticalAlignAction(it.id);
|
|
146
|
+
}
|
|
147
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
148
|
+
arrow: true,
|
|
149
|
+
title: getShortcutKeyText(it.shortcutKey || []),
|
|
150
|
+
placement: "right"
|
|
151
|
+
}, /*#__PURE__*/React.createElement(Stack, {
|
|
152
|
+
direction: 'row',
|
|
153
|
+
alignItems: 'center',
|
|
154
|
+
justifyContent: "center",
|
|
155
|
+
gap: 1
|
|
156
|
+
}, it.icon, /*#__PURE__*/React.createElement(Box, {
|
|
157
|
+
sx: {
|
|
158
|
+
fontSize: '0.875rem'
|
|
159
|
+
}
|
|
160
|
+
}, it.label))));
|
|
161
|
+
}));
|
|
162
|
+
};
|
|
163
|
+
export default EditorVerticalAlignSelect;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Theme } from '@emotion/react';
|
|
2
|
+
import { SxProps } from '@mui/material';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
interface ToolbarItemProps {
|
|
5
|
+
tip?: string;
|
|
6
|
+
text?: string;
|
|
7
|
+
shortcutKey?: string[];
|
|
8
|
+
sx?: SxProps<Theme>;
|
|
9
|
+
icon?: React.ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
13
|
+
}
|
|
14
|
+
declare const ToolbarItem: React.ForwardRefExoticComponent<ToolbarItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
15
|
+
export default ToolbarItem;
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
var _excluded = ["tip", "shortcutKey", "icon", "sx", "text", "onClick", "className", "disabled"];
|
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
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; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
8
|
+
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); }
|
|
9
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
11
|
+
import { Box, Button, Stack, Tooltip } from '@mui/material';
|
|
12
|
+
import { getShortcutKeyText } from "../../util";
|
|
13
|
+
import React from 'react';
|
|
14
|
+
var ToolbarItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
15
|
+
var tip = _ref.tip,
|
|
16
|
+
shortcutKey = _ref.shortcutKey,
|
|
17
|
+
icon = _ref.icon,
|
|
18
|
+
sx = _ref.sx,
|
|
19
|
+
text = _ref.text,
|
|
20
|
+
onClick = _ref.onClick,
|
|
21
|
+
className = _ref.className,
|
|
22
|
+
disabled = _ref.disabled,
|
|
23
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
24
|
+
var shortcutKeyText = getShortcutKeyText(shortcutKey || []);
|
|
25
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
26
|
+
title: tip ? /*#__PURE__*/React.createElement(Stack, {
|
|
27
|
+
alignItems: "center"
|
|
28
|
+
}, /*#__PURE__*/React.createElement(Box, null, tip), shortcutKeyText && /*#__PURE__*/React.createElement(Box, {
|
|
29
|
+
sx: {
|
|
30
|
+
fontSize: 12
|
|
31
|
+
}
|
|
32
|
+
}, shortcutKeyText)) : null,
|
|
33
|
+
arrow: true
|
|
34
|
+
}, /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Button, _extends({
|
|
35
|
+
ref: ref,
|
|
36
|
+
onClick: onClick,
|
|
37
|
+
className: className,
|
|
38
|
+
disabled: disabled,
|
|
39
|
+
sx: _objectSpread({
|
|
40
|
+
minWidth: '36px',
|
|
41
|
+
p: 1,
|
|
42
|
+
color: 'text.primary',
|
|
43
|
+
borderRadius: 'var(--mui-shape-borderRadius)',
|
|
44
|
+
'&.tool-active': {
|
|
45
|
+
bgcolor: 'background.paper2',
|
|
46
|
+
color: 'primary.main'
|
|
47
|
+
},
|
|
48
|
+
'&[disabled]': {
|
|
49
|
+
color: 'text.disabled'
|
|
50
|
+
},
|
|
51
|
+
'&:hover': {
|
|
52
|
+
bgcolor: 'background.paper2'
|
|
53
|
+
},
|
|
54
|
+
textTransform: 'none'
|
|
55
|
+
}, sx)
|
|
56
|
+
}, rest), /*#__PURE__*/React.createElement(Stack, {
|
|
57
|
+
direction: 'row',
|
|
58
|
+
alignItems: 'center',
|
|
59
|
+
gap: 1,
|
|
60
|
+
sx: {
|
|
61
|
+
lineHeight: 1,
|
|
62
|
+
flexShrink: 0
|
|
63
|
+
}
|
|
64
|
+
}, icon, text && /*#__PURE__*/React.createElement(Box, {
|
|
65
|
+
component: "span"
|
|
66
|
+
}, text)))));
|
|
67
|
+
});
|
|
68
|
+
ToolbarItem.displayName = 'toolbar-item';
|
|
69
|
+
export default ToolbarItem;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { default as EditorAlignSelect } from './EditorAlignSelect';
|
|
2
|
+
export { default as EditorCode } from './EditorCode';
|
|
3
|
+
export { default as EditorFontBgColor } from './EditorFontBgColor';
|
|
4
|
+
export { default as EditorFontColor } from './EditorFontColor';
|
|
5
|
+
export { default as EditorFontSize } from './EditorFontSize';
|
|
6
|
+
export { default as EditorHeading } from './EditorHeading';
|
|
7
|
+
export { default as EditorInsert } from './EditorInsert';
|
|
8
|
+
export { default as EditorListSelect } from './EditorListSelect';
|
|
9
|
+
export { default as EditorMath } from './EditorMath';
|
|
10
|
+
export { default as EditorMore } from './EditorMore';
|
|
11
|
+
export { default as EditorScript } from './EditorScript';
|
|
12
|
+
export { default as EditorVerticalAlignSelect } from './EditorVerticalAlignSelect';
|
|
13
|
+
export { default as ToolbarItem } from './Item';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { default as EditorAlignSelect } from "./EditorAlignSelect";
|
|
2
|
+
export { default as EditorCode } from "./EditorCode";
|
|
3
|
+
export { default as EditorFontBgColor } from "./EditorFontBgColor";
|
|
4
|
+
export { default as EditorFontColor } from "./EditorFontColor";
|
|
5
|
+
export { default as EditorFontSize } from "./EditorFontSize";
|
|
6
|
+
export { default as EditorHeading } from "./EditorHeading";
|
|
7
|
+
export { default as EditorInsert } from "./EditorInsert";
|
|
8
|
+
export { default as EditorListSelect } from "./EditorListSelect";
|
|
9
|
+
export { default as EditorMath } from "./EditorMath";
|
|
10
|
+
export { default as EditorMore } from "./EditorMore";
|
|
11
|
+
export { default as EditorScript } from "./EditorScript";
|
|
12
|
+
export { default as EditorVerticalAlignSelect } from "./EditorVerticalAlignSelect";
|
|
13
|
+
export { default as ToolbarItem } from "./Item";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as FloatingPopover } from './FloatingPopover';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as FloatingPopover } from "./FloatingPopover";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare enum NodeTypeEnum {
|
|
2
|
+
BlockAttachment = "blockAttachment",
|
|
3
|
+
InlineAttachment = "inlineAttachment",
|
|
4
|
+
Paragraph = "paragraph",
|
|
5
|
+
Heading = "heading",
|
|
6
|
+
BulletList = "bulletList",
|
|
7
|
+
OrderedList = "orderedList",
|
|
8
|
+
TaskList = "taskList",
|
|
9
|
+
Blockquote = "blockquote",
|
|
10
|
+
CodeBlock = "codeBlock",
|
|
11
|
+
HorizontalRule = "horizontalRule",
|
|
12
|
+
Details = "details",
|
|
13
|
+
Table = "table",
|
|
14
|
+
Image = "image",
|
|
15
|
+
Video = "video",
|
|
16
|
+
Audio = "audio",
|
|
17
|
+
Link = "link",
|
|
18
|
+
Code = "code",
|
|
19
|
+
InlineMath = "inlineMath",
|
|
20
|
+
BlockMath = "blockMath"
|
|
21
|
+
}
|
|
22
|
+
export declare const NODE_TYPE_LABEL: Record<NodeTypeEnum, {
|
|
23
|
+
label: string;
|
|
24
|
+
color?: boolean;
|
|
25
|
+
fontSize?: boolean;
|
|
26
|
+
align?: boolean;
|
|
27
|
+
convert?: boolean;
|
|
28
|
+
download?: boolean;
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}>;
|