cvnert-editor 0.1.0
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/LICENSE +21 -0
- package/README.md +57 -0
- package/dist/components/tiptap-extension/indent-extension.d.ts +90 -0
- package/dist/components/tiptap-extension/list-normalization-extension.d.ts +30 -0
- package/dist/components/tiptap-extension/node-alignment-extension.d.ts +38 -0
- package/dist/components/tiptap-extension/node-background-extension.d.ts +23 -0
- package/dist/components/tiptap-extension/triple-click-block-selection-extension.d.ts +13 -0
- package/dist/components/tiptap-extension/ui-state-extension.d.ts +22 -0
- package/dist/components/tiptap-icons/add-col-left-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/add-col-right-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/add-row-bottom-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/add-row-top-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/align-bottom-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/align-center-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/align-center-vertical-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/align-end-vertical-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/align-justify-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/align-left-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/align-middle-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/align-right-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/align-start-vertical-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/align-top-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/alignment-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/arrow-down-a-z-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/arrow-down-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/arrow-down-to-line-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/arrow-down-z-a-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/arrow-left-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/arrow-right-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/arrow-up-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/at-sign-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/ban-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/blockquote-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/bold-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/check-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/chevron-down-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/chevron-right-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/clipboard-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/close-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/code-block-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/code2-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/copy-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/corner-down-left-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/external-link-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/grip-4-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/grip-vertical-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/heading-five-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/heading-four-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/heading-one-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/heading-six-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/heading-three-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/heading-two-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/highlighter-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/image-caption-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/image-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/image-plus-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/indent-decrease-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/indent-increase-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/italic-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/link-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/list-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/list-indented-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/list-ordered-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/list-todo-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/minus-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/moon-star-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/more-vertical-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/move-horizontal-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/paint-bucket-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/plus-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/plus-small-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/redo2-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/refresh-ccw-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/repeat-2-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/rotate-ccw-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/smile-plus-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/square-x-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/strike-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/subscript-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/sun-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/superscript-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/table-cell-merge-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/table-cell-split-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/table-header-column-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/table-header-row-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/table-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/text-color-small-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/trash-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/type-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/underline-icon.d.ts +3 -0
- package/dist/components/tiptap-icons/undo2-icon.d.ts +3 -0
- package/dist/components/tiptap-node/horizontal-rule-node/horizontal-rule-node-extension.d.ts +2 -0
- package/dist/components/tiptap-node/image-node/image-node-extension.d.ts +3 -0
- package/dist/components/tiptap-node/image-node/image-node-floating.d.ts +4 -0
- package/dist/components/tiptap-node/image-node/image-node-view.d.ts +24 -0
- package/dist/components/tiptap-node/image-upload-node/image-upload-node-extension.d.ts +57 -0
- package/dist/components/tiptap-node/image-upload-node/image-upload-node.d.ts +69 -0
- package/dist/components/tiptap-node/table-node/extensions/table-handle/helpers/create-image.d.ts +9 -0
- package/dist/components/tiptap-node/table-node/extensions/table-handle/index.d.ts +2 -0
- package/dist/components/tiptap-node/table-node/extensions/table-handle/table-handle-plugin.d.ts +43 -0
- package/dist/components/tiptap-node/table-node/extensions/table-handle/table-handle.d.ts +14 -0
- package/dist/components/tiptap-node/table-node/extensions/table-node-extension.d.ts +31 -0
- package/dist/components/tiptap-node/table-node/hooks/use-table-handle-state.d.ts +22 -0
- package/dist/components/tiptap-node/table-node/lib/tiptap-table-utils.d.ts +395 -0
- package/dist/components/tiptap-node/table-node/ui/table-add-row-column-button/index.d.ts +2 -0
- package/dist/components/tiptap-node/table-node/ui/table-add-row-column-button/table-add-row-column-button.d.ts +14 -0
- package/dist/components/tiptap-node/table-node/ui/table-add-row-column-button/use-table-add-row-column.d.ts +53 -0
- package/dist/components/tiptap-node/table-node/ui/table-align-cell-button/index.d.ts +2 -0
- package/dist/components/tiptap-node/table-node/ui/table-align-cell-button/table-align-cell-button.d.ts +41 -0
- package/dist/components/tiptap-node/table-node/ui/table-align-cell-button/use-table-align-cell.d.ts +145 -0
- package/dist/components/tiptap-node/table-node/ui/table-alignment-menu/index.d.ts +1 -0
- package/dist/components/tiptap-node/table-node/ui/table-alignment-menu/table-alignment-menu.d.ts +16 -0
- package/dist/components/tiptap-node/table-node/ui/table-cell-handle-menu/index.d.ts +1 -0
- package/dist/components/tiptap-node/table-node/ui/table-cell-handle-menu/table-cell-handle-menu.d.ts +11 -0
- package/dist/components/tiptap-node/table-node/ui/table-clear-row-column-content-button/index.d.ts +2 -0
- package/dist/components/tiptap-node/table-node/ui/table-clear-row-column-content-button/table-clear-row-column-content-button.d.ts +14 -0
- package/dist/components/tiptap-node/table-node/ui/table-clear-row-column-content-button/use-table-clear-row-column-content.d.ts +96 -0
- package/dist/components/tiptap-node/table-node/ui/table-delete-row-column-button/index.d.ts +2 -0
- package/dist/components/tiptap-node/table-node/ui/table-delete-row-column-button/table-delete-row-column-button.d.ts +14 -0
- package/dist/components/tiptap-node/table-node/ui/table-delete-row-column-button/use-table-delete-row-column.d.ts +80 -0
- package/dist/components/tiptap-node/table-node/ui/table-duplicate-row-column-button/index.d.ts +2 -0
- package/dist/components/tiptap-node/table-node/ui/table-duplicate-row-column-button/table-duplicate-row-column-button.d.ts +6 -0
- package/dist/components/tiptap-node/table-node/ui/table-duplicate-row-column-button/use-table-duplicate-row-column.d.ts +42 -0
- package/dist/components/tiptap-node/table-node/ui/table-extend-row-column-button/index.d.ts +2 -0
- package/dist/components/tiptap-node/table-node/ui/table-extend-row-column-button/table-extend-row-column-button.d.ts +23 -0
- package/dist/components/tiptap-node/table-node/ui/table-extend-row-column-button/use-table-extend-row-column.d.ts +14 -0
- package/dist/components/tiptap-node/table-node/ui/table-fit-to-width-button/index.d.ts +2 -0
- package/dist/components/tiptap-node/table-node/ui/table-fit-to-width-button/table-fit-to-width-button.d.ts +21 -0
- package/dist/components/tiptap-node/table-node/ui/table-fit-to-width-button/use-table-fit-to-width.d.ts +67 -0
- package/dist/components/tiptap-node/table-node/ui/table-handle/table-handle.d.ts +50 -0
- package/dist/components/tiptap-node/table-node/ui/table-handle/use-table-handle-positioning.d.ts +41 -0
- package/dist/components/tiptap-node/table-node/ui/table-handle-menu/index.d.ts +1 -0
- package/dist/components/tiptap-node/table-node/ui/table-handle-menu/table-handle-menu.d.ts +25 -0
- package/dist/components/tiptap-node/table-node/ui/table-header-row-column-button/index.d.ts +2 -0
- package/dist/components/tiptap-node/table-node/ui/table-header-row-column-button/table-header-row-column-button.d.ts +15 -0
- package/dist/components/tiptap-node/table-node/ui/table-header-row-column-button/use-table-header-row-column.d.ts +51 -0
- package/dist/components/tiptap-node/table-node/ui/table-merge-split-cell-button/index.d.ts +2 -0
- package/dist/components/tiptap-node/table-node/ui/table-merge-split-cell-button/table-merge-split-cell-button.d.ts +43 -0
- package/dist/components/tiptap-node/table-node/ui/table-merge-split-cell-button/use-table-merge-split-cell.d.ts +119 -0
- package/dist/components/tiptap-node/table-node/ui/table-move-row-column-button/index.d.ts +2 -0
- package/dist/components/tiptap-node/table-node/ui/table-move-row-column-button/table-move-row-column-button.d.ts +37 -0
- package/dist/components/tiptap-node/table-node/ui/table-move-row-column-button/use-table-move-row-column.d.ts +94 -0
- package/dist/components/tiptap-node/table-node/ui/table-selection-overlay/index.d.ts +1 -0
- package/dist/components/tiptap-node/table-node/ui/table-selection-overlay/table-selection-overlay.d.ts +14 -0
- package/dist/components/tiptap-node/table-node/ui/table-selection-overlay/use-resize-overlay.d.ts +2 -0
- package/dist/components/tiptap-node/table-node/ui/table-sort-row-column-button/index.d.ts +2 -0
- package/dist/components/tiptap-node/table-node/ui/table-sort-row-column-button/table-sort-row-column-button.d.ts +14 -0
- package/dist/components/tiptap-node/table-node/ui/table-sort-row-column-button/use-table-sort-row-column.d.ts +111 -0
- package/dist/components/tiptap-node/toc-node/context/toc-context.d.ts +44 -0
- package/dist/components/tiptap-node/toc-node/extensions/toc-node-extension.d.ts +45 -0
- package/dist/components/tiptap-node/toc-node/index.d.ts +3 -0
- package/dist/components/tiptap-node/toc-node/toc-node.d.ts +4 -0
- package/dist/components/tiptap-node/toc-node/ui/toc-show-title-button/index.d.ts +2 -0
- package/dist/components/tiptap-node/toc-node/ui/toc-show-title-button/toc-show-title-button.d.ts +16 -0
- package/dist/components/tiptap-node/toc-node/ui/toc-show-title-button/toc-show-title.d.ts +83 -0
- package/dist/components/tiptap-node/toc-node/ui/toc-sidebar/index.d.ts +1 -0
- package/dist/components/tiptap-node/toc-node/ui/toc-sidebar/toc-sidebar.d.ts +14 -0
- package/dist/components/tiptap-templates/omnibox/omnibox-editor-header.d.ts +1 -0
- package/dist/components/tiptap-templates/omnibox/omnibox-editor-mobile-toolbar.d.ts +14 -0
- package/dist/components/tiptap-templates/omnibox/omnibox-editor-theme-toggle.d.ts +1 -0
- package/dist/components/tiptap-templates/omnibox/omnibox-editor-toolbar-floating.d.ts +15 -0
- package/dist/components/tiptap-templates/omnibox/omnibox-editor.d.ts +28 -0
- package/dist/components/tiptap-ui/blockquote-button/blockquote-button.d.ts +22 -0
- package/dist/components/tiptap-ui/blockquote-button/index.d.ts +2 -0
- package/dist/components/tiptap-ui/blockquote-button/use-blockquote.d.ts +80 -0
- package/dist/components/tiptap-ui/code-block-button/code-block-button.d.ts +22 -0
- package/dist/components/tiptap-ui/code-block-button/index.d.ts +2 -0
- package/dist/components/tiptap-ui/code-block-button/use-code-block.d.ts +87 -0
- package/dist/components/tiptap-ui/color-highlight-button/color-highlight-button.d.ts +46 -0
- package/dist/components/tiptap-ui/color-highlight-button/index.d.ts +2 -0
- package/dist/components/tiptap-ui/color-highlight-button/use-color-highlight.d.ts +93 -0
- package/dist/components/tiptap-ui/color-highlight-popover/color-highlight-popover.d.ts +35 -0
- package/dist/components/tiptap-ui/color-highlight-popover/index.d.ts +1 -0
- package/dist/components/tiptap-ui/color-menu/color-menu.d.ts +39 -0
- package/dist/components/tiptap-ui/color-menu/index.d.ts +1 -0
- package/dist/components/tiptap-ui/color-text-button/color-text-button.d.ts +23 -0
- package/dist/components/tiptap-ui/color-text-button/index.d.ts +2 -0
- package/dist/components/tiptap-ui/color-text-button/use-color-text.d.ts +109 -0
- package/dist/components/tiptap-ui/color-text-popover/color-text-popover.d.ts +46 -0
- package/dist/components/tiptap-ui/color-text-popover/index.d.ts +2 -0
- package/dist/components/tiptap-ui/color-text-popover/use-color-text-popover.d.ts +132 -0
- package/dist/components/tiptap-ui/copy-anchor-link-button/copy-anchor-link-button.d.ts +22 -0
- package/dist/components/tiptap-ui/copy-anchor-link-button/index.d.ts +3 -0
- package/dist/components/tiptap-ui/copy-anchor-link-button/use-copy-anchor-link.d.ts +93 -0
- package/dist/components/tiptap-ui/copy-anchor-link-button/use-scroll-to-hash.d.ts +27 -0
- package/dist/components/tiptap-ui/copy-to-clipboard-button/copy-to-clipboard-button.d.ts +22 -0
- package/dist/components/tiptap-ui/copy-to-clipboard-button/index.d.ts +2 -0
- package/dist/components/tiptap-ui/copy-to-clipboard-button/use-copy-to-clipboard.d.ts +103 -0
- package/dist/components/tiptap-ui/delete-node-button/delete-node-button.d.ts +22 -0
- package/dist/components/tiptap-ui/delete-node-button/index.d.ts +2 -0
- package/dist/components/tiptap-ui/delete-node-button/use-delete-node.d.ts +82 -0
- package/dist/components/tiptap-ui/drag-context-menu/drag-context-menu-types.d.ts +30 -0
- package/dist/components/tiptap-ui/drag-context-menu/drag-context-menu.d.ts +3 -0
- package/dist/components/tiptap-ui/drag-context-menu/index.d.ts +2 -0
- package/dist/components/tiptap-ui/duplicate-button/duplicate-button.d.ts +22 -0
- package/dist/components/tiptap-ui/duplicate-button/index.d.ts +2 -0
- package/dist/components/tiptap-ui/duplicate-button/use-duplicate.d.ts +78 -0
- package/dist/components/tiptap-ui/emoji-dropdown-menu/emoji-dropdown-menu.d.ts +3 -0
- package/dist/components/tiptap-ui/emoji-dropdown-menu/index.d.ts +1 -0
- package/dist/components/tiptap-ui/emoji-menu/emoji-menu-utils.d.ts +6 -0
- package/dist/components/tiptap-ui/emoji-menu/emoji-menu.d.ts +18 -0
- package/dist/components/tiptap-ui/emoji-menu/index.d.ts +2 -0
- package/dist/components/tiptap-ui/emoji-trigger-button/emoji-trigger-button.d.ts +22 -0
- package/dist/components/tiptap-ui/emoji-trigger-button/index.d.ts +2 -0
- package/dist/components/tiptap-ui/emoji-trigger-button/use-emoji-trigger.d.ts +94 -0
- package/dist/components/tiptap-ui/heading-button/heading-button.d.ts +23 -0
- package/dist/components/tiptap-ui/heading-button/index.d.ts +2 -0
- package/dist/components/tiptap-ui/heading-button/use-heading.d.ts +108 -0
- package/dist/components/tiptap-ui/image-align-button/image-align-button.d.ts +23 -0
- package/dist/components/tiptap-ui/image-align-button/index.d.ts +2 -0
- package/dist/components/tiptap-ui/image-align-button/use-image-align.d.ts +110 -0
- package/dist/components/tiptap-ui/image-caption-button/image-caption-button.d.ts +16 -0
- package/dist/components/tiptap-ui/image-caption-button/index.d.ts +2 -0
- package/dist/components/tiptap-ui/image-caption-button/use-image-caption.d.ts +82 -0
- package/dist/components/tiptap-ui/image-download-button/image-download-button.d.ts +23 -0
- package/dist/components/tiptap-ui/image-download-button/index.d.ts +2 -0
- package/dist/components/tiptap-ui/image-download-button/use-image-download.d.ts +64 -0
- package/dist/components/tiptap-ui/image-upload-button/image-upload-button.d.ts +29 -0
- package/dist/components/tiptap-ui/image-upload-button/index.d.ts +2 -0
- package/dist/components/tiptap-ui/image-upload-button/use-image-upload.d.ts +84 -0
- package/dist/components/tiptap-ui/indent-button/indent-button.d.ts +30 -0
- package/dist/components/tiptap-ui/indent-button/index.d.ts +2 -0
- package/dist/components/tiptap-ui/indent-button/use-indent.d.ts +91 -0
- package/dist/components/tiptap-ui/link-popover/index.d.ts +2 -0
- package/dist/components/tiptap-ui/link-popover/link-popover.d.ts +58 -0
- package/dist/components/tiptap-ui/link-popover/use-link-popover.d.ts +117 -0
- package/dist/components/tiptap-ui/list-button/index.d.ts +2 -0
- package/dist/components/tiptap-ui/list-button/list-button.d.ts +23 -0
- package/dist/components/tiptap-ui/list-button/use-list.d.ts +97 -0
- package/dist/components/tiptap-ui/mark-button/index.d.ts +2 -0
- package/dist/components/tiptap-ui/mark-button/mark-button.d.ts +23 -0
- package/dist/components/tiptap-ui/mark-button/use-mark.d.ts +104 -0
- package/dist/components/tiptap-ui/mention-dropdown-menu/index.d.ts +1 -0
- package/dist/components/tiptap-ui/mention-dropdown-menu/mention-dropdown-menu.d.ts +4 -0
- package/dist/components/tiptap-ui/mention-trigger-button/index.d.ts +2 -0
- package/dist/components/tiptap-ui/mention-trigger-button/mention-trigger-button.d.ts +22 -0
- package/dist/components/tiptap-ui/mention-trigger-button/use-mention-trigger.d.ts +96 -0
- package/dist/components/tiptap-ui/move-node-button/index.d.ts +2 -0
- package/dist/components/tiptap-ui/move-node-button/move-node-button.d.ts +20 -0
- package/dist/components/tiptap-ui/move-node-button/use-move-node.d.ts +52 -0
- package/dist/components/tiptap-ui/reset-all-formatting-button/index.d.ts +2 -0
- package/dist/components/tiptap-ui/reset-all-formatting-button/reset-all-formatting-button.d.ts +24 -0
- package/dist/components/tiptap-ui/reset-all-formatting-button/use-reset-all-formatting.d.ts +106 -0
- package/dist/components/tiptap-ui/slash-command-trigger-button/index.d.ts +2 -0
- package/dist/components/tiptap-ui/slash-command-trigger-button/slash-command-trigger-button.d.ts +22 -0
- package/dist/components/tiptap-ui/slash-command-trigger-button/use-slash-command-trigger.d.ts +96 -0
- package/dist/components/tiptap-ui/slash-dropdown-menu/index.d.ts +2 -0
- package/dist/components/tiptap-ui/slash-dropdown-menu/slash-dropdown-menu.d.ts +8 -0
- package/dist/components/tiptap-ui/slash-dropdown-menu/use-slash-dropdown-menu.d.ts +126 -0
- package/dist/components/tiptap-ui/text-align-button/index.d.ts +2 -0
- package/dist/components/tiptap-ui/text-align-button/text-align-button.d.ts +30 -0
- package/dist/components/tiptap-ui/text-align-button/use-text-align.d.ts +102 -0
- package/dist/components/tiptap-ui/text-button/index.d.ts +2 -0
- package/dist/components/tiptap-ui/text-button/text-button.d.ts +22 -0
- package/dist/components/tiptap-ui/text-button/use-text.d.ts +86 -0
- package/dist/components/tiptap-ui/turn-into-dropdown/index.d.ts +2 -0
- package/dist/components/tiptap-ui/turn-into-dropdown/turn-into-dropdown.d.ts +16 -0
- package/dist/components/tiptap-ui/turn-into-dropdown/use-turn-into-dropdown.d.ts +149 -0
- package/dist/components/tiptap-ui/undo-redo-button/index.d.ts +2 -0
- package/dist/components/tiptap-ui/undo-redo-button/undo-redo-button.d.ts +23 -0
- package/dist/components/tiptap-ui/undo-redo-button/use-undo-redo.d.ts +90 -0
- package/dist/components/tiptap-ui-primitive/avatar/avatar.d.ts +23 -0
- package/dist/components/tiptap-ui-primitive/avatar/index.d.ts +1 -0
- package/dist/components/tiptap-ui-primitive/badge/badge.d.ts +11 -0
- package/dist/components/tiptap-ui-primitive/badge/index.d.ts +1 -0
- package/dist/components/tiptap-ui-primitive/button/button.d.ts +16 -0
- package/dist/components/tiptap-ui-primitive/button/index.d.ts +1 -0
- package/dist/components/tiptap-ui-primitive/button-group/button-group.d.ts +10 -0
- package/dist/components/tiptap-ui-primitive/button-group/index.d.ts +1 -0
- package/dist/components/tiptap-ui-primitive/card/card.d.ts +10 -0
- package/dist/components/tiptap-ui-primitive/card/index.d.ts +1 -0
- package/dist/components/tiptap-ui-primitive/combobox/combobox.d.ts +21 -0
- package/dist/components/tiptap-ui-primitive/combobox/index.d.ts +1 -0
- package/dist/components/tiptap-ui-primitive/dropdown-menu/dropdown-menu.d.ts +29 -0
- package/dist/components/tiptap-ui-primitive/dropdown-menu/index.d.ts +1 -0
- package/dist/components/tiptap-ui-primitive/input/index.d.ts +1 -0
- package/dist/components/tiptap-ui-primitive/input/input.d.ts +3 -0
- package/dist/components/tiptap-ui-primitive/input-group/index.d.ts +1 -0
- package/dist/components/tiptap-ui-primitive/input-group/input-group.d.ts +19 -0
- package/dist/components/tiptap-ui-primitive/menu/index.d.ts +5 -0
- package/dist/components/tiptap-ui-primitive/menu/menu-context.d.ts +5 -0
- package/dist/components/tiptap-ui-primitive/menu/menu-hooks.d.ts +10 -0
- package/dist/components/tiptap-ui-primitive/menu/menu-types.d.ts +44 -0
- package/dist/components/tiptap-ui-primitive/menu/menu-utils.d.ts +15 -0
- package/dist/components/tiptap-ui-primitive/menu/menu.d.ts +20 -0
- package/dist/components/tiptap-ui-primitive/popover/index.d.ts +1 -0
- package/dist/components/tiptap-ui-primitive/popover/popover.d.ts +6 -0
- package/dist/components/tiptap-ui-primitive/separator/index.d.ts +1 -0
- package/dist/components/tiptap-ui-primitive/separator/separator.d.ts +5 -0
- package/dist/components/tiptap-ui-primitive/spacer/index.d.ts +1 -0
- package/dist/components/tiptap-ui-primitive/spacer/spacer.d.ts +5 -0
- package/dist/components/tiptap-ui-primitive/textarea/index.d.ts +1 -0
- package/dist/components/tiptap-ui-primitive/textarea/textarea.d.ts +3 -0
- package/dist/components/tiptap-ui-primitive/toolbar/index.d.ts +1 -0
- package/dist/components/tiptap-ui-primitive/toolbar/toolbar.d.ts +9 -0
- package/dist/components/tiptap-ui-primitive/tooltip/index.d.ts +1 -0
- package/dist/components/tiptap-ui-primitive/tooltip/tooltip.d.ts +29 -0
- package/dist/components/tiptap-ui-utils/floating-element/floating-element-utils.d.ts +3 -0
- package/dist/components/tiptap-ui-utils/floating-element/floating-element.d.ts +53 -0
- package/dist/components/tiptap-ui-utils/floating-element/index.d.ts +2 -0
- package/dist/components/tiptap-ui-utils/suggestion-menu/index.d.ts +3 -0
- package/dist/components/tiptap-ui-utils/suggestion-menu/suggestion-menu-types.d.ts +86 -0
- package/dist/components/tiptap-ui-utils/suggestion-menu/suggestion-menu-utils.d.ts +19 -0
- package/dist/components/tiptap-ui-utils/suggestion-menu/suggestion-menu.d.ts +6 -0
- package/dist/cvnert-editor.css +1 -0
- package/dist/cvnert-editor.js +17069 -0
- package/dist/cvnert-editor.umd.cjs +5 -0
- package/dist/hooks/use-composed-ref.d.ts +3 -0
- package/dist/hooks/use-cursor-visibility.d.ts +20 -0
- package/dist/hooks/use-element-rect.d.ts +35 -0
- package/dist/hooks/use-floating-element.d.ts +36 -0
- package/dist/hooks/use-floating-toolbar-visibility.d.ts +29 -0
- package/dist/hooks/use-is-breakpoint.d.ts +9 -0
- package/dist/hooks/use-isomorphic-layout-effect.d.ts +7 -0
- package/dist/hooks/use-menu-navigation.d.ts +52 -0
- package/dist/hooks/use-on-click-outside.d.ts +18 -0
- package/dist/hooks/use-throttled-callback.d.ts +18 -0
- package/dist/hooks/use-tiptap-editor.d.ts +6 -0
- package/dist/hooks/use-ui-editor-state.d.ts +4 -0
- package/dist/hooks/use-unmount.d.ts +7 -0
- package/dist/hooks/use-window-size.d.ts +35 -0
- package/dist/index.d.ts +3 -0
- package/dist/lib/tiptap-advanced-utils.d.ts +120 -0
- package/dist/lib/tiptap-collab-utils.d.ts +46 -0
- package/dist/lib/tiptap-utils.d.ts +174 -0
- package/dist/types.d.ts +26 -0
- package/package.json +94 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/react";
|
|
2
|
+
import type { ColorType, ColorItem, ColorValueResolver, RecentColor, UseColorTextPopoverConfig } from "@/components/tiptap-ui/color-text-popover";
|
|
3
|
+
import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
|
|
4
|
+
import { Button } from "@/components/tiptap-ui-primitive/button";
|
|
5
|
+
import "@/components/tiptap-ui/color-text-popover/color-text-popover.css";
|
|
6
|
+
type ColorChangePayload = {
|
|
7
|
+
type: ColorType;
|
|
8
|
+
label: string;
|
|
9
|
+
value: string;
|
|
10
|
+
};
|
|
11
|
+
export interface RecentColorButtonProps extends ButtonProps {
|
|
12
|
+
colorObj: RecentColor;
|
|
13
|
+
withLabel?: boolean;
|
|
14
|
+
onColorChanged?: (payload: ColorChangePayload) => void;
|
|
15
|
+
editor?: Editor | null;
|
|
16
|
+
resolveColorValue?: ColorValueResolver;
|
|
17
|
+
}
|
|
18
|
+
export declare function RecentColorButton({ colorObj, withLabel, onColorChanged, editor, resolveColorValue, ...props }: RecentColorButtonProps): import("react").JSX.Element;
|
|
19
|
+
export interface ColorGroupProps {
|
|
20
|
+
type: ColorType;
|
|
21
|
+
colors: ColorItem[][];
|
|
22
|
+
onColorSelected: (payload: ColorChangePayload) => void;
|
|
23
|
+
selectedIndex?: number;
|
|
24
|
+
startIndexOffset: number;
|
|
25
|
+
editor?: Editor | null;
|
|
26
|
+
resolveColorValue?: ColorValueResolver;
|
|
27
|
+
}
|
|
28
|
+
export declare function ColorGroup({ type, colors, onColorSelected, selectedIndex, startIndexOffset, editor, resolveColorValue, }: ColorGroupProps): import("react").JSX.Element[];
|
|
29
|
+
export interface TextStyleColorPanelProps {
|
|
30
|
+
maxColorsPerGroup?: number;
|
|
31
|
+
maxRecentColors?: number;
|
|
32
|
+
onColorChanged?: (payload: ColorChangePayload) => void;
|
|
33
|
+
editor?: Editor | null;
|
|
34
|
+
resolveColorValue?: ColorValueResolver;
|
|
35
|
+
}
|
|
36
|
+
export declare function TextStyleColorPanel({ maxColorsPerGroup, maxRecentColors, onColorChanged, editor, resolveColorValue, }: TextStyleColorPanelProps): import("react").JSX.Element;
|
|
37
|
+
export interface ColorTextPopoverProps extends Omit<React.ComponentProps<typeof Button>, "type">, UseColorTextPopoverConfig {
|
|
38
|
+
resolveColorValue?: ColorValueResolver;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Color text popover component for Tiptap editors.
|
|
42
|
+
*
|
|
43
|
+
* For custom popover implementations, use the `useColorTextPopover` hook instead.
|
|
44
|
+
*/
|
|
45
|
+
export declare function ColorTextPopover({ editor: providedEditor, hideWhenUnavailable, onColorChanged, onClick, children, ref, resolveColorValue, ...buttonProps }: ColorTextPopoverProps): import("react").JSX.Element | null;
|
|
46
|
+
export default ColorTextPopover;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/react";
|
|
2
|
+
export type ColorType = "text" | "highlight";
|
|
3
|
+
export interface ColorItem {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
export interface RecentColor {
|
|
8
|
+
type: ColorType;
|
|
9
|
+
label: string;
|
|
10
|
+
value: string;
|
|
11
|
+
}
|
|
12
|
+
export type ColorValueResolver = ({ type, label, value, }: {
|
|
13
|
+
type: ColorType;
|
|
14
|
+
label: string;
|
|
15
|
+
value: string;
|
|
16
|
+
}) => string;
|
|
17
|
+
/**
|
|
18
|
+
* Configuration for the color text popover functionality
|
|
19
|
+
*/
|
|
20
|
+
export interface UseColorTextPopoverConfig {
|
|
21
|
+
/**
|
|
22
|
+
* The Tiptap editor instance.
|
|
23
|
+
*/
|
|
24
|
+
editor?: Editor | null;
|
|
25
|
+
/**
|
|
26
|
+
* Whether the popover should hide when color text is not available.
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
hideWhenUnavailable?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Callback function called after a color is applied.
|
|
32
|
+
*/
|
|
33
|
+
onColorChanged?: ({ type, label, value, }: {
|
|
34
|
+
type: ColorType;
|
|
35
|
+
label: string;
|
|
36
|
+
value: string;
|
|
37
|
+
}) => void;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Get a color object by its value
|
|
41
|
+
*/
|
|
42
|
+
export declare function getColorByValue(value: string, colorArray: ColorItem[]): ColorItem;
|
|
43
|
+
/**
|
|
44
|
+
* Checks if color text popover should be shown
|
|
45
|
+
*/
|
|
46
|
+
export declare function shouldShowColorTextPopover(params: {
|
|
47
|
+
editor: Editor | null;
|
|
48
|
+
hideWhenUnavailable: boolean;
|
|
49
|
+
}): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Hook to manage recently used colors
|
|
52
|
+
*/
|
|
53
|
+
export declare function useRecentColors(maxColors?: number): {
|
|
54
|
+
recentColors: RecentColor[];
|
|
55
|
+
addRecentColor: ({ type, label, value, }: {
|
|
56
|
+
type: ColorType;
|
|
57
|
+
label: string;
|
|
58
|
+
value: string;
|
|
59
|
+
}) => void;
|
|
60
|
+
isInitialized: boolean;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Custom hook that provides color text popover functionality for Tiptap editor
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```tsx
|
|
67
|
+
* // Simple usage - no params needed
|
|
68
|
+
* function MySimpleColorTextPopover() {
|
|
69
|
+
* const { isVisible, handleColorChanged } = useColorTextPopover()
|
|
70
|
+
*
|
|
71
|
+
* if (!isVisible) return null
|
|
72
|
+
*
|
|
73
|
+
* return (
|
|
74
|
+
* <Popover>
|
|
75
|
+
* <PopoverTrigger asChild>
|
|
76
|
+
* <button>Color Text</button>
|
|
77
|
+
* </PopoverTrigger>
|
|
78
|
+
* <PopoverContent>
|
|
79
|
+
* <TextStyleColorPanel onColorChanged={handleColorChanged} />
|
|
80
|
+
* </PopoverContent>
|
|
81
|
+
* </Popover>
|
|
82
|
+
* )
|
|
83
|
+
* }
|
|
84
|
+
*
|
|
85
|
+
* // Advanced usage with configuration
|
|
86
|
+
* function MyAdvancedColorTextPopover() {
|
|
87
|
+
* const {
|
|
88
|
+
* isVisible,
|
|
89
|
+
* activeTextStyle,
|
|
90
|
+
* activeHighlight,
|
|
91
|
+
* handleColorChanged,
|
|
92
|
+
* label,
|
|
93
|
+
* Icon,
|
|
94
|
+
* } = useColorTextPopover({
|
|
95
|
+
* editor: myEditor,
|
|
96
|
+
* hideWhenUnavailable: true,
|
|
97
|
+
* onColorChanged: ({ type, label, value }) => console.log('Color changed!', { type, label, value })
|
|
98
|
+
* })
|
|
99
|
+
*
|
|
100
|
+
* if (!isVisible) return null
|
|
101
|
+
*
|
|
102
|
+
* return (
|
|
103
|
+
* <Popover>
|
|
104
|
+
* <PopoverTrigger asChild>
|
|
105
|
+
* <Button
|
|
106
|
+
* disabled={isDisabled}
|
|
107
|
+
* aria-label={label}
|
|
108
|
+
* >
|
|
109
|
+
* <Icon style={{ color: activeTextStyle.color }} />
|
|
110
|
+
* </Button>
|
|
111
|
+
* </PopoverTrigger>
|
|
112
|
+
* <PopoverContent>
|
|
113
|
+
* <TextStyleColorPanel onColorChanged={handleColorChanged} />
|
|
114
|
+
* </PopoverContent>
|
|
115
|
+
* </Popover>
|
|
116
|
+
* )
|
|
117
|
+
* }
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
export declare function useColorTextPopover(config?: UseColorTextPopoverConfig): {
|
|
121
|
+
isVisible: boolean;
|
|
122
|
+
canToggle: boolean;
|
|
123
|
+
activeTextStyle: import("@tiptap/pm/model").Attrs;
|
|
124
|
+
activeHighlight: import("@tiptap/pm/model").Attrs;
|
|
125
|
+
handleColorChanged: ({ type, label, value, }: {
|
|
126
|
+
type: ColorType;
|
|
127
|
+
label: string;
|
|
128
|
+
value: string;
|
|
129
|
+
}) => void;
|
|
130
|
+
label: string;
|
|
131
|
+
Icon: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
132
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { UseCopyAnchorLinkConfig } from "@/components/tiptap-ui/copy-anchor-link-button";
|
|
2
|
+
import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
|
|
3
|
+
export interface CopyAnchorLinkButtonProps extends Omit<ButtonProps, "type">, UseCopyAnchorLinkConfig {
|
|
4
|
+
/**
|
|
5
|
+
* Optional text to display alongside the icon.
|
|
6
|
+
*/
|
|
7
|
+
text?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Optional show shortcut keys in the button.
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
12
|
+
showShortcut?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function CopyAnchorLinkShortcutBadge({ shortcutKeys, }: {
|
|
15
|
+
shortcutKeys?: string;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
17
|
+
/**
|
|
18
|
+
* Button component for copying anchor links in a Tiptap editor.
|
|
19
|
+
*
|
|
20
|
+
* For custom button implementations, use the `useCopyAnchorLink` hook instead.
|
|
21
|
+
*/
|
|
22
|
+
export declare const CopyAnchorLinkButton: import("react").ForwardRefExoticComponent<CopyAnchorLinkButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { type Editor } from "@tiptap/react";
|
|
2
|
+
import type { Node } from "@tiptap/pm/model";
|
|
3
|
+
export declare const COPY_ANCHOR_LINK_SHORTCUT_KEY = "mod+ctrl+l";
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for the copy anchor link functionality
|
|
6
|
+
*/
|
|
7
|
+
export interface UseCopyAnchorLinkConfig {
|
|
8
|
+
/**
|
|
9
|
+
* The Tiptap editor instance.
|
|
10
|
+
*/
|
|
11
|
+
editor?: Editor | null;
|
|
12
|
+
/**
|
|
13
|
+
* Whether the button should hide when no node ID is available.
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
16
|
+
hideWhenUnavailable?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Called when the copy operation finishes.
|
|
19
|
+
* Provides a boolean indicating whether a node ID was found.
|
|
20
|
+
*/
|
|
21
|
+
onNodeIdNotFound?: (found: boolean) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Called after the node ID is extracted.
|
|
24
|
+
* Provides the extracted node ID, or null if none found.
|
|
25
|
+
*/
|
|
26
|
+
onExtractedNodeId?: (nodeId: string | null) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Callback function called after a successful copy operation.
|
|
29
|
+
*/
|
|
30
|
+
onCopied?: () => void;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Extracts the data-id from a node
|
|
34
|
+
*/
|
|
35
|
+
export declare function extractNodeId(node: Node | null, attributeName: string): string | null;
|
|
36
|
+
/**
|
|
37
|
+
* Checks if a node has a data-id that can be copied
|
|
38
|
+
*/
|
|
39
|
+
export declare function canCopyAnchorLink(editor: Editor | null): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Extracts and copies the node ID to clipboard with full URL like Omnibox
|
|
42
|
+
*/
|
|
43
|
+
export declare function copyNodeId(editor: Editor | null, onExtractedNodeId?: (nodeId: string | null) => void, onNodeIdNotFound?: (found: boolean) => void): Promise<boolean>;
|
|
44
|
+
/**
|
|
45
|
+
* Determines if the copy anchor link button should be shown
|
|
46
|
+
*/
|
|
47
|
+
export declare function shouldShowButton(props: {
|
|
48
|
+
editor: Editor | null;
|
|
49
|
+
hideWhenUnavailable: boolean;
|
|
50
|
+
}): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Custom hook that provides copy anchor link functionality for Tiptap editor
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```tsx
|
|
56
|
+
* // Simple usage - no params needed
|
|
57
|
+
* function MyCopyAnchorLinkButton() {
|
|
58
|
+
* const { isVisible, handleCopyAnchorLink } = useCopyAnchorLink()
|
|
59
|
+
*
|
|
60
|
+
* if (!isVisible) return null
|
|
61
|
+
*
|
|
62
|
+
* return <button onClick={handleCopyAnchorLink}>Copy Link</button>
|
|
63
|
+
* }
|
|
64
|
+
*
|
|
65
|
+
* // Advanced usage with configuration
|
|
66
|
+
* function MyAdvancedCopyAnchorLinkButton() {
|
|
67
|
+
* const { isVisible, handleCopyAnchorLink, label } = useCopyAnchorLink({
|
|
68
|
+
* editor: myEditor,
|
|
69
|
+
* hideWhenUnavailable: true,
|
|
70
|
+
* onCopied: () => console.log('Link copied!')
|
|
71
|
+
* })
|
|
72
|
+
*
|
|
73
|
+
* if (!isVisible) return null
|
|
74
|
+
*
|
|
75
|
+
* return (
|
|
76
|
+
* <MyButton
|
|
77
|
+
* onClick={handleCopyAnchorLink}
|
|
78
|
+
* aria-label={label}
|
|
79
|
+
* >
|
|
80
|
+
* Copy Anchor Link
|
|
81
|
+
* </MyButton>
|
|
82
|
+
* )
|
|
83
|
+
* }
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
export declare function useCopyAnchorLink(config?: UseCopyAnchorLinkConfig): {
|
|
87
|
+
isVisible: boolean;
|
|
88
|
+
handleCopyAnchorLink: () => Promise<boolean>;
|
|
89
|
+
canCopyAnchorLink: boolean;
|
|
90
|
+
label: string;
|
|
91
|
+
shortcutKeys: string;
|
|
92
|
+
Icon: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
93
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type Editor } from "@tiptap/react";
|
|
2
|
+
export interface UseScrollToHashConfig {
|
|
3
|
+
/**
|
|
4
|
+
* The Tiptap editor instance.
|
|
5
|
+
*/
|
|
6
|
+
editor?: Editor | null;
|
|
7
|
+
/**
|
|
8
|
+
* Callback called when the target node is found.
|
|
9
|
+
* @param nodeId The ID of the found node
|
|
10
|
+
*/
|
|
11
|
+
onTargetFound?: (nodeId: string) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Callback called when the target node is not found.
|
|
14
|
+
* @param hash The hash that was attempted to be scrolled to
|
|
15
|
+
*/
|
|
16
|
+
onTargetNotFound?: (hash: string) => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Hook to scroll to a specific hash in the Tiptap editor.
|
|
20
|
+
* It finds the node with the given ID and scrolls it into view.
|
|
21
|
+
*
|
|
22
|
+
* @param config Configuration for the scroll behavior
|
|
23
|
+
* @returns Function to scroll to a specific hash
|
|
24
|
+
*/
|
|
25
|
+
export declare function useScrollToHash(config?: UseScrollToHashConfig): {
|
|
26
|
+
scrollToHash: (id: string) => boolean;
|
|
27
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { UseCopyToClipboardConfig } from "@/components/tiptap-ui/copy-to-clipboard-button";
|
|
2
|
+
import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
|
|
3
|
+
export interface CopyToClipboardButtonProps extends Omit<ButtonProps, "type">, UseCopyToClipboardConfig {
|
|
4
|
+
/**
|
|
5
|
+
* Optional text to display alongside the icon.
|
|
6
|
+
*/
|
|
7
|
+
text?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Optional show shortcut keys in the button.
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
12
|
+
showShortcut?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function CopyToClipboardShortcutBadge({ shortcutKeys, }: {
|
|
15
|
+
shortcutKeys?: string;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
17
|
+
/**
|
|
18
|
+
* Button component for copying content to clipboard in a Tiptap editor.
|
|
19
|
+
*
|
|
20
|
+
* For custom button implementations, use the `useCopyToClipboard` hook instead.
|
|
21
|
+
*/
|
|
22
|
+
export declare const CopyToClipboardButton: import("react").ForwardRefExoticComponent<CopyToClipboardButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/react";
|
|
2
|
+
import type { Transaction } from "@tiptap/pm/state";
|
|
3
|
+
export declare const COPY_TO_CLIPBOARD_SHORTCUT_KEY = "mod+c";
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for the copy to clipboard functionality
|
|
6
|
+
*/
|
|
7
|
+
export interface UseCopyToClipboardConfig {
|
|
8
|
+
/**
|
|
9
|
+
* The Tiptap editor instance.
|
|
10
|
+
*/
|
|
11
|
+
editor?: Editor | null;
|
|
12
|
+
/**
|
|
13
|
+
* Whether to copy the text with formatting (default: true)
|
|
14
|
+
* When true, attempts to copy HTML format to clipboard
|
|
15
|
+
*/
|
|
16
|
+
copyWithFormatting?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the button should hide when copying is not available.
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
hideWhenUnavailable?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Callback function called after a successful copy operation.
|
|
24
|
+
*/
|
|
25
|
+
onCopied?: () => void;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Writes text and optional HTML content to the clipboard
|
|
29
|
+
* @param textContent The plain text content to write
|
|
30
|
+
* @param htmlContent Optional HTML content to write
|
|
31
|
+
* @returns Promise that resolves when the content is successfully written
|
|
32
|
+
*/
|
|
33
|
+
export declare function writeToClipboard(textContent: string, htmlContent?: string): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Checks if content can be copied in the current editor state
|
|
36
|
+
*/
|
|
37
|
+
export declare function canCopyContent(tr: Transaction): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Checks if formatting can be reset for a node
|
|
40
|
+
*/
|
|
41
|
+
export declare function canCopyToClipboard(editor: Editor | null): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Helper function to extract content from selection or document
|
|
44
|
+
*/
|
|
45
|
+
export declare function extractContent(editor: Editor, copyWithFormatting?: boolean): {
|
|
46
|
+
textContent: string;
|
|
47
|
+
htmlContent?: string;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Copies content to clipboard
|
|
51
|
+
*/
|
|
52
|
+
export declare function copyToClipboard(editor: Editor | null, copyWithFormatting?: boolean): Promise<boolean>;
|
|
53
|
+
/**
|
|
54
|
+
* Determines if the copy to clipboard button should be shown
|
|
55
|
+
*/
|
|
56
|
+
export declare function shouldShowButton(props: {
|
|
57
|
+
editor: Editor | null;
|
|
58
|
+
hideWhenUnavailable: boolean;
|
|
59
|
+
}): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Custom hook that provides copy to clipboard functionality for Tiptap editor
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```tsx
|
|
65
|
+
* // Simple usage - no params needed
|
|
66
|
+
* function MySimpleCopyButton() {
|
|
67
|
+
* const { isVisible, handleCopyToClipboard } = useCopyToClipboard()
|
|
68
|
+
*
|
|
69
|
+
* if (!isVisible) return null
|
|
70
|
+
*
|
|
71
|
+
* return <button onClick={handleCopyToClipboard}>Copy</button>
|
|
72
|
+
* }
|
|
73
|
+
*
|
|
74
|
+
* // Advanced usage with configuration
|
|
75
|
+
* function MyAdvancedCopyButton() {
|
|
76
|
+
* const { isVisible, handleCopyToClipboard, label } = useCopyToClipboard({
|
|
77
|
+
* editor: myEditor,
|
|
78
|
+
* copyWithFormatting: false,
|
|
79
|
+
* hideWhenUnavailable: true,
|
|
80
|
+
* onCopied: () => console.log('Content copied!')
|
|
81
|
+
* })
|
|
82
|
+
*
|
|
83
|
+
* if (!isVisible) return null
|
|
84
|
+
*
|
|
85
|
+
* return (
|
|
86
|
+
* <MyButton
|
|
87
|
+
* onClick={handleCopyToClipboard}
|
|
88
|
+
* aria-label={label}
|
|
89
|
+
* >
|
|
90
|
+
* Copy Content
|
|
91
|
+
* </MyButton>
|
|
92
|
+
* )
|
|
93
|
+
* }
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
export declare function useCopyToClipboard(config?: UseCopyToClipboardConfig): {
|
|
97
|
+
isVisible: boolean;
|
|
98
|
+
handleCopyToClipboard: () => Promise<boolean>;
|
|
99
|
+
canCopyToClipboard: boolean;
|
|
100
|
+
label: string;
|
|
101
|
+
shortcutKeys: string;
|
|
102
|
+
Icon: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
103
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { UseDeleteNodeConfig } from "@/components/tiptap-ui/delete-node-button";
|
|
2
|
+
import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
|
|
3
|
+
export interface DeleteNodeButtonProps extends Omit<ButtonProps, "type">, UseDeleteNodeConfig {
|
|
4
|
+
/**
|
|
5
|
+
* Optional text to display alongside the icon.
|
|
6
|
+
*/
|
|
7
|
+
text?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Optional show shortcut keys in the button.
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
12
|
+
showShortcut?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function DeleteNodeShortcutBadge({ shortcutKeys, }: {
|
|
15
|
+
shortcutKeys?: string;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
17
|
+
/**
|
|
18
|
+
* Button component for deleting a node in a Tiptap editor.
|
|
19
|
+
*
|
|
20
|
+
* For custom button implementations, use the `useDeleteNode` hook instead.
|
|
21
|
+
*/
|
|
22
|
+
export declare const DeleteNodeButton: import("react").ForwardRefExoticComponent<DeleteNodeButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { type Editor } from "@tiptap/react";
|
|
2
|
+
export declare const DELETE_NODE_SHORTCUT_KEY = "backspace";
|
|
3
|
+
/**
|
|
4
|
+
* Configuration for the delete node functionality
|
|
5
|
+
*/
|
|
6
|
+
export interface UseDeleteNodeConfig {
|
|
7
|
+
/**
|
|
8
|
+
* The Tiptap editor instance.
|
|
9
|
+
*/
|
|
10
|
+
editor?: Editor | null;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the button should hide when node deletion is not available.
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
hideWhenUnavailable?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Callback function called after a successful deletion.
|
|
18
|
+
*/
|
|
19
|
+
onDeleted?: () => void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Checks if a node can be deleted based on the current selection
|
|
23
|
+
*/
|
|
24
|
+
export declare function canDeleteNode(editor: Editor | null): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Helper function to delete a node with fallback strategy
|
|
27
|
+
*/
|
|
28
|
+
export declare function deleteNodeAtPosition(editor: Editor, pos: number, nodeSize: number): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Deletes the selected node in the editor using current selection
|
|
31
|
+
*/
|
|
32
|
+
export declare function deleteNode(editor: Editor | null): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Determines if the delete node button should be shown
|
|
35
|
+
*/
|
|
36
|
+
export declare function shouldShowButton(props: {
|
|
37
|
+
editor: Editor | null;
|
|
38
|
+
hideWhenUnavailable: boolean;
|
|
39
|
+
}): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Custom hook that provides delete node functionality for Tiptap editor
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```tsx
|
|
45
|
+
* // Simple usage - no params needed
|
|
46
|
+
* function MySimpleDeleteButton() {
|
|
47
|
+
* const { isVisible, handleDeleteNode } = useDeleteNode()
|
|
48
|
+
*
|
|
49
|
+
* if (!isVisible) return null
|
|
50
|
+
*
|
|
51
|
+
* return <button onClick={handleDeleteNode}>Delete</button>
|
|
52
|
+
* }
|
|
53
|
+
*
|
|
54
|
+
* // Advanced usage with configuration
|
|
55
|
+
* function MyAdvancedDeleteButton() {
|
|
56
|
+
* const { isVisible, handleDeleteNode, label } = useDeleteNode({
|
|
57
|
+
* editor: myEditor,
|
|
58
|
+
* hideWhenUnavailable: true,
|
|
59
|
+
* onDeleted: () => console.log('Node deleted!')
|
|
60
|
+
* })
|
|
61
|
+
*
|
|
62
|
+
* if (!isVisible) return null
|
|
63
|
+
*
|
|
64
|
+
* return (
|
|
65
|
+
* <MyButton
|
|
66
|
+
* onClick={handleDeleteNode}
|
|
67
|
+
* aria-label={label}
|
|
68
|
+
* >
|
|
69
|
+
* Delete Node
|
|
70
|
+
* </MyButton>
|
|
71
|
+
* )
|
|
72
|
+
* }
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
export declare function useDeleteNode(config?: UseDeleteNodeConfig): {
|
|
76
|
+
isVisible: boolean;
|
|
77
|
+
handleDeleteNode: () => boolean;
|
|
78
|
+
canDeleteNode: boolean;
|
|
79
|
+
label: string;
|
|
80
|
+
shortcutKeys: string;
|
|
81
|
+
Icon: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
82
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { DragHandleProps } from "@tiptap/extension-drag-handle-react";
|
|
2
|
+
import type { Node } from "@tiptap/pm/model";
|
|
3
|
+
import type { Editor } from "@tiptap/react";
|
|
4
|
+
export interface DragContextMenuProps extends Omit<DragHandleProps, "editor" | "children"> {
|
|
5
|
+
editor?: Editor | null;
|
|
6
|
+
withSlashCommandTrigger?: boolean;
|
|
7
|
+
mobileBreakpoint?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface NodeChangeData {
|
|
10
|
+
node: Node | null;
|
|
11
|
+
editor: Editor;
|
|
12
|
+
pos: number;
|
|
13
|
+
}
|
|
14
|
+
export interface MenuItemProps {
|
|
15
|
+
icon: React.ComponentType<{
|
|
16
|
+
className?: string;
|
|
17
|
+
style?: React.CSSProperties;
|
|
18
|
+
}>;
|
|
19
|
+
label: string;
|
|
20
|
+
onClick: () => void;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
isActive?: boolean;
|
|
23
|
+
shortcutBadge?: React.ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export interface ColorMenuItemProps {
|
|
26
|
+
color: {
|
|
27
|
+
value: string;
|
|
28
|
+
label: string;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { UseDuplicateConfig } from "@/components/tiptap-ui/duplicate-button";
|
|
2
|
+
import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
|
|
3
|
+
export interface DuplicateButtonProps extends Omit<ButtonProps, "type">, UseDuplicateConfig {
|
|
4
|
+
/**
|
|
5
|
+
* Optional text to display alongside the icon.
|
|
6
|
+
*/
|
|
7
|
+
text?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Optional show shortcut keys in the button.
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
12
|
+
showShortcut?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function DuplicateShortcutBadge({ shortcutKeys, }: {
|
|
15
|
+
shortcutKeys?: string;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
17
|
+
/**
|
|
18
|
+
* Button component for duplicating a node in a Tiptap editor.
|
|
19
|
+
*
|
|
20
|
+
* For custom button implementations, use the `useDuplicate` hook instead.
|
|
21
|
+
*/
|
|
22
|
+
export declare const DuplicateButton: import("react").ForwardRefExoticComponent<DuplicateButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|