@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 @@
|
|
|
1
|
+
export declare function useIsMobile(breakpoint?: number): import("vue").Ref<boolean, boolean>;
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
useIsMobile: () => useIsMobile
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
23
|
+
var import_vue = require("vue");
|
|
24
|
+
function useIsMobile(breakpoint = 768) {
|
|
25
|
+
const isMobile = (0, import_vue.ref)(false);
|
|
26
|
+
const checkMobile = () => {
|
|
27
|
+
isMobile.value = window.innerWidth < breakpoint;
|
|
28
|
+
};
|
|
29
|
+
(0, import_vue.onMounted)(() => {
|
|
30
|
+
const mql = window.matchMedia(`(max-width: ${breakpoint - 1}px)`);
|
|
31
|
+
mql.addEventListener("change", checkMobile);
|
|
32
|
+
checkMobile();
|
|
33
|
+
});
|
|
34
|
+
(0, import_vue.onBeforeUnmount)(() => {
|
|
35
|
+
const mql = window.matchMedia(`(max-width: ${breakpoint - 1}px)`);
|
|
36
|
+
mql.removeEventListener("change", checkMobile);
|
|
37
|
+
});
|
|
38
|
+
return isMobile;
|
|
39
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/vue-3';
|
|
2
|
+
export type TextAlign = 'left' | 'center' | 'right' | 'justify';
|
|
3
|
+
export interface UseTextAlignConfig {
|
|
4
|
+
editor: any;
|
|
5
|
+
align: TextAlign;
|
|
6
|
+
hideWhenUnavailable?: boolean;
|
|
7
|
+
onAligned?: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const TEXT_ALIGN_SHORTCUT_KEYS: Record<TextAlign, string>;
|
|
10
|
+
export declare const textAlignIcons: any;
|
|
11
|
+
export declare const textAlignLabels: Record<TextAlign, string>;
|
|
12
|
+
export declare function canSetTextAlign(editor: Editor | null, align: TextAlign): boolean;
|
|
13
|
+
export declare function isTextAlignActive(editor: Editor | null, align: TextAlign): boolean;
|
|
14
|
+
export declare function setTextAlign(editor: Editor | null, align: TextAlign): boolean;
|
|
15
|
+
export declare function shouldShowButton(props: {
|
|
16
|
+
editor: Editor | null;
|
|
17
|
+
hideWhenUnavailable: boolean;
|
|
18
|
+
align: TextAlign;
|
|
19
|
+
}): boolean;
|
|
20
|
+
export declare function useTextAlign(config: UseTextAlignConfig): {
|
|
21
|
+
isVisible: import("vue").Ref<boolean, boolean>;
|
|
22
|
+
isActive: import("vue").Ref<boolean, boolean>;
|
|
23
|
+
handleTextAlign: () => void;
|
|
24
|
+
canAlign: import("vue").Ref<boolean, boolean>;
|
|
25
|
+
label: string;
|
|
26
|
+
shortcutKeys: string;
|
|
27
|
+
Icon: any;
|
|
28
|
+
};
|
|
@@ -0,0 +1,132 @@
|
|
|
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
|
+
TEXT_ALIGN_SHORTCUT_KEYS: () => TEXT_ALIGN_SHORTCUT_KEYS,
|
|
21
|
+
canSetTextAlign: () => canSetTextAlign,
|
|
22
|
+
isTextAlignActive: () => isTextAlignActive,
|
|
23
|
+
setTextAlign: () => setTextAlign,
|
|
24
|
+
shouldShowButton: () => shouldShowButton,
|
|
25
|
+
textAlignIcons: () => textAlignIcons,
|
|
26
|
+
textAlignLabels: () => textAlignLabels,
|
|
27
|
+
useTextAlign: () => useTextAlign
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
30
|
+
var import_vue = require("vue");
|
|
31
|
+
var import_tiptap_utils = require("../utils/tiptap-utils");
|
|
32
|
+
var import_icons = require("../icons");
|
|
33
|
+
const TEXT_ALIGN_SHORTCUT_KEYS = {
|
|
34
|
+
left: "mod+shift+l",
|
|
35
|
+
center: "mod+shift+e",
|
|
36
|
+
right: "mod+shift+r",
|
|
37
|
+
justify: "mod+shift+j"
|
|
38
|
+
};
|
|
39
|
+
const textAlignIcons = {
|
|
40
|
+
left: import_icons.AlignLeftIcon,
|
|
41
|
+
center: import_icons.AlignCenterIcon,
|
|
42
|
+
right: import_icons.AlignRightIcon,
|
|
43
|
+
justify: import_icons.AlignJustifyIcon
|
|
44
|
+
};
|
|
45
|
+
const textAlignLabels = {
|
|
46
|
+
left: "Align left",
|
|
47
|
+
center: "Align center",
|
|
48
|
+
right: "Align right",
|
|
49
|
+
justify: "Align justify"
|
|
50
|
+
};
|
|
51
|
+
function canSetTextAlign(editor, align) {
|
|
52
|
+
if (!editor || !editor.isEditable)
|
|
53
|
+
return false;
|
|
54
|
+
if (!(0, import_tiptap_utils.isExtensionAvailable)(editor, "textAlign") || (0, import_tiptap_utils.isNodeTypeSelected)(editor, ["image", "horizontalRule"]))
|
|
55
|
+
return false;
|
|
56
|
+
return editor.can().setTextAlign(align);
|
|
57
|
+
}
|
|
58
|
+
function isTextAlignActive(editor, align) {
|
|
59
|
+
if (!editor || !editor.isEditable)
|
|
60
|
+
return false;
|
|
61
|
+
return editor.isActive({ textAlign: align });
|
|
62
|
+
}
|
|
63
|
+
function setTextAlign(editor, align) {
|
|
64
|
+
if (!editor || !editor.isEditable)
|
|
65
|
+
return false;
|
|
66
|
+
if (!canSetTextAlign(editor, align))
|
|
67
|
+
return false;
|
|
68
|
+
return editor.chain().focus().setTextAlign(align).run();
|
|
69
|
+
}
|
|
70
|
+
function shouldShowButton(props) {
|
|
71
|
+
const { editor, hideWhenUnavailable, align } = props;
|
|
72
|
+
if (!editor || !editor.isEditable)
|
|
73
|
+
return false;
|
|
74
|
+
if (!(0, import_tiptap_utils.isExtensionAvailable)(editor, "textAlign"))
|
|
75
|
+
return false;
|
|
76
|
+
if (hideWhenUnavailable && !editor.isActive("code")) {
|
|
77
|
+
return canSetTextAlign(editor, align);
|
|
78
|
+
}
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
function useTextAlign(config) {
|
|
82
|
+
const { align, hideWhenUnavailable = false, onAligned } = config;
|
|
83
|
+
const isVisible = (0, import_vue.ref)(true);
|
|
84
|
+
const isActive = (0, import_vue.ref)(false);
|
|
85
|
+
const canAlign = (0, import_vue.ref)(false);
|
|
86
|
+
const getEditor = () => {
|
|
87
|
+
const editor = config.editor;
|
|
88
|
+
return editor && "value" in editor ? editor.value : editor;
|
|
89
|
+
};
|
|
90
|
+
const updateState = () => {
|
|
91
|
+
const editor = getEditor();
|
|
92
|
+
if (!editor || !editor.isEditable) {
|
|
93
|
+
isVisible.value = false;
|
|
94
|
+
isActive.value = false;
|
|
95
|
+
canAlign.value = false;
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
isActive.value = isTextAlignActive(editor, align);
|
|
99
|
+
canAlign.value = canSetTextAlign(editor, align);
|
|
100
|
+
isVisible.value = shouldShowButton({ editor, align, hideWhenUnavailable });
|
|
101
|
+
};
|
|
102
|
+
(0, import_vue.watch)(
|
|
103
|
+
() => getEditor(),
|
|
104
|
+
(editor) => {
|
|
105
|
+
if (!editor)
|
|
106
|
+
return;
|
|
107
|
+
updateState();
|
|
108
|
+
editor.on("selectionUpdate", updateState);
|
|
109
|
+
editor.on("transaction", updateState);
|
|
110
|
+
(0, import_vue.onBeforeUnmount)(() => {
|
|
111
|
+
editor.off("selectionUpdate", updateState);
|
|
112
|
+
editor.off("transaction", updateState);
|
|
113
|
+
});
|
|
114
|
+
},
|
|
115
|
+
{ immediate: true }
|
|
116
|
+
);
|
|
117
|
+
const handleTextAlign = () => {
|
|
118
|
+
const editor = getEditor();
|
|
119
|
+
if (setTextAlign(editor, align)) {
|
|
120
|
+
onAligned == null ? void 0 : onAligned();
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
return {
|
|
124
|
+
isVisible,
|
|
125
|
+
isActive,
|
|
126
|
+
handleTextAlign,
|
|
127
|
+
canAlign,
|
|
128
|
+
label: textAlignLabels[align],
|
|
129
|
+
shortcutKeys: TEXT_ALIGN_SHORTCUT_KEYS[align],
|
|
130
|
+
Icon: textAlignIcons[align]
|
|
131
|
+
};
|
|
132
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
default: () => stdin_default,
|
|
21
|
+
useThrottledCallback: () => useThrottledCallback
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
24
|
+
var import_vue = require("vue");
|
|
25
|
+
const throttle = (fn, wait, options = { leading: false, trailing: true }) => {
|
|
26
|
+
let timeout = null;
|
|
27
|
+
let previous = 0;
|
|
28
|
+
const throttled = function(...args) {
|
|
29
|
+
const now = Date.now();
|
|
30
|
+
if (!previous && options.leading === false)
|
|
31
|
+
previous = now;
|
|
32
|
+
const remaining = wait - (now - previous);
|
|
33
|
+
if (remaining <= 0 || remaining > wait) {
|
|
34
|
+
if (timeout) {
|
|
35
|
+
clearTimeout(timeout);
|
|
36
|
+
timeout = null;
|
|
37
|
+
}
|
|
38
|
+
previous = now;
|
|
39
|
+
fn.apply(this, args);
|
|
40
|
+
} else if (!timeout && options.trailing !== false) {
|
|
41
|
+
timeout = setTimeout(() => {
|
|
42
|
+
previous = options.leading === false ? 0 : Date.now();
|
|
43
|
+
timeout = null;
|
|
44
|
+
fn.apply(this, args);
|
|
45
|
+
}, remaining);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
throttled.cancel = () => {
|
|
49
|
+
if (timeout) {
|
|
50
|
+
clearTimeout(timeout);
|
|
51
|
+
timeout = null;
|
|
52
|
+
}
|
|
53
|
+
previous = 0;
|
|
54
|
+
};
|
|
55
|
+
return throttled;
|
|
56
|
+
};
|
|
57
|
+
function useThrottledCallback(fn, wait = 250, options = { leading: false, trailing: true }) {
|
|
58
|
+
const throttled = throttle(fn, wait, options);
|
|
59
|
+
(0, import_vue.onBeforeUnmount)(() => {
|
|
60
|
+
throttled.cancel();
|
|
61
|
+
});
|
|
62
|
+
return throttled;
|
|
63
|
+
}
|
|
64
|
+
var stdin_default = useThrottledCallback;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/vue-3';
|
|
2
|
+
export type UndoRedoAction = 'undo' | 'redo';
|
|
3
|
+
export interface UseUndoRedoConfig {
|
|
4
|
+
editor: any;
|
|
5
|
+
action: UndoRedoAction;
|
|
6
|
+
hideWhenUnavailable?: boolean;
|
|
7
|
+
onExecuted?: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const UNDO_REDO_SHORTCUT_KEYS: Record<UndoRedoAction, string>;
|
|
10
|
+
export declare const historyActionLabels: Record<UndoRedoAction, string>;
|
|
11
|
+
export declare const historyIcons: {
|
|
12
|
+
undo: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
13
|
+
className: {
|
|
14
|
+
type: StringConstructor;
|
|
15
|
+
default: string;
|
|
16
|
+
};
|
|
17
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
18
|
+
className: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
default: string;
|
|
21
|
+
};
|
|
22
|
+
}>> & Readonly<{}>, {
|
|
23
|
+
className: string;
|
|
24
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
25
|
+
redo: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
26
|
+
className: {
|
|
27
|
+
type: StringConstructor;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
30
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
31
|
+
className: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
default: string;
|
|
34
|
+
};
|
|
35
|
+
}>> & Readonly<{}>, {
|
|
36
|
+
className: string;
|
|
37
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
38
|
+
};
|
|
39
|
+
export declare function canExecuteUndoRedoAction(editor: Editor | null, action: UndoRedoAction): boolean;
|
|
40
|
+
export declare function executeUndoRedoAction(editor: Editor | null, action: UndoRedoAction): boolean;
|
|
41
|
+
export declare function useUndoRedo(config: UseUndoRedoConfig): {
|
|
42
|
+
isVisible: import("vue").Ref<boolean, boolean>;
|
|
43
|
+
handleAction: () => boolean;
|
|
44
|
+
canExecute: import("vue").Ref<boolean, boolean>;
|
|
45
|
+
label: string;
|
|
46
|
+
shortcutKeys: string;
|
|
47
|
+
Icon: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
48
|
+
className: {
|
|
49
|
+
type: StringConstructor;
|
|
50
|
+
default: string;
|
|
51
|
+
};
|
|
52
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
53
|
+
className: {
|
|
54
|
+
type: StringConstructor;
|
|
55
|
+
default: string;
|
|
56
|
+
};
|
|
57
|
+
}>> & Readonly<{}>, {
|
|
58
|
+
className: string;
|
|
59
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
60
|
+
};
|
|
@@ -0,0 +1,115 @@
|
|
|
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
|
+
UNDO_REDO_SHORTCUT_KEYS: () => UNDO_REDO_SHORTCUT_KEYS,
|
|
21
|
+
canExecuteUndoRedoAction: () => canExecuteUndoRedoAction,
|
|
22
|
+
executeUndoRedoAction: () => executeUndoRedoAction,
|
|
23
|
+
historyActionLabels: () => historyActionLabels,
|
|
24
|
+
historyIcons: () => historyIcons,
|
|
25
|
+
useUndoRedo: () => useUndoRedo
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
28
|
+
var import_vue = require("vue");
|
|
29
|
+
var import_tiptap_utils = require("../utils/tiptap-utils");
|
|
30
|
+
var import_icons = require("../icons");
|
|
31
|
+
const UNDO_REDO_SHORTCUT_KEYS = {
|
|
32
|
+
undo: "mod+z",
|
|
33
|
+
redo: "mod+shift+z"
|
|
34
|
+
};
|
|
35
|
+
const historyActionLabels = {
|
|
36
|
+
undo: "Undo",
|
|
37
|
+
redo: "Redo"
|
|
38
|
+
};
|
|
39
|
+
const historyIcons = {
|
|
40
|
+
undo: import_icons.Undo2Icon,
|
|
41
|
+
redo: import_icons.Redo2Icon
|
|
42
|
+
};
|
|
43
|
+
function canExecuteUndoRedoAction(editor, action) {
|
|
44
|
+
if (!editor || !editor.isEditable)
|
|
45
|
+
return false;
|
|
46
|
+
if ((0, import_tiptap_utils.isNodeTypeSelected)(editor, ["image"]))
|
|
47
|
+
return false;
|
|
48
|
+
return action === "undo" ? editor.can().undo() : editor.can().redo();
|
|
49
|
+
}
|
|
50
|
+
function executeUndoRedoAction(editor, action) {
|
|
51
|
+
if (!editor || !editor.isEditable)
|
|
52
|
+
return false;
|
|
53
|
+
if (!canExecuteUndoRedoAction(editor, action))
|
|
54
|
+
return false;
|
|
55
|
+
const chain = editor.chain().focus();
|
|
56
|
+
return action === "undo" ? chain.undo().run() : chain.redo().run();
|
|
57
|
+
}
|
|
58
|
+
function useUndoRedo(config) {
|
|
59
|
+
const { action, hideWhenUnavailable = false, onExecuted } = config;
|
|
60
|
+
const isVisible = (0, import_vue.ref)(true);
|
|
61
|
+
const getEditor = () => {
|
|
62
|
+
const editor = config.editor;
|
|
63
|
+
return editor && "value" in editor ? editor.value : editor;
|
|
64
|
+
};
|
|
65
|
+
const handleUpdate = () => {
|
|
66
|
+
const editor = getEditor();
|
|
67
|
+
if (!editor || !editor.isEditable) {
|
|
68
|
+
isVisible.value = false;
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (hideWhenUnavailable && !editor.isActive("code")) {
|
|
72
|
+
isVisible.value = canExecuteUndoRedoAction(editor, action);
|
|
73
|
+
} else {
|
|
74
|
+
isVisible.value = true;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const handleAction = () => {
|
|
78
|
+
const editor = getEditor();
|
|
79
|
+
if (!editor)
|
|
80
|
+
return false;
|
|
81
|
+
const success = executeUndoRedoAction(editor, action);
|
|
82
|
+
if (success) {
|
|
83
|
+
onExecuted == null ? void 0 : onExecuted();
|
|
84
|
+
}
|
|
85
|
+
return success;
|
|
86
|
+
};
|
|
87
|
+
const canExecute = (0, import_vue.ref)(false);
|
|
88
|
+
const updateCanExecute = () => {
|
|
89
|
+
canExecute.value = canExecuteUndoRedoAction(getEditor(), action);
|
|
90
|
+
};
|
|
91
|
+
(0, import_vue.watch)(
|
|
92
|
+
() => getEditor(),
|
|
93
|
+
(editor) => {
|
|
94
|
+
if (!editor)
|
|
95
|
+
return;
|
|
96
|
+
handleUpdate();
|
|
97
|
+
updateCanExecute();
|
|
98
|
+
editor.on("transaction", handleUpdate);
|
|
99
|
+
editor.on("transaction", updateCanExecute);
|
|
100
|
+
(0, import_vue.onBeforeUnmount)(() => {
|
|
101
|
+
editor.off("transaction", handleUpdate);
|
|
102
|
+
editor.off("transaction", updateCanExecute);
|
|
103
|
+
});
|
|
104
|
+
},
|
|
105
|
+
{ immediate: true }
|
|
106
|
+
);
|
|
107
|
+
return {
|
|
108
|
+
isVisible,
|
|
109
|
+
handleAction,
|
|
110
|
+
canExecute,
|
|
111
|
+
label: historyActionLabels[action],
|
|
112
|
+
shortcutKeys: UNDO_REDO_SHORTCUT_KEYS[action],
|
|
113
|
+
Icon: historyIcons[action]
|
|
114
|
+
};
|
|
115
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface WindowSizeState {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
offsetTop: number;
|
|
5
|
+
offsetLeft: number;
|
|
6
|
+
scale: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function useWindowSize(): WindowSizeState;
|
|
9
|
+
export declare function useWindowSizeStore(): import("vue").Ref<{
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
offsetTop: number;
|
|
13
|
+
offsetLeft: number;
|
|
14
|
+
scale: number;
|
|
15
|
+
}, WindowSizeState | {
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
offsetTop: number;
|
|
19
|
+
offsetLeft: number;
|
|
20
|
+
scale: number;
|
|
21
|
+
}>;
|
|
@@ -0,0 +1,93 @@
|
|
|
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
|
+
useWindowSize: () => useWindowSize,
|
|
21
|
+
useWindowSizeStore: () => useWindowSizeStore
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
24
|
+
var import_vue = require("vue");
|
|
25
|
+
var import_use_throttled_callback = require("./use-throttled-callback");
|
|
26
|
+
function useWindowSize() {
|
|
27
|
+
const windowSize = (0, import_vue.ref)({
|
|
28
|
+
width: 0,
|
|
29
|
+
height: 0,
|
|
30
|
+
offsetTop: 0,
|
|
31
|
+
offsetLeft: 0,
|
|
32
|
+
scale: 0
|
|
33
|
+
});
|
|
34
|
+
const handleViewportChange = (0, import_use_throttled_callback.useThrottledCallback)(() => {
|
|
35
|
+
if (typeof window === "undefined")
|
|
36
|
+
return;
|
|
37
|
+
const vp = window.visualViewport;
|
|
38
|
+
if (!vp)
|
|
39
|
+
return;
|
|
40
|
+
const { width = 0, height = 0, offsetTop = 0, offsetLeft = 0, scale = 0 } = vp;
|
|
41
|
+
if (width === windowSize.value.width && height === windowSize.value.height && offsetTop === windowSize.value.offsetTop && offsetLeft === windowSize.value.offsetLeft && scale === windowSize.value.scale) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
windowSize.value = { width, height, offsetTop, offsetLeft, scale };
|
|
45
|
+
}, 200);
|
|
46
|
+
(0, import_vue.onMounted)(() => {
|
|
47
|
+
const visualViewport = window.visualViewport;
|
|
48
|
+
if (!visualViewport)
|
|
49
|
+
return;
|
|
50
|
+
visualViewport.addEventListener("resize", handleViewportChange);
|
|
51
|
+
handleViewportChange();
|
|
52
|
+
});
|
|
53
|
+
(0, import_vue.onBeforeUnmount)(() => {
|
|
54
|
+
const visualViewport = window.visualViewport;
|
|
55
|
+
if (visualViewport) {
|
|
56
|
+
visualViewport.removeEventListener("resize", handleViewportChange);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
return windowSize.value;
|
|
60
|
+
}
|
|
61
|
+
function useWindowSizeStore() {
|
|
62
|
+
const windowSize = (0, import_vue.ref)({
|
|
63
|
+
width: typeof window !== "undefined" ? window.innerWidth : 0,
|
|
64
|
+
height: typeof window !== "undefined" ? window.innerHeight : 0,
|
|
65
|
+
offsetTop: 0,
|
|
66
|
+
offsetLeft: 0,
|
|
67
|
+
scale: 1
|
|
68
|
+
});
|
|
69
|
+
const handleViewportChange = (0, import_use_throttled_callback.useThrottledCallback)(() => {
|
|
70
|
+
if (typeof window === "undefined")
|
|
71
|
+
return;
|
|
72
|
+
const vp = window.visualViewport;
|
|
73
|
+
if (!vp)
|
|
74
|
+
return;
|
|
75
|
+
windowSize.value = {
|
|
76
|
+
width: vp.width,
|
|
77
|
+
height: vp.height,
|
|
78
|
+
offsetTop: vp.offsetTop,
|
|
79
|
+
offsetLeft: vp.offsetLeft,
|
|
80
|
+
scale: vp.scale
|
|
81
|
+
};
|
|
82
|
+
}, 200);
|
|
83
|
+
(0, import_vue.onMounted)(() => {
|
|
84
|
+
var _a;
|
|
85
|
+
(_a = window.visualViewport) == null ? void 0 : _a.addEventListener("resize", handleViewportChange);
|
|
86
|
+
handleViewportChange();
|
|
87
|
+
});
|
|
88
|
+
(0, import_vue.onBeforeUnmount)(() => {
|
|
89
|
+
var _a;
|
|
90
|
+
(_a = window.visualViewport) == null ? void 0 : _a.removeEventListener("resize", handleViewportChange);
|
|
91
|
+
});
|
|
92
|
+
return windowSize;
|
|
93
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
.cgx-atm .flex {
|
|
3
|
+
align-items: initial;
|
|
4
|
+
flex-direction: initial;
|
|
5
|
+
justify-content: initial;
|
|
6
|
+
flex-wrap: initial;
|
|
7
|
+
}
|
|
8
|
+
.cgx-atm .flex-row {
|
|
9
|
+
flex-direction: row;
|
|
10
|
+
}
|
|
11
|
+
.cgx-atm .flex-col {
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
}
|
|
14
|
+
.cgx-atm .justify-center {
|
|
15
|
+
justify-content: center;
|
|
16
|
+
}
|
|
17
|
+
.cgx-atm .justify-between {
|
|
18
|
+
justify-content: space-between;
|
|
19
|
+
}
|
|
20
|
+
.cgx-atm .justify-around {
|
|
21
|
+
justify-content: space-around;
|
|
22
|
+
}
|
|
23
|
+
.cgx-atm .justify-end {
|
|
24
|
+
justify-content: flex-end;
|
|
25
|
+
}
|
|
26
|
+
.cgx-atm .items-center {
|
|
27
|
+
align-items: center;
|
|
28
|
+
}
|
|
29
|
+
.cgx-atm .flex-wrap {
|
|
30
|
+
flex-wrap: wrap;
|
|
31
|
+
}
|
|
32
|
+
|