@dooherceg/tiptap-controlled-editor-with-table 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 (287) hide show
  1. package/README.md +63 -0
  2. package/dist/Combination-CO0ZtURs.js +1333 -0
  3. package/dist/assets/badge.css +1 -0
  4. package/dist/assets/button.css +1 -0
  5. package/dist/assets/card.css +1 -0
  6. package/dist/assets/color-highlight-button.css +1 -0
  7. package/dist/assets/dropdown-menu.css +1 -0
  8. package/dist/assets/image-upload-node.css +1 -0
  9. package/dist/assets/input.css +1 -0
  10. package/dist/assets/popover.css +1 -0
  11. package/dist/assets/separator.css +1 -0
  12. package/dist/assets/simple-editor.css +1 -0
  13. package/dist/assets/toolbar.css +1 -0
  14. package/dist/assets/tooltip.css +1 -0
  15. package/dist/components/tiptap-icons/add-table-column-after-icon.d.ts +1 -0
  16. package/dist/components/tiptap-icons/add-table-column-after-icon.js +26 -0
  17. package/dist/components/tiptap-icons/add-table-column-before-icon.d.ts +1 -0
  18. package/dist/components/tiptap-icons/add-table-column-before-icon.js +26 -0
  19. package/dist/components/tiptap-icons/add-table-row-after-icon.d.ts +1 -0
  20. package/dist/components/tiptap-icons/add-table-row-after-icon.js +26 -0
  21. package/dist/components/tiptap-icons/add-table-row-before-icon.d.ts +1 -0
  22. package/dist/components/tiptap-icons/add-table-row-before-icon.js +26 -0
  23. package/dist/components/tiptap-icons/align-center-icon.d.ts +3 -0
  24. package/dist/components/tiptap-icons/align-center-icon.js +47 -0
  25. package/dist/components/tiptap-icons/align-justify-icon.d.ts +3 -0
  26. package/dist/components/tiptap-icons/align-justify-icon.js +47 -0
  27. package/dist/components/tiptap-icons/align-left-icon.d.ts +1 -0
  28. package/dist/components/tiptap-icons/align-left-icon.js +49 -0
  29. package/dist/components/tiptap-icons/align-right-icon.d.ts +1 -0
  30. package/dist/components/tiptap-icons/align-right-icon.js +49 -0
  31. package/dist/components/tiptap-icons/arrow-left-icon.d.ts +1 -0
  32. package/dist/components/tiptap-icons/arrow-left-icon.js +27 -0
  33. package/dist/components/tiptap-icons/ban-icon.d.ts +1 -0
  34. package/dist/components/tiptap-icons/ban-icon.js +29 -0
  35. package/dist/components/tiptap-icons/blockquote-icon.d.ts +1 -0
  36. package/dist/components/tiptap-icons/blockquote-icon.js +58 -0
  37. package/dist/components/tiptap-icons/bold-icon.d.ts +1 -0
  38. package/dist/components/tiptap-icons/bold-icon.js +29 -0
  39. package/dist/components/tiptap-icons/chevron-down-icon.d.ts +3 -0
  40. package/dist/components/tiptap-icons/chevron-down-icon.js +27 -0
  41. package/dist/components/tiptap-icons/close-icon.d.ts +1 -0
  42. package/dist/components/tiptap-icons/close-icon.js +27 -0
  43. package/dist/components/tiptap-icons/code-block-icon.d.ts +1 -0
  44. package/dist/components/tiptap-icons/code-block-icon.js +49 -0
  45. package/dist/components/tiptap-icons/code2-icon.d.ts +1 -0
  46. package/dist/components/tiptap-icons/code2-icon.js +43 -0
  47. package/dist/components/tiptap-icons/corner-down-left-icon.d.ts +1 -0
  48. package/dist/components/tiptap-icons/corner-down-left-icon.js +29 -0
  49. package/dist/components/tiptap-icons/delete-table-column-icon.d.ts +1 -0
  50. package/dist/components/tiptap-icons/delete-table-column-icon.js +26 -0
  51. package/dist/components/tiptap-icons/delete-table-row-icon.d.ts +1 -0
  52. package/dist/components/tiptap-icons/delete-table-row-icon.js +33 -0
  53. package/dist/components/tiptap-icons/external-link-icon.d.ts +1 -0
  54. package/dist/components/tiptap-icons/external-link-icon.js +36 -0
  55. package/dist/components/tiptap-icons/heading-five-icon.d.ts +1 -0
  56. package/dist/components/tiptap-icons/heading-five-icon.js +36 -0
  57. package/dist/components/tiptap-icons/heading-four-icon.d.ts +1 -0
  58. package/dist/components/tiptap-icons/heading-four-icon.js +36 -0
  59. package/dist/components/tiptap-icons/heading-icon.d.ts +1 -0
  60. package/dist/components/tiptap-icons/heading-icon.js +27 -0
  61. package/dist/components/tiptap-icons/heading-one-icon.d.ts +1 -0
  62. package/dist/components/tiptap-icons/heading-one-icon.js +36 -0
  63. package/dist/components/tiptap-icons/heading-six-icon.d.ts +1 -0
  64. package/dist/components/tiptap-icons/heading-six-icon.js +38 -0
  65. package/dist/components/tiptap-icons/heading-three-icon.d.ts +1 -0
  66. package/dist/components/tiptap-icons/heading-three-icon.js +47 -0
  67. package/dist/components/tiptap-icons/heading-two-icon.d.ts +1 -0
  68. package/dist/components/tiptap-icons/heading-two-icon.js +36 -0
  69. package/dist/components/tiptap-icons/highlighter-icon.d.ts +1 -0
  70. package/dist/components/tiptap-icons/highlighter-icon.js +29 -0
  71. package/dist/components/tiptap-icons/image-plus-icon.d.ts +1 -0
  72. package/dist/components/tiptap-icons/image-plus-icon.js +29 -0
  73. package/dist/components/tiptap-icons/italic-icon.d.ts +1 -0
  74. package/dist/components/tiptap-icons/italic-icon.js +27 -0
  75. package/dist/components/tiptap-icons/link-icon.d.ts +1 -0
  76. package/dist/components/tiptap-icons/link-icon.js +36 -0
  77. package/dist/components/tiptap-icons/list-icon.d.ts +1 -0
  78. package/dist/components/tiptap-icons/list-icon.js +76 -0
  79. package/dist/components/tiptap-icons/list-ordered-icon.d.ts +1 -0
  80. package/dist/components/tiptap-icons/list-ordered-icon.js +76 -0
  81. package/dist/components/tiptap-icons/list-todo-icon.d.ts +1 -0
  82. package/dist/components/tiptap-icons/list-todo-icon.js +67 -0
  83. package/dist/components/tiptap-icons/merge-table-cells-icon.d.ts +1 -0
  84. package/dist/components/tiptap-icons/merge-table-cells-icon.js +26 -0
  85. package/dist/components/tiptap-icons/moon-star-icon.d.ts +1 -0
  86. package/dist/components/tiptap-icons/moon-star-icon.js +38 -0
  87. package/dist/components/tiptap-icons/redo2-icon.d.ts +1 -0
  88. package/dist/components/tiptap-icons/redo2-icon.js +29 -0
  89. package/dist/components/tiptap-icons/remove-table-icon.d.ts +1 -0
  90. package/dist/components/tiptap-icons/remove-table-icon.js +26 -0
  91. package/dist/components/tiptap-icons/split-table-cells-icon copy.d.ts +1 -0
  92. package/dist/components/tiptap-icons/split-table-cells-icon copy.js +30 -0
  93. package/dist/components/tiptap-icons/strike-icon.d.ts +1 -0
  94. package/dist/components/tiptap-icons/strike-icon.js +36 -0
  95. package/dist/components/tiptap-icons/subscript-icon.d.ts +1 -0
  96. package/dist/components/tiptap-icons/subscript-icon.js +49 -0
  97. package/dist/components/tiptap-icons/sun-icon.d.ts +1 -0
  98. package/dist/components/tiptap-icons/sun-icon.js +87 -0
  99. package/dist/components/tiptap-icons/superscript-icon.d.ts +1 -0
  100. package/dist/components/tiptap-icons/superscript-icon.js +49 -0
  101. package/dist/components/tiptap-icons/table-icon.d.ts +3 -0
  102. package/dist/components/tiptap-icons/table-icon.js +24 -0
  103. package/dist/components/tiptap-icons/trash-icon.d.ts +1 -0
  104. package/dist/components/tiptap-icons/trash-icon.js +29 -0
  105. package/dist/components/tiptap-icons/underline-icon.d.ts +1 -0
  106. package/dist/components/tiptap-icons/underline-icon.js +29 -0
  107. package/dist/components/tiptap-icons/undo2-icon.d.ts +1 -0
  108. package/dist/components/tiptap-icons/undo2-icon.js +29 -0
  109. package/dist/components/tiptap-node/horizontal-rule-node/horizontal-rule-node-extension.d.ts +2 -0
  110. package/dist/components/tiptap-node/horizontal-rule-node/horizontal-rule-node-extension.js +67 -0
  111. package/dist/components/tiptap-node/image-upload-node/image-upload-node-extension.d.ts +58 -0
  112. package/dist/components/tiptap-node/image-upload-node/image-upload-node-extension.js +77 -0
  113. package/dist/components/tiptap-node/image-upload-node/image-upload-node.d.ts +68 -0
  114. package/dist/components/tiptap-node/image-upload-node/image-upload-node.js +329 -0
  115. package/dist/components/tiptap-node/image-upload-node/index.d.ts +1 -0
  116. package/dist/components/tiptap-node/image-upload-node/index.js +4 -0
  117. package/dist/components/tiptap-templates/simple/simple-editor.d.ts +8 -0
  118. package/dist/components/tiptap-templates/simple/simple-editor.js +1956 -0
  119. package/dist/components/tiptap-templates/simple/theme-toggle.d.ts +1 -0
  120. package/dist/components/tiptap-templates/simple/theme-toggle.js +28 -0
  121. package/dist/components/tiptap-ui/blockquote-button/blockquote-button.d.ts +22 -0
  122. package/dist/components/tiptap-ui/blockquote-button/blockquote-button.js +71 -0
  123. package/dist/components/tiptap-ui/blockquote-button/index.d.ts +2 -0
  124. package/dist/components/tiptap-ui/blockquote-button/index.js +11 -0
  125. package/dist/components/tiptap-ui/blockquote-button/use-blockquote.d.ts +80 -0
  126. package/dist/components/tiptap-ui/blockquote-button/use-blockquote.js +82 -0
  127. package/dist/components/tiptap-ui/code-block-button/code-block-button.d.ts +22 -0
  128. package/dist/components/tiptap-ui/code-block-button/code-block-button.js +71 -0
  129. package/dist/components/tiptap-ui/code-block-button/index.d.ts +2 -0
  130. package/dist/components/tiptap-ui/code-block-button/index.js +11 -0
  131. package/dist/components/tiptap-ui/code-block-button/use-code-block.d.ts +87 -0
  132. package/dist/components/tiptap-ui/code-block-button/use-code-block.js +83 -0
  133. package/dist/components/tiptap-ui/color-highlight-button/color-highlight-button.d.ts +45 -0
  134. package/dist/components/tiptap-ui/color-highlight-button/color-highlight-button.js +89 -0
  135. package/dist/components/tiptap-ui/color-highlight-button/index.d.ts +2 -0
  136. package/dist/components/tiptap-ui/color-highlight-button/index.js +14 -0
  137. package/dist/components/tiptap-ui/color-highlight-button/use-color-highlight.d.ts +82 -0
  138. package/dist/components/tiptap-ui/color-highlight-button/use-color-highlight.js +176 -0
  139. package/dist/components/tiptap-ui/color-highlight-popover/color-highlight-popover.d.ts +25 -0
  140. package/dist/components/tiptap-ui/color-highlight-popover/color-highlight-popover.js +136 -0
  141. package/dist/components/tiptap-ui/color-highlight-popover/index.d.ts +1 -0
  142. package/dist/components/tiptap-ui/color-highlight-popover/index.js +6 -0
  143. package/dist/components/tiptap-ui/heading-button/heading-button.d.ts +23 -0
  144. package/dist/components/tiptap-ui/heading-button/heading-button.js +74 -0
  145. package/dist/components/tiptap-ui/heading-button/index.d.ts +2 -0
  146. package/dist/components/tiptap-ui/heading-button/index.js +13 -0
  147. package/dist/components/tiptap-ui/heading-button/use-heading.d.ts +108 -0
  148. package/dist/components/tiptap-ui/heading-button/use-heading.js +112 -0
  149. package/dist/components/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu.d.ts +20 -0
  150. package/dist/components/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu.js +67 -0
  151. package/dist/components/tiptap-ui/heading-dropdown-menu/index.d.ts +2 -0
  152. package/dist/components/tiptap-ui/heading-dropdown-menu/index.js +7 -0
  153. package/dist/components/tiptap-ui/heading-dropdown-menu/use-heading-dropdown-menu.d.ts +73 -0
  154. package/dist/components/tiptap-ui/heading-dropdown-menu/use-heading-dropdown-menu.js +38 -0
  155. package/dist/components/tiptap-ui/image-upload-button/image-upload-button.d.ts +29 -0
  156. package/dist/components/tiptap-ui/image-upload-button/image-upload-button.js +72 -0
  157. package/dist/components/tiptap-ui/image-upload-button/index.d.ts +2 -0
  158. package/dist/components/tiptap-ui/image-upload-button/index.js +12 -0
  159. package/dist/components/tiptap-ui/image-upload-button/use-image-upload.d.ts +84 -0
  160. package/dist/components/tiptap-ui/image-upload-button/use-image-upload.js +76 -0
  161. package/dist/components/tiptap-ui/insert-table-button/insert-table-button.d.ts +4 -0
  162. package/dist/components/tiptap-ui/insert-table-button/insert-table-button.js +41 -0
  163. package/dist/components/tiptap-ui/link-popover/index.d.ts +2 -0
  164. package/dist/components/tiptap-ui/link-popover/index.js +13 -0
  165. package/dist/components/tiptap-ui/link-popover/link-popover.d.ts +57 -0
  166. package/dist/components/tiptap-ui/link-popover/link-popover.js +193 -0
  167. package/dist/components/tiptap-ui/link-popover/use-link-popover.d.ts +117 -0
  168. package/dist/components/tiptap-ui/link-popover/use-link-popover.js +103 -0
  169. package/dist/components/tiptap-ui/list-button/index.d.ts +2 -0
  170. package/dist/components/tiptap-ui/list-button/index.js +14 -0
  171. package/dist/components/tiptap-ui/list-button/list-button.d.ts +23 -0
  172. package/dist/components/tiptap-ui/list-button/list-button.js +74 -0
  173. package/dist/components/tiptap-ui/list-button/use-list.d.ts +97 -0
  174. package/dist/components/tiptap-ui/list-button/use-list.js +149 -0
  175. package/dist/components/tiptap-ui/list-dropdown-menu/index.d.ts +1 -0
  176. package/dist/components/tiptap-ui/list-dropdown-menu/index.js +4 -0
  177. package/dist/components/tiptap-ui/list-dropdown-menu/list-dropdown-menu.d.ts +29 -0
  178. package/dist/components/tiptap-ui/list-dropdown-menu/list-dropdown-menu.js +63 -0
  179. package/dist/components/tiptap-ui/list-dropdown-menu/use-list-dropdown-menu.d.ts +90 -0
  180. package/dist/components/tiptap-ui/list-dropdown-menu/use-list-dropdown-menu.js +84 -0
  181. package/dist/components/tiptap-ui/mark-button/index.d.ts +2 -0
  182. package/dist/components/tiptap-ui/mark-button/index.js +14 -0
  183. package/dist/components/tiptap-ui/mark-button/mark-button.d.ts +23 -0
  184. package/dist/components/tiptap-ui/mark-button/mark-button.js +74 -0
  185. package/dist/components/tiptap-ui/mark-button/use-mark.d.ts +104 -0
  186. package/dist/components/tiptap-ui/mark-button/use-mark.js +84 -0
  187. package/dist/components/tiptap-ui/table-actions-toolbar/add-column-after-button.d.ts +4 -0
  188. package/dist/components/tiptap-ui/table-actions-toolbar/add-column-after-button.js +7 -0
  189. package/dist/components/tiptap-ui/table-actions-toolbar/add-column-before-button.d.ts +4 -0
  190. package/dist/components/tiptap-ui/table-actions-toolbar/add-column-before-button.js +7 -0
  191. package/dist/components/tiptap-ui/table-actions-toolbar/add-row-after-button.d.ts +4 -0
  192. package/dist/components/tiptap-ui/table-actions-toolbar/add-row-after-button.js +7 -0
  193. package/dist/components/tiptap-ui/table-actions-toolbar/add-row-before-button.d.ts +4 -0
  194. package/dist/components/tiptap-ui/table-actions-toolbar/add-row-before-button.js +7 -0
  195. package/dist/components/tiptap-ui/table-actions-toolbar/delete-column-button.d.ts +4 -0
  196. package/dist/components/tiptap-ui/table-actions-toolbar/delete-column-button.js +7 -0
  197. package/dist/components/tiptap-ui/table-actions-toolbar/delete-row-button.d.ts +4 -0
  198. package/dist/components/tiptap-ui/table-actions-toolbar/delete-row-button.js +7 -0
  199. package/dist/components/tiptap-ui/table-actions-toolbar/get-table-node-and-pos.d.ts +6 -0
  200. package/dist/components/tiptap-ui/table-actions-toolbar/get-table-node-and-pos.js +15 -0
  201. package/dist/components/tiptap-ui/table-actions-toolbar/merge-cells-button.d.ts +4 -0
  202. package/dist/components/tiptap-ui/table-actions-toolbar/merge-cells-button.js +7 -0
  203. package/dist/components/tiptap-ui/table-actions-toolbar/remove-table-button.d.ts +4 -0
  204. package/dist/components/tiptap-ui/table-actions-toolbar/remove-table-button.js +7 -0
  205. package/dist/components/tiptap-ui/table-actions-toolbar/split-table-cells-button.d.ts +4 -0
  206. package/dist/components/tiptap-ui/table-actions-toolbar/split-table-cells-button.js +7 -0
  207. package/dist/components/tiptap-ui/table-actions-toolbar/table-actions-toolbar.d.ts +2 -0
  208. package/dist/components/tiptap-ui/table-actions-toolbar/table-actions-toolbar.js +75 -0
  209. package/dist/components/tiptap-ui/text-align-button/index.d.ts +2 -0
  210. package/dist/components/tiptap-ui/text-align-button/index.js +15 -0
  211. package/dist/components/tiptap-ui/text-align-button/text-align-button.d.ts +30 -0
  212. package/dist/components/tiptap-ui/text-align-button/text-align-button.js +81 -0
  213. package/dist/components/tiptap-ui/text-align-button/use-text-align.d.ts +101 -0
  214. package/dist/components/tiptap-ui/text-align-button/use-text-align.js +84 -0
  215. package/dist/components/tiptap-ui/undo-redo-button/index.d.ts +2 -0
  216. package/dist/components/tiptap-ui/undo-redo-button/index.js +13 -0
  217. package/dist/components/tiptap-ui/undo-redo-button/undo-redo-button.d.ts +23 -0
  218. package/dist/components/tiptap-ui/undo-redo-button/undo-redo-button.js +70 -0
  219. package/dist/components/tiptap-ui/undo-redo-button/use-undo-redo.d.ts +90 -0
  220. package/dist/components/tiptap-ui/undo-redo-button/use-undo-redo.js +67 -0
  221. package/dist/components/tiptap-ui-primitive/badge/badge.d.ts +8 -0
  222. package/dist/components/tiptap-ui-primitive/badge/badge.js +30 -0
  223. package/dist/components/tiptap-ui-primitive/badge/index.d.ts +1 -0
  224. package/dist/components/tiptap-ui-primitive/badge/index.js +4 -0
  225. package/dist/components/tiptap-ui-primitive/button/button.d.ts +14 -0
  226. package/dist/components/tiptap-ui-primitive/button/button.js +69 -0
  227. package/dist/components/tiptap-ui-primitive/button/index.d.ts +1 -0
  228. package/dist/components/tiptap-ui-primitive/button/index.js +6 -0
  229. package/dist/components/tiptap-ui-primitive/card/card.d.ts +9 -0
  230. package/dist/components/tiptap-ui-primitive/card/card.js +62 -0
  231. package/dist/components/tiptap-ui-primitive/card/index.d.ts +1 -0
  232. package/dist/components/tiptap-ui-primitive/card/index.js +9 -0
  233. package/dist/components/tiptap-ui-primitive/dropdown-menu/dropdown-menu.d.ts +16 -0
  234. package/dist/components/tiptap-ui-primitive/dropdown-menu/dropdown-menu.js +1028 -0
  235. package/dist/components/tiptap-ui-primitive/dropdown-menu/index.d.ts +1 -0
  236. package/dist/components/tiptap-ui-primitive/dropdown-menu/index.js +13 -0
  237. package/dist/components/tiptap-ui-primitive/input/index.d.ts +1 -0
  238. package/dist/components/tiptap-ui-primitive/input/index.js +5 -0
  239. package/dist/components/tiptap-ui-primitive/input/input.d.ts +3 -0
  240. package/dist/components/tiptap-ui-primitive/input/input.js +16 -0
  241. package/dist/components/tiptap-ui-primitive/popover/index.d.ts +1 -0
  242. package/dist/components/tiptap-ui-primitive/popover/index.js +6 -0
  243. package/dist/components/tiptap-ui-primitive/popover/popover.d.ts +5 -0
  244. package/dist/components/tiptap-ui-primitive/popover/popover.js +244 -0
  245. package/dist/components/tiptap-ui-primitive/separator/index.d.ts +1 -0
  246. package/dist/components/tiptap-ui-primitive/separator/index.js +4 -0
  247. package/dist/components/tiptap-ui-primitive/separator/separator.d.ts +6 -0
  248. package/dist/components/tiptap-ui-primitive/separator/separator.js +22 -0
  249. package/dist/components/tiptap-ui-primitive/spacer/index.d.ts +1 -0
  250. package/dist/components/tiptap-ui-primitive/spacer/index.js +4 -0
  251. package/dist/components/tiptap-ui-primitive/spacer/spacer.d.ts +6 -0
  252. package/dist/components/tiptap-ui-primitive/spacer/spacer.js +20 -0
  253. package/dist/components/tiptap-ui-primitive/toolbar/index.d.ts +1 -0
  254. package/dist/components/tiptap-ui-primitive/toolbar/index.js +6 -0
  255. package/dist/components/tiptap-ui-primitive/toolbar/toolbar.d.ts +8 -0
  256. package/dist/components/tiptap-ui-primitive/toolbar/toolbar.js +83 -0
  257. package/dist/components/tiptap-ui-primitive/tooltip/index.d.ts +1 -0
  258. package/dist/components/tiptap-ui-primitive/tooltip/index.js +6 -0
  259. package/dist/components/tiptap-ui-primitive/tooltip/tooltip.d.ts +28 -0
  260. package/dist/components/tiptap-ui-primitive/tooltip/tooltip.js +1374 -0
  261. package/dist/floating-ui.react-dom-DgOuULHo.js +1334 -0
  262. package/dist/hooks/use-composed-ref.d.ts +3 -0
  263. package/dist/hooks/use-composed-ref.js +16 -0
  264. package/dist/hooks/use-cursor-visibility.d.ts +20 -0
  265. package/dist/hooks/use-cursor-visibility.js +31 -0
  266. package/dist/hooks/use-element-rect.d.ts +35 -0
  267. package/dist/hooks/use-element-rect.js +79 -0
  268. package/dist/hooks/use-menu-navigation.d.ts +52 -0
  269. package/dist/hooks/use-menu-navigation.js +68 -0
  270. package/dist/hooks/use-mobile.d.ts +1 -0
  271. package/dist/hooks/use-mobile.js +13 -0
  272. package/dist/hooks/use-scrolling.d.ts +8 -0
  273. package/dist/hooks/use-scrolling.js +17 -0
  274. package/dist/hooks/use-throttled-callback.d.ts +18 -0
  275. package/dist/hooks/use-throttled-callback.js +116 -0
  276. package/dist/hooks/use-tiptap-editor.d.ts +17 -0
  277. package/dist/hooks/use-tiptap-editor.js +25 -0
  278. package/dist/hooks/use-unmount.d.ts +7 -0
  279. package/dist/hooks/use-unmount.js +14 -0
  280. package/dist/hooks/use-window-size.d.ts +35 -0
  281. package/dist/hooks/use-window-size.js +33 -0
  282. package/dist/index-Bqw9S4qP.js +238 -0
  283. package/dist/lib/tiptap-utils.d.ts +160 -0
  284. package/dist/lib/tiptap-utils.js +229 -0
  285. package/dist/main.d.ts +1 -0
  286. package/dist/main.js +4 -0
  287. package/package.json +67 -0
@@ -0,0 +1,1028 @@
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import * as a from "react";
3
+ import L, { forwardRef as ge } from "react";
4
+ import { a as ae, d as A, j as me, u as we, m as ce, P as O, e as g, b as W, c as Te, A as xn, f as se, k as Nn, i as An, F as On, D as Fn, C as kn, g as Gn, h as Ln, R as xe, n as Kn, o as Ne, l as $n } from "../../../Combination-CO0ZtURs.js";
5
+ import { cn as Ae } from "../../../lib/tiptap-utils.js";
6
+ import '../../../assets/dropdown-menu.css';function Oe(e) {
7
+ const o = e + "CollectionProvider", [n, t] = ae(o), [r, s] = n(
8
+ o,
9
+ { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
10
+ ), l = (R) => {
11
+ const { scope: M, children: C } = R, E = L.useRef(null), h = L.useRef(/* @__PURE__ */ new Map()).current;
12
+ return /* @__PURE__ */ c(r, { scope: M, itemMap: h, collectionRef: E, children: C });
13
+ };
14
+ l.displayName = o;
15
+ const d = e + "CollectionSlot", m = me(d), f = L.forwardRef(
16
+ (R, M) => {
17
+ const { scope: C, children: E } = R, h = s(d, C), I = A(M, h.collectionRef);
18
+ return /* @__PURE__ */ c(m, { ref: I, children: E });
19
+ }
20
+ );
21
+ f.displayName = d;
22
+ const i = e + "CollectionItemSlot", u = "data-radix-collection-item", v = me(i), _ = L.forwardRef(
23
+ (R, M) => {
24
+ const { scope: C, children: E, ...h } = R, I = L.useRef(null), N = A(M, I), y = s(i, C);
25
+ return L.useEffect(() => (y.itemMap.set(I, { ref: I, ...h }), () => void y.itemMap.delete(I))), /* @__PURE__ */ c(v, { [u]: "", ref: N, children: E });
26
+ }
27
+ );
28
+ _.displayName = i;
29
+ function w(R) {
30
+ const M = s(e + "CollectionConsumer", R);
31
+ return L.useCallback(() => {
32
+ const E = M.collectionRef.current;
33
+ if (!E) return [];
34
+ const h = Array.from(E.querySelectorAll(`[${u}]`));
35
+ return Array.from(M.itemMap.values()).sort(
36
+ (y, T) => h.indexOf(y.ref.current) - h.indexOf(T.ref.current)
37
+ );
38
+ }, [M.collectionRef, M.itemMap]);
39
+ }
40
+ return [
41
+ { Provider: l, Slot: f, ItemSlot: _ },
42
+ w,
43
+ t
44
+ ];
45
+ }
46
+ var Un = a.createContext(void 0);
47
+ function Fe(e) {
48
+ const o = a.useContext(Un);
49
+ return e || o || "ltr";
50
+ }
51
+ var fe = "rovingFocusGroup.onEntryFocus", Bn = { bubbles: !1, cancelable: !0 }, Z = "RovingFocusGroup", [ve, ke, Vn] = Oe(Z), [Yn, Ge] = ae(
52
+ Z,
53
+ [Vn]
54
+ ), [jn, Xn] = Yn(Z), Le = a.forwardRef(
55
+ (e, o) => /* @__PURE__ */ c(ve.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ c(ve.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ c(Hn, { ...e, ref: o }) }) })
56
+ );
57
+ Le.displayName = Z;
58
+ var Hn = a.forwardRef((e, o) => {
59
+ const {
60
+ __scopeRovingFocusGroup: n,
61
+ orientation: t,
62
+ loop: r = !1,
63
+ dir: s,
64
+ currentTabStopId: l,
65
+ defaultCurrentTabStopId: d,
66
+ onCurrentTabStopIdChange: m,
67
+ onEntryFocus: f,
68
+ preventScrollOnEntryFocus: i = !1,
69
+ ...u
70
+ } = e, v = a.useRef(null), _ = A(o, v), w = Fe(s), [R, M] = we({
71
+ prop: l,
72
+ defaultProp: d ?? null,
73
+ onChange: m,
74
+ caller: Z
75
+ }), [C, E] = a.useState(!1), h = ce(f), I = ke(n), N = a.useRef(!1), [y, T] = a.useState(0);
76
+ return a.useEffect(() => {
77
+ const b = v.current;
78
+ if (b)
79
+ return b.addEventListener(fe, h), () => b.removeEventListener(fe, h);
80
+ }, [h]), /* @__PURE__ */ c(
81
+ jn,
82
+ {
83
+ scope: n,
84
+ orientation: t,
85
+ dir: w,
86
+ loop: r,
87
+ currentTabStopId: R,
88
+ onItemFocus: a.useCallback(
89
+ (b) => M(b),
90
+ [M]
91
+ ),
92
+ onItemShiftTab: a.useCallback(() => E(!0), []),
93
+ onFocusableItemAdd: a.useCallback(
94
+ () => T((b) => b + 1),
95
+ []
96
+ ),
97
+ onFocusableItemRemove: a.useCallback(
98
+ () => T((b) => b - 1),
99
+ []
100
+ ),
101
+ children: /* @__PURE__ */ c(
102
+ O.div,
103
+ {
104
+ tabIndex: C || y === 0 ? -1 : 0,
105
+ "data-orientation": t,
106
+ ...u,
107
+ ref: _,
108
+ style: { outline: "none", ...e.style },
109
+ onMouseDown: g(e.onMouseDown, () => {
110
+ N.current = !0;
111
+ }),
112
+ onFocus: g(e.onFocus, (b) => {
113
+ const $ = !N.current;
114
+ if (b.target === b.currentTarget && $ && !C) {
115
+ const k = new CustomEvent(fe, Bn);
116
+ if (b.currentTarget.dispatchEvent(k), !k.defaultPrevented) {
117
+ const V = I().filter((x) => x.focusable), Y = V.find((x) => x.active), ne = V.find((x) => x.id === R), le = [Y, ne, ...V].filter(
118
+ Boolean
119
+ ).map((x) => x.ref.current);
120
+ Ue(le, i);
121
+ }
122
+ }
123
+ N.current = !1;
124
+ }),
125
+ onBlur: g(e.onBlur, () => E(!1))
126
+ }
127
+ )
128
+ }
129
+ );
130
+ }), Ke = "RovingFocusGroupItem", $e = a.forwardRef(
131
+ (e, o) => {
132
+ const {
133
+ __scopeRovingFocusGroup: n,
134
+ focusable: t = !0,
135
+ active: r = !1,
136
+ tabStopId: s,
137
+ children: l,
138
+ ...d
139
+ } = e, m = W(), f = s || m, i = Xn(Ke, n), u = i.currentTabStopId === f, v = ke(n), { onFocusableItemAdd: _, onFocusableItemRemove: w, currentTabStopId: R } = i;
140
+ return a.useEffect(() => {
141
+ if (t)
142
+ return _(), () => w();
143
+ }, [t, _, w]), /* @__PURE__ */ c(
144
+ ve.ItemSlot,
145
+ {
146
+ scope: n,
147
+ id: f,
148
+ focusable: t,
149
+ active: r,
150
+ children: /* @__PURE__ */ c(
151
+ O.span,
152
+ {
153
+ tabIndex: u ? 0 : -1,
154
+ "data-orientation": i.orientation,
155
+ ...d,
156
+ ref: o,
157
+ onMouseDown: g(e.onMouseDown, (M) => {
158
+ t ? i.onItemFocus(f) : M.preventDefault();
159
+ }),
160
+ onFocus: g(e.onFocus, () => i.onItemFocus(f)),
161
+ onKeyDown: g(e.onKeyDown, (M) => {
162
+ if (M.key === "Tab" && M.shiftKey) {
163
+ i.onItemShiftTab();
164
+ return;
165
+ }
166
+ if (M.target !== M.currentTarget) return;
167
+ const C = qn(M, i.orientation, i.dir);
168
+ if (C !== void 0) {
169
+ if (M.metaKey || M.ctrlKey || M.altKey || M.shiftKey) return;
170
+ M.preventDefault();
171
+ let h = v().filter((I) => I.focusable).map((I) => I.ref.current);
172
+ if (C === "last") h.reverse();
173
+ else if (C === "prev" || C === "next") {
174
+ C === "prev" && h.reverse();
175
+ const I = h.indexOf(M.currentTarget);
176
+ h = i.loop ? Zn(h, I + 1) : h.slice(I + 1);
177
+ }
178
+ setTimeout(() => Ue(h));
179
+ }
180
+ }),
181
+ children: typeof l == "function" ? l({ isCurrentTabStop: u, hasTabStop: R != null }) : l
182
+ }
183
+ )
184
+ }
185
+ );
186
+ }
187
+ );
188
+ $e.displayName = Ke;
189
+ var Wn = {
190
+ ArrowLeft: "prev",
191
+ ArrowUp: "prev",
192
+ ArrowRight: "next",
193
+ ArrowDown: "next",
194
+ PageUp: "first",
195
+ Home: "first",
196
+ PageDown: "last",
197
+ End: "last"
198
+ };
199
+ function zn(e, o) {
200
+ return o !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
201
+ }
202
+ function qn(e, o, n) {
203
+ const t = zn(e.key, n);
204
+ if (!(o === "vertical" && ["ArrowLeft", "ArrowRight"].includes(t)) && !(o === "horizontal" && ["ArrowUp", "ArrowDown"].includes(t)))
205
+ return Wn[t];
206
+ }
207
+ function Ue(e, o = !1) {
208
+ const n = document.activeElement;
209
+ for (const t of e)
210
+ if (t === n || (t.focus({ preventScroll: o }), document.activeElement !== n)) return;
211
+ }
212
+ function Zn(e, o) {
213
+ return e.map((n, t) => e[(o + t) % e.length]);
214
+ }
215
+ var Jn = Le, Qn = $e, Me = ["Enter", " "], eo = ["ArrowDown", "PageUp", "Home"], Be = ["ArrowUp", "PageDown", "End"], no = [...eo, ...Be], oo = {
216
+ ltr: [...Me, "ArrowRight"],
217
+ rtl: [...Me, "ArrowLeft"]
218
+ }, to = {
219
+ ltr: ["ArrowLeft"],
220
+ rtl: ["ArrowRight"]
221
+ }, J = "Menu", [z, ro, ao] = Oe(J), [K, Ve] = ae(J, [
222
+ ao,
223
+ Te,
224
+ Ge
225
+ ]), Q = Te(), Ye = Ge(), [je, F] = K(J), [co, ee] = K(J), Xe = (e) => {
226
+ const { __scopeMenu: o, open: n = !1, children: t, dir: r, onOpenChange: s, modal: l = !0 } = e, d = Q(o), [m, f] = a.useState(null), i = a.useRef(!1), u = ce(s), v = Fe(r);
227
+ return a.useEffect(() => {
228
+ const _ = () => {
229
+ i.current = !0, document.addEventListener("pointerdown", w, { capture: !0, once: !0 }), document.addEventListener("pointermove", w, { capture: !0, once: !0 });
230
+ }, w = () => i.current = !1;
231
+ return document.addEventListener("keydown", _, { capture: !0 }), () => {
232
+ document.removeEventListener("keydown", _, { capture: !0 }), document.removeEventListener("pointerdown", w, { capture: !0 }), document.removeEventListener("pointermove", w, { capture: !0 });
233
+ };
234
+ }, []), /* @__PURE__ */ c(xe, { ...d, children: /* @__PURE__ */ c(
235
+ je,
236
+ {
237
+ scope: o,
238
+ open: n,
239
+ onOpenChange: u,
240
+ content: m,
241
+ onContentChange: f,
242
+ children: /* @__PURE__ */ c(
243
+ co,
244
+ {
245
+ scope: o,
246
+ onClose: a.useCallback(() => u(!1), [u]),
247
+ isUsingKeyboardRef: i,
248
+ dir: v,
249
+ modal: l,
250
+ children: t
251
+ }
252
+ )
253
+ }
254
+ ) });
255
+ };
256
+ Xe.displayName = J;
257
+ var so = "MenuAnchor", Ce = a.forwardRef(
258
+ (e, o) => {
259
+ const { __scopeMenu: n, ...t } = e, r = Q(n);
260
+ return /* @__PURE__ */ c(xn, { ...r, ...t, ref: o });
261
+ }
262
+ );
263
+ Ce.displayName = so;
264
+ var he = "MenuPortal", [uo, He] = K(he, {
265
+ forceMount: void 0
266
+ }), We = (e) => {
267
+ const { __scopeMenu: o, forceMount: n, children: t, container: r } = e, s = F(he, o);
268
+ return /* @__PURE__ */ c(uo, { scope: o, forceMount: n, children: /* @__PURE__ */ c(se, { present: n || s.open, children: /* @__PURE__ */ c(Gn, { asChild: !0, container: r, children: t }) }) });
269
+ };
270
+ We.displayName = he;
271
+ var P = "MenuContent", [io, _e] = K(P), ze = a.forwardRef(
272
+ (e, o) => {
273
+ const n = He(P, e.__scopeMenu), { forceMount: t = n.forceMount, ...r } = e, s = F(P, e.__scopeMenu), l = ee(P, e.__scopeMenu);
274
+ return /* @__PURE__ */ c(z.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ c(se, { present: t || s.open, children: /* @__PURE__ */ c(z.Slot, { scope: e.__scopeMenu, children: l.modal ? /* @__PURE__ */ c(lo, { ...r, ref: o }) : /* @__PURE__ */ c(po, { ...r, ref: o }) }) }) });
275
+ }
276
+ ), lo = a.forwardRef(
277
+ (e, o) => {
278
+ const n = F(P, e.__scopeMenu), t = a.useRef(null), r = A(o, t);
279
+ return a.useEffect(() => {
280
+ const s = t.current;
281
+ if (s) return Ln(s);
282
+ }, []), /* @__PURE__ */ c(
283
+ Re,
284
+ {
285
+ ...e,
286
+ ref: r,
287
+ trapFocus: n.open,
288
+ disableOutsidePointerEvents: n.open,
289
+ disableOutsideScroll: !0,
290
+ onFocusOutside: g(
291
+ e.onFocusOutside,
292
+ (s) => s.preventDefault(),
293
+ { checkForDefaultPrevented: !1 }
294
+ ),
295
+ onDismiss: () => n.onOpenChange(!1)
296
+ }
297
+ );
298
+ }
299
+ ), po = a.forwardRef((e, o) => {
300
+ const n = F(P, e.__scopeMenu);
301
+ return /* @__PURE__ */ c(
302
+ Re,
303
+ {
304
+ ...e,
305
+ ref: o,
306
+ trapFocus: !1,
307
+ disableOutsidePointerEvents: !1,
308
+ disableOutsideScroll: !1,
309
+ onDismiss: () => n.onOpenChange(!1)
310
+ }
311
+ );
312
+ }), fo = me("MenuContent.ScrollLock"), Re = a.forwardRef(
313
+ (e, o) => {
314
+ const {
315
+ __scopeMenu: n,
316
+ loop: t = !1,
317
+ trapFocus: r,
318
+ onOpenAutoFocus: s,
319
+ onCloseAutoFocus: l,
320
+ disableOutsidePointerEvents: d,
321
+ onEntryFocus: m,
322
+ onEscapeKeyDown: f,
323
+ onPointerDownOutside: i,
324
+ onFocusOutside: u,
325
+ onInteractOutside: v,
326
+ onDismiss: _,
327
+ disableOutsideScroll: w,
328
+ ...R
329
+ } = e, M = F(P, n), C = ee(P, n), E = Q(n), h = Ye(n), I = ro(n), [N, y] = a.useState(null), T = a.useRef(null), b = A(o, T, M.onContentChange), $ = a.useRef(0), k = a.useRef(""), V = a.useRef(0), Y = a.useRef(null), ne = a.useRef("right"), oe = a.useRef(0), le = w ? An : a.Fragment, x = w ? { as: fo, allowPinchZoom: !0 } : void 0, Tn = (p) => {
330
+ const B = k.current + p, G = I().filter((D) => !D.disabled), j = document.activeElement, de = G.find((D) => D.ref.current === j)?.textValue, pe = G.map((D) => D.textValue), De = bo(pe, B, de), X = G.find((D) => D.textValue === De)?.ref.current;
331
+ (function D(Pe) {
332
+ k.current = Pe, window.clearTimeout($.current), Pe !== "" && ($.current = window.setTimeout(() => D(""), 1e3));
333
+ })(B), X && setTimeout(() => X.focus());
334
+ };
335
+ a.useEffect(() => () => window.clearTimeout($.current), []), Nn();
336
+ const U = a.useCallback((p) => ne.current === Y.current?.side && Do(p, Y.current?.area), []);
337
+ return /* @__PURE__ */ c(
338
+ io,
339
+ {
340
+ scope: n,
341
+ searchRef: k,
342
+ onItemEnter: a.useCallback(
343
+ (p) => {
344
+ U(p) && p.preventDefault();
345
+ },
346
+ [U]
347
+ ),
348
+ onItemLeave: a.useCallback(
349
+ (p) => {
350
+ U(p) || (T.current?.focus(), y(null));
351
+ },
352
+ [U]
353
+ ),
354
+ onTriggerLeave: a.useCallback(
355
+ (p) => {
356
+ U(p) && p.preventDefault();
357
+ },
358
+ [U]
359
+ ),
360
+ pointerGraceTimerRef: V,
361
+ onPointerGraceIntentChange: a.useCallback((p) => {
362
+ Y.current = p;
363
+ }, []),
364
+ children: /* @__PURE__ */ c(le, { ...x, children: /* @__PURE__ */ c(
365
+ On,
366
+ {
367
+ asChild: !0,
368
+ trapped: r,
369
+ onMountAutoFocus: g(s, (p) => {
370
+ p.preventDefault(), T.current?.focus({ preventScroll: !0 });
371
+ }),
372
+ onUnmountAutoFocus: l,
373
+ children: /* @__PURE__ */ c(
374
+ Fn,
375
+ {
376
+ asChild: !0,
377
+ disableOutsidePointerEvents: d,
378
+ onEscapeKeyDown: f,
379
+ onPointerDownOutside: i,
380
+ onFocusOutside: u,
381
+ onInteractOutside: v,
382
+ onDismiss: _,
383
+ children: /* @__PURE__ */ c(
384
+ Jn,
385
+ {
386
+ asChild: !0,
387
+ ...h,
388
+ dir: C.dir,
389
+ orientation: "vertical",
390
+ loop: t,
391
+ currentTabStopId: N,
392
+ onCurrentTabStopIdChange: y,
393
+ onEntryFocus: g(m, (p) => {
394
+ C.isUsingKeyboardRef.current || p.preventDefault();
395
+ }),
396
+ preventScrollOnEntryFocus: !0,
397
+ children: /* @__PURE__ */ c(
398
+ kn,
399
+ {
400
+ role: "menu",
401
+ "aria-orientation": "vertical",
402
+ "data-state": fn(M.open),
403
+ "data-radix-menu-content": "",
404
+ dir: C.dir,
405
+ ...E,
406
+ ...R,
407
+ ref: b,
408
+ style: { outline: "none", ...R.style },
409
+ onKeyDown: g(R.onKeyDown, (p) => {
410
+ const G = p.target.closest("[data-radix-menu-content]") === p.currentTarget, j = p.ctrlKey || p.altKey || p.metaKey, de = p.key.length === 1;
411
+ G && (p.key === "Tab" && p.preventDefault(), !j && de && Tn(p.key));
412
+ const pe = T.current;
413
+ if (p.target !== pe || !no.includes(p.key)) return;
414
+ p.preventDefault();
415
+ const X = I().filter((D) => !D.disabled).map((D) => D.ref.current);
416
+ Be.includes(p.key) && X.reverse(), Io(X);
417
+ }),
418
+ onBlur: g(e.onBlur, (p) => {
419
+ p.currentTarget.contains(p.target) || (window.clearTimeout($.current), k.current = "");
420
+ }),
421
+ onPointerMove: g(
422
+ e.onPointerMove,
423
+ q((p) => {
424
+ const B = p.target, G = oe.current !== p.clientX;
425
+ if (p.currentTarget.contains(B) && G) {
426
+ const j = p.clientX > oe.current ? "right" : "left";
427
+ ne.current = j, oe.current = p.clientX;
428
+ }
429
+ })
430
+ )
431
+ }
432
+ )
433
+ }
434
+ )
435
+ }
436
+ )
437
+ }
438
+ ) })
439
+ }
440
+ );
441
+ }
442
+ );
443
+ ze.displayName = P;
444
+ var mo = "MenuGroup", Ie = a.forwardRef(
445
+ (e, o) => {
446
+ const { __scopeMenu: n, ...t } = e;
447
+ return /* @__PURE__ */ c(O.div, { role: "group", ...t, ref: o });
448
+ }
449
+ );
450
+ Ie.displayName = mo;
451
+ var vo = "MenuLabel", qe = a.forwardRef(
452
+ (e, o) => {
453
+ const { __scopeMenu: n, ...t } = e;
454
+ return /* @__PURE__ */ c(O.div, { ...t, ref: o });
455
+ }
456
+ );
457
+ qe.displayName = vo;
458
+ var te = "MenuItem", ye = "menu.itemSelect", ue = a.forwardRef(
459
+ (e, o) => {
460
+ const { disabled: n = !1, onSelect: t, ...r } = e, s = a.useRef(null), l = ee(te, e.__scopeMenu), d = _e(te, e.__scopeMenu), m = A(o, s), f = a.useRef(!1), i = () => {
461
+ const u = s.current;
462
+ if (!n && u) {
463
+ const v = new CustomEvent(ye, { bubbles: !0, cancelable: !0 });
464
+ u.addEventListener(ye, (_) => t?.(_), { once: !0 }), Kn(u, v), v.defaultPrevented ? f.current = !1 : l.onClose();
465
+ }
466
+ };
467
+ return /* @__PURE__ */ c(
468
+ Ze,
469
+ {
470
+ ...r,
471
+ ref: m,
472
+ disabled: n,
473
+ onClick: g(e.onClick, i),
474
+ onPointerDown: (u) => {
475
+ e.onPointerDown?.(u), f.current = !0;
476
+ },
477
+ onPointerUp: g(e.onPointerUp, (u) => {
478
+ f.current || u.currentTarget?.click();
479
+ }),
480
+ onKeyDown: g(e.onKeyDown, (u) => {
481
+ const v = d.searchRef.current !== "";
482
+ n || v && u.key === " " || Me.includes(u.key) && (u.currentTarget.click(), u.preventDefault());
483
+ })
484
+ }
485
+ );
486
+ }
487
+ );
488
+ ue.displayName = te;
489
+ var Ze = a.forwardRef(
490
+ (e, o) => {
491
+ const { __scopeMenu: n, disabled: t = !1, textValue: r, ...s } = e, l = _e(te, n), d = Ye(n), m = a.useRef(null), f = A(o, m), [i, u] = a.useState(!1), [v, _] = a.useState("");
492
+ return a.useEffect(() => {
493
+ const w = m.current;
494
+ w && _((w.textContent ?? "").trim());
495
+ }, [s.children]), /* @__PURE__ */ c(
496
+ z.ItemSlot,
497
+ {
498
+ scope: n,
499
+ disabled: t,
500
+ textValue: r ?? v,
501
+ children: /* @__PURE__ */ c(Qn, { asChild: !0, ...d, focusable: !t, children: /* @__PURE__ */ c(
502
+ O.div,
503
+ {
504
+ role: "menuitem",
505
+ "data-highlighted": i ? "" : void 0,
506
+ "aria-disabled": t || void 0,
507
+ "data-disabled": t ? "" : void 0,
508
+ ...s,
509
+ ref: f,
510
+ onPointerMove: g(
511
+ e.onPointerMove,
512
+ q((w) => {
513
+ t ? l.onItemLeave(w) : (l.onItemEnter(w), w.defaultPrevented || w.currentTarget.focus({ preventScroll: !0 }));
514
+ })
515
+ ),
516
+ onPointerLeave: g(
517
+ e.onPointerLeave,
518
+ q((w) => l.onItemLeave(w))
519
+ ),
520
+ onFocus: g(e.onFocus, () => u(!0)),
521
+ onBlur: g(e.onBlur, () => u(!1))
522
+ }
523
+ ) })
524
+ }
525
+ );
526
+ }
527
+ ), Mo = "MenuCheckboxItem", Je = a.forwardRef(
528
+ (e, o) => {
529
+ const { checked: n = !1, onCheckedChange: t, ...r } = e;
530
+ return /* @__PURE__ */ c(tn, { scope: e.__scopeMenu, checked: n, children: /* @__PURE__ */ c(
531
+ ue,
532
+ {
533
+ role: "menuitemcheckbox",
534
+ "aria-checked": re(n) ? "mixed" : n,
535
+ ...r,
536
+ ref: o,
537
+ "data-state": Ee(n),
538
+ onSelect: g(
539
+ r.onSelect,
540
+ () => t?.(re(n) ? !0 : !n),
541
+ { checkForDefaultPrevented: !1 }
542
+ )
543
+ }
544
+ ) });
545
+ }
546
+ );
547
+ Je.displayName = Mo;
548
+ var Qe = "MenuRadioGroup", [go, wo] = K(
549
+ Qe,
550
+ { value: void 0, onValueChange: () => {
551
+ } }
552
+ ), en = a.forwardRef(
553
+ (e, o) => {
554
+ const { value: n, onValueChange: t, ...r } = e, s = ce(t);
555
+ return /* @__PURE__ */ c(go, { scope: e.__scopeMenu, value: n, onValueChange: s, children: /* @__PURE__ */ c(Ie, { ...r, ref: o }) });
556
+ }
557
+ );
558
+ en.displayName = Qe;
559
+ var nn = "MenuRadioItem", on = a.forwardRef(
560
+ (e, o) => {
561
+ const { value: n, ...t } = e, r = wo(nn, e.__scopeMenu), s = n === r.value;
562
+ return /* @__PURE__ */ c(tn, { scope: e.__scopeMenu, checked: s, children: /* @__PURE__ */ c(
563
+ ue,
564
+ {
565
+ role: "menuitemradio",
566
+ "aria-checked": s,
567
+ ...t,
568
+ ref: o,
569
+ "data-state": Ee(s),
570
+ onSelect: g(
571
+ t.onSelect,
572
+ () => r.onValueChange?.(n),
573
+ { checkForDefaultPrevented: !1 }
574
+ )
575
+ }
576
+ ) });
577
+ }
578
+ );
579
+ on.displayName = nn;
580
+ var Se = "MenuItemIndicator", [tn, Co] = K(
581
+ Se,
582
+ { checked: !1 }
583
+ ), rn = a.forwardRef(
584
+ (e, o) => {
585
+ const { __scopeMenu: n, forceMount: t, ...r } = e, s = Co(Se, n);
586
+ return /* @__PURE__ */ c(
587
+ se,
588
+ {
589
+ present: t || re(s.checked) || s.checked === !0,
590
+ children: /* @__PURE__ */ c(
591
+ O.span,
592
+ {
593
+ ...r,
594
+ ref: o,
595
+ "data-state": Ee(s.checked)
596
+ }
597
+ )
598
+ }
599
+ );
600
+ }
601
+ );
602
+ rn.displayName = Se;
603
+ var ho = "MenuSeparator", an = a.forwardRef(
604
+ (e, o) => {
605
+ const { __scopeMenu: n, ...t } = e;
606
+ return /* @__PURE__ */ c(
607
+ O.div,
608
+ {
609
+ role: "separator",
610
+ "aria-orientation": "horizontal",
611
+ ...t,
612
+ ref: o
613
+ }
614
+ );
615
+ }
616
+ );
617
+ an.displayName = ho;
618
+ var _o = "MenuArrow", cn = a.forwardRef(
619
+ (e, o) => {
620
+ const { __scopeMenu: n, ...t } = e, r = Q(n);
621
+ return /* @__PURE__ */ c($n, { ...r, ...t, ref: o });
622
+ }
623
+ );
624
+ cn.displayName = _o;
625
+ var be = "MenuSub", [Ro, sn] = K(be), un = (e) => {
626
+ const { __scopeMenu: o, children: n, open: t = !1, onOpenChange: r } = e, s = F(be, o), l = Q(o), [d, m] = a.useState(null), [f, i] = a.useState(null), u = ce(r);
627
+ return a.useEffect(() => (s.open === !1 && u(!1), () => u(!1)), [s.open, u]), /* @__PURE__ */ c(xe, { ...l, children: /* @__PURE__ */ c(
628
+ je,
629
+ {
630
+ scope: o,
631
+ open: t,
632
+ onOpenChange: u,
633
+ content: f,
634
+ onContentChange: i,
635
+ children: /* @__PURE__ */ c(
636
+ Ro,
637
+ {
638
+ scope: o,
639
+ contentId: W(),
640
+ triggerId: W(),
641
+ trigger: d,
642
+ onTriggerChange: m,
643
+ children: n
644
+ }
645
+ )
646
+ }
647
+ ) });
648
+ };
649
+ un.displayName = be;
650
+ var H = "MenuSubTrigger", ln = a.forwardRef(
651
+ (e, o) => {
652
+ const n = F(H, e.__scopeMenu), t = ee(H, e.__scopeMenu), r = sn(H, e.__scopeMenu), s = _e(H, e.__scopeMenu), l = a.useRef(null), { pointerGraceTimerRef: d, onPointerGraceIntentChange: m } = s, f = { __scopeMenu: e.__scopeMenu }, i = a.useCallback(() => {
653
+ l.current && window.clearTimeout(l.current), l.current = null;
654
+ }, []);
655
+ return a.useEffect(() => i, [i]), a.useEffect(() => {
656
+ const u = d.current;
657
+ return () => {
658
+ window.clearTimeout(u), m(null);
659
+ };
660
+ }, [d, m]), /* @__PURE__ */ c(Ce, { asChild: !0, ...f, children: /* @__PURE__ */ c(
661
+ Ze,
662
+ {
663
+ id: r.triggerId,
664
+ "aria-haspopup": "menu",
665
+ "aria-expanded": n.open,
666
+ "aria-controls": r.contentId,
667
+ "data-state": fn(n.open),
668
+ ...e,
669
+ ref: Ne(o, r.onTriggerChange),
670
+ onClick: (u) => {
671
+ e.onClick?.(u), !(e.disabled || u.defaultPrevented) && (u.currentTarget.focus(), n.open || n.onOpenChange(!0));
672
+ },
673
+ onPointerMove: g(
674
+ e.onPointerMove,
675
+ q((u) => {
676
+ s.onItemEnter(u), !u.defaultPrevented && !e.disabled && !n.open && !l.current && (s.onPointerGraceIntentChange(null), l.current = window.setTimeout(() => {
677
+ n.onOpenChange(!0), i();
678
+ }, 100));
679
+ })
680
+ ),
681
+ onPointerLeave: g(
682
+ e.onPointerLeave,
683
+ q((u) => {
684
+ i();
685
+ const v = n.content?.getBoundingClientRect();
686
+ if (v) {
687
+ const _ = n.content?.dataset.side, w = _ === "right", R = w ? -5 : 5, M = v[w ? "left" : "right"], C = v[w ? "right" : "left"];
688
+ s.onPointerGraceIntentChange({
689
+ area: [
690
+ // Apply a bleed on clientX to ensure that our exit point is
691
+ // consistently within polygon bounds
692
+ { x: u.clientX + R, y: u.clientY },
693
+ { x: M, y: v.top },
694
+ { x: C, y: v.top },
695
+ { x: C, y: v.bottom },
696
+ { x: M, y: v.bottom }
697
+ ],
698
+ side: _
699
+ }), window.clearTimeout(d.current), d.current = window.setTimeout(
700
+ () => s.onPointerGraceIntentChange(null),
701
+ 300
702
+ );
703
+ } else {
704
+ if (s.onTriggerLeave(u), u.defaultPrevented) return;
705
+ s.onPointerGraceIntentChange(null);
706
+ }
707
+ })
708
+ ),
709
+ onKeyDown: g(e.onKeyDown, (u) => {
710
+ const v = s.searchRef.current !== "";
711
+ e.disabled || v && u.key === " " || oo[t.dir].includes(u.key) && (n.onOpenChange(!0), n.content?.focus(), u.preventDefault());
712
+ })
713
+ }
714
+ ) });
715
+ }
716
+ );
717
+ ln.displayName = H;
718
+ var dn = "MenuSubContent", pn = a.forwardRef(
719
+ (e, o) => {
720
+ const n = He(P, e.__scopeMenu), { forceMount: t = n.forceMount, ...r } = e, s = F(P, e.__scopeMenu), l = ee(P, e.__scopeMenu), d = sn(dn, e.__scopeMenu), m = a.useRef(null), f = A(o, m);
721
+ return /* @__PURE__ */ c(z.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ c(se, { present: t || s.open, children: /* @__PURE__ */ c(z.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ c(
722
+ Re,
723
+ {
724
+ id: d.contentId,
725
+ "aria-labelledby": d.triggerId,
726
+ ...r,
727
+ ref: f,
728
+ align: "start",
729
+ side: l.dir === "rtl" ? "left" : "right",
730
+ disableOutsidePointerEvents: !1,
731
+ disableOutsideScroll: !1,
732
+ trapFocus: !1,
733
+ onOpenAutoFocus: (i) => {
734
+ l.isUsingKeyboardRef.current && m.current?.focus(), i.preventDefault();
735
+ },
736
+ onCloseAutoFocus: (i) => i.preventDefault(),
737
+ onFocusOutside: g(e.onFocusOutside, (i) => {
738
+ i.target !== d.trigger && s.onOpenChange(!1);
739
+ }),
740
+ onEscapeKeyDown: g(e.onEscapeKeyDown, (i) => {
741
+ l.onClose(), i.preventDefault();
742
+ }),
743
+ onKeyDown: g(e.onKeyDown, (i) => {
744
+ const u = i.currentTarget.contains(i.target), v = to[l.dir].includes(i.key);
745
+ u && v && (s.onOpenChange(!1), d.trigger?.focus(), i.preventDefault());
746
+ })
747
+ }
748
+ ) }) }) });
749
+ }
750
+ );
751
+ pn.displayName = dn;
752
+ function fn(e) {
753
+ return e ? "open" : "closed";
754
+ }
755
+ function re(e) {
756
+ return e === "indeterminate";
757
+ }
758
+ function Ee(e) {
759
+ return re(e) ? "indeterminate" : e ? "checked" : "unchecked";
760
+ }
761
+ function Io(e) {
762
+ const o = document.activeElement;
763
+ for (const n of e)
764
+ if (n === o || (n.focus(), document.activeElement !== o)) return;
765
+ }
766
+ function So(e, o) {
767
+ return e.map((n, t) => e[(o + t) % e.length]);
768
+ }
769
+ function bo(e, o, n) {
770
+ const r = o.length > 1 && Array.from(o).every((f) => f === o[0]) ? o[0] : o, s = n ? e.indexOf(n) : -1;
771
+ let l = So(e, Math.max(s, 0));
772
+ r.length === 1 && (l = l.filter((f) => f !== n));
773
+ const m = l.find(
774
+ (f) => f.toLowerCase().startsWith(r.toLowerCase())
775
+ );
776
+ return m !== n ? m : void 0;
777
+ }
778
+ function Eo(e, o) {
779
+ const { x: n, y: t } = e;
780
+ let r = !1;
781
+ for (let s = 0, l = o.length - 1; s < o.length; l = s++) {
782
+ const d = o[s], m = o[l], f = d.x, i = d.y, u = m.x, v = m.y;
783
+ i > t != v > t && n < (u - f) * (t - i) / (v - i) + f && (r = !r);
784
+ }
785
+ return r;
786
+ }
787
+ function Do(e, o) {
788
+ if (!o) return !1;
789
+ const n = { x: e.clientX, y: e.clientY };
790
+ return Eo(n, o);
791
+ }
792
+ function q(e) {
793
+ return (o) => o.pointerType === "mouse" ? e(o) : void 0;
794
+ }
795
+ var Po = Xe, yo = Ce, To = We, xo = ze, No = Ie, Ao = qe, Oo = ue, Fo = Je, ko = en, Go = on, Lo = rn, Ko = an, $o = cn, Uo = un, Bo = ln, Vo = pn, ie = "DropdownMenu", [Yo] = ae(
796
+ ie,
797
+ [Ve]
798
+ ), S = Ve(), [jo, mn] = Yo(ie), vn = (e) => {
799
+ const {
800
+ __scopeDropdownMenu: o,
801
+ children: n,
802
+ dir: t,
803
+ open: r,
804
+ defaultOpen: s,
805
+ onOpenChange: l,
806
+ modal: d = !0
807
+ } = e, m = S(o), f = a.useRef(null), [i, u] = we({
808
+ prop: r,
809
+ defaultProp: s ?? !1,
810
+ onChange: l,
811
+ caller: ie
812
+ });
813
+ return /* @__PURE__ */ c(
814
+ jo,
815
+ {
816
+ scope: o,
817
+ triggerId: W(),
818
+ triggerRef: f,
819
+ contentId: W(),
820
+ open: i,
821
+ onOpenChange: u,
822
+ onOpenToggle: a.useCallback(() => u((v) => !v), [u]),
823
+ modal: d,
824
+ children: /* @__PURE__ */ c(Po, { ...m, open: i, onOpenChange: u, dir: t, modal: d, children: n })
825
+ }
826
+ );
827
+ };
828
+ vn.displayName = ie;
829
+ var Mn = "DropdownMenuTrigger", gn = a.forwardRef(
830
+ (e, o) => {
831
+ const { __scopeDropdownMenu: n, disabled: t = !1, ...r } = e, s = mn(Mn, n), l = S(n);
832
+ return /* @__PURE__ */ c(yo, { asChild: !0, ...l, children: /* @__PURE__ */ c(
833
+ O.button,
834
+ {
835
+ type: "button",
836
+ id: s.triggerId,
837
+ "aria-haspopup": "menu",
838
+ "aria-expanded": s.open,
839
+ "aria-controls": s.open ? s.contentId : void 0,
840
+ "data-state": s.open ? "open" : "closed",
841
+ "data-disabled": t ? "" : void 0,
842
+ disabled: t,
843
+ ...r,
844
+ ref: Ne(o, s.triggerRef),
845
+ onPointerDown: g(e.onPointerDown, (d) => {
846
+ !t && d.button === 0 && d.ctrlKey === !1 && (s.onOpenToggle(), s.open || d.preventDefault());
847
+ }),
848
+ onKeyDown: g(e.onKeyDown, (d) => {
849
+ t || (["Enter", " "].includes(d.key) && s.onOpenToggle(), d.key === "ArrowDown" && s.onOpenChange(!0), ["Enter", " ", "ArrowDown"].includes(d.key) && d.preventDefault());
850
+ })
851
+ }
852
+ ) });
853
+ }
854
+ );
855
+ gn.displayName = Mn;
856
+ var Xo = "DropdownMenuPortal", wn = (e) => {
857
+ const { __scopeDropdownMenu: o, ...n } = e, t = S(o);
858
+ return /* @__PURE__ */ c(To, { ...t, ...n });
859
+ };
860
+ wn.displayName = Xo;
861
+ var Cn = "DropdownMenuContent", hn = a.forwardRef(
862
+ (e, o) => {
863
+ const { __scopeDropdownMenu: n, ...t } = e, r = mn(Cn, n), s = S(n), l = a.useRef(!1);
864
+ return /* @__PURE__ */ c(
865
+ xo,
866
+ {
867
+ id: r.contentId,
868
+ "aria-labelledby": r.triggerId,
869
+ ...s,
870
+ ...t,
871
+ ref: o,
872
+ onCloseAutoFocus: g(e.onCloseAutoFocus, (d) => {
873
+ l.current || r.triggerRef.current?.focus(), l.current = !1, d.preventDefault();
874
+ }),
875
+ onInteractOutside: g(e.onInteractOutside, (d) => {
876
+ const m = d.detail.originalEvent, f = m.button === 0 && m.ctrlKey === !0, i = m.button === 2 || f;
877
+ (!r.modal || i) && (l.current = !0);
878
+ }),
879
+ style: {
880
+ ...e.style,
881
+ "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
882
+ "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
883
+ "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
884
+ "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
885
+ "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
886
+ }
887
+ }
888
+ );
889
+ }
890
+ );
891
+ hn.displayName = Cn;
892
+ var Ho = "DropdownMenuGroup", _n = a.forwardRef(
893
+ (e, o) => {
894
+ const { __scopeDropdownMenu: n, ...t } = e, r = S(n);
895
+ return /* @__PURE__ */ c(No, { ...r, ...t, ref: o });
896
+ }
897
+ );
898
+ _n.displayName = Ho;
899
+ var Wo = "DropdownMenuLabel", zo = a.forwardRef(
900
+ (e, o) => {
901
+ const { __scopeDropdownMenu: n, ...t } = e, r = S(n);
902
+ return /* @__PURE__ */ c(Ao, { ...r, ...t, ref: o });
903
+ }
904
+ );
905
+ zo.displayName = Wo;
906
+ var qo = "DropdownMenuItem", Rn = a.forwardRef(
907
+ (e, o) => {
908
+ const { __scopeDropdownMenu: n, ...t } = e, r = S(n);
909
+ return /* @__PURE__ */ c(Oo, { ...r, ...t, ref: o });
910
+ }
911
+ );
912
+ Rn.displayName = qo;
913
+ var Zo = "DropdownMenuCheckboxItem", Jo = a.forwardRef((e, o) => {
914
+ const { __scopeDropdownMenu: n, ...t } = e, r = S(n);
915
+ return /* @__PURE__ */ c(Fo, { ...r, ...t, ref: o });
916
+ });
917
+ Jo.displayName = Zo;
918
+ var Qo = "DropdownMenuRadioGroup", In = a.forwardRef((e, o) => {
919
+ const { __scopeDropdownMenu: n, ...t } = e, r = S(n);
920
+ return /* @__PURE__ */ c(ko, { ...r, ...t, ref: o });
921
+ });
922
+ In.displayName = Qo;
923
+ var et = "DropdownMenuRadioItem", nt = a.forwardRef((e, o) => {
924
+ const { __scopeDropdownMenu: n, ...t } = e, r = S(n);
925
+ return /* @__PURE__ */ c(Go, { ...r, ...t, ref: o });
926
+ });
927
+ nt.displayName = et;
928
+ var ot = "DropdownMenuItemIndicator", tt = a.forwardRef((e, o) => {
929
+ const { __scopeDropdownMenu: n, ...t } = e, r = S(n);
930
+ return /* @__PURE__ */ c(Lo, { ...r, ...t, ref: o });
931
+ });
932
+ tt.displayName = ot;
933
+ var rt = "DropdownMenuSeparator", at = a.forwardRef((e, o) => {
934
+ const { __scopeDropdownMenu: n, ...t } = e, r = S(n);
935
+ return /* @__PURE__ */ c(Ko, { ...r, ...t, ref: o });
936
+ });
937
+ at.displayName = rt;
938
+ var ct = "DropdownMenuArrow", st = a.forwardRef(
939
+ (e, o) => {
940
+ const { __scopeDropdownMenu: n, ...t } = e, r = S(n);
941
+ return /* @__PURE__ */ c($o, { ...r, ...t, ref: o });
942
+ }
943
+ );
944
+ st.displayName = ct;
945
+ var ut = (e) => {
946
+ const { __scopeDropdownMenu: o, children: n, open: t, onOpenChange: r, defaultOpen: s } = e, l = S(o), [d, m] = we({
947
+ prop: t,
948
+ defaultProp: s ?? !1,
949
+ onChange: r,
950
+ caller: "DropdownMenuSub"
951
+ });
952
+ return /* @__PURE__ */ c(Uo, { ...l, open: d, onOpenChange: m, children: n });
953
+ }, it = "DropdownMenuSubTrigger", Sn = a.forwardRef((e, o) => {
954
+ const { __scopeDropdownMenu: n, ...t } = e, r = S(n);
955
+ return /* @__PURE__ */ c(Bo, { ...r, ...t, ref: o });
956
+ });
957
+ Sn.displayName = it;
958
+ var lt = "DropdownMenuSubContent", bn = a.forwardRef((e, o) => {
959
+ const { __scopeDropdownMenu: n, ...t } = e, r = S(n);
960
+ return /* @__PURE__ */ c(
961
+ Vo,
962
+ {
963
+ ...r,
964
+ ...t,
965
+ ref: o,
966
+ style: {
967
+ ...e.style,
968
+ "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
969
+ "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
970
+ "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
971
+ "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
972
+ "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
973
+ }
974
+ }
975
+ );
976
+ });
977
+ bn.displayName = lt;
978
+ var dt = vn, En = gn, pt = wn, Dn = hn, ft = _n, mt = Rn, vt = In, Mt = ut, gt = Sn, Pn = bn;
979
+ function bt({
980
+ ...e
981
+ }) {
982
+ return /* @__PURE__ */ c(dt, { modal: !1, ...e });
983
+ }
984
+ function yn({
985
+ ...e
986
+ }) {
987
+ return /* @__PURE__ */ c(pt, { ...e });
988
+ }
989
+ const wt = ge(({ ...e }, o) => /* @__PURE__ */ c(En, { ref: o, ...e }));
990
+ wt.displayName = En.displayName;
991
+ const Et = ft, Dt = Mt, Pt = vt, yt = mt, Tt = gt, Ct = ge(({ className: e, portal: o = !0, ...n }, t) => {
992
+ const r = /* @__PURE__ */ c(
993
+ Pn,
994
+ {
995
+ ref: t,
996
+ className: Ae("tiptap-dropdown-menu", e),
997
+ ...n
998
+ }
999
+ );
1000
+ return o ? /* @__PURE__ */ c(yn, { ...typeof o == "object" ? o : {}, children: r }) : r;
1001
+ });
1002
+ Ct.displayName = Pn.displayName;
1003
+ const ht = ge(({ className: e, sideOffset: o = 4, portal: n = !1, ...t }, r) => {
1004
+ const s = /* @__PURE__ */ c(
1005
+ Dn,
1006
+ {
1007
+ ref: r,
1008
+ sideOffset: o,
1009
+ onCloseAutoFocus: (l) => l.preventDefault(),
1010
+ className: Ae("tiptap-dropdown-menu", e),
1011
+ ...t
1012
+ }
1013
+ );
1014
+ return n ? /* @__PURE__ */ c(yn, { ...typeof n == "object" ? n : {}, children: s }) : s;
1015
+ });
1016
+ ht.displayName = Dn.displayName;
1017
+ export {
1018
+ bt as DropdownMenu,
1019
+ ht as DropdownMenuContent,
1020
+ Et as DropdownMenuGroup,
1021
+ yt as DropdownMenuItem,
1022
+ yn as DropdownMenuPortal,
1023
+ Pt as DropdownMenuRadioGroup,
1024
+ Dt as DropdownMenuSub,
1025
+ Ct as DropdownMenuSubContent,
1026
+ Tt as DropdownMenuSubTrigger,
1027
+ wt as DropdownMenuTrigger
1028
+ };