@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,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
|
+
TextAlignButton: () => TextAlignButton
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
23
|
+
var import_vue = require("vue");
|
|
24
|
+
var import_atomic = require("./_atomic.css");
|
|
25
|
+
var import_vue2 = require("vue");
|
|
26
|
+
var import_use_text_align = require("../hooks/use-text-align");
|
|
27
|
+
var import_button = require("../primitives/button");
|
|
28
|
+
var import_tiptap_utils = require("../utils/tiptap-utils");
|
|
29
|
+
const TextAlignButton = (0, import_vue2.defineComponent)({
|
|
30
|
+
name: "TextAlignButton",
|
|
31
|
+
props: {
|
|
32
|
+
editor: {
|
|
33
|
+
type: Object,
|
|
34
|
+
required: true
|
|
35
|
+
},
|
|
36
|
+
align: {
|
|
37
|
+
type: String,
|
|
38
|
+
required: true
|
|
39
|
+
},
|
|
40
|
+
text: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: ""
|
|
43
|
+
},
|
|
44
|
+
hideWhenUnavailable: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: false
|
|
47
|
+
},
|
|
48
|
+
showShortcut: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: false
|
|
51
|
+
},
|
|
52
|
+
className: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: ""
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
setup(props, {
|
|
58
|
+
slots,
|
|
59
|
+
attrs
|
|
60
|
+
}) {
|
|
61
|
+
const {
|
|
62
|
+
isVisible,
|
|
63
|
+
handleTextAlign,
|
|
64
|
+
label,
|
|
65
|
+
canAlign,
|
|
66
|
+
isActive,
|
|
67
|
+
Icon,
|
|
68
|
+
shortcutKeys
|
|
69
|
+
} = (0, import_use_text_align.useTextAlign)({
|
|
70
|
+
editor: props.editor,
|
|
71
|
+
align: props.align,
|
|
72
|
+
hideWhenUnavailable: props.hideWhenUnavailable
|
|
73
|
+
});
|
|
74
|
+
return () => {
|
|
75
|
+
if (!isVisible.value)
|
|
76
|
+
return null;
|
|
77
|
+
return (0, import_vue.createVNode)(import_button.Button, (0, import_vue.mergeProps)({
|
|
78
|
+
"type": "button",
|
|
79
|
+
"disabled": !canAlign.value,
|
|
80
|
+
"data-style": "ghost",
|
|
81
|
+
"data-active-state": isActive.value ? "on" : "off",
|
|
82
|
+
"data-disabled": !canAlign.value,
|
|
83
|
+
"role": "button",
|
|
84
|
+
"tabindex": -1,
|
|
85
|
+
"aria-label": label,
|
|
86
|
+
"aria-pressed": isActive.value,
|
|
87
|
+
"tooltip": label,
|
|
88
|
+
"onClick": handleTextAlign,
|
|
89
|
+
"class": (0, import_tiptap_utils.cn)(props.className)
|
|
90
|
+
}, attrs), {
|
|
91
|
+
default: () => [slots.default ? slots.default() : (0, import_vue.createVNode)(import_vue.Fragment, null, [(0, import_vue.createVNode)(Icon, {
|
|
92
|
+
"class": "tiptap-button-icon"
|
|
93
|
+
}, null), props.text && (0, import_vue.createVNode)("span", {
|
|
94
|
+
"class": "tiptap-button-text"
|
|
95
|
+
}, [props.text])])]
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
});
|
|
@@ -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,96 @@
|
|
|
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
|
+
UndoRedoButton: () => UndoRedoButton
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
23
|
+
var import_vue = require("vue");
|
|
24
|
+
var import_atomic = require("./_atomic.css");
|
|
25
|
+
var import_vue2 = require("vue");
|
|
26
|
+
var import_use_undo_redo = require("../hooks/use-undo-redo");
|
|
27
|
+
var import_button = require("../primitives/button");
|
|
28
|
+
var import_tiptap_utils = require("../utils/tiptap-utils");
|
|
29
|
+
const UndoRedoButton = (0, import_vue2.defineComponent)({
|
|
30
|
+
name: "UndoRedoButton",
|
|
31
|
+
props: {
|
|
32
|
+
editor: {
|
|
33
|
+
type: Object,
|
|
34
|
+
required: true
|
|
35
|
+
},
|
|
36
|
+
action: {
|
|
37
|
+
type: String,
|
|
38
|
+
required: true
|
|
39
|
+
},
|
|
40
|
+
text: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: ""
|
|
43
|
+
},
|
|
44
|
+
hideWhenUnavailable: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: false
|
|
47
|
+
},
|
|
48
|
+
showShortcut: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: false
|
|
51
|
+
},
|
|
52
|
+
className: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: ""
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
setup(props, {
|
|
58
|
+
slots,
|
|
59
|
+
attrs
|
|
60
|
+
}) {
|
|
61
|
+
const {
|
|
62
|
+
isVisible,
|
|
63
|
+
handleAction,
|
|
64
|
+
label,
|
|
65
|
+
canExecute,
|
|
66
|
+
Icon,
|
|
67
|
+
shortcutKeys
|
|
68
|
+
} = (0, import_use_undo_redo.useUndoRedo)({
|
|
69
|
+
editor: props.editor,
|
|
70
|
+
action: props.action,
|
|
71
|
+
hideWhenUnavailable: props.hideWhenUnavailable
|
|
72
|
+
});
|
|
73
|
+
return () => {
|
|
74
|
+
if (!isVisible.value)
|
|
75
|
+
return null;
|
|
76
|
+
return (0, import_vue.createVNode)(import_button.Button, (0, import_vue.mergeProps)({
|
|
77
|
+
"type": "button",
|
|
78
|
+
"disabled": !canExecute.value,
|
|
79
|
+
"data-style": "ghost",
|
|
80
|
+
"data-disabled": !canExecute.value,
|
|
81
|
+
"role": "button",
|
|
82
|
+
"tabindex": -1,
|
|
83
|
+
"aria-label": label,
|
|
84
|
+
"tooltip": label,
|
|
85
|
+
"onClick": handleAction,
|
|
86
|
+
"class": (0, import_tiptap_utils.cn)(props.className)
|
|
87
|
+
}, attrs), {
|
|
88
|
+
default: () => [slots.default ? slots.default() : (0, import_vue.createVNode)(import_vue.Fragment, null, [(0, import_vue.createVNode)(Icon, {
|
|
89
|
+
"class": "tiptap-button-icon"
|
|
90
|
+
}, null), props.text && (0, import_vue.createVNode)("span", {
|
|
91
|
+
"class": "tiptap-button-text"
|
|
92
|
+
}, [props.text])])]
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
});
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,154 @@
|
|
|
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
|
+
BLOCKQUOTE_SHORTCUT_KEY: () => BLOCKQUOTE_SHORTCUT_KEY,
|
|
21
|
+
canToggleBlockquote: () => canToggleBlockquote,
|
|
22
|
+
shouldShowButton: () => shouldShowButton,
|
|
23
|
+
toggleBlockquote: () => toggleBlockquote,
|
|
24
|
+
useBlockquote: () => useBlockquote
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
27
|
+
var import_vue = require("vue");
|
|
28
|
+
var import_state = require("@tiptap/pm/state");
|
|
29
|
+
var import_tiptap_utils = require("../utils/tiptap-utils");
|
|
30
|
+
var import_icons = require("../icons");
|
|
31
|
+
const BLOCKQUOTE_SHORTCUT_KEY = "mod+shift+b";
|
|
32
|
+
function canToggleBlockquote(editor, turnInto = true) {
|
|
33
|
+
var _a;
|
|
34
|
+
if (!editor || !editor.isEditable)
|
|
35
|
+
return false;
|
|
36
|
+
if (!(0, import_tiptap_utils.isNodeInSchema)("blockquote", editor) || (0, import_tiptap_utils.isNodeTypeSelected)(editor, ["image"]))
|
|
37
|
+
return false;
|
|
38
|
+
if (!turnInto) {
|
|
39
|
+
return editor.can().toggleWrap("blockquote");
|
|
40
|
+
}
|
|
41
|
+
try {
|
|
42
|
+
const view = editor.view;
|
|
43
|
+
const state = view.state;
|
|
44
|
+
const selection = state.selection;
|
|
45
|
+
if (selection.empty || selection instanceof import_state.TextSelection) {
|
|
46
|
+
const pos = (_a = (0, import_tiptap_utils.findNodePosition)({
|
|
47
|
+
editor,
|
|
48
|
+
node: state.selection.$anchor.node(1)
|
|
49
|
+
})) == null ? void 0 : _a.pos;
|
|
50
|
+
if (!(0, import_tiptap_utils.isValidPosition)(pos))
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
return true;
|
|
54
|
+
} catch (e) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function toggleBlockquote(editor) {
|
|
59
|
+
var _a;
|
|
60
|
+
if (!editor || !editor.isEditable)
|
|
61
|
+
return false;
|
|
62
|
+
if (!canToggleBlockquote(editor))
|
|
63
|
+
return false;
|
|
64
|
+
try {
|
|
65
|
+
const view = editor.view;
|
|
66
|
+
let state = view.state;
|
|
67
|
+
let tr = state.tr;
|
|
68
|
+
if (state.selection.empty || state.selection instanceof import_state.TextSelection) {
|
|
69
|
+
const pos = (_a = (0, import_tiptap_utils.findNodePosition)({
|
|
70
|
+
editor,
|
|
71
|
+
node: state.selection.$anchor.node(1)
|
|
72
|
+
})) == null ? void 0 : _a.pos;
|
|
73
|
+
if (!(0, import_tiptap_utils.isValidPosition)(pos))
|
|
74
|
+
return false;
|
|
75
|
+
tr = tr.setSelection(import_state.NodeSelection.create(state.doc, pos));
|
|
76
|
+
view.dispatch(tr);
|
|
77
|
+
state = view.state;
|
|
78
|
+
}
|
|
79
|
+
const selection = state.selection;
|
|
80
|
+
let chain = editor.chain().focus();
|
|
81
|
+
if (selection instanceof import_state.NodeSelection) {
|
|
82
|
+
chain = chain.clearNodes();
|
|
83
|
+
}
|
|
84
|
+
const toggle = editor.isActive("blockquote") ? chain.lift("blockquote") : chain.wrapIn("blockquote");
|
|
85
|
+
toggle.run();
|
|
86
|
+
editor.chain().focus().selectTextblockEnd().run();
|
|
87
|
+
return true;
|
|
88
|
+
} catch (e) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function shouldShowButton(props) {
|
|
93
|
+
const { editor, hideWhenUnavailable } = props;
|
|
94
|
+
if (!editor || !editor.isEditable)
|
|
95
|
+
return false;
|
|
96
|
+
if (!(0, import_tiptap_utils.isNodeInSchema)("blockquote", editor))
|
|
97
|
+
return false;
|
|
98
|
+
if (hideWhenUnavailable && !editor.isActive("code")) {
|
|
99
|
+
return canToggleBlockquote(editor);
|
|
100
|
+
}
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
function useBlockquote(config) {
|
|
104
|
+
const { hideWhenUnavailable = false, onToggled } = config;
|
|
105
|
+
const isVisible = (0, import_vue.ref)(true);
|
|
106
|
+
const isActive = (0, import_vue.ref)(false);
|
|
107
|
+
const canToggle = (0, import_vue.ref)(false);
|
|
108
|
+
const getEditor = () => {
|
|
109
|
+
const editor = config.editor;
|
|
110
|
+
return editor && "value" in editor ? editor.value : editor;
|
|
111
|
+
};
|
|
112
|
+
const updateState = () => {
|
|
113
|
+
const editor = getEditor();
|
|
114
|
+
if (!editor || !editor.isEditable) {
|
|
115
|
+
isVisible.value = false;
|
|
116
|
+
isActive.value = false;
|
|
117
|
+
canToggle.value = false;
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
isActive.value = editor.isActive("blockquote");
|
|
121
|
+
canToggle.value = canToggleBlockquote(editor);
|
|
122
|
+
isVisible.value = shouldShowButton({ editor, hideWhenUnavailable });
|
|
123
|
+
};
|
|
124
|
+
(0, import_vue.watch)(
|
|
125
|
+
() => getEditor(),
|
|
126
|
+
(editor) => {
|
|
127
|
+
if (!editor)
|
|
128
|
+
return;
|
|
129
|
+
updateState();
|
|
130
|
+
editor.on("selectionUpdate", updateState);
|
|
131
|
+
editor.on("transaction", updateState);
|
|
132
|
+
(0, import_vue.onBeforeUnmount)(() => {
|
|
133
|
+
editor.off("selectionUpdate", updateState);
|
|
134
|
+
editor.off("transaction", updateState);
|
|
135
|
+
});
|
|
136
|
+
},
|
|
137
|
+
{ immediate: true }
|
|
138
|
+
);
|
|
139
|
+
const handleToggle = () => {
|
|
140
|
+
const editor = getEditor();
|
|
141
|
+
if (toggleBlockquote(editor)) {
|
|
142
|
+
onToggled == null ? void 0 : onToggled();
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
return {
|
|
146
|
+
isVisible,
|
|
147
|
+
isActive,
|
|
148
|
+
handleToggle,
|
|
149
|
+
canToggle,
|
|
150
|
+
label: "Blockquote",
|
|
151
|
+
shortcutKeys: BLOCKQUOTE_SHORTCUT_KEY,
|
|
152
|
+
Icon: import_icons.BlockquoteIcon
|
|
153
|
+
};
|
|
154
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/vue-3';
|
|
2
|
+
export declare const CODE_BLOCK_SHORTCUT_KEY = "mod+alt+c";
|
|
3
|
+
export interface UseCodeBlockConfig {
|
|
4
|
+
editor: any;
|
|
5
|
+
hideWhenUnavailable?: boolean;
|
|
6
|
+
onToggled?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function canToggle(editor: Editor | null, turnInto?: boolean): boolean;
|
|
9
|
+
export declare function toggleCodeBlock(editor: Editor | null): boolean;
|
|
10
|
+
export declare function shouldShowButton(props: {
|
|
11
|
+
editor: Editor | null;
|
|
12
|
+
hideWhenUnavailable: boolean;
|
|
13
|
+
}): boolean;
|
|
14
|
+
export declare function useCodeBlock(config: UseCodeBlockConfig): {
|
|
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
|
+
};
|
|
@@ -0,0 +1,154 @@
|
|
|
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
|
+
CODE_BLOCK_SHORTCUT_KEY: () => CODE_BLOCK_SHORTCUT_KEY,
|
|
21
|
+
canToggle: () => canToggle,
|
|
22
|
+
shouldShowButton: () => shouldShowButton,
|
|
23
|
+
toggleCodeBlock: () => toggleCodeBlock,
|
|
24
|
+
useCodeBlock: () => useCodeBlock
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
27
|
+
var import_vue = require("vue");
|
|
28
|
+
var import_state = require("@tiptap/pm/state");
|
|
29
|
+
var import_tiptap_utils = require("../utils/tiptap-utils");
|
|
30
|
+
var import_icons = require("../icons");
|
|
31
|
+
const CODE_BLOCK_SHORTCUT_KEY = "mod+alt+c";
|
|
32
|
+
function canToggle(editor, turnInto = true) {
|
|
33
|
+
var _a;
|
|
34
|
+
if (!editor || !editor.isEditable)
|
|
35
|
+
return false;
|
|
36
|
+
if (!(0, import_tiptap_utils.isNodeInSchema)("codeBlock", editor) || (0, import_tiptap_utils.isNodeTypeSelected)(editor, ["image"]))
|
|
37
|
+
return false;
|
|
38
|
+
if (!turnInto) {
|
|
39
|
+
return editor.can().toggleNode("codeBlock", "paragraph");
|
|
40
|
+
}
|
|
41
|
+
try {
|
|
42
|
+
const view = editor.view;
|
|
43
|
+
const state = view.state;
|
|
44
|
+
const selection = state.selection;
|
|
45
|
+
if (selection.empty || selection instanceof import_state.TextSelection) {
|
|
46
|
+
const pos = (_a = (0, import_tiptap_utils.findNodePosition)({
|
|
47
|
+
editor,
|
|
48
|
+
node: state.selection.$anchor.node(1)
|
|
49
|
+
})) == null ? void 0 : _a.pos;
|
|
50
|
+
if (!(0, import_tiptap_utils.isValidPosition)(pos))
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
return true;
|
|
54
|
+
} catch (e) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function toggleCodeBlock(editor) {
|
|
59
|
+
var _a;
|
|
60
|
+
if (!editor || !editor.isEditable)
|
|
61
|
+
return false;
|
|
62
|
+
if (!canToggle(editor))
|
|
63
|
+
return false;
|
|
64
|
+
try {
|
|
65
|
+
const view = editor.view;
|
|
66
|
+
let state = view.state;
|
|
67
|
+
let tr = state.tr;
|
|
68
|
+
if (state.selection.empty || state.selection instanceof import_state.TextSelection) {
|
|
69
|
+
const pos = (_a = (0, import_tiptap_utils.findNodePosition)({
|
|
70
|
+
editor,
|
|
71
|
+
node: state.selection.$anchor.node(1)
|
|
72
|
+
})) == null ? void 0 : _a.pos;
|
|
73
|
+
if (!(0, import_tiptap_utils.isValidPosition)(pos))
|
|
74
|
+
return false;
|
|
75
|
+
tr = tr.setSelection(import_state.NodeSelection.create(state.doc, pos));
|
|
76
|
+
view.dispatch(tr);
|
|
77
|
+
state = view.state;
|
|
78
|
+
}
|
|
79
|
+
const selection = state.selection;
|
|
80
|
+
let chain = editor.chain().focus();
|
|
81
|
+
if (selection instanceof import_state.NodeSelection) {
|
|
82
|
+
chain = chain.clearNodes();
|
|
83
|
+
}
|
|
84
|
+
const toggle = editor.isActive("codeBlock") ? chain.setNode("paragraph") : chain.toggleNode("codeBlock", "paragraph");
|
|
85
|
+
toggle.run();
|
|
86
|
+
editor.chain().focus().selectTextblockEnd().run();
|
|
87
|
+
return true;
|
|
88
|
+
} catch (e) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function shouldShowButton(props) {
|
|
93
|
+
const { editor, hideWhenUnavailable } = props;
|
|
94
|
+
if (!editor || !editor.isEditable)
|
|
95
|
+
return false;
|
|
96
|
+
if (!(0, import_tiptap_utils.isNodeInSchema)("codeBlock", editor))
|
|
97
|
+
return false;
|
|
98
|
+
if (hideWhenUnavailable && !editor.isActive("code")) {
|
|
99
|
+
return canToggle(editor);
|
|
100
|
+
}
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
function useCodeBlock(config) {
|
|
104
|
+
const { hideWhenUnavailable = false, onToggled } = config;
|
|
105
|
+
const isVisible = (0, import_vue.ref)(true);
|
|
106
|
+
const isActive = (0, import_vue.ref)(false);
|
|
107
|
+
const canToggleState = (0, import_vue.ref)(false);
|
|
108
|
+
const getEditor = () => {
|
|
109
|
+
const editor = config.editor;
|
|
110
|
+
return editor && "value" in editor ? editor.value : editor;
|
|
111
|
+
};
|
|
112
|
+
const updateState = () => {
|
|
113
|
+
const editor = getEditor();
|
|
114
|
+
if (!editor || !editor.isEditable) {
|
|
115
|
+
isVisible.value = false;
|
|
116
|
+
isActive.value = false;
|
|
117
|
+
canToggleState.value = false;
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
isActive.value = editor.isActive("codeBlock");
|
|
121
|
+
canToggleState.value = canToggle(editor);
|
|
122
|
+
isVisible.value = shouldShowButton({ editor, hideWhenUnavailable });
|
|
123
|
+
};
|
|
124
|
+
(0, import_vue.watch)(
|
|
125
|
+
() => getEditor(),
|
|
126
|
+
(editor) => {
|
|
127
|
+
if (!editor)
|
|
128
|
+
return;
|
|
129
|
+
updateState();
|
|
130
|
+
editor.on("selectionUpdate", updateState);
|
|
131
|
+
editor.on("transaction", updateState);
|
|
132
|
+
(0, import_vue.onBeforeUnmount)(() => {
|
|
133
|
+
editor.off("selectionUpdate", updateState);
|
|
134
|
+
editor.off("transaction", updateState);
|
|
135
|
+
});
|
|
136
|
+
},
|
|
137
|
+
{ immediate: true }
|
|
138
|
+
);
|
|
139
|
+
const handleToggle = () => {
|
|
140
|
+
const editor = getEditor();
|
|
141
|
+
if (toggleCodeBlock(editor)) {
|
|
142
|
+
onToggled == null ? void 0 : onToggled();
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
return {
|
|
146
|
+
isVisible,
|
|
147
|
+
isActive,
|
|
148
|
+
handleToggle,
|
|
149
|
+
canToggle: canToggleState,
|
|
150
|
+
label: "Code Block",
|
|
151
|
+
shortcutKeys: CODE_BLOCK_SHORTCUT_KEY,
|
|
152
|
+
Icon: import_icons.CodeBlockIcon
|
|
153
|
+
};
|
|
154
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/vue-3';
|
|
2
|
+
export declare const COLOR_HIGHLIGHT_SHORTCUT_KEY = "mod+shift+h";
|
|
3
|
+
export declare const HIGHLIGHT_COLORS: {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
border: string;
|
|
7
|
+
}[];
|
|
8
|
+
export type HighlightColor = (typeof HIGHLIGHT_COLORS)[number];
|
|
9
|
+
export declare function canColorHighlight(editor: Editor | null): boolean;
|
|
10
|
+
export declare function isColorHighlightActive(editor: Editor | null, highlightColor?: string): boolean;
|
|
11
|
+
export declare function removeHighlight(editor: Editor | null): boolean;
|
|
12
|
+
export declare function shouldShowButton(props: {
|
|
13
|
+
editor: Editor | null;
|
|
14
|
+
hideWhenUnavailable: boolean;
|
|
15
|
+
}): boolean;
|
|
16
|
+
export declare function useColorHighlight(config: {
|
|
17
|
+
editor: any;
|
|
18
|
+
label?: string;
|
|
19
|
+
highlightColor?: string;
|
|
20
|
+
hideWhenUnavailable?: boolean;
|
|
21
|
+
onApplied?: (params: {
|
|
22
|
+
color: string;
|
|
23
|
+
label: string;
|
|
24
|
+
}) => void;
|
|
25
|
+
}): {
|
|
26
|
+
isVisible: import("vue").Ref<boolean, boolean>;
|
|
27
|
+
isActive: import("vue").Ref<boolean, boolean>;
|
|
28
|
+
handleColorHighlight: () => void;
|
|
29
|
+
handleRemoveHighlight: () => void;
|
|
30
|
+
canHighlight: import("vue").Ref<boolean, boolean>;
|
|
31
|
+
label: string;
|
|
32
|
+
shortcutKeys: string;
|
|
33
|
+
Icon: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
34
|
+
className: {
|
|
35
|
+
type: StringConstructor;
|
|
36
|
+
default: string;
|
|
37
|
+
};
|
|
38
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
39
|
+
className: {
|
|
40
|
+
type: StringConstructor;
|
|
41
|
+
default: string;
|
|
42
|
+
};
|
|
43
|
+
}>> & Readonly<{}>, {
|
|
44
|
+
className: string;
|
|
45
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
46
|
+
};
|