@import-ai/omnibox-editor 0.0.1
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 +526 -0
- package/dist/components/tiptap-extension/ai-generation-widget-extension.d.ts +41 -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/ai-sparkles-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-ai-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/mic-ai-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-ai-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/stop-circle-2-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-icons/x-icon.d.ts +3 -0
- package/dist/components/tiptap-node/code-block-node/code-block-node-extension.d.ts +6 -0
- package/dist/components/tiptap-node/code-block-node/code-block-node-view.d.ts +2 -0
- package/dist/components/tiptap-node/code-block-node/diagram-render.d.ts +7 -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-load-state.d.ts +9 -0
- package/dist/components/tiptap-node/image-node/image-node-extension.d.ts +7 -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 +26 -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 +32 -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 +18 -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-context-menu/index.d.ts +1 -0
- package/dist/components/tiptap-node/table-node/ui/table-context-menu/table-context-menu-utils.d.ts +20 -0
- package/dist/components/tiptap-node/table-node/ui/table-context-menu/table-context-menu.d.ts +7 -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 +15 -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 +32 -0
- package/dist/components/tiptap-ui/ai-composer/ai-composer.d.ts +21 -0
- package/dist/components/tiptap-ui/ai-composer/ai-generation-state.d.ts +6 -0
- package/dist/components/tiptap-ui/ai-composer/ai-markdown-preview.d.ts +4 -0
- package/dist/components/tiptap-ui/ai-composer/ai-review-controls.d.ts +13 -0
- package/dist/components/tiptap-ui/ai-composer/ai-writing-indicator.d.ts +10 -0
- package/dist/components/tiptap-ui/ai-composer/index.d.ts +3 -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-utils.d.ts +8 -0
- package/dist/components/tiptap-ui/color-menu/color-menu.d.ts +43 -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 +92 -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 +102 -0
- package/dist/components/tiptap-ui/math-editor/index.d.ts +1 -0
- package/dist/components/tiptap-ui/math-editor/math-editor.d.ts +10 -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 +7 -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 +146 -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 +103 -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 +153 -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/contexts/user-context.d.ts +16 -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 +7 -0
- package/dist/lib/clipboard.d.ts +6 -0
- package/dist/lib/editor-collaboration.d.ts +6 -0
- package/dist/lib/editor-content.d.ts +5 -0
- package/dist/lib/editor-users.d.ts +27 -0
- package/dist/lib/html-table.d.ts +5 -0
- package/dist/lib/i18n.d.ts +170 -0
- package/dist/lib/markdown.d.ts +12 -0
- package/dist/lib/math-editor.d.ts +19 -0
- package/dist/lib/tiptap-advanced-utils.d.ts +120 -0
- package/dist/lib/tiptap-collab-utils.d.ts +47 -0
- package/dist/lib/tiptap-utils.d.ts +174 -0
- package/dist/omnibox-editor.css +1 -0
- package/dist/omnibox-editor.js +19816 -0
- package/dist/omnibox-editor.umd.cjs +15 -0
- package/dist/types.d.ts +77 -0
- package/package.json +114 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { type Editor } from "@tiptap/react";
|
|
2
|
+
import type { Node } from "@tiptap/pm/model";
|
|
3
|
+
export declare const SLASH_COMMAND_TRIGGER_SHORTCUT_KEY = "mod+/";
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for the slash command functionality
|
|
6
|
+
*/
|
|
7
|
+
export interface UseSlashCommandTriggerConfig {
|
|
8
|
+
/**
|
|
9
|
+
* The Tiptap editor instance.
|
|
10
|
+
*/
|
|
11
|
+
editor?: Editor | null;
|
|
12
|
+
/**
|
|
13
|
+
* The node to apply trigger to
|
|
14
|
+
*/
|
|
15
|
+
node?: Node | null;
|
|
16
|
+
/**
|
|
17
|
+
* The position of the node in the document
|
|
18
|
+
*/
|
|
19
|
+
nodePos?: number | null;
|
|
20
|
+
/**
|
|
21
|
+
* The trigger text to insert
|
|
22
|
+
* @default "/"
|
|
23
|
+
*/
|
|
24
|
+
trigger?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Whether the button should hide when insertion is not available.
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
hideWhenUnavailable?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Callback function called after a successful trigger insertion.
|
|
32
|
+
*/
|
|
33
|
+
onTriggered?: (trigger: string) => void;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Checks if a slash command can be inserted in the current editor state
|
|
37
|
+
*/
|
|
38
|
+
export declare function canInsertSlashCommand(editor: Editor | null, node?: Node | null, nodePos?: number | null): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Inserts a slash command at a specified node position or after the current selection
|
|
41
|
+
*/
|
|
42
|
+
export declare function insertSlashCommand(editor: Editor | null, trigger?: string, node?: Node | null, nodePos?: number | null): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Determines if the slash command button should be shown
|
|
45
|
+
*/
|
|
46
|
+
export declare function shouldShowButton(props: {
|
|
47
|
+
editor: Editor | null;
|
|
48
|
+
hideWhenUnavailable: boolean;
|
|
49
|
+
node?: Node | null;
|
|
50
|
+
nodePos?: number | null;
|
|
51
|
+
}): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Custom hook that provides slash command functionality for Tiptap editor
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```tsx
|
|
57
|
+
* // Simple usage - no params needed
|
|
58
|
+
* function MySimpleSlashButton() {
|
|
59
|
+
* const { isVisible, handleSlashCommand } = useSlashCommandTrigger()
|
|
60
|
+
*
|
|
61
|
+
* if (!isVisible) return null
|
|
62
|
+
*
|
|
63
|
+
* return <button onClick={handleSlashCommand}>Insert Block</button>
|
|
64
|
+
* }
|
|
65
|
+
*
|
|
66
|
+
* // Advanced usage with configuration
|
|
67
|
+
* function MyAdvancedSlashButton() {
|
|
68
|
+
* const { isVisible, handleSlashCommand, label } = useSlashCommandTrigger({
|
|
69
|
+
* editor: myEditor,
|
|
70
|
+
* trigger: "/",
|
|
71
|
+
* hideWhenUnavailable: true,
|
|
72
|
+
* onTriggered: (trigger) => console.log('Inserted:', trigger)
|
|
73
|
+
* })
|
|
74
|
+
*
|
|
75
|
+
* if (!isVisible) return null
|
|
76
|
+
*
|
|
77
|
+
* return (
|
|
78
|
+
* <MyButton
|
|
79
|
+
* onClick={handleSlashCommand}
|
|
80
|
+
* aria-label={label}
|
|
81
|
+
* >
|
|
82
|
+
* Insert Block
|
|
83
|
+
* </MyButton>
|
|
84
|
+
* )
|
|
85
|
+
* }
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
export declare function useSlashCommandTrigger(config?: UseSlashCommandTriggerConfig): {
|
|
89
|
+
isVisible: boolean;
|
|
90
|
+
handleSlashCommand: () => boolean;
|
|
91
|
+
canInsert: boolean;
|
|
92
|
+
label: string;
|
|
93
|
+
shortcutKeys: string;
|
|
94
|
+
trigger: string;
|
|
95
|
+
Icon: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
96
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SuggestionMenuProps } from "@/components/tiptap-ui-utils/suggestion-menu";
|
|
2
|
+
import type { SlashMenuConfig } from "@/components/tiptap-ui/slash-dropdown-menu/use-slash-dropdown-menu";
|
|
3
|
+
import "@/components/tiptap-ui/slash-dropdown-menu/slash-dropdown-menu.css";
|
|
4
|
+
type SlashDropdownMenuProps = Omit<SuggestionMenuProps, "items" | "children"> & {
|
|
5
|
+
config?: SlashMenuConfig;
|
|
6
|
+
};
|
|
7
|
+
export declare const SlashDropdownMenu: (props: SlashDropdownMenuProps) => import("react").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/react";
|
|
2
|
+
import { type OmniboxEditorI18n } from "@/lib/i18n";
|
|
3
|
+
import type { SuggestionItem } from "@/components/tiptap-ui-utils/suggestion-menu";
|
|
4
|
+
export interface SlashMenuConfig {
|
|
5
|
+
aiEnabled?: boolean;
|
|
6
|
+
onAiAction?: (action: SlashMenuAiAction) => void;
|
|
7
|
+
enabledItems?: SlashMenuItemType[];
|
|
8
|
+
customItems?: SuggestionItem[];
|
|
9
|
+
itemGroups?: {
|
|
10
|
+
[key in SlashMenuItemType]?: string;
|
|
11
|
+
};
|
|
12
|
+
showGroups?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare function getSlashMenuTexts(i18n: OmniboxEditorI18n): {
|
|
15
|
+
ai_continue_writing: {
|
|
16
|
+
title: string;
|
|
17
|
+
subtext: string;
|
|
18
|
+
keywords: string[];
|
|
19
|
+
badge: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
20
|
+
group: string;
|
|
21
|
+
};
|
|
22
|
+
ai_ask: {
|
|
23
|
+
title: string;
|
|
24
|
+
subtext: string;
|
|
25
|
+
keywords: string[];
|
|
26
|
+
badge: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
27
|
+
group: string;
|
|
28
|
+
};
|
|
29
|
+
text: {
|
|
30
|
+
title: string;
|
|
31
|
+
subtext: string;
|
|
32
|
+
keywords: string[];
|
|
33
|
+
badge: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
34
|
+
group: string;
|
|
35
|
+
};
|
|
36
|
+
heading_1: {
|
|
37
|
+
title: string;
|
|
38
|
+
subtext: string;
|
|
39
|
+
keywords: string[];
|
|
40
|
+
badge: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
41
|
+
group: string;
|
|
42
|
+
};
|
|
43
|
+
heading_2: {
|
|
44
|
+
title: string;
|
|
45
|
+
subtext: string;
|
|
46
|
+
keywords: string[];
|
|
47
|
+
badge: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
48
|
+
group: string;
|
|
49
|
+
};
|
|
50
|
+
heading_3: {
|
|
51
|
+
title: string;
|
|
52
|
+
subtext: string;
|
|
53
|
+
keywords: string[];
|
|
54
|
+
badge: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
55
|
+
group: string;
|
|
56
|
+
};
|
|
57
|
+
bullet_list: {
|
|
58
|
+
title: string;
|
|
59
|
+
subtext: string;
|
|
60
|
+
keywords: string[];
|
|
61
|
+
badge: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
62
|
+
group: string;
|
|
63
|
+
};
|
|
64
|
+
ordered_list: {
|
|
65
|
+
title: string;
|
|
66
|
+
subtext: string;
|
|
67
|
+
keywords: string[];
|
|
68
|
+
badge: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
69
|
+
group: string;
|
|
70
|
+
};
|
|
71
|
+
task_list: {
|
|
72
|
+
title: string;
|
|
73
|
+
subtext: string;
|
|
74
|
+
keywords: string[];
|
|
75
|
+
badge: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
76
|
+
group: string;
|
|
77
|
+
};
|
|
78
|
+
quote: {
|
|
79
|
+
title: string;
|
|
80
|
+
subtext: string;
|
|
81
|
+
keywords: string[];
|
|
82
|
+
badge: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
83
|
+
group: string;
|
|
84
|
+
};
|
|
85
|
+
code_block: {
|
|
86
|
+
title: string;
|
|
87
|
+
subtext: string;
|
|
88
|
+
keywords: string[];
|
|
89
|
+
badge: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
90
|
+
group: string;
|
|
91
|
+
};
|
|
92
|
+
mention: {
|
|
93
|
+
title: string;
|
|
94
|
+
subtext: string;
|
|
95
|
+
keywords: string[];
|
|
96
|
+
badge: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
97
|
+
group: string;
|
|
98
|
+
};
|
|
99
|
+
emoji: {
|
|
100
|
+
title: string;
|
|
101
|
+
subtext: string;
|
|
102
|
+
keywords: string[];
|
|
103
|
+
badge: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
104
|
+
group: string;
|
|
105
|
+
};
|
|
106
|
+
table: {
|
|
107
|
+
title: string;
|
|
108
|
+
subtext: string;
|
|
109
|
+
keywords: string[];
|
|
110
|
+
badge: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
111
|
+
group: string;
|
|
112
|
+
};
|
|
113
|
+
divider: {
|
|
114
|
+
title: string;
|
|
115
|
+
subtext: string;
|
|
116
|
+
keywords: string[];
|
|
117
|
+
badge: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
118
|
+
group: string;
|
|
119
|
+
};
|
|
120
|
+
toc: {
|
|
121
|
+
title: string;
|
|
122
|
+
subtext: string;
|
|
123
|
+
keywords: string[];
|
|
124
|
+
badge: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
125
|
+
group: string;
|
|
126
|
+
};
|
|
127
|
+
image: {
|
|
128
|
+
title: string;
|
|
129
|
+
subtext: string;
|
|
130
|
+
keywords: string[];
|
|
131
|
+
badge: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
132
|
+
group: string;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
export type SlashMenuItemType = keyof ReturnType<typeof getSlashMenuTexts>;
|
|
136
|
+
export type SlashMenuAiAction = "ask" | "continue_writing";
|
|
137
|
+
export declare function getSlashMenuItemAction(itemType: SlashMenuItemType): SlashMenuAiAction | null;
|
|
138
|
+
export declare function getSlashMenuItemTypes(itemTypes: SlashMenuItemType[], config?: Pick<SlashMenuConfig, "aiEnabled">): ("emoji" | "image" | "table" | "mention" | "text" | "quote" | "toc" | "ai_continue_writing" | "ai_ask" | "heading_1" | "heading_2" | "heading_3" | "bullet_list" | "ordered_list" | "task_list" | "code_block" | "divider")[];
|
|
139
|
+
/**
|
|
140
|
+
* Custom hook for slash dropdown menu functionality
|
|
141
|
+
*/
|
|
142
|
+
export declare function useSlashDropdownMenu(config?: SlashMenuConfig): {
|
|
143
|
+
getSlashMenuItems: (editor: Editor) => SuggestionItem<any>[];
|
|
144
|
+
config: SlashMenuConfig | undefined;
|
|
145
|
+
};
|
|
146
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { TextAlign, UseTextAlignConfig } from "@/components/tiptap-ui/text-align-button";
|
|
2
|
+
import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
|
|
3
|
+
type IconProps = React.SVGProps<SVGSVGElement>;
|
|
4
|
+
type IconComponent = ({ className, ...props }: IconProps) => React.ReactElement;
|
|
5
|
+
export interface TextAlignButtonProps extends Omit<ButtonProps, "type">, UseTextAlignConfig {
|
|
6
|
+
/**
|
|
7
|
+
* Optional text to display alongside the icon.
|
|
8
|
+
*/
|
|
9
|
+
text?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Optional show shortcut keys in the button.
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
14
|
+
showShortcut?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Optional custom icon component to render instead of the default.
|
|
17
|
+
*/
|
|
18
|
+
icon?: React.MemoExoticComponent<IconComponent> | React.FC<IconProps>;
|
|
19
|
+
}
|
|
20
|
+
export declare function TextAlignShortcutBadge({ align, shortcutKeys, }: {
|
|
21
|
+
align: TextAlign;
|
|
22
|
+
shortcutKeys?: string;
|
|
23
|
+
}): import("react").JSX.Element;
|
|
24
|
+
/**
|
|
25
|
+
* Button component for setting text alignment in a Tiptap editor.
|
|
26
|
+
*
|
|
27
|
+
* For custom button implementations, use the `useTextAlign` hook instead.
|
|
28
|
+
*/
|
|
29
|
+
export declare const TextAlignButton: import("react").ForwardRefExoticComponent<TextAlignButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { ChainedCommands } from "@tiptap/react";
|
|
2
|
+
import { type Editor } from "@tiptap/react";
|
|
3
|
+
import { type OmniboxEditorI18n } from "@/lib/i18n";
|
|
4
|
+
export type TextAlign = "left" | "center" | "right" | "justify";
|
|
5
|
+
/**
|
|
6
|
+
* Configuration for the text align functionality
|
|
7
|
+
*/
|
|
8
|
+
export interface UseTextAlignConfig {
|
|
9
|
+
/**
|
|
10
|
+
* The Tiptap editor instance.
|
|
11
|
+
*/
|
|
12
|
+
editor?: Editor | null;
|
|
13
|
+
/**
|
|
14
|
+
* The text alignment to apply.
|
|
15
|
+
*/
|
|
16
|
+
align: TextAlign;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the button should hide when alignment is not available.
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
hideWhenUnavailable?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Callback function called after a successful alignment change.
|
|
24
|
+
*/
|
|
25
|
+
onAligned?: () => void;
|
|
26
|
+
}
|
|
27
|
+
export declare const TEXT_ALIGN_SHORTCUT_KEYS: Record<TextAlign, string>;
|
|
28
|
+
export declare const textAlignIcons: {
|
|
29
|
+
left: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
30
|
+
center: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
31
|
+
right: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
32
|
+
justify: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
33
|
+
};
|
|
34
|
+
export declare function getTextAlignLabel(align: TextAlign, i18n: OmniboxEditorI18n): string;
|
|
35
|
+
/**
|
|
36
|
+
* Checks if text alignment can be performed in the current editor state
|
|
37
|
+
*/
|
|
38
|
+
export declare function canSetTextAlign(editor: Editor | null, align: TextAlign): boolean;
|
|
39
|
+
export declare function hasSetTextAlign(commands: ChainedCommands): commands is ChainedCommands & {
|
|
40
|
+
setTextAlign: (align: TextAlign) => ChainedCommands;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Checks if the text alignment is currently active
|
|
44
|
+
*/
|
|
45
|
+
export declare function isTextAlignActive(editor: Editor | null, align: TextAlign): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Sets text alignment in the editor
|
|
48
|
+
*/
|
|
49
|
+
export declare function setTextAlign(editor: Editor | null, align: TextAlign): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Determines if the text align button should be shown
|
|
52
|
+
*/
|
|
53
|
+
export declare function shouldShowButton(props: {
|
|
54
|
+
editor: Editor | null;
|
|
55
|
+
hideWhenUnavailable: boolean;
|
|
56
|
+
align: TextAlign;
|
|
57
|
+
}): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Custom hook that provides text align functionality for Tiptap editor
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```tsx
|
|
63
|
+
* // Simple usage
|
|
64
|
+
* function MySimpleAlignButton() {
|
|
65
|
+
* const { isVisible, handleTextAlign } = useTextAlign({ align: "center" })
|
|
66
|
+
*
|
|
67
|
+
* if (!isVisible) return null
|
|
68
|
+
*
|
|
69
|
+
* return <button onClick={handleTextAlign}>Align Center</button>
|
|
70
|
+
* }
|
|
71
|
+
*
|
|
72
|
+
* // Advanced usage with configuration
|
|
73
|
+
* function MyAdvancedAlignButton() {
|
|
74
|
+
* const { isVisible, handleTextAlign, label, isActive } = useTextAlign({
|
|
75
|
+
* editor: myEditor,
|
|
76
|
+
* align: "right",
|
|
77
|
+
* hideWhenUnavailable: true,
|
|
78
|
+
* onAligned: () => console.log('Text aligned!')
|
|
79
|
+
* })
|
|
80
|
+
*
|
|
81
|
+
* if (!isVisible) return null
|
|
82
|
+
*
|
|
83
|
+
* return (
|
|
84
|
+
* <MyButton
|
|
85
|
+
* onClick={handleTextAlign}
|
|
86
|
+
* aria-pressed={isActive}
|
|
87
|
+
* aria-label={label}
|
|
88
|
+
* >
|
|
89
|
+
* Align Right
|
|
90
|
+
* </MyButton>
|
|
91
|
+
* )
|
|
92
|
+
* }
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
export declare function useTextAlign(config: UseTextAlignConfig): {
|
|
96
|
+
isVisible: boolean;
|
|
97
|
+
isActive: boolean;
|
|
98
|
+
handleTextAlign: () => boolean;
|
|
99
|
+
canAlign: boolean;
|
|
100
|
+
label: string;
|
|
101
|
+
shortcutKeys: string;
|
|
102
|
+
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>;
|
|
103
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { UseTextConfig } from "@/components/tiptap-ui/text-button";
|
|
2
|
+
import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
|
|
3
|
+
export interface TextButtonProps extends Omit<ButtonProps, "type">, UseTextConfig {
|
|
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 TextShortcutBadge({ shortcutKeys, }: {
|
|
15
|
+
shortcutKeys?: string;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
17
|
+
/**
|
|
18
|
+
* Button component for converting to text/paragraph in a Tiptap editor.
|
|
19
|
+
*
|
|
20
|
+
* For custom button implementations, use the `useText` hook instead.
|
|
21
|
+
*/
|
|
22
|
+
export declare const TextButton: import("react").ForwardRefExoticComponent<TextButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { type Editor } from "@tiptap/react";
|
|
2
|
+
export declare const TEXT_SHORTCUT_KEY = "mod+alt+0";
|
|
3
|
+
/**
|
|
4
|
+
* Configuration for the text/paragraph functionality
|
|
5
|
+
*/
|
|
6
|
+
export interface UseTextConfig {
|
|
7
|
+
/**
|
|
8
|
+
* The Tiptap editor instance.
|
|
9
|
+
*/
|
|
10
|
+
editor?: Editor | null;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the button should hide when text conversion is not available.
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
hideWhenUnavailable?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Callback function called after a successful conversion.
|
|
18
|
+
*/
|
|
19
|
+
onToggled?: () => void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Returns whether we can toggle/turn the current selection into a paragraph.
|
|
23
|
+
* - When `turnInto === false`, it just checks the direct ability to set paragraph on the selection.
|
|
24
|
+
* - When `turnInto === true`, it additionally requires the selection to be within convertible types.
|
|
25
|
+
*/
|
|
26
|
+
export declare function canToggleText(editor: Editor | null, turnInto?: boolean): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Checks if paragraph is currently active
|
|
29
|
+
*/
|
|
30
|
+
export declare function isParagraphActive(editor: Editor | null): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Converts the current selection or node to paragraph
|
|
33
|
+
*/
|
|
34
|
+
export declare function toggleParagraph(editor: Editor | null): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Determines if the text button should be shown
|
|
37
|
+
*/
|
|
38
|
+
export declare function shouldShowButton(props: {
|
|
39
|
+
editor: Editor | null;
|
|
40
|
+
hideWhenUnavailable: boolean;
|
|
41
|
+
}): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Custom hook that provides text/paragraph functionality for Tiptap editor
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* // Simple usage - no params needed
|
|
48
|
+
* function MySimpleTextButton() {
|
|
49
|
+
* const { isVisible, handleToggle, isActive } = useText()
|
|
50
|
+
*
|
|
51
|
+
* if (!isVisible) return null
|
|
52
|
+
*
|
|
53
|
+
* return <button onClick={handleToggle}>Text</button>
|
|
54
|
+
* }
|
|
55
|
+
*
|
|
56
|
+
* // Advanced usage with configuration
|
|
57
|
+
* function MyAdvancedTextButton() {
|
|
58
|
+
* const { isVisible, handleToggle, label, isActive } = useText({
|
|
59
|
+
* editor: myEditor,
|
|
60
|
+
* hideWhenUnavailable: true,
|
|
61
|
+
* onToggled: () => console.log('Text converted!')
|
|
62
|
+
* })
|
|
63
|
+
*
|
|
64
|
+
* if (!isVisible) return null
|
|
65
|
+
*
|
|
66
|
+
* return (
|
|
67
|
+
* <MyButton
|
|
68
|
+
* onClick={handleToggle}
|
|
69
|
+
* aria-label={label}
|
|
70
|
+
* aria-pressed={isActive}
|
|
71
|
+
* >
|
|
72
|
+
* Convert to Text
|
|
73
|
+
* </MyButton>
|
|
74
|
+
* )
|
|
75
|
+
* }
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export declare function useText(config?: UseTextConfig): {
|
|
79
|
+
isVisible: boolean;
|
|
80
|
+
isActive: boolean;
|
|
81
|
+
handleToggle: () => boolean;
|
|
82
|
+
canToggle: boolean;
|
|
83
|
+
label: string;
|
|
84
|
+
shortcutKeys: string;
|
|
85
|
+
Icon: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
86
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/react";
|
|
2
|
+
import type { UseTurnIntoDropdownConfig } from "@/components/tiptap-ui/turn-into-dropdown";
|
|
3
|
+
import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
|
|
4
|
+
export interface TurnIntoDropdownContentProps {
|
|
5
|
+
blockTypes?: string[];
|
|
6
|
+
editor?: Editor | null;
|
|
7
|
+
}
|
|
8
|
+
export declare function TurnIntoDropdownContent({ blockTypes, editor, }: TurnIntoDropdownContentProps): import("react").JSX.Element;
|
|
9
|
+
export interface TurnIntoDropdownProps extends Omit<ButtonProps, "type">, UseTurnIntoDropdownConfig {
|
|
10
|
+
modal?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Dropdown component for transforming block types in a Tiptap editor.
|
|
14
|
+
* For custom dropdown implementations, use the `useTurnIntoDropdown` hook instead.
|
|
15
|
+
*/
|
|
16
|
+
export declare const TurnIntoDropdown: import("react").ForwardRefExoticComponent<TurnIntoDropdownProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/react";
|
|
2
|
+
import { type OmniboxEditorI18n } from "@/lib/i18n";
|
|
3
|
+
import type { Level } from "@/components/tiptap-ui/heading-button";
|
|
4
|
+
export declare const TURN_INTO_BLOCKS: string[];
|
|
5
|
+
/**
|
|
6
|
+
* Configuration for the turn into dropdown functionality
|
|
7
|
+
*/
|
|
8
|
+
export interface UseTurnIntoDropdownConfig {
|
|
9
|
+
/**
|
|
10
|
+
* The Tiptap editor instance.
|
|
11
|
+
*/
|
|
12
|
+
editor?: Editor | null;
|
|
13
|
+
/**
|
|
14
|
+
* Whether the dropdown should hide when no options are available.
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
hideWhenUnavailable?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Which block types to show in the dropdown
|
|
20
|
+
* @default ["paragraph", "heading", "bulletList", "orderedList", "taskList", "blockquote", "codeBlock"]
|
|
21
|
+
*/
|
|
22
|
+
blockTypes?: string[];
|
|
23
|
+
/**
|
|
24
|
+
* Callback function called when the dropdown state changes.
|
|
25
|
+
*/
|
|
26
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
27
|
+
}
|
|
28
|
+
export declare const blockTypeOptions: ({
|
|
29
|
+
type: string;
|
|
30
|
+
label: string;
|
|
31
|
+
isActive: (editor: Editor) => boolean;
|
|
32
|
+
level?: undefined;
|
|
33
|
+
} | {
|
|
34
|
+
type: string;
|
|
35
|
+
label: string;
|
|
36
|
+
level: Level;
|
|
37
|
+
isActive: (editor: Editor) => boolean;
|
|
38
|
+
})[];
|
|
39
|
+
type BlockTypeOption = (typeof blockTypeOptions)[number];
|
|
40
|
+
export declare function localizeBlockTypeOption(option: BlockTypeOption, i18n: OmniboxEditorI18n): BlockTypeOption;
|
|
41
|
+
/**
|
|
42
|
+
* Checks if turn into functionality can be used in the current editor state
|
|
43
|
+
*/
|
|
44
|
+
export declare function canTurnInto(editor: Editor | null, allowedBlockTypes?: string[]): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Gets filtered block type options based on available types
|
|
47
|
+
*/
|
|
48
|
+
export declare function getFilteredBlockTypeOptions(blockTypes?: string[]): ({
|
|
49
|
+
type: string;
|
|
50
|
+
label: string;
|
|
51
|
+
isActive: (editor: Editor) => boolean;
|
|
52
|
+
level?: undefined;
|
|
53
|
+
} | {
|
|
54
|
+
type: string;
|
|
55
|
+
label: string;
|
|
56
|
+
level: Level;
|
|
57
|
+
isActive: (editor: Editor) => boolean;
|
|
58
|
+
})[];
|
|
59
|
+
/**
|
|
60
|
+
* Gets the currently active block type from the available options
|
|
61
|
+
*/
|
|
62
|
+
export declare function getActiveBlockType(editor: Editor | null, blockTypes?: string[]): {
|
|
63
|
+
type: string;
|
|
64
|
+
label: string;
|
|
65
|
+
isActive: (editor: Editor) => boolean;
|
|
66
|
+
level?: undefined;
|
|
67
|
+
} | {
|
|
68
|
+
type: string;
|
|
69
|
+
label: string;
|
|
70
|
+
level: Level;
|
|
71
|
+
isActive: (editor: Editor) => boolean;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Determines if the turn into dropdown should be visible
|
|
75
|
+
*/
|
|
76
|
+
export declare function shouldShowTurnInto(params: {
|
|
77
|
+
editor: Editor | null;
|
|
78
|
+
hideWhenUnavailable: boolean;
|
|
79
|
+
blockTypes?: string[];
|
|
80
|
+
}): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Custom hook that provides turn into dropdown functionality for Tiptap editor
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```tsx
|
|
86
|
+
* // Simple usage
|
|
87
|
+
* function MyTurnIntoDropdown() {
|
|
88
|
+
* const {
|
|
89
|
+
* isVisible,
|
|
90
|
+
* canToggle,
|
|
91
|
+
* activeBlockType,
|
|
92
|
+
* handleOpenChange,
|
|
93
|
+
* label,
|
|
94
|
+
* Icon,
|
|
95
|
+
* } = useTurnIntoDropdown()
|
|
96
|
+
*
|
|
97
|
+
* if (!isVisible) return null
|
|
98
|
+
*
|
|
99
|
+
* return (
|
|
100
|
+
* <DropdownMenu onOpenChange={handleOpenChange}>
|
|
101
|
+
* // dropdown content
|
|
102
|
+
* </DropdownMenu>
|
|
103
|
+
* )
|
|
104
|
+
* }
|
|
105
|
+
*
|
|
106
|
+
* // Advanced usage with configuration
|
|
107
|
+
* function MyAdvancedTurnIntoDropdown() {
|
|
108
|
+
* const {
|
|
109
|
+
* isVisible,
|
|
110
|
+
* activeBlockType,
|
|
111
|
+
* } = useTurnIntoDropdown({
|
|
112
|
+
* editor: myEditor,
|
|
113
|
+
* blockTypes: ["paragraph", "heading", "bulletList"],
|
|
114
|
+
* hideWhenUnavailable: true,
|
|
115
|
+
* onOpenChange: (isOpen) => console.log("Dropdown toggled", isOpen),
|
|
116
|
+
* })
|
|
117
|
+
*
|
|
118
|
+
* // component implementation
|
|
119
|
+
* }
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
export declare function useTurnIntoDropdown(config?: UseTurnIntoDropdownConfig): {
|
|
123
|
+
isVisible: boolean;
|
|
124
|
+
canToggle: boolean;
|
|
125
|
+
isOpen: boolean;
|
|
126
|
+
setIsOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
127
|
+
activeBlockType: {
|
|
128
|
+
type: string;
|
|
129
|
+
label: string;
|
|
130
|
+
isActive: (editor: Editor) => boolean;
|
|
131
|
+
level?: undefined;
|
|
132
|
+
} | {
|
|
133
|
+
type: string;
|
|
134
|
+
label: string;
|
|
135
|
+
level: Level;
|
|
136
|
+
isActive: (editor: Editor) => boolean;
|
|
137
|
+
};
|
|
138
|
+
handleOpenChange: (open: boolean) => void;
|
|
139
|
+
filteredOptions: ({
|
|
140
|
+
type: string;
|
|
141
|
+
label: string;
|
|
142
|
+
isActive: (editor: Editor) => boolean;
|
|
143
|
+
level?: undefined;
|
|
144
|
+
} | {
|
|
145
|
+
type: string;
|
|
146
|
+
label: string;
|
|
147
|
+
level: Level;
|
|
148
|
+
isActive: (editor: Editor) => boolean;
|
|
149
|
+
})[];
|
|
150
|
+
label: string;
|
|
151
|
+
Icon: import("react").MemoExoticComponent<({ className, ...props }: Omit<import("react").SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
|
|
152
|
+
};
|
|
153
|
+
export {};
|