@cgboiler/biz-basic 1.0.53 → 1.0.55
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/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/rich-text-editor/RichTextEditor.d.ts +14 -5
- package/es/rich-text-editor/RichTextEditor.js +76 -196
- package/es/rich-text-editor/_atomic.css +2 -1
- package/es/rich-text-editor/extensions/ConsumedTrigger.d.ts +8 -0
- package/es/rich-text-editor/extensions/ConsumedTrigger.js +22 -0
- package/es/rich-text-editor/extensions/CustomContent.d.ts +5 -0
- package/es/rich-text-editor/extensions/CustomContent.js +103 -0
- package/es/rich-text-editor/extensions/HashTag.d.ts +15 -0
- package/es/rich-text-editor/extensions/HashTag.js +133 -0
- package/es/rich-text-editor/extensions/HorizontalRule.d.ts +2 -0
- package/es/rich-text-editor/extensions/HorizontalRule.js +16 -0
- package/es/rich-text-editor/extensions/IMEComposition.d.ts +16 -0
- package/es/rich-text-editor/extensions/IMEComposition.js +30 -0
- package/es/rich-text-editor/extensions/ImageUpload.d.ts +56 -0
- package/es/rich-text-editor/extensions/ImageUpload.js +80 -0
- package/es/rich-text-editor/extensions/MarkdownExtensions.d.ts +15 -0
- package/es/rich-text-editor/extensions/MarkdownExtensions.js +35 -0
- package/es/rich-text-editor/extensions/MediaInputRules.d.ts +17 -0
- package/es/rich-text-editor/extensions/MediaInputRules.js +47 -0
- package/es/rich-text-editor/extensions/MentionExtension.d.ts +15 -0
- package/es/rich-text-editor/extensions/MentionExtension.js +60 -0
- package/es/rich-text-editor/extensions/index.d.ts +16 -0
- package/es/rich-text-editor/extensions/index.js +20 -0
- package/es/rich-text-editor/hooks/index.d.ts +6 -0
- package/es/rich-text-editor/hooks/index.js +4 -0
- package/es/rich-text-editor/hooks/useEditorHistory.d.ts +17 -0
- package/es/rich-text-editor/hooks/useEditorHistory.js +87 -0
- package/es/rich-text-editor/index copy 2.css +1 -0
- package/es/rich-text-editor/index copy 2.less +598 -0
- package/es/rich-text-editor/index copy.css +1 -0
- package/es/rich-text-editor/index copy.less +356 -0
- package/es/rich-text-editor/index.css +1 -1
- package/es/rich-text-editor/index.less +444 -254
- package/es/rich-text-editor/lib/utils.d.ts +123 -0
- package/es/rich-text-editor/lib/utils.js +244 -0
- package/es/rich-text-editor/menu-system/components/_atomic.css +44 -0
- package/es/rich-text-editor/menu-system/components/blockquote-button.d.ts +49 -0
- package/es/rich-text-editor/menu-system/components/blockquote-button.js +75 -0
- package/es/rich-text-editor/menu-system/components/code-block-button.d.ts +49 -0
- package/es/rich-text-editor/menu-system/components/code-block-button.js +75 -0
- package/es/rich-text-editor/menu-system/components/color-highlight-button.d.ts +61 -0
- package/es/rich-text-editor/menu-system/components/color-highlight-button.js +102 -0
- package/es/rich-text-editor/menu-system/components/color-highlight-popover.d.ts +32 -0
- package/es/rich-text-editor/menu-system/components/color-highlight-popover.js +99 -0
- package/es/rich-text-editor/menu-system/components/heading-dropdown-menu.d.ts +43 -0
- package/es/rich-text-editor/menu-system/components/heading-dropdown-menu.js +102 -0
- package/es/rich-text-editor/menu-system/components/horizontal-rule-button.d.ts +22 -0
- package/es/rich-text-editor/menu-system/components/horizontal-rule-button.js +42 -0
- package/es/rich-text-editor/menu-system/components/image-upload-button.d.ts +40 -0
- package/es/rich-text-editor/menu-system/components/image-upload-button.js +71 -0
- package/es/rich-text-editor/menu-system/components/image-upload-node.d.ts +93 -0
- package/es/rich-text-editor/menu-system/components/image-upload-node.js +299 -0
- package/es/rich-text-editor/menu-system/components/link-popover.d.ts +32 -0
- package/es/rich-text-editor/menu-system/components/link-popover.js +127 -0
- package/es/rich-text-editor/menu-system/components/list-button.d.ts +40 -0
- package/es/rich-text-editor/menu-system/components/list-button.js +69 -0
- package/es/rich-text-editor/menu-system/components/list-dropdown-menu.d.ts +41 -0
- package/es/rich-text-editor/menu-system/components/list-dropdown-menu.js +97 -0
- package/es/rich-text-editor/menu-system/components/mark-button.d.ts +58 -0
- package/es/rich-text-editor/menu-system/components/mark-button.js +80 -0
- package/es/rich-text-editor/menu-system/components/text-align-button.d.ts +58 -0
- package/es/rich-text-editor/menu-system/components/text-align-button.js +80 -0
- package/es/rich-text-editor/menu-system/components/undo-redo-button.d.ts +58 -0
- package/es/rich-text-editor/menu-system/components/undo-redo-button.js +77 -0
- package/es/rich-text-editor/menu-system/hooks/use-blockquote.d.ts +34 -0
- package/es/rich-text-editor/menu-system/hooks/use-blockquote.js +140 -0
- package/es/rich-text-editor/menu-system/hooks/use-code-block.d.ts +34 -0
- package/es/rich-text-editor/menu-system/hooks/use-code-block.js +140 -0
- package/es/rich-text-editor/menu-system/hooks/use-color-highlight.d.ts +46 -0
- package/es/rich-text-editor/menu-system/hooks/use-color-highlight.js +166 -0
- package/es/rich-text-editor/menu-system/hooks/use-cursor-visibility.d.ts +7 -0
- package/es/rich-text-editor/menu-system/hooks/use-cursor-visibility.js +46 -0
- package/es/rich-text-editor/menu-system/hooks/use-element-rect.d.ts +10 -0
- package/es/rich-text-editor/menu-system/hooks/use-element-rect.js +132 -0
- package/es/rich-text-editor/menu-system/hooks/use-file-upload.d.ts +94 -0
- package/es/rich-text-editor/menu-system/hooks/use-file-upload.js +135 -0
- package/es/rich-text-editor/menu-system/hooks/use-heading-dropdown-menu.d.ts +41 -0
- package/es/rich-text-editor/menu-system/hooks/use-heading-dropdown-menu.js +70 -0
- package/es/rich-text-editor/menu-system/hooks/use-heading.d.ts +26 -0
- package/es/rich-text-editor/menu-system/hooks/use-heading.js +166 -0
- package/es/rich-text-editor/menu-system/hooks/use-image-upload.d.ts +35 -0
- package/es/rich-text-editor/menu-system/hooks/use-image-upload.js +103 -0
- package/es/rich-text-editor/menu-system/hooks/use-link-popover.d.ts +10 -0
- package/es/rich-text-editor/menu-system/hooks/use-link-popover.js +62 -0
- package/es/rich-text-editor/menu-system/hooks/use-list-dropdown-menu.d.ts +34 -0
- package/es/rich-text-editor/menu-system/hooks/use-list-dropdown-menu.js +121 -0
- package/es/rich-text-editor/menu-system/hooks/use-list.d.ts +28 -0
- package/es/rich-text-editor/menu-system/hooks/use-list.js +191 -0
- package/es/rich-text-editor/menu-system/hooks/use-mark.d.ts +22 -0
- package/es/rich-text-editor/menu-system/hooks/use-mark.js +109 -0
- package/es/rich-text-editor/menu-system/hooks/use-menu-navigation.d.ts +16 -0
- package/es/rich-text-editor/menu-system/hooks/use-menu-navigation.js +134 -0
- package/es/rich-text-editor/menu-system/hooks/use-mobile.d.ts +1 -0
- package/es/rich-text-editor/menu-system/hooks/use-mobile.js +20 -0
- package/es/rich-text-editor/menu-system/hooks/use-text-align.d.ts +28 -0
- package/es/rich-text-editor/menu-system/hooks/use-text-align.js +113 -0
- package/es/rich-text-editor/menu-system/hooks/use-throttled-callback.d.ts +8 -0
- package/es/rich-text-editor/menu-system/hooks/use-throttled-callback.js +45 -0
- package/es/rich-text-editor/menu-system/hooks/use-undo-redo.d.ts +60 -0
- package/es/rich-text-editor/menu-system/hooks/use-undo-redo.js +96 -0
- package/es/rich-text-editor/menu-system/hooks/use-window-size.d.ts +21 -0
- package/es/rich-text-editor/menu-system/hooks/use-window-size.js +74 -0
- package/es/rich-text-editor/menu-system/icons/_atomic.css +32 -0
- package/es/rich-text-editor/menu-system/icons/index.d.ts +546 -0
- package/es/rich-text-editor/menu-system/icons/index.js +487 -0
- package/es/rich-text-editor/menu-system/primitives/_atomic.css +38 -0
- package/es/rich-text-editor/menu-system/primitives/button.d.ts +110 -0
- package/es/rich-text-editor/menu-system/primitives/button.js +107 -0
- package/es/rich-text-editor/menu-system/primitives/card.d.ts +75 -0
- package/es/rich-text-editor/menu-system/primitives/card.js +116 -0
- package/es/rich-text-editor/menu-system/primitives/input.d.ts +37 -0
- package/es/rich-text-editor/menu-system/primitives/input.js +55 -0
- package/es/rich-text-editor/menu-system/primitives/separator.d.ts +34 -0
- package/es/rich-text-editor/menu-system/primitives/separator.js +42 -0
- package/es/rich-text-editor/menu-system/primitives/toolbar.d.ts +39 -0
- package/es/rich-text-editor/menu-system/primitives/toolbar.js +149 -0
- package/es/rich-text-editor/menu-system/styles/animations.css +1 -0
- package/es/rich-text-editor/menu-system/styles/animations.less +91 -0
- package/es/rich-text-editor/menu-system/styles/button-colors.css +1 -0
- package/es/rich-text-editor/menu-system/styles/button-colors.less +142 -0
- package/es/rich-text-editor/menu-system/styles/button-group.css +1 -0
- package/es/rich-text-editor/menu-system/styles/button-group.less +23 -0
- package/es/rich-text-editor/menu-system/styles/button.css +1 -0
- package/es/rich-text-editor/menu-system/styles/button.less +322 -0
- package/es/rich-text-editor/menu-system/styles/card.css +1 -0
- package/es/rich-text-editor/menu-system/styles/card.less +78 -0
- package/es/rich-text-editor/menu-system/styles/color-highlight-button.css +1 -0
- package/es/rich-text-editor/menu-system/styles/color-highlight-button.less +57 -0
- package/es/rich-text-editor/menu-system/styles/color-highlight-popover.css +1 -0
- package/es/rich-text-editor/menu-system/styles/color-highlight-popover.less +51 -0
- package/es/rich-text-editor/menu-system/styles/dropdown-menu.css +1 -0
- package/es/rich-text-editor/menu-system/styles/dropdown-menu.less +40 -0
- package/es/rich-text-editor/menu-system/styles/image-upload-node.css +1 -0
- package/es/rich-text-editor/menu-system/styles/image-upload-node.less +240 -0
- package/es/rich-text-editor/menu-system/styles/input.css +1 -0
- package/es/rich-text-editor/menu-system/styles/input.less +53 -0
- package/es/rich-text-editor/menu-system/styles/link-popover.css +1 -0
- package/es/rich-text-editor/menu-system/styles/link-popover.less +32 -0
- package/es/rich-text-editor/menu-system/styles/separator.css +1 -0
- package/es/rich-text-editor/menu-system/styles/separator.less +26 -0
- package/es/rich-text-editor/menu-system/styles/simple-editor.css +1 -0
- package/es/rich-text-editor/menu-system/styles/simple-editor.less +39 -0
- package/es/rich-text-editor/menu-system/styles/toolbar.css +1 -0
- package/es/rich-text-editor/menu-system/styles/toolbar.less +87 -0
- package/es/rich-text-editor/menu-system/styles/variables.css +1 -0
- package/es/rich-text-editor/menu-system/styles/variables.less +296 -0
- package/es/rich-text-editor/menu-system/utils/tiptap-utils.d.ts +122 -0
- package/es/rich-text-editor/menu-system/utils/tiptap-utils.js +243 -0
- package/es/rich-text-editor/types.d.ts +4 -0
- package/es/rich-text-editor/types.js +4 -0
- package/es/rich-text-editor/useExtensions.d.ts +3 -3
- package/es/rich-text-editor/useExtensions.js +63 -428
- package/es/rich-text-editor/utils/eventHandlers.d.ts +37 -0
- package/es/rich-text-editor/utils/eventHandlers.js +103 -0
- package/es/rich-text-editor/utils/index.d.ts +6 -0
- package/es/rich-text-editor/utils/index.js +19 -0
- package/es/rich-text-editor/utils/triggerHelpers.d.ts +31 -0
- package/es/rich-text-editor/utils/triggerHelpers.js +46 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/rich-text-editor/RichTextEditor.d.ts +14 -5
- package/lib/rich-text-editor/RichTextEditor.js +76 -206
- package/lib/rich-text-editor/_atomic.css +2 -1
- package/lib/rich-text-editor/extensions/ConsumedTrigger.d.ts +8 -0
- package/lib/rich-text-editor/extensions/ConsumedTrigger.js +41 -0
- package/lib/rich-text-editor/extensions/CustomContent.d.ts +5 -0
- package/lib/rich-text-editor/extensions/CustomContent.js +132 -0
- package/lib/rich-text-editor/extensions/HashTag.d.ts +15 -0
- package/lib/rich-text-editor/extensions/HashTag.js +157 -0
- package/lib/rich-text-editor/extensions/HorizontalRule.d.ts +2 -0
- package/lib/rich-text-editor/extensions/HorizontalRule.js +45 -0
- package/lib/rich-text-editor/extensions/IMEComposition.d.ts +16 -0
- package/lib/rich-text-editor/extensions/IMEComposition.js +49 -0
- package/lib/rich-text-editor/extensions/ImageUpload.d.ts +56 -0
- package/lib/rich-text-editor/extensions/ImageUpload.js +99 -0
- package/lib/rich-text-editor/extensions/MarkdownExtensions.d.ts +15 -0
- package/lib/rich-text-editor/extensions/MarkdownExtensions.js +54 -0
- package/lib/rich-text-editor/extensions/MediaInputRules.d.ts +17 -0
- package/lib/rich-text-editor/extensions/MediaInputRules.js +66 -0
- package/lib/rich-text-editor/extensions/MentionExtension.d.ts +15 -0
- package/lib/rich-text-editor/extensions/MentionExtension.js +89 -0
- package/lib/rich-text-editor/extensions/index.d.ts +16 -0
- package/lib/rich-text-editor/extensions/index.js +49 -0
- package/lib/rich-text-editor/hooks/index.d.ts +6 -0
- package/lib/rich-text-editor/hooks/index.js +23 -0
- package/lib/rich-text-editor/hooks/useEditorHistory.d.ts +17 -0
- package/lib/rich-text-editor/hooks/useEditorHistory.js +116 -0
- package/lib/rich-text-editor/index copy 2.css +1 -0
- package/lib/rich-text-editor/index copy 2.less +598 -0
- package/lib/rich-text-editor/index copy.css +1 -0
- package/lib/rich-text-editor/index copy.less +356 -0
- package/lib/rich-text-editor/index.css +1 -1
- package/lib/rich-text-editor/index.less +444 -254
- package/lib/rich-text-editor/lib/utils.d.ts +123 -0
- package/lib/rich-text-editor/lib/utils.js +263 -0
- package/lib/rich-text-editor/menu-system/components/_atomic.css +44 -0
- package/lib/rich-text-editor/menu-system/components/blockquote-button.d.ts +49 -0
- package/lib/rich-text-editor/menu-system/components/blockquote-button.js +94 -0
- package/lib/rich-text-editor/menu-system/components/code-block-button.d.ts +49 -0
- package/lib/rich-text-editor/menu-system/components/code-block-button.js +94 -0
- package/lib/rich-text-editor/menu-system/components/color-highlight-button.d.ts +61 -0
- package/lib/rich-text-editor/menu-system/components/color-highlight-button.js +119 -0
- package/lib/rich-text-editor/menu-system/components/color-highlight-popover.d.ts +32 -0
- package/lib/rich-text-editor/menu-system/components/color-highlight-popover.js +118 -0
- package/lib/rich-text-editor/menu-system/components/heading-dropdown-menu.d.ts +43 -0
- package/lib/rich-text-editor/menu-system/components/heading-dropdown-menu.js +131 -0
- package/lib/rich-text-editor/menu-system/components/horizontal-rule-button.d.ts +22 -0
- package/lib/rich-text-editor/menu-system/components/horizontal-rule-button.js +61 -0
- package/lib/rich-text-editor/menu-system/components/image-upload-button.d.ts +40 -0
- package/lib/rich-text-editor/menu-system/components/image-upload-button.js +90 -0
- package/lib/rich-text-editor/menu-system/components/image-upload-node.d.ts +93 -0
- package/lib/rich-text-editor/menu-system/components/image-upload-node.js +316 -0
- package/lib/rich-text-editor/menu-system/components/link-popover.d.ts +32 -0
- package/lib/rich-text-editor/menu-system/components/link-popover.js +146 -0
- package/lib/rich-text-editor/menu-system/components/list-button.d.ts +40 -0
- package/lib/rich-text-editor/menu-system/components/list-button.js +88 -0
- package/lib/rich-text-editor/menu-system/components/list-dropdown-menu.d.ts +41 -0
- package/lib/rich-text-editor/menu-system/components/list-dropdown-menu.js +116 -0
- package/lib/rich-text-editor/menu-system/components/mark-button.d.ts +58 -0
- package/lib/rich-text-editor/menu-system/components/mark-button.js +99 -0
- package/lib/rich-text-editor/menu-system/components/text-align-button.d.ts +58 -0
- package/lib/rich-text-editor/menu-system/components/text-align-button.js +99 -0
- package/lib/rich-text-editor/menu-system/components/undo-redo-button.d.ts +58 -0
- package/lib/rich-text-editor/menu-system/components/undo-redo-button.js +96 -0
- package/lib/rich-text-editor/menu-system/hooks/use-blockquote.d.ts +34 -0
- package/lib/rich-text-editor/menu-system/hooks/use-blockquote.js +154 -0
- package/lib/rich-text-editor/menu-system/hooks/use-code-block.d.ts +34 -0
- package/lib/rich-text-editor/menu-system/hooks/use-code-block.js +154 -0
- package/lib/rich-text-editor/menu-system/hooks/use-color-highlight.d.ts +46 -0
- package/lib/rich-text-editor/menu-system/hooks/use-color-highlight.js +185 -0
- package/lib/rich-text-editor/menu-system/hooks/use-cursor-visibility.d.ts +7 -0
- package/lib/rich-text-editor/menu-system/hooks/use-cursor-visibility.js +65 -0
- package/lib/rich-text-editor/menu-system/hooks/use-element-rect.d.ts +10 -0
- package/lib/rich-text-editor/menu-system/hooks/use-element-rect.js +149 -0
- package/lib/rich-text-editor/menu-system/hooks/use-file-upload.d.ts +94 -0
- package/lib/rich-text-editor/menu-system/hooks/use-file-upload.js +154 -0
- package/lib/rich-text-editor/menu-system/hooks/use-heading-dropdown-menu.d.ts +41 -0
- package/lib/rich-text-editor/menu-system/hooks/use-heading-dropdown-menu.js +84 -0
- package/lib/rich-text-editor/menu-system/hooks/use-heading.d.ts +26 -0
- package/lib/rich-text-editor/menu-system/hooks/use-heading.js +190 -0
- package/lib/rich-text-editor/menu-system/hooks/use-image-upload.d.ts +35 -0
- package/lib/rich-text-editor/menu-system/hooks/use-image-upload.js +122 -0
- package/lib/rich-text-editor/menu-system/hooks/use-link-popover.d.ts +10 -0
- package/lib/rich-text-editor/menu-system/hooks/use-link-popover.js +81 -0
- package/lib/rich-text-editor/menu-system/hooks/use-list-dropdown-menu.d.ts +34 -0
- package/lib/rich-text-editor/menu-system/hooks/use-list-dropdown-menu.js +140 -0
- package/lib/rich-text-editor/menu-system/hooks/use-list.d.ts +28 -0
- package/lib/rich-text-editor/menu-system/hooks/use-list.js +205 -0
- package/lib/rich-text-editor/menu-system/hooks/use-mark.d.ts +22 -0
- package/lib/rich-text-editor/menu-system/hooks/use-mark.js +138 -0
- package/lib/rich-text-editor/menu-system/hooks/use-menu-navigation.d.ts +16 -0
- package/lib/rich-text-editor/menu-system/hooks/use-menu-navigation.js +153 -0
- package/lib/rich-text-editor/menu-system/hooks/use-mobile.d.ts +1 -0
- package/lib/rich-text-editor/menu-system/hooks/use-mobile.js +39 -0
- package/lib/rich-text-editor/menu-system/hooks/use-text-align.d.ts +28 -0
- package/lib/rich-text-editor/menu-system/hooks/use-text-align.js +132 -0
- package/lib/rich-text-editor/menu-system/hooks/use-throttled-callback.d.ts +8 -0
- package/lib/rich-text-editor/menu-system/hooks/use-throttled-callback.js +64 -0
- package/lib/rich-text-editor/menu-system/hooks/use-undo-redo.d.ts +60 -0
- package/lib/rich-text-editor/menu-system/hooks/use-undo-redo.js +115 -0
- package/lib/rich-text-editor/menu-system/hooks/use-window-size.d.ts +21 -0
- package/lib/rich-text-editor/menu-system/hooks/use-window-size.js +93 -0
- package/lib/rich-text-editor/menu-system/icons/_atomic.css +32 -0
- package/lib/rich-text-editor/menu-system/icons/index.d.ts +546 -0
- package/lib/rich-text-editor/menu-system/icons/index.js +506 -0
- package/lib/rich-text-editor/menu-system/primitives/_atomic.css +38 -0
- package/lib/rich-text-editor/menu-system/primitives/button.d.ts +110 -0
- package/lib/rich-text-editor/menu-system/primitives/button.js +126 -0
- package/lib/rich-text-editor/menu-system/primitives/card.d.ts +75 -0
- package/lib/rich-text-editor/menu-system/primitives/card.js +135 -0
- package/lib/rich-text-editor/menu-system/primitives/input.d.ts +37 -0
- package/lib/rich-text-editor/menu-system/primitives/input.js +74 -0
- package/lib/rich-text-editor/menu-system/primitives/separator.d.ts +34 -0
- package/lib/rich-text-editor/menu-system/primitives/separator.js +61 -0
- package/lib/rich-text-editor/menu-system/primitives/toolbar.d.ts +39 -0
- package/lib/rich-text-editor/menu-system/primitives/toolbar.js +168 -0
- package/lib/rich-text-editor/menu-system/styles/animations.css +1 -0
- package/lib/rich-text-editor/menu-system/styles/animations.less +91 -0
- package/lib/rich-text-editor/menu-system/styles/button-colors.css +1 -0
- package/lib/rich-text-editor/menu-system/styles/button-colors.less +142 -0
- package/lib/rich-text-editor/menu-system/styles/button-group.css +1 -0
- package/lib/rich-text-editor/menu-system/styles/button-group.less +23 -0
- package/lib/rich-text-editor/menu-system/styles/button.css +1 -0
- package/lib/rich-text-editor/menu-system/styles/button.less +322 -0
- package/lib/rich-text-editor/menu-system/styles/card.css +1 -0
- package/lib/rich-text-editor/menu-system/styles/card.less +78 -0
- package/lib/rich-text-editor/menu-system/styles/color-highlight-button.css +1 -0
- package/lib/rich-text-editor/menu-system/styles/color-highlight-button.less +57 -0
- package/lib/rich-text-editor/menu-system/styles/color-highlight-popover.css +1 -0
- package/lib/rich-text-editor/menu-system/styles/color-highlight-popover.less +51 -0
- package/lib/rich-text-editor/menu-system/styles/dropdown-menu.css +1 -0
- package/lib/rich-text-editor/menu-system/styles/dropdown-menu.less +40 -0
- package/lib/rich-text-editor/menu-system/styles/image-upload-node.css +1 -0
- package/lib/rich-text-editor/menu-system/styles/image-upload-node.less +240 -0
- package/lib/rich-text-editor/menu-system/styles/input.css +1 -0
- package/lib/rich-text-editor/menu-system/styles/input.less +53 -0
- package/lib/rich-text-editor/menu-system/styles/link-popover.css +1 -0
- package/lib/rich-text-editor/menu-system/styles/link-popover.less +32 -0
- package/lib/rich-text-editor/menu-system/styles/separator.css +1 -0
- package/lib/rich-text-editor/menu-system/styles/separator.less +26 -0
- package/lib/rich-text-editor/menu-system/styles/simple-editor.css +1 -0
- package/lib/rich-text-editor/menu-system/styles/simple-editor.less +39 -0
- package/lib/rich-text-editor/menu-system/styles/toolbar.css +1 -0
- package/lib/rich-text-editor/menu-system/styles/toolbar.less +87 -0
- package/lib/rich-text-editor/menu-system/styles/variables.css +1 -0
- package/lib/rich-text-editor/menu-system/styles/variables.less +296 -0
- package/lib/rich-text-editor/menu-system/utils/tiptap-utils.d.ts +122 -0
- package/lib/rich-text-editor/menu-system/utils/tiptap-utils.js +262 -0
- package/lib/rich-text-editor/types.d.ts +4 -0
- package/lib/rich-text-editor/types.js +4 -0
- package/lib/rich-text-editor/useExtensions.d.ts +3 -3
- package/lib/rich-text-editor/useExtensions.js +64 -429
- package/lib/rich-text-editor/utils/eventHandlers.d.ts +37 -0
- package/lib/rich-text-editor/utils/eventHandlers.js +132 -0
- package/lib/rich-text-editor/utils/index.d.ts +6 -0
- package/lib/rich-text-editor/utils/index.js +32 -0
- package/lib/rich-text-editor/utils/triggerHelpers.d.ts +31 -0
- package/lib/rich-text-editor/utils/triggerHelpers.js +65 -0
- package/package.json +13 -3
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
export declare const ImageUploadButton: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
editor: {
|
|
4
|
+
type: PropType<any>;
|
|
5
|
+
required: true;
|
|
6
|
+
};
|
|
7
|
+
text: {
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
hideWhenUnavailable: {
|
|
12
|
+
type: BooleanConstructor;
|
|
13
|
+
default: boolean;
|
|
14
|
+
};
|
|
15
|
+
className: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
}>, () => import("vue/jsx-runtime").JSX.Element | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
20
|
+
editor: {
|
|
21
|
+
type: PropType<any>;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
text: {
|
|
25
|
+
type: StringConstructor;
|
|
26
|
+
default: string;
|
|
27
|
+
};
|
|
28
|
+
hideWhenUnavailable: {
|
|
29
|
+
type: BooleanConstructor;
|
|
30
|
+
default: boolean;
|
|
31
|
+
};
|
|
32
|
+
className: {
|
|
33
|
+
type: StringConstructor;
|
|
34
|
+
default: string;
|
|
35
|
+
};
|
|
36
|
+
}>> & Readonly<{}>, {
|
|
37
|
+
text: string;
|
|
38
|
+
className: string;
|
|
39
|
+
hideWhenUnavailable: boolean;
|
|
40
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var stdin_exports = {};
|
|
19
|
+
__export(stdin_exports, {
|
|
20
|
+
ImageUploadButton: () => ImageUploadButton
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
23
|
+
var import_vue = require("vue");
|
|
24
|
+
var import_atomic = require("./_atomic.css");
|
|
25
|
+
var import_vue2 = require("vue");
|
|
26
|
+
var import_use_image_upload = require("../hooks/use-image-upload");
|
|
27
|
+
var import_button = require("../primitives/button");
|
|
28
|
+
var import_tiptap_utils = require("../utils/tiptap-utils");
|
|
29
|
+
const ImageUploadButton = (0, import_vue2.defineComponent)({
|
|
30
|
+
name: "ImageUploadButton",
|
|
31
|
+
props: {
|
|
32
|
+
editor: {
|
|
33
|
+
type: Object,
|
|
34
|
+
required: true
|
|
35
|
+
},
|
|
36
|
+
text: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: ""
|
|
39
|
+
},
|
|
40
|
+
hideWhenUnavailable: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false
|
|
43
|
+
},
|
|
44
|
+
className: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: ""
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
setup(props, {
|
|
50
|
+
slots,
|
|
51
|
+
attrs
|
|
52
|
+
}) {
|
|
53
|
+
const {
|
|
54
|
+
isVisible,
|
|
55
|
+
handleImage,
|
|
56
|
+
label,
|
|
57
|
+
canInsert,
|
|
58
|
+
isActive,
|
|
59
|
+
Icon,
|
|
60
|
+
shortcutKeys
|
|
61
|
+
} = (0, import_use_image_upload.useImageUpload)({
|
|
62
|
+
editor: props.editor,
|
|
63
|
+
hideWhenUnavailable: props.hideWhenUnavailable
|
|
64
|
+
});
|
|
65
|
+
return () => {
|
|
66
|
+
if (!isVisible.value)
|
|
67
|
+
return null;
|
|
68
|
+
return (0, import_vue.createVNode)(import_button.Button, (0, import_vue.mergeProps)({
|
|
69
|
+
"type": "button",
|
|
70
|
+
"disabled": !canInsert.value,
|
|
71
|
+
"data-style": "ghost",
|
|
72
|
+
"data-active-state": isActive.value ? "on" : "off",
|
|
73
|
+
"data-disabled": !canInsert.value,
|
|
74
|
+
"role": "button",
|
|
75
|
+
"tabindex": -1,
|
|
76
|
+
"aria-label": label,
|
|
77
|
+
"aria-pressed": isActive.value,
|
|
78
|
+
"tooltip": label,
|
|
79
|
+
"onClick": handleImage,
|
|
80
|
+
"class": (0, import_tiptap_utils.cn)(props.className)
|
|
81
|
+
}, attrs), {
|
|
82
|
+
default: () => [slots.default ? slots.default() : (0, import_vue.createVNode)(import_vue.Fragment, null, [(0, import_vue.createVNode)(Icon, {
|
|
83
|
+
"class": "tiptap-button-icon"
|
|
84
|
+
}, null), props.text && (0, import_vue.createVNode)("span", {
|
|
85
|
+
"class": "tiptap-button-text"
|
|
86
|
+
}, [props.text])])]
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
});
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import '../styles/image-upload-node.less';
|
|
3
|
+
export declare const ImageUploadNodeView: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
editor: {
|
|
5
|
+
type: PropType<import("@tiptap/core").NodeViewProps["editor"]>;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
node: {
|
|
9
|
+
type: PropType<import("@tiptap/core").NodeViewProps["node"]>;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
decorations: {
|
|
13
|
+
type: PropType<import("@tiptap/core").NodeViewProps["decorations"]>;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
selected: {
|
|
17
|
+
type: PropType<import("@tiptap/core").NodeViewProps["selected"]>;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
extension: {
|
|
21
|
+
type: PropType<import("@tiptap/core").NodeViewProps["extension"]>;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
getPos: {
|
|
25
|
+
type: PropType<import("@tiptap/core").NodeViewProps["getPos"]>;
|
|
26
|
+
required: true;
|
|
27
|
+
};
|
|
28
|
+
updateAttributes: {
|
|
29
|
+
type: PropType<import("@tiptap/core").NodeViewProps["updateAttributes"]>;
|
|
30
|
+
required: true;
|
|
31
|
+
};
|
|
32
|
+
deleteNode: {
|
|
33
|
+
type: PropType<import("@tiptap/core").NodeViewProps["deleteNode"]>;
|
|
34
|
+
required: true;
|
|
35
|
+
};
|
|
36
|
+
view: {
|
|
37
|
+
type: PropType<import("@tiptap/core").NodeViewProps["view"]>;
|
|
38
|
+
required: true;
|
|
39
|
+
};
|
|
40
|
+
innerDecorations: {
|
|
41
|
+
type: PropType<import("@tiptap/core").NodeViewProps["innerDecorations"]>;
|
|
42
|
+
required: true;
|
|
43
|
+
};
|
|
44
|
+
HTMLAttributes: {
|
|
45
|
+
type: PropType<import("@tiptap/core").NodeViewProps["HTMLAttributes"]>;
|
|
46
|
+
required: true;
|
|
47
|
+
};
|
|
48
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
49
|
+
editor: {
|
|
50
|
+
type: PropType<import("@tiptap/core").NodeViewProps["editor"]>;
|
|
51
|
+
required: true;
|
|
52
|
+
};
|
|
53
|
+
node: {
|
|
54
|
+
type: PropType<import("@tiptap/core").NodeViewProps["node"]>;
|
|
55
|
+
required: true;
|
|
56
|
+
};
|
|
57
|
+
decorations: {
|
|
58
|
+
type: PropType<import("@tiptap/core").NodeViewProps["decorations"]>;
|
|
59
|
+
required: true;
|
|
60
|
+
};
|
|
61
|
+
selected: {
|
|
62
|
+
type: PropType<import("@tiptap/core").NodeViewProps["selected"]>;
|
|
63
|
+
required: true;
|
|
64
|
+
};
|
|
65
|
+
extension: {
|
|
66
|
+
type: PropType<import("@tiptap/core").NodeViewProps["extension"]>;
|
|
67
|
+
required: true;
|
|
68
|
+
};
|
|
69
|
+
getPos: {
|
|
70
|
+
type: PropType<import("@tiptap/core").NodeViewProps["getPos"]>;
|
|
71
|
+
required: true;
|
|
72
|
+
};
|
|
73
|
+
updateAttributes: {
|
|
74
|
+
type: PropType<import("@tiptap/core").NodeViewProps["updateAttributes"]>;
|
|
75
|
+
required: true;
|
|
76
|
+
};
|
|
77
|
+
deleteNode: {
|
|
78
|
+
type: PropType<import("@tiptap/core").NodeViewProps["deleteNode"]>;
|
|
79
|
+
required: true;
|
|
80
|
+
};
|
|
81
|
+
view: {
|
|
82
|
+
type: PropType<import("@tiptap/core").NodeViewProps["view"]>;
|
|
83
|
+
required: true;
|
|
84
|
+
};
|
|
85
|
+
innerDecorations: {
|
|
86
|
+
type: PropType<import("@tiptap/core").NodeViewProps["innerDecorations"]>;
|
|
87
|
+
required: true;
|
|
88
|
+
};
|
|
89
|
+
HTMLAttributes: {
|
|
90
|
+
type: PropType<import("@tiptap/core").NodeViewProps["HTMLAttributes"]>;
|
|
91
|
+
required: true;
|
|
92
|
+
};
|
|
93
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
21
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
22
|
+
var __export = (target, all) => {
|
|
23
|
+
for (var name in all)
|
|
24
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
25
|
+
};
|
|
26
|
+
var __copyProps = (to, from, except, desc) => {
|
|
27
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
28
|
+
for (let key of __getOwnPropNames(from))
|
|
29
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
30
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
31
|
+
}
|
|
32
|
+
return to;
|
|
33
|
+
};
|
|
34
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
|
+
var __async = (__this, __arguments, generator) => {
|
|
36
|
+
return new Promise((resolve, reject) => {
|
|
37
|
+
var fulfilled = (value) => {
|
|
38
|
+
try {
|
|
39
|
+
step(generator.next(value));
|
|
40
|
+
} catch (e) {
|
|
41
|
+
reject(e);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
var rejected = (value) => {
|
|
45
|
+
try {
|
|
46
|
+
step(generator.throw(value));
|
|
47
|
+
} catch (e) {
|
|
48
|
+
reject(e);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
52
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
var stdin_exports = {};
|
|
56
|
+
__export(stdin_exports, {
|
|
57
|
+
ImageUploadNodeView: () => ImageUploadNodeView
|
|
58
|
+
});
|
|
59
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
60
|
+
var import_vue = require("vue");
|
|
61
|
+
var import_atomic = require("./_atomic.css");
|
|
62
|
+
var import_vue2 = require("vue");
|
|
63
|
+
var import_vue_3 = require("@tiptap/vue-3");
|
|
64
|
+
var import_button = require("../primitives/button");
|
|
65
|
+
var import_icons = require("../icons");
|
|
66
|
+
var import_tiptap_utils = require("../utils/tiptap-utils");
|
|
67
|
+
var import_use_file_upload = require("../hooks/use-file-upload");
|
|
68
|
+
var import_image_upload_node = require("../styles/image-upload-node.css");
|
|
69
|
+
const ImageUploadDragArea = (0, import_vue2.defineComponent)({
|
|
70
|
+
name: "ImageUploadDragArea",
|
|
71
|
+
props: {
|
|
72
|
+
onFile: {
|
|
73
|
+
type: Function,
|
|
74
|
+
required: true
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
setup(props, {
|
|
78
|
+
slots
|
|
79
|
+
}) {
|
|
80
|
+
const isDragOver = (0, import_vue2.ref)(false);
|
|
81
|
+
const isDragActive = (0, import_vue2.ref)(false);
|
|
82
|
+
const handleDragEnter = (e) => {
|
|
83
|
+
e.preventDefault();
|
|
84
|
+
e.stopPropagation();
|
|
85
|
+
isDragActive.value = true;
|
|
86
|
+
};
|
|
87
|
+
const handleDragLeave = (e) => {
|
|
88
|
+
e.preventDefault();
|
|
89
|
+
e.stopPropagation();
|
|
90
|
+
if (!e.currentTarget.contains(e.relatedTarget)) {
|
|
91
|
+
isDragActive.value = false;
|
|
92
|
+
isDragOver.value = false;
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
const handleDragOver = (e) => {
|
|
96
|
+
e.preventDefault();
|
|
97
|
+
e.stopPropagation();
|
|
98
|
+
isDragOver.value = true;
|
|
99
|
+
};
|
|
100
|
+
const handleDrop = (e) => {
|
|
101
|
+
var _a;
|
|
102
|
+
e.preventDefault();
|
|
103
|
+
e.stopPropagation();
|
|
104
|
+
isDragActive.value = false;
|
|
105
|
+
isDragOver.value = false;
|
|
106
|
+
const files = Array.from(((_a = e.dataTransfer) == null ? void 0 : _a.files) || []);
|
|
107
|
+
if (files.length > 0) {
|
|
108
|
+
props.onFile(files);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
return () => {
|
|
112
|
+
var _a;
|
|
113
|
+
return (0, import_vue.createVNode)("div", {
|
|
114
|
+
"class": `tiptap-image-upload-drag-area ${isDragActive.value ? "drag-active" : ""} ${isDragOver.value ? "drag-over" : ""}`,
|
|
115
|
+
"onDragenter": handleDragEnter,
|
|
116
|
+
"onDragleave": handleDragLeave,
|
|
117
|
+
"onDragover": handleDragOver,
|
|
118
|
+
"onDrop": handleDrop
|
|
119
|
+
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
const ImageUploadPreview = (0, import_vue2.defineComponent)({
|
|
124
|
+
name: "ImageUploadPreview",
|
|
125
|
+
props: {
|
|
126
|
+
fileItem: {
|
|
127
|
+
type: Object,
|
|
128
|
+
required: true
|
|
129
|
+
},
|
|
130
|
+
onRemove: {
|
|
131
|
+
type: Function,
|
|
132
|
+
required: true
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
setup(props) {
|
|
136
|
+
const formatFileSize = (bytes) => {
|
|
137
|
+
if (bytes === 0)
|
|
138
|
+
return "0 Bytes";
|
|
139
|
+
const k = 1024;
|
|
140
|
+
const sizes = ["Bytes", "KB", "MB", "GB"];
|
|
141
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
142
|
+
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(2))} ${sizes[i]}`;
|
|
143
|
+
};
|
|
144
|
+
return () => (0, import_vue.createVNode)("div", {
|
|
145
|
+
"class": "tiptap-image-upload-preview"
|
|
146
|
+
}, [props.fileItem.status === "uploading" && (0, import_vue.createVNode)("div", {
|
|
147
|
+
"class": "tiptap-image-upload-progress",
|
|
148
|
+
"style": {
|
|
149
|
+
width: `${props.fileItem.progress}%`
|
|
150
|
+
}
|
|
151
|
+
}, null), (0, import_vue.createVNode)("div", {
|
|
152
|
+
"class": "tiptap-image-upload-preview-content"
|
|
153
|
+
}, [(0, import_vue.createVNode)("div", {
|
|
154
|
+
"class": "tiptap-image-upload-file-info"
|
|
155
|
+
}, [(0, import_vue.createVNode)("div", {
|
|
156
|
+
"class": "tiptap-image-upload-file-icon"
|
|
157
|
+
}, [(0, import_vue.createVNode)(import_icons.CloudUploadIcon, null, null)]), (0, import_vue.createVNode)("div", {
|
|
158
|
+
"class": "tiptap-image-upload-details"
|
|
159
|
+
}, [(0, import_vue.createVNode)("span", {
|
|
160
|
+
"class": "tiptap-image-upload-text"
|
|
161
|
+
}, [props.fileItem.file.name]), (0, import_vue.createVNode)("span", {
|
|
162
|
+
"class": "tiptap-image-upload-subtext"
|
|
163
|
+
}, [formatFileSize(props.fileItem.file.size)])])]), (0, import_vue.createVNode)("div", {
|
|
164
|
+
"class": "tiptap-image-upload-actions"
|
|
165
|
+
}, [props.fileItem.status === "uploading" && (0, import_vue.createVNode)("span", {
|
|
166
|
+
"class": "tiptap-image-upload-progress-text"
|
|
167
|
+
}, [props.fileItem.progress, (0, import_vue.createTextVNode)("%")]), (0, import_vue.createVNode)(import_button.Button, {
|
|
168
|
+
"type": "button",
|
|
169
|
+
"data-style": "ghost",
|
|
170
|
+
"onClick": (e) => {
|
|
171
|
+
e.stopPropagation();
|
|
172
|
+
props.onRemove();
|
|
173
|
+
}
|
|
174
|
+
}, {
|
|
175
|
+
default: () => [(0, import_vue.createVNode)(import_icons.CloseIcon, {
|
|
176
|
+
"class": "tiptap-button-icon"
|
|
177
|
+
}, null)]
|
|
178
|
+
})])])]);
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
const DropZoneContent = (0, import_vue2.defineComponent)({
|
|
182
|
+
name: "DropZoneContent",
|
|
183
|
+
props: {
|
|
184
|
+
maxSize: {
|
|
185
|
+
type: Number,
|
|
186
|
+
required: true
|
|
187
|
+
},
|
|
188
|
+
limit: {
|
|
189
|
+
type: Number,
|
|
190
|
+
required: true
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
render() {
|
|
194
|
+
return (0, import_vue.createVNode)(import_vue.Fragment, null, [(0, import_vue.createVNode)("div", {
|
|
195
|
+
"class": "tiptap-image-upload-dropzone"
|
|
196
|
+
}, [(0, import_vue.createVNode)(import_icons.FileIcon, null, null), (0, import_vue.createVNode)(import_icons.FileCornerIcon, null, null), (0, import_vue.createVNode)("div", {
|
|
197
|
+
"class": "tiptap-image-upload-icon-container"
|
|
198
|
+
}, [(0, import_vue.createVNode)(import_icons.CloudUploadIcon, null, null)])]), (0, import_vue.createVNode)("div", {
|
|
199
|
+
"class": "tiptap-image-upload-content"
|
|
200
|
+
}, [(0, import_vue.createVNode)("span", {
|
|
201
|
+
"class": "tiptap-image-upload-text"
|
|
202
|
+
}, [(0, import_vue.createVNode)("em", null, [(0, import_vue.createTextVNode)("Click to upload")]), (0, import_vue.createTextVNode)(" or drag and drop")]), (0, import_vue.createVNode)("span", {
|
|
203
|
+
"class": "tiptap-image-upload-subtext"
|
|
204
|
+
}, [(0, import_vue.createTextVNode)("Maximum "), this.limit, (0, import_vue.createTextVNode)(" file"), this.limit === 1 ? "" : "s", (0, import_vue.createTextVNode)(", "), this.maxSize / 1024 / 1024, (0, import_vue.createTextVNode)("MB each.")])])]);
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
const ImageUploadNodeView = (0, import_vue2.defineComponent)({
|
|
208
|
+
name: "ImageUploadNodeView",
|
|
209
|
+
props: import_vue_3.nodeViewProps,
|
|
210
|
+
setup(props) {
|
|
211
|
+
const {
|
|
212
|
+
accept,
|
|
213
|
+
limit,
|
|
214
|
+
maxSize
|
|
215
|
+
} = props.node.attrs;
|
|
216
|
+
const inputRef = (0, import_vue2.ref)();
|
|
217
|
+
const extension = props.extension;
|
|
218
|
+
const uploadOptions = {
|
|
219
|
+
maxSize,
|
|
220
|
+
limit,
|
|
221
|
+
accept,
|
|
222
|
+
upload: extension.options.upload,
|
|
223
|
+
onSuccess: extension.options.onSuccess,
|
|
224
|
+
onError: extension.options.onError
|
|
225
|
+
};
|
|
226
|
+
const {
|
|
227
|
+
fileItems,
|
|
228
|
+
uploadFiles,
|
|
229
|
+
removeFileItem,
|
|
230
|
+
clearAllFiles
|
|
231
|
+
} = (0, import_use_file_upload.useFileUpload)(uploadOptions);
|
|
232
|
+
const handleUpload = (files) => __async(this, null, function* () {
|
|
233
|
+
const urls = yield uploadFiles(files);
|
|
234
|
+
if (urls.length > 0) {
|
|
235
|
+
const pos = props.getPos();
|
|
236
|
+
if ((0, import_tiptap_utils.isValidPosition)(pos)) {
|
|
237
|
+
const imageNodes = urls.map((url, index) => {
|
|
238
|
+
var _a;
|
|
239
|
+
const filename = ((_a = files[index]) == null ? void 0 : _a.name.replace(/\.[^/.]+$/, "")) || "unknown";
|
|
240
|
+
return {
|
|
241
|
+
type: extension.options.type,
|
|
242
|
+
attrs: __spreadProps(__spreadValues({}, extension.options), {
|
|
243
|
+
src: url,
|
|
244
|
+
alt: filename,
|
|
245
|
+
title: filename
|
|
246
|
+
})
|
|
247
|
+
};
|
|
248
|
+
});
|
|
249
|
+
props.editor.chain().focus().deleteRange({
|
|
250
|
+
from: pos,
|
|
251
|
+
to: pos + props.node.nodeSize
|
|
252
|
+
}).insertContentAt(pos, imageNodes).run();
|
|
253
|
+
(0, import_tiptap_utils.focusNextNode)(props.editor);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
const handleChange = (e) => {
|
|
258
|
+
var _a, _b;
|
|
259
|
+
const target = e.target;
|
|
260
|
+
const files = target.files;
|
|
261
|
+
if (!files || files.length === 0) {
|
|
262
|
+
(_b = (_a = extension.options).onError) == null ? void 0 : _b.call(_a, new Error("No file selected"));
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
handleUpload(Array.from(files));
|
|
266
|
+
};
|
|
267
|
+
const handleClick = () => {
|
|
268
|
+
if (inputRef.value && fileItems.value.length === 0) {
|
|
269
|
+
inputRef.value.value = "";
|
|
270
|
+
inputRef.value.click();
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
return () => {
|
|
274
|
+
const hasFiles = fileItems.value.length > 0;
|
|
275
|
+
return (0, import_vue.createVNode)(import_vue_3.NodeViewWrapper, {
|
|
276
|
+
"class": "tiptap-image-upload",
|
|
277
|
+
"tabindex": 0,
|
|
278
|
+
"onClick": handleClick
|
|
279
|
+
}, {
|
|
280
|
+
default: () => [!hasFiles && (0, import_vue.createVNode)(ImageUploadDragArea, {
|
|
281
|
+
"onFile": handleUpload
|
|
282
|
+
}, {
|
|
283
|
+
default: () => [(0, import_vue.createVNode)(DropZoneContent, {
|
|
284
|
+
"maxSize": maxSize,
|
|
285
|
+
"limit": limit
|
|
286
|
+
}, null)]
|
|
287
|
+
}), hasFiles && (0, import_vue.createVNode)("div", {
|
|
288
|
+
"class": "tiptap-image-upload-previews"
|
|
289
|
+
}, [fileItems.value.length > 1 && (0, import_vue.createVNode)("div", {
|
|
290
|
+
"class": "tiptap-image-upload-header"
|
|
291
|
+
}, [(0, import_vue.createVNode)("span", null, [(0, import_vue.createTextVNode)("Uploading "), fileItems.value.length, (0, import_vue.createTextVNode)(" files")]), (0, import_vue.createVNode)(import_button.Button, {
|
|
292
|
+
"type": "button",
|
|
293
|
+
"data-style": "ghost",
|
|
294
|
+
"onClick": (e) => {
|
|
295
|
+
e.stopPropagation();
|
|
296
|
+
clearAllFiles();
|
|
297
|
+
}
|
|
298
|
+
}, {
|
|
299
|
+
default: () => [(0, import_vue.createTextVNode)("Clear All")]
|
|
300
|
+
})]), fileItems.value.map((fileItem) => (0, import_vue.createVNode)(ImageUploadPreview, {
|
|
301
|
+
"key": fileItem.id,
|
|
302
|
+
"fileItem": fileItem,
|
|
303
|
+
"onRemove": () => removeFileItem(fileItem.id)
|
|
304
|
+
}, null))]), (0, import_vue.createVNode)("input", {
|
|
305
|
+
"ref": inputRef,
|
|
306
|
+
"name": "file",
|
|
307
|
+
"accept": accept,
|
|
308
|
+
"type": "file",
|
|
309
|
+
"multiple": limit > 1,
|
|
310
|
+
"onChange": handleChange,
|
|
311
|
+
"onClick": (e) => e.stopPropagation()
|
|
312
|
+
}, null)]
|
|
313
|
+
});
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import '../styles/link-popover.less';
|
|
3
|
+
export declare const LinkPopover: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
editor: {
|
|
5
|
+
type: PropType<any>;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
hideWhenUnavailable: {
|
|
9
|
+
type: BooleanConstructor;
|
|
10
|
+
default: boolean;
|
|
11
|
+
};
|
|
12
|
+
className: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
}>, () => import("vue/jsx-runtime").JSX.Element | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
17
|
+
editor: {
|
|
18
|
+
type: PropType<any>;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
hideWhenUnavailable: {
|
|
22
|
+
type: BooleanConstructor;
|
|
23
|
+
default: boolean;
|
|
24
|
+
};
|
|
25
|
+
className: {
|
|
26
|
+
type: StringConstructor;
|
|
27
|
+
default: string;
|
|
28
|
+
};
|
|
29
|
+
}>> & Readonly<{}>, {
|
|
30
|
+
className: string;
|
|
31
|
+
hideWhenUnavailable: boolean;
|
|
32
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|