@cgboiler/biz-basic 1.0.52 → 1.0.54
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 +88 -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 -391
- 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 +88 -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 -392
- 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,41 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import { type ListType } from '../hooks/use-list';
|
|
3
|
+
export declare const ListDropdownMenu: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
editor: {
|
|
5
|
+
type: PropType<any>;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
types: {
|
|
9
|
+
type: PropType<ListType[]>;
|
|
10
|
+
default: () => string[];
|
|
11
|
+
};
|
|
12
|
+
hideWhenUnavailable: {
|
|
13
|
+
type: BooleanConstructor;
|
|
14
|
+
default: boolean;
|
|
15
|
+
};
|
|
16
|
+
className: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
default: string;
|
|
19
|
+
};
|
|
20
|
+
}>, () => import("vue/jsx-runtime").JSX.Element | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
21
|
+
editor: {
|
|
22
|
+
type: PropType<any>;
|
|
23
|
+
required: true;
|
|
24
|
+
};
|
|
25
|
+
types: {
|
|
26
|
+
type: PropType<ListType[]>;
|
|
27
|
+
default: () => string[];
|
|
28
|
+
};
|
|
29
|
+
hideWhenUnavailable: {
|
|
30
|
+
type: BooleanConstructor;
|
|
31
|
+
default: boolean;
|
|
32
|
+
};
|
|
33
|
+
className: {
|
|
34
|
+
type: StringConstructor;
|
|
35
|
+
default: string;
|
|
36
|
+
};
|
|
37
|
+
}>> & Readonly<{}>, {
|
|
38
|
+
className: string;
|
|
39
|
+
types: ListType[];
|
|
40
|
+
hideWhenUnavailable: boolean;
|
|
41
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
|
|
2
|
+
import "./_atomic.css";
|
|
3
|
+
import { defineComponent } from "vue";
|
|
4
|
+
import { useListDropdownMenu } from "../hooks/use-list-dropdown-menu";
|
|
5
|
+
import { toggleList } from "../hooks/use-list";
|
|
6
|
+
import { Button } from "../primitives/button";
|
|
7
|
+
import { cn } from "../utils/tiptap-utils";
|
|
8
|
+
import { ElDropdown, ElDropdownMenu, ElDropdownItem } from "element-plus";
|
|
9
|
+
import { ChevronDownIcon } from "../icons";
|
|
10
|
+
const ListDropdownMenu = defineComponent({
|
|
11
|
+
name: "ListDropdownMenu",
|
|
12
|
+
props: {
|
|
13
|
+
editor: {
|
|
14
|
+
type: Object,
|
|
15
|
+
required: true
|
|
16
|
+
},
|
|
17
|
+
types: {
|
|
18
|
+
type: Array,
|
|
19
|
+
default: () => ["bulletList", "orderedList", "taskList"]
|
|
20
|
+
},
|
|
21
|
+
hideWhenUnavailable: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: false
|
|
24
|
+
},
|
|
25
|
+
className: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: ""
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
setup(props, {
|
|
31
|
+
attrs
|
|
32
|
+
}) {
|
|
33
|
+
const {
|
|
34
|
+
isVisible,
|
|
35
|
+
activeType,
|
|
36
|
+
isActive,
|
|
37
|
+
canToggle,
|
|
38
|
+
filteredLists,
|
|
39
|
+
label,
|
|
40
|
+
Icon
|
|
41
|
+
} = useListDropdownMenu({
|
|
42
|
+
editor: props.editor,
|
|
43
|
+
types: props.types,
|
|
44
|
+
hideWhenUnavailable: props.hideWhenUnavailable
|
|
45
|
+
});
|
|
46
|
+
const handleListSelect = (type) => {
|
|
47
|
+
const editor = props.editor && "value" in props.editor ? props.editor.value : props.editor;
|
|
48
|
+
toggleList(editor, type);
|
|
49
|
+
};
|
|
50
|
+
return () => {
|
|
51
|
+
if (!isVisible.value)
|
|
52
|
+
return null;
|
|
53
|
+
const trigger = _createVNode(Button, _mergeProps({
|
|
54
|
+
"type": "button",
|
|
55
|
+
"disabled": !canToggle.value,
|
|
56
|
+
"data-style": "ghost",
|
|
57
|
+
"data-active-state": isActive.value ? "on" : "off",
|
|
58
|
+
"data-disabled": !canToggle.value,
|
|
59
|
+
"role": "button",
|
|
60
|
+
"tooltip": label,
|
|
61
|
+
"class": cn(props.className, "tiptap-list-dropdown-trigger")
|
|
62
|
+
}, attrs), {
|
|
63
|
+
default: () => [_createVNode(Icon.value, {
|
|
64
|
+
"class": "tiptap-button-icon"
|
|
65
|
+
}, null), _createVNode(ChevronDownIcon, {
|
|
66
|
+
"class": "tiptap-button-icon-chevron"
|
|
67
|
+
}, null)]
|
|
68
|
+
});
|
|
69
|
+
return _createVNode(ElDropdown, {
|
|
70
|
+
"trigger": "click",
|
|
71
|
+
"onCommand": handleListSelect,
|
|
72
|
+
"popper-class": "tiptap-dropdown-menu"
|
|
73
|
+
}, {
|
|
74
|
+
default: () => trigger,
|
|
75
|
+
dropdown: () => _createVNode(ElDropdownMenu, null, {
|
|
76
|
+
default: () => [filteredLists.map((option) => {
|
|
77
|
+
const ListOptionIcon = option.icon;
|
|
78
|
+
return _createVNode(ElDropdownItem, {
|
|
79
|
+
"key": option.type,
|
|
80
|
+
"command": option.type,
|
|
81
|
+
"class": cn(activeType.value === option.type && "is-active")
|
|
82
|
+
}, {
|
|
83
|
+
default: () => [_createVNode("div", {
|
|
84
|
+
"class": "tiptap-dropdown-menu-item-content"
|
|
85
|
+
}, [_createVNode(ListOptionIcon, {
|
|
86
|
+
"class": "tiptap-dropdown-menu-item-icon"
|
|
87
|
+
}, null), _createVNode("span", null, [option.label])])]
|
|
88
|
+
});
|
|
89
|
+
})]
|
|
90
|
+
})
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
export {
|
|
96
|
+
ListDropdownMenu
|
|
97
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import { type Mark } from '../hooks/use-mark';
|
|
3
|
+
export declare const MarkButton: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
editor: {
|
|
5
|
+
type: PropType<any>;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
type: {
|
|
9
|
+
type: PropType<Mark>;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
text: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
hideWhenUnavailable: {
|
|
17
|
+
type: BooleanConstructor;
|
|
18
|
+
default: boolean;
|
|
19
|
+
};
|
|
20
|
+
showShortcut: {
|
|
21
|
+
type: BooleanConstructor;
|
|
22
|
+
default: boolean;
|
|
23
|
+
};
|
|
24
|
+
className: {
|
|
25
|
+
type: StringConstructor;
|
|
26
|
+
default: string;
|
|
27
|
+
};
|
|
28
|
+
}>, () => import("vue/jsx-runtime").JSX.Element | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
29
|
+
editor: {
|
|
30
|
+
type: PropType<any>;
|
|
31
|
+
required: true;
|
|
32
|
+
};
|
|
33
|
+
type: {
|
|
34
|
+
type: PropType<Mark>;
|
|
35
|
+
required: true;
|
|
36
|
+
};
|
|
37
|
+
text: {
|
|
38
|
+
type: StringConstructor;
|
|
39
|
+
default: string;
|
|
40
|
+
};
|
|
41
|
+
hideWhenUnavailable: {
|
|
42
|
+
type: BooleanConstructor;
|
|
43
|
+
default: boolean;
|
|
44
|
+
};
|
|
45
|
+
showShortcut: {
|
|
46
|
+
type: BooleanConstructor;
|
|
47
|
+
default: boolean;
|
|
48
|
+
};
|
|
49
|
+
className: {
|
|
50
|
+
type: StringConstructor;
|
|
51
|
+
default: string;
|
|
52
|
+
};
|
|
53
|
+
}>> & Readonly<{}>, {
|
|
54
|
+
text: string;
|
|
55
|
+
className: string;
|
|
56
|
+
hideWhenUnavailable: boolean;
|
|
57
|
+
showShortcut: boolean;
|
|
58
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Fragment as _Fragment, createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
|
|
2
|
+
import "./_atomic.css";
|
|
3
|
+
import { defineComponent } from "vue";
|
|
4
|
+
import { useMark } from "../hooks/use-mark";
|
|
5
|
+
import { Button } from "../primitives/button";
|
|
6
|
+
import { cn } from "../utils/tiptap-utils";
|
|
7
|
+
const MarkButton = defineComponent({
|
|
8
|
+
name: "MarkButton",
|
|
9
|
+
props: {
|
|
10
|
+
editor: {
|
|
11
|
+
type: Object,
|
|
12
|
+
required: true
|
|
13
|
+
},
|
|
14
|
+
type: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true
|
|
17
|
+
},
|
|
18
|
+
text: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: ""
|
|
21
|
+
},
|
|
22
|
+
hideWhenUnavailable: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
26
|
+
showShortcut: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: false
|
|
29
|
+
},
|
|
30
|
+
className: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: ""
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
setup(props, {
|
|
36
|
+
slots,
|
|
37
|
+
attrs
|
|
38
|
+
}) {
|
|
39
|
+
const {
|
|
40
|
+
isVisible,
|
|
41
|
+
handleMark,
|
|
42
|
+
label,
|
|
43
|
+
canToggle,
|
|
44
|
+
isActive,
|
|
45
|
+
Icon,
|
|
46
|
+
shortcutKeys
|
|
47
|
+
} = useMark({
|
|
48
|
+
editor: props.editor,
|
|
49
|
+
type: props.type,
|
|
50
|
+
hideWhenUnavailable: props.hideWhenUnavailable
|
|
51
|
+
});
|
|
52
|
+
return () => {
|
|
53
|
+
if (!isVisible.value)
|
|
54
|
+
return null;
|
|
55
|
+
return _createVNode(Button, _mergeProps({
|
|
56
|
+
"type": "button",
|
|
57
|
+
"disabled": !canToggle.value,
|
|
58
|
+
"data-style": "ghost",
|
|
59
|
+
"data-active-state": isActive.value ? "on" : "off",
|
|
60
|
+
"data-disabled": !canToggle.value,
|
|
61
|
+
"role": "button",
|
|
62
|
+
"tabindex": -1,
|
|
63
|
+
"aria-label": label,
|
|
64
|
+
"aria-pressed": isActive.value,
|
|
65
|
+
"tooltip": label,
|
|
66
|
+
"onClick": handleMark,
|
|
67
|
+
"class": cn(props.className)
|
|
68
|
+
}, attrs), {
|
|
69
|
+
default: () => [slots.default ? slots.default() : _createVNode(_Fragment, null, [_createVNode(Icon, {
|
|
70
|
+
"class": "tiptap-button-icon"
|
|
71
|
+
}, null), props.text && _createVNode("span", {
|
|
72
|
+
"class": "tiptap-button-text"
|
|
73
|
+
}, [props.text])])]
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
export {
|
|
79
|
+
MarkButton
|
|
80
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import { type TextAlign } from '../hooks/use-text-align';
|
|
3
|
+
export declare const TextAlignButton: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
editor: {
|
|
5
|
+
type: PropType<any>;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
align: {
|
|
9
|
+
type: PropType<TextAlign>;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
text: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
hideWhenUnavailable: {
|
|
17
|
+
type: BooleanConstructor;
|
|
18
|
+
default: boolean;
|
|
19
|
+
};
|
|
20
|
+
showShortcut: {
|
|
21
|
+
type: BooleanConstructor;
|
|
22
|
+
default: boolean;
|
|
23
|
+
};
|
|
24
|
+
className: {
|
|
25
|
+
type: StringConstructor;
|
|
26
|
+
default: string;
|
|
27
|
+
};
|
|
28
|
+
}>, () => import("vue/jsx-runtime").JSX.Element | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
29
|
+
editor: {
|
|
30
|
+
type: PropType<any>;
|
|
31
|
+
required: true;
|
|
32
|
+
};
|
|
33
|
+
align: {
|
|
34
|
+
type: PropType<TextAlign>;
|
|
35
|
+
required: true;
|
|
36
|
+
};
|
|
37
|
+
text: {
|
|
38
|
+
type: StringConstructor;
|
|
39
|
+
default: string;
|
|
40
|
+
};
|
|
41
|
+
hideWhenUnavailable: {
|
|
42
|
+
type: BooleanConstructor;
|
|
43
|
+
default: boolean;
|
|
44
|
+
};
|
|
45
|
+
showShortcut: {
|
|
46
|
+
type: BooleanConstructor;
|
|
47
|
+
default: boolean;
|
|
48
|
+
};
|
|
49
|
+
className: {
|
|
50
|
+
type: StringConstructor;
|
|
51
|
+
default: string;
|
|
52
|
+
};
|
|
53
|
+
}>> & Readonly<{}>, {
|
|
54
|
+
text: string;
|
|
55
|
+
className: string;
|
|
56
|
+
hideWhenUnavailable: boolean;
|
|
57
|
+
showShortcut: boolean;
|
|
58
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Fragment as _Fragment, createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
|
|
2
|
+
import "./_atomic.css";
|
|
3
|
+
import { defineComponent } from "vue";
|
|
4
|
+
import { useTextAlign } from "../hooks/use-text-align";
|
|
5
|
+
import { Button } from "../primitives/button";
|
|
6
|
+
import { cn } from "../utils/tiptap-utils";
|
|
7
|
+
const TextAlignButton = defineComponent({
|
|
8
|
+
name: "TextAlignButton",
|
|
9
|
+
props: {
|
|
10
|
+
editor: {
|
|
11
|
+
type: Object,
|
|
12
|
+
required: true
|
|
13
|
+
},
|
|
14
|
+
align: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true
|
|
17
|
+
},
|
|
18
|
+
text: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: ""
|
|
21
|
+
},
|
|
22
|
+
hideWhenUnavailable: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
26
|
+
showShortcut: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: false
|
|
29
|
+
},
|
|
30
|
+
className: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: ""
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
setup(props, {
|
|
36
|
+
slots,
|
|
37
|
+
attrs
|
|
38
|
+
}) {
|
|
39
|
+
const {
|
|
40
|
+
isVisible,
|
|
41
|
+
handleTextAlign,
|
|
42
|
+
label,
|
|
43
|
+
canAlign,
|
|
44
|
+
isActive,
|
|
45
|
+
Icon,
|
|
46
|
+
shortcutKeys
|
|
47
|
+
} = useTextAlign({
|
|
48
|
+
editor: props.editor,
|
|
49
|
+
align: props.align,
|
|
50
|
+
hideWhenUnavailable: props.hideWhenUnavailable
|
|
51
|
+
});
|
|
52
|
+
return () => {
|
|
53
|
+
if (!isVisible.value)
|
|
54
|
+
return null;
|
|
55
|
+
return _createVNode(Button, _mergeProps({
|
|
56
|
+
"type": "button",
|
|
57
|
+
"disabled": !canAlign.value,
|
|
58
|
+
"data-style": "ghost",
|
|
59
|
+
"data-active-state": isActive.value ? "on" : "off",
|
|
60
|
+
"data-disabled": !canAlign.value,
|
|
61
|
+
"role": "button",
|
|
62
|
+
"tabindex": -1,
|
|
63
|
+
"aria-label": label,
|
|
64
|
+
"aria-pressed": isActive.value,
|
|
65
|
+
"tooltip": label,
|
|
66
|
+
"onClick": handleTextAlign,
|
|
67
|
+
"class": cn(props.className)
|
|
68
|
+
}, attrs), {
|
|
69
|
+
default: () => [slots.default ? slots.default() : _createVNode(_Fragment, null, [_createVNode(Icon, {
|
|
70
|
+
"class": "tiptap-button-icon"
|
|
71
|
+
}, null), props.text && _createVNode("span", {
|
|
72
|
+
"class": "tiptap-button-text"
|
|
73
|
+
}, [props.text])])]
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
export {
|
|
79
|
+
TextAlignButton
|
|
80
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import { type UndoRedoAction } from '../hooks/use-undo-redo';
|
|
3
|
+
export declare const UndoRedoButton: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
editor: {
|
|
5
|
+
type: PropType<any>;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
action: {
|
|
9
|
+
type: PropType<UndoRedoAction>;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
text: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
hideWhenUnavailable: {
|
|
17
|
+
type: BooleanConstructor;
|
|
18
|
+
default: boolean;
|
|
19
|
+
};
|
|
20
|
+
showShortcut: {
|
|
21
|
+
type: BooleanConstructor;
|
|
22
|
+
default: boolean;
|
|
23
|
+
};
|
|
24
|
+
className: {
|
|
25
|
+
type: StringConstructor;
|
|
26
|
+
default: string;
|
|
27
|
+
};
|
|
28
|
+
}>, () => import("vue/jsx-runtime").JSX.Element | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
29
|
+
editor: {
|
|
30
|
+
type: PropType<any>;
|
|
31
|
+
required: true;
|
|
32
|
+
};
|
|
33
|
+
action: {
|
|
34
|
+
type: PropType<UndoRedoAction>;
|
|
35
|
+
required: true;
|
|
36
|
+
};
|
|
37
|
+
text: {
|
|
38
|
+
type: StringConstructor;
|
|
39
|
+
default: string;
|
|
40
|
+
};
|
|
41
|
+
hideWhenUnavailable: {
|
|
42
|
+
type: BooleanConstructor;
|
|
43
|
+
default: boolean;
|
|
44
|
+
};
|
|
45
|
+
showShortcut: {
|
|
46
|
+
type: BooleanConstructor;
|
|
47
|
+
default: boolean;
|
|
48
|
+
};
|
|
49
|
+
className: {
|
|
50
|
+
type: StringConstructor;
|
|
51
|
+
default: string;
|
|
52
|
+
};
|
|
53
|
+
}>> & Readonly<{}>, {
|
|
54
|
+
text: string;
|
|
55
|
+
className: string;
|
|
56
|
+
hideWhenUnavailable: boolean;
|
|
57
|
+
showShortcut: boolean;
|
|
58
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Fragment as _Fragment, createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
|
|
2
|
+
import "./_atomic.css";
|
|
3
|
+
import { defineComponent } from "vue";
|
|
4
|
+
import { useUndoRedo } from "../hooks/use-undo-redo";
|
|
5
|
+
import { Button } from "../primitives/button";
|
|
6
|
+
import { cn } from "../utils/tiptap-utils";
|
|
7
|
+
const UndoRedoButton = defineComponent({
|
|
8
|
+
name: "UndoRedoButton",
|
|
9
|
+
props: {
|
|
10
|
+
editor: {
|
|
11
|
+
type: Object,
|
|
12
|
+
required: true
|
|
13
|
+
},
|
|
14
|
+
action: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true
|
|
17
|
+
},
|
|
18
|
+
text: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: ""
|
|
21
|
+
},
|
|
22
|
+
hideWhenUnavailable: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
26
|
+
showShortcut: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: false
|
|
29
|
+
},
|
|
30
|
+
className: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: ""
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
setup(props, {
|
|
36
|
+
slots,
|
|
37
|
+
attrs
|
|
38
|
+
}) {
|
|
39
|
+
const {
|
|
40
|
+
isVisible,
|
|
41
|
+
handleAction,
|
|
42
|
+
label,
|
|
43
|
+
canExecute,
|
|
44
|
+
Icon,
|
|
45
|
+
shortcutKeys
|
|
46
|
+
} = useUndoRedo({
|
|
47
|
+
editor: props.editor,
|
|
48
|
+
action: props.action,
|
|
49
|
+
hideWhenUnavailable: props.hideWhenUnavailable
|
|
50
|
+
});
|
|
51
|
+
return () => {
|
|
52
|
+
if (!isVisible.value)
|
|
53
|
+
return null;
|
|
54
|
+
return _createVNode(Button, _mergeProps({
|
|
55
|
+
"type": "button",
|
|
56
|
+
"disabled": !canExecute.value,
|
|
57
|
+
"data-style": "ghost",
|
|
58
|
+
"data-disabled": !canExecute.value,
|
|
59
|
+
"role": "button",
|
|
60
|
+
"tabindex": -1,
|
|
61
|
+
"aria-label": label,
|
|
62
|
+
"tooltip": label,
|
|
63
|
+
"onClick": handleAction,
|
|
64
|
+
"class": cn(props.className)
|
|
65
|
+
}, attrs), {
|
|
66
|
+
default: () => [slots.default ? slots.default() : _createVNode(_Fragment, null, [_createVNode(Icon, {
|
|
67
|
+
"class": "tiptap-button-icon"
|
|
68
|
+
}, null), props.text && _createVNode("span", {
|
|
69
|
+
"class": "tiptap-button-text"
|
|
70
|
+
}, [props.text])])]
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
export {
|
|
76
|
+
UndoRedoButton
|
|
77
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/vue-3';
|
|
2
|
+
export declare const BLOCKQUOTE_SHORTCUT_KEY = "mod+shift+b";
|
|
3
|
+
export interface UseBlockquoteConfig {
|
|
4
|
+
editor: any;
|
|
5
|
+
hideWhenUnavailable?: boolean;
|
|
6
|
+
onToggled?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function canToggleBlockquote(editor: Editor | null, turnInto?: boolean): boolean;
|
|
9
|
+
export declare function toggleBlockquote(editor: Editor | null): boolean;
|
|
10
|
+
export declare function shouldShowButton(props: {
|
|
11
|
+
editor: Editor | null;
|
|
12
|
+
hideWhenUnavailable: boolean;
|
|
13
|
+
}): boolean;
|
|
14
|
+
export declare function useBlockquote(config: UseBlockquoteConfig): {
|
|
15
|
+
isVisible: import("vue").Ref<boolean, boolean>;
|
|
16
|
+
isActive: import("vue").Ref<boolean, boolean>;
|
|
17
|
+
handleToggle: () => void;
|
|
18
|
+
canToggle: import("vue").Ref<boolean, boolean>;
|
|
19
|
+
label: string;
|
|
20
|
+
shortcutKeys: string;
|
|
21
|
+
Icon: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
22
|
+
className: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
27
|
+
className: {
|
|
28
|
+
type: StringConstructor;
|
|
29
|
+
default: string;
|
|
30
|
+
};
|
|
31
|
+
}>> & Readonly<{}>, {
|
|
32
|
+
className: string;
|
|
33
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
34
|
+
};
|