@kopexa/tiptap 17.6.18 → 17.7.2

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 (428) hide show
  1. package/dist/index.d.mts +691 -24
  2. package/dist/index.d.ts +691 -24
  3. package/dist/index.js +1478 -786
  4. package/dist/index.mjs +7987 -112
  5. package/package.json +57 -52
  6. package/dist/chunk-2SI7MRAE.mjs +0 -64
  7. package/dist/chunk-2U5CQUZH.mjs +0 -91
  8. package/dist/chunk-2UDCL55K.mjs +0 -55
  9. package/dist/chunk-2V6VOAPI.mjs +0 -139
  10. package/dist/chunk-2Z2QVW67.mjs +0 -1
  11. package/dist/chunk-32SUXCAQ.mjs +0 -115
  12. package/dist/chunk-33QD5PYJ.mjs +0 -63
  13. package/dist/chunk-3VRQUYYW.mjs +0 -169
  14. package/dist/chunk-42HKGCOO.mjs +0 -129
  15. package/dist/chunk-4ALV4UA5.mjs +0 -1
  16. package/dist/chunk-4CDZ547I.mjs +0 -185
  17. package/dist/chunk-4HO7BWDC.mjs +0 -89
  18. package/dist/chunk-4JRYQZ4A.mjs +0 -174
  19. package/dist/chunk-552JLRNB.mjs +0 -35
  20. package/dist/chunk-5SMDMQDF.mjs +0 -34
  21. package/dist/chunk-6552DQWB.mjs +0 -416
  22. package/dist/chunk-7FDDRVUE.mjs +0 -143
  23. package/dist/chunk-7VGROP26.mjs +0 -262
  24. package/dist/chunk-7VW67NVL.mjs +0 -80
  25. package/dist/chunk-AAV7ZNBP.mjs +0 -83
  26. package/dist/chunk-ATRHILCH.mjs +0 -1
  27. package/dist/chunk-B7WJOQ3X.mjs +0 -103
  28. package/dist/chunk-BEV5U2DK.mjs +0 -131
  29. package/dist/chunk-BXHPO3T7.mjs +0 -152
  30. package/dist/chunk-BXJYNSWQ.mjs +0 -30
  31. package/dist/chunk-C5RQWJKE.mjs +0 -155
  32. package/dist/chunk-CNVACBGT.mjs +0 -51
  33. package/dist/chunk-DQK6PA4U.mjs +0 -276
  34. package/dist/chunk-DSBJFMHK.mjs +0 -38
  35. package/dist/chunk-DT7ML2P4.mjs +0 -42
  36. package/dist/chunk-DZLGLP7R.mjs +0 -99
  37. package/dist/chunk-EAAQE5ZV.mjs +0 -283
  38. package/dist/chunk-EHY2NAW7.mjs +0 -120
  39. package/dist/chunk-EIIWU5FR.mjs +0 -61
  40. package/dist/chunk-ERPGWXFK.mjs +0 -163
  41. package/dist/chunk-F73FCUD5.mjs +0 -1
  42. package/dist/chunk-FRJX2F4T.mjs +0 -55
  43. package/dist/chunk-GYIYX2JH.mjs +0 -73
  44. package/dist/chunk-H6LC4LDQ.mjs +0 -63
  45. package/dist/chunk-H7MS2UMO.mjs +0 -168
  46. package/dist/chunk-HLLA2HRV.mjs +0 -1
  47. package/dist/chunk-HTJ2RXOG.mjs +0 -32
  48. package/dist/chunk-IFXRPGIJ.mjs +0 -98
  49. package/dist/chunk-IOB3REX6.mjs +0 -173
  50. package/dist/chunk-IQERE7KP.mjs +0 -115
  51. package/dist/chunk-JCV5SEKN.mjs +0 -65
  52. package/dist/chunk-JVSH5T4B.mjs +0 -72
  53. package/dist/chunk-KK4K43WM.mjs +0 -59
  54. package/dist/chunk-KR42JAVB.mjs +0 -60
  55. package/dist/chunk-KYLBKQ2E.mjs +0 -203
  56. package/dist/chunk-L5RDMV3H.mjs +0 -216
  57. package/dist/chunk-LNVWG34E.mjs +0 -165
  58. package/dist/chunk-LVNUU67N.mjs +0 -1
  59. package/dist/chunk-MNTOOEHA.mjs +0 -1
  60. package/dist/chunk-N3JE67CS.mjs +0 -81
  61. package/dist/chunk-N4CT5RNC.mjs +0 -123
  62. package/dist/chunk-OEVR5N7X.mjs +0 -65
  63. package/dist/chunk-P55PLOHR.mjs +0 -34
  64. package/dist/chunk-Q5FK7SFY.mjs +0 -75
  65. package/dist/chunk-Q7DFJ5NI.mjs +0 -153
  66. package/dist/chunk-QIELBKP3.mjs +0 -104
  67. package/dist/chunk-R2GM4A3T.mjs +0 -71
  68. package/dist/chunk-REJEJXOZ.mjs +0 -10
  69. package/dist/chunk-RFWNKE7D.mjs +0 -238
  70. package/dist/chunk-TAM3VMJT.mjs +0 -80
  71. package/dist/chunk-TDFS3DCZ.mjs +0 -79
  72. package/dist/chunk-TLM5ALHZ.mjs +0 -1
  73. package/dist/chunk-TZQQ6C2Q.mjs +0 -101
  74. package/dist/chunk-U5XAL46P.mjs +0 -39
  75. package/dist/chunk-UJ4BNZ63.mjs +0 -178
  76. package/dist/chunk-UVHVCION.mjs +0 -168
  77. package/dist/chunk-V6TAZMQN.mjs +0 -105
  78. package/dist/chunk-VF3G2URZ.mjs +0 -83
  79. package/dist/chunk-VRQ6OSAZ.mjs +0 -76
  80. package/dist/chunk-VTKJPVNM.mjs +0 -148
  81. package/dist/chunk-VX3HSJ76.mjs +0 -73
  82. package/dist/chunk-W2FLOOJ6.mjs +0 -75
  83. package/dist/chunk-XGAABDMW.mjs +0 -159
  84. package/dist/chunk-Y2KSWMG5.mjs +0 -1
  85. package/dist/chunk-YJAHZXLG.mjs +0 -92
  86. package/dist/chunk-Z365KVQY.mjs +0 -34
  87. package/dist/chunk-ZVTJ6XD7.mjs +0 -88
  88. package/dist/chunk-ZZ4OU46C.mjs +0 -131
  89. package/dist/context/editor-context.d.mts +0 -10
  90. package/dist/context/editor-context.d.ts +0 -10
  91. package/dist/context/editor-context.js +0 -34
  92. package/dist/context/editor-context.mjs +0 -9
  93. package/dist/context/editor-file-context.d.mts +0 -70
  94. package/dist/context/editor-file-context.d.ts +0 -70
  95. package/dist/context/editor-file-context.js +0 -96
  96. package/dist/context/editor-file-context.mjs +0 -12
  97. package/dist/extensions/callout/callout-settings.d.mts +0 -13
  98. package/dist/extensions/callout/callout-settings.d.ts +0 -13
  99. package/dist/extensions/callout/callout-settings.js +0 -206
  100. package/dist/extensions/callout/callout-settings.mjs +0 -9
  101. package/dist/extensions/callout/callout-view.d.mts +0 -12
  102. package/dist/extensions/callout/callout-view.d.ts +0 -12
  103. package/dist/extensions/callout/callout-view.js +0 -273
  104. package/dist/extensions/callout/callout-view.mjs +0 -12
  105. package/dist/extensions/callout/index.d.mts +0 -44
  106. package/dist/extensions/callout/index.d.ts +0 -44
  107. package/dist/extensions/callout/index.js +0 -380
  108. package/dist/extensions/callout/index.mjs +0 -13
  109. package/dist/extensions/callout/messages.d.mts +0 -59
  110. package/dist/extensions/callout/messages.d.ts +0 -59
  111. package/dist/extensions/callout/messages.js +0 -88
  112. package/dist/extensions/callout/messages.mjs +0 -7
  113. package/dist/extensions/image/image-view.d.mts +0 -15
  114. package/dist/extensions/image/image-view.d.ts +0 -15
  115. package/dist/extensions/image/image-view.js +0 -255
  116. package/dist/extensions/image/image-view.mjs +0 -12
  117. package/dist/extensions/image/index.d.mts +0 -29
  118. package/dist/extensions/image/index.d.ts +0 -29
  119. package/dist/extensions/image/index.js +0 -282
  120. package/dist/extensions/image/index.mjs +0 -16
  121. package/dist/extensions/image/messages.d.mts +0 -28
  122. package/dist/extensions/image/messages.d.ts +0 -28
  123. package/dist/extensions/image/messages.js +0 -57
  124. package/dist/extensions/image/messages.mjs +0 -7
  125. package/dist/extensions/image-upload/image-upload-view.d.mts +0 -12
  126. package/dist/extensions/image-upload/image-upload-view.d.ts +0 -12
  127. package/dist/extensions/image-upload/image-upload-view.js +0 -338
  128. package/dist/extensions/image-upload/image-upload-view.mjs +0 -12
  129. package/dist/extensions/image-upload/index.d.mts +0 -46
  130. package/dist/extensions/image-upload/index.d.ts +0 -46
  131. package/dist/extensions/image-upload/index.js +0 -414
  132. package/dist/extensions/image-upload/index.mjs +0 -16
  133. package/dist/extensions/image-upload/messages.d.mts +0 -32
  134. package/dist/extensions/image-upload/messages.d.ts +0 -32
  135. package/dist/extensions/image-upload/messages.js +0 -61
  136. package/dist/extensions/image-upload/messages.mjs +0 -7
  137. package/dist/extensions/link/index.d.mts +0 -6
  138. package/dist/extensions/link/index.d.ts +0 -6
  139. package/dist/extensions/link/index.js +0 -94
  140. package/dist/extensions/link/index.mjs +0 -7
  141. package/dist/extensions/math/index.d.mts +0 -38
  142. package/dist/extensions/math/index.d.ts +0 -38
  143. package/dist/extensions/math/index.js +0 -544
  144. package/dist/extensions/math/index.mjs +0 -17
  145. package/dist/extensions/math/inline-math-view.d.mts +0 -12
  146. package/dist/extensions/math/inline-math-view.d.ts +0 -12
  147. package/dist/extensions/math/inline-math-view.js +0 -232
  148. package/dist/extensions/math/inline-math-view.mjs +0 -11
  149. package/dist/extensions/math/inline-math.d.mts +0 -32
  150. package/dist/extensions/math/inline-math.d.ts +0 -32
  151. package/dist/extensions/math/inline-math.js +0 -304
  152. package/dist/extensions/math/inline-math.mjs +0 -12
  153. package/dist/extensions/math/math-block-view.d.mts +0 -11
  154. package/dist/extensions/math/math-block-view.d.ts +0 -11
  155. package/dist/extensions/math/math-block-view.js +0 -248
  156. package/dist/extensions/math/math-block-view.mjs +0 -11
  157. package/dist/extensions/math/messages.d.mts +0 -49
  158. package/dist/extensions/math/messages.d.ts +0 -49
  159. package/dist/extensions/math/messages.js +0 -78
  160. package/dist/extensions/math/messages.mjs +0 -7
  161. package/dist/extensions/selection/index.d.mts +0 -5
  162. package/dist/extensions/selection/index.d.ts +0 -5
  163. package/dist/extensions/selection/index.js +0 -62
  164. package/dist/extensions/selection/index.mjs +0 -7
  165. package/dist/extensions/toc/index.d.mts +0 -53
  166. package/dist/extensions/toc/index.d.ts +0 -53
  167. package/dist/extensions/toc/index.js +0 -501
  168. package/dist/extensions/toc/index.mjs +0 -13
  169. package/dist/extensions/toc/messages.d.mts +0 -74
  170. package/dist/extensions/toc/messages.d.ts +0 -74
  171. package/dist/extensions/toc/messages.js +0 -103
  172. package/dist/extensions/toc/messages.mjs +0 -7
  173. package/dist/extensions/toc/toc-settings.d.mts +0 -13
  174. package/dist/extensions/toc/toc-settings.d.ts +0 -13
  175. package/dist/extensions/toc/toc-settings.js +0 -283
  176. package/dist/extensions/toc/toc-settings.mjs +0 -9
  177. package/dist/extensions/toc/toc-view.d.mts +0 -12
  178. package/dist/extensions/toc/toc-view.d.ts +0 -12
  179. package/dist/extensions/toc/toc-view.js +0 -411
  180. package/dist/extensions/toc/toc-view.mjs +0 -12
  181. package/dist/extensions/trailing-node/index.d.mts +0 -9
  182. package/dist/extensions/trailing-node/index.d.ts +0 -9
  183. package/dist/extensions/trailing-node/index.js +0 -86
  184. package/dist/extensions/trailing-node/index.mjs +0 -7
  185. package/dist/extensions/ui-state/index.d.mts +0 -34
  186. package/dist/extensions/ui-state/index.d.ts +0 -34
  187. package/dist/extensions/ui-state/index.js +0 -84
  188. package/dist/extensions/ui-state/index.mjs +0 -9
  189. package/dist/extensions/variable/extract-variables.d.mts +0 -16
  190. package/dist/extensions/variable/extract-variables.d.ts +0 -16
  191. package/dist/extensions/variable/extract-variables.js +0 -58
  192. package/dist/extensions/variable/extract-variables.mjs +0 -7
  193. package/dist/extensions/variable/index.d.mts +0 -38
  194. package/dist/extensions/variable/index.d.ts +0 -38
  195. package/dist/extensions/variable/index.js +0 -190
  196. package/dist/extensions/variable/index.mjs +0 -11
  197. package/dist/extensions/variable/messages.d.mts +0 -69
  198. package/dist/extensions/variable/messages.d.ts +0 -69
  199. package/dist/extensions/variable/messages.js +0 -98
  200. package/dist/extensions/variable/messages.mjs +0 -7
  201. package/dist/extensions/variable/variable-context.d.mts +0 -56
  202. package/dist/extensions/variable/variable-context.d.ts +0 -56
  203. package/dist/extensions/variable/variable-context.js +0 -70
  204. package/dist/extensions/variable/variable-context.mjs +0 -12
  205. package/dist/extensions/variable/variable-filler-dialog.d.mts +0 -43
  206. package/dist/extensions/variable/variable-filler-dialog.d.ts +0 -43
  207. package/dist/extensions/variable/variable-filler-dialog.js +0 -207
  208. package/dist/extensions/variable/variable-filler-dialog.mjs +0 -9
  209. package/dist/extensions/variable/variable-suggestion.d.mts +0 -31
  210. package/dist/extensions/variable/variable-suggestion.d.ts +0 -31
  211. package/dist/extensions/variable/variable-suggestion.js +0 -615
  212. package/dist/extensions/variable/variable-suggestion.mjs +0 -14
  213. package/dist/extensions/variable/variable-view.d.mts +0 -13
  214. package/dist/extensions/variable/variable-view.d.ts +0 -13
  215. package/dist/extensions/variable/variable-view.js +0 -110
  216. package/dist/extensions/variable/variable-view.mjs +0 -11
  217. package/dist/hooks/use-create-editor.d.mts +0 -46
  218. package/dist/hooks/use-create-editor.d.ts +0 -46
  219. package/dist/hooks/use-create-editor.js +0 -2726
  220. package/dist/hooks/use-create-editor.mjs +0 -37
  221. package/dist/hooks/use-cursor-visibility.d.mts +0 -37
  222. package/dist/hooks/use-cursor-visibility.d.ts +0 -37
  223. package/dist/hooks/use-cursor-visibility.js +0 -140
  224. package/dist/hooks/use-cursor-visibility.mjs +0 -8
  225. package/dist/hooks/use-floating-element.d.mts +0 -43
  226. package/dist/hooks/use-floating-element.d.ts +0 -43
  227. package/dist/hooks/use-floating-element.js +0 -88
  228. package/dist/hooks/use-floating-element.mjs +0 -8
  229. package/dist/hooks/use-floating-toolbar-visibility.d.mts +0 -32
  230. package/dist/hooks/use-floating-toolbar-visibility.d.ts +0 -32
  231. package/dist/hooks/use-floating-toolbar-visibility.js +0 -115
  232. package/dist/hooks/use-floating-toolbar-visibility.mjs +0 -13
  233. package/dist/hooks/use-menu-navigation.d.mts +0 -55
  234. package/dist/hooks/use-menu-navigation.d.ts +0 -55
  235. package/dist/hooks/use-menu-navigation.js +0 -163
  236. package/dist/hooks/use-menu-navigation.mjs +0 -8
  237. package/dist/hooks/use-tiptap-editor.d.mts +0 -20
  238. package/dist/hooks/use-tiptap-editor.d.ts +0 -20
  239. package/dist/hooks/use-tiptap-editor.js +0 -58
  240. package/dist/hooks/use-tiptap-editor.mjs +0 -8
  241. package/dist/hooks/use-ui-editor-state.d.mts +0 -7
  242. package/dist/hooks/use-ui-editor-state.d.ts +0 -7
  243. package/dist/hooks/use-ui-editor-state.js +0 -107
  244. package/dist/hooks/use-ui-editor-state.mjs +0 -11
  245. package/dist/hooks/use-window-size.d.mts +0 -12
  246. package/dist/hooks/use-window-size.d.ts +0 -12
  247. package/dist/hooks/use-window-size.js +0 -75
  248. package/dist/hooks/use-window-size.mjs +0 -7
  249. package/dist/presets/basic/editor-header.d.mts +0 -23
  250. package/dist/presets/basic/editor-header.d.ts +0 -23
  251. package/dist/presets/basic/editor-header.js +0 -2750
  252. package/dist/presets/basic/editor-header.mjs +0 -43
  253. package/dist/presets/basic/index.d.mts +0 -38
  254. package/dist/presets/basic/index.d.ts +0 -38
  255. package/dist/presets/basic/index.js +0 -6891
  256. package/dist/presets/basic/index.mjs +0 -85
  257. package/dist/ui/blockquote-button/blockquote-button.d.mts +0 -20
  258. package/dist/ui/blockquote-button/blockquote-button.d.ts +0 -20
  259. package/dist/ui/blockquote-button/blockquote-button.js +0 -247
  260. package/dist/ui/blockquote-button/blockquote-button.mjs +0 -9
  261. package/dist/ui/blockquote-button/index.d.mts +0 -6
  262. package/dist/ui/blockquote-button/index.d.ts +0 -6
  263. package/dist/ui/blockquote-button/index.js +0 -259
  264. package/dist/ui/blockquote-button/index.mjs +0 -21
  265. package/dist/ui/blockquote-button/use-blockquote.d.mts +0 -85
  266. package/dist/ui/blockquote-button/use-blockquote.d.ts +0 -85
  267. package/dist/ui/blockquote-button/use-blockquote.js +0 -192
  268. package/dist/ui/blockquote-button/use-blockquote.mjs +0 -17
  269. package/dist/ui/bubble-menu/index.d.mts +0 -13
  270. package/dist/ui/bubble-menu/index.d.ts +0 -13
  271. package/dist/ui/bubble-menu/index.js +0 -673
  272. package/dist/ui/bubble-menu/index.mjs +0 -16
  273. package/dist/ui/codeblock-button/code-block-button.d.mts +0 -20
  274. package/dist/ui/codeblock-button/code-block-button.d.ts +0 -20
  275. package/dist/ui/codeblock-button/code-block-button.js +0 -237
  276. package/dist/ui/codeblock-button/code-block-button.mjs +0 -9
  277. package/dist/ui/codeblock-button/index.d.mts +0 -6
  278. package/dist/ui/codeblock-button/index.d.ts +0 -6
  279. package/dist/ui/codeblock-button/index.js +0 -249
  280. package/dist/ui/codeblock-button/index.mjs +0 -21
  281. package/dist/ui/codeblock-button/use-code-block.d.mts +0 -92
  282. package/dist/ui/codeblock-button/use-code-block.d.ts +0 -92
  283. package/dist/ui/codeblock-button/use-code-block.js +0 -192
  284. package/dist/ui/codeblock-button/use-code-block.mjs +0 -17
  285. package/dist/ui/color-highlight-button/color-highlight-button.d.mts +0 -25
  286. package/dist/ui/color-highlight-button/color-highlight-button.d.ts +0 -25
  287. package/dist/ui/color-highlight-button/color-highlight-button.js +0 -266
  288. package/dist/ui/color-highlight-button/color-highlight-button.mjs +0 -9
  289. package/dist/ui/color-highlight-button/index.d.mts +0 -6
  290. package/dist/ui/color-highlight-button/index.d.ts +0 -6
  291. package/dist/ui/color-highlight-button/index.js +0 -342
  292. package/dist/ui/color-highlight-button/index.mjs +0 -27
  293. package/dist/ui/color-highlight-button/use-color-highlight.d.mts +0 -64
  294. package/dist/ui/color-highlight-button/use-color-highlight.d.ts +0 -64
  295. package/dist/ui/color-highlight-button/use-color-highlight.js +0 -247
  296. package/dist/ui/color-highlight-button/use-color-highlight.mjs +0 -23
  297. package/dist/ui/color-highlight-popover/color-highlight-popover.d.mts +0 -29
  298. package/dist/ui/color-highlight-popover/color-highlight-popover.d.ts +0 -29
  299. package/dist/ui/color-highlight-popover/color-highlight-popover.js +0 -590
  300. package/dist/ui/color-highlight-popover/color-highlight-popover.mjs +0 -17
  301. package/dist/ui/color-highlight-popover/index.d.mts +0 -6
  302. package/dist/ui/color-highlight-popover/index.d.ts +0 -6
  303. package/dist/ui/color-highlight-popover/index.js +0 -591
  304. package/dist/ui/color-highlight-popover/index.mjs +0 -17
  305. package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.d.mts +0 -30
  306. package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.d.ts +0 -30
  307. package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.js +0 -171
  308. package/dist/ui/copy-anchor-link-button/use-scroll-to-hash.mjs +0 -10
  309. package/dist/ui/heading-button/index.d.mts +0 -45
  310. package/dist/ui/heading-button/index.d.ts +0 -45
  311. package/dist/ui/heading-button/index.js +0 -222
  312. package/dist/ui/heading-button/index.mjs +0 -16
  313. package/dist/ui/heading-button/utils.d.mts +0 -17
  314. package/dist/ui/heading-button/utils.d.ts +0 -17
  315. package/dist/ui/heading-button/utils.js +0 -92
  316. package/dist/ui/heading-button/utils.mjs +0 -19
  317. package/dist/ui/heading-dropdown-menu/index.d.mts +0 -14
  318. package/dist/ui/heading-dropdown-menu/index.d.ts +0 -14
  319. package/dist/ui/heading-dropdown-menu/index.js +0 -308
  320. package/dist/ui/heading-dropdown-menu/index.mjs +0 -10
  321. package/dist/ui/link-bubble/index.d.mts +0 -13
  322. package/dist/ui/link-bubble/index.d.ts +0 -13
  323. package/dist/ui/link-bubble/index.js +0 -183
  324. package/dist/ui/link-bubble/index.mjs +0 -10
  325. package/dist/ui/link-popover/index.d.mts +0 -7
  326. package/dist/ui/link-popover/index.d.ts +0 -7
  327. package/dist/ui/link-popover/index.js +0 -512
  328. package/dist/ui/link-popover/index.mjs +0 -30
  329. package/dist/ui/link-popover/link-popover.d.mts +0 -85
  330. package/dist/ui/link-popover/link-popover.d.ts +0 -85
  331. package/dist/ui/link-popover/link-popover.js +0 -498
  332. package/dist/ui/link-popover/link-popover.mjs +0 -16
  333. package/dist/ui/link-popover/use-link-popover.d.mts +0 -123
  334. package/dist/ui/link-popover/use-link-popover.d.ts +0 -123
  335. package/dist/ui/link-popover/use-link-popover.js +0 -259
  336. package/dist/ui/link-popover/use-link-popover.mjs +0 -20
  337. package/dist/ui/list-button/index.d.mts +0 -50
  338. package/dist/ui/list-button/index.d.ts +0 -50
  339. package/dist/ui/list-button/index.js +0 -232
  340. package/dist/ui/list-button/index.mjs +0 -24
  341. package/dist/ui/list-dropdown-menu/index.d.mts +0 -45
  342. package/dist/ui/list-dropdown-menu/index.d.ts +0 -45
  343. package/dist/ui/list-dropdown-menu/index.js +0 -361
  344. package/dist/ui/list-dropdown-menu/index.mjs +0 -21
  345. package/dist/ui/mark-button/index.d.mts +0 -59
  346. package/dist/ui/mark-button/index.d.ts +0 -59
  347. package/dist/ui/mark-button/index.js +0 -217
  348. package/dist/ui/mark-button/index.mjs +0 -26
  349. package/dist/ui/reset-all-formatting-button/index.d.mts +0 -7
  350. package/dist/ui/reset-all-formatting-button/index.d.ts +0 -7
  351. package/dist/ui/reset-all-formatting-button/index.js +0 -286
  352. package/dist/ui/reset-all-formatting-button/index.mjs +0 -26
  353. package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.d.mts +0 -30
  354. package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.d.ts +0 -30
  355. package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.js +0 -271
  356. package/dist/ui/reset-all-formatting-button/reset-all-formatting-button.mjs +0 -12
  357. package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.d.mts +0 -103
  358. package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.d.ts +0 -103
  359. package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.js +0 -211
  360. package/dist/ui/reset-all-formatting-button/use-reset-all-formatting.mjs +0 -21
  361. package/dist/ui/slash-dropdown-menu/index.d.mts +0 -10
  362. package/dist/ui/slash-dropdown-menu/index.d.ts +0 -10
  363. package/dist/ui/slash-dropdown-menu/index.js +0 -1056
  364. package/dist/ui/slash-dropdown-menu/index.mjs +0 -19
  365. package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.d.mts +0 -16
  366. package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.d.ts +0 -16
  367. package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.js +0 -1053
  368. package/dist/ui/slash-dropdown-menu/slash-dropdown-menu.mjs +0 -16
  369. package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.d.mts +0 -162
  370. package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.d.ts +0 -162
  371. package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.js +0 -457
  372. package/dist/ui/slash-dropdown-menu/use-slash-dropdown-menu.mjs +0 -10
  373. package/dist/ui/suggestion-menu/index.d.mts +0 -10
  374. package/dist/ui/suggestion-menu/index.d.ts +0 -10
  375. package/dist/ui/suggestion-menu/index.js +0 -489
  376. package/dist/ui/suggestion-menu/index.mjs +0 -17
  377. package/dist/ui/suggestion-menu/suggestion-menu-types.d.mts +0 -89
  378. package/dist/ui/suggestion-menu/suggestion-menu-types.d.ts +0 -89
  379. package/dist/ui/suggestion-menu/suggestion-menu-types.js +0 -19
  380. package/dist/ui/suggestion-menu/suggestion-menu-types.mjs +0 -1
  381. package/dist/ui/suggestion-menu/suggestion-menu-utils.d.mts +0 -27
  382. package/dist/ui/suggestion-menu/suggestion-menu-utils.d.ts +0 -27
  383. package/dist/ui/suggestion-menu/suggestion-menu-utils.js +0 -75
  384. package/dist/ui/suggestion-menu/suggestion-menu-utils.mjs +0 -9
  385. package/dist/ui/suggestion-menu/suggestion-menu.d.mts +0 -15
  386. package/dist/ui/suggestion-menu/suggestion-menu.d.ts +0 -15
  387. package/dist/ui/suggestion-menu/suggestion-menu.js +0 -453
  388. package/dist/ui/suggestion-menu/suggestion-menu.mjs +0 -12
  389. package/dist/ui/table-button/index.d.mts +0 -15
  390. package/dist/ui/table-button/index.d.ts +0 -15
  391. package/dist/ui/table-button/index.js +0 -202
  392. package/dist/ui/table-button/index.mjs +0 -9
  393. package/dist/ui/table-button/use-table.d.mts +0 -51
  394. package/dist/ui/table-button/use-table.d.ts +0 -51
  395. package/dist/ui/table-button/use-table.js +0 -146
  396. package/dist/ui/table-button/use-table.mjs +0 -14
  397. package/dist/ui/text-align-button/index.d.mts +0 -6
  398. package/dist/ui/text-align-button/index.d.ts +0 -6
  399. package/dist/ui/text-align-button/index.js +0 -235
  400. package/dist/ui/text-align-button/index.mjs +0 -29
  401. package/dist/ui/text-align-button/text-align-button.d.mts +0 -20
  402. package/dist/ui/text-align-button/text-align-button.d.ts +0 -20
  403. package/dist/ui/text-align-button/text-align-button.js +0 -215
  404. package/dist/ui/text-align-button/text-align-button.mjs +0 -9
  405. package/dist/ui/text-align-button/use-text-align.d.mts +0 -106
  406. package/dist/ui/text-align-button/use-text-align.d.ts +0 -106
  407. package/dist/ui/text-align-button/use-text-align.js +0 -169
  408. package/dist/ui/text-align-button/use-text-align.mjs +0 -24
  409. package/dist/ui/undo-redo-button/index.d.mts +0 -6
  410. package/dist/ui/undo-redo-button/index.d.ts +0 -6
  411. package/dist/ui/undo-redo-button/index.js +0 -202
  412. package/dist/ui/undo-redo-button/index.mjs +0 -25
  413. package/dist/ui/undo-redo-button/undo-redo-button.d.mts +0 -23
  414. package/dist/ui/undo-redo-button/undo-redo-button.d.ts +0 -23
  415. package/dist/ui/undo-redo-button/undo-redo-button.js +0 -187
  416. package/dist/ui/undo-redo-button/undo-redo-button.mjs +0 -10
  417. package/dist/ui/undo-redo-button/use-undo-redo.d.mts +0 -95
  418. package/dist/ui/undo-redo-button/use-undo-redo.d.ts +0 -95
  419. package/dist/ui/undo-redo-button/use-undo-redo.js +0 -146
  420. package/dist/ui/undo-redo-button/use-undo-redo.mjs +0 -21
  421. package/dist/utils/index.d.mts +0 -38
  422. package/dist/utils/index.d.ts +0 -38
  423. package/dist/utils/index.js +0 -128
  424. package/dist/utils/index.mjs +0 -15
  425. package/dist/utils/safe-parse.d.mts +0 -14
  426. package/dist/utils/safe-parse.d.ts +0 -14
  427. package/dist/utils/safe-parse.js +0 -203
  428. package/dist/utils/safe-parse.mjs +0 -8
@@ -1,489 +0,0 @@
1
- "use client";
2
- "use strict";
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __export = (target, all) => {
10
- for (var name in all)
11
- __defProp(target, name, { get: all[name], enumerable: true });
12
- };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from))
16
- if (!__hasOwnProp.call(to, key) && key !== except)
17
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
- }
19
- return to;
20
- };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
-
31
- // src/ui/suggestion-menu/index.tsx
32
- var suggestion_menu_exports = {};
33
- __export(suggestion_menu_exports, {
34
- SuggestionMenu: () => SuggestionMenu,
35
- calculateStartPosition: () => calculateStartPosition,
36
- filterSuggestionItems: () => filterSuggestionItems
37
- });
38
- module.exports = __toCommonJS(suggestion_menu_exports);
39
-
40
- // src/ui/suggestion-menu/suggestion-menu.tsx
41
- var import_react4 = require("@floating-ui/react");
42
- var import_state = require("@tiptap/pm/state");
43
- var import_suggestion = require("@tiptap/suggestion");
44
- var React3 = __toESM(require("react"));
45
-
46
- // src/hooks/use-floating-element.ts
47
- var import_react = require("@floating-ui/react");
48
- var React = __toESM(require("react"));
49
- function useFloatingElement(show, referencePos, zIndex, options) {
50
- const { dismissOptions, ...floatingOptions } = options || {};
51
- const { refs, update, context, floatingStyles } = (0, import_react.useFloating)({
52
- open: show,
53
- ...floatingOptions
54
- });
55
- const { isMounted, styles } = (0, import_react.useTransitionStyles)(context);
56
- const dismiss = (0, import_react.useDismiss)(context, dismissOptions);
57
- const { getReferenceProps, getFloatingProps } = (0, import_react.useInteractions)([dismiss]);
58
- React.useEffect(() => {
59
- update();
60
- }, [referencePos, update]);
61
- React.useEffect(() => {
62
- if (referencePos === null) {
63
- return;
64
- }
65
- refs.setReference({
66
- getBoundingClientRect: () => referencePos
67
- });
68
- }, [referencePos, refs]);
69
- return React.useMemo(
70
- () => ({
71
- isMounted,
72
- ref: refs.setFloating,
73
- style: {
74
- ...styles,
75
- ...floatingStyles,
76
- zIndex
77
- },
78
- update,
79
- getFloatingProps,
80
- getReferenceProps
81
- }),
82
- [
83
- floatingStyles,
84
- isMounted,
85
- refs.setFloating,
86
- styles,
87
- update,
88
- zIndex,
89
- getFloatingProps,
90
- getReferenceProps
91
- ]
92
- );
93
- }
94
-
95
- // src/hooks/use-menu-navigation.ts
96
- var React2 = __toESM(require("react"));
97
- function useMenuNavigation({
98
- editor,
99
- containerRef,
100
- query,
101
- items,
102
- onSelect,
103
- onClose,
104
- orientation = "vertical",
105
- autoSelectFirstItem = true
106
- }) {
107
- const [selectedIndex, setSelectedIndex] = React2.useState(
108
- autoSelectFirstItem ? 0 : -1
109
- );
110
- React2.useEffect(() => {
111
- const handleKeyboardNavigation = (event) => {
112
- if (!items.length) return false;
113
- const moveNext = () => setSelectedIndex((currentIndex) => {
114
- if (currentIndex === -1) return 0;
115
- return (currentIndex + 1) % items.length;
116
- });
117
- const movePrev = () => setSelectedIndex((currentIndex) => {
118
- if (currentIndex === -1) return items.length - 1;
119
- return (currentIndex - 1 + items.length) % items.length;
120
- });
121
- switch (event.key) {
122
- case "ArrowUp": {
123
- if (orientation === "horizontal") return false;
124
- event.preventDefault();
125
- movePrev();
126
- return true;
127
- }
128
- case "ArrowDown": {
129
- if (orientation === "horizontal") return false;
130
- event.preventDefault();
131
- moveNext();
132
- return true;
133
- }
134
- case "ArrowLeft": {
135
- if (orientation === "vertical") return false;
136
- event.preventDefault();
137
- movePrev();
138
- return true;
139
- }
140
- case "ArrowRight": {
141
- if (orientation === "vertical") return false;
142
- event.preventDefault();
143
- moveNext();
144
- return true;
145
- }
146
- case "Tab": {
147
- event.preventDefault();
148
- if (event.shiftKey) {
149
- movePrev();
150
- } else {
151
- moveNext();
152
- }
153
- return true;
154
- }
155
- case "Home": {
156
- event.preventDefault();
157
- setSelectedIndex(0);
158
- return true;
159
- }
160
- case "End": {
161
- event.preventDefault();
162
- setSelectedIndex(items.length - 1);
163
- return true;
164
- }
165
- case "Enter": {
166
- if (event.isComposing) return false;
167
- event.preventDefault();
168
- if (selectedIndex !== -1 && items[selectedIndex]) {
169
- onSelect == null ? void 0 : onSelect(items[selectedIndex]);
170
- }
171
- return true;
172
- }
173
- case "Escape": {
174
- event.preventDefault();
175
- onClose == null ? void 0 : onClose();
176
- return true;
177
- }
178
- default:
179
- return false;
180
- }
181
- };
182
- let targetElement = null;
183
- if (editor) {
184
- targetElement = editor.view.dom;
185
- } else if (containerRef == null ? void 0 : containerRef.current) {
186
- targetElement = containerRef.current;
187
- }
188
- if (targetElement) {
189
- targetElement.addEventListener("keydown", handleKeyboardNavigation, true);
190
- return () => {
191
- targetElement == null ? void 0 : targetElement.removeEventListener(
192
- "keydown",
193
- handleKeyboardNavigation,
194
- true
195
- );
196
- };
197
- }
198
- return void 0;
199
- }, [
200
- editor,
201
- containerRef,
202
- items,
203
- selectedIndex,
204
- onSelect,
205
- onClose,
206
- orientation
207
- ]);
208
- React2.useEffect(() => {
209
- if (query) {
210
- setSelectedIndex(autoSelectFirstItem ? 0 : -1);
211
- }
212
- }, [query, autoSelectFirstItem]);
213
- return {
214
- selectedIndex: items.length ? selectedIndex : void 0,
215
- setSelectedIndex
216
- };
217
- }
218
-
219
- // src/hooks/use-tiptap-editor.ts
220
- var import_react2 = require("@tiptap/react");
221
- var import_react3 = require("react");
222
- function useTiptapEditor(providedEditor) {
223
- const { editor: coreEditor } = (0, import_react2.useCurrentEditor)();
224
- const mainEditor = (0, import_react3.useMemo)(
225
- () => providedEditor || coreEditor,
226
- [providedEditor, coreEditor]
227
- );
228
- const editorState = (0, import_react2.useEditorState)({
229
- editor: mainEditor,
230
- selector(context) {
231
- if (!context.editor) {
232
- return {
233
- editor: null,
234
- editorState: void 0,
235
- canCommand: void 0
236
- };
237
- }
238
- return {
239
- editor: context.editor,
240
- editorState: context.editor.state,
241
- canCommand: context.editor.can
242
- };
243
- }
244
- });
245
- return editorState || { editor: null };
246
- }
247
-
248
- // src/ui/suggestion-menu/suggestion-menu-utils.ts
249
- function calculateStartPosition(cursorPosition, previousNode, triggerChar) {
250
- if (!(previousNode == null ? void 0 : previousNode.text) || !triggerChar) {
251
- return cursorPosition;
252
- }
253
- const commandText = previousNode.text;
254
- const triggerCharIndex = commandText.lastIndexOf(triggerChar);
255
- if (triggerCharIndex === -1) {
256
- return cursorPosition;
257
- }
258
- const textLength = commandText.substring(triggerCharIndex).length;
259
- return cursorPosition - textLength;
260
- }
261
- function filterSuggestionItems(items, query) {
262
- const normalizedQuery = query.trim().toLowerCase();
263
- if (!normalizedQuery) {
264
- return items;
265
- }
266
- return items.filter((item) => {
267
- var _a, _b;
268
- if (item.title.toLowerCase().includes(normalizedQuery)) {
269
- return true;
270
- }
271
- if ((_a = item.subtext) == null ? void 0 : _a.toLowerCase().includes(normalizedQuery)) {
272
- return true;
273
- }
274
- if ((_b = item.keywords) == null ? void 0 : _b.some(
275
- (keyword) => keyword.toLowerCase().includes(normalizedQuery)
276
- )) {
277
- return true;
278
- }
279
- return false;
280
- }).sort((a, b) => {
281
- const aTitle = a.title.toLowerCase();
282
- const bTitle = b.title.toLowerCase();
283
- if (aTitle === normalizedQuery && bTitle !== normalizedQuery) return -1;
284
- if (bTitle === normalizedQuery && aTitle !== normalizedQuery) return 1;
285
- if (aTitle.startsWith(normalizedQuery) && !bTitle.startsWith(normalizedQuery))
286
- return -1;
287
- if (bTitle.startsWith(normalizedQuery) && !aTitle.startsWith(normalizedQuery))
288
- return 1;
289
- return 0;
290
- });
291
- }
292
-
293
- // src/ui/suggestion-menu/suggestion-menu.tsx
294
- var import_jsx_runtime = require("react/jsx-runtime");
295
- var SuggestionMenu = ({
296
- editor: providedEditor,
297
- floatingOptions,
298
- selector = "tiptap-suggestion-menu",
299
- children,
300
- maxHeight = 384,
301
- pluginKey = import_suggestion.SuggestionPluginKey,
302
- ...internalSuggestionProps
303
- }) => {
304
- const { editor } = useTiptapEditor(providedEditor);
305
- const [show, setShow] = React3.useState(false);
306
- const [internalClientRect, setInternalClientRect] = React3.useState(null);
307
- const [internalCommand, setInternalCommand] = React3.useState(null);
308
- const [internalItems, setInternalItems] = React3.useState(
309
- []
310
- );
311
- const [internalQuery, setInternalQuery] = React3.useState("");
312
- const [, setInternalRange] = React3.useState(null);
313
- const { ref, style, getFloatingProps, isMounted } = useFloatingElement(
314
- show,
315
- internalClientRect,
316
- 1e3,
317
- {
318
- placement: "bottom-start",
319
- middleware: [
320
- (0, import_react4.offset)(10),
321
- (0, import_react4.flip)({
322
- mainAxis: true,
323
- crossAxis: false
324
- }),
325
- (0, import_react4.shift)(),
326
- (0, import_react4.size)({
327
- apply({ availableHeight, elements }) {
328
- if (elements.floating) {
329
- const maxHeightValue = maxHeight ? Math.min(maxHeight, availableHeight) : availableHeight;
330
- elements.floating.style.setProperty(
331
- "--suggestion-menu-max-height",
332
- `${maxHeightValue}px`
333
- );
334
- }
335
- }
336
- })
337
- ],
338
- onOpenChange(open) {
339
- if (!open) {
340
- setShow(false);
341
- }
342
- },
343
- ...floatingOptions
344
- }
345
- );
346
- const internalSuggestionPropsRef = React3.useRef(internalSuggestionProps);
347
- React3.useEffect(() => {
348
- internalSuggestionPropsRef.current = internalSuggestionProps;
349
- }, [internalSuggestionProps]);
350
- const closePopup = React3.useCallback(() => {
351
- setShow(false);
352
- }, []);
353
- React3.useEffect(() => {
354
- if (!editor || editor.isDestroyed) {
355
- return;
356
- }
357
- const existingPlugin = editor.state.plugins.find(
358
- (plugin) => plugin.spec.key === pluginKey
359
- );
360
- if (existingPlugin) {
361
- editor.unregisterPlugin(pluginKey);
362
- }
363
- const suggestion = (0, import_suggestion.Suggestion)({
364
- pluginKey: pluginKey instanceof import_state.PluginKey ? pluginKey : new import_state.PluginKey(pluginKey),
365
- editor,
366
- command({ editor: editor2, range, props }) {
367
- var _a, _b;
368
- if (!range) {
369
- return;
370
- }
371
- const { view, state } = editor2;
372
- const { selection } = state;
373
- const isMention = editor2.extensionManager.extensions.some(
374
- (extension) => {
375
- var _a2, _b2;
376
- const name = extension.name;
377
- return name === "mention" && ((_b2 = (_a2 = extension.options) == null ? void 0 : _a2.suggestion) == null ? void 0 : _b2.char) === internalSuggestionPropsRef.current.char;
378
- }
379
- );
380
- if (!isMention) {
381
- const cursorPosition = selection.$from.pos;
382
- const previousNode = (_a = selection.$head) == null ? void 0 : _a.nodeBefore;
383
- const startPosition = previousNode ? calculateStartPosition(
384
- cursorPosition,
385
- previousNode,
386
- internalSuggestionPropsRef.current.char
387
- ) : selection.$from.start();
388
- const transaction = state.tr.deleteRange(
389
- startPosition,
390
- cursorPosition
391
- );
392
- view.dispatch(transaction);
393
- }
394
- const nodeAfter = view.state.selection.$to.nodeAfter;
395
- const overrideSpace = (_b = nodeAfter == null ? void 0 : nodeAfter.text) == null ? void 0 : _b.startsWith(" ");
396
- const rangeToUse = { ...range };
397
- if (overrideSpace) {
398
- rangeToUse.to += 1;
399
- }
400
- props.onSelect({ editor: editor2, range: rangeToUse, context: props.context });
401
- },
402
- render: () => {
403
- return {
404
- onStart: (props) => {
405
- var _a, _b;
406
- setInternalCommand(() => props.command);
407
- setInternalItems(props.items);
408
- setInternalQuery(props.query);
409
- setInternalRange(props.range);
410
- setInternalClientRect((_b = (_a = props.clientRect) == null ? void 0 : _a.call(props)) != null ? _b : null);
411
- setShow(true);
412
- },
413
- onUpdate: (props) => {
414
- var _a, _b;
415
- setInternalCommand(() => props.command);
416
- setInternalItems(props.items);
417
- setInternalQuery(props.query);
418
- setInternalRange(props.range);
419
- setInternalClientRect((_b = (_a = props.clientRect) == null ? void 0 : _a.call(props)) != null ? _b : null);
420
- },
421
- onKeyDown: (props) => {
422
- if (props.event.key === "Escape") {
423
- closePopup();
424
- return true;
425
- }
426
- return false;
427
- },
428
- onExit: () => {
429
- setInternalCommand(null);
430
- setInternalItems([]);
431
- setInternalQuery("");
432
- setInternalRange(null);
433
- setInternalClientRect(null);
434
- setShow(false);
435
- }
436
- };
437
- },
438
- ...internalSuggestionPropsRef.current
439
- });
440
- editor.registerPlugin(suggestion);
441
- return () => {
442
- if (!editor.isDestroyed) {
443
- editor.unregisterPlugin(pluginKey);
444
- }
445
- };
446
- }, [editor, pluginKey, closePopup]);
447
- const onSelect = React3.useCallback(
448
- (item) => {
449
- closePopup();
450
- if (internalCommand) {
451
- internalCommand(item);
452
- }
453
- },
454
- [closePopup, internalCommand]
455
- );
456
- const { selectedIndex } = useMenuNavigation({
457
- editor,
458
- query: internalQuery,
459
- items: internalItems,
460
- onSelect
461
- });
462
- if (!isMounted || !show || !editor) {
463
- return null;
464
- }
465
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react4.FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
466
- "div",
467
- {
468
- ref,
469
- style,
470
- ...getFloatingProps(),
471
- "data-selector": selector,
472
- className: "tiptap-suggestion-menu",
473
- role: "listbox",
474
- "aria-label": "Suggestions",
475
- onPointerDown: (e) => e.preventDefault(),
476
- children: children({
477
- items: internalItems,
478
- selectedIndex,
479
- onSelect
480
- })
481
- }
482
- ) });
483
- };
484
- // Annotate the CommonJS export names for ESM import in node:
485
- 0 && (module.exports = {
486
- SuggestionMenu,
487
- calculateStartPosition,
488
- filterSuggestionItems
489
- });
@@ -1,17 +0,0 @@
1
- "use client";
2
- import "../../chunk-HLLA2HRV.mjs";
3
- import {
4
- SuggestionMenu
5
- } from "../../chunk-L5RDMV3H.mjs";
6
- import {
7
- calculateStartPosition,
8
- filterSuggestionItems
9
- } from "../../chunk-CNVACBGT.mjs";
10
- import "../../chunk-P55PLOHR.mjs";
11
- import "../../chunk-KK4K43WM.mjs";
12
- import "../../chunk-42HKGCOO.mjs";
13
- export {
14
- SuggestionMenu,
15
- calculateStartPosition,
16
- filterSuggestionItems
17
- };
@@ -1,89 +0,0 @@
1
- import { UseFloatingOptions } from '@floating-ui/react';
2
- import { PluginKey } from '@tiptap/pm/state';
3
- import { Editor, Range } from '@tiptap/react';
4
- import { SuggestionOptions } from '@tiptap/suggestion';
5
- import * as React from 'react';
6
-
7
- type DefaultContext = unknown;
8
- type IconProps = React.SVGProps<SVGSVGElement>;
9
- type IconComponent = ({ className, ...props }: IconProps) => React.ReactElement;
10
- interface SuggestionItem<T = DefaultContext> {
11
- /**
12
- * The main text to display for the suggestion.
13
- */
14
- title: string;
15
- /**
16
- * Secondary text to provide additional context.
17
- */
18
- subtext?: string;
19
- /**
20
- * Icon or badge to display alongside the suggestion.
21
- */
22
- badge?: React.MemoExoticComponent<IconComponent> | React.FC<IconProps> | string;
23
- /**
24
- * Group identifier for organizing suggestions.
25
- */
26
- group?: string;
27
- /**
28
- * Additional keywords for filtering suggestions.
29
- */
30
- keywords?: string[];
31
- /**
32
- * Custom data to pass to the onSelect handler.
33
- */
34
- context?: T;
35
- /**
36
- * Callback executed when this suggestion is selected.
37
- */
38
- onSelect: (props: {
39
- editor: Editor;
40
- range: Range;
41
- context?: T;
42
- }) => void;
43
- }
44
- type SuggestionMenuRenderProps<T = DefaultContext> = {
45
- /**
46
- * List of suggestion items to display.
47
- */
48
- items: SuggestionItem<T>[];
49
- /**
50
- * Index of the currently selected item.
51
- */
52
- selectedIndex?: number;
53
- /**
54
- * Callback to select an item.
55
- */
56
- onSelect: (item: SuggestionItem<T>) => void;
57
- };
58
- interface SuggestionMenuProps<T = DefaultContext> extends Omit<SuggestionOptions<SuggestionItem<T>>, "pluginKey" | "editor"> {
59
- /**
60
- * The Tiptap editor instance.
61
- */
62
- editor?: Editor | null;
63
- /**
64
- * Additional options for the floating UI.
65
- */
66
- floatingOptions?: Partial<UseFloatingOptions>;
67
- /**
68
- * CSS selector attribute for targeting the menu.
69
- * @default 'tiptap-suggestion-menu'
70
- */
71
- selector?: string;
72
- /**
73
- * Unique key for the suggestion plugin.
74
- * @default SuggestionPluginKey
75
- */
76
- pluginKey?: string | PluginKey;
77
- /**
78
- * Maximum height of the suggestion menu.
79
- * If provided, the menu will scroll if content exceeds this height.
80
- * @default 384
81
- */
82
- maxHeight?: number;
83
- /**
84
- * Render function for the menu content.
85
- */
86
- children: (props: SuggestionMenuRenderProps<T>) => React.ReactNode;
87
- }
88
-
89
- export type { SuggestionItem, SuggestionMenuProps, SuggestionMenuRenderProps };
@@ -1,89 +0,0 @@
1
- import { UseFloatingOptions } from '@floating-ui/react';
2
- import { PluginKey } from '@tiptap/pm/state';
3
- import { Editor, Range } from '@tiptap/react';
4
- import { SuggestionOptions } from '@tiptap/suggestion';
5
- import * as React from 'react';
6
-
7
- type DefaultContext = unknown;
8
- type IconProps = React.SVGProps<SVGSVGElement>;
9
- type IconComponent = ({ className, ...props }: IconProps) => React.ReactElement;
10
- interface SuggestionItem<T = DefaultContext> {
11
- /**
12
- * The main text to display for the suggestion.
13
- */
14
- title: string;
15
- /**
16
- * Secondary text to provide additional context.
17
- */
18
- subtext?: string;
19
- /**
20
- * Icon or badge to display alongside the suggestion.
21
- */
22
- badge?: React.MemoExoticComponent<IconComponent> | React.FC<IconProps> | string;
23
- /**
24
- * Group identifier for organizing suggestions.
25
- */
26
- group?: string;
27
- /**
28
- * Additional keywords for filtering suggestions.
29
- */
30
- keywords?: string[];
31
- /**
32
- * Custom data to pass to the onSelect handler.
33
- */
34
- context?: T;
35
- /**
36
- * Callback executed when this suggestion is selected.
37
- */
38
- onSelect: (props: {
39
- editor: Editor;
40
- range: Range;
41
- context?: T;
42
- }) => void;
43
- }
44
- type SuggestionMenuRenderProps<T = DefaultContext> = {
45
- /**
46
- * List of suggestion items to display.
47
- */
48
- items: SuggestionItem<T>[];
49
- /**
50
- * Index of the currently selected item.
51
- */
52
- selectedIndex?: number;
53
- /**
54
- * Callback to select an item.
55
- */
56
- onSelect: (item: SuggestionItem<T>) => void;
57
- };
58
- interface SuggestionMenuProps<T = DefaultContext> extends Omit<SuggestionOptions<SuggestionItem<T>>, "pluginKey" | "editor"> {
59
- /**
60
- * The Tiptap editor instance.
61
- */
62
- editor?: Editor | null;
63
- /**
64
- * Additional options for the floating UI.
65
- */
66
- floatingOptions?: Partial<UseFloatingOptions>;
67
- /**
68
- * CSS selector attribute for targeting the menu.
69
- * @default 'tiptap-suggestion-menu'
70
- */
71
- selector?: string;
72
- /**
73
- * Unique key for the suggestion plugin.
74
- * @default SuggestionPluginKey
75
- */
76
- pluginKey?: string | PluginKey;
77
- /**
78
- * Maximum height of the suggestion menu.
79
- * If provided, the menu will scroll if content exceeds this height.
80
- * @default 384
81
- */
82
- maxHeight?: number;
83
- /**
84
- * Render function for the menu content.
85
- */
86
- children: (props: SuggestionMenuRenderProps<T>) => React.ReactNode;
87
- }
88
-
89
- export type { SuggestionItem, SuggestionMenuProps, SuggestionMenuRenderProps };
@@ -1,19 +0,0 @@
1
- "use client";
2
- "use strict";
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __copyProps = (to, from, except, desc) => {
8
- if (from && typeof from === "object" || typeof from === "function") {
9
- for (let key of __getOwnPropNames(from))
10
- if (!__hasOwnProp.call(to, key) && key !== except)
11
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- }
13
- return to;
14
- };
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
-
17
- // src/ui/suggestion-menu/suggestion-menu-types.ts
18
- var suggestion_menu_types_exports = {};
19
- module.exports = __toCommonJS(suggestion_menu_types_exports);
@@ -1 +0,0 @@
1
- "use client";