@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,86 @@
|
|
|
1
|
+
import type { UseFloatingOptions } from "@floating-ui/react";
|
|
2
|
+
import type { PluginKey } from "@tiptap/pm/state";
|
|
3
|
+
import type { SuggestionOptions } from "@tiptap/suggestion";
|
|
4
|
+
import type { Editor, Range } from "@tiptap/react";
|
|
5
|
+
type DefaultContext = any;
|
|
6
|
+
type IconProps = React.SVGProps<SVGSVGElement>;
|
|
7
|
+
type IconComponent = ({ className, ...props }: IconProps) => React.ReactElement;
|
|
8
|
+
export interface SuggestionItem<T = DefaultContext> {
|
|
9
|
+
/**
|
|
10
|
+
* The main text to display for the suggestion.
|
|
11
|
+
*/
|
|
12
|
+
title: string;
|
|
13
|
+
/**
|
|
14
|
+
* Secondary text to provide additional context.
|
|
15
|
+
*/
|
|
16
|
+
subtext?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Icon or badge to display alongside the suggestion.
|
|
19
|
+
*/
|
|
20
|
+
badge?: React.MemoExoticComponent<IconComponent> | React.FC<IconProps> | string;
|
|
21
|
+
/**
|
|
22
|
+
* Group identifier for organizing suggestions.
|
|
23
|
+
*/
|
|
24
|
+
group?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Additional keywords for filtering suggestions.
|
|
27
|
+
*/
|
|
28
|
+
keywords?: string[];
|
|
29
|
+
/**
|
|
30
|
+
* Custom data to pass to the onSelect handler.
|
|
31
|
+
*/
|
|
32
|
+
context?: T;
|
|
33
|
+
/**
|
|
34
|
+
* Callback executed when this suggestion is selected.
|
|
35
|
+
*/
|
|
36
|
+
onSelect: (props: {
|
|
37
|
+
editor: Editor;
|
|
38
|
+
range: Range;
|
|
39
|
+
context?: T;
|
|
40
|
+
}) => void;
|
|
41
|
+
}
|
|
42
|
+
export type SuggestionMenuRenderProps<T = DefaultContext> = {
|
|
43
|
+
/**
|
|
44
|
+
* List of suggestion items to display.
|
|
45
|
+
*/
|
|
46
|
+
items: SuggestionItem<T>[];
|
|
47
|
+
/**
|
|
48
|
+
* Index of the currently selected item.
|
|
49
|
+
*/
|
|
50
|
+
selectedIndex?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Callback to select an item.
|
|
53
|
+
*/
|
|
54
|
+
onSelect: (item: SuggestionItem<T>) => void;
|
|
55
|
+
};
|
|
56
|
+
export interface SuggestionMenuProps<T = DefaultContext> extends Omit<SuggestionOptions<SuggestionItem<T>>, "pluginKey" | "editor"> {
|
|
57
|
+
/**
|
|
58
|
+
* The Tiptap editor instance.
|
|
59
|
+
*/
|
|
60
|
+
editor?: Editor | null;
|
|
61
|
+
/**
|
|
62
|
+
* Additional options for the floating UI.
|
|
63
|
+
*/
|
|
64
|
+
floatingOptions?: Partial<UseFloatingOptions>;
|
|
65
|
+
/**
|
|
66
|
+
* CSS selector attribute for targeting the menu.
|
|
67
|
+
* @default 'tiptap-suggestion-menu'
|
|
68
|
+
*/
|
|
69
|
+
selector?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Unique key for the suggestion plugin.
|
|
72
|
+
* @default SuggestionPluginKey
|
|
73
|
+
*/
|
|
74
|
+
pluginKey?: string | PluginKey;
|
|
75
|
+
/**
|
|
76
|
+
* Maximum height of the suggestion menu.
|
|
77
|
+
* If provided, the menu will scroll if content exceeds this height.
|
|
78
|
+
* @default 384
|
|
79
|
+
*/
|
|
80
|
+
maxHeight?: number;
|
|
81
|
+
/**
|
|
82
|
+
* Render function for the menu content.
|
|
83
|
+
*/
|
|
84
|
+
children: (props: SuggestionMenuRenderProps<T>) => React.ReactNode;
|
|
85
|
+
}
|
|
86
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Node } from "@tiptap/pm/model";
|
|
2
|
+
import type { SuggestionItem } from "@/components/tiptap-ui-utils/suggestion-menu/suggestion-menu-types";
|
|
3
|
+
/**
|
|
4
|
+
* Calculates the start position of a suggestion command in the text.
|
|
5
|
+
*
|
|
6
|
+
* @param cursorPosition Current cursor position
|
|
7
|
+
* @param previousNode Node before the cursor
|
|
8
|
+
* @param triggerChar Character that triggers the suggestion
|
|
9
|
+
* @returns The position where the command starts
|
|
10
|
+
*/
|
|
11
|
+
export declare function calculateStartPosition(cursorPosition: number, previousNode: Node | null, triggerChar?: string): number;
|
|
12
|
+
/**
|
|
13
|
+
* Filters and sorts suggestion items based on a search query.
|
|
14
|
+
*
|
|
15
|
+
* @param items List of suggestion items to filter
|
|
16
|
+
* @param query Search query string
|
|
17
|
+
* @returns Filtered and sorted list of suggestions
|
|
18
|
+
*/
|
|
19
|
+
export declare function filterSuggestionItems(items: SuggestionItem[], query: string): SuggestionItem<any>[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SuggestionMenuProps } from "@/components/tiptap-ui-utils/suggestion-menu/suggestion-menu-types";
|
|
2
|
+
/**
|
|
3
|
+
* A component that renders a suggestion menu for Tiptap editors.
|
|
4
|
+
* Displays a floating menu when a trigger character is typed.
|
|
5
|
+
*/
|
|
6
|
+
export declare const SuggestionMenu: ({ editor: providedEditor, floatingOptions, selector, children, maxHeight, pluginKey, ...internalSuggestionProps }: SuggestionMenuProps) => import("react").JSX.Element | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type EditorUser } from "@/lib/editor-users";
|
|
2
|
+
import type { OmniboxEditorCollaborationUser, OmniboxEditorMentionUser } from "@/types";
|
|
3
|
+
export type User = EditorUser;
|
|
4
|
+
export type UserContextValue = {
|
|
5
|
+
user: User;
|
|
6
|
+
mentionUsers: User[];
|
|
7
|
+
onlineUsers: User[];
|
|
8
|
+
setOnlineUsers: (users: User[]) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const UserContext: import("react").Context<UserContextValue>;
|
|
11
|
+
export declare function UserProvider({ children, mentionUsers, user: providedUser, }: {
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
mentionUsers?: OmniboxEditorMentionUser[];
|
|
14
|
+
user?: OmniboxEditorCollaborationUser;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
export declare const useUser: () => UserContextValue;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
type UserRef<T> = ((instance: T | null) => void) | React.RefObject<T | null> | null | undefined;
|
|
2
|
+
export declare const useComposedRef: <T extends HTMLElement>(libRef: React.RefObject<T | null>, userRef: UserRef<T>) => (instance: T | null) => void;
|
|
3
|
+
export default useComposedRef;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/react";
|
|
2
|
+
export interface CursorVisibilityOptions {
|
|
3
|
+
/**
|
|
4
|
+
* The Tiptap editor instance
|
|
5
|
+
*/
|
|
6
|
+
editor?: Editor | null;
|
|
7
|
+
/**
|
|
8
|
+
* Reference to the toolbar element that may obscure the cursor
|
|
9
|
+
*/
|
|
10
|
+
overlayHeight?: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Custom hook that ensures the cursor remains visible when typing in a Tiptap editor.
|
|
14
|
+
* Automatically scrolls the window when the cursor would be hidden by the toolbar.
|
|
15
|
+
*
|
|
16
|
+
* @param options.editor The Tiptap editor instance
|
|
17
|
+
* @param options.overlayHeight Toolbar height to account for
|
|
18
|
+
* @returns The bounding rect of the body
|
|
19
|
+
*/
|
|
20
|
+
export declare function useCursorVisibility({ editor, overlayHeight, }: CursorVisibilityOptions): import("@/hooks/use-element-rect").RectState;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type RectState = Omit<DOMRect, "toJSON">;
|
|
2
|
+
export interface ElementRectOptions {
|
|
3
|
+
/**
|
|
4
|
+
* The element to track. Can be an Element, ref, or selector string.
|
|
5
|
+
* Defaults to document.body if not provided.
|
|
6
|
+
*/
|
|
7
|
+
element?: Element | React.RefObject<Element> | string | null;
|
|
8
|
+
/**
|
|
9
|
+
* Whether to enable rect tracking
|
|
10
|
+
*/
|
|
11
|
+
enabled?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Throttle delay in milliseconds for rect updates
|
|
14
|
+
*/
|
|
15
|
+
throttleMs?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Whether to use ResizeObserver for more accurate tracking
|
|
18
|
+
*/
|
|
19
|
+
useResizeObserver?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Custom hook that tracks an element's bounding rectangle and updates on resize, scroll, etc.
|
|
23
|
+
*
|
|
24
|
+
* @param options Configuration options for element rect tracking
|
|
25
|
+
* @returns The current bounding rectangle of the element
|
|
26
|
+
*/
|
|
27
|
+
export declare function useElementRect({ element, enabled, throttleMs, useResizeObserver, }?: ElementRectOptions): RectState;
|
|
28
|
+
/**
|
|
29
|
+
* Convenience hook for tracking document.body rect
|
|
30
|
+
*/
|
|
31
|
+
export declare function useBodyRect(options?: Omit<ElementRectOptions, "element">): RectState;
|
|
32
|
+
/**
|
|
33
|
+
* Convenience hook for tracking a ref element's rect
|
|
34
|
+
*/
|
|
35
|
+
export declare function useRefRect<T extends Element>(ref: React.RefObject<T>, options?: Omit<ElementRectOptions, "element">): RectState;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { AutoUpdateOptions, UseDismissProps, UseFloatingOptions } from "@floating-ui/react";
|
|
2
|
+
interface FloatingElementReturn {
|
|
3
|
+
/**
|
|
4
|
+
* Whether the floating element is currently mounted in the DOM.
|
|
5
|
+
*/
|
|
6
|
+
isMounted: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Ref function to attach to the floating element DOM node.
|
|
9
|
+
*/
|
|
10
|
+
ref: (node: HTMLElement | null) => void;
|
|
11
|
+
/**
|
|
12
|
+
* Combined styles for positioning, transitions, and z-index.
|
|
13
|
+
*/
|
|
14
|
+
style: React.CSSProperties;
|
|
15
|
+
/**
|
|
16
|
+
* Returns props that should be spread onto the floating element.
|
|
17
|
+
*/
|
|
18
|
+
getFloatingProps: (userProps?: React.HTMLProps<HTMLElement>) => Record<string, unknown>;
|
|
19
|
+
/**
|
|
20
|
+
* Returns props that should be spread onto the reference element.
|
|
21
|
+
*/
|
|
22
|
+
getReferenceProps: (userProps?: React.HTMLProps<Element>) => Record<string, unknown>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Custom hook for creating and managing floating elements relative to a reference position
|
|
26
|
+
*
|
|
27
|
+
* @param show - Boolean controlling visibility of the floating element
|
|
28
|
+
* @param referencePos - DOMRect, function returning DOMRect, or null representing the position to anchor the floating element to
|
|
29
|
+
* @param zIndex - Z-index value for the floating element
|
|
30
|
+
* @param options - Additional options to pass to the underlying useFloating hook
|
|
31
|
+
* @returns Object containing properties and methods to control the floating element
|
|
32
|
+
*/
|
|
33
|
+
export declare function useFloatingElement(show: boolean, reference: HTMLElement | DOMRect | (() => DOMRect | null) | null, zIndex: number, options?: Partial<UseFloatingOptions & {
|
|
34
|
+
dismissOptions?: UseDismissProps;
|
|
35
|
+
}>, autoUpdateOptions?: AutoUpdateOptions): FloatingElementReturn;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type Editor } from "@tiptap/react";
|
|
2
|
+
export declare const HIDE_FLOATING_META = "hideFloatingToolbar";
|
|
3
|
+
/**
|
|
4
|
+
* Centralizes all logic about when the floating toolbar should be hidden/shown.
|
|
5
|
+
*
|
|
6
|
+
* - Listens for transactions that carry HIDE_FLOATING_META
|
|
7
|
+
* - Clears the hide flag on common “user intent” events
|
|
8
|
+
* - Handles the “re-click on the same selected node” case
|
|
9
|
+
* - Exposes `shouldShow` so UI can just render based on it
|
|
10
|
+
* - Exposes helpers to set selections with the meta flag
|
|
11
|
+
*/
|
|
12
|
+
export declare function useFloatingToolbarVisibility(params: {
|
|
13
|
+
editor: Editor | null;
|
|
14
|
+
isSelectionValid: (editor: Editor, selection: Editor["state"]["selection"]) => boolean;
|
|
15
|
+
extraHideWhen?: boolean;
|
|
16
|
+
}): {
|
|
17
|
+
shouldShow: boolean;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Programmatically select a node and hide floating for that selection
|
|
21
|
+
* @param editor
|
|
22
|
+
* @param pos
|
|
23
|
+
*/
|
|
24
|
+
export declare const selectNodeAndHideFloating: (editor: Editor, pos: number) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Mark “hide floating” on the next relevant transaction (no selection change needed)
|
|
27
|
+
* @param editor
|
|
28
|
+
*/
|
|
29
|
+
export declare const markHideFloatingOnNext: (editor: Editor) => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type BreakpointMode = "min" | "max";
|
|
2
|
+
/**
|
|
3
|
+
* Hook to detect whether the current viewport matches a given breakpoint rule.
|
|
4
|
+
* Example:
|
|
5
|
+
* useIsBreakpoint("max", 768) // true when width < 768
|
|
6
|
+
* useIsBreakpoint("min", 1024) // true when width >= 1024
|
|
7
|
+
*/
|
|
8
|
+
export declare function useIsBreakpoint(mode?: BreakpointMode, breakpoint?: number): boolean;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Custom hook that uses either `useLayoutEffect` or `useEffect` based on the environment (client-side or server-side).
|
|
4
|
+
* @param {Function} effect - The effect function to be executed.
|
|
5
|
+
* @param {Array<any>} [dependencies] - An array of dependencies for the effect (optional).
|
|
6
|
+
*/
|
|
7
|
+
export declare const useIsomorphicLayoutEffect: typeof useEffect;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/react";
|
|
2
|
+
type Orientation = "horizontal" | "vertical" | "both";
|
|
3
|
+
interface MenuNavigationOptions<T> {
|
|
4
|
+
/**
|
|
5
|
+
* The Tiptap editor instance, if using with a Tiptap editor.
|
|
6
|
+
*/
|
|
7
|
+
editor?: Editor | null;
|
|
8
|
+
/**
|
|
9
|
+
* Reference to the container element for handling keyboard events.
|
|
10
|
+
*/
|
|
11
|
+
containerRef?: React.RefObject<HTMLElement | null>;
|
|
12
|
+
/**
|
|
13
|
+
* Search query that affects the selected item.
|
|
14
|
+
*/
|
|
15
|
+
query?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Array of items to navigate through.
|
|
18
|
+
*/
|
|
19
|
+
items: T[];
|
|
20
|
+
/**
|
|
21
|
+
* Callback fired when an item is selected.
|
|
22
|
+
*/
|
|
23
|
+
onSelect?: (item: T) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Callback fired when the menu should close.
|
|
26
|
+
*/
|
|
27
|
+
onClose?: () => void;
|
|
28
|
+
/**
|
|
29
|
+
* The navigation orientation of the menu.
|
|
30
|
+
* @default "vertical"
|
|
31
|
+
*/
|
|
32
|
+
orientation?: Orientation;
|
|
33
|
+
/**
|
|
34
|
+
* Whether to automatically select the first item when the menu opens.
|
|
35
|
+
* @default true
|
|
36
|
+
*/
|
|
37
|
+
autoSelectFirstItem?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Hook that implements keyboard navigation for dropdown menus and command palettes.
|
|
41
|
+
*
|
|
42
|
+
* Handles arrow keys, tab, home/end, enter for selection, and escape to close.
|
|
43
|
+
* Works with both Tiptap editors and regular DOM elements.
|
|
44
|
+
*
|
|
45
|
+
* @param options - Configuration options for the menu navigation
|
|
46
|
+
* @returns Object containing the selected index and a setter function
|
|
47
|
+
*/
|
|
48
|
+
export declare function useMenuNavigation<T>({ editor, containerRef, query, items, onSelect, onClose, orientation, autoSelectFirstItem, }: MenuNavigationOptions<T>): {
|
|
49
|
+
selectedIndex: number | undefined;
|
|
50
|
+
setSelectedIndex: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
51
|
+
};
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { RefObject } from "react";
|
|
2
|
+
declare function useEventListener<K extends keyof MediaQueryListEventMap>(eventName: K, handler: (event: MediaQueryListEventMap[K]) => void, element: RefObject<MediaQueryList>, options?: boolean | AddEventListenerOptions): void;
|
|
3
|
+
declare function useEventListener<K extends keyof WindowEventMap>(eventName: K, handler: (event: WindowEventMap[K]) => void, element?: undefined, options?: boolean | AddEventListenerOptions): void;
|
|
4
|
+
declare function useEventListener<K extends keyof HTMLElementEventMap & keyof SVGElementEventMap, T extends Element = K extends keyof HTMLElementEventMap ? HTMLDivElement : SVGElement>(eventName: K, handler: ((event: HTMLElementEventMap[K]) => void) | ((event: SVGElementEventMap[K]) => void), element: RefObject<T>, options?: boolean | AddEventListenerOptions): void;
|
|
5
|
+
declare function useEventListener<K extends keyof DocumentEventMap>(eventName: K, handler: (event: DocumentEventMap[K]) => void, element: RefObject<Document>, options?: boolean | AddEventListenerOptions): void;
|
|
6
|
+
export { useEventListener };
|
|
7
|
+
/** Supported event types. */
|
|
8
|
+
type EventType = "mousedown" | "mouseup" | "touchstart" | "touchend" | "focusin" | "focusout";
|
|
9
|
+
/**
|
|
10
|
+
* Custom hook that handles clicks outside a specified element.
|
|
11
|
+
* @template T - The type of the element's reference.
|
|
12
|
+
* @param {RefObject<T> | RefObject<T>[]} ref - The React ref object(s) representing the element(s) to watch for outside clicks.
|
|
13
|
+
* @param {(event: MouseEvent | TouchEvent | FocusEvent) => void} handler - The callback function to be executed when a click outside the element occurs.
|
|
14
|
+
* @param {EventType} [eventType] - The mouse event type to listen for (optional, default is 'mousedown').
|
|
15
|
+
* @param {?AddEventListenerOptions} [eventListenerOptions] - The options object to be passed to the `addEventListener` method (optional).
|
|
16
|
+
* @returns {void}
|
|
17
|
+
*/
|
|
18
|
+
export declare function useOnClickOutside<T extends HTMLElement | null = HTMLElement>(ref: RefObject<T> | RefObject<T>[], handler: (event: MouseEvent | TouchEvent | FocusEvent) => void, eventType?: EventType, eventListenerOptions?: AddEventListenerOptions): void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface ThrottleSettings {
|
|
2
|
+
leading?: boolean | undefined;
|
|
3
|
+
trailing?: boolean | undefined;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* A hook that returns a throttled callback function.
|
|
7
|
+
*
|
|
8
|
+
* @param fn The function to throttle
|
|
9
|
+
* @param wait The time in ms to wait before calling the function
|
|
10
|
+
* @param dependencies The dependencies to watch for changes
|
|
11
|
+
* @param options The throttle options
|
|
12
|
+
*/
|
|
13
|
+
export declare function useThrottledCallback<T extends (...args: any[]) => any>(fn: T, wait?: number, dependencies?: React.DependencyList, options?: ThrottleSettings): {
|
|
14
|
+
(this: ThisParameterType<T>, ...args: Parameters<T>): ReturnType<T>;
|
|
15
|
+
cancel: () => void;
|
|
16
|
+
flush: () => void;
|
|
17
|
+
};
|
|
18
|
+
export default useThrottledCallback;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface WindowSizeState {
|
|
2
|
+
/**
|
|
3
|
+
* The width of the window's visual viewport in pixels.
|
|
4
|
+
*/
|
|
5
|
+
width: number;
|
|
6
|
+
/**
|
|
7
|
+
* The height of the window's visual viewport in pixels.
|
|
8
|
+
*/
|
|
9
|
+
height: number;
|
|
10
|
+
/**
|
|
11
|
+
* The distance from the top of the visual viewport to the top of the layout viewport.
|
|
12
|
+
* Particularly useful for handling mobile keyboard appearance.
|
|
13
|
+
*/
|
|
14
|
+
offsetTop: number;
|
|
15
|
+
/**
|
|
16
|
+
* The distance from the left of the visual viewport to the left of the layout viewport.
|
|
17
|
+
*/
|
|
18
|
+
offsetLeft: number;
|
|
19
|
+
/**
|
|
20
|
+
* The scale factor of the visual viewport.
|
|
21
|
+
* This is useful for scaling elements based on the current zoom level.
|
|
22
|
+
*/
|
|
23
|
+
scale: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Hook that tracks the window's visual viewport dimensions, position, and provides
|
|
27
|
+
* a CSS transform for positioning elements.
|
|
28
|
+
*
|
|
29
|
+
* Uses the Visual Viewport API to get accurate measurements, especially important
|
|
30
|
+
* for mobile devices where virtual keyboards can change the visible area.
|
|
31
|
+
* Only updates state when values actually change to optimize performance.
|
|
32
|
+
*
|
|
33
|
+
* @returns An object containing viewport properties and a CSS transform string
|
|
34
|
+
*/
|
|
35
|
+
export declare function useWindowSize(): WindowSizeState;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "./style.css";
|
|
2
|
+
export { OmniboxEditor, } from "./components/tiptap-templates/omnibox/omnibox-editor";
|
|
3
|
+
export { contentToMarkdown, contentToTiptapJson, htmlTableToTiptapNode, markdownWithHtmlTablesToTiptapJson, markdownToTiptapJson, tiptapJsonToMarkdown, } from "./lib/markdown";
|
|
4
|
+
export { getEditorTranslations } from "./lib/i18n";
|
|
5
|
+
export type { OmniboxEditorAiAction, OmniboxEditorCollaborationConfig, OmniboxEditorCollaborationProvider, OmniboxEditorCollaborationUser, OmniboxEditorMentionUser, EditorProviderProps, OmniboxEditorAiConfig, OmniboxEditorAiFeature, OmniboxEditorAiSubmitPayload, OmniboxEditorTheme, OmniboxEditorProps, OmniboxEditorUpdatePayload, UploadFunction, } from "./types";
|
|
6
|
+
export type { MarkdownParseOptions, TiptapJsonContent, } from "./lib/markdown";
|
|
7
|
+
export type { OmniboxEditorLocale, OmniboxEditorTranslations, } from "./lib/i18n";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { JSONContent } from "@tiptap/core";
|
|
2
|
+
import type { Slice } from "@tiptap/pm/model";
|
|
3
|
+
export type TiptapClipboardJsonContent = JSONContent;
|
|
4
|
+
export declare function tiptapJsonToClipboardText(json: TiptapClipboardJsonContent): string;
|
|
5
|
+
export declare function clipboardSliceToTiptapJson(slice: Slice): TiptapClipboardJsonContent;
|
|
6
|
+
export declare function clipboardSliceToText(slice: Slice): string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { OmniboxEditorCollaborationConfig, OmniboxEditorCollaborationUser } from "@/types";
|
|
2
|
+
export type CollaborationUser = OmniboxEditorCollaborationUser;
|
|
3
|
+
export declare function isCollaborationEnabled(collaboration?: OmniboxEditorCollaborationConfig): boolean;
|
|
4
|
+
export declare function shouldSyncExternalContent(collaboration?: OmniboxEditorCollaborationConfig): boolean;
|
|
5
|
+
export declare function getStarterKitUndoRedo(collaboration?: OmniboxEditorCollaborationConfig): false | undefined;
|
|
6
|
+
export declare function getCollaborationUser(collaboration: OmniboxEditorCollaborationConfig, fallbackUser?: OmniboxEditorCollaborationUser): CollaborationUser;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Content, JSONContent } from "@tiptap/core";
|
|
2
|
+
import { type MarkdownParseOptions, type TiptapJsonContent } from "./markdown";
|
|
3
|
+
export type ExternalEditorContent = Content | string;
|
|
4
|
+
export declare function normalizeEditorContent(content: ExternalEditorContent, options?: MarkdownParseOptions): TiptapJsonContent;
|
|
5
|
+
export declare function getExternalContentUpdate(previousContent: TiptapJsonContent | null, nextContent: ExternalEditorContent, options?: MarkdownParseOptions): JSONContent | null;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { OmniboxEditorCollaborationUser, OmniboxEditorMentionUser } from "@/types";
|
|
2
|
+
export type EditorUser = {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
color: string;
|
|
6
|
+
avatar: string;
|
|
7
|
+
position?: string;
|
|
8
|
+
};
|
|
9
|
+
type StorageLike = Pick<Storage, "getItem" | "setItem">;
|
|
10
|
+
export declare const FIRST_NAMES: string[];
|
|
11
|
+
export declare const LAST_NAMES: string[];
|
|
12
|
+
export declare const USER_COLORS: string[];
|
|
13
|
+
export declare function getOrCreateEditorUser(storage?: StorageLike | null): EditorUser;
|
|
14
|
+
export declare function toEditorUser(user?: OmniboxEditorCollaborationUser | OmniboxEditorMentionUser | null): EditorUser | null;
|
|
15
|
+
export declare function toEditorUsers(users?: Array<OmniboxEditorCollaborationUser | OmniboxEditorMentionUser | null | undefined>): EditorUser[];
|
|
16
|
+
type AwarenessUser = {
|
|
17
|
+
clientId?: number;
|
|
18
|
+
id?: unknown;
|
|
19
|
+
name?: unknown;
|
|
20
|
+
color?: unknown;
|
|
21
|
+
avatar?: unknown;
|
|
22
|
+
position?: unknown;
|
|
23
|
+
};
|
|
24
|
+
export declare function awarenessUserToEditorUser(user: AwarenessUser): EditorUser | null;
|
|
25
|
+
export declare function dedupeEditorUsers(users: EditorUser[]): EditorUser[];
|
|
26
|
+
export declare function getMentionUsers(query: string, users: EditorUser[], limit?: number): EditorUser[];
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { TiptapJsonContent } from "./markdown";
|
|
2
|
+
export declare function htmlTableToTiptapNode(tableHtml: string): TiptapJsonContent | null;
|
|
3
|
+
export declare function containsMergedTable(node: TiptapJsonContent): boolean;
|
|
4
|
+
export declare function isMergedTable(node: TiptapJsonContent): boolean;
|
|
5
|
+
export declare function tableToHtml(table: TiptapJsonContent, serializeBlockNode: (node: TiptapJsonContent) => string): string;
|