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,43 @@
|
|
|
1
|
+
import type { UseTableMergeSplitCellConfig } from "@/components/tiptap-node/table-node/ui/table-merge-split-cell-button";
|
|
2
|
+
import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
|
|
3
|
+
export interface TableMergeSplitCellButtonProps extends Omit<ButtonProps, "type">, UseTableMergeSplitCellConfig {
|
|
4
|
+
/**
|
|
5
|
+
* Optional text to display alongside the icon.
|
|
6
|
+
*/
|
|
7
|
+
text?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Button component for merging or splitting table cells in a Tiptap editor.
|
|
11
|
+
*
|
|
12
|
+
* **Merge Cells**: When multiple cells are selected (using CellSelection),
|
|
13
|
+
* this button will merge them into a single cell.
|
|
14
|
+
*
|
|
15
|
+
* **Split Cell**: When a merged cell is selected, this button will split
|
|
16
|
+
* it back into individual cells.
|
|
17
|
+
*
|
|
18
|
+
* For custom button implementations, use the `useTableMergeSplitCell` hook instead.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* // Merge cells button
|
|
23
|
+
* <TableMergeSplitCellButton
|
|
24
|
+
* action="merge"
|
|
25
|
+
* hideWhenUnavailable={true}
|
|
26
|
+
* />
|
|
27
|
+
*
|
|
28
|
+
* // Split cell button
|
|
29
|
+
* <TableMergeSplitCellButton
|
|
30
|
+
* action="split"
|
|
31
|
+
* text="Split Cell"
|
|
32
|
+
* onExecuted={(action) => console.log(`${action} completed!`)}
|
|
33
|
+
* />
|
|
34
|
+
*
|
|
35
|
+
* // Custom styling
|
|
36
|
+
* <TableMergeSplitCellButton
|
|
37
|
+
* action="merge"
|
|
38
|
+
* className="my-custom-merge-button"
|
|
39
|
+
* style={{ backgroundColor: 'blue' }}
|
|
40
|
+
* />
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare const TableMergeSplitCellButton: import("react").ForwardRefExoticComponent<TableMergeSplitCellButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/react";
|
|
2
|
+
export type MergeSplitAction = "merge" | "split";
|
|
3
|
+
export interface UseTableMergeSplitCellConfig {
|
|
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 action to perform - merge or split cells.
|
|
11
|
+
*/
|
|
12
|
+
action: MergeSplitAction;
|
|
13
|
+
/**
|
|
14
|
+
* Hide the button when the action isn't currently possible.
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
hideWhenUnavailable?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Callback function called after a successful merge or split.
|
|
20
|
+
*/
|
|
21
|
+
onExecuted?: (action: MergeSplitAction) => void;
|
|
22
|
+
}
|
|
23
|
+
export declare const tableMergeSplitCellLabels: Record<MergeSplitAction, string>;
|
|
24
|
+
export declare const tableMergeSplitCellIcons: {
|
|
25
|
+
merge: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
26
|
+
split: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Custom hook that provides **table cell merge/split**
|
|
30
|
+
* functionality for the Tiptap editor.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* // Simple merge button
|
|
35
|
+
* function MergeCellsButton() {
|
|
36
|
+
* const { isVisible, handleExecute, canExecute, label, Icon } = useTableMergeSplitCell({
|
|
37
|
+
* action: "merge",
|
|
38
|
+
* })
|
|
39
|
+
*
|
|
40
|
+
* if (!isVisible) return null
|
|
41
|
+
*
|
|
42
|
+
* return (
|
|
43
|
+
* <button
|
|
44
|
+
* onClick={handleExecute}
|
|
45
|
+
* disabled={!canExecute}
|
|
46
|
+
* aria-label={label}
|
|
47
|
+
* >
|
|
48
|
+
* <Icon /> {label}
|
|
49
|
+
* </button>
|
|
50
|
+
* )
|
|
51
|
+
* }
|
|
52
|
+
*
|
|
53
|
+
* // Split cell button with callback
|
|
54
|
+
* function SplitCellButton({ editor }: { editor: Editor }) {
|
|
55
|
+
* const { isVisible, handleExecute, label, canExecute, Icon } = useTableMergeSplitCell({
|
|
56
|
+
* editor,
|
|
57
|
+
* action: "split",
|
|
58
|
+
* hideWhenUnavailable: true,
|
|
59
|
+
* onExecuted: (action) => console.log(`${action} completed!`),
|
|
60
|
+
* })
|
|
61
|
+
*
|
|
62
|
+
* if (!isVisible) return null
|
|
63
|
+
*
|
|
64
|
+
* return (
|
|
65
|
+
* <button
|
|
66
|
+
* onClick={handleExecute}
|
|
67
|
+
* disabled={!canExecute}
|
|
68
|
+
* aria-label={label}
|
|
69
|
+
* >
|
|
70
|
+
* <Icon /> {label}
|
|
71
|
+
* </button>
|
|
72
|
+
* )
|
|
73
|
+
* }
|
|
74
|
+
*
|
|
75
|
+
* // Dynamic merge/split button based on context
|
|
76
|
+
* function MergeSplitButton() {
|
|
77
|
+
* const mergeAction = useTableMergeSplitCell({
|
|
78
|
+
* action: "merge",
|
|
79
|
+
* hideWhenUnavailable: true,
|
|
80
|
+
* })
|
|
81
|
+
*
|
|
82
|
+
* const splitAction = useTableMergeSplitCell({
|
|
83
|
+
* action: "split",
|
|
84
|
+
* hideWhenUnavailable: true,
|
|
85
|
+
* })
|
|
86
|
+
*
|
|
87
|
+
* if (mergeAction.isVisible) {
|
|
88
|
+
* return (
|
|
89
|
+
* <button
|
|
90
|
+
* onClick={mergeAction.handleExecute}
|
|
91
|
+
* disabled={!mergeAction.canExecute}
|
|
92
|
+
* >
|
|
93
|
+
* {mergeAction.label}
|
|
94
|
+
* </button>
|
|
95
|
+
* )
|
|
96
|
+
* }
|
|
97
|
+
*
|
|
98
|
+
* if (splitAction.isVisible) {
|
|
99
|
+
* return (
|
|
100
|
+
* <button
|
|
101
|
+
* onClick={splitAction.handleExecute}
|
|
102
|
+
* disabled={!splitAction.canExecute}
|
|
103
|
+
* >
|
|
104
|
+
* {splitAction.label}
|
|
105
|
+
* </button>
|
|
106
|
+
* )
|
|
107
|
+
* }
|
|
108
|
+
*
|
|
109
|
+
* return null
|
|
110
|
+
* }
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
export declare function useTableMergeSplitCell(config: UseTableMergeSplitCellConfig): {
|
|
114
|
+
isVisible: boolean;
|
|
115
|
+
canExecute: boolean;
|
|
116
|
+
handleExecute: () => boolean;
|
|
117
|
+
label: string;
|
|
118
|
+
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>;
|
|
119
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { UseTableMoveRowColumnConfig } from "@/components/tiptap-node/table-node/ui/table-move-row-column-button";
|
|
2
|
+
import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
|
|
3
|
+
export interface TableMoveRowColumnButtonProps extends Omit<ButtonProps, "type">, UseTableMoveRowColumnConfig {
|
|
4
|
+
/**
|
|
5
|
+
* Optional text to display alongside the icon.
|
|
6
|
+
*/
|
|
7
|
+
text?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Button component for moving a table row/column in a Tiptap editor.
|
|
11
|
+
*
|
|
12
|
+
* Supports moving:
|
|
13
|
+
* - Rows up or down
|
|
14
|
+
* - Columns left or right
|
|
15
|
+
*
|
|
16
|
+
* For custom button implementations, use the `useTableMoveRowColumn` hook instead.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* // Move row up
|
|
21
|
+
* <TableMoveRowColumnButton
|
|
22
|
+
* index={0}
|
|
23
|
+
* orientation="row"
|
|
24
|
+
* direction="up"
|
|
25
|
+
* />
|
|
26
|
+
*
|
|
27
|
+
* // Move column right
|
|
28
|
+
* <TableMoveRowColumnButton
|
|
29
|
+
* index={2}
|
|
30
|
+
* orientation="column"
|
|
31
|
+
* direction="right"
|
|
32
|
+
* hideWhenUnavailable={true}
|
|
33
|
+
* onMoved={() => console.log("Column moved!")}
|
|
34
|
+
* />
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare const TableMoveRowColumnButton: import("react").ForwardRefExoticComponent<TableMoveRowColumnButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/react";
|
|
2
|
+
import type { Orientation } from "@/components/tiptap-node/table-node/lib/tiptap-table-utils";
|
|
3
|
+
export type MoveDirection = "up" | "down" | "left" | "right";
|
|
4
|
+
export interface UseTableMoveRowColumnConfig {
|
|
5
|
+
/**
|
|
6
|
+
* The Tiptap editor instance. If omitted, the hook will use
|
|
7
|
+
* the context/editor from `useTiptapEditor`.
|
|
8
|
+
*/
|
|
9
|
+
editor?: Editor | null;
|
|
10
|
+
/**
|
|
11
|
+
* The index of the row or column to move.
|
|
12
|
+
* If omitted, will use the current selection.
|
|
13
|
+
*/
|
|
14
|
+
index?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Whether you're moving a row or a column.
|
|
17
|
+
* If omitted, will use the current selection.
|
|
18
|
+
*/
|
|
19
|
+
orientation?: Orientation;
|
|
20
|
+
/**
|
|
21
|
+
* The position of the table in the document.
|
|
22
|
+
*/
|
|
23
|
+
tablePos?: number;
|
|
24
|
+
/**
|
|
25
|
+
* The direction to move (up/down for rows, left/right for columns).
|
|
26
|
+
*/
|
|
27
|
+
direction: MoveDirection;
|
|
28
|
+
/**
|
|
29
|
+
* Hide the button when moving isn't currently possible.
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
hideWhenUnavailable?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Callback function called after a successful move.
|
|
35
|
+
*/
|
|
36
|
+
onMoved?: () => void;
|
|
37
|
+
}
|
|
38
|
+
export declare const tableMoveRowColumnLabels: Record<Orientation, Record<MoveDirection, string>>;
|
|
39
|
+
export declare const tableMoveRowColumnIcons: {
|
|
40
|
+
up: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
41
|
+
down: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
42
|
+
left: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
43
|
+
right: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Custom hook that provides **table row/column moving**
|
|
47
|
+
* functionality for the Tiptap editor.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```tsx
|
|
51
|
+
* // Move row up
|
|
52
|
+
* function MoveRowUpButton({ rowIndex }: { rowIndex: number }) {
|
|
53
|
+
* const { isVisible, handleMove, canMoveRowColumn, label, Icon } = useTableMoveRowColumn({
|
|
54
|
+
* index: rowIndex,
|
|
55
|
+
* orientation: "row",
|
|
56
|
+
* direction: "up",
|
|
57
|
+
* hideWhenUnavailable: true,
|
|
58
|
+
* onMoved: () => console.log("Row moved up!"),
|
|
59
|
+
* })
|
|
60
|
+
*
|
|
61
|
+
* if (!isVisible) return null
|
|
62
|
+
*
|
|
63
|
+
* return (
|
|
64
|
+
* <button
|
|
65
|
+
* onClick={handleMove}
|
|
66
|
+
* disabled={!canMoveRowColumn}
|
|
67
|
+
* aria-label={label}
|
|
68
|
+
* >
|
|
69
|
+
* <Icon /> {label}
|
|
70
|
+
* </button>
|
|
71
|
+
* )
|
|
72
|
+
* }
|
|
73
|
+
*
|
|
74
|
+
* // Move column based on current selection
|
|
75
|
+
* function MoveColumnButton({ direction }: { direction: "left" | "right" }) {
|
|
76
|
+
* const { isVisible, handleMove, label } = useTableMoveRowColumn({
|
|
77
|
+
* orientation: "column",
|
|
78
|
+
* direction,
|
|
79
|
+
* hideWhenUnavailable: true,
|
|
80
|
+
* })
|
|
81
|
+
*
|
|
82
|
+
* if (!isVisible) return null
|
|
83
|
+
*
|
|
84
|
+
* return <button onClick={handleMove}>{label}</button>
|
|
85
|
+
* }
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
export declare function useTableMoveRowColumn(config: UseTableMoveRowColumnConfig): {
|
|
89
|
+
isVisible: boolean;
|
|
90
|
+
canMoveRowColumn: boolean;
|
|
91
|
+
handleMove: () => boolean;
|
|
92
|
+
label: string;
|
|
93
|
+
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> | 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>;
|
|
94
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./table-selection-overlay";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/react";
|
|
2
|
+
export interface TableSelectionOverlayProps {
|
|
3
|
+
editor?: Editor | null;
|
|
4
|
+
cellMenu?: React.ComponentType<{
|
|
5
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
6
|
+
editor?: Editor | null;
|
|
7
|
+
onResizeStart?: (handle: ResizeHandle) => (event: React.MouseEvent) => void;
|
|
8
|
+
}>;
|
|
9
|
+
showResizeHandles?: boolean;
|
|
10
|
+
onMenuOpenChange?: (isOpen: boolean) => void;
|
|
11
|
+
}
|
|
12
|
+
type ResizeHandle = "tl" | "tr" | "bl" | "br" | null;
|
|
13
|
+
export declare const TableSelectionOverlay: React.FC<TableSelectionOverlayProps>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { UseTableSortRowColumnConfig } from "@/components/tiptap-node/table-node/ui/table-sort-row-column-button";
|
|
2
|
+
import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
|
|
3
|
+
export interface TableSortRowColumnButtonProps extends Omit<ButtonProps, "type">, UseTableSortRowColumnConfig {
|
|
4
|
+
/**
|
|
5
|
+
* Optional text to display alongside the icon.
|
|
6
|
+
*/
|
|
7
|
+
text?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Button component for sorting a table row/column in a Tiptap editor.
|
|
11
|
+
*
|
|
12
|
+
* For custom button implementations, use the `useTableSortRowColumn` hook instead.
|
|
13
|
+
*/
|
|
14
|
+
export declare const TableSortRowColumnButton: import("react").ForwardRefExoticComponent<TableSortRowColumnButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/react";
|
|
2
|
+
import type { Orientation } from "@/components/tiptap-node/table-node/lib/tiptap-table-utils";
|
|
3
|
+
export type SortDirection = "asc" | "desc";
|
|
4
|
+
export interface UseTableSortRowColumnConfig {
|
|
5
|
+
/**
|
|
6
|
+
* The Tiptap editor instance. If omitted, the hook will use
|
|
7
|
+
* the context/editor from `useTiptapEditor`.
|
|
8
|
+
*/
|
|
9
|
+
editor?: Editor | null;
|
|
10
|
+
/**
|
|
11
|
+
* The index of the row or column to sort.
|
|
12
|
+
* If omitted, will use the current selection.
|
|
13
|
+
*/
|
|
14
|
+
index?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Whether you're sorting a row or a column.
|
|
17
|
+
* If omitted, will use the current selection.
|
|
18
|
+
*/
|
|
19
|
+
orientation?: Orientation;
|
|
20
|
+
/**
|
|
21
|
+
* The position of the table in the document.
|
|
22
|
+
*/
|
|
23
|
+
tablePos?: number;
|
|
24
|
+
/**
|
|
25
|
+
* The sort direction (ascending or descending).
|
|
26
|
+
*/
|
|
27
|
+
direction: SortDirection;
|
|
28
|
+
/**
|
|
29
|
+
* Hide the button when sorting isn't currently possible.
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
hideWhenUnavailable?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Callback function called after a successful sort.
|
|
35
|
+
*/
|
|
36
|
+
onSorted?: () => void;
|
|
37
|
+
}
|
|
38
|
+
export declare const tableSortRowColumnLabels: Record<Orientation, Record<SortDirection, string>>;
|
|
39
|
+
export declare const tableSortRowColumnIcons: {
|
|
40
|
+
asc: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
41
|
+
desc: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Custom hook that provides **table row/column sorting**
|
|
45
|
+
* functionality for the Tiptap editor.
|
|
46
|
+
*
|
|
47
|
+
* **Header Handling:** Header cells are automatically detected and excluded
|
|
48
|
+
* from sorting. During a sort operation, header cells remain in their original
|
|
49
|
+
* positions while only data cells are rearranged. Headers are identified by
|
|
50
|
+
* node type (`tableHeader`) or attributes (`header: true`).
|
|
51
|
+
*
|
|
52
|
+
* **Empty Cell Handling:** Empty cells are always sorted to the end,
|
|
53
|
+
* regardless of sort direction (A-Z or Z-A).
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```tsx
|
|
57
|
+
* // Sort currently selected row/column (smart mode)
|
|
58
|
+
* function SortButton() {
|
|
59
|
+
* const { isVisible, handleSort } = useTableSortRowColumn({ direction: "asc" })
|
|
60
|
+
*
|
|
61
|
+
* if (!isVisible) return null
|
|
62
|
+
*
|
|
63
|
+
* return <button onClick={handleSort}>Sort A-Z</button>
|
|
64
|
+
* }
|
|
65
|
+
*
|
|
66
|
+
* // Sort specific row, headers will be preserved
|
|
67
|
+
* function SortRowButton({ rowIndex }: { rowIndex: number }) {
|
|
68
|
+
* const { isVisible, handleSort, label, canSortRowColumn } = useTableSortRowColumn({
|
|
69
|
+
* index: rowIndex,
|
|
70
|
+
* orientation: "row",
|
|
71
|
+
* direction: "asc",
|
|
72
|
+
* hideWhenUnavailable: true,
|
|
73
|
+
* onSorted: () => console.log("Row sorted! Headers stayed in place."),
|
|
74
|
+
* })
|
|
75
|
+
*
|
|
76
|
+
* if (!isVisible) return null
|
|
77
|
+
*
|
|
78
|
+
* return (
|
|
79
|
+
* <button
|
|
80
|
+
* onClick={handleSort}
|
|
81
|
+
* disabled={!canSortRowColumn}
|
|
82
|
+
* aria-label={label}
|
|
83
|
+
* >
|
|
84
|
+
* {label}
|
|
85
|
+
* </button>
|
|
86
|
+
* )
|
|
87
|
+
* }
|
|
88
|
+
*
|
|
89
|
+
* // Sort with callback to handle the result
|
|
90
|
+
* function SmartSortButton() {
|
|
91
|
+
* const { isVisible, handleSort, label } = useTableSortRowColumn({
|
|
92
|
+
* direction: "desc",
|
|
93
|
+
* hideWhenUnavailable: true,
|
|
94
|
+
* onSorted: () => {
|
|
95
|
+
* console.log("Sort completed! Headers were automatically preserved.")
|
|
96
|
+
* }
|
|
97
|
+
* })
|
|
98
|
+
*
|
|
99
|
+
* if (!isVisible) return null
|
|
100
|
+
*
|
|
101
|
+
* return <button onClick={handleSort}>{label}</button>
|
|
102
|
+
* }
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
export declare function useTableSortRowColumn(config?: UseTableSortRowColumnConfig): {
|
|
106
|
+
isVisible: boolean;
|
|
107
|
+
canSortRowColumn: boolean;
|
|
108
|
+
handleSort: () => boolean;
|
|
109
|
+
label: string;
|
|
110
|
+
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>;
|
|
111
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { TableOfContentData, TableOfContentDataItem } from "@tiptap/extension-table-of-contents";
|
|
3
|
+
type TocState = {
|
|
4
|
+
tocContent: TableOfContentData | null;
|
|
5
|
+
setTocContent: (value: TableOfContentData | null) => void;
|
|
6
|
+
navigateToHeading: (item: TableOfContentDataItem, options?: {
|
|
7
|
+
topOffset?: number;
|
|
8
|
+
behavior?: ScrollBehavior;
|
|
9
|
+
}) => void;
|
|
10
|
+
normalizeHeadingDepths: <T extends {
|
|
11
|
+
level?: number;
|
|
12
|
+
originalLevel?: number;
|
|
13
|
+
}>(headingList: T[]) => number[];
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Normalizes heading depths for a table of contents (TOC) structure.
|
|
17
|
+
*
|
|
18
|
+
* This function ensures proper hierarchical nesting where a heading can only be
|
|
19
|
+
* a child of a previous heading with a smaller level number (higher priority).
|
|
20
|
+
* It prevents incorrect structures like h2 being listed under h3.
|
|
21
|
+
*
|
|
22
|
+
* Algorithm:
|
|
23
|
+
* 1. Rebases all levels so the minimum level becomes 1 (root level)
|
|
24
|
+
* 2. Maintains a stack of ancestors; pops entries until a smaller level is found
|
|
25
|
+
* 3. If found, nests it under that parent (parent depth + 1)
|
|
26
|
+
* 4. If not found, treats it as a root-level item (depth = 1)
|
|
27
|
+
*
|
|
28
|
+
* @param items - Array of heading items with `level` or `originalLevel` properties
|
|
29
|
+
* @returns Array of normalized depths corresponding to each heading item
|
|
30
|
+
*/
|
|
31
|
+
export declare function normalizeHeadingDepths<T extends {
|
|
32
|
+
level?: number;
|
|
33
|
+
originalLevel?: number;
|
|
34
|
+
}>(items: T[]): number[];
|
|
35
|
+
/**
|
|
36
|
+
* Find the nearest scrollable ancestor of an element.
|
|
37
|
+
* Falls back to `window` when no scrollable container is found.
|
|
38
|
+
*/
|
|
39
|
+
export declare const getScrollableAncestor: (element: HTMLElement) => HTMLElement | Window;
|
|
40
|
+
export declare const TocProvider: ({ children }: {
|
|
41
|
+
children: ReactNode;
|
|
42
|
+
}) => import("react").JSX.Element;
|
|
43
|
+
export declare const useToc: () => TocState;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Node } from "@tiptap/core";
|
|
2
|
+
export interface TocNodeAttrs {
|
|
3
|
+
/**
|
|
4
|
+
* The maximum number of headings to show in the TOC node.
|
|
5
|
+
* @default 20
|
|
6
|
+
*/
|
|
7
|
+
maxShowCount?: number | null;
|
|
8
|
+
/**
|
|
9
|
+
* Offset from the top of the viewport when scrolling to a heading.
|
|
10
|
+
* @default 0
|
|
11
|
+
*/
|
|
12
|
+
topOffset?: number | null;
|
|
13
|
+
/**
|
|
14
|
+
* Whether to show the "Table of contents" title.
|
|
15
|
+
* @default true
|
|
16
|
+
*/
|
|
17
|
+
showTitle?: boolean | null;
|
|
18
|
+
}
|
|
19
|
+
export interface TocNodeOptions extends TocNodeAttrs {
|
|
20
|
+
/**
|
|
21
|
+
* HTML attributes to add to the TOC node element
|
|
22
|
+
* @default {}
|
|
23
|
+
* @example { class: 'foo' }
|
|
24
|
+
*/
|
|
25
|
+
HTMLAttributes: Record<string, unknown>;
|
|
26
|
+
}
|
|
27
|
+
declare module "@tiptap/core" {
|
|
28
|
+
interface Commands<ReturnType> {
|
|
29
|
+
tocNode: {
|
|
30
|
+
/**
|
|
31
|
+
* Insert a table of contents node.
|
|
32
|
+
*
|
|
33
|
+
* Example:
|
|
34
|
+
* editor.commands.insertTocNode({ maxShowCount: 10 })
|
|
35
|
+
*/
|
|
36
|
+
insertTocNode: (attrs?: TocNodeAttrs) => ReturnType;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A Tiptap node extension that creates a table of contents node.
|
|
42
|
+
* @see registry/tiptap-node/toc-node/toc-node-component
|
|
43
|
+
*/
|
|
44
|
+
export declare const TocNode: Node<TocNodeOptions, any>;
|
|
45
|
+
export default TocNode;
|
package/dist/components/tiptap-node/toc-node/ui/toc-show-title-button/toc-show-title-button.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { UseTocShowTitleConfig } from "@/components/tiptap-node/toc-node/ui/toc-show-title-button/toc-show-title";
|
|
3
|
+
import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
|
|
4
|
+
export interface TocShowTitleButtonProps extends Omit<ButtonProps, "type" | "onToggle">, UseTocShowTitleConfig {
|
|
5
|
+
/**
|
|
6
|
+
* Optional text to display alongside the icon.
|
|
7
|
+
*/
|
|
8
|
+
text?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Button component for toggling TOC title in a Tiptap editor.
|
|
12
|
+
* Only appears when a TOC node is selected in the editor.
|
|
13
|
+
*
|
|
14
|
+
* For custom button implementations, use the `useTocShowTitle` hook instead.
|
|
15
|
+
*/
|
|
16
|
+
export declare const TocShowTitleButton: React.ForwardRefExoticComponent<TocShowTitleButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { type Editor } from "@tiptap/react";
|
|
2
|
+
/**
|
|
3
|
+
* Configuration for the TOC show title functionality
|
|
4
|
+
*/
|
|
5
|
+
export interface UseTocShowTitleConfig {
|
|
6
|
+
/**
|
|
7
|
+
* The Tiptap editor instance.
|
|
8
|
+
*/
|
|
9
|
+
editor?: Editor | null;
|
|
10
|
+
/**
|
|
11
|
+
* Whether the button should hide when title toggle is not available.
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
14
|
+
hideWhenUnavailable?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Callback function called after a successful title toggle.
|
|
17
|
+
*/
|
|
18
|
+
onToggle?: () => void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Checks if TOC title can be toggled in the current editor state
|
|
22
|
+
*/
|
|
23
|
+
export declare function canToggleTocTitle(editor: Editor | null): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Checks if the currently selected TOC node has title enabled
|
|
26
|
+
*/
|
|
27
|
+
export declare function isTocTitleActive(editor: Editor | null): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Toggles the TOC title in the editor
|
|
30
|
+
*/
|
|
31
|
+
export declare function toggleTocTitle(editor: Editor | null): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Determines if the TOC show title button should be shown
|
|
34
|
+
*/
|
|
35
|
+
export declare function shouldShowButton(props: {
|
|
36
|
+
editor: Editor | null;
|
|
37
|
+
hideWhenUnavailable: boolean;
|
|
38
|
+
}): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Custom hook that provides TOC show title functionality for Tiptap editor
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* // Simple usage
|
|
45
|
+
* function MyTocShowTitleButton() {
|
|
46
|
+
* const { isVisible, handleToggle } = useTocShowTitle()
|
|
47
|
+
*
|
|
48
|
+
* if (!isVisible) return null
|
|
49
|
+
*
|
|
50
|
+
* return <button onClick={handleToggle}>Toggle Title</button>
|
|
51
|
+
* }
|
|
52
|
+
*
|
|
53
|
+
* // Advanced usage
|
|
54
|
+
* function MyAdvancedTocShowTitleButton() {
|
|
55
|
+
* const { isVisible, handleToggle, label, canToggle, isActive } = useTocShowTitle({
|
|
56
|
+
* editor: myEditor,
|
|
57
|
+
* hideWhenUnavailable: true,
|
|
58
|
+
* onToggle: () => console.log('Title toggled!')
|
|
59
|
+
* })
|
|
60
|
+
*
|
|
61
|
+
* if (!isVisible) return null
|
|
62
|
+
*
|
|
63
|
+
* return (
|
|
64
|
+
* <MyButton
|
|
65
|
+
* onClick={handleToggle}
|
|
66
|
+
* disabled={!canToggle}
|
|
67
|
+
* aria-label={label}
|
|
68
|
+
* data-active={isActive}
|
|
69
|
+
* >
|
|
70
|
+
* Toggle Title
|
|
71
|
+
* </MyButton>
|
|
72
|
+
* )
|
|
73
|
+
* }
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
export declare function useTocShowTitle(config?: UseTocShowTitleConfig): {
|
|
77
|
+
isVisible: boolean;
|
|
78
|
+
isActive: boolean;
|
|
79
|
+
canToggle: boolean;
|
|
80
|
+
handleToggle: () => boolean;
|
|
81
|
+
label: string;
|
|
82
|
+
Icon: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
83
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./toc-sidebar";
|