@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,740 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
8
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
9
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
10
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
11
|
+
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."); }
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
14
|
+
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; } }
|
|
15
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
+
import { Box, Button, CircularProgress, IconButton, MenuItem, MenuList, Paper, Slider, Stack, TextField, Tooltip, Typography } from "@mui/material";
|
|
17
|
+
import { NodeViewWrapper } from '@tiptap/react';
|
|
18
|
+
import { FloatingPopover } from "../../../component";
|
|
19
|
+
import { DeleteLineIcon, DownloadLineIcon, EditBoxLineIcon, PauseLineIcon, PlayLineIcon, SpeedLineIcon, UploadCloud2LineIcon, VolumeMuteLineIcon, VolumeUpLineIcon } from "../../../component/Icons";
|
|
20
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
21
|
+
import Disk from "../../../asset/images/disk.png";
|
|
22
|
+
import InsertAudio from "./Insert";
|
|
23
|
+
import ReadonlyAudio from "./Readonly";
|
|
24
|
+
var EditAudioDialog = function EditAudioDialog(_ref) {
|
|
25
|
+
var attrs = _ref.attrs,
|
|
26
|
+
onSave = _ref.onSave,
|
|
27
|
+
onUpload = _ref.onUpload,
|
|
28
|
+
onError = _ref.onError;
|
|
29
|
+
var _useState = useState(attrs.src),
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
+
src = _useState2[0],
|
|
32
|
+
setSrc = _useState2[1];
|
|
33
|
+
var _useState3 = useState(attrs.title || ''),
|
|
34
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
35
|
+
title = _useState4[0],
|
|
36
|
+
setTitle = _useState4[1];
|
|
37
|
+
var _useState5 = useState(attrs.poster || ''),
|
|
38
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
39
|
+
poster = _useState6[0],
|
|
40
|
+
setPoster = _useState6[1];
|
|
41
|
+
var _useState7 = useState(false),
|
|
42
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
43
|
+
uploadingPoster = _useState8[0],
|
|
44
|
+
setUploadingPoster = _useState8[1];
|
|
45
|
+
var _useState9 = useState(false),
|
|
46
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
47
|
+
uploading = _useState10[0],
|
|
48
|
+
setUploading = _useState10[1];
|
|
49
|
+
var handleSave = function handleSave() {
|
|
50
|
+
onSave({
|
|
51
|
+
src: src,
|
|
52
|
+
title: title,
|
|
53
|
+
poster: poster
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
var handleSelectAudio = function handleSelectAudio() {
|
|
57
|
+
var uploadId = document.getElementById('audioUploadInput');
|
|
58
|
+
if (uploadId) {
|
|
59
|
+
uploadId.click();
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
var handleSelectPosterImage = function handleSelectPosterImage() {
|
|
63
|
+
var uploadId = document.getElementById('posterUploadInput');
|
|
64
|
+
if (uploadId) {
|
|
65
|
+
uploadId.click();
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
var handleUploadPoster = /*#__PURE__*/function () {
|
|
69
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) {
|
|
70
|
+
var _event$target$files;
|
|
71
|
+
var file, url;
|
|
72
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
73
|
+
while (1) switch (_context.prev = _context.next) {
|
|
74
|
+
case 0:
|
|
75
|
+
file = (_event$target$files = event.target.files) === null || _event$target$files === void 0 ? void 0 : _event$target$files[0];
|
|
76
|
+
if (!file) {
|
|
77
|
+
_context.next = 16;
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
setUploadingPoster(true);
|
|
81
|
+
_context.prev = 3;
|
|
82
|
+
_context.next = 6;
|
|
83
|
+
return onUpload === null || onUpload === void 0 ? void 0 : onUpload(file);
|
|
84
|
+
case 6:
|
|
85
|
+
url = _context.sent;
|
|
86
|
+
if (url) {
|
|
87
|
+
setPoster(url);
|
|
88
|
+
}
|
|
89
|
+
_context.next = 13;
|
|
90
|
+
break;
|
|
91
|
+
case 10:
|
|
92
|
+
_context.prev = 10;
|
|
93
|
+
_context.t0 = _context["catch"](3);
|
|
94
|
+
onError === null || onError === void 0 || onError(_context.t0);
|
|
95
|
+
case 13:
|
|
96
|
+
_context.prev = 13;
|
|
97
|
+
setUploadingPoster(false);
|
|
98
|
+
return _context.finish(13);
|
|
99
|
+
case 16:
|
|
100
|
+
case "end":
|
|
101
|
+
return _context.stop();
|
|
102
|
+
}
|
|
103
|
+
}, _callee, null, [[3, 10, 13, 16]]);
|
|
104
|
+
}));
|
|
105
|
+
return function handleUploadPoster(_x) {
|
|
106
|
+
return _ref2.apply(this, arguments);
|
|
107
|
+
};
|
|
108
|
+
}();
|
|
109
|
+
var handleAudioUpload = /*#__PURE__*/function () {
|
|
110
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(event) {
|
|
111
|
+
var _event$target$files2;
|
|
112
|
+
var file, url;
|
|
113
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
114
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
115
|
+
case 0:
|
|
116
|
+
file = (_event$target$files2 = event.target.files) === null || _event$target$files2 === void 0 ? void 0 : _event$target$files2[0];
|
|
117
|
+
if (!file) {
|
|
118
|
+
_context2.next = 16;
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
setUploading(true);
|
|
122
|
+
_context2.prev = 3;
|
|
123
|
+
_context2.next = 6;
|
|
124
|
+
return onUpload === null || onUpload === void 0 ? void 0 : onUpload(file);
|
|
125
|
+
case 6:
|
|
126
|
+
url = _context2.sent;
|
|
127
|
+
if (url) {
|
|
128
|
+
setTitle(file.name);
|
|
129
|
+
setSrc(url);
|
|
130
|
+
}
|
|
131
|
+
_context2.next = 13;
|
|
132
|
+
break;
|
|
133
|
+
case 10:
|
|
134
|
+
_context2.prev = 10;
|
|
135
|
+
_context2.t0 = _context2["catch"](3);
|
|
136
|
+
onError === null || onError === void 0 || onError(_context2.t0);
|
|
137
|
+
case 13:
|
|
138
|
+
_context2.prev = 13;
|
|
139
|
+
setUploading(false);
|
|
140
|
+
return _context2.finish(13);
|
|
141
|
+
case 16:
|
|
142
|
+
case "end":
|
|
143
|
+
return _context2.stop();
|
|
144
|
+
}
|
|
145
|
+
}, _callee2, null, [[3, 10, 13, 16]]);
|
|
146
|
+
}));
|
|
147
|
+
return function handleAudioUpload(_x2) {
|
|
148
|
+
return _ref3.apply(this, arguments);
|
|
149
|
+
};
|
|
150
|
+
}();
|
|
151
|
+
return /*#__PURE__*/React.createElement(Stack, {
|
|
152
|
+
gap: 2,
|
|
153
|
+
sx: {
|
|
154
|
+
width: 350,
|
|
155
|
+
bgcolor: 'background.paper',
|
|
156
|
+
borderRadius: 'var(--mui-shape-borderRadius)',
|
|
157
|
+
px: 2,
|
|
158
|
+
py: 1.5
|
|
159
|
+
},
|
|
160
|
+
onClick: function onClick(e) {
|
|
161
|
+
return e.stopPropagation();
|
|
162
|
+
}
|
|
163
|
+
}, /*#__PURE__*/React.createElement(Stack, {
|
|
164
|
+
direction: 'row',
|
|
165
|
+
gap: 2
|
|
166
|
+
}, /*#__PURE__*/React.createElement(TextField, {
|
|
167
|
+
fullWidth: true,
|
|
168
|
+
size: "small",
|
|
169
|
+
value: src,
|
|
170
|
+
onChange: function onChange(e) {
|
|
171
|
+
return setSrc(e.target.value);
|
|
172
|
+
},
|
|
173
|
+
placeholder: "\u8F93\u5165\u97F3\u9891\u6587\u4EF6\u7684 URL"
|
|
174
|
+
}), /*#__PURE__*/React.createElement(IconButton, {
|
|
175
|
+
onClick: handleSelectAudio
|
|
176
|
+
}, uploading ? /*#__PURE__*/React.createElement(CircularProgress, {
|
|
177
|
+
size: 20
|
|
178
|
+
}) : /*#__PURE__*/React.createElement(UploadCloud2LineIcon, {
|
|
179
|
+
sx: {
|
|
180
|
+
fontSize: 18
|
|
181
|
+
}
|
|
182
|
+
}))), /*#__PURE__*/React.createElement(TextField, {
|
|
183
|
+
fullWidth: true,
|
|
184
|
+
size: "small",
|
|
185
|
+
value: title,
|
|
186
|
+
onChange: function onChange(e) {
|
|
187
|
+
return setTitle(e.target.value);
|
|
188
|
+
},
|
|
189
|
+
placeholder: "\u8F93\u5165\u97F3\u9891\u540D\u79F0\uFF08\u53EF\u9009\uFF09"
|
|
190
|
+
}), /*#__PURE__*/React.createElement(Stack, {
|
|
191
|
+
direction: 'row',
|
|
192
|
+
gap: 2
|
|
193
|
+
}, /*#__PURE__*/React.createElement(TextField, {
|
|
194
|
+
fullWidth: true,
|
|
195
|
+
size: "small",
|
|
196
|
+
value: poster,
|
|
197
|
+
onChange: function onChange(e) {
|
|
198
|
+
return setPoster(e.target.value);
|
|
199
|
+
},
|
|
200
|
+
placeholder: "\u8F93\u5165\u6D77\u62A5\u56FE\u7247\u7684 URL\uFF08\u53EF\u9009\uFF09"
|
|
201
|
+
}), /*#__PURE__*/React.createElement(IconButton, {
|
|
202
|
+
onClick: handleSelectPosterImage
|
|
203
|
+
}, uploadingPoster ? /*#__PURE__*/React.createElement(CircularProgress, {
|
|
204
|
+
size: 20
|
|
205
|
+
}) : /*#__PURE__*/React.createElement(UploadCloud2LineIcon, {
|
|
206
|
+
sx: {
|
|
207
|
+
fontSize: 18
|
|
208
|
+
}
|
|
209
|
+
}))), /*#__PURE__*/React.createElement("input", {
|
|
210
|
+
id: "audioUploadInput",
|
|
211
|
+
type: "file",
|
|
212
|
+
hidden: true,
|
|
213
|
+
multiple: false,
|
|
214
|
+
accept: "audio/*",
|
|
215
|
+
onChange: handleAudioUpload
|
|
216
|
+
}), /*#__PURE__*/React.createElement("input", {
|
|
217
|
+
id: "posterUploadInput",
|
|
218
|
+
type: "file",
|
|
219
|
+
hidden: true,
|
|
220
|
+
multiple: false,
|
|
221
|
+
accept: "image/*",
|
|
222
|
+
onChange: handleUploadPoster
|
|
223
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
224
|
+
variant: "contained",
|
|
225
|
+
disabled: uploadingPoster,
|
|
226
|
+
fullWidth: true,
|
|
227
|
+
onClick: handleSave
|
|
228
|
+
}, "\u5D4C\u5165\u97F3\u9891"));
|
|
229
|
+
};
|
|
230
|
+
var AudioViewWrapper = function AudioViewWrapper(_ref4) {
|
|
231
|
+
var editor = _ref4.editor,
|
|
232
|
+
node = _ref4.node,
|
|
233
|
+
updateAttributes = _ref4.updateAttributes,
|
|
234
|
+
deleteNode = _ref4.deleteNode,
|
|
235
|
+
selected = _ref4.selected,
|
|
236
|
+
onUpload = _ref4.onUpload,
|
|
237
|
+
_onError = _ref4.onError;
|
|
238
|
+
var attrs = node.attrs;
|
|
239
|
+
var audioRef = useRef(null);
|
|
240
|
+
var _useState11 = useState(false),
|
|
241
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
242
|
+
isHovering = _useState12[0],
|
|
243
|
+
setIsHovering = _useState12[1];
|
|
244
|
+
var _useState13 = useState(false),
|
|
245
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
246
|
+
isPlaying = _useState14[0],
|
|
247
|
+
setIsPlaying = _useState14[1];
|
|
248
|
+
var _useState15 = useState(false),
|
|
249
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
250
|
+
isMuted = _useState16[0],
|
|
251
|
+
setIsMuted = _useState16[1];
|
|
252
|
+
var _useState17 = useState(0),
|
|
253
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
254
|
+
currentTime = _useState18[0],
|
|
255
|
+
setCurrentTime = _useState18[1];
|
|
256
|
+
var _useState19 = useState(0),
|
|
257
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
258
|
+
duration = _useState20[0],
|
|
259
|
+
setDuration = _useState20[1];
|
|
260
|
+
var _useState21 = useState(0.5),
|
|
261
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
262
|
+
volume = _useState22[0],
|
|
263
|
+
setVolume = _useState22[1];
|
|
264
|
+
var _useState23 = useState(1),
|
|
265
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
266
|
+
playbackRate = _useState24[0],
|
|
267
|
+
setPlaybackRate = _useState24[1];
|
|
268
|
+
var _useState25 = useState(null),
|
|
269
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
|
270
|
+
anchorElEdit = _useState26[0],
|
|
271
|
+
setAnchorElEdit = _useState26[1];
|
|
272
|
+
var handleCloseEditPopover = function handleCloseEditPopover() {
|
|
273
|
+
return setAnchorElEdit(null);
|
|
274
|
+
};
|
|
275
|
+
var handleShowEditPopover = function handleShowEditPopover(event) {
|
|
276
|
+
if (anchorElEdit) {
|
|
277
|
+
handleCloseEditPopover();
|
|
278
|
+
} else {
|
|
279
|
+
setAnchorElEdit(event.currentTarget);
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
var _useState27 = useState(null),
|
|
283
|
+
_useState28 = _slicedToArray(_useState27, 2),
|
|
284
|
+
anchorElSpeed = _useState28[0],
|
|
285
|
+
setAnchorElSpeed = _useState28[1];
|
|
286
|
+
var handleCloseSpeedPopover = function handleCloseSpeedPopover() {
|
|
287
|
+
return setAnchorElSpeed(null);
|
|
288
|
+
};
|
|
289
|
+
var handleShowSpeedPopover = function handleShowSpeedPopover(event) {
|
|
290
|
+
if (anchorElSpeed) {
|
|
291
|
+
handleCloseSpeedPopover();
|
|
292
|
+
} else {
|
|
293
|
+
setAnchorElSpeed(event.currentTarget);
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
// 格式化时间
|
|
298
|
+
var formatTime = function formatTime(time) {
|
|
299
|
+
var minutes = Math.floor(time / 60);
|
|
300
|
+
var seconds = Math.floor(time % 60);
|
|
301
|
+
return "".concat(minutes, ":").concat(seconds < 10 ? '0' : '').concat(seconds);
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
// 处理声音
|
|
305
|
+
var toogleMute = function toogleMute() {
|
|
306
|
+
if (audioRef.current) {
|
|
307
|
+
if (isMuted) {
|
|
308
|
+
audioRef.current.muted = false;
|
|
309
|
+
} else {
|
|
310
|
+
audioRef.current.muted = true;
|
|
311
|
+
}
|
|
312
|
+
setIsMuted(!isMuted);
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
// 处理播放/暂停
|
|
317
|
+
var togglePlay = function togglePlay() {
|
|
318
|
+
if (audioRef.current) {
|
|
319
|
+
if (isPlaying) {
|
|
320
|
+
audioRef.current.pause();
|
|
321
|
+
} else {
|
|
322
|
+
audioRef.current.play();
|
|
323
|
+
}
|
|
324
|
+
setIsPlaying(!isPlaying);
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
// 处理进度条变化
|
|
329
|
+
var handleProgressChange = function handleProgressChange(event, newValue) {
|
|
330
|
+
var newTime = newValue;
|
|
331
|
+
if (audioRef.current) {
|
|
332
|
+
audioRef.current.currentTime = newTime;
|
|
333
|
+
setCurrentTime(newTime);
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
// 处理音量变化
|
|
338
|
+
var handleVolumeChange = function handleVolumeChange(event, newValue) {
|
|
339
|
+
var newVolume = newValue;
|
|
340
|
+
setVolume(newVolume);
|
|
341
|
+
if (audioRef.current) {
|
|
342
|
+
audioRef.current.volume = newVolume;
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
// 处理播放速度变化
|
|
347
|
+
var handlePlaybackRateChange = function handlePlaybackRateChange(rate) {
|
|
348
|
+
setPlaybackRate(rate);
|
|
349
|
+
if (audioRef.current) {
|
|
350
|
+
audioRef.current.playbackRate = rate;
|
|
351
|
+
}
|
|
352
|
+
handleCloseSpeedPopover();
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
// 处理下载
|
|
356
|
+
var handleDownload = function handleDownload() {
|
|
357
|
+
if (attrs.src) {
|
|
358
|
+
var link = document.createElement('a');
|
|
359
|
+
link.href = attrs.src;
|
|
360
|
+
link.download = attrs.src.split('/').pop() || 'audio.mp3';
|
|
361
|
+
document.body.appendChild(link);
|
|
362
|
+
link.click();
|
|
363
|
+
document.body.removeChild(link);
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
// 更新音频源和海报
|
|
368
|
+
var updateAudioSource = function updateAudioSource(value) {
|
|
369
|
+
updateAttributes({
|
|
370
|
+
src: value.src,
|
|
371
|
+
title: value.title || null,
|
|
372
|
+
poster: value.poster || null,
|
|
373
|
+
controls: attrs.controls,
|
|
374
|
+
autoplay: attrs.autoplay,
|
|
375
|
+
loop: attrs.loop,
|
|
376
|
+
muted: attrs.muted
|
|
377
|
+
});
|
|
378
|
+
handleCloseEditPopover();
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
// 音频事件处理
|
|
382
|
+
useEffect(function () {
|
|
383
|
+
var audio = audioRef.current;
|
|
384
|
+
if (!audio) return;
|
|
385
|
+
var handleLoadedMetadata = function handleLoadedMetadata() {
|
|
386
|
+
setDuration(audio.duration);
|
|
387
|
+
};
|
|
388
|
+
var handleTimeUpdate = function handleTimeUpdate() {
|
|
389
|
+
setCurrentTime(audio.currentTime);
|
|
390
|
+
};
|
|
391
|
+
var handlePlay = function handlePlay() {
|
|
392
|
+
setIsPlaying(true);
|
|
393
|
+
};
|
|
394
|
+
var handlePause = function handlePause() {
|
|
395
|
+
setIsPlaying(false);
|
|
396
|
+
};
|
|
397
|
+
var handleError = function handleError(e) {
|
|
398
|
+
_onError === null || _onError === void 0 || _onError(e.error);
|
|
399
|
+
};
|
|
400
|
+
audio.addEventListener('loadedmetadata', handleLoadedMetadata);
|
|
401
|
+
audio.addEventListener('timeupdate', handleTimeUpdate);
|
|
402
|
+
audio.addEventListener('play', handlePlay);
|
|
403
|
+
audio.addEventListener('pause', handlePause);
|
|
404
|
+
audio.addEventListener('error', handleError);
|
|
405
|
+
return function () {
|
|
406
|
+
audio.removeEventListener('loadedmetadata', handleLoadedMetadata);
|
|
407
|
+
audio.removeEventListener('timeupdate', handleTimeUpdate);
|
|
408
|
+
audio.removeEventListener('play', handlePlay);
|
|
409
|
+
audio.removeEventListener('pause', handlePause);
|
|
410
|
+
audio.removeEventListener('error', handleError);
|
|
411
|
+
};
|
|
412
|
+
}, [attrs.src, _onError]);
|
|
413
|
+
if (!attrs.src && !editor.isEditable) {
|
|
414
|
+
return null;
|
|
415
|
+
}
|
|
416
|
+
if (!editor.isEditable) {
|
|
417
|
+
return /*#__PURE__*/React.createElement(ReadonlyAudio, {
|
|
418
|
+
attrs: attrs,
|
|
419
|
+
onError: _onError
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
if (!attrs.src) {
|
|
423
|
+
return /*#__PURE__*/React.createElement(InsertAudio, {
|
|
424
|
+
selected: selected,
|
|
425
|
+
attrs: attrs,
|
|
426
|
+
updateAttributes: updateAttributes,
|
|
427
|
+
onUpload: onUpload,
|
|
428
|
+
onError: _onError
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
return /*#__PURE__*/React.createElement(NodeViewWrapper, {
|
|
432
|
+
className: "audio-wrapper ".concat(selected ? 'ProseMirror-selectednode' : ''),
|
|
433
|
+
"data-drag-handle": true
|
|
434
|
+
}, /*#__PURE__*/React.createElement(Stack, {
|
|
435
|
+
direction: 'row',
|
|
436
|
+
alignItems: 'center',
|
|
437
|
+
sx: {
|
|
438
|
+
position: 'relative',
|
|
439
|
+
border: '1px solid',
|
|
440
|
+
borderColor: 'divider',
|
|
441
|
+
borderRadius: 'var(--mui-shape-borderRadius)',
|
|
442
|
+
p: '0.25rem',
|
|
443
|
+
bgcolor: 'background.paper',
|
|
444
|
+
'&:hover': {
|
|
445
|
+
'.audio-controls': {
|
|
446
|
+
opacity: 1
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
},
|
|
450
|
+
onMouseEnter: function onMouseEnter() {
|
|
451
|
+
return setIsHovering(true);
|
|
452
|
+
},
|
|
453
|
+
onMouseLeave: function onMouseLeave() {
|
|
454
|
+
return setIsHovering(false);
|
|
455
|
+
}
|
|
456
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
457
|
+
sx: {
|
|
458
|
+
height: 100,
|
|
459
|
+
minWidth: 100,
|
|
460
|
+
cursor: 'pointer',
|
|
461
|
+
position: 'relative',
|
|
462
|
+
flexShrink: 0,
|
|
463
|
+
display: 'flex',
|
|
464
|
+
alignItems: 'center',
|
|
465
|
+
justifyContent: 'center',
|
|
466
|
+
borderRadius: 'var(--mui-shape-borderRadius) 0 0 var(--mui-shape-borderRadius)',
|
|
467
|
+
backgroundSize: 'cover',
|
|
468
|
+
backgroundImage: "url(".concat(Disk, ")")
|
|
469
|
+
},
|
|
470
|
+
onClick: togglePlay
|
|
471
|
+
}, attrs.poster && /*#__PURE__*/React.createElement("img", {
|
|
472
|
+
src: attrs.poster,
|
|
473
|
+
alt: "\u97F3\u9891\u6D77\u62A5",
|
|
474
|
+
style: _objectSpread({
|
|
475
|
+
width: 48,
|
|
476
|
+
height: 48,
|
|
477
|
+
objectFit: 'cover',
|
|
478
|
+
borderRadius: '50%'
|
|
479
|
+
}, isPlaying && {
|
|
480
|
+
animation: 'rotate-icon infinite 20s linear'
|
|
481
|
+
})
|
|
482
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
483
|
+
sx: {
|
|
484
|
+
position: 'absolute',
|
|
485
|
+
top: 0,
|
|
486
|
+
left: 0,
|
|
487
|
+
width: '100%',
|
|
488
|
+
height: '100%',
|
|
489
|
+
display: 'flex',
|
|
490
|
+
alignItems: 'center',
|
|
491
|
+
justifyContent: 'center',
|
|
492
|
+
opacity: isHovering ? 1 : 0,
|
|
493
|
+
transition: 'opacity 0.2s',
|
|
494
|
+
borderRadius: '50%'
|
|
495
|
+
}
|
|
496
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
497
|
+
sx: {
|
|
498
|
+
width: 32,
|
|
499
|
+
height: 32,
|
|
500
|
+
borderRadius: '50%',
|
|
501
|
+
display: 'flex',
|
|
502
|
+
alignItems: 'center',
|
|
503
|
+
justifyContent: 'center'
|
|
504
|
+
}
|
|
505
|
+
}, /*#__PURE__*/React.createElement(IconButton, null, isPlaying ? /*#__PURE__*/React.createElement(PauseLineIcon, {
|
|
506
|
+
sx: {
|
|
507
|
+
fontSize: '1.5rem',
|
|
508
|
+
color: 'text.primary'
|
|
509
|
+
}
|
|
510
|
+
}) : /*#__PURE__*/React.createElement(PlayLineIcon, {
|
|
511
|
+
sx: {
|
|
512
|
+
fontSize: '1.5rem',
|
|
513
|
+
color: 'text.primary'
|
|
514
|
+
}
|
|
515
|
+
}))))), /*#__PURE__*/React.createElement(Box, {
|
|
516
|
+
sx: {
|
|
517
|
+
flex: 1,
|
|
518
|
+
pr: 2,
|
|
519
|
+
pl: 4,
|
|
520
|
+
position: 'relative'
|
|
521
|
+
}
|
|
522
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
523
|
+
variant: "subtitle1",
|
|
524
|
+
sx: {
|
|
525
|
+
fontWeight: 500,
|
|
526
|
+
mb: 1
|
|
527
|
+
}
|
|
528
|
+
}, attrs.title || '音频'), /*#__PURE__*/React.createElement(Stack, {
|
|
529
|
+
direction: "row",
|
|
530
|
+
alignItems: "center",
|
|
531
|
+
spacing: 1
|
|
532
|
+
}, /*#__PURE__*/React.createElement(Stack, {
|
|
533
|
+
direction: "row",
|
|
534
|
+
alignItems: "center",
|
|
535
|
+
spacing: 1,
|
|
536
|
+
sx: {
|
|
537
|
+
flex: 1
|
|
538
|
+
}
|
|
539
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
540
|
+
variant: "caption",
|
|
541
|
+
sx: {
|
|
542
|
+
minWidth: 40
|
|
543
|
+
}
|
|
544
|
+
}, formatTime(currentTime)), /*#__PURE__*/React.createElement(Slider, {
|
|
545
|
+
value: currentTime,
|
|
546
|
+
min: 0,
|
|
547
|
+
max: duration || 100,
|
|
548
|
+
onChange: handleProgressChange,
|
|
549
|
+
size: "small",
|
|
550
|
+
sx: {
|
|
551
|
+
flex: 1
|
|
552
|
+
}
|
|
553
|
+
}), /*#__PURE__*/React.createElement(Typography, {
|
|
554
|
+
variant: "caption",
|
|
555
|
+
sx: {
|
|
556
|
+
minWidth: 40
|
|
557
|
+
}
|
|
558
|
+
}, formatTime(duration))), /*#__PURE__*/React.createElement(Stack, {
|
|
559
|
+
direction: "row",
|
|
560
|
+
alignItems: "center",
|
|
561
|
+
sx: {
|
|
562
|
+
flexShrink: 0
|
|
563
|
+
}
|
|
564
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
565
|
+
size: "small",
|
|
566
|
+
onClick: toogleMute,
|
|
567
|
+
sx: {
|
|
568
|
+
flexShrink: 0
|
|
569
|
+
}
|
|
570
|
+
}, !isMuted ? /*#__PURE__*/React.createElement(VolumeUpLineIcon, {
|
|
571
|
+
sx: {
|
|
572
|
+
fontSize: '1rem'
|
|
573
|
+
}
|
|
574
|
+
}) : /*#__PURE__*/React.createElement(VolumeMuteLineIcon, {
|
|
575
|
+
sx: {
|
|
576
|
+
fontSize: '1rem'
|
|
577
|
+
}
|
|
578
|
+
})), /*#__PURE__*/React.createElement(Slider, {
|
|
579
|
+
value: volume,
|
|
580
|
+
min: 0,
|
|
581
|
+
max: 1,
|
|
582
|
+
step: 0.01,
|
|
583
|
+
onChange: handleVolumeChange,
|
|
584
|
+
size: "small",
|
|
585
|
+
color: "error",
|
|
586
|
+
disabled: isMuted,
|
|
587
|
+
sx: function sx(t) {
|
|
588
|
+
return _objectSpread({
|
|
589
|
+
width: 80,
|
|
590
|
+
color: 'rgba(0,0,0,0.87)',
|
|
591
|
+
'& .MuiSlider-track': {
|
|
592
|
+
border: 'none'
|
|
593
|
+
},
|
|
594
|
+
'& .MuiSlider-thumb': {
|
|
595
|
+
width: 12,
|
|
596
|
+
height: 12,
|
|
597
|
+
backgroundColor: '#fff',
|
|
598
|
+
'&::before': {
|
|
599
|
+
boxShadow: '0 4px 8px rgba(0,0,0,0.4)'
|
|
600
|
+
},
|
|
601
|
+
'&:hover, &.Mui-focusVisible, &.Mui-active': {
|
|
602
|
+
boxShadow: 'none'
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
}, t.applyStyles('dark', {
|
|
606
|
+
color: '#fff'
|
|
607
|
+
}));
|
|
608
|
+
}
|
|
609
|
+
})), /*#__PURE__*/React.createElement(Tooltip, {
|
|
610
|
+
arrow: true,
|
|
611
|
+
title: "\u500D\u901F\u64AD\u653E"
|
|
612
|
+
}, /*#__PURE__*/React.createElement(Stack, {
|
|
613
|
+
direction: 'row',
|
|
614
|
+
alignItems: 'center',
|
|
615
|
+
sx: {
|
|
616
|
+
flexShrink: 0,
|
|
617
|
+
pr: 1
|
|
618
|
+
},
|
|
619
|
+
onClick: handleShowSpeedPopover
|
|
620
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
621
|
+
size: "small",
|
|
622
|
+
sx: {
|
|
623
|
+
color: anchorElSpeed ? 'primary.main' : ''
|
|
624
|
+
}
|
|
625
|
+
}, /*#__PURE__*/React.createElement(SpeedLineIcon, {
|
|
626
|
+
sx: {
|
|
627
|
+
fontSize: '1rem'
|
|
628
|
+
}
|
|
629
|
+
})), /*#__PURE__*/React.createElement(Box, {
|
|
630
|
+
sx: {
|
|
631
|
+
color: 'text.secondary',
|
|
632
|
+
fontSize: '0.75rem'
|
|
633
|
+
}
|
|
634
|
+
}, playbackRate, "x"))))), (isHovering || !!anchorElEdit) && /*#__PURE__*/React.createElement(Box, {
|
|
635
|
+
className: "audio-controls",
|
|
636
|
+
sx: {
|
|
637
|
+
position: 'absolute',
|
|
638
|
+
top: '0.5rem',
|
|
639
|
+
right: '0.5rem',
|
|
640
|
+
display: 'flex',
|
|
641
|
+
gap: '0.25rem'
|
|
642
|
+
}
|
|
643
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
644
|
+
arrow: true,
|
|
645
|
+
title: "\u7F16\u8F91\u97F3\u9891"
|
|
646
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
647
|
+
size: "small",
|
|
648
|
+
onClick: handleShowEditPopover,
|
|
649
|
+
sx: {
|
|
650
|
+
color: 'text.primary',
|
|
651
|
+
bgcolor: 'background.paper'
|
|
652
|
+
}
|
|
653
|
+
}, /*#__PURE__*/React.createElement(EditBoxLineIcon, {
|
|
654
|
+
sx: {
|
|
655
|
+
fontSize: '1rem'
|
|
656
|
+
}
|
|
657
|
+
}))), /*#__PURE__*/React.createElement(Tooltip, {
|
|
658
|
+
arrow: true,
|
|
659
|
+
title: "\u4E0B\u8F7D\u97F3\u9891"
|
|
660
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
661
|
+
size: "small",
|
|
662
|
+
onClick: handleDownload,
|
|
663
|
+
sx: {
|
|
664
|
+
color: 'text.primary',
|
|
665
|
+
bgcolor: 'background.paper'
|
|
666
|
+
}
|
|
667
|
+
}, /*#__PURE__*/React.createElement(DownloadLineIcon, {
|
|
668
|
+
sx: {
|
|
669
|
+
fontSize: '1rem'
|
|
670
|
+
}
|
|
671
|
+
}))), /*#__PURE__*/React.createElement(Tooltip, {
|
|
672
|
+
arrow: true,
|
|
673
|
+
title: "\u5220\u9664\u97F3\u9891"
|
|
674
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
675
|
+
size: "small",
|
|
676
|
+
onClick: deleteNode,
|
|
677
|
+
sx: {
|
|
678
|
+
color: 'text.primary',
|
|
679
|
+
bgcolor: 'background.paper'
|
|
680
|
+
}
|
|
681
|
+
}, /*#__PURE__*/React.createElement(DeleteLineIcon, {
|
|
682
|
+
sx: {
|
|
683
|
+
fontSize: '1rem'
|
|
684
|
+
}
|
|
685
|
+
}))))), /*#__PURE__*/React.createElement("audio", {
|
|
686
|
+
ref: audioRef,
|
|
687
|
+
src: attrs.src,
|
|
688
|
+
style: {
|
|
689
|
+
display: 'none'
|
|
690
|
+
},
|
|
691
|
+
onError: function onError(e) {
|
|
692
|
+
_onError === null || _onError === void 0 || _onError(e);
|
|
693
|
+
}
|
|
694
|
+
}), /*#__PURE__*/React.createElement(FloatingPopover, {
|
|
695
|
+
open: Boolean(anchorElEdit),
|
|
696
|
+
anchorEl: anchorElEdit,
|
|
697
|
+
onClose: handleCloseEditPopover,
|
|
698
|
+
placement: "bottom"
|
|
699
|
+
}, /*#__PURE__*/React.createElement(EditAudioDialog, {
|
|
700
|
+
attrs: attrs,
|
|
701
|
+
onSave: updateAudioSource,
|
|
702
|
+
onUpload: onUpload,
|
|
703
|
+
onError: _onError
|
|
704
|
+
})), /*#__PURE__*/React.createElement(FloatingPopover, {
|
|
705
|
+
open: Boolean(anchorElSpeed),
|
|
706
|
+
anchorEl: anchorElSpeed,
|
|
707
|
+
onClose: handleCloseSpeedPopover,
|
|
708
|
+
placement: "bottom"
|
|
709
|
+
}, /*#__PURE__*/React.createElement(Paper, {
|
|
710
|
+
sx: {
|
|
711
|
+
p: 0.5,
|
|
712
|
+
borderRadius: 'var(--mui-shape-borderRadius)',
|
|
713
|
+
'.MuiList-root': {
|
|
714
|
+
p: '0px !important',
|
|
715
|
+
m: '0px !important'
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
}, /*#__PURE__*/React.createElement(MenuList, null, [0.5, 0.75, 1, 1.25, 1.5, 2].map(function (rate, index) {
|
|
719
|
+
return /*#__PURE__*/React.createElement(MenuItem, {
|
|
720
|
+
key: index,
|
|
721
|
+
selected: rate === playbackRate,
|
|
722
|
+
onClick: function onClick() {
|
|
723
|
+
return handlePlaybackRateChange(rate);
|
|
724
|
+
},
|
|
725
|
+
sx: {
|
|
726
|
+
py: 1,
|
|
727
|
+
px: 2,
|
|
728
|
+
fontSize: '0.875rem',
|
|
729
|
+
borderRadius: 'var(--mui-shape-borderRadius)',
|
|
730
|
+
'&:hover:not(.Mui-selected)': {
|
|
731
|
+
backgroundColor: 'action.hover'
|
|
732
|
+
},
|
|
733
|
+
'&.Mui-selected': {
|
|
734
|
+
backgroundColor: 'action.selected'
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
}, /*#__PURE__*/React.createElement(Box, null, rate, "x"));
|
|
738
|
+
})))));
|
|
739
|
+
};
|
|
740
|
+
export default AudioViewWrapper;
|