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
package/dist/components/tiptap-node/table-node/ui/table-cell-handle-menu/table-cell-handle-menu.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/react";
|
|
2
|
+
import "./table-cell-handle-menu.css";
|
|
3
|
+
declare const TableActionMenu: ({ onClose }: {
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
}) => import("react").JSX.Element;
|
|
6
|
+
interface TableCellHandleMenuProps extends React.ComponentPropsWithoutRef<"button"> {
|
|
7
|
+
editor?: Editor | null;
|
|
8
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const TableCellHandleMenu: import("react").ForwardRefExoticComponent<TableCellHandleMenuProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
export { TableActionMenu };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { UseTableClearRowColumnContentConfig } from "@/components/tiptap-node/table-node/ui/table-clear-row-column-content-button";
|
|
2
|
+
import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
|
|
3
|
+
export interface TableClearRowColumnContentButtonProps extends Omit<ButtonProps, "type">, UseTableClearRowColumnContentConfig {
|
|
4
|
+
/**
|
|
5
|
+
* Optional text to display alongside the icon.
|
|
6
|
+
*/
|
|
7
|
+
text?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Button component for clearing table row/column content in a Tiptap editor.
|
|
11
|
+
*
|
|
12
|
+
* For custom button implementations, use the `useTableClearRowColumnContent` hook instead.
|
|
13
|
+
*/
|
|
14
|
+
export declare const TableClearRowColumnContentButton: import("react").ForwardRefExoticComponent<TableClearRowColumnContentButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/react";
|
|
2
|
+
import type { Orientation } from "@/components/tiptap-node/table-node/lib/tiptap-table-utils";
|
|
3
|
+
export interface UseTableClearRowColumnContentConfig {
|
|
4
|
+
/**
|
|
5
|
+
* The Tiptap editor instance. If omitted, the hook will use
|
|
6
|
+
* the context/editor from `useTiptapEditor`.
|
|
7
|
+
*/
|
|
8
|
+
editor?: Editor | null;
|
|
9
|
+
/**
|
|
10
|
+
* The index of the row or column to clear.
|
|
11
|
+
* If omitted, will clear the currently selected cells.
|
|
12
|
+
*/
|
|
13
|
+
index?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Whether you're clearing a row or a column.
|
|
16
|
+
* If omitted, will clear the currently selected cells.
|
|
17
|
+
*/
|
|
18
|
+
orientation?: Orientation;
|
|
19
|
+
/**
|
|
20
|
+
* The position of the table in the document.
|
|
21
|
+
*/
|
|
22
|
+
tablePos?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Hide the button when clearing isn't currently possible.
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
hideWhenUnavailable?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Whether to reset cell attributes (backgroundColor, nodeVerticalAlign, nodeTextAlign) when clearing.
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
resetAttrs?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Callback function called after a successful clear.
|
|
35
|
+
*/
|
|
36
|
+
onCleared?: () => void;
|
|
37
|
+
}
|
|
38
|
+
export declare const tableClearRowColumnContentLabels: Record<Orientation, string>;
|
|
39
|
+
/**
|
|
40
|
+
* Custom hook that provides **table row/column content clearing**
|
|
41
|
+
* functionality for the Tiptap editor.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```tsx
|
|
45
|
+
* // Clear currently selected cells (no parameters needed)
|
|
46
|
+
* function ClearSelectedButton() {
|
|
47
|
+
* const { isVisible, handleClear } = useTableClearRowColumnContent()
|
|
48
|
+
*
|
|
49
|
+
* if (!isVisible) return null
|
|
50
|
+
*
|
|
51
|
+
* return <button onClick={handleClear}>Clear Selection</button>
|
|
52
|
+
* }
|
|
53
|
+
*
|
|
54
|
+
* // Clear specific row with attribute reset
|
|
55
|
+
* function ClearRowButton({ rowIndex }: { rowIndex: number }) {
|
|
56
|
+
* const { isVisible, handleClear, label, canClearRowColumnContent } = useTableClearRowColumnContent({
|
|
57
|
+
* index: rowIndex,
|
|
58
|
+
* orientation: "row",
|
|
59
|
+
* resetAttrs: true,
|
|
60
|
+
* hideWhenUnavailable: true,
|
|
61
|
+
* onCleared: () => console.log("Row cleared and attributes reset!"),
|
|
62
|
+
* })
|
|
63
|
+
*
|
|
64
|
+
* if (!isVisible) return null
|
|
65
|
+
*
|
|
66
|
+
* return (
|
|
67
|
+
* <button
|
|
68
|
+
* onClick={handleClear}
|
|
69
|
+
* disabled={!canClearRowColumnContent}
|
|
70
|
+
* aria-label={label}
|
|
71
|
+
* >
|
|
72
|
+
* {label}
|
|
73
|
+
* </button>
|
|
74
|
+
* )
|
|
75
|
+
* }
|
|
76
|
+
*
|
|
77
|
+
* // Clear content based on current table selection (row/column/cells)
|
|
78
|
+
* function SmartClearButton() {
|
|
79
|
+
* const { isVisible, handleClear, label } = useTableClearRowColumnContent({
|
|
80
|
+
* resetAttrs: true,
|
|
81
|
+
* hideWhenUnavailable: true
|
|
82
|
+
* })
|
|
83
|
+
*
|
|
84
|
+
* if (!isVisible) return null
|
|
85
|
+
*
|
|
86
|
+
* return <button onClick={handleClear}>{label}</button>
|
|
87
|
+
* }
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
export declare function useTableClearRowColumnContent(config?: UseTableClearRowColumnContentConfig): {
|
|
91
|
+
isVisible: boolean;
|
|
92
|
+
canClearRowColumnContent: boolean;
|
|
93
|
+
handleClear: () => boolean;
|
|
94
|
+
label: string;
|
|
95
|
+
Icon: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
96
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { UseTableDeleteRowColumnConfig } from "@/components/tiptap-node/table-node/ui/table-delete-row-column-button";
|
|
2
|
+
import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
|
|
3
|
+
export interface TableDeleteRowColumnButtonProps extends Omit<ButtonProps, "type">, UseTableDeleteRowColumnConfig {
|
|
4
|
+
/**
|
|
5
|
+
* Optional text to display alongside the icon.
|
|
6
|
+
*/
|
|
7
|
+
text?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Button component for deleting a table row/column in a Tiptap editor.
|
|
11
|
+
*
|
|
12
|
+
* For custom button implementations, use the `useTableDeleteRowColumn` hook instead.
|
|
13
|
+
*/
|
|
14
|
+
export declare const TableDeleteRowColumnButton: import("react").ForwardRefExoticComponent<TableDeleteRowColumnButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/react";
|
|
2
|
+
import type { Orientation } from "@/components/tiptap-node/table-node/lib/tiptap-table-utils";
|
|
3
|
+
export interface UseTableDeleteRowColumnConfig {
|
|
4
|
+
/**
|
|
5
|
+
* The Tiptap editor instance. If omitted, the hook will use
|
|
6
|
+
* the context/editor from `useTiptapEditor`.
|
|
7
|
+
*/
|
|
8
|
+
editor?: Editor | null;
|
|
9
|
+
/**
|
|
10
|
+
* The index of the row or column to delete.
|
|
11
|
+
*/
|
|
12
|
+
index?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Whether you're deleting a row or a column.
|
|
15
|
+
*/
|
|
16
|
+
orientation?: Orientation;
|
|
17
|
+
/**
|
|
18
|
+
* The position of the table in the document.
|
|
19
|
+
*/
|
|
20
|
+
tablePos?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Hide the button when deletion isn't currently possible.
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
hideWhenUnavailable?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Callback function called after a successful delete.
|
|
28
|
+
*/
|
|
29
|
+
onDeleted?: () => void;
|
|
30
|
+
}
|
|
31
|
+
export declare const tableDeleteRowColumnLabels: Record<Orientation, string>;
|
|
32
|
+
/**
|
|
33
|
+
* Custom hook that provides **table row/column deletion**
|
|
34
|
+
* functionality for the Tiptap editor.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* // Simple usage with default editor context
|
|
39
|
+
* function DeleteRowButton() {
|
|
40
|
+
* const { isVisible, handleDelete } = useTableDeleteRowColumn({
|
|
41
|
+
* index: 0,
|
|
42
|
+
* orientation: "row",
|
|
43
|
+
* })
|
|
44
|
+
*
|
|
45
|
+
* if (!isVisible) return null
|
|
46
|
+
*
|
|
47
|
+
* return <button onClick={handleDelete}>Delete Row</button>
|
|
48
|
+
* }
|
|
49
|
+
*
|
|
50
|
+
* // Advanced usage with custom editor instance
|
|
51
|
+
* function DeleteColumnButton({ editor }: { editor: Editor }) {
|
|
52
|
+
* const { isVisible, handleDelete, label, canDeleteRowColumn, Icon } = useTableDeleteRowColumn({
|
|
53
|
+
* editor,
|
|
54
|
+
* index: 1,
|
|
55
|
+
* orientation: "column",
|
|
56
|
+
* hideWhenUnavailable: true,
|
|
57
|
+
* onDeleted: () => console.log("Column deleted!"),
|
|
58
|
+
* })
|
|
59
|
+
*
|
|
60
|
+
* if (!isVisible) return null
|
|
61
|
+
*
|
|
62
|
+
* return (
|
|
63
|
+
* <button
|
|
64
|
+
* onClick={handleDelete}
|
|
65
|
+
* aria-disabled={!canDeleteRowColumn}
|
|
66
|
+
* aria-label={label}
|
|
67
|
+
* >
|
|
68
|
+
* <Icon /> Delete Column
|
|
69
|
+
* </button>
|
|
70
|
+
* )
|
|
71
|
+
* }
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
export declare function useTableDeleteRowColumn(config: UseTableDeleteRowColumnConfig): {
|
|
75
|
+
isVisible: boolean;
|
|
76
|
+
canDeleteRowColumn: boolean;
|
|
77
|
+
handleDelete: () => boolean;
|
|
78
|
+
label: string;
|
|
79
|
+
Icon: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
80
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { UseTableDuplicateRowColumnConfig } from "@/components/tiptap-node/table-node/ui/table-duplicate-row-column-button";
|
|
2
|
+
import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
|
|
3
|
+
export interface TableDuplicateRowColumnButtonProps extends Omit<ButtonProps, "type">, UseTableDuplicateRowColumnConfig {
|
|
4
|
+
text?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const TableDuplicateRowColumnButton: import("react").ForwardRefExoticComponent<TableDuplicateRowColumnButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/react";
|
|
2
|
+
import type { Orientation } from "@/components/tiptap-node/table-node/lib/tiptap-table-utils";
|
|
3
|
+
export interface UseTableDuplicateRowColumnConfig {
|
|
4
|
+
/**
|
|
5
|
+
* The Tiptap editor instance. If omitted, the hook will use
|
|
6
|
+
* the context/editor from `useTiptapEditor`.
|
|
7
|
+
*/
|
|
8
|
+
editor?: Editor | null;
|
|
9
|
+
/**
|
|
10
|
+
* The index of the row or column to duplicate.
|
|
11
|
+
*/
|
|
12
|
+
index?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Whether you're duplicating a row or a column.
|
|
15
|
+
*/
|
|
16
|
+
orientation?: Orientation;
|
|
17
|
+
/**
|
|
18
|
+
* The position of the table in the document.
|
|
19
|
+
*/
|
|
20
|
+
tablePos?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Hide the button when duplication isn't currently possible.
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
hideWhenUnavailable?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Callback function called after a successful duplication.
|
|
28
|
+
*/
|
|
29
|
+
onDuplicated?: () => void;
|
|
30
|
+
}
|
|
31
|
+
export declare const tableDuplicateRowColumnLabels: Record<Orientation, string>;
|
|
32
|
+
/**
|
|
33
|
+
* Custom hook that provides **table row/column duplication**
|
|
34
|
+
* functionality for the Tiptap editor.
|
|
35
|
+
*/
|
|
36
|
+
export declare function useTableDuplicateRowColumn(config: UseTableDuplicateRowColumnConfig): {
|
|
37
|
+
isVisible: boolean;
|
|
38
|
+
canDuplicateRowColumn: boolean;
|
|
39
|
+
handleDuplicate: () => boolean;
|
|
40
|
+
label: string;
|
|
41
|
+
Icon: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
42
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type Editor } from "@tiptap/react";
|
|
2
|
+
import type { Node } from "@tiptap/pm/model";
|
|
3
|
+
import type { Orientation } from "@/components/tiptap-node/table-node/lib/tiptap-table-utils";
|
|
4
|
+
import "./table-extend-row-column-button.css";
|
|
5
|
+
interface TableExtendRowColumnButtonProps {
|
|
6
|
+
editor?: Editor | null;
|
|
7
|
+
block: Node;
|
|
8
|
+
onMouseDown: () => void;
|
|
9
|
+
onMouseUp: () => void;
|
|
10
|
+
orientation: Orientation;
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Simplified button component for extending/reducing table dimensions
|
|
15
|
+
*/
|
|
16
|
+
export declare const TableExtendRowColumnButton: React.FC<TableExtendRowColumnButtonProps>;
|
|
17
|
+
export interface TableExtendRowColumnButtonsProps {
|
|
18
|
+
editor?: Editor | null;
|
|
19
|
+
onMouseDown?: () => void;
|
|
20
|
+
onMouseUp?: () => void;
|
|
21
|
+
}
|
|
22
|
+
export declare const TableExtendRowColumnButtons: React.FC<TableExtendRowColumnButtonsProps>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface TableExtendRowColumnButtonPositionResult {
|
|
2
|
+
isMounted: boolean;
|
|
3
|
+
ref: (node: HTMLElement | null) => void;
|
|
4
|
+
style: React.CSSProperties;
|
|
5
|
+
}
|
|
6
|
+
interface TableExtendRowColumnButtonsPositioningResult {
|
|
7
|
+
rowButton: TableExtendRowColumnButtonPositionResult;
|
|
8
|
+
columnButton: TableExtendRowColumnButtonPositionResult;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Hook for managing positioning of both row and column extend buttons
|
|
12
|
+
*/
|
|
13
|
+
export declare function useTableExtendRowColumnButtonsPositioning(showAddOrRemoveColumnsButton: boolean, showAddOrRemoveRowsButton: boolean, referencePosTable: DOMRect | null): TableExtendRowColumnButtonsPositioningResult;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { UseTableFitToWidthConfig } from "@/components/tiptap-node/table-node/ui/table-fit-to-width-button/use-table-fit-to-width";
|
|
2
|
+
import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
|
|
3
|
+
export interface TableFitToWidthButtonProps extends Omit<ButtonProps, "type">, UseTableFitToWidthConfig {
|
|
4
|
+
text?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Button component for fitting table to container width.
|
|
8
|
+
*
|
|
9
|
+
* This component provides a user interface for toggling table width between
|
|
10
|
+
* fixed column widths and container-fitting behavior. It integrates with the
|
|
11
|
+
* Tiptap table extension to modify table layout properties.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <TableFitToWidthButton
|
|
16
|
+
* editor={editor}
|
|
17
|
+
* onWidthAdjusted={() => console.log('Width changed')}
|
|
18
|
+
* />
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare const TableFitToWidthButton: import("react").ForwardRefExoticComponent<TableFitToWidthButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/react";
|
|
2
|
+
export interface UseTableFitToWidthConfig {
|
|
3
|
+
/**
|
|
4
|
+
* The Tiptap editor instance. If omitted, the hook will use
|
|
5
|
+
* the editor from `useTiptapEditor`.
|
|
6
|
+
*/
|
|
7
|
+
editor?: Editor | null;
|
|
8
|
+
/**
|
|
9
|
+
* Hide the button when the action isn't currently possible.
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
12
|
+
hideWhenUnavailable?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Called after the table width is successfully adjusted.
|
|
15
|
+
*/
|
|
16
|
+
onWidthAdjusted?: () => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* React hook that provides a **Fit table to container width** action for Tiptap.
|
|
20
|
+
*
|
|
21
|
+
* What it does:
|
|
22
|
+
* - Sets the current table's `width` to `"100%"`
|
|
23
|
+
* - Clears cell-level `colwidth` so the table can expand fluidly
|
|
24
|
+
*
|
|
25
|
+
* Returned API:
|
|
26
|
+
* - `isVisible`: whether a button should be shown
|
|
27
|
+
* - `canFitToWidth`: whether the action can execute now
|
|
28
|
+
* - `handleFitToWidth()`: runs the action; returns `true` on success
|
|
29
|
+
* - `label`: UI label, e.g. "Fit to width"
|
|
30
|
+
* - `Icon`: a presentational icon component
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // Minimal button
|
|
34
|
+
* function FitToWidthButton() {
|
|
35
|
+
* const { isVisible, canFitToWidth, handleFitToWidth, label, Icon } =
|
|
36
|
+
* useTableFitToWidth({ hideWhenUnavailable: true })
|
|
37
|
+
*
|
|
38
|
+
* if (!isVisible) return null
|
|
39
|
+
* return (
|
|
40
|
+
* <button onClick={handleFitToWidth} disabled={!canFitToWidth} aria-label={label}>
|
|
41
|
+
* <Icon /> {label}
|
|
42
|
+
* </button>
|
|
43
|
+
* )
|
|
44
|
+
* }
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* // Using a provided editor instance and a success callback
|
|
48
|
+
* function FitToWidthWithCallback({ editor }: { editor: Editor }) {
|
|
49
|
+
* const { handleFitToWidth, canFitToWidth } = useTableFitToWidth({
|
|
50
|
+
* editor,
|
|
51
|
+
* hideWhenUnavailable: true,
|
|
52
|
+
* onWidthAdjusted: () => console.log("Table set to auto width"),
|
|
53
|
+
* })
|
|
54
|
+
* return (
|
|
55
|
+
* <button onClick={handleFitToWidth} disabled={!canFitToWidth}>
|
|
56
|
+
* Fit to container
|
|
57
|
+
* </button>
|
|
58
|
+
* )
|
|
59
|
+
* }
|
|
60
|
+
*/
|
|
61
|
+
export declare function useTableFitToWidth(config?: UseTableFitToWidthConfig): {
|
|
62
|
+
isVisible: boolean;
|
|
63
|
+
canFitToWidth: boolean;
|
|
64
|
+
handleFitToWidth: () => boolean;
|
|
65
|
+
label: string;
|
|
66
|
+
Icon: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
67
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/react";
|
|
2
|
+
import type { ComponentType } from "react";
|
|
3
|
+
import type { Node } from "@tiptap/pm/model";
|
|
4
|
+
import { useTableHandlePositioning } from "@/components/tiptap-node/table-node/ui/table-handle/use-table-handle-positioning";
|
|
5
|
+
import { useTableHandleState } from "@/components/tiptap-node/table-node/hooks/use-table-handle-state";
|
|
6
|
+
import { type Orientation } from "@/components/tiptap-node/table-node/lib/tiptap-table-utils";
|
|
7
|
+
export interface TableHandleButtonProps {
|
|
8
|
+
editor: Editor;
|
|
9
|
+
orientation: Orientation;
|
|
10
|
+
index?: number;
|
|
11
|
+
tablePos?: number;
|
|
12
|
+
tableNode?: Node;
|
|
13
|
+
onToggleOtherHandle?: (visible: boolean) => void;
|
|
14
|
+
onOpenChange?: (open: boolean) => void;
|
|
15
|
+
}
|
|
16
|
+
export interface TableHandleRenderProps {
|
|
17
|
+
editor: Editor;
|
|
18
|
+
state: ReturnType<typeof useTableHandleState>;
|
|
19
|
+
rowHandle: ReturnType<typeof useTableHandlePositioning>["rowHandle"];
|
|
20
|
+
colHandle: ReturnType<typeof useTableHandlePositioning>["colHandle"];
|
|
21
|
+
toggleRowVisibility: (visible: boolean) => void;
|
|
22
|
+
toggleColumnVisibility: (visible: boolean) => void;
|
|
23
|
+
}
|
|
24
|
+
export interface TableHandleProps {
|
|
25
|
+
/**
|
|
26
|
+
* The Tiptap editor instance.
|
|
27
|
+
*/
|
|
28
|
+
editor?: Editor | null;
|
|
29
|
+
/**
|
|
30
|
+
* Custom component to render for row handles.
|
|
31
|
+
* If not provided, uses the default TableHandleMenu.
|
|
32
|
+
*/
|
|
33
|
+
rowButton?: ComponentType<TableHandleButtonProps>;
|
|
34
|
+
/**
|
|
35
|
+
* Custom component to render for column handles.
|
|
36
|
+
* If not provided, uses the default TableHandleMenu.
|
|
37
|
+
*/
|
|
38
|
+
columnButton?: ComponentType<TableHandleButtonProps>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Main table handle component that manages the positioning and rendering
|
|
42
|
+
* of table row/column handles, extend buttons, and context menus.
|
|
43
|
+
*
|
|
44
|
+
* This component can be extended with custom row and column buttons,
|
|
45
|
+
* or completely customized using the render prop pattern.
|
|
46
|
+
*/
|
|
47
|
+
export declare function TableHandle({ editor: providedEditor, rowButton: CustomRowButton, columnButton: CustomColumnButton, }: TableHandleProps): import("react").JSX.Element | null;
|
|
48
|
+
export declare namespace TableHandle {
|
|
49
|
+
var displayName: string;
|
|
50
|
+
}
|
package/dist/components/tiptap-node/table-node/ui/table-handle/use-table-handle-positioning.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
type Orientation = "row" | "col" | "cell";
|
|
2
|
+
type DraggingState = {
|
|
3
|
+
draggedCellOrientation: Exclude<Orientation, "cell">;
|
|
4
|
+
mousePos: number;
|
|
5
|
+
initialOffset?: number;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Hook for positioning individual table handles using Floating UI
|
|
9
|
+
*/
|
|
10
|
+
export declare function useTableHandlePosition(orientation: Orientation, show: boolean, referencePosCell: DOMRect | null, referencePosTable: DOMRect | null, draggingState?: DraggingState): {
|
|
11
|
+
isMounted: boolean;
|
|
12
|
+
ref: (node: HTMLElement | null) => void;
|
|
13
|
+
style: React.CSSProperties;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Hook for managing positioning of all table handles (row, column, and cell)
|
|
17
|
+
*
|
|
18
|
+
* @param show - Whether handles should be shown
|
|
19
|
+
* @param referencePosCell - The bounding rect of the current cell
|
|
20
|
+
* @param referencePosTable - The bounding rect of the table
|
|
21
|
+
* @param draggingState - Current dragging state if any
|
|
22
|
+
* @returns Positioning data for all handle types
|
|
23
|
+
*/
|
|
24
|
+
export declare function useTableHandlePositioning(show: boolean, referencePosCell: DOMRect | null, referencePosTable: DOMRect | null, draggingState?: DraggingState): {
|
|
25
|
+
rowHandle: {
|
|
26
|
+
isMounted: boolean;
|
|
27
|
+
ref: (node: HTMLElement | null) => void;
|
|
28
|
+
style: React.CSSProperties;
|
|
29
|
+
};
|
|
30
|
+
colHandle: {
|
|
31
|
+
isMounted: boolean;
|
|
32
|
+
ref: (node: HTMLElement | null) => void;
|
|
33
|
+
style: React.CSSProperties;
|
|
34
|
+
};
|
|
35
|
+
cellHandle: {
|
|
36
|
+
isMounted: boolean;
|
|
37
|
+
ref: (node: HTMLElement | null) => void;
|
|
38
|
+
style: React.CSSProperties;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./table-handle-menu";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/react";
|
|
2
|
+
import type { Node } from "@tiptap/pm/model";
|
|
3
|
+
import type { Orientation } from "@/components/tiptap-node/table-node/lib/tiptap-table-utils";
|
|
4
|
+
import "./table-handle-menu.css";
|
|
5
|
+
interface BaseProps {
|
|
6
|
+
editor?: Editor | null;
|
|
7
|
+
orientation: Orientation;
|
|
8
|
+
index?: number;
|
|
9
|
+
tableNode?: Node;
|
|
10
|
+
tablePos?: number;
|
|
11
|
+
}
|
|
12
|
+
interface TableHandleMenuProps extends BaseProps {
|
|
13
|
+
onToggleOtherHandle?: (visible: boolean) => void;
|
|
14
|
+
onOpenChange?: (open: boolean) => void;
|
|
15
|
+
dragStart?: (e: React.DragEvent) => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Menu content component
|
|
19
|
+
*/
|
|
20
|
+
declare const TableActionMenu: () => import("react").JSX.Element;
|
|
21
|
+
/**
|
|
22
|
+
* Main table handle menu component
|
|
23
|
+
*/
|
|
24
|
+
export declare const TableHandleMenu: ({ editor: providedEditor, orientation, index, tableNode, tablePos, onToggleOtherHandle, onOpenChange, dragStart, }: TableHandleMenuProps) => import("react").JSX.Element;
|
|
25
|
+
export { TableActionMenu };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { UseTableHeaderRowColumnConfig } from "@/components/tiptap-node/table-node/ui/table-header-row-column-button";
|
|
2
|
+
import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
|
|
3
|
+
export interface TableHeaderRowColumnButtonProps extends Omit<ButtonProps, "type">, UseTableHeaderRowColumnConfig {
|
|
4
|
+
/**
|
|
5
|
+
* Optional text to display alongside the icon.
|
|
6
|
+
*/
|
|
7
|
+
text?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Button component for toggling table header row/column in a Tiptap editor.
|
|
11
|
+
* Only works for the first row (index 0) or first column (index 0).
|
|
12
|
+
*
|
|
13
|
+
* For custom button implementations, use the `useTableHeaderRowColumn` hook instead.
|
|
14
|
+
*/
|
|
15
|
+
export declare const TableHeaderRowColumnButton: import("react").ForwardRefExoticComponent<TableHeaderRowColumnButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/react";
|
|
2
|
+
import type { Orientation } from "@/components/tiptap-node/table-node/lib/tiptap-table-utils";
|
|
3
|
+
export interface UseTableHeaderRowColumnConfig {
|
|
4
|
+
/**
|
|
5
|
+
* The Tiptap editor instance. If omitted, the hook will use
|
|
6
|
+
* the context/editor from `useTiptapEditor`.
|
|
7
|
+
*/
|
|
8
|
+
editor?: Editor | null;
|
|
9
|
+
/**
|
|
10
|
+
* The index of the row or column. Header functionality only applies to index 0.
|
|
11
|
+
* If omitted, will use the current selection.
|
|
12
|
+
*/
|
|
13
|
+
index?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Whether you're toggling header for a row or a column.
|
|
16
|
+
* If omitted, will use the current selection.
|
|
17
|
+
*/
|
|
18
|
+
orientation?: Orientation;
|
|
19
|
+
/**
|
|
20
|
+
* The position of the table in the document.
|
|
21
|
+
* Used when there's no cell selection so we can target a specific table.
|
|
22
|
+
*/
|
|
23
|
+
tablePos?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Hide the button when header toggle isn't currently possible.
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
hideWhenUnavailable?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Callback function called after a successful header toggle.
|
|
31
|
+
*/
|
|
32
|
+
onToggled?: () => void;
|
|
33
|
+
}
|
|
34
|
+
export declare const tableHeaderRowColumnLabels: Record<Orientation, string>;
|
|
35
|
+
export declare const tableHeaderRowColumnIcons: {
|
|
36
|
+
row: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
37
|
+
column: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Custom hook that provides **table header row/column toggle**
|
|
41
|
+
* functionality for the Tiptap editor. Supports `tablePos` when
|
|
42
|
+
* no cell is selected.
|
|
43
|
+
*/
|
|
44
|
+
export declare function useTableHeaderRowColumn(config: UseTableHeaderRowColumnConfig): {
|
|
45
|
+
isVisible: boolean;
|
|
46
|
+
canToggleHeader: boolean;
|
|
47
|
+
handleToggle: () => boolean;
|
|
48
|
+
label: string;
|
|
49
|
+
Icon: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element> | import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
50
|
+
isActive: boolean;
|
|
51
|
+
};
|