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,14 @@
|
|
|
1
|
+
import "./toc-sidebar.css";
|
|
2
|
+
export interface TocSidebarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* The maximum number of headings to show in the TOC.
|
|
5
|
+
* @default 20
|
|
6
|
+
*/
|
|
7
|
+
maxShowCount?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Offset from the top of the editor container (in pixels).
|
|
10
|
+
* @default 0
|
|
11
|
+
*/
|
|
12
|
+
topOffset?: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function TocSidebar({ className, maxShowCount, topOffset, ...props }: TocSidebarProps): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function OmniboxEditorHeader(): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Editor } from "@tiptap/react";
|
|
2
|
+
export type ToolbarViewType = {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
icon: React.ReactNode;
|
|
6
|
+
content: React.ReactNode;
|
|
7
|
+
mobileButton?: (onClick: () => void) => React.ReactNode;
|
|
8
|
+
desktopComponent?: React.ReactNode;
|
|
9
|
+
shouldShow?: (editor: Editor | null) => boolean;
|
|
10
|
+
};
|
|
11
|
+
export interface MobileToolbarProps {
|
|
12
|
+
editor?: Editor | null;
|
|
13
|
+
}
|
|
14
|
+
export declare function MobileToolbar({ editor: providedEditor }: MobileToolbarProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ThemeToggle(): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Editor } from "@tiptap/react";
|
|
2
|
+
import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
|
|
3
|
+
export declare function OmniboxToolbarFloating(): import("react").JSX.Element | null;
|
|
4
|
+
export interface MoreOptionsProps extends Omit<ButtonProps, "type"> {
|
|
5
|
+
/**
|
|
6
|
+
* The Tiptap editor instance.
|
|
7
|
+
*/
|
|
8
|
+
editor?: Editor | null;
|
|
9
|
+
/**
|
|
10
|
+
* Whether to hide the dropdown when no options are available.
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
hideWhenUnavailable?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function MoreOptions({ editor: providedEditor, hideWhenUnavailable, ...props }: MoreOptionsProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import "@/components/tiptap-node/table-node/styles/prosemirror-table.css";
|
|
2
|
+
import "@/components/tiptap-node/table-node/styles/table-node.css";
|
|
3
|
+
import "@/components/tiptap-node/blockquote-node/blockquote-node.css";
|
|
4
|
+
import "@/components/tiptap-node/code-block-node/code-block-node.css";
|
|
5
|
+
import "@/components/tiptap-node/horizontal-rule-node/horizontal-rule-node.css";
|
|
6
|
+
import "@/components/tiptap-node/list-node/list-node.css";
|
|
7
|
+
import "@/components/tiptap-node/image-node/image-node.css";
|
|
8
|
+
import "@/components/tiptap-node/heading-node/heading-node.css";
|
|
9
|
+
import "@/components/tiptap-node/paragraph-node/paragraph-node.css";
|
|
10
|
+
import type { EditorProviderProps, OmniboxEditorProps } from "@/types";
|
|
11
|
+
/**
|
|
12
|
+
* Loading spinner component shown while creating the editor instance
|
|
13
|
+
*/
|
|
14
|
+
export declare function LoadingSpinner({ text }: {
|
|
15
|
+
text?: string;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
17
|
+
/**
|
|
18
|
+
* EditorContent component that renders the actual editor
|
|
19
|
+
*/
|
|
20
|
+
export declare function EditorContentArea(): import("react").JSX.Element | null;
|
|
21
|
+
/**
|
|
22
|
+
* Component that creates and provides the editor instance
|
|
23
|
+
*/
|
|
24
|
+
export declare function EditorProvider(props: EditorProviderProps): import("react").JSX.Element;
|
|
25
|
+
/**
|
|
26
|
+
* Full local editor with all necessary providers.
|
|
27
|
+
*/
|
|
28
|
+
export declare function OmniboxEditor({ editable, placeholder, content, variant, showHeader, showToc, onUpdate, imageUpload, imageUploadMaxSize, imageUploadLimit, onImageUploadError, onImageUploadSuccess, }: OmniboxEditorProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { UseBlockquoteConfig } from "@/components/tiptap-ui/blockquote-button";
|
|
2
|
+
import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
|
|
3
|
+
export interface BlockquoteButtonProps extends Omit<ButtonProps, "type">, UseBlockquoteConfig {
|
|
4
|
+
/**
|
|
5
|
+
* Optional text to display alongside the icon.
|
|
6
|
+
*/
|
|
7
|
+
text?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Optional show shortcut keys in the button.
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
12
|
+
showShortcut?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function BlockquoteShortcutBadge({ shortcutKeys, }: {
|
|
15
|
+
shortcutKeys?: string;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
17
|
+
/**
|
|
18
|
+
* Button component for toggling blockquote in a Tiptap editor.
|
|
19
|
+
*
|
|
20
|
+
* For custom button implementations, use the `useBlockquote` hook instead.
|
|
21
|
+
*/
|
|
22
|
+
export declare const BlockquoteButton: import("react").ForwardRefExoticComponent<BlockquoteButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/react";
|
|
2
|
+
export declare const BLOCKQUOTE_SHORTCUT_KEY = "mod+shift+b";
|
|
3
|
+
/**
|
|
4
|
+
* Configuration for the blockquote functionality
|
|
5
|
+
*/
|
|
6
|
+
export interface UseBlockquoteConfig {
|
|
7
|
+
/**
|
|
8
|
+
* The Tiptap editor instance.
|
|
9
|
+
*/
|
|
10
|
+
editor?: Editor | null;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the button should hide when blockquote is not available.
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
hideWhenUnavailable?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Callback function called after a successful toggle.
|
|
18
|
+
*/
|
|
19
|
+
onToggled?: () => void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Checks if blockquote can be toggled in the current editor state
|
|
23
|
+
*/
|
|
24
|
+
export declare function canToggleBlockquote(editor: Editor | null, turnInto?: boolean): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Toggles blockquote formatting for a specific node or the current selection
|
|
27
|
+
*/
|
|
28
|
+
export declare function toggleBlockquote(editor: Editor | null): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Determines if the blockquote button should be shown
|
|
31
|
+
*/
|
|
32
|
+
export declare function shouldShowButton(props: {
|
|
33
|
+
editor: Editor | null;
|
|
34
|
+
hideWhenUnavailable: boolean;
|
|
35
|
+
}): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Custom hook that provides blockquote functionality for Tiptap editor
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```tsx
|
|
41
|
+
* // Simple usage - no params needed
|
|
42
|
+
* function MySimpleBlockquoteButton() {
|
|
43
|
+
* const { isVisible, handleToggle, isActive } = useBlockquote()
|
|
44
|
+
*
|
|
45
|
+
* if (!isVisible) return null
|
|
46
|
+
*
|
|
47
|
+
* return <button onClick={handleToggle}>Blockquote</button>
|
|
48
|
+
* }
|
|
49
|
+
*
|
|
50
|
+
* // Advanced usage with configuration
|
|
51
|
+
* function MyAdvancedBlockquoteButton() {
|
|
52
|
+
* const { isVisible, handleToggle, label, isActive } = useBlockquote({
|
|
53
|
+
* editor: myEditor,
|
|
54
|
+
* hideWhenUnavailable: true,
|
|
55
|
+
* onToggled: () => console.log('Blockquote toggled!')
|
|
56
|
+
* })
|
|
57
|
+
*
|
|
58
|
+
* if (!isVisible) return null
|
|
59
|
+
*
|
|
60
|
+
* return (
|
|
61
|
+
* <MyButton
|
|
62
|
+
* onClick={handleToggle}
|
|
63
|
+
* aria-label={label}
|
|
64
|
+
* aria-pressed={isActive}
|
|
65
|
+
* >
|
|
66
|
+
* Toggle Blockquote
|
|
67
|
+
* </MyButton>
|
|
68
|
+
* )
|
|
69
|
+
* }
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
export declare function useBlockquote(config?: UseBlockquoteConfig): {
|
|
73
|
+
isVisible: boolean;
|
|
74
|
+
isActive: boolean;
|
|
75
|
+
handleToggle: () => boolean;
|
|
76
|
+
canToggle: boolean;
|
|
77
|
+
label: string;
|
|
78
|
+
shortcutKeys: string;
|
|
79
|
+
Icon: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
80
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { UseCodeBlockConfig } from "@/components/tiptap-ui/code-block-button";
|
|
2
|
+
import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
|
|
3
|
+
export interface CodeBlockButtonProps extends Omit<ButtonProps, "type">, UseCodeBlockConfig {
|
|
4
|
+
/**
|
|
5
|
+
* Optional text to display alongside the icon.
|
|
6
|
+
*/
|
|
7
|
+
text?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Optional show shortcut keys in the button.
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
12
|
+
showShortcut?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function CodeBlockShortcutBadge({ shortcutKeys, }: {
|
|
15
|
+
shortcutKeys?: string;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
17
|
+
/**
|
|
18
|
+
* Button component for toggling code block in a Tiptap editor.
|
|
19
|
+
*
|
|
20
|
+
* For custom button implementations, use the `useCodeBlock` hook instead.
|
|
21
|
+
*/
|
|
22
|
+
export declare const CodeBlockButton: import("react").ForwardRefExoticComponent<CodeBlockButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { type Editor } from "@tiptap/react";
|
|
2
|
+
export declare const CODE_BLOCK_SHORTCUT_KEY = "mod+alt+c";
|
|
3
|
+
/**
|
|
4
|
+
* Configuration for the code block functionality
|
|
5
|
+
*/
|
|
6
|
+
export interface UseCodeBlockConfig {
|
|
7
|
+
/**
|
|
8
|
+
* The Tiptap editor instance.
|
|
9
|
+
*/
|
|
10
|
+
editor?: Editor | null;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the button should hide when code block is not available.
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
hideWhenUnavailable?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Callback function called after a successful code block toggle.
|
|
18
|
+
*/
|
|
19
|
+
onToggled?: () => void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Checks if code block can be toggled in the current editor state
|
|
23
|
+
*/
|
|
24
|
+
export declare function canToggle(editor: Editor | null, turnInto?: boolean): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Toggles code block in the editor
|
|
27
|
+
*/
|
|
28
|
+
export declare function toggleCodeBlock(editor: Editor | null): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Determines if the code block button should be shown
|
|
31
|
+
*/
|
|
32
|
+
export declare function shouldShowButton(props: {
|
|
33
|
+
editor: Editor | null;
|
|
34
|
+
hideWhenUnavailable: boolean;
|
|
35
|
+
}): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Custom hook that provides code block functionality for Tiptap editor
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```tsx
|
|
41
|
+
* // Simple usage - no params needed
|
|
42
|
+
* function MySimpleCodeBlockButton() {
|
|
43
|
+
* const { isVisible, isActive, handleToggle } = useCodeBlock()
|
|
44
|
+
*
|
|
45
|
+
* if (!isVisible) return null
|
|
46
|
+
*
|
|
47
|
+
* return (
|
|
48
|
+
* <button
|
|
49
|
+
* onClick={handleToggle}
|
|
50
|
+
* aria-pressed={isActive}
|
|
51
|
+
* >
|
|
52
|
+
* Code Block
|
|
53
|
+
* </button>
|
|
54
|
+
* )
|
|
55
|
+
* }
|
|
56
|
+
*
|
|
57
|
+
* // Advanced usage with configuration
|
|
58
|
+
* function MyAdvancedCodeBlockButton() {
|
|
59
|
+
* const { isVisible, isActive, handleToggle, label } = useCodeBlock({
|
|
60
|
+
* editor: myEditor,
|
|
61
|
+
* hideWhenUnavailable: true,
|
|
62
|
+
* onToggled: (isActive) => console.log('Code block toggled:', isActive)
|
|
63
|
+
* })
|
|
64
|
+
*
|
|
65
|
+
* if (!isVisible) return null
|
|
66
|
+
*
|
|
67
|
+
* return (
|
|
68
|
+
* <MyButton
|
|
69
|
+
* onClick={handleToggle}
|
|
70
|
+
* aria-label={label}
|
|
71
|
+
* aria-pressed={isActive}
|
|
72
|
+
* >
|
|
73
|
+
* Toggle Code Block
|
|
74
|
+
* </MyButton>
|
|
75
|
+
* )
|
|
76
|
+
* }
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
export declare function useCodeBlock(config?: UseCodeBlockConfig): {
|
|
80
|
+
isVisible: boolean;
|
|
81
|
+
isActive: boolean;
|
|
82
|
+
handleToggle: () => boolean;
|
|
83
|
+
canToggle: boolean;
|
|
84
|
+
label: string;
|
|
85
|
+
shortcutKeys: string;
|
|
86
|
+
Icon: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
87
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { UseColorHighlightConfig } from "@/components/tiptap-ui/color-highlight-button";
|
|
2
|
+
import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
|
|
3
|
+
import "@/components/tiptap-ui/color-highlight-button/color-highlight-button.css";
|
|
4
|
+
export interface ColorHighlightButtonProps extends Omit<ButtonProps, "type">, UseColorHighlightConfig {
|
|
5
|
+
/**
|
|
6
|
+
* Optional text to display alongside the icon.
|
|
7
|
+
*/
|
|
8
|
+
text?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Optional show shortcut keys in the button.
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
showShortcut?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function ColorHighlightShortcutBadge({ shortcutKeys, }: {
|
|
16
|
+
shortcutKeys?: string;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
/**
|
|
19
|
+
* Button component for applying color highlights in a Tiptap editor.
|
|
20
|
+
*
|
|
21
|
+
* Supports two highlighting modes:
|
|
22
|
+
* - "mark": Uses the highlight mark extension (default)
|
|
23
|
+
* - "node": Uses the node background extension
|
|
24
|
+
*
|
|
25
|
+
* For custom button implementations, use the `useColorHighlight` hook instead.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* // Mark-based highlighting (default)
|
|
30
|
+
* <ColorHighlightButton highlightColor="yellow" />
|
|
31
|
+
*
|
|
32
|
+
* // Node-based background coloring
|
|
33
|
+
* <ColorHighlightButton
|
|
34
|
+
* highlightColor="var(--tt-color-highlight-blue)"
|
|
35
|
+
* mode="node"
|
|
36
|
+
* />
|
|
37
|
+
*
|
|
38
|
+
* // With custom callback
|
|
39
|
+
* <ColorHighlightButton
|
|
40
|
+
* highlightColor="red"
|
|
41
|
+
* mode="mark"
|
|
42
|
+
* onApplied={({ color, mode }) => console.log(`Applied ${color} in ${mode} mode`)}
|
|
43
|
+
* />
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare const ColorHighlightButton: import("react").ForwardRefExoticComponent<ColorHighlightButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { type Editor } from "@tiptap/react";
|
|
2
|
+
export declare const COLOR_HIGHLIGHT_SHORTCUT_KEY = "mod+shift+h";
|
|
3
|
+
export declare const HIGHLIGHT_COLORS: {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
colorValue: string;
|
|
7
|
+
border: string;
|
|
8
|
+
}[];
|
|
9
|
+
export type HighlightColor = (typeof HIGHLIGHT_COLORS)[number];
|
|
10
|
+
export type HighlightMode = "mark" | "node";
|
|
11
|
+
/**
|
|
12
|
+
* Configuration for the color highlight functionality
|
|
13
|
+
*/
|
|
14
|
+
export interface UseColorHighlightConfig {
|
|
15
|
+
/**
|
|
16
|
+
* The Tiptap editor instance.
|
|
17
|
+
*/
|
|
18
|
+
editor?: Editor | null;
|
|
19
|
+
/**
|
|
20
|
+
* The color to apply when toggling the highlight.
|
|
21
|
+
*/
|
|
22
|
+
highlightColor?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Optional label to display alongside the icon.
|
|
25
|
+
*/
|
|
26
|
+
label?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Whether the button should hide when the mark is not available.
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
hideWhenUnavailable?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The highlighting mode to use.
|
|
34
|
+
* - "mark": Uses the highlight mark extension (default)
|
|
35
|
+
* - "node": Uses the node background extension
|
|
36
|
+
* @default "mark"
|
|
37
|
+
*/
|
|
38
|
+
mode?: HighlightMode;
|
|
39
|
+
/**
|
|
40
|
+
* When true, uses the actual color value (colorValue) instead of CSS variable (value).
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
useColorValue?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Called when the highlight is applied.
|
|
46
|
+
*/
|
|
47
|
+
onApplied?: ({ color, label, mode, }: {
|
|
48
|
+
color: string;
|
|
49
|
+
label: string;
|
|
50
|
+
mode: HighlightMode;
|
|
51
|
+
}) => void;
|
|
52
|
+
}
|
|
53
|
+
export declare function pickHighlightColorsByValue(values: string[]): {
|
|
54
|
+
label: string;
|
|
55
|
+
value: string;
|
|
56
|
+
colorValue: string;
|
|
57
|
+
border: string;
|
|
58
|
+
}[];
|
|
59
|
+
/**
|
|
60
|
+
* Gets the appropriate color value based on configuration
|
|
61
|
+
*/
|
|
62
|
+
export declare function getHighlightColorValue(color: string, useColorValue?: boolean): string;
|
|
63
|
+
/**
|
|
64
|
+
* Checks if highlight can be applied based on the mode and current editor state
|
|
65
|
+
*/
|
|
66
|
+
export declare function canColorHighlight(editor: Editor | null, mode?: HighlightMode): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Checks if highlight is currently active
|
|
69
|
+
*/
|
|
70
|
+
export declare function isColorHighlightActive(editor: Editor | null, highlightColor?: string, mode?: HighlightMode): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Removes highlight based on the mode
|
|
73
|
+
*/
|
|
74
|
+
export declare function removeHighlight(editor: Editor | null, mode?: HighlightMode): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Determines if the highlight button should be shown
|
|
77
|
+
*/
|
|
78
|
+
export declare function shouldShowButton(props: {
|
|
79
|
+
editor: Editor | null;
|
|
80
|
+
hideWhenUnavailable: boolean;
|
|
81
|
+
mode: HighlightMode;
|
|
82
|
+
}): boolean;
|
|
83
|
+
export declare function useColorHighlight(config: UseColorHighlightConfig): {
|
|
84
|
+
isVisible: boolean;
|
|
85
|
+
isActive: boolean;
|
|
86
|
+
handleColorHighlight: () => boolean;
|
|
87
|
+
handleRemoveHighlight: () => boolean;
|
|
88
|
+
canColorHighlight: boolean;
|
|
89
|
+
label: string;
|
|
90
|
+
shortcutKeys: string;
|
|
91
|
+
Icon: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
92
|
+
mode: HighlightMode;
|
|
93
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type Editor } from "@tiptap/react";
|
|
2
|
+
import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
|
|
3
|
+
import type { HighlightColor, UseColorHighlightConfig } from "@/components/tiptap-ui/color-highlight-button";
|
|
4
|
+
export interface ColorHighlightPopoverContentProps {
|
|
5
|
+
/**
|
|
6
|
+
* The Tiptap editor instance.
|
|
7
|
+
*/
|
|
8
|
+
editor?: Editor | null;
|
|
9
|
+
/**
|
|
10
|
+
* Optional colors to use in the highlight popover.
|
|
11
|
+
* If not provided, defaults to a predefined set of colors.
|
|
12
|
+
*/
|
|
13
|
+
colors?: HighlightColor[];
|
|
14
|
+
/**
|
|
15
|
+
* When true, uses the actual color value (colorValue) instead of CSS variable (value).
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
useColorValue?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface ColorHighlightPopoverProps extends Omit<ButtonProps, "type">, Pick<UseColorHighlightConfig, "editor" | "hideWhenUnavailable" | "onApplied"> {
|
|
21
|
+
/**
|
|
22
|
+
* Optional colors to use in the highlight popover.
|
|
23
|
+
* If not provided, defaults to a predefined set of colors.
|
|
24
|
+
*/
|
|
25
|
+
colors?: HighlightColor[];
|
|
26
|
+
/**
|
|
27
|
+
* When true, uses the actual color value (colorValue) instead of CSS variable (value).
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
|
+
useColorValue?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export declare const ColorHighlightPopoverButton: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
33
|
+
export declare function ColorHighlightPopoverContent({ editor, colors, useColorValue, }: ColorHighlightPopoverContentProps): import("react").JSX.Element;
|
|
34
|
+
export declare function ColorHighlightPopover({ editor: providedEditor, colors, hideWhenUnavailable, useColorValue, onApplied, ...props }: ColorHighlightPopoverProps): import("react").JSX.Element | null;
|
|
35
|
+
export default ColorHighlightPopover;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./color-highlight-popover";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/react";
|
|
2
|
+
import { Menu } from "@/components/tiptap-ui-primitive/menu";
|
|
3
|
+
import type { RecentColor } from "@/components/tiptap-ui/color-text-popover";
|
|
4
|
+
interface ColorMenuItemProps {
|
|
5
|
+
editor?: Editor | null;
|
|
6
|
+
color: {
|
|
7
|
+
value: string;
|
|
8
|
+
label: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
declare const TextColorMenuItem: React.FC<ColorMenuItemProps>;
|
|
12
|
+
declare const HighlightColorMenuItem: React.FC<ColorMenuItemProps>;
|
|
13
|
+
declare const RecentColorMenuItem: React.FC<{
|
|
14
|
+
editor?: Editor | null;
|
|
15
|
+
colorObj: RecentColor;
|
|
16
|
+
}>;
|
|
17
|
+
export interface ColorMenuProps {
|
|
18
|
+
editor?: Editor | null;
|
|
19
|
+
/**
|
|
20
|
+
* Custom trigger component. If not provided, uses default paint bucket button.
|
|
21
|
+
*/
|
|
22
|
+
trigger?: React.ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Label for the color menu trigger
|
|
25
|
+
* @default "Color"
|
|
26
|
+
*/
|
|
27
|
+
label?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Menu placement relative to trigger
|
|
30
|
+
* @default "right"
|
|
31
|
+
*/
|
|
32
|
+
placement?: React.ComponentProps<typeof Menu>["placement"];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Reusable color menu component that provides text and highlight color options.
|
|
36
|
+
* Includes recent colors, text colors, and highlight colors sections.
|
|
37
|
+
*/
|
|
38
|
+
export declare const ColorMenu: React.FC<ColorMenuProps>;
|
|
39
|
+
export { TextColorMenuItem, HighlightColorMenuItem, RecentColorMenuItem };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./color-menu";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { UseColorTextConfig } from "@/components/tiptap-ui/color-text-button";
|
|
2
|
+
import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
|
|
3
|
+
import "@/components/tiptap-ui/color-text-button/color-text-button.css";
|
|
4
|
+
export interface ColorTextButtonProps extends Omit<ButtonProps, "type">, UseColorTextConfig {
|
|
5
|
+
/**
|
|
6
|
+
* Optional text to display alongside the icon.
|
|
7
|
+
*/
|
|
8
|
+
text?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Optional show shortcut keys in the button.
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
showShortcut?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function ColorTextShortcutBadge({ shortcutKeys, }: {
|
|
16
|
+
shortcutKeys?: string;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
/**
|
|
19
|
+
* Button component for applying text colors in a Tiptap editor.
|
|
20
|
+
*
|
|
21
|
+
* For custom button implementations, use the `useColorText` hook instead.
|
|
22
|
+
*/
|
|
23
|
+
export declare const ColorTextButton: import("react").ForwardRefExoticComponent<ColorTextButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { type Editor } from "@tiptap/react";
|
|
2
|
+
export declare const COLOR_TEXT_SHORTCUT_KEY = "mod+shift+t";
|
|
3
|
+
export declare const TEXT_COLORS: {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
border: string;
|
|
7
|
+
}[];
|
|
8
|
+
/**
|
|
9
|
+
* Configuration for the color text functionality
|
|
10
|
+
*/
|
|
11
|
+
export interface UseColorTextConfig {
|
|
12
|
+
/**
|
|
13
|
+
* The Tiptap editor instance.
|
|
14
|
+
*/
|
|
15
|
+
editor?: Editor | null;
|
|
16
|
+
/**
|
|
17
|
+
* The text color to apply.
|
|
18
|
+
* Can be any valid CSS color value.
|
|
19
|
+
*/
|
|
20
|
+
textColor: string;
|
|
21
|
+
/**
|
|
22
|
+
* Optional text to display alongside the icon.
|
|
23
|
+
*/
|
|
24
|
+
label: string;
|
|
25
|
+
/**
|
|
26
|
+
* Whether the button should hide when the mark is not available.
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
hideWhenUnavailable?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Called when the text color is applied.
|
|
32
|
+
*/
|
|
33
|
+
onApplied?: ({ color, label }: {
|
|
34
|
+
color: string;
|
|
35
|
+
label: string;
|
|
36
|
+
}) => void;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Checks if text color can be toggled in the current editor state
|
|
40
|
+
*/
|
|
41
|
+
export declare function canColorText(editor: Editor | null): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Checks if text color is active in the current selection
|
|
44
|
+
*/
|
|
45
|
+
export declare function isColorTextActive(editor: Editor | null, textColor: string): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Determines if the color text button should be shown
|
|
48
|
+
*/
|
|
49
|
+
export declare function shouldShowButton(props: {
|
|
50
|
+
editor: Editor | null;
|
|
51
|
+
hideWhenUnavailable: boolean;
|
|
52
|
+
}): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Custom hook that provides color text functionality for Tiptap editor
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```tsx
|
|
58
|
+
* // Simple usage with required textColor
|
|
59
|
+
* function MySimpleTextColorButton() {
|
|
60
|
+
* const { isVisible, handleColorText, isActive } = useColorText({
|
|
61
|
+
* textColor: "red",
|
|
62
|
+
* label: "Red Text",
|
|
63
|
+
* })
|
|
64
|
+
*
|
|
65
|
+
* if (!isVisible) return null
|
|
66
|
+
*
|
|
67
|
+
* return (
|
|
68
|
+
* <button
|
|
69
|
+
* onClick={handleColorText}
|
|
70
|
+
* style={{ color: isActive ? "red" : "inherit" }}
|
|
71
|
+
* >
|
|
72
|
+
* Red Text
|
|
73
|
+
* </button>
|
|
74
|
+
* )
|
|
75
|
+
* }
|
|
76
|
+
*
|
|
77
|
+
* // Advanced usage
|
|
78
|
+
* function MyAdvancedTextColorButton() {
|
|
79
|
+
* const { isVisible, handleColorText, label, isActive } = useColorText({
|
|
80
|
+
* editor: myEditor,
|
|
81
|
+
* textColor: "#ff0000",
|
|
82
|
+
* label: "Apply Red",
|
|
83
|
+
* hideWhenUnavailable: true,
|
|
84
|
+
* onApplied: ({ color }) => console.log("Applied:", color),
|
|
85
|
+
* })
|
|
86
|
+
*
|
|
87
|
+
* if (!isVisible) return null
|
|
88
|
+
*
|
|
89
|
+
* return (
|
|
90
|
+
* <MyButton
|
|
91
|
+
* onClick={handleColorText}
|
|
92
|
+
* aria-label={label}
|
|
93
|
+
* data-active={isActive}
|
|
94
|
+
* >
|
|
95
|
+
* Apply Text Color
|
|
96
|
+
* </MyButton>
|
|
97
|
+
* )
|
|
98
|
+
* }
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
export declare function useColorText(config: UseColorTextConfig): {
|
|
102
|
+
isVisible: boolean;
|
|
103
|
+
isActive: boolean;
|
|
104
|
+
handleColorText: () => false | undefined;
|
|
105
|
+
canColorText: boolean;
|
|
106
|
+
label: string;
|
|
107
|
+
shortcutKeys: string;
|
|
108
|
+
Icon: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
109
|
+
};
|