@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,132 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var stdin_exports = {};
|
|
29
|
+
__export(stdin_exports, {
|
|
30
|
+
createCustomContentExtension: () => createCustomContentExtension
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
33
|
+
var import_extension_mention = __toESM(require("@tiptap/extension-mention"));
|
|
34
|
+
const createCustomContentExtension = () => {
|
|
35
|
+
return import_extension_mention.default.extend({
|
|
36
|
+
name: "customContent",
|
|
37
|
+
parseHTML() {
|
|
38
|
+
return [{ tag: 'span[data-type="custom-content"]' }];
|
|
39
|
+
},
|
|
40
|
+
addAttributes() {
|
|
41
|
+
return {
|
|
42
|
+
id: {
|
|
43
|
+
default: null,
|
|
44
|
+
parseHTML: (element) => element.getAttribute("data-id"),
|
|
45
|
+
renderHTML: (attributes) => {
|
|
46
|
+
if (!attributes.id) {
|
|
47
|
+
return {};
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
"data-id": attributes.id
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
label: {
|
|
55
|
+
default: null,
|
|
56
|
+
parseHTML: (element) => element.getAttribute("file-label"),
|
|
57
|
+
renderHTML: (attributes) => {
|
|
58
|
+
if (!attributes.label) {
|
|
59
|
+
return {};
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
"file-label": attributes.label
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
obj: {
|
|
67
|
+
default: null,
|
|
68
|
+
parseHTML: (element) => {
|
|
69
|
+
const objStr = element.getAttribute("obj");
|
|
70
|
+
try {
|
|
71
|
+
return objStr ? JSON.parse(objStr) : null;
|
|
72
|
+
} catch (e) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
renderHTML: (attributes) => {
|
|
77
|
+
if (!attributes.obj) {
|
|
78
|
+
return {};
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
obj: JSON.stringify(attributes.obj)
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
color: {
|
|
86
|
+
default: null,
|
|
87
|
+
parseHTML: (element) => element.getAttribute("data-color"),
|
|
88
|
+
renderHTML: (attributes) => {
|
|
89
|
+
if (!attributes.color)
|
|
90
|
+
return {};
|
|
91
|
+
return { "data-color": attributes.color };
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
hoverColor: {
|
|
95
|
+
default: null,
|
|
96
|
+
parseHTML: (element) => element.getAttribute("data-hover-color"),
|
|
97
|
+
renderHTML: (attributes) => {
|
|
98
|
+
if (!attributes.hoverColor)
|
|
99
|
+
return {};
|
|
100
|
+
return { "data-hover-color": attributes.hoverColor };
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
},
|
|
105
|
+
renderHTML({ node }) {
|
|
106
|
+
var _a, _b, _c, _d, _e, _f;
|
|
107
|
+
const obj = (_b = (_a = node == null ? void 0 : node.attrs) == null ? void 0 : _a.obj) != null ? _b : {};
|
|
108
|
+
const label = (_d = (_c = node == null ? void 0 : node.attrs) == null ? void 0 : _c.label) != null ? _d : "";
|
|
109
|
+
const color = (_e = node == null ? void 0 : node.attrs) == null ? void 0 : _e.color;
|
|
110
|
+
const hoverColor = (_f = node == null ? void 0 : node.attrs) == null ? void 0 : _f.hoverColor;
|
|
111
|
+
const styleParts = [];
|
|
112
|
+
if (color)
|
|
113
|
+
styleParts.push(`--custom-content-color: ${color}`);
|
|
114
|
+
if (hoverColor)
|
|
115
|
+
styleParts.push(`--custom-content-hover-color: ${hoverColor}`);
|
|
116
|
+
return [
|
|
117
|
+
"span",
|
|
118
|
+
{
|
|
119
|
+
class: "custom-content",
|
|
120
|
+
"data-type": "custom-content",
|
|
121
|
+
obj: JSON.stringify(obj),
|
|
122
|
+
"file-label": label,
|
|
123
|
+
"data-color": color,
|
|
124
|
+
"data-hover-color": hoverColor,
|
|
125
|
+
style: styleParts.length ? styleParts.join(";") : void 0,
|
|
126
|
+
contenteditable: "false"
|
|
127
|
+
},
|
|
128
|
+
label
|
|
129
|
+
];
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface HashTagOptions {
|
|
2
|
+
emit: any;
|
|
3
|
+
imeState: {
|
|
4
|
+
isComposing: boolean;
|
|
5
|
+
};
|
|
6
|
+
editorRef: {
|
|
7
|
+
current: any;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 创建 HashTag 扩展
|
|
12
|
+
* @param options - 配置选项
|
|
13
|
+
* @returns TipTap Extension
|
|
14
|
+
*/
|
|
15
|
+
export declare const createHashTagExtension: (options: HashTagOptions) => import("@tiptap/core").Node<import("@tiptap/extension-mention").MentionOptions<any, import("@tiptap/extension-mention").MentionNodeAttrs>, any>;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var stdin_exports = {};
|
|
29
|
+
__export(stdin_exports, {
|
|
30
|
+
createHashTagExtension: () => createHashTagExtension
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
33
|
+
var import_extension_mention = __toESM(require("@tiptap/extension-mention"));
|
|
34
|
+
var import_triggerHelpers = require("../utils/triggerHelpers");
|
|
35
|
+
const createHashTagExtension = (options) => {
|
|
36
|
+
const { emit, imeState, editorRef } = options;
|
|
37
|
+
return import_extension_mention.default.extend({
|
|
38
|
+
name: "hashTag",
|
|
39
|
+
parseHTML() {
|
|
40
|
+
return [{ tag: 'span[data-type="hashTag"]' }];
|
|
41
|
+
},
|
|
42
|
+
addAttributes() {
|
|
43
|
+
return {
|
|
44
|
+
id: {
|
|
45
|
+
default: null,
|
|
46
|
+
parseHTML: (element) => element.getAttribute("data-id"),
|
|
47
|
+
renderHTML: (attributes) => {
|
|
48
|
+
if (!attributes.id)
|
|
49
|
+
return {};
|
|
50
|
+
return { "data-id": attributes.id };
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
label: {
|
|
54
|
+
default: null,
|
|
55
|
+
parseHTML: (element) => element.getAttribute("data-label"),
|
|
56
|
+
renderHTML: (attributes) => {
|
|
57
|
+
if (!attributes.label)
|
|
58
|
+
return {};
|
|
59
|
+
return { "data-label": attributes.label };
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
type: {
|
|
63
|
+
default: null,
|
|
64
|
+
parseHTML: (element) => element.getAttribute("data-tag-type"),
|
|
65
|
+
renderHTML: (attributes) => {
|
|
66
|
+
if (!attributes.type)
|
|
67
|
+
return {};
|
|
68
|
+
return { "data-tag-type": attributes.type };
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
},
|
|
73
|
+
renderHTML({ node }) {
|
|
74
|
+
var _a, _b, _c, _d, _e, _f;
|
|
75
|
+
const id = (_b = (_a = node == null ? void 0 : node.attrs) == null ? void 0 : _a.id) != null ? _b : "";
|
|
76
|
+
const label = (_d = (_c = node == null ? void 0 : node.attrs) == null ? void 0 : _c.label) != null ? _d : "";
|
|
77
|
+
const type = (_f = (_e = node == null ? void 0 : node.attrs) == null ? void 0 : _e.type) != null ? _f : "";
|
|
78
|
+
return [
|
|
79
|
+
"span",
|
|
80
|
+
{
|
|
81
|
+
class: "hash-tag",
|
|
82
|
+
"data-type": "hashTag",
|
|
83
|
+
"data-id": id,
|
|
84
|
+
"data-label": label,
|
|
85
|
+
"data-tag-type": type,
|
|
86
|
+
"data-hash-tag": "#",
|
|
87
|
+
contenteditable: "false"
|
|
88
|
+
},
|
|
89
|
+
`#${label}`
|
|
90
|
+
];
|
|
91
|
+
}
|
|
92
|
+
}).configure({
|
|
93
|
+
deleteTriggerWithBackspace: true,
|
|
94
|
+
suggestion: {
|
|
95
|
+
char: "#",
|
|
96
|
+
allowedPrefixes: null,
|
|
97
|
+
allowSpaces: false,
|
|
98
|
+
/**
|
|
99
|
+
* allow - 判断是否允许触发建议态
|
|
100
|
+
*/
|
|
101
|
+
allow: ({ state, range }) => {
|
|
102
|
+
if (imeState.isComposing)
|
|
103
|
+
return true;
|
|
104
|
+
return !(0, import_triggerHelpers.checkConsumed)(state, range);
|
|
105
|
+
},
|
|
106
|
+
render() {
|
|
107
|
+
let activeRange = null;
|
|
108
|
+
let exitCause = "unknown";
|
|
109
|
+
return {
|
|
110
|
+
onStart({ editor, range, command, query }) {
|
|
111
|
+
activeRange = range;
|
|
112
|
+
editorRef.current = editor;
|
|
113
|
+
exitCause = "unknown";
|
|
114
|
+
emit("hashTag-triggered", (data) => {
|
|
115
|
+
try {
|
|
116
|
+
(editorRef.current || editor).chain().focus().deleteRange(activeRange || range).insertContentAt((activeRange || range).from, {
|
|
117
|
+
type: "hashTag",
|
|
118
|
+
attrs: { id: data.hashTagId, label: data.name, type: data.type }
|
|
119
|
+
}).setTextSelection((activeRange || range).from + 1).insertContent(" ").run();
|
|
120
|
+
} catch (e) {
|
|
121
|
+
command({ id: data.hashTagId, label: data.name, type: data.type });
|
|
122
|
+
(editorRef.current || editor).chain().focus().insertContent(" ").run();
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
emit("hashTag-input", query != null ? query : "");
|
|
126
|
+
},
|
|
127
|
+
onUpdate({ query, range, editor }) {
|
|
128
|
+
activeRange = range || activeRange;
|
|
129
|
+
editorRef.current = editor || editorRef.current;
|
|
130
|
+
emit("hashTag-input", query != null ? query : "");
|
|
131
|
+
},
|
|
132
|
+
onKeyDown({ event }) {
|
|
133
|
+
if ((0, import_triggerHelpers.isSpaceKey)(event)) {
|
|
134
|
+
exitCause = "space";
|
|
135
|
+
}
|
|
136
|
+
return false;
|
|
137
|
+
},
|
|
138
|
+
onExit({ editor, range }) {
|
|
139
|
+
if (imeState.isComposing) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if ((0, import_triggerHelpers.checkLastCharIsSpace)(editor)) {
|
|
143
|
+
exitCause = "space";
|
|
144
|
+
}
|
|
145
|
+
(0, import_triggerHelpers.markAsConsumed)(editor, range, "#");
|
|
146
|
+
activeRange = null;
|
|
147
|
+
editorRef.current = null;
|
|
148
|
+
emit("hashTag-exit", {
|
|
149
|
+
reason: exitCause,
|
|
150
|
+
nonContiguous: exitCause === "space"
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var stdin_exports = {};
|
|
29
|
+
__export(stdin_exports, {
|
|
30
|
+
HorizontalRule: () => HorizontalRule,
|
|
31
|
+
default: () => stdin_default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
34
|
+
var import_core = require("@tiptap/core");
|
|
35
|
+
var import_extension_horizontal_rule = __toESM(require("@tiptap/extension-horizontal-rule"));
|
|
36
|
+
const HorizontalRule = import_extension_horizontal_rule.default.extend({
|
|
37
|
+
renderHTML() {
|
|
38
|
+
return [
|
|
39
|
+
"div",
|
|
40
|
+
(0, import_core.mergeAttributes)(this.options.HTMLAttributes, { "data-type": this.name }),
|
|
41
|
+
["hr"]
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
var stdin_default = HorizontalRule;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 文件说明:
|
|
3
|
+
* - IME Composition 状态跟踪扩展
|
|
4
|
+
* - 功能:跟踪当前是否处于 IME 输入法组合输入状态(如中文拼音输入)
|
|
5
|
+
* - 作用:防止在 composition 期间误判为输入结束,导致建议提示框过早关闭
|
|
6
|
+
*/
|
|
7
|
+
import { Extension } from '@tiptap/core';
|
|
8
|
+
export interface IMECompositionState {
|
|
9
|
+
isComposing: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 创建 IME Composition 跟踪扩展
|
|
13
|
+
* @param state - 共享状态对象
|
|
14
|
+
* @returns TipTap Extension
|
|
15
|
+
*/
|
|
16
|
+
export declare const createIMECompositionExtension: (state: IMECompositionState) => Extension<any, any>;
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
createIMECompositionExtension: () => createIMECompositionExtension
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
23
|
+
var import_core = require("@tiptap/core");
|
|
24
|
+
var import_state = require("@tiptap/pm/state");
|
|
25
|
+
const createIMECompositionExtension = (state) => {
|
|
26
|
+
return import_core.Extension.create({
|
|
27
|
+
name: "imeCompositionTracker",
|
|
28
|
+
addProseMirrorPlugins() {
|
|
29
|
+
return [
|
|
30
|
+
new import_state.Plugin({
|
|
31
|
+
props: {
|
|
32
|
+
handleDOMEvents: {
|
|
33
|
+
compositionstart: () => {
|
|
34
|
+
state.isComposing = true;
|
|
35
|
+
return false;
|
|
36
|
+
},
|
|
37
|
+
compositionend: () => {
|
|
38
|
+
setTimeout(() => {
|
|
39
|
+
state.isComposing = false;
|
|
40
|
+
}, 10);
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Node } from '@tiptap/vue-3';
|
|
2
|
+
import type { NodeType } from '@tiptap/pm/model';
|
|
3
|
+
export type UploadFunction = (file: File, onProgress?: (event: {
|
|
4
|
+
progress: number;
|
|
5
|
+
}) => void, abortSignal?: AbortSignal) => Promise<string>;
|
|
6
|
+
export interface ImageUploadNodeOptions {
|
|
7
|
+
/**
|
|
8
|
+
* The type of the node.
|
|
9
|
+
* @default 'image'
|
|
10
|
+
*/
|
|
11
|
+
type?: string | NodeType | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Acceptable file types for upload.
|
|
14
|
+
* @default 'image/*'
|
|
15
|
+
*/
|
|
16
|
+
accept?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Maximum number of files that can be uploaded.
|
|
19
|
+
* @default 1
|
|
20
|
+
*/
|
|
21
|
+
limit?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Maximum file size in bytes (0 for unlimited).
|
|
24
|
+
* @default 0
|
|
25
|
+
*/
|
|
26
|
+
maxSize?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Function to handle the upload process.
|
|
29
|
+
*/
|
|
30
|
+
upload?: UploadFunction;
|
|
31
|
+
/**
|
|
32
|
+
* Callback for upload errors.
|
|
33
|
+
*/
|
|
34
|
+
onError?: (error: Error) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Callback for successful uploads.
|
|
37
|
+
*/
|
|
38
|
+
onSuccess?: (url: string) => void;
|
|
39
|
+
/**
|
|
40
|
+
* HTML attributes to add to the image element.
|
|
41
|
+
* @default {}
|
|
42
|
+
*/
|
|
43
|
+
HTMLAttributes: Record<string, any>;
|
|
44
|
+
}
|
|
45
|
+
declare module '@tiptap/core' {
|
|
46
|
+
interface Commands<ReturnType> {
|
|
47
|
+
imageUpload: {
|
|
48
|
+
setImageUploadNode: (options?: Partial<ImageUploadNodeOptions>) => ReturnType;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* A Tiptap node extension that creates an image upload component.
|
|
54
|
+
*/
|
|
55
|
+
export declare const ImageUpload: Node<ImageUploadNodeOptions, any>;
|
|
56
|
+
export default ImageUpload;
|
|
@@ -0,0 +1,99 @@
|
|
|
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
|
+
ImageUpload: () => ImageUpload,
|
|
21
|
+
default: () => stdin_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
24
|
+
var import_vue_3 = require("@tiptap/vue-3");
|
|
25
|
+
var import_image_upload_node = require("../menu-system/components/image-upload-node");
|
|
26
|
+
const ImageUpload = import_vue_3.Node.create({
|
|
27
|
+
name: "imageUpload",
|
|
28
|
+
group: "block",
|
|
29
|
+
draggable: true,
|
|
30
|
+
selectable: true,
|
|
31
|
+
atom: true,
|
|
32
|
+
addOptions() {
|
|
33
|
+
return {
|
|
34
|
+
type: "image",
|
|
35
|
+
accept: "image/*",
|
|
36
|
+
limit: 1,
|
|
37
|
+
maxSize: 0,
|
|
38
|
+
upload: void 0,
|
|
39
|
+
onError: void 0,
|
|
40
|
+
onSuccess: void 0,
|
|
41
|
+
HTMLAttributes: {}
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
addAttributes() {
|
|
45
|
+
return {
|
|
46
|
+
accept: {
|
|
47
|
+
default: this.options.accept
|
|
48
|
+
},
|
|
49
|
+
limit: {
|
|
50
|
+
default: this.options.limit
|
|
51
|
+
},
|
|
52
|
+
maxSize: {
|
|
53
|
+
default: this.options.maxSize
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
parseHTML() {
|
|
58
|
+
return [{ tag: 'div[data-type="image-upload"]' }];
|
|
59
|
+
},
|
|
60
|
+
renderHTML({ HTMLAttributes }) {
|
|
61
|
+
return ["div", (0, import_vue_3.mergeAttributes)({ "data-type": "image-upload" }, HTMLAttributes)];
|
|
62
|
+
},
|
|
63
|
+
addNodeView() {
|
|
64
|
+
return (0, import_vue_3.VueNodeViewRenderer)(import_image_upload_node.ImageUploadNodeView);
|
|
65
|
+
},
|
|
66
|
+
addCommands() {
|
|
67
|
+
return {
|
|
68
|
+
setImageUploadNode: (options) => ({ commands }) => {
|
|
69
|
+
return commands.insertContent({
|
|
70
|
+
type: this.name,
|
|
71
|
+
attrs: options
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
/**
|
|
77
|
+
* Adds Enter key handler to trigger the upload component when it's selected.
|
|
78
|
+
*/
|
|
79
|
+
addKeyboardShortcuts() {
|
|
80
|
+
return {
|
|
81
|
+
Enter: ({ editor }) => {
|
|
82
|
+
const { selection } = editor.state;
|
|
83
|
+
const { nodeAfter } = selection.$from;
|
|
84
|
+
if (nodeAfter && nodeAfter.type.name === "imageUpload" && editor.isActive("imageUpload")) {
|
|
85
|
+
const nodeEl = editor.view.nodeDOM(selection.$from.pos);
|
|
86
|
+
if (nodeEl && nodeEl instanceof HTMLElement) {
|
|
87
|
+
const firstChild = nodeEl.firstChild;
|
|
88
|
+
if (firstChild && firstChild instanceof HTMLElement) {
|
|
89
|
+
firstChild.click();
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
var stdin_default = ImageUpload;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 文件说明:
|
|
3
|
+
* - Markdown 相关扩展
|
|
4
|
+
* - 包括 Markdown 解析器和链接输入规则
|
|
5
|
+
*/
|
|
6
|
+
import { Extension } from '@tiptap/core';
|
|
7
|
+
/**
|
|
8
|
+
* Markdown 解析器配置
|
|
9
|
+
*/
|
|
10
|
+
export declare const MarkdownExtension: Extension<import("tiptap-markdown").MarkdownOptions, import("tiptap-markdown").MarkdownStorage>;
|
|
11
|
+
/**
|
|
12
|
+
* Markdown 链接输入规则扩展
|
|
13
|
+
* 语法:[text](url) + 空格
|
|
14
|
+
*/
|
|
15
|
+
export declare const MarkdownLinkInputRule: Extension<any, any>;
|
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
MarkdownExtension: () => MarkdownExtension,
|
|
21
|
+
MarkdownLinkInputRule: () => MarkdownLinkInputRule
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
24
|
+
var import_core = require("@tiptap/core");
|
|
25
|
+
var import_tiptap_markdown = require("tiptap-markdown");
|
|
26
|
+
const MarkdownExtension = import_tiptap_markdown.Markdown.configure({
|
|
27
|
+
html: true,
|
|
28
|
+
tightLists: true,
|
|
29
|
+
tightListClass: "tight",
|
|
30
|
+
bulletListMarker: "-",
|
|
31
|
+
linkify: true,
|
|
32
|
+
breaks: false,
|
|
33
|
+
transformPastedText: true,
|
|
34
|
+
transformCopiedText: true
|
|
35
|
+
});
|
|
36
|
+
const MarkdownLinkInputRule = import_core.Extension.create({
|
|
37
|
+
name: "markdownLinkInputRule",
|
|
38
|
+
addInputRules() {
|
|
39
|
+
return [
|
|
40
|
+
new import_core.InputRule({
|
|
41
|
+
find: /\[([^\]]+)\]\(([^\)]+)\)\s/,
|
|
42
|
+
handler: ({ range, match, commands }) => {
|
|
43
|
+
const [, text, href] = match;
|
|
44
|
+
commands.deleteRange({ from: range.from, to: range.to });
|
|
45
|
+
commands.insertContent({
|
|
46
|
+
type: "text",
|
|
47
|
+
text,
|
|
48
|
+
marks: [{ type: "link", attrs: { href } }]
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
];
|
|
53
|
+
}
|
|
54
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 文件说明:
|
|
3
|
+
* - 媒体输入规则扩展(视频和音频)
|
|
4
|
+
* - 支持通过特定语法快速插入视频和音频元素
|
|
5
|
+
* - 语法:!video(url) 和 !audio(url)
|
|
6
|
+
*/
|
|
7
|
+
import { Extension } from '@tiptap/core';
|
|
8
|
+
/**
|
|
9
|
+
* 视频输入规则扩展
|
|
10
|
+
* 语法:!video(url) + 空格
|
|
11
|
+
*/
|
|
12
|
+
export declare const VideoInputRule: Extension<any, any>;
|
|
13
|
+
/**
|
|
14
|
+
* 音频输入规则扩展
|
|
15
|
+
* 语法:!audio(url) + 空格
|
|
16
|
+
*/
|
|
17
|
+
export declare const AudioInputRule: Extension<any, any>;
|