@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.
Files changed (359) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +526 -0
  3. package/dist/components/tiptap-extension/ai-generation-widget-extension.d.ts +41 -0
  4. package/dist/components/tiptap-extension/indent-extension.d.ts +90 -0
  5. package/dist/components/tiptap-extension/list-normalization-extension.d.ts +30 -0
  6. package/dist/components/tiptap-extension/node-alignment-extension.d.ts +38 -0
  7. package/dist/components/tiptap-extension/node-background-extension.d.ts +23 -0
  8. package/dist/components/tiptap-extension/triple-click-block-selection-extension.d.ts +13 -0
  9. package/dist/components/tiptap-extension/ui-state-extension.d.ts +22 -0
  10. package/dist/components/tiptap-icons/add-col-left-icon.d.ts +3 -0
  11. package/dist/components/tiptap-icons/add-col-right-icon.d.ts +3 -0
  12. package/dist/components/tiptap-icons/add-row-bottom-icon.d.ts +3 -0
  13. package/dist/components/tiptap-icons/add-row-top-icon.d.ts +3 -0
  14. package/dist/components/tiptap-icons/ai-sparkles-icon.d.ts +3 -0
  15. package/dist/components/tiptap-icons/align-bottom-icon.d.ts +3 -0
  16. package/dist/components/tiptap-icons/align-center-icon.d.ts +3 -0
  17. package/dist/components/tiptap-icons/align-center-vertical-icon.d.ts +3 -0
  18. package/dist/components/tiptap-icons/align-end-vertical-icon.d.ts +3 -0
  19. package/dist/components/tiptap-icons/align-justify-icon.d.ts +3 -0
  20. package/dist/components/tiptap-icons/align-left-icon.d.ts +3 -0
  21. package/dist/components/tiptap-icons/align-middle-icon.d.ts +3 -0
  22. package/dist/components/tiptap-icons/align-right-icon.d.ts +3 -0
  23. package/dist/components/tiptap-icons/align-start-vertical-icon.d.ts +3 -0
  24. package/dist/components/tiptap-icons/align-top-icon.d.ts +3 -0
  25. package/dist/components/tiptap-icons/alignment-icon.d.ts +3 -0
  26. package/dist/components/tiptap-icons/arrow-down-a-z-icon.d.ts +3 -0
  27. package/dist/components/tiptap-icons/arrow-down-icon.d.ts +3 -0
  28. package/dist/components/tiptap-icons/arrow-down-to-line-icon.d.ts +3 -0
  29. package/dist/components/tiptap-icons/arrow-down-z-a-icon.d.ts +3 -0
  30. package/dist/components/tiptap-icons/arrow-left-icon.d.ts +3 -0
  31. package/dist/components/tiptap-icons/arrow-right-icon.d.ts +3 -0
  32. package/dist/components/tiptap-icons/arrow-up-icon.d.ts +3 -0
  33. package/dist/components/tiptap-icons/at-sign-icon.d.ts +3 -0
  34. package/dist/components/tiptap-icons/ban-icon.d.ts +3 -0
  35. package/dist/components/tiptap-icons/blockquote-icon.d.ts +3 -0
  36. package/dist/components/tiptap-icons/bold-icon.d.ts +3 -0
  37. package/dist/components/tiptap-icons/check-ai-icon.d.ts +3 -0
  38. package/dist/components/tiptap-icons/check-icon.d.ts +3 -0
  39. package/dist/components/tiptap-icons/chevron-down-icon.d.ts +3 -0
  40. package/dist/components/tiptap-icons/chevron-right-icon.d.ts +3 -0
  41. package/dist/components/tiptap-icons/clipboard-icon.d.ts +3 -0
  42. package/dist/components/tiptap-icons/close-icon.d.ts +3 -0
  43. package/dist/components/tiptap-icons/code-block-icon.d.ts +3 -0
  44. package/dist/components/tiptap-icons/code2-icon.d.ts +3 -0
  45. package/dist/components/tiptap-icons/copy-icon.d.ts +3 -0
  46. package/dist/components/tiptap-icons/corner-down-left-icon.d.ts +3 -0
  47. package/dist/components/tiptap-icons/external-link-icon.d.ts +3 -0
  48. package/dist/components/tiptap-icons/grip-4-icon.d.ts +3 -0
  49. package/dist/components/tiptap-icons/grip-vertical-icon.d.ts +3 -0
  50. package/dist/components/tiptap-icons/heading-five-icon.d.ts +3 -0
  51. package/dist/components/tiptap-icons/heading-four-icon.d.ts +3 -0
  52. package/dist/components/tiptap-icons/heading-one-icon.d.ts +3 -0
  53. package/dist/components/tiptap-icons/heading-six-icon.d.ts +3 -0
  54. package/dist/components/tiptap-icons/heading-three-icon.d.ts +3 -0
  55. package/dist/components/tiptap-icons/heading-two-icon.d.ts +3 -0
  56. package/dist/components/tiptap-icons/highlighter-icon.d.ts +3 -0
  57. package/dist/components/tiptap-icons/image-caption-icon.d.ts +3 -0
  58. package/dist/components/tiptap-icons/image-icon.d.ts +3 -0
  59. package/dist/components/tiptap-icons/image-plus-icon.d.ts +3 -0
  60. package/dist/components/tiptap-icons/indent-decrease-icon.d.ts +3 -0
  61. package/dist/components/tiptap-icons/indent-increase-icon.d.ts +3 -0
  62. package/dist/components/tiptap-icons/italic-icon.d.ts +3 -0
  63. package/dist/components/tiptap-icons/link-icon.d.ts +3 -0
  64. package/dist/components/tiptap-icons/list-icon.d.ts +3 -0
  65. package/dist/components/tiptap-icons/list-indented-icon.d.ts +3 -0
  66. package/dist/components/tiptap-icons/list-ordered-icon.d.ts +3 -0
  67. package/dist/components/tiptap-icons/list-todo-icon.d.ts +3 -0
  68. package/dist/components/tiptap-icons/mic-ai-icon.d.ts +3 -0
  69. package/dist/components/tiptap-icons/minus-icon.d.ts +3 -0
  70. package/dist/components/tiptap-icons/moon-star-icon.d.ts +3 -0
  71. package/dist/components/tiptap-icons/more-vertical-icon.d.ts +3 -0
  72. package/dist/components/tiptap-icons/move-horizontal-icon.d.ts +3 -0
  73. package/dist/components/tiptap-icons/paint-bucket-icon.d.ts +3 -0
  74. package/dist/components/tiptap-icons/plus-icon.d.ts +3 -0
  75. package/dist/components/tiptap-icons/plus-small-icon.d.ts +3 -0
  76. package/dist/components/tiptap-icons/redo2-icon.d.ts +3 -0
  77. package/dist/components/tiptap-icons/refresh-ai-icon.d.ts +3 -0
  78. package/dist/components/tiptap-icons/refresh-ccw-icon.d.ts +3 -0
  79. package/dist/components/tiptap-icons/repeat-2-icon.d.ts +3 -0
  80. package/dist/components/tiptap-icons/rotate-ccw-icon.d.ts +3 -0
  81. package/dist/components/tiptap-icons/smile-plus-icon.d.ts +3 -0
  82. package/dist/components/tiptap-icons/square-x-icon.d.ts +3 -0
  83. package/dist/components/tiptap-icons/stop-circle-2-icon.d.ts +3 -0
  84. package/dist/components/tiptap-icons/strike-icon.d.ts +3 -0
  85. package/dist/components/tiptap-icons/subscript-icon.d.ts +3 -0
  86. package/dist/components/tiptap-icons/sun-icon.d.ts +3 -0
  87. package/dist/components/tiptap-icons/superscript-icon.d.ts +3 -0
  88. package/dist/components/tiptap-icons/table-cell-merge-icon.d.ts +3 -0
  89. package/dist/components/tiptap-icons/table-cell-split-icon.d.ts +3 -0
  90. package/dist/components/tiptap-icons/table-header-column-icon.d.ts +3 -0
  91. package/dist/components/tiptap-icons/table-header-row-icon.d.ts +3 -0
  92. package/dist/components/tiptap-icons/table-icon.d.ts +3 -0
  93. package/dist/components/tiptap-icons/text-color-small-icon.d.ts +3 -0
  94. package/dist/components/tiptap-icons/trash-icon.d.ts +3 -0
  95. package/dist/components/tiptap-icons/type-icon.d.ts +3 -0
  96. package/dist/components/tiptap-icons/underline-icon.d.ts +3 -0
  97. package/dist/components/tiptap-icons/undo2-icon.d.ts +3 -0
  98. package/dist/components/tiptap-icons/x-icon.d.ts +3 -0
  99. package/dist/components/tiptap-node/code-block-node/code-block-node-extension.d.ts +6 -0
  100. package/dist/components/tiptap-node/code-block-node/code-block-node-view.d.ts +2 -0
  101. package/dist/components/tiptap-node/code-block-node/diagram-render.d.ts +7 -0
  102. package/dist/components/tiptap-node/horizontal-rule-node/horizontal-rule-node-extension.d.ts +2 -0
  103. package/dist/components/tiptap-node/image-node/image-load-state.d.ts +9 -0
  104. package/dist/components/tiptap-node/image-node/image-node-extension.d.ts +7 -0
  105. package/dist/components/tiptap-node/image-node/image-node-floating.d.ts +4 -0
  106. package/dist/components/tiptap-node/image-node/image-node-view.d.ts +26 -0
  107. package/dist/components/tiptap-node/image-upload-node/image-upload-node-extension.d.ts +57 -0
  108. package/dist/components/tiptap-node/image-upload-node/image-upload-node.d.ts +69 -0
  109. package/dist/components/tiptap-node/table-node/extensions/table-handle/helpers/create-image.d.ts +9 -0
  110. package/dist/components/tiptap-node/table-node/extensions/table-handle/index.d.ts +2 -0
  111. package/dist/components/tiptap-node/table-node/extensions/table-handle/table-handle-plugin.d.ts +43 -0
  112. package/dist/components/tiptap-node/table-node/extensions/table-handle/table-handle.d.ts +14 -0
  113. package/dist/components/tiptap-node/table-node/extensions/table-node-extension.d.ts +32 -0
  114. package/dist/components/tiptap-node/table-node/hooks/use-table-handle-state.d.ts +22 -0
  115. package/dist/components/tiptap-node/table-node/lib/tiptap-table-utils.d.ts +395 -0
  116. package/dist/components/tiptap-node/table-node/ui/table-add-row-column-button/index.d.ts +2 -0
  117. package/dist/components/tiptap-node/table-node/ui/table-add-row-column-button/table-add-row-column-button.d.ts +14 -0
  118. package/dist/components/tiptap-node/table-node/ui/table-add-row-column-button/use-table-add-row-column.d.ts +53 -0
  119. package/dist/components/tiptap-node/table-node/ui/table-align-cell-button/index.d.ts +2 -0
  120. package/dist/components/tiptap-node/table-node/ui/table-align-cell-button/table-align-cell-button.d.ts +41 -0
  121. package/dist/components/tiptap-node/table-node/ui/table-align-cell-button/use-table-align-cell.d.ts +145 -0
  122. package/dist/components/tiptap-node/table-node/ui/table-alignment-menu/index.d.ts +1 -0
  123. package/dist/components/tiptap-node/table-node/ui/table-alignment-menu/table-alignment-menu.d.ts +16 -0
  124. package/dist/components/tiptap-node/table-node/ui/table-cell-handle-menu/index.d.ts +1 -0
  125. package/dist/components/tiptap-node/table-node/ui/table-cell-handle-menu/table-cell-handle-menu.d.ts +18 -0
  126. package/dist/components/tiptap-node/table-node/ui/table-clear-row-column-content-button/index.d.ts +2 -0
  127. package/dist/components/tiptap-node/table-node/ui/table-clear-row-column-content-button/table-clear-row-column-content-button.d.ts +14 -0
  128. package/dist/components/tiptap-node/table-node/ui/table-clear-row-column-content-button/use-table-clear-row-column-content.d.ts +96 -0
  129. package/dist/components/tiptap-node/table-node/ui/table-context-menu/index.d.ts +1 -0
  130. package/dist/components/tiptap-node/table-node/ui/table-context-menu/table-context-menu-utils.d.ts +20 -0
  131. package/dist/components/tiptap-node/table-node/ui/table-context-menu/table-context-menu.d.ts +7 -0
  132. package/dist/components/tiptap-node/table-node/ui/table-delete-row-column-button/index.d.ts +2 -0
  133. package/dist/components/tiptap-node/table-node/ui/table-delete-row-column-button/table-delete-row-column-button.d.ts +14 -0
  134. package/dist/components/tiptap-node/table-node/ui/table-delete-row-column-button/use-table-delete-row-column.d.ts +80 -0
  135. package/dist/components/tiptap-node/table-node/ui/table-duplicate-row-column-button/index.d.ts +2 -0
  136. package/dist/components/tiptap-node/table-node/ui/table-duplicate-row-column-button/table-duplicate-row-column-button.d.ts +6 -0
  137. package/dist/components/tiptap-node/table-node/ui/table-duplicate-row-column-button/use-table-duplicate-row-column.d.ts +42 -0
  138. package/dist/components/tiptap-node/table-node/ui/table-extend-row-column-button/index.d.ts +2 -0
  139. package/dist/components/tiptap-node/table-node/ui/table-extend-row-column-button/table-extend-row-column-button.d.ts +23 -0
  140. package/dist/components/tiptap-node/table-node/ui/table-extend-row-column-button/use-table-extend-row-column.d.ts +14 -0
  141. package/dist/components/tiptap-node/table-node/ui/table-fit-to-width-button/index.d.ts +2 -0
  142. package/dist/components/tiptap-node/table-node/ui/table-fit-to-width-button/table-fit-to-width-button.d.ts +21 -0
  143. package/dist/components/tiptap-node/table-node/ui/table-fit-to-width-button/use-table-fit-to-width.d.ts +67 -0
  144. package/dist/components/tiptap-node/table-node/ui/table-handle/table-handle.d.ts +50 -0
  145. package/dist/components/tiptap-node/table-node/ui/table-handle/use-table-handle-positioning.d.ts +41 -0
  146. package/dist/components/tiptap-node/table-node/ui/table-handle-menu/index.d.ts +1 -0
  147. package/dist/components/tiptap-node/table-node/ui/table-handle-menu/table-handle-menu.d.ts +25 -0
  148. package/dist/components/tiptap-node/table-node/ui/table-header-row-column-button/index.d.ts +2 -0
  149. package/dist/components/tiptap-node/table-node/ui/table-header-row-column-button/table-header-row-column-button.d.ts +15 -0
  150. package/dist/components/tiptap-node/table-node/ui/table-header-row-column-button/use-table-header-row-column.d.ts +51 -0
  151. package/dist/components/tiptap-node/table-node/ui/table-merge-split-cell-button/index.d.ts +2 -0
  152. package/dist/components/tiptap-node/table-node/ui/table-merge-split-cell-button/table-merge-split-cell-button.d.ts +43 -0
  153. package/dist/components/tiptap-node/table-node/ui/table-merge-split-cell-button/use-table-merge-split-cell.d.ts +119 -0
  154. package/dist/components/tiptap-node/table-node/ui/table-move-row-column-button/index.d.ts +2 -0
  155. package/dist/components/tiptap-node/table-node/ui/table-move-row-column-button/table-move-row-column-button.d.ts +37 -0
  156. package/dist/components/tiptap-node/table-node/ui/table-move-row-column-button/use-table-move-row-column.d.ts +94 -0
  157. package/dist/components/tiptap-node/table-node/ui/table-selection-overlay/index.d.ts +1 -0
  158. package/dist/components/tiptap-node/table-node/ui/table-selection-overlay/table-selection-overlay.d.ts +15 -0
  159. package/dist/components/tiptap-node/table-node/ui/table-selection-overlay/use-resize-overlay.d.ts +2 -0
  160. package/dist/components/tiptap-node/table-node/ui/table-sort-row-column-button/index.d.ts +2 -0
  161. package/dist/components/tiptap-node/table-node/ui/table-sort-row-column-button/table-sort-row-column-button.d.ts +14 -0
  162. package/dist/components/tiptap-node/table-node/ui/table-sort-row-column-button/use-table-sort-row-column.d.ts +111 -0
  163. package/dist/components/tiptap-node/toc-node/context/toc-context.d.ts +44 -0
  164. package/dist/components/tiptap-node/toc-node/extensions/toc-node-extension.d.ts +45 -0
  165. package/dist/components/tiptap-node/toc-node/index.d.ts +3 -0
  166. package/dist/components/tiptap-node/toc-node/toc-node.d.ts +4 -0
  167. package/dist/components/tiptap-node/toc-node/ui/toc-show-title-button/index.d.ts +2 -0
  168. package/dist/components/tiptap-node/toc-node/ui/toc-show-title-button/toc-show-title-button.d.ts +16 -0
  169. package/dist/components/tiptap-node/toc-node/ui/toc-show-title-button/toc-show-title.d.ts +83 -0
  170. package/dist/components/tiptap-node/toc-node/ui/toc-sidebar/index.d.ts +1 -0
  171. package/dist/components/tiptap-node/toc-node/ui/toc-sidebar/toc-sidebar.d.ts +14 -0
  172. package/dist/components/tiptap-templates/omnibox/omnibox-editor-header.d.ts +1 -0
  173. package/dist/components/tiptap-templates/omnibox/omnibox-editor-mobile-toolbar.d.ts +14 -0
  174. package/dist/components/tiptap-templates/omnibox/omnibox-editor-theme-toggle.d.ts +1 -0
  175. package/dist/components/tiptap-templates/omnibox/omnibox-editor-toolbar-floating.d.ts +15 -0
  176. package/dist/components/tiptap-templates/omnibox/omnibox-editor.d.ts +32 -0
  177. package/dist/components/tiptap-ui/ai-composer/ai-composer.d.ts +21 -0
  178. package/dist/components/tiptap-ui/ai-composer/ai-generation-state.d.ts +6 -0
  179. package/dist/components/tiptap-ui/ai-composer/ai-markdown-preview.d.ts +4 -0
  180. package/dist/components/tiptap-ui/ai-composer/ai-review-controls.d.ts +13 -0
  181. package/dist/components/tiptap-ui/ai-composer/ai-writing-indicator.d.ts +10 -0
  182. package/dist/components/tiptap-ui/ai-composer/index.d.ts +3 -0
  183. package/dist/components/tiptap-ui/blockquote-button/blockquote-button.d.ts +22 -0
  184. package/dist/components/tiptap-ui/blockquote-button/index.d.ts +2 -0
  185. package/dist/components/tiptap-ui/blockquote-button/use-blockquote.d.ts +80 -0
  186. package/dist/components/tiptap-ui/code-block-button/code-block-button.d.ts +22 -0
  187. package/dist/components/tiptap-ui/code-block-button/index.d.ts +2 -0
  188. package/dist/components/tiptap-ui/code-block-button/use-code-block.d.ts +87 -0
  189. package/dist/components/tiptap-ui/color-highlight-button/color-highlight-button.d.ts +46 -0
  190. package/dist/components/tiptap-ui/color-highlight-button/index.d.ts +2 -0
  191. package/dist/components/tiptap-ui/color-highlight-button/use-color-highlight.d.ts +93 -0
  192. package/dist/components/tiptap-ui/color-highlight-popover/color-highlight-popover.d.ts +35 -0
  193. package/dist/components/tiptap-ui/color-highlight-popover/index.d.ts +1 -0
  194. package/dist/components/tiptap-ui/color-menu/color-menu-utils.d.ts +8 -0
  195. package/dist/components/tiptap-ui/color-menu/color-menu.d.ts +43 -0
  196. package/dist/components/tiptap-ui/color-menu/index.d.ts +1 -0
  197. package/dist/components/tiptap-ui/color-text-button/color-text-button.d.ts +23 -0
  198. package/dist/components/tiptap-ui/color-text-button/index.d.ts +2 -0
  199. package/dist/components/tiptap-ui/color-text-button/use-color-text.d.ts +109 -0
  200. package/dist/components/tiptap-ui/color-text-popover/color-text-popover.d.ts +46 -0
  201. package/dist/components/tiptap-ui/color-text-popover/index.d.ts +2 -0
  202. package/dist/components/tiptap-ui/color-text-popover/use-color-text-popover.d.ts +132 -0
  203. package/dist/components/tiptap-ui/copy-anchor-link-button/copy-anchor-link-button.d.ts +22 -0
  204. package/dist/components/tiptap-ui/copy-anchor-link-button/index.d.ts +3 -0
  205. package/dist/components/tiptap-ui/copy-anchor-link-button/use-copy-anchor-link.d.ts +93 -0
  206. package/dist/components/tiptap-ui/copy-anchor-link-button/use-scroll-to-hash.d.ts +27 -0
  207. package/dist/components/tiptap-ui/copy-to-clipboard-button/copy-to-clipboard-button.d.ts +22 -0
  208. package/dist/components/tiptap-ui/copy-to-clipboard-button/index.d.ts +2 -0
  209. package/dist/components/tiptap-ui/copy-to-clipboard-button/use-copy-to-clipboard.d.ts +103 -0
  210. package/dist/components/tiptap-ui/delete-node-button/delete-node-button.d.ts +22 -0
  211. package/dist/components/tiptap-ui/delete-node-button/index.d.ts +2 -0
  212. package/dist/components/tiptap-ui/delete-node-button/use-delete-node.d.ts +82 -0
  213. package/dist/components/tiptap-ui/drag-context-menu/drag-context-menu-types.d.ts +30 -0
  214. package/dist/components/tiptap-ui/drag-context-menu/drag-context-menu.d.ts +3 -0
  215. package/dist/components/tiptap-ui/drag-context-menu/index.d.ts +2 -0
  216. package/dist/components/tiptap-ui/duplicate-button/duplicate-button.d.ts +22 -0
  217. package/dist/components/tiptap-ui/duplicate-button/index.d.ts +2 -0
  218. package/dist/components/tiptap-ui/duplicate-button/use-duplicate.d.ts +78 -0
  219. package/dist/components/tiptap-ui/emoji-dropdown-menu/emoji-dropdown-menu.d.ts +3 -0
  220. package/dist/components/tiptap-ui/emoji-dropdown-menu/index.d.ts +1 -0
  221. package/dist/components/tiptap-ui/emoji-menu/emoji-menu-utils.d.ts +6 -0
  222. package/dist/components/tiptap-ui/emoji-menu/emoji-menu.d.ts +18 -0
  223. package/dist/components/tiptap-ui/emoji-menu/index.d.ts +2 -0
  224. package/dist/components/tiptap-ui/emoji-trigger-button/emoji-trigger-button.d.ts +22 -0
  225. package/dist/components/tiptap-ui/emoji-trigger-button/index.d.ts +2 -0
  226. package/dist/components/tiptap-ui/emoji-trigger-button/use-emoji-trigger.d.ts +94 -0
  227. package/dist/components/tiptap-ui/heading-button/heading-button.d.ts +23 -0
  228. package/dist/components/tiptap-ui/heading-button/index.d.ts +2 -0
  229. package/dist/components/tiptap-ui/heading-button/use-heading.d.ts +108 -0
  230. package/dist/components/tiptap-ui/image-align-button/image-align-button.d.ts +23 -0
  231. package/dist/components/tiptap-ui/image-align-button/index.d.ts +2 -0
  232. package/dist/components/tiptap-ui/image-align-button/use-image-align.d.ts +110 -0
  233. package/dist/components/tiptap-ui/image-caption-button/image-caption-button.d.ts +16 -0
  234. package/dist/components/tiptap-ui/image-caption-button/index.d.ts +2 -0
  235. package/dist/components/tiptap-ui/image-caption-button/use-image-caption.d.ts +82 -0
  236. package/dist/components/tiptap-ui/image-download-button/image-download-button.d.ts +23 -0
  237. package/dist/components/tiptap-ui/image-download-button/index.d.ts +2 -0
  238. package/dist/components/tiptap-ui/image-download-button/use-image-download.d.ts +64 -0
  239. package/dist/components/tiptap-ui/image-upload-button/image-upload-button.d.ts +29 -0
  240. package/dist/components/tiptap-ui/image-upload-button/index.d.ts +2 -0
  241. package/dist/components/tiptap-ui/image-upload-button/use-image-upload.d.ts +84 -0
  242. package/dist/components/tiptap-ui/indent-button/indent-button.d.ts +30 -0
  243. package/dist/components/tiptap-ui/indent-button/index.d.ts +2 -0
  244. package/dist/components/tiptap-ui/indent-button/use-indent.d.ts +92 -0
  245. package/dist/components/tiptap-ui/link-popover/index.d.ts +2 -0
  246. package/dist/components/tiptap-ui/link-popover/link-popover.d.ts +58 -0
  247. package/dist/components/tiptap-ui/link-popover/use-link-popover.d.ts +117 -0
  248. package/dist/components/tiptap-ui/list-button/index.d.ts +2 -0
  249. package/dist/components/tiptap-ui/list-button/list-button.d.ts +23 -0
  250. package/dist/components/tiptap-ui/list-button/use-list.d.ts +97 -0
  251. package/dist/components/tiptap-ui/mark-button/index.d.ts +2 -0
  252. package/dist/components/tiptap-ui/mark-button/mark-button.d.ts +23 -0
  253. package/dist/components/tiptap-ui/mark-button/use-mark.d.ts +102 -0
  254. package/dist/components/tiptap-ui/math-editor/index.d.ts +1 -0
  255. package/dist/components/tiptap-ui/math-editor/math-editor.d.ts +10 -0
  256. package/dist/components/tiptap-ui/mention-dropdown-menu/index.d.ts +1 -0
  257. package/dist/components/tiptap-ui/mention-dropdown-menu/mention-dropdown-menu.d.ts +7 -0
  258. package/dist/components/tiptap-ui/mention-trigger-button/index.d.ts +2 -0
  259. package/dist/components/tiptap-ui/mention-trigger-button/mention-trigger-button.d.ts +22 -0
  260. package/dist/components/tiptap-ui/mention-trigger-button/use-mention-trigger.d.ts +96 -0
  261. package/dist/components/tiptap-ui/move-node-button/index.d.ts +2 -0
  262. package/dist/components/tiptap-ui/move-node-button/move-node-button.d.ts +20 -0
  263. package/dist/components/tiptap-ui/move-node-button/use-move-node.d.ts +52 -0
  264. package/dist/components/tiptap-ui/reset-all-formatting-button/index.d.ts +2 -0
  265. package/dist/components/tiptap-ui/reset-all-formatting-button/reset-all-formatting-button.d.ts +24 -0
  266. package/dist/components/tiptap-ui/reset-all-formatting-button/use-reset-all-formatting.d.ts +106 -0
  267. package/dist/components/tiptap-ui/slash-command-trigger-button/index.d.ts +2 -0
  268. package/dist/components/tiptap-ui/slash-command-trigger-button/slash-command-trigger-button.d.ts +22 -0
  269. package/dist/components/tiptap-ui/slash-command-trigger-button/use-slash-command-trigger.d.ts +96 -0
  270. package/dist/components/tiptap-ui/slash-dropdown-menu/index.d.ts +2 -0
  271. package/dist/components/tiptap-ui/slash-dropdown-menu/slash-dropdown-menu.d.ts +8 -0
  272. package/dist/components/tiptap-ui/slash-dropdown-menu/use-slash-dropdown-menu.d.ts +146 -0
  273. package/dist/components/tiptap-ui/text-align-button/index.d.ts +2 -0
  274. package/dist/components/tiptap-ui/text-align-button/text-align-button.d.ts +30 -0
  275. package/dist/components/tiptap-ui/text-align-button/use-text-align.d.ts +103 -0
  276. package/dist/components/tiptap-ui/text-button/index.d.ts +2 -0
  277. package/dist/components/tiptap-ui/text-button/text-button.d.ts +22 -0
  278. package/dist/components/tiptap-ui/text-button/use-text.d.ts +86 -0
  279. package/dist/components/tiptap-ui/turn-into-dropdown/index.d.ts +2 -0
  280. package/dist/components/tiptap-ui/turn-into-dropdown/turn-into-dropdown.d.ts +16 -0
  281. package/dist/components/tiptap-ui/turn-into-dropdown/use-turn-into-dropdown.d.ts +153 -0
  282. package/dist/components/tiptap-ui/undo-redo-button/index.d.ts +2 -0
  283. package/dist/components/tiptap-ui/undo-redo-button/undo-redo-button.d.ts +23 -0
  284. package/dist/components/tiptap-ui/undo-redo-button/use-undo-redo.d.ts +90 -0
  285. package/dist/components/tiptap-ui-primitive/avatar/avatar.d.ts +23 -0
  286. package/dist/components/tiptap-ui-primitive/avatar/index.d.ts +1 -0
  287. package/dist/components/tiptap-ui-primitive/badge/badge.d.ts +11 -0
  288. package/dist/components/tiptap-ui-primitive/badge/index.d.ts +1 -0
  289. package/dist/components/tiptap-ui-primitive/button/button.d.ts +16 -0
  290. package/dist/components/tiptap-ui-primitive/button/index.d.ts +1 -0
  291. package/dist/components/tiptap-ui-primitive/button-group/button-group.d.ts +10 -0
  292. package/dist/components/tiptap-ui-primitive/button-group/index.d.ts +1 -0
  293. package/dist/components/tiptap-ui-primitive/card/card.d.ts +10 -0
  294. package/dist/components/tiptap-ui-primitive/card/index.d.ts +1 -0
  295. package/dist/components/tiptap-ui-primitive/combobox/combobox.d.ts +21 -0
  296. package/dist/components/tiptap-ui-primitive/combobox/index.d.ts +1 -0
  297. package/dist/components/tiptap-ui-primitive/dropdown-menu/dropdown-menu.d.ts +29 -0
  298. package/dist/components/tiptap-ui-primitive/dropdown-menu/index.d.ts +1 -0
  299. package/dist/components/tiptap-ui-primitive/input/index.d.ts +1 -0
  300. package/dist/components/tiptap-ui-primitive/input/input.d.ts +3 -0
  301. package/dist/components/tiptap-ui-primitive/input-group/index.d.ts +1 -0
  302. package/dist/components/tiptap-ui-primitive/input-group/input-group.d.ts +19 -0
  303. package/dist/components/tiptap-ui-primitive/menu/index.d.ts +5 -0
  304. package/dist/components/tiptap-ui-primitive/menu/menu-context.d.ts +5 -0
  305. package/dist/components/tiptap-ui-primitive/menu/menu-hooks.d.ts +10 -0
  306. package/dist/components/tiptap-ui-primitive/menu/menu-types.d.ts +44 -0
  307. package/dist/components/tiptap-ui-primitive/menu/menu-utils.d.ts +15 -0
  308. package/dist/components/tiptap-ui-primitive/menu/menu.d.ts +20 -0
  309. package/dist/components/tiptap-ui-primitive/popover/index.d.ts +1 -0
  310. package/dist/components/tiptap-ui-primitive/popover/popover.d.ts +6 -0
  311. package/dist/components/tiptap-ui-primitive/separator/index.d.ts +1 -0
  312. package/dist/components/tiptap-ui-primitive/separator/separator.d.ts +5 -0
  313. package/dist/components/tiptap-ui-primitive/spacer/index.d.ts +1 -0
  314. package/dist/components/tiptap-ui-primitive/spacer/spacer.d.ts +5 -0
  315. package/dist/components/tiptap-ui-primitive/textarea/index.d.ts +1 -0
  316. package/dist/components/tiptap-ui-primitive/textarea/textarea.d.ts +3 -0
  317. package/dist/components/tiptap-ui-primitive/toolbar/index.d.ts +1 -0
  318. package/dist/components/tiptap-ui-primitive/toolbar/toolbar.d.ts +9 -0
  319. package/dist/components/tiptap-ui-primitive/tooltip/index.d.ts +1 -0
  320. package/dist/components/tiptap-ui-primitive/tooltip/tooltip.d.ts +29 -0
  321. package/dist/components/tiptap-ui-utils/floating-element/floating-element-utils.d.ts +3 -0
  322. package/dist/components/tiptap-ui-utils/floating-element/floating-element.d.ts +53 -0
  323. package/dist/components/tiptap-ui-utils/floating-element/index.d.ts +2 -0
  324. package/dist/components/tiptap-ui-utils/suggestion-menu/index.d.ts +3 -0
  325. package/dist/components/tiptap-ui-utils/suggestion-menu/suggestion-menu-types.d.ts +86 -0
  326. package/dist/components/tiptap-ui-utils/suggestion-menu/suggestion-menu-utils.d.ts +19 -0
  327. package/dist/components/tiptap-ui-utils/suggestion-menu/suggestion-menu.d.ts +6 -0
  328. package/dist/contexts/user-context.d.ts +16 -0
  329. package/dist/hooks/use-composed-ref.d.ts +3 -0
  330. package/dist/hooks/use-cursor-visibility.d.ts +20 -0
  331. package/dist/hooks/use-element-rect.d.ts +35 -0
  332. package/dist/hooks/use-floating-element.d.ts +36 -0
  333. package/dist/hooks/use-floating-toolbar-visibility.d.ts +29 -0
  334. package/dist/hooks/use-is-breakpoint.d.ts +9 -0
  335. package/dist/hooks/use-isomorphic-layout-effect.d.ts +7 -0
  336. package/dist/hooks/use-menu-navigation.d.ts +52 -0
  337. package/dist/hooks/use-on-click-outside.d.ts +18 -0
  338. package/dist/hooks/use-throttled-callback.d.ts +18 -0
  339. package/dist/hooks/use-tiptap-editor.d.ts +6 -0
  340. package/dist/hooks/use-ui-editor-state.d.ts +4 -0
  341. package/dist/hooks/use-unmount.d.ts +7 -0
  342. package/dist/hooks/use-window-size.d.ts +35 -0
  343. package/dist/index.d.ts +7 -0
  344. package/dist/lib/clipboard.d.ts +6 -0
  345. package/dist/lib/editor-collaboration.d.ts +6 -0
  346. package/dist/lib/editor-content.d.ts +5 -0
  347. package/dist/lib/editor-users.d.ts +27 -0
  348. package/dist/lib/html-table.d.ts +5 -0
  349. package/dist/lib/i18n.d.ts +170 -0
  350. package/dist/lib/markdown.d.ts +12 -0
  351. package/dist/lib/math-editor.d.ts +19 -0
  352. package/dist/lib/tiptap-advanced-utils.d.ts +120 -0
  353. package/dist/lib/tiptap-collab-utils.d.ts +47 -0
  354. package/dist/lib/tiptap-utils.d.ts +174 -0
  355. package/dist/omnibox-editor.css +1 -0
  356. package/dist/omnibox-editor.js +19816 -0
  357. package/dist/omnibox-editor.umd.cjs +15 -0
  358. package/dist/types.d.ts +77 -0
  359. package/package.json +114 -0
@@ -0,0 +1,170 @@
1
+ export type OmniboxEditorLocale = "en" | "zh-CN" | (string & {});
2
+ type OmniboxEditorTranslationMap = {
3
+ addCaption: string;
4
+ add: string;
5
+ ai: string;
6
+ aiIsWriting: string;
7
+ aiReviewPrompt: string;
8
+ aiTone: string;
9
+ apply: string;
10
+ askAi: string;
11
+ askAiPrompt: string;
12
+ askAiSubtext: string;
13
+ blockquote: string;
14
+ blockquoteBlock: string;
15
+ bulletList: string;
16
+ bold: string;
17
+ clearAllContents: string;
18
+ clickForOptions: string;
19
+ code: string;
20
+ codeBlock: string;
21
+ codeBlockWithSyntaxHighlighting: string;
22
+ color: string;
23
+ continueWriting: string;
24
+ continueWritingPrompt: string;
25
+ continueWritingSubtext: string;
26
+ copyAnchorLink: string;
27
+ copyToClipboard: string;
28
+ close: string;
29
+ delete: string;
30
+ discard: string;
31
+ duplicateNode: string;
32
+ applyFormula: string;
33
+ closeFormulaEditor: string;
34
+ editFormula: string;
35
+ emoji: string;
36
+ emojiSubtext: string;
37
+ failedToRenderChart: string;
38
+ failedToRenderDiagram: string;
39
+ heading: string;
40
+ heading1: string;
41
+ heading2: string;
42
+ heading3: string;
43
+ heading4: string;
44
+ heading5: string;
45
+ heading6: string;
46
+ highlightColor: string;
47
+ holdForDrag: string;
48
+ hideSource: string;
49
+ image: string;
50
+ imageSubtext: string;
51
+ addImage: string;
52
+ replaceImage: string;
53
+ increaseIndent: string;
54
+ insert: string;
55
+ italic: string;
56
+ linkEditor: string;
57
+ link: string;
58
+ listItem: string;
59
+ listWithOrderedItems: string;
60
+ listWithTasks: string;
61
+ listWithUnorderedItems: string;
62
+ loading: string;
63
+ mention: string;
64
+ mentionSubtext: string;
65
+ node: string;
66
+ orderedList: string;
67
+ placeholder: string;
68
+ pasteLink: string;
69
+ openLinkInNewWindow: string;
70
+ recentColors: string;
71
+ recentTextColor: string;
72
+ recentHighlightColor: string;
73
+ regularTextParagraph: string;
74
+ resetFormatting: string;
75
+ separator: string;
76
+ separatorSubtext: string;
77
+ showSource: string;
78
+ style: string;
79
+ subsectionAndGroupHeading: string;
80
+ table: string;
81
+ rowActions: string;
82
+ columnActions: string;
83
+ tableCellsOption: string;
84
+ insertRowAbove: string;
85
+ insertRowBelow: string;
86
+ deleteRow: string;
87
+ clearRowContents: string;
88
+ insertColumnLeft: string;
89
+ insertColumnRight: string;
90
+ duplicateRow: string;
91
+ duplicateColumn: string;
92
+ moveRowUp: string;
93
+ moveRowDown: string;
94
+ moveColumnLeft: string;
95
+ moveColumnRight: string;
96
+ sortRowAsc: string;
97
+ sortRowDesc: string;
98
+ sortColumnAsc: string;
99
+ sortColumnDesc: string;
100
+ deleteColumn: string;
101
+ clearColumnContents: string;
102
+ headerRow: string;
103
+ headerColumn: string;
104
+ mergeCells: string;
105
+ splitCell: string;
106
+ alignLeft: string;
107
+ alignCenter: string;
108
+ alignRight: string;
109
+ alignTop: string;
110
+ alignMiddle: string;
111
+ alignBottom: string;
112
+ alignment: string;
113
+ backgroundColor: string;
114
+ defaultTextColor: string;
115
+ grayTextColor: string;
116
+ brownTextColor: string;
117
+ orangeTextColor: string;
118
+ yellowTextColor: string;
119
+ greenTextColor: string;
120
+ blueTextColor: string;
121
+ purpleTextColor: string;
122
+ pinkTextColor: string;
123
+ redTextColor: string;
124
+ defaultBackgroundColor: string;
125
+ grayBackgroundColor: string;
126
+ brownBackgroundColor: string;
127
+ orangeBackgroundColor: string;
128
+ yellowBackgroundColor: string;
129
+ greenBackgroundColor: string;
130
+ blueBackgroundColor: string;
131
+ purpleBackgroundColor: string;
132
+ pinkBackgroundColor: string;
133
+ redBackgroundColor: string;
134
+ clearContents: string;
135
+ fitToWidth: string;
136
+ deleteTable: string;
137
+ tableOfContents: string;
138
+ tableOfContentsSubtext: string;
139
+ tableSubtext: string;
140
+ taskList: string;
141
+ text: string;
142
+ textColor: string;
143
+ textColorOptions: string;
144
+ textHighlighter: string;
145
+ highlightColors: string;
146
+ removeHighlight: string;
147
+ moreOptions: string;
148
+ removeLink: string;
149
+ strike: string;
150
+ underline: string;
151
+ alignJustify: string;
152
+ applyLink: string;
153
+ superscript: string;
154
+ subscript: string;
155
+ decreaseIndent: string;
156
+ submitAiPrompt: string;
157
+ stopAiGeneration: string;
158
+ topLevelHeading: string;
159
+ turnInto: string;
160
+ turnIntoCurrent: string;
161
+ tryAgain: string;
162
+ upload: string;
163
+ uploadFailed: string;
164
+ };
165
+ export type OmniboxEditorTranslations = Partial<OmniboxEditorTranslationMap>;
166
+ export declare function getEditorTranslations(locale?: OmniboxEditorLocale, translations?: OmniboxEditorTranslations): OmniboxEditorTranslationMap;
167
+ export type OmniboxEditorI18n = OmniboxEditorTranslationMap;
168
+ export declare const EditorI18nContext: import("react").Context<OmniboxEditorTranslationMap>;
169
+ export declare function useEditorI18n(): OmniboxEditorTranslationMap;
170
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { JSONContent } from "@tiptap/core";
2
+ export type TiptapJsonContent = JSONContent;
3
+ export interface MarkdownParseOptions {
4
+ debug?: boolean;
5
+ linkBase?: string;
6
+ }
7
+ export declare function markdownToTiptapJson(markdown: string, options?: MarkdownParseOptions): TiptapJsonContent;
8
+ export declare function markdownWithHtmlTablesToTiptapJson(markdown: string, options?: MarkdownParseOptions): TiptapJsonContent;
9
+ export declare function contentToTiptapJson(content: string | TiptapJsonContent, options?: MarkdownParseOptions): TiptapJsonContent;
10
+ export declare function tiptapJsonToMarkdown(json: TiptapJsonContent, options?: MarkdownParseOptions): string;
11
+ export declare function contentToMarkdown(content: string | TiptapJsonContent, options?: MarkdownParseOptions): string;
12
+ export { htmlTableToTiptapNode } from "./html-table";
@@ -0,0 +1,19 @@
1
+ export type MathNodeEditTarget = {
2
+ type: "blockMath" | "inlineMath";
3
+ pos: number;
4
+ latex: string;
5
+ };
6
+ type MathEditorCommands = {
7
+ commands: {
8
+ updateBlockMath: (options: {
9
+ latex: string;
10
+ pos: number;
11
+ }) => boolean;
12
+ updateInlineMath: (options: {
13
+ latex: string;
14
+ pos: number;
15
+ }) => boolean;
16
+ };
17
+ };
18
+ export declare function updateMathNodeLatex(editor: MathEditorCommands, target: MathNodeEditTarget, latex: string): boolean;
19
+ export {};
@@ -0,0 +1,120 @@
1
+ import type { Attrs, Node } from "@tiptap/pm/model";
2
+ import { type Editor } from "@tiptap/react";
3
+ /**
4
+ * Splits an array into chunks of specified size
5
+ */
6
+ export declare function chunkArray<T>(array: Array<T>, size: number): Array<Array<T>>;
7
+ /**
8
+ * Helper function to check if there's content above the current position
9
+ */
10
+ export declare function hasContentAbove(editor: Editor | null): {
11
+ hasContent: boolean;
12
+ content: string;
13
+ };
14
+ /**
15
+ * Gets the active attributes of a specific mark in the current editor selection.
16
+ *
17
+ * @param editor - The Tiptap editor instance.
18
+ * @param markName - The name of the mark to look for (e.g., "highlight", "link").
19
+ * @returns The attributes of the active mark, or `null` if the mark is not active.
20
+ */
21
+ export declare function getActiveMarkAttrs(editor: Editor | null, markName: string): Attrs | null;
22
+ /**
23
+ * Finds the position of a node in the editor selection
24
+ * @param params Object containing editor, node (optional), and nodePos (optional)
25
+ * @returns The position of the node in the selection or null if not found
26
+ */
27
+ export declare function findSelectionPosition(params: {
28
+ editor: Editor;
29
+ node?: Node | null;
30
+ nodePos?: number | null;
31
+ }): number | null;
32
+ /**
33
+ * Gets the currently selected DOM element in the editor
34
+ * @param editor The Tiptap editor instance
35
+ * @returns The selected DOM element or null if no selection is present
36
+ */
37
+ export declare function getSelectedDOMElement(editor: Editor): HTMLElement | null;
38
+ /**
39
+ * Gets the closest node from the current selection in the editor based on criteria
40
+ * @param editor The Tiptap editor instance
41
+ * @param options Configuration options for finding the node
42
+ * @returns An object containing the closest matching node, its position, and depth, or null if not found
43
+ */
44
+ export declare function getClosestNode(editor: Editor | null, options?: {
45
+ nodeName?: string;
46
+ isBlock?: boolean;
47
+ predicate?: (node: Node) => boolean;
48
+ }): {
49
+ node: Node;
50
+ pos: number;
51
+ depth: number;
52
+ } | null;
53
+ /**
54
+ * Gets the closest node from a specific position in the document
55
+ * @param editor The Tiptap editor instance
56
+ * @param pos The position to search from
57
+ * @param options Configuration options for finding the node
58
+ * @returns An object containing the closest matching node, its position, and depth, or null if not found
59
+ */
60
+ export declare function getClosestNodeByPos(editor: Editor | null, pos: number, options?: {
61
+ nodeName?: string;
62
+ isBlock?: boolean;
63
+ predicate?: (node: Node) => boolean;
64
+ }): {
65
+ node: Node;
66
+ pos: number;
67
+ depth: number;
68
+ } | null;
69
+ /**
70
+ * Convenience function to find closest block node (maintains backward compatibility)
71
+ */
72
+ export declare function getClosestBlockNode(editor: Editor | null): {
73
+ node: Node;
74
+ pos: number;
75
+ depth: number;
76
+ } | null;
77
+ /**
78
+ * Convenience function to find closest node by name
79
+ */
80
+ export declare function getClosestNodeByName(editor: Editor | null, nodeName: string): {
81
+ node: Node;
82
+ pos: number;
83
+ depth: number;
84
+ } | null;
85
+ /**
86
+ * Find multiple matching nodes up the tree
87
+ */
88
+ export declare function getAllMatchingNodes(editor: Editor | null, options?: {
89
+ nodeName?: string;
90
+ isBlock?: boolean;
91
+ predicate?: (node: Node) => boolean;
92
+ }): {
93
+ node: Node;
94
+ pos: number;
95
+ depth: number;
96
+ }[];
97
+ /**
98
+ * Gets the anchor node and its position in the editor.
99
+ * @param editor The Tiptap editor instance
100
+ * @param allowEmptySelection If true, still returns the node at the cursor position even if selection is empty
101
+ * @returns An object containing the anchor node and its position, or null if not found
102
+ */
103
+ export declare function getAnchorNodeAndPos(editor: Editor | null, allowEmptySelection?: boolean): {
104
+ node: Node;
105
+ pos: number;
106
+ } | null;
107
+ /**
108
+ * Checks if the current selection in the editor contains any text.
109
+ *
110
+ * @param editor - The Tiptap editor instance.
111
+ * @returns `true` if the selection contains text, `false` otherwise.
112
+ */
113
+ export declare function selectionHasText(editor: Editor | null): boolean;
114
+ /**
115
+ * Retrieves a specific extension by name from the Tiptap editor.
116
+ * @param editor - The Tiptap editor instance
117
+ * @param extensionName - The name of the extension to retrieve
118
+ * @returns The extension instance if found, otherwise null
119
+ */
120
+ export declare function getEditorExtension(editor: Editor | null, extensionName: string): import("@tiptap/core").AnyExtension | null;
@@ -0,0 +1,47 @@
1
+ import { type Selection } from "@tiptap/pm/state";
2
+ import type { JSONContent, Editor } from "@tiptap/react";
3
+ import { type OmniboxEditorI18n } from "@/lib/i18n";
4
+ export type OverflowPosition = "none" | "top" | "bottom" | "both";
5
+ /**
6
+ * Returns a display name for the current node in the editor
7
+ * @param editor The Tiptap editor instance
8
+ * @returns The display name of the current node
9
+ */
10
+ export declare const getNodeDisplayName: (editor: Editor | null, i18n?: OmniboxEditorI18n) => string;
11
+ /**
12
+ * Removes empty paragraph nodes from content
13
+ */
14
+ export declare const removeEmptyParagraphs: (content: JSONContent) => {
15
+ content: JSONContent[] | undefined;
16
+ type?: string;
17
+ attrs?: Record<string, any> | undefined;
18
+ marks?: {
19
+ type: string;
20
+ attrs?: Record<string, any>;
21
+ [key: string]: any;
22
+ }[];
23
+ text?: string;
24
+ };
25
+ /**
26
+ * Determines how a target element overflows relative to a container element
27
+ */
28
+ export declare function getElementOverflowPosition(targetElement: Element, containerElement: HTMLElement): OverflowPosition;
29
+ /**
30
+ * Checks if the current selection is valid for a given editor
31
+ */
32
+ export declare const isSelectionValid: (editor: Editor | null, selection?: Selection, excludedNodeTypes?: string[]) => boolean;
33
+ /**
34
+ * Checks if the current text selection is valid for editing
35
+ * - Not empty
36
+ * - Not a code block
37
+ * - Not a node selection
38
+ */
39
+ export declare const isTextSelectionValid: (editor: Editor | null) => boolean;
40
+ /**
41
+ * Gets the bounding rect of the current selection in the editor.
42
+ */
43
+ export declare const getSelectionBoundingRect: (editor: Editor) => DOMRect | null;
44
+ /**
45
+ * Generates a deterministic avatar URL from a user name
46
+ */
47
+ export declare const getAvatar: (name: string) => string;
@@ -0,0 +1,174 @@
1
+ import type { Node as PMNode } from "@tiptap/pm/model";
2
+ import type { Transaction } from "@tiptap/pm/state";
3
+ import { type ClassValue } from "clsx";
4
+ import { Selection } from "@tiptap/pm/state";
5
+ import { type Editor, type NodeWithPos } from "@tiptap/react";
6
+ export declare const MAX_FILE_SIZE: number;
7
+ export declare const MAC_SYMBOLS: Record<string, string>;
8
+ export declare const SR_ONLY: {
9
+ readonly position: "absolute";
10
+ readonly width: "1px";
11
+ readonly height: "1px";
12
+ readonly padding: 0;
13
+ readonly margin: "-1px";
14
+ readonly overflow: "hidden";
15
+ readonly clip: "rect(0, 0, 0, 0)";
16
+ readonly whiteSpace: "nowrap";
17
+ readonly borderWidth: 0;
18
+ };
19
+ export declare function cn(...inputs: ClassValue[]): string;
20
+ /**
21
+ * Determines if the current platform is macOS
22
+ * @returns boolean indicating if the current platform is Mac
23
+ */
24
+ export declare function isMac(): boolean;
25
+ /**
26
+ * Formats a shortcut key based on the platform (Mac or non-Mac)
27
+ * @param key - The key to format (e.g., "ctrl", "alt", "shift")
28
+ * @param isMac - Boolean indicating if the platform is Mac
29
+ * @param capitalize - Whether to capitalize the key (default: true)
30
+ * @returns Formatted shortcut key symbol
31
+ */
32
+ export declare const formatShortcutKey: (key: string, isMac: boolean, capitalize?: boolean) => string;
33
+ /**
34
+ * Parses a shortcut key string into an array of formatted key symbols
35
+ * @param shortcutKeys - The string of shortcut keys (e.g., "ctrl-alt-shift")
36
+ * @param delimiter - The delimiter used to split the keys (default: "-")
37
+ * @param capitalize - Whether to capitalize the keys (default: true)
38
+ * @returns Array of formatted shortcut key symbols
39
+ */
40
+ export declare const parseShortcutKeys: (props: {
41
+ shortcutKeys: string | undefined;
42
+ delimiter?: string;
43
+ capitalize?: boolean;
44
+ }) => string[];
45
+ /**
46
+ * Checks if a mark exists in the editor schema
47
+ * @param markName - The name of the mark to check
48
+ * @param editor - The editor instance
49
+ * @returns boolean indicating if the mark exists in the schema
50
+ */
51
+ export declare const isMarkInSchema: (markName: string, editor: Editor | null) => boolean;
52
+ /**
53
+ * Checks if a node exists in the editor schema
54
+ * @param nodeName - The name of the node to check
55
+ * @param editor - The editor instance
56
+ * @returns boolean indicating if the node exists in the schema
57
+ */
58
+ export declare const isNodeInSchema: (nodeName: string, editor: Editor | null) => boolean;
59
+ /**
60
+ * Moves the focus to the next node in the editor
61
+ * @param editor - The editor instance
62
+ * @returns boolean indicating if the focus was moved
63
+ */
64
+ export declare function focusNextNode(editor: Editor): boolean;
65
+ /**
66
+ * Checks if a value is a valid number (not null, undefined, or NaN)
67
+ * @param value - The value to check
68
+ * @returns boolean indicating if the value is a valid number
69
+ */
70
+ export declare function isValidPosition(pos: number | null | undefined): pos is number;
71
+ /**
72
+ * Checks if one or more extensions are registered in the Tiptap editor.
73
+ * @param editor - The Tiptap editor instance
74
+ * @param extensionNames - A single extension name or an array of names to check
75
+ * @returns True if at least one of the extensions is available, false otherwise
76
+ */
77
+ export declare function isExtensionAvailable(editor: Editor | null, extensionNames: string | string[]): boolean;
78
+ /**
79
+ * Finds a node at the specified position with error handling
80
+ * @param editor The Tiptap editor instance
81
+ * @param position The position in the document to find the node
82
+ * @returns The node at the specified position, or null if not found
83
+ */
84
+ export declare function findNodeAtPosition(editor: Editor, position: number): PMNode | null;
85
+ /**
86
+ * Finds the position and instance of a node in the document
87
+ * @param props Object containing editor, node (optional), and nodePos (optional)
88
+ * @param props.editor The Tiptap editor instance
89
+ * @param props.node The node to find (optional if nodePos is provided)
90
+ * @param props.nodePos The position of the node to find (optional if node is provided)
91
+ * @returns An object with the position and node, or null if not found
92
+ */
93
+ export declare function findNodePosition(props: {
94
+ editor: Editor | null;
95
+ node?: PMNode | null;
96
+ nodePos?: number | null;
97
+ }): {
98
+ pos: number;
99
+ node: PMNode;
100
+ } | null;
101
+ /**
102
+ * Determines whether the current selection contains a node whose type matches
103
+ * any of the provided node type names.
104
+ * @param editor Tiptap editor instance
105
+ * @param nodeTypeNames List of node type names to match against
106
+ * @param checkAncestorNodes Whether to check ancestor node types up the depth chain
107
+ */
108
+ export declare function isNodeTypeSelected(editor: Editor | null, nodeTypeNames?: string[], checkAncestorNodes?: boolean): boolean;
109
+ /**
110
+ * Check whether the current selection is fully within nodes
111
+ * whose type names are in the provided `types` list.
112
+ *
113
+ * - NodeSelection → checks the selected node.
114
+ * - Text/AllSelection → ensures all textblocks within [from, to) are allowed.
115
+ */
116
+ export declare function selectionWithinConvertibleTypes(editor: Editor, types?: string[]): boolean;
117
+ /**
118
+ * Handles image upload with progress tracking and abort capability
119
+ * @param file The file to upload
120
+ * @param onProgress Optional callback for tracking upload progress
121
+ * @param abortSignal Optional AbortSignal for cancelling the upload
122
+ * @returns Promise resolving to the URL of the uploaded image
123
+ */
124
+ export declare const handleImageUpload: (file: File, onProgress?: (event: {
125
+ progress: number;
126
+ }) => void, abortSignal?: AbortSignal) => Promise<string>;
127
+ type ProtocolOptions = {
128
+ /**
129
+ * The protocol scheme to be registered.
130
+ * @default '''
131
+ * @example 'ftp'
132
+ * @example 'git'
133
+ */
134
+ scheme: string;
135
+ /**
136
+ * If enabled, it allows optional slashes after the protocol.
137
+ * @default false
138
+ * @example true
139
+ */
140
+ optionalSlashes?: boolean;
141
+ };
142
+ type ProtocolConfig = Array<ProtocolOptions | string>;
143
+ export declare function isAllowedUri(uri: string | undefined, protocols?: ProtocolConfig): true | RegExpMatchArray | null;
144
+ export declare function sanitizeUrl(inputUrl: string, baseUrl: string, protocols?: ProtocolConfig): string;
145
+ /**
146
+ * Update a single attribute on multiple nodes.
147
+ *
148
+ * @param tr - The transaction to mutate
149
+ * @param targets - Array of { node, pos }
150
+ * @param attrName - Attribute key to update
151
+ * @param next - New value OR updater function receiving previous value
152
+ * Pass `undefined` to remove the attribute.
153
+ * @returns true if at least one node was updated, false otherwise
154
+ */
155
+ export declare function updateNodesAttr<A extends string = string, V = unknown>(tr: Transaction, targets: readonly NodeWithPos[], attrName: A, next: V | ((prev: V | undefined) => V | undefined)): boolean;
156
+ /**
157
+ * Selects the entire content of the current block node if the selection is empty.
158
+ * If the selection is not empty, it does nothing.
159
+ * @param editor The Tiptap editor instance
160
+ */
161
+ export declare function selectCurrentBlockContent(editor: Editor): void;
162
+ /**
163
+ * Retrieves all nodes of specified types from the current selection.
164
+ * @param selection The current editor selection
165
+ * @param allowedNodeTypes An array of node type names to look for (e.g., ["image", "table"])
166
+ * @returns An array of objects containing the node and its position
167
+ */
168
+ export declare function getSelectedNodesOfType(selection: Selection, allowedNodeTypes: string[]): NodeWithPos[];
169
+ /**
170
+ * Clamps a value between min and max bounds
171
+ */
172
+ export declare function clamp(value: number, min: number, max: number): number;
173
+ export declare function getSelectedBlockNodes(editor: Editor): PMNode[];
174
+ export {};