@youcan/celeste 0.6.96 → 0.6.98

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 (979) hide show
  1. package/dist/celeste.css +2034 -2034
  2. package/dist/cjs/alert.js +2 -112
  3. package/dist/cjs/alpha-slider.js +2 -3
  4. package/dist/cjs/badge.js +2 -59
  5. package/dist/cjs/button.js +2 -40
  6. package/dist/cjs/checkbox-card.js +2 -111
  7. package/dist/cjs/checkbox-label.js +2 -110
  8. package/dist/cjs/checkbox.js +2 -4
  9. package/dist/cjs/chunks/_plugin-vue_export-helper.js +12 -8
  10. package/dist/cjs/chunks/alert.js +103 -0
  11. package/dist/cjs/chunks/alpha-slider.js +110 -118
  12. package/dist/cjs/chunks/badge.js +59 -0
  13. package/dist/cjs/chunks/button.js +43 -0
  14. package/dist/cjs/chunks/checkbox-card.js +100 -0
  15. package/dist/cjs/chunks/checkbox-label.js +94 -0
  16. package/dist/cjs/chunks/checkbox.js +39 -37
  17. package/dist/cjs/chunks/clsx.js +17 -11
  18. package/dist/cjs/chunks/collapsible-content.js +29 -26
  19. package/dist/cjs/chunks/collapsible-trigger.js +26 -21
  20. package/dist/cjs/chunks/collapsible.js +30 -27
  21. package/dist/cjs/chunks/color-area.js +174 -0
  22. package/dist/cjs/chunks/color-picker.js +458 -0
  23. package/dist/cjs/chunks/color-swatch.js +65 -0
  24. package/dist/cjs/chunks/combobox-anchor.js +32 -30
  25. package/dist/cjs/chunks/combobox-empty.js +36 -0
  26. package/dist/cjs/chunks/combobox-group.js +43 -0
  27. package/dist/cjs/chunks/combobox-input.js +72 -0
  28. package/dist/cjs/chunks/combobox-item.js +95 -0
  29. package/dist/cjs/chunks/combobox-list.js +66 -0
  30. package/dist/cjs/chunks/combobox-root.js +50 -0
  31. package/dist/cjs/chunks/combobox-separator.js +36 -0
  32. package/dist/cjs/chunks/combobox-trigger.js +45 -0
  33. package/dist/cjs/chunks/combobox.js +199 -0
  34. package/dist/cjs/chunks/compact-button.js +44 -0
  35. package/dist/cjs/chunks/components.js +310 -0
  36. package/dist/cjs/chunks/content-divider.js +60 -0
  37. package/dist/cjs/chunks/core.js +325 -0
  38. package/dist/cjs/chunks/counter-input.js +74 -69
  39. package/dist/cjs/chunks/digit-input-group.js +34 -0
  40. package/dist/cjs/chunks/digit-input-slot.js +33 -0
  41. package/dist/cjs/chunks/digit-input.js +54 -0
  42. package/dist/cjs/chunks/dist.js +12213 -0
  43. package/dist/cjs/chunks/dist2.js +15565 -0
  44. package/dist/cjs/chunks/dropdown-menu-content.js +62 -0
  45. package/dist/cjs/chunks/dropdown-menu-group.js +30 -0
  46. package/dist/cjs/chunks/dropdown-menu-item.js +49 -0
  47. package/dist/cjs/chunks/dropdown-menu-label.js +34 -0
  48. package/dist/cjs/chunks/dropdown-menu-separator.js +31 -0
  49. package/dist/cjs/chunks/dropdown-menu-sub-content.js +59 -0
  50. package/dist/cjs/chunks/dropdown-menu-sub-trigger.js +45 -0
  51. package/dist/cjs/chunks/dropdown-menu-sub.js +27 -24
  52. package/dist/cjs/chunks/dropdown-menu-trigger.js +31 -0
  53. package/dist/cjs/chunks/dropdown-menu.js +38 -0
  54. package/dist/cjs/chunks/extra-settings.js +134 -0
  55. package/dist/cjs/chunks/fancy-button.js +42 -0
  56. package/dist/cjs/chunks/file-upload-area.js +139 -0
  57. package/dist/cjs/chunks/hint-text.js +38 -0
  58. package/dist/cjs/chunks/hue-slider.js +120 -0
  59. package/dist/cjs/chunks/label.js +64 -0
  60. package/dist/cjs/chunks/link-bubble.js +198 -0
  61. package/dist/cjs/chunks/link-button.js +48 -0
  62. package/dist/cjs/chunks/menus.js +1173 -0
  63. package/dist/cjs/chunks/modal-body.js +25 -0
  64. package/dist/cjs/chunks/modal-close.js +26 -21
  65. package/dist/cjs/chunks/modal-content.js +53 -0
  66. package/dist/cjs/chunks/modal-footer.js +25 -0
  67. package/dist/cjs/chunks/modal-header.js +83 -0
  68. package/dist/cjs/chunks/modal-trigger.js +26 -21
  69. package/dist/cjs/chunks/modal.js +28 -25
  70. package/dist/cjs/chunks/pagination-content.js +34 -0
  71. package/dist/cjs/chunks/pagination-ellipsis.js +37 -0
  72. package/dist/cjs/chunks/pagination-first.js +33 -31
  73. package/dist/cjs/chunks/pagination-item.js +36 -31
  74. package/dist/cjs/chunks/pagination-last.js +33 -31
  75. package/dist/cjs/chunks/pagination-next.js +33 -31
  76. package/dist/cjs/chunks/pagination-previous.js +33 -31
  77. package/dist/cjs/chunks/pagination.js +60 -0
  78. package/dist/cjs/chunks/popover-content.js +113 -0
  79. package/dist/cjs/chunks/popover-trigger.js +30 -0
  80. package/dist/cjs/chunks/popover.js +28 -25
  81. package/dist/cjs/chunks/progress-bar.js +73 -0
  82. package/dist/cjs/chunks/progress-circle.js +95 -0
  83. package/dist/cjs/chunks/radio-group-card.js +100 -0
  84. package/dist/cjs/chunks/radio-group-item.js +35 -33
  85. package/dist/cjs/chunks/radio-group-label.js +94 -0
  86. package/dist/cjs/chunks/radio-group.js +40 -38
  87. package/dist/cjs/chunks/rich-editor.js +5187 -0
  88. package/dist/cjs/chunks/scroll-area.js +46 -0
  89. package/dist/cjs/chunks/scroll-bar.js +37 -0
  90. package/dist/cjs/chunks/segmented-control-item.js +43 -0
  91. package/dist/cjs/chunks/segmented-control.js +43 -0
  92. package/dist/cjs/chunks/select-content.js +66 -0
  93. package/dist/cjs/chunks/select-group.js +26 -21
  94. package/dist/cjs/chunks/select-icon.js +27 -0
  95. package/dist/cjs/chunks/select-item.js +43 -0
  96. package/dist/cjs/chunks/select-label.js +35 -0
  97. package/dist/cjs/chunks/select-separator.js +31 -0
  98. package/dist/cjs/chunks/select-trigger.js +41 -0
  99. package/dist/cjs/chunks/select-value.js +35 -0
  100. package/dist/cjs/chunks/select.js +39 -37
  101. package/dist/cjs/chunks/sheet-close.js +32 -0
  102. package/dist/cjs/chunks/sheet-content.js +65 -0
  103. package/dist/cjs/chunks/sheet-description.js +34 -0
  104. package/dist/cjs/chunks/sheet-footer.js +25 -0
  105. package/dist/cjs/chunks/sheet-header.js +25 -0
  106. package/dist/cjs/chunks/sheet-title.js +34 -0
  107. package/dist/cjs/chunks/sheet-trigger.js +26 -21
  108. package/dist/cjs/chunks/sheet.js +28 -25
  109. package/dist/cjs/chunks/sidebar-content.js +24 -20
  110. package/dist/cjs/chunks/sidebar-element.js +32 -27
  111. package/dist/cjs/chunks/sidebar-footer.js +24 -20
  112. package/dist/cjs/chunks/sidebar-group-content.js +28 -0
  113. package/dist/cjs/chunks/sidebar-group-label.js +37 -28
  114. package/dist/cjs/chunks/sidebar-group.js +24 -20
  115. package/dist/cjs/chunks/sidebar-header.js +24 -20
  116. package/dist/cjs/chunks/sidebar-menu-action.js +38 -33
  117. package/dist/cjs/chunks/sidebar-menu-badge.js +42 -28
  118. package/dist/cjs/chunks/sidebar-menu-button.js +43 -38
  119. package/dist/cjs/chunks/sidebar-menu-item.js +24 -20
  120. package/dist/cjs/chunks/sidebar-menu-sub-button.js +46 -36
  121. package/dist/cjs/chunks/sidebar-menu-sub-item.js +24 -20
  122. package/dist/cjs/chunks/sidebar-menu-sub.js +24 -20
  123. package/dist/cjs/chunks/sidebar-menu.js +24 -20
  124. package/dist/cjs/chunks/sidebar-provider.js +73 -0
  125. package/dist/cjs/chunks/sidebar-trigger.js +38 -0
  126. package/dist/cjs/chunks/sidebar.js +67 -82
  127. package/dist/cjs/chunks/slider.js +50 -51
  128. package/dist/cjs/chunks/social-button.js +42 -0
  129. package/dist/cjs/chunks/sonner-alert.js +42 -0
  130. package/dist/cjs/chunks/sonner.js +1175 -1175
  131. package/dist/cjs/chunks/status-badge.js +50 -0
  132. package/dist/cjs/chunks/switch.js +39 -37
  133. package/dist/cjs/chunks/tab-menu-content.js +36 -0
  134. package/dist/cjs/chunks/tab-menu-item.js +44 -0
  135. package/dist/cjs/chunks/tab-menu-list.js +35 -0
  136. package/dist/cjs/chunks/tab-menu.js +36 -0
  137. package/dist/cjs/chunks/table-body.js +25 -0
  138. package/dist/cjs/chunks/table-caption.js +25 -0
  139. package/dist/cjs/chunks/table-cell.js +31 -0
  140. package/dist/cjs/chunks/table-footer.js +25 -0
  141. package/dist/cjs/chunks/table-head.js +31 -0
  142. package/dist/cjs/chunks/table-header.js +21 -19
  143. package/dist/cjs/chunks/table-row.js +34 -0
  144. package/dist/cjs/chunks/table.js +45 -0
  145. package/dist/cjs/chunks/table2.js +26 -0
  146. package/dist/cjs/chunks/tag.js +58 -0
  147. package/dist/cjs/chunks/text-input-affix.js +31 -0
  148. package/dist/cjs/chunks/text-input-button.js +39 -0
  149. package/dist/cjs/chunks/text-input.js +118 -0
  150. package/dist/cjs/chunks/textarea.js +61 -0
  151. package/dist/cjs/chunks/tooltip-content.js +108 -0
  152. package/dist/cjs/chunks/tooltip-provider.js +30 -25
  153. package/dist/cjs/chunks/tooltip-root.js +39 -35
  154. package/dist/cjs/chunks/tooltip-trigger.js +26 -22
  155. package/dist/cjs/chunks/tooltip.js +98 -83
  156. package/dist/cjs/chunks/use-color-model.js +943 -0
  157. package/dist/cjs/collapsible-content.js +2 -4
  158. package/dist/cjs/collapsible-trigger.js +2 -3
  159. package/dist/cjs/collapsible.js +2 -3
  160. package/dist/cjs/color-area.js +2 -176
  161. package/dist/cjs/color-picker.js +2 -518
  162. package/dist/cjs/color-swatch.js +2 -61
  163. package/dist/cjs/color.js +72 -70
  164. package/dist/cjs/combobox-anchor.js +2 -3
  165. package/dist/cjs/combobox-empty.js +2 -33
  166. package/dist/cjs/combobox-group.js +2 -43
  167. package/dist/cjs/combobox-input.js +2 -65
  168. package/dist/cjs/combobox-item.js +2 -111
  169. package/dist/cjs/combobox-list.js +2 -63
  170. package/dist/cjs/combobox-root.js +2 -42
  171. package/dist/cjs/combobox-separator.js +2 -33
  172. package/dist/cjs/combobox-trigger.js +2 -48
  173. package/dist/cjs/combobox.js +2 -240
  174. package/dist/cjs/command-group.js +36 -40
  175. package/dist/cjs/command-input.js +40 -40
  176. package/dist/cjs/command-item.js +30 -33
  177. package/dist/cjs/command-list.js +55 -51
  178. package/dist/cjs/command-root.js +50 -45
  179. package/dist/cjs/command-separator.js +30 -31
  180. package/dist/cjs/compact-button.js +2 -43
  181. package/dist/cjs/config.js +292 -127
  182. package/dist/cjs/content-divider.js +2 -3
  183. package/dist/cjs/counter-input.js +2 -4
  184. package/dist/cjs/crypto.js +3 -4
  185. package/dist/cjs/digit-input-group.js +2 -32
  186. package/dist/cjs/digit-input-slot.js +2 -29
  187. package/dist/cjs/digit-input.js +2 -47
  188. package/dist/cjs/dropdown-menu-content.js +2 -54
  189. package/dist/cjs/dropdown-menu-group.js +2 -25
  190. package/dist/cjs/dropdown-menu-item.js +2 -54
  191. package/dist/cjs/dropdown-menu-label.js +2 -32
  192. package/dist/cjs/dropdown-menu-separator.js +2 -26
  193. package/dist/cjs/dropdown-menu-sub-content.js +2 -51
  194. package/dist/cjs/dropdown-menu-sub-trigger.js +2 -45
  195. package/dist/cjs/dropdown-menu-sub.js +2 -3
  196. package/dist/cjs/dropdown-menu-trigger.js +2 -27
  197. package/dist/cjs/dropdown-menu.js +2 -36
  198. package/dist/cjs/extra-settings.js +2 -156
  199. package/dist/cjs/fancy-button.js +2 -38
  200. package/dist/cjs/file-upload-area.js +2 -146
  201. package/dist/cjs/hint-text.js +2 -37
  202. package/dist/cjs/hue-slider.js +2 -134
  203. package/dist/cjs/index.js +369 -520
  204. package/dist/cjs/label.js +2 -56
  205. package/dist/cjs/link-bubble.js +2 -242
  206. package/dist/cjs/link-button.js +2 -44
  207. package/dist/cjs/modal-body.js +2 -23
  208. package/dist/cjs/modal-close.js +2 -3
  209. package/dist/cjs/modal-content.js +2 -49
  210. package/dist/cjs/modal-footer.js +2 -23
  211. package/dist/cjs/modal-header.js +2 -82
  212. package/dist/cjs/modal-trigger.js +2 -3
  213. package/dist/cjs/modal.js +2 -3
  214. package/dist/cjs/pagination-content.js +2 -31
  215. package/dist/cjs/pagination-ellipsis.js +2 -35
  216. package/dist/cjs/pagination-first.js +2 -3
  217. package/dist/cjs/pagination-item.js +2 -3
  218. package/dist/cjs/pagination-last.js +2 -3
  219. package/dist/cjs/pagination-next.js +2 -3
  220. package/dist/cjs/pagination-previous.js +2 -3
  221. package/dist/cjs/pagination.js +2 -60
  222. package/dist/cjs/popover-content.js +2 -106
  223. package/dist/cjs/popover-trigger.js +2 -25
  224. package/dist/cjs/popover.js +2 -3
  225. package/dist/cjs/progress-bar.js +2 -85
  226. package/dist/cjs/progress-circle.js +2 -93
  227. package/dist/cjs/radio-group-card.js +2 -111
  228. package/dist/cjs/radio-group-item.js +2 -4
  229. package/dist/cjs/radio-group-label.js +2 -110
  230. package/dist/cjs/radio-group.js +2 -4
  231. package/dist/cjs/rich-editor.js +2 -430
  232. package/dist/cjs/scroll-area.js +2 -43
  233. package/dist/cjs/scroll-bar.js +2 -33
  234. package/dist/cjs/segmented-control-item.js +2 -40
  235. package/dist/cjs/segmented-control.js +2 -41
  236. package/dist/cjs/select-content.js +2 -62
  237. package/dist/cjs/select-group.js +2 -3
  238. package/dist/cjs/select-icon.js +2 -25
  239. package/dist/cjs/select-item.js +2 -45
  240. package/dist/cjs/select-label.js +2 -32
  241. package/dist/cjs/select-separator.js +2 -26
  242. package/dist/cjs/select-trigger.js +2 -41
  243. package/dist/cjs/select-value.js +2 -32
  244. package/dist/cjs/select.js +2 -3
  245. package/dist/cjs/sheet-close.js +2 -29
  246. package/dist/cjs/sheet-content.js +2 -61
  247. package/dist/cjs/sheet-description.js +2 -31
  248. package/dist/cjs/sheet-footer.js +2 -28
  249. package/dist/cjs/sheet-header.js +2 -23
  250. package/dist/cjs/sheet-title.js +2 -31
  251. package/dist/cjs/sheet-trigger.js +2 -3
  252. package/dist/cjs/sheet.js +2 -3
  253. package/dist/cjs/shims.js +0 -1
  254. package/dist/cjs/sidebar-content.js +2 -4
  255. package/dist/cjs/sidebar-element.js +2 -4
  256. package/dist/cjs/sidebar-footer.js +2 -4
  257. package/dist/cjs/sidebar-group-content.js +2 -24
  258. package/dist/cjs/sidebar-group-label.js +2 -4
  259. package/dist/cjs/sidebar-group.js +2 -4
  260. package/dist/cjs/sidebar-header.js +2 -4
  261. package/dist/cjs/sidebar-menu-action.js +2 -4
  262. package/dist/cjs/sidebar-menu-badge.js +2 -4
  263. package/dist/cjs/sidebar-menu-button.js +2 -4
  264. package/dist/cjs/sidebar-menu-item.js +2 -4
  265. package/dist/cjs/sidebar-menu-sub-button.js +2 -4
  266. package/dist/cjs/sidebar-menu-sub-item.js +2 -4
  267. package/dist/cjs/sidebar-menu-sub.js +2 -4
  268. package/dist/cjs/sidebar-menu.js +2 -4
  269. package/dist/cjs/sidebar-provider.js +2 -3
  270. package/dist/cjs/sidebar-separator.js +2 -3
  271. package/dist/cjs/sidebar-trigger.js +2 -34
  272. package/dist/cjs/sidebar.js +2 -4
  273. package/dist/cjs/slider.js +2 -4
  274. package/dist/cjs/social-button.js +2 -45
  275. package/dist/cjs/sonner-alert.js +2 -42
  276. package/dist/cjs/sonner.js +2 -3
  277. package/dist/cjs/status-badge.js +2 -50
  278. package/dist/cjs/switch.js +2 -4
  279. package/dist/cjs/tab-menu-content.js +2 -33
  280. package/dist/cjs/tab-menu-item.js +2 -45
  281. package/dist/cjs/tab-menu-list.js +2 -35
  282. package/dist/cjs/tab-menu.js +2 -33
  283. package/dist/cjs/table-body.js +2 -23
  284. package/dist/cjs/table-caption.js +2 -23
  285. package/dist/cjs/table-cell.js +2 -26
  286. package/dist/cjs/table-empty.js +2 -44
  287. package/dist/cjs/table-footer.js +2 -23
  288. package/dist/cjs/table-head.js +2 -24
  289. package/dist/cjs/table-header.js +2 -3
  290. package/dist/cjs/table-row.js +2 -32
  291. package/dist/cjs/table.js +2 -26
  292. package/dist/cjs/tag.js +2 -47
  293. package/dist/cjs/text-input-affix.js +2 -27
  294. package/dist/cjs/text-input-button.js +2 -32
  295. package/dist/cjs/text-input.js +2 -120
  296. package/dist/cjs/textarea.js +2 -57
  297. package/dist/cjs/tooltip-content.js +2 -94
  298. package/dist/cjs/tooltip-provider.js +2 -3
  299. package/dist/cjs/tooltip-root.js +2 -3
  300. package/dist/cjs/tooltip-trigger.js +2 -3
  301. package/dist/cjs/tooltip.js +2 -3
  302. package/dist/cjs/types.js +0 -1
  303. package/dist/cjs/use-color-model.js +3 -32
  304. package/dist/cjs/use-delegated-props.js +12 -10
  305. package/dist/cjs/use-sidebar.js +10 -9
  306. package/dist/cjs/use-user-select.js +37 -35
  307. package/dist/components/alert/alert.d.ts +14 -9
  308. package/dist/components/badge/badge.d.ts +4 -3
  309. package/dist/components/badge/status-badge.d.ts +4 -3
  310. package/dist/components/button/button.d.ts +5 -4
  311. package/dist/components/button/compact-button.d.ts +3 -2
  312. package/dist/components/button/fancy-button.d.ts +5 -4
  313. package/dist/components/button/link-button.d.ts +5 -4
  314. package/dist/components/button/social-button.d.ts +3 -2
  315. package/dist/components/checkbox/checkbox-card.d.ts +23 -21
  316. package/dist/components/checkbox/checkbox-label.d.ts +17 -16
  317. package/dist/components/checkbox/checkbox.d.ts +2 -1
  318. package/dist/components/collapsible/collapsible-content.d.ts +5 -4
  319. package/dist/components/collapsible/collapsible-trigger.d.ts +5 -4
  320. package/dist/components/collapsible/collapsible.d.ts +6 -5
  321. package/dist/components/color-picker/alpha-slider.d.ts +4 -5
  322. package/dist/components/color-picker/color-area.d.ts +2 -3
  323. package/dist/components/color-picker/color-picker.d.ts +5 -4
  324. package/dist/components/color-picker/color-swatch.d.ts +4 -3
  325. package/dist/components/color-picker/hue-slider.d.ts +7 -8
  326. package/dist/components/combobox/combobox-anchor.d.ts +7 -11
  327. package/dist/components/combobox/combobox-empty.d.ts +7 -11
  328. package/dist/components/combobox/combobox-group.d.ts +7 -11
  329. package/dist/components/combobox/combobox-input.d.ts +5 -3
  330. package/dist/components/combobox/combobox-item.d.ts +7 -5
  331. package/dist/components/combobox/combobox-list.d.ts +7 -11
  332. package/dist/components/combobox/combobox-root.d.ts +7 -11
  333. package/dist/components/combobox/combobox-separator.d.ts +7 -11
  334. package/dist/components/combobox/combobox-trigger.d.ts +5 -4
  335. package/dist/components/combobox/combobox.d.ts +9 -7
  336. package/dist/components/content-divider/content-divider.d.ts +3 -2
  337. package/dist/components/counter-input/counter-input.d.ts +2 -1
  338. package/dist/components/digit-input/digit-input-group.d.ts +7 -11
  339. package/dist/components/digit-input/digit-input-slot.d.ts +2 -1
  340. package/dist/components/digit-input/digit-input.d.ts +7 -11
  341. package/dist/components/dropdown-menu/dropdown-menu-content.d.ts +7 -11
  342. package/dist/components/dropdown-menu/dropdown-menu-group.d.ts +7 -11
  343. package/dist/components/dropdown-menu/dropdown-menu-item.d.ts +11 -13
  344. package/dist/components/dropdown-menu/dropdown-menu-label.d.ts +7 -11
  345. package/dist/components/dropdown-menu/dropdown-menu-separator.d.ts +2 -1
  346. package/dist/components/dropdown-menu/dropdown-menu-sub-content.d.ts +7 -11
  347. package/dist/components/dropdown-menu/dropdown-menu-sub-trigger.d.ts +9 -12
  348. package/dist/components/dropdown-menu/dropdown-menu-sub.d.ts +7 -11
  349. package/dist/components/dropdown-menu/dropdown-menu-trigger.d.ts +7 -11
  350. package/dist/components/dropdown-menu/dropdown-menu.d.ts +7 -11
  351. package/dist/components/file-upload/file-upload-area.d.ts +8 -9
  352. package/dist/components/hint-text/hint-text.d.ts +4 -3
  353. package/dist/components/label/label.d.ts +11 -14
  354. package/dist/components/modal/modal-body.d.ts +7 -11
  355. package/dist/components/modal/modal-close.d.ts +7 -11
  356. package/dist/components/modal/modal-content.d.ts +7 -11
  357. package/dist/components/modal/modal-footer.d.ts +7 -11
  358. package/dist/components/modal/modal-header.d.ts +3 -2
  359. package/dist/components/modal/modal-trigger.d.ts +7 -11
  360. package/dist/components/modal/modal.d.ts +7 -11
  361. package/dist/components/pagination/pagination-content.d.ts +6 -5
  362. package/dist/components/pagination/pagination-ellipsis.d.ts +5 -4
  363. package/dist/components/pagination/pagination-first.d.ts +5 -4
  364. package/dist/components/pagination/pagination-item.d.ts +5 -4
  365. package/dist/components/pagination/pagination-last.d.ts +5 -4
  366. package/dist/components/pagination/pagination-next.d.ts +5 -4
  367. package/dist/components/pagination/pagination-previous.d.ts +5 -4
  368. package/dist/components/pagination/pagination.d.ts +12 -9
  369. package/dist/components/popover/popover-content.d.ts +7 -5
  370. package/dist/components/popover/popover-trigger.d.ts +7 -11
  371. package/dist/components/popover/popover.d.ts +7 -11
  372. package/dist/components/progress/progress-bar.d.ts +10 -13
  373. package/dist/components/progress/progress-circle.d.ts +7 -11
  374. package/dist/components/radio-group/radio-group-card.d.ts +23 -21
  375. package/dist/components/radio-group/radio-group-item.d.ts +2 -1
  376. package/dist/components/radio-group/radio-group-label.d.ts +17 -16
  377. package/dist/components/radio-group/radio-group.d.ts +7 -11
  378. package/dist/components/rich-editor/extra-settings.d.ts +2 -1
  379. package/dist/components/rich-editor/link-bubble.d.ts +3 -4
  380. package/dist/components/rich-editor/rich-editor.d.ts +2 -1
  381. package/dist/components/scroll-area/scroll-area.d.ts +7 -11
  382. package/dist/components/scroll-area/scroll-bar.d.ts +2 -1
  383. package/dist/components/segmented-control/segmented-control-item.d.ts +7 -11
  384. package/dist/components/segmented-control/segmented-control.d.ts +7 -11
  385. package/dist/components/select/select-content.d.ts +7 -11
  386. package/dist/components/select/select-group.d.ts +7 -11
  387. package/dist/components/select/select-icon.d.ts +7 -11
  388. package/dist/components/select/select-item.d.ts +7 -11
  389. package/dist/components/select/select-label.d.ts +7 -11
  390. package/dist/components/select/select-separator.d.ts +2 -1
  391. package/dist/components/select/select-trigger.d.ts +7 -11
  392. package/dist/components/select/select-value.d.ts +7 -11
  393. package/dist/components/select/select.d.ts +7 -11
  394. package/dist/components/sheet/sheet-close.d.ts +5 -4
  395. package/dist/components/sheet/sheet-content.d.ts +5 -4
  396. package/dist/components/sheet/sheet-description.d.ts +5 -4
  397. package/dist/components/sheet/sheet-footer.d.ts +5 -4
  398. package/dist/components/sheet/sheet-header.d.ts +5 -4
  399. package/dist/components/sheet/sheet-title.d.ts +5 -4
  400. package/dist/components/sheet/sheet-trigger.d.ts +5 -4
  401. package/dist/components/sheet/sheet.d.ts +7 -11
  402. package/dist/components/sidebar/sidebar-content.d.ts +7 -11
  403. package/dist/components/sidebar/sidebar-element.d.ts +5 -4
  404. package/dist/components/sidebar/sidebar-footer.d.ts +5 -4
  405. package/dist/components/sidebar/sidebar-group-content.d.ts +7 -11
  406. package/dist/components/sidebar/sidebar-group-label.d.ts +7 -11
  407. package/dist/components/sidebar/sidebar-group.d.ts +7 -11
  408. package/dist/components/sidebar/sidebar-header.d.ts +5 -4
  409. package/dist/components/sidebar/sidebar-menu-action.d.ts +5 -4
  410. package/dist/components/sidebar/sidebar-menu-badge.d.ts +4 -3
  411. package/dist/components/sidebar/sidebar-menu-button.d.ts +7 -11
  412. package/dist/components/sidebar/sidebar-menu-item.d.ts +7 -11
  413. package/dist/components/sidebar/sidebar-menu-sub-button.d.ts +5 -4
  414. package/dist/components/sidebar/sidebar-menu-sub-item.d.ts +7 -11
  415. package/dist/components/sidebar/sidebar-menu-sub.d.ts +7 -11
  416. package/dist/components/sidebar/sidebar-menu.d.ts +7 -11
  417. package/dist/components/sidebar/sidebar-provider.d.ts +8 -12
  418. package/dist/components/sidebar/sidebar-separator.d.ts +2 -1
  419. package/dist/components/sidebar/sidebar-trigger.d.ts +2 -1
  420. package/dist/components/sidebar/sidebar.d.ts +7 -5
  421. package/dist/components/slider/slider.d.ts +2 -1
  422. package/dist/components/sonner/sonner-alert.d.ts +3 -2
  423. package/dist/components/sonner/sonner.d.ts +2 -1
  424. package/dist/components/switch/switch.d.ts +2 -1
  425. package/dist/components/tab-menu/tab-menu-content.d.ts +7 -11
  426. package/dist/components/tab-menu/tab-menu-item.d.ts +11 -13
  427. package/dist/components/tab-menu/tab-menu-list.d.ts +7 -11
  428. package/dist/components/tab-menu/tab-menu.d.ts +7 -11
  429. package/dist/components/table/table-body.d.ts +5 -4
  430. package/dist/components/table/table-caption.d.ts +5 -4
  431. package/dist/components/table/table-cell.d.ts +6 -5
  432. package/dist/components/table/table-empty.d.ts +5 -4
  433. package/dist/components/table/table-footer.d.ts +5 -4
  434. package/dist/components/table/table-head.d.ts +6 -5
  435. package/dist/components/table/table-header.d.ts +5 -4
  436. package/dist/components/table/table-row.d.ts +5 -4
  437. package/dist/components/table/table.d.ts +5 -4
  438. package/dist/components/tag/tag.d.ts +5 -4
  439. package/dist/components/text-input/text-input-affix.d.ts +7 -11
  440. package/dist/components/text-input/text-input-button.d.ts +7 -11
  441. package/dist/components/text-input/text-input.d.ts +21 -15
  442. package/dist/components/textarea/textarea.d.ts +9 -8
  443. package/dist/components/tooltip/tooltip-content.d.ts +5 -4
  444. package/dist/components/tooltip/tooltip-provider.d.ts +5 -4
  445. package/dist/components/tooltip/tooltip-root.d.ts +5 -4
  446. package/dist/components/tooltip/tooltip-trigger.d.ts +5 -4
  447. package/dist/components/tooltip/tooltip.d.ts +5 -4
  448. package/dist/esm/alert.js +2 -0
  449. package/dist/esm/alpha-slider.js +2 -0
  450. package/dist/esm/badge.js +2 -0
  451. package/dist/esm/button.js +2 -0
  452. package/dist/esm/checkbox-card.js +2 -0
  453. package/dist/esm/checkbox-label.js +2 -0
  454. package/dist/esm/checkbox.js +2 -0
  455. package/dist/esm/chunks/_plugin-vue_export-helper.js +8 -0
  456. package/dist/esm/chunks/alert.js +96 -0
  457. package/dist/esm/chunks/alpha-slider.js +113 -0
  458. package/dist/esm/chunks/badge.js +52 -0
  459. package/dist/esm/chunks/button.js +36 -0
  460. package/dist/esm/chunks/checkbox-card.js +94 -0
  461. package/dist/esm/chunks/checkbox-label.js +88 -0
  462. package/dist/esm/chunks/checkbox.js +35 -0
  463. package/dist/esm/chunks/clsx.js +16 -0
  464. package/dist/esm/chunks/collapsible-content.js +25 -0
  465. package/dist/esm/chunks/collapsible-trigger.js +22 -0
  466. package/dist/esm/chunks/collapsible.js +26 -0
  467. package/dist/esm/chunks/color-area.js +166 -0
  468. package/dist/esm/chunks/color-picker.js +452 -0
  469. package/dist/esm/chunks/color-swatch.js +58 -0
  470. package/dist/esm/chunks/combobox-anchor.js +28 -0
  471. package/dist/esm/chunks/combobox-empty.js +29 -0
  472. package/dist/esm/chunks/combobox-group.js +36 -0
  473. package/dist/esm/chunks/combobox-input.js +65 -0
  474. package/dist/esm/chunks/combobox-item.js +89 -0
  475. package/dist/esm/chunks/combobox-list.js +59 -0
  476. package/dist/esm/chunks/combobox-root.js +43 -0
  477. package/dist/esm/chunks/combobox-separator.js +29 -0
  478. package/dist/esm/chunks/combobox-trigger.js +38 -0
  479. package/dist/esm/chunks/combobox.js +193 -0
  480. package/dist/esm/chunks/compact-button.js +37 -0
  481. package/dist/esm/chunks/components.js +299 -0
  482. package/dist/esm/chunks/content-divider.js +55 -0
  483. package/dist/esm/chunks/core.js +289 -0
  484. package/dist/esm/chunks/counter-input.js +70 -0
  485. package/dist/esm/chunks/digit-input-group.js +27 -0
  486. package/dist/esm/chunks/digit-input-slot.js +26 -0
  487. package/dist/esm/chunks/digit-input.js +47 -0
  488. package/dist/esm/chunks/dist.js +11525 -0
  489. package/dist/esm/chunks/dist2.js +15302 -0
  490. package/dist/esm/chunks/dropdown-menu-content.js +55 -0
  491. package/dist/esm/chunks/dropdown-menu-group.js +23 -0
  492. package/dist/esm/chunks/dropdown-menu-item.js +43 -0
  493. package/dist/esm/chunks/dropdown-menu-label.js +27 -0
  494. package/dist/esm/chunks/dropdown-menu-separator.js +24 -0
  495. package/dist/esm/chunks/dropdown-menu-sub-content.js +52 -0
  496. package/dist/esm/chunks/dropdown-menu-sub-trigger.js +39 -0
  497. package/dist/esm/chunks/dropdown-menu-sub.js +23 -0
  498. package/dist/esm/chunks/dropdown-menu-trigger.js +24 -0
  499. package/dist/esm/chunks/dropdown-menu.js +31 -0
  500. package/dist/esm/chunks/extra-settings.js +127 -0
  501. package/dist/esm/chunks/fancy-button.js +35 -0
  502. package/dist/esm/chunks/file-upload-area.js +132 -0
  503. package/dist/esm/chunks/hint-text.js +31 -0
  504. package/dist/esm/chunks/hue-slider.js +113 -0
  505. package/dist/esm/chunks/label.js +58 -0
  506. package/dist/esm/chunks/link-bubble.js +191 -0
  507. package/dist/esm/chunks/link-button.js +41 -0
  508. package/dist/esm/chunks/menus.js +1173 -0
  509. package/dist/esm/chunks/modal-body.js +17 -0
  510. package/dist/esm/chunks/modal-close.js +22 -0
  511. package/dist/esm/chunks/modal-content.js +46 -0
  512. package/dist/esm/chunks/modal-footer.js +17 -0
  513. package/dist/esm/chunks/modal-header.js +77 -0
  514. package/dist/esm/chunks/modal-trigger.js +22 -0
  515. package/dist/esm/chunks/modal.js +24 -0
  516. package/dist/esm/chunks/pagination-content.js +27 -0
  517. package/dist/esm/chunks/pagination-ellipsis.js +30 -0
  518. package/dist/esm/chunks/pagination-first.js +29 -0
  519. package/dist/esm/chunks/pagination-item.js +32 -0
  520. package/dist/esm/chunks/pagination-last.js +29 -0
  521. package/dist/esm/chunks/pagination-next.js +29 -0
  522. package/dist/esm/chunks/pagination-previous.js +29 -0
  523. package/dist/esm/chunks/pagination.js +54 -0
  524. package/dist/esm/chunks/popover-content.js +107 -0
  525. package/dist/esm/chunks/popover-trigger.js +23 -0
  526. package/dist/esm/chunks/popover.js +24 -0
  527. package/dist/esm/chunks/progress-bar.js +67 -0
  528. package/dist/esm/chunks/progress-circle.js +89 -0
  529. package/dist/esm/chunks/radio-group-card.js +94 -0
  530. package/dist/esm/chunks/radio-group-item.js +31 -0
  531. package/dist/esm/chunks/radio-group-label.js +88 -0
  532. package/dist/esm/chunks/radio-group.js +36 -0
  533. package/dist/esm/chunks/rich-editor.js +5180 -0
  534. package/dist/esm/chunks/scroll-area.js +39 -0
  535. package/dist/esm/chunks/scroll-bar.js +30 -0
  536. package/dist/esm/chunks/segmented-control-item.js +36 -0
  537. package/dist/esm/chunks/segmented-control.js +36 -0
  538. package/dist/esm/chunks/select-content.js +59 -0
  539. package/dist/esm/chunks/select-group.js +22 -0
  540. package/dist/esm/chunks/select-icon.js +19 -0
  541. package/dist/esm/chunks/select-item.js +36 -0
  542. package/dist/esm/chunks/select-label.js +28 -0
  543. package/dist/esm/chunks/select-separator.js +24 -0
  544. package/dist/esm/chunks/select-trigger.js +34 -0
  545. package/dist/esm/chunks/select-value.js +28 -0
  546. package/dist/esm/chunks/select.js +35 -0
  547. package/dist/esm/chunks/sheet-close.js +25 -0
  548. package/dist/esm/chunks/sheet-content.js +58 -0
  549. package/dist/esm/chunks/sheet-description.js +27 -0
  550. package/dist/esm/chunks/sheet-footer.js +17 -0
  551. package/dist/esm/chunks/sheet-header.js +17 -0
  552. package/dist/esm/chunks/sheet-title.js +27 -0
  553. package/dist/esm/chunks/sheet-trigger.js +22 -0
  554. package/dist/esm/chunks/sheet.js +24 -0
  555. package/dist/esm/chunks/sidebar-content.js +19 -0
  556. package/dist/esm/chunks/sidebar-element.js +28 -0
  557. package/dist/esm/chunks/sidebar-footer.js +19 -0
  558. package/dist/esm/chunks/sidebar-group-content.js +20 -0
  559. package/dist/esm/chunks/sidebar-group-label.js +33 -0
  560. package/dist/esm/chunks/sidebar-group.js +19 -0
  561. package/dist/esm/chunks/sidebar-header.js +19 -0
  562. package/dist/esm/chunks/sidebar-menu-action.js +34 -0
  563. package/dist/esm/chunks/sidebar-menu-badge.js +37 -0
  564. package/dist/esm/chunks/sidebar-menu-button.js +39 -0
  565. package/dist/esm/chunks/sidebar-menu-item.js +19 -0
  566. package/dist/esm/chunks/sidebar-menu-sub-button.js +42 -0
  567. package/dist/esm/chunks/sidebar-menu-sub-item.js +19 -0
  568. package/dist/esm/chunks/sidebar-menu-sub.js +19 -0
  569. package/dist/esm/chunks/sidebar-menu.js +19 -0
  570. package/dist/esm/chunks/sidebar-provider.js +67 -0
  571. package/dist/esm/chunks/sidebar-trigger.js +30 -0
  572. package/dist/esm/chunks/sidebar.js +63 -0
  573. package/dist/esm/chunks/slider.js +46 -0
  574. package/dist/esm/chunks/social-button.js +36 -0
  575. package/dist/esm/chunks/sonner-alert.js +34 -0
  576. package/dist/esm/chunks/sonner.js +1210 -0
  577. package/dist/esm/chunks/status-badge.js +43 -0
  578. package/dist/esm/chunks/switch.js +35 -0
  579. package/dist/esm/chunks/tab-menu-content.js +29 -0
  580. package/dist/esm/chunks/tab-menu-item.js +38 -0
  581. package/dist/esm/chunks/tab-menu-list.js +28 -0
  582. package/dist/esm/chunks/tab-menu.js +29 -0
  583. package/dist/esm/chunks/table-body.js +17 -0
  584. package/dist/esm/chunks/table-caption.js +17 -0
  585. package/dist/esm/chunks/table-cell.js +23 -0
  586. package/dist/esm/chunks/table-footer.js +17 -0
  587. package/dist/esm/chunks/table-head.js +23 -0
  588. package/dist/esm/chunks/table-header.js +16 -0
  589. package/dist/esm/chunks/table-row.js +26 -0
  590. package/dist/esm/chunks/table.js +38 -0
  591. package/dist/esm/chunks/table2.js +19 -0
  592. package/dist/esm/chunks/tag.js +52 -0
  593. package/dist/esm/chunks/text-input-affix.js +23 -0
  594. package/dist/esm/chunks/text-input-button.js +31 -0
  595. package/dist/esm/chunks/text-input.js +112 -0
  596. package/dist/esm/chunks/textarea.js +54 -0
  597. package/dist/esm/chunks/tooltip-content.js +102 -0
  598. package/dist/esm/chunks/tooltip-provider.js +26 -0
  599. package/dist/esm/chunks/tooltip-root.js +35 -0
  600. package/dist/esm/chunks/tooltip-trigger.js +22 -0
  601. package/dist/esm/chunks/tooltip.js +94 -0
  602. package/dist/esm/chunks/use-color-model.js +925 -0
  603. package/dist/esm/collapsible-content.js +2 -0
  604. package/dist/esm/collapsible-trigger.js +2 -0
  605. package/dist/esm/collapsible.js +2 -0
  606. package/dist/esm/color-area.js +2 -0
  607. package/dist/esm/color-picker.js +2 -0
  608. package/dist/esm/color-swatch.js +2 -0
  609. package/dist/esm/color.js +92 -0
  610. package/dist/esm/combobox-anchor.js +2 -0
  611. package/dist/esm/combobox-empty.js +2 -0
  612. package/dist/esm/combobox-group.js +2 -0
  613. package/dist/esm/combobox-input.js +2 -0
  614. package/dist/esm/combobox-item.js +2 -0
  615. package/dist/esm/combobox-list.js +2 -0
  616. package/dist/esm/combobox-root.js +2 -0
  617. package/dist/esm/combobox-separator.js +2 -0
  618. package/dist/esm/combobox-trigger.js +2 -0
  619. package/dist/esm/combobox.js +2 -0
  620. package/dist/esm/command-group.js +35 -0
  621. package/dist/esm/command-input.js +41 -0
  622. package/dist/esm/command-item.js +31 -0
  623. package/dist/esm/command-list.js +56 -0
  624. package/dist/esm/command-root.js +51 -0
  625. package/dist/esm/command-separator.js +29 -0
  626. package/dist/esm/compact-button.js +2 -0
  627. package/dist/esm/config.js +298 -0
  628. package/dist/esm/content-divider.js +2 -0
  629. package/dist/esm/counter-input.js +2 -0
  630. package/dist/esm/crypto.js +6 -0
  631. package/dist/esm/digit-input-group.js +2 -0
  632. package/dist/esm/digit-input-slot.js +2 -0
  633. package/dist/esm/digit-input.js +2 -0
  634. package/dist/esm/dropdown-menu-content.js +2 -0
  635. package/dist/esm/dropdown-menu-group.js +2 -0
  636. package/dist/esm/dropdown-menu-item.js +2 -0
  637. package/dist/esm/dropdown-menu-label.js +2 -0
  638. package/dist/esm/dropdown-menu-separator.js +2 -0
  639. package/dist/esm/dropdown-menu-sub-content.js +2 -0
  640. package/dist/esm/dropdown-menu-sub-trigger.js +2 -0
  641. package/dist/esm/dropdown-menu-sub.js +2 -0
  642. package/dist/esm/dropdown-menu-trigger.js +2 -0
  643. package/dist/esm/dropdown-menu.js +2 -0
  644. package/dist/esm/extra-settings.js +2 -0
  645. package/dist/esm/fancy-button.js +2 -0
  646. package/dist/esm/file-upload-area.js +2 -0
  647. package/dist/esm/hint-text.js +2 -0
  648. package/dist/esm/hue-slider.js +2 -0
  649. package/dist/esm/index.js +212 -0
  650. package/dist/esm/label.js +2 -0
  651. package/dist/esm/link-bubble.js +2 -0
  652. package/dist/esm/link-button.js +2 -0
  653. package/dist/esm/modal-body.js +2 -0
  654. package/dist/esm/modal-close.js +2 -0
  655. package/dist/esm/modal-content.js +2 -0
  656. package/dist/esm/modal-footer.js +2 -0
  657. package/dist/esm/modal-header.js +2 -0
  658. package/dist/esm/modal-trigger.js +2 -0
  659. package/dist/esm/modal.js +2 -0
  660. package/dist/esm/pagination-content.js +2 -0
  661. package/dist/esm/pagination-ellipsis.js +2 -0
  662. package/dist/esm/pagination-first.js +2 -0
  663. package/dist/esm/pagination-item.js +2 -0
  664. package/dist/esm/pagination-last.js +2 -0
  665. package/dist/esm/pagination-next.js +2 -0
  666. package/dist/esm/pagination-previous.js +2 -0
  667. package/dist/esm/pagination.js +2 -0
  668. package/dist/esm/popover-content.js +2 -0
  669. package/dist/esm/popover-trigger.js +2 -0
  670. package/dist/esm/popover.js +2 -0
  671. package/dist/esm/progress-bar.js +2 -0
  672. package/dist/esm/progress-circle.js +2 -0
  673. package/dist/esm/radio-group-card.js +2 -0
  674. package/dist/esm/radio-group-item.js +2 -0
  675. package/dist/esm/radio-group-label.js +2 -0
  676. package/dist/esm/radio-group.js +2 -0
  677. package/dist/esm/rich-editor.js +2 -0
  678. package/dist/esm/scroll-area.js +2 -0
  679. package/dist/esm/scroll-bar.js +2 -0
  680. package/dist/esm/segmented-control-item.js +2 -0
  681. package/dist/esm/segmented-control.js +2 -0
  682. package/dist/esm/select-content.js +2 -0
  683. package/dist/esm/select-group.js +2 -0
  684. package/dist/esm/select-icon.js +2 -0
  685. package/dist/esm/select-item.js +2 -0
  686. package/dist/esm/select-label.js +2 -0
  687. package/dist/esm/select-separator.js +2 -0
  688. package/dist/esm/select-trigger.js +2 -0
  689. package/dist/esm/select-value.js +2 -0
  690. package/dist/esm/select.js +2 -0
  691. package/dist/esm/sheet-close.js +2 -0
  692. package/dist/esm/sheet-content.js +2 -0
  693. package/dist/esm/sheet-description.js +2 -0
  694. package/dist/esm/sheet-footer.js +2 -0
  695. package/dist/esm/sheet-header.js +2 -0
  696. package/dist/esm/sheet-title.js +2 -0
  697. package/dist/esm/sheet-trigger.js +2 -0
  698. package/dist/esm/sheet.js +2 -0
  699. package/dist/esm/shims.js +0 -0
  700. package/dist/esm/sidebar-content.js +2 -0
  701. package/dist/esm/sidebar-element.js +2 -0
  702. package/dist/esm/sidebar-footer.js +2 -0
  703. package/dist/esm/sidebar-group-content.js +2 -0
  704. package/dist/esm/sidebar-group-label.js +2 -0
  705. package/dist/esm/sidebar-group.js +2 -0
  706. package/dist/esm/sidebar-header.js +2 -0
  707. package/dist/esm/sidebar-menu-action.js +2 -0
  708. package/dist/esm/sidebar-menu-badge.js +2 -0
  709. package/dist/esm/sidebar-menu-button.js +2 -0
  710. package/dist/esm/sidebar-menu-item.js +2 -0
  711. package/dist/esm/sidebar-menu-sub-button.js +2 -0
  712. package/dist/esm/sidebar-menu-sub-item.js +2 -0
  713. package/dist/esm/sidebar-menu-sub.js +2 -0
  714. package/dist/esm/sidebar-menu.js +2 -0
  715. package/dist/esm/sidebar-provider.js +2 -0
  716. package/dist/esm/sidebar-separator.js +2 -0
  717. package/dist/esm/sidebar-trigger.js +2 -0
  718. package/dist/esm/sidebar.js +2 -0
  719. package/dist/esm/slider.js +2 -0
  720. package/dist/esm/social-button.js +2 -0
  721. package/dist/esm/sonner-alert.js +2 -0
  722. package/dist/esm/sonner.js +2 -0
  723. package/dist/esm/status-badge.js +2 -0
  724. package/dist/esm/switch.js +2 -0
  725. package/dist/esm/tab-menu-content.js +2 -0
  726. package/dist/esm/tab-menu-item.js +2 -0
  727. package/dist/esm/tab-menu-list.js +2 -0
  728. package/dist/esm/tab-menu.js +2 -0
  729. package/dist/esm/table-body.js +2 -0
  730. package/dist/esm/table-caption.js +2 -0
  731. package/dist/esm/table-cell.js +2 -0
  732. package/dist/esm/table-empty.js +2 -0
  733. package/dist/esm/table-footer.js +2 -0
  734. package/dist/esm/table-head.js +2 -0
  735. package/dist/esm/table-header.js +2 -0
  736. package/dist/esm/table-row.js +2 -0
  737. package/dist/esm/table.js +2 -0
  738. package/dist/esm/tag.js +2 -0
  739. package/dist/esm/text-input-affix.js +2 -0
  740. package/dist/esm/text-input-button.js +2 -0
  741. package/dist/esm/text-input.js +2 -0
  742. package/dist/esm/textarea.js +2 -0
  743. package/dist/esm/tooltip-content.js +2 -0
  744. package/dist/esm/tooltip-provider.js +2 -0
  745. package/dist/esm/tooltip-root.js +2 -0
  746. package/dist/esm/tooltip-trigger.js +2 -0
  747. package/dist/esm/tooltip.js +2 -0
  748. package/dist/esm/types.js +0 -0
  749. package/dist/esm/use-color-model.js +2 -0
  750. package/dist/esm/use-delegated-props.js +14 -0
  751. package/dist/esm/use-sidebar.js +11 -0
  752. package/dist/esm/use-user-select.js +39 -0
  753. package/package.json +10 -10
  754. package/src/components/label/label.vue +1 -1
  755. package/dist/cjs/chunks/content-divider.vue_vue_type_style_index_0_lang.js +0 -52
  756. package/dist/cjs/chunks/index.js +0 -10879
  757. package/dist/cjs/chunks/index2.js +0 -90
  758. package/dist/cjs/chunks/index3.js +0 -272
  759. package/dist/cjs/chunks/index4.js +0 -1486
  760. package/dist/cjs/chunks/index5.js +0 -17162
  761. package/dist/cjs/chunks/rich-editor.vue_vue_type_style_index_0_scoped_4e1c9896_lang.js +0 -5272
  762. package/dist/cjs/chunks/sidebar-provider.vue_vue_type_style_index_0_lang.js +0 -63
  763. package/dist/cjs/chunks/sidebar-separator.vue_vue_type_style_index_0_lang.js +0 -137
  764. package/dist/cjs/chunks/tinycolor.js +0 -965
  765. package/dist/es/alert.js +0 -113
  766. package/dist/es/alpha-slider.js +0 -4
  767. package/dist/es/badge.js +0 -60
  768. package/dist/es/button.js +0 -41
  769. package/dist/es/checkbox-card.js +0 -112
  770. package/dist/es/checkbox-label.js +0 -111
  771. package/dist/es/checkbox.js +0 -5
  772. package/dist/es/chunks/_plugin-vue_export-helper.js +0 -10
  773. package/dist/es/chunks/alpha-slider.js +0 -128
  774. package/dist/es/chunks/checkbox.js +0 -39
  775. package/dist/es/chunks/clsx.js +0 -16
  776. package/dist/es/chunks/collapsible-content.js +0 -28
  777. package/dist/es/chunks/collapsible-trigger.js +0 -23
  778. package/dist/es/chunks/collapsible.js +0 -29
  779. package/dist/es/chunks/combobox-anchor.js +0 -32
  780. package/dist/es/chunks/content-divider.vue_vue_type_style_index_0_lang.js +0 -53
  781. package/dist/es/chunks/counter-input.js +0 -71
  782. package/dist/es/chunks/dropdown-menu-sub.js +0 -26
  783. package/dist/es/chunks/index.js +0 -10864
  784. package/dist/es/chunks/index2.js +0 -91
  785. package/dist/es/chunks/index3.js +0 -273
  786. package/dist/es/chunks/index4.js +0 -1486
  787. package/dist/es/chunks/index5.js +0 -17163
  788. package/dist/es/chunks/modal-close.js +0 -23
  789. package/dist/es/chunks/modal-trigger.js +0 -23
  790. package/dist/es/chunks/modal.js +0 -27
  791. package/dist/es/chunks/pagination-first.js +0 -33
  792. package/dist/es/chunks/pagination-item.js +0 -33
  793. package/dist/es/chunks/pagination-last.js +0 -33
  794. package/dist/es/chunks/pagination-next.js +0 -33
  795. package/dist/es/chunks/pagination-previous.js +0 -33
  796. package/dist/es/chunks/popover.js +0 -27
  797. package/dist/es/chunks/radio-group-item.js +0 -35
  798. package/dist/es/chunks/radio-group.js +0 -40
  799. package/dist/es/chunks/rich-editor.vue_vue_type_style_index_0_scoped_4e1c9896_lang.js +0 -5273
  800. package/dist/es/chunks/select-group.js +0 -23
  801. package/dist/es/chunks/select.js +0 -39
  802. package/dist/es/chunks/sheet-trigger.js +0 -23
  803. package/dist/es/chunks/sheet.js +0 -27
  804. package/dist/es/chunks/sidebar-content.js +0 -22
  805. package/dist/es/chunks/sidebar-element.js +0 -29
  806. package/dist/es/chunks/sidebar-footer.js +0 -22
  807. package/dist/es/chunks/sidebar-group-label.js +0 -30
  808. package/dist/es/chunks/sidebar-group.js +0 -22
  809. package/dist/es/chunks/sidebar-header.js +0 -22
  810. package/dist/es/chunks/sidebar-menu-action.js +0 -35
  811. package/dist/es/chunks/sidebar-menu-badge.js +0 -30
  812. package/dist/es/chunks/sidebar-menu-button.js +0 -40
  813. package/dist/es/chunks/sidebar-menu-item.js +0 -22
  814. package/dist/es/chunks/sidebar-menu-sub-button.js +0 -38
  815. package/dist/es/chunks/sidebar-menu-sub-item.js +0 -22
  816. package/dist/es/chunks/sidebar-menu-sub.js +0 -22
  817. package/dist/es/chunks/sidebar-menu.js +0 -22
  818. package/dist/es/chunks/sidebar-provider.vue_vue_type_style_index_0_lang.js +0 -64
  819. package/dist/es/chunks/sidebar-separator.vue_vue_type_style_index_0_lang.js +0 -138
  820. package/dist/es/chunks/sidebar.js +0 -85
  821. package/dist/es/chunks/slider.js +0 -53
  822. package/dist/es/chunks/sonner.js +0 -1223
  823. package/dist/es/chunks/switch.js +0 -39
  824. package/dist/es/chunks/table-header.js +0 -21
  825. package/dist/es/chunks/tinycolor.js +0 -966
  826. package/dist/es/chunks/tooltip-provider.js +0 -27
  827. package/dist/es/chunks/tooltip-root.js +0 -37
  828. package/dist/es/chunks/tooltip-trigger.js +0 -24
  829. package/dist/es/chunks/tooltip.js +0 -85
  830. package/dist/es/collapsible-content.js +0 -5
  831. package/dist/es/collapsible-trigger.js +0 -4
  832. package/dist/es/collapsible.js +0 -4
  833. package/dist/es/color-area.js +0 -177
  834. package/dist/es/color-picker.js +0 -519
  835. package/dist/es/color-swatch.js +0 -62
  836. package/dist/es/color.js +0 -102
  837. package/dist/es/combobox-anchor.js +0 -4
  838. package/dist/es/combobox-empty.js +0 -34
  839. package/dist/es/combobox-group.js +0 -44
  840. package/dist/es/combobox-input.js +0 -66
  841. package/dist/es/combobox-item.js +0 -112
  842. package/dist/es/combobox-list.js +0 -64
  843. package/dist/es/combobox-root.js +0 -43
  844. package/dist/es/combobox-separator.js +0 -34
  845. package/dist/es/combobox-trigger.js +0 -49
  846. package/dist/es/combobox.js +0 -241
  847. package/dist/es/command-group.js +0 -42
  848. package/dist/es/command-input.js +0 -43
  849. package/dist/es/command-item.js +0 -35
  850. package/dist/es/command-list.js +0 -53
  851. package/dist/es/command-root.js +0 -47
  852. package/dist/es/command-separator.js +0 -33
  853. package/dist/es/compact-button.js +0 -44
  854. package/dist/es/config.js +0 -136
  855. package/dist/es/content-divider.js +0 -4
  856. package/dist/es/counter-input.js +0 -5
  857. package/dist/es/crypto.js +0 -8
  858. package/dist/es/digit-input-group.js +0 -33
  859. package/dist/es/digit-input-slot.js +0 -30
  860. package/dist/es/digit-input.js +0 -48
  861. package/dist/es/dropdown-menu-content.js +0 -55
  862. package/dist/es/dropdown-menu-group.js +0 -26
  863. package/dist/es/dropdown-menu-item.js +0 -55
  864. package/dist/es/dropdown-menu-label.js +0 -33
  865. package/dist/es/dropdown-menu-separator.js +0 -27
  866. package/dist/es/dropdown-menu-sub-content.js +0 -52
  867. package/dist/es/dropdown-menu-sub-trigger.js +0 -46
  868. package/dist/es/dropdown-menu-sub.js +0 -4
  869. package/dist/es/dropdown-menu-trigger.js +0 -28
  870. package/dist/es/dropdown-menu.js +0 -37
  871. package/dist/es/extra-settings.js +0 -157
  872. package/dist/es/fancy-button.js +0 -39
  873. package/dist/es/file-upload-area.js +0 -147
  874. package/dist/es/hint-text.js +0 -38
  875. package/dist/es/hue-slider.js +0 -135
  876. package/dist/es/index.js +0 -526
  877. package/dist/es/label.js +0 -57
  878. package/dist/es/link-bubble.js +0 -243
  879. package/dist/es/link-button.js +0 -45
  880. package/dist/es/modal-body.js +0 -24
  881. package/dist/es/modal-close.js +0 -4
  882. package/dist/es/modal-content.js +0 -50
  883. package/dist/es/modal-footer.js +0 -24
  884. package/dist/es/modal-header.js +0 -83
  885. package/dist/es/modal-trigger.js +0 -4
  886. package/dist/es/modal.js +0 -4
  887. package/dist/es/pagination-content.js +0 -32
  888. package/dist/es/pagination-ellipsis.js +0 -36
  889. package/dist/es/pagination-first.js +0 -4
  890. package/dist/es/pagination-item.js +0 -4
  891. package/dist/es/pagination-last.js +0 -4
  892. package/dist/es/pagination-next.js +0 -4
  893. package/dist/es/pagination-previous.js +0 -4
  894. package/dist/es/pagination.js +0 -61
  895. package/dist/es/popover-content.js +0 -107
  896. package/dist/es/popover-trigger.js +0 -26
  897. package/dist/es/popover.js +0 -4
  898. package/dist/es/progress-bar.js +0 -86
  899. package/dist/es/progress-circle.js +0 -94
  900. package/dist/es/radio-group-card.js +0 -112
  901. package/dist/es/radio-group-item.js +0 -5
  902. package/dist/es/radio-group-label.js +0 -111
  903. package/dist/es/radio-group.js +0 -5
  904. package/dist/es/rich-editor.js +0 -431
  905. package/dist/es/scroll-area.js +0 -44
  906. package/dist/es/scroll-bar.js +0 -34
  907. package/dist/es/segmented-control-item.js +0 -41
  908. package/dist/es/segmented-control.js +0 -42
  909. package/dist/es/select-content.js +0 -63
  910. package/dist/es/select-group.js +0 -4
  911. package/dist/es/select-icon.js +0 -26
  912. package/dist/es/select-item.js +0 -46
  913. package/dist/es/select-label.js +0 -33
  914. package/dist/es/select-separator.js +0 -27
  915. package/dist/es/select-trigger.js +0 -42
  916. package/dist/es/select-value.js +0 -33
  917. package/dist/es/select.js +0 -4
  918. package/dist/es/sheet-close.js +0 -30
  919. package/dist/es/sheet-content.js +0 -62
  920. package/dist/es/sheet-description.js +0 -32
  921. package/dist/es/sheet-footer.js +0 -29
  922. package/dist/es/sheet-header.js +0 -24
  923. package/dist/es/sheet-title.js +0 -32
  924. package/dist/es/sheet-trigger.js +0 -4
  925. package/dist/es/sheet.js +0 -4
  926. package/dist/es/shims.js +0 -1
  927. package/dist/es/sidebar-content.js +0 -5
  928. package/dist/es/sidebar-element.js +0 -5
  929. package/dist/es/sidebar-footer.js +0 -5
  930. package/dist/es/sidebar-group-content.js +0 -25
  931. package/dist/es/sidebar-group-label.js +0 -5
  932. package/dist/es/sidebar-group.js +0 -5
  933. package/dist/es/sidebar-header.js +0 -5
  934. package/dist/es/sidebar-menu-action.js +0 -5
  935. package/dist/es/sidebar-menu-badge.js +0 -5
  936. package/dist/es/sidebar-menu-button.js +0 -5
  937. package/dist/es/sidebar-menu-item.js +0 -5
  938. package/dist/es/sidebar-menu-sub-button.js +0 -5
  939. package/dist/es/sidebar-menu-sub-item.js +0 -5
  940. package/dist/es/sidebar-menu-sub.js +0 -5
  941. package/dist/es/sidebar-menu.js +0 -5
  942. package/dist/es/sidebar-provider.js +0 -4
  943. package/dist/es/sidebar-separator.js +0 -4
  944. package/dist/es/sidebar-trigger.js +0 -35
  945. package/dist/es/sidebar.js +0 -5
  946. package/dist/es/slider.js +0 -5
  947. package/dist/es/social-button.js +0 -46
  948. package/dist/es/sonner-alert.js +0 -43
  949. package/dist/es/sonner.js +0 -4
  950. package/dist/es/status-badge.js +0 -51
  951. package/dist/es/switch.js +0 -5
  952. package/dist/es/tab-menu-content.js +0 -34
  953. package/dist/es/tab-menu-item.js +0 -46
  954. package/dist/es/tab-menu-list.js +0 -36
  955. package/dist/es/tab-menu.js +0 -34
  956. package/dist/es/table-body.js +0 -24
  957. package/dist/es/table-caption.js +0 -24
  958. package/dist/es/table-cell.js +0 -27
  959. package/dist/es/table-empty.js +0 -45
  960. package/dist/es/table-footer.js +0 -24
  961. package/dist/es/table-head.js +0 -25
  962. package/dist/es/table-header.js +0 -4
  963. package/dist/es/table-row.js +0 -33
  964. package/dist/es/table.js +0 -27
  965. package/dist/es/tag.js +0 -48
  966. package/dist/es/text-input-affix.js +0 -28
  967. package/dist/es/text-input-button.js +0 -33
  968. package/dist/es/text-input.js +0 -121
  969. package/dist/es/textarea.js +0 -58
  970. package/dist/es/tooltip-content.js +0 -95
  971. package/dist/es/tooltip-provider.js +0 -4
  972. package/dist/es/tooltip-root.js +0 -4
  973. package/dist/es/tooltip-trigger.js +0 -4
  974. package/dist/es/tooltip.js +0 -4
  975. package/dist/es/types.js +0 -1
  976. package/dist/es/use-color-model.js +0 -33
  977. package/dist/es/use-delegated-props.js +0 -14
  978. package/dist/es/use-sidebar.js +0 -18
  979. package/dist/es/use-user-select.js +0 -39
@@ -1,1486 +0,0 @@
1
- import { aN as flip, aO as shift, aP as offset, aQ as arrow$1, aR as size, aS as autoPlacement, aT as hide, aU as inline, aV as computePosition } from "./index.js";
2
- import { S as Selection, a as SelectionRange, T as TextSelection, F as Fragment, b as Slice, P as PluginKey, k as keydownHandler, c as Plugin, i as isTextSelection, p as posToDOMRect, N as NodeSelection, g as getText, d as getTextSerializersFromSchema } from "./index5.js";
3
- import { defineComponent, ref, onMounted, nextTick, onBeforeUnmount, h } from "vue";
4
- var readFromCache;
5
- var addToCache;
6
- if (typeof WeakMap != "undefined") {
7
- let cache = /* @__PURE__ */ new WeakMap();
8
- readFromCache = (key) => cache.get(key);
9
- addToCache = (key, value) => {
10
- cache.set(key, value);
11
- return value;
12
- };
13
- } else {
14
- const cache = [];
15
- const cacheSize = 10;
16
- let cachePos = 0;
17
- readFromCache = (key) => {
18
- for (let i = 0; i < cache.length; i += 2)
19
- if (cache[i] == key) return cache[i + 1];
20
- };
21
- addToCache = (key, value) => {
22
- if (cachePos == cacheSize) cachePos = 0;
23
- cache[cachePos++] = key;
24
- return cache[cachePos++] = value;
25
- };
26
- }
27
- var TableMap = class {
28
- constructor(width, height, map, problems) {
29
- this.width = width;
30
- this.height = height;
31
- this.map = map;
32
- this.problems = problems;
33
- }
34
- // Find the dimensions of the cell at the given position.
35
- findCell(pos) {
36
- for (let i = 0; i < this.map.length; i++) {
37
- const curPos = this.map[i];
38
- if (curPos != pos) continue;
39
- const left = i % this.width;
40
- const top = i / this.width | 0;
41
- let right = left + 1;
42
- let bottom = top + 1;
43
- for (let j = 1; right < this.width && this.map[i + j] == curPos; j++) {
44
- right++;
45
- }
46
- for (let j = 1; bottom < this.height && this.map[i + this.width * j] == curPos; j++) {
47
- bottom++;
48
- }
49
- return { left, top, right, bottom };
50
- }
51
- throw new RangeError(`No cell with offset ${pos} found`);
52
- }
53
- // Find the left side of the cell at the given position.
54
- colCount(pos) {
55
- for (let i = 0; i < this.map.length; i++) {
56
- if (this.map[i] == pos) {
57
- return i % this.width;
58
- }
59
- }
60
- throw new RangeError(`No cell with offset ${pos} found`);
61
- }
62
- // Find the next cell in the given direction, starting from the cell
63
- // at `pos`, if any.
64
- nextCell(pos, axis, dir) {
65
- const { left, right, top, bottom } = this.findCell(pos);
66
- if (axis == "horiz") {
67
- if (dir < 0 ? left == 0 : right == this.width) return null;
68
- return this.map[top * this.width + (dir < 0 ? left - 1 : right)];
69
- } else {
70
- if (dir < 0 ? top == 0 : bottom == this.height) return null;
71
- return this.map[left + this.width * (dir < 0 ? top - 1 : bottom)];
72
- }
73
- }
74
- // Get the rectangle spanning the two given cells.
75
- rectBetween(a, b) {
76
- const {
77
- left: leftA,
78
- right: rightA,
79
- top: topA,
80
- bottom: bottomA
81
- } = this.findCell(a);
82
- const {
83
- left: leftB,
84
- right: rightB,
85
- top: topB,
86
- bottom: bottomB
87
- } = this.findCell(b);
88
- return {
89
- left: Math.min(leftA, leftB),
90
- top: Math.min(topA, topB),
91
- right: Math.max(rightA, rightB),
92
- bottom: Math.max(bottomA, bottomB)
93
- };
94
- }
95
- // Return the position of all cells that have the top left corner in
96
- // the given rectangle.
97
- cellsInRect(rect) {
98
- const result = [];
99
- const seen = {};
100
- for (let row = rect.top; row < rect.bottom; row++) {
101
- for (let col = rect.left; col < rect.right; col++) {
102
- const index = row * this.width + col;
103
- const pos = this.map[index];
104
- if (seen[pos]) continue;
105
- seen[pos] = true;
106
- if (col == rect.left && col && this.map[index - 1] == pos || row == rect.top && row && this.map[index - this.width] == pos) {
107
- continue;
108
- }
109
- result.push(pos);
110
- }
111
- }
112
- return result;
113
- }
114
- // Return the position at which the cell at the given row and column
115
- // starts, or would start, if a cell started there.
116
- positionAt(row, col, table) {
117
- for (let i = 0, rowStart = 0; ; i++) {
118
- const rowEnd = rowStart + table.child(i).nodeSize;
119
- if (i == row) {
120
- let index = col + row * this.width;
121
- const rowEndIndex = (row + 1) * this.width;
122
- while (index < rowEndIndex && this.map[index] < rowStart) index++;
123
- return index == rowEndIndex ? rowEnd - 1 : this.map[index];
124
- }
125
- rowStart = rowEnd;
126
- }
127
- }
128
- // Find the table map for the given table node.
129
- static get(table) {
130
- return readFromCache(table) || addToCache(table, computeMap(table));
131
- }
132
- };
133
- function computeMap(table) {
134
- if (table.type.spec.tableRole != "table")
135
- throw new RangeError("Not a table node: " + table.type.name);
136
- const width = findWidth(table), height = table.childCount;
137
- const map = [];
138
- let mapPos = 0;
139
- let problems = null;
140
- const colWidths = [];
141
- for (let i = 0, e = width * height; i < e; i++) map[i] = 0;
142
- for (let row = 0, pos = 0; row < height; row++) {
143
- const rowNode = table.child(row);
144
- pos++;
145
- for (let i = 0; ; i++) {
146
- while (mapPos < map.length && map[mapPos] != 0) mapPos++;
147
- if (i == rowNode.childCount) break;
148
- const cellNode = rowNode.child(i);
149
- const { colspan, rowspan, colwidth } = cellNode.attrs;
150
- for (let h2 = 0; h2 < rowspan; h2++) {
151
- if (h2 + row >= height) {
152
- (problems || (problems = [])).push({
153
- type: "overlong_rowspan",
154
- pos,
155
- n: rowspan - h2
156
- });
157
- break;
158
- }
159
- const start = mapPos + h2 * width;
160
- for (let w = 0; w < colspan; w++) {
161
- if (map[start + w] == 0) map[start + w] = pos;
162
- else
163
- (problems || (problems = [])).push({
164
- type: "collision",
165
- row,
166
- pos,
167
- n: colspan - w
168
- });
169
- const colW = colwidth && colwidth[w];
170
- if (colW) {
171
- const widthIndex = (start + w) % width * 2, prev = colWidths[widthIndex];
172
- if (prev == null || prev != colW && colWidths[widthIndex + 1] == 1) {
173
- colWidths[widthIndex] = colW;
174
- colWidths[widthIndex + 1] = 1;
175
- } else if (prev == colW) {
176
- colWidths[widthIndex + 1]++;
177
- }
178
- }
179
- }
180
- }
181
- mapPos += colspan;
182
- pos += cellNode.nodeSize;
183
- }
184
- const expectedPos = (row + 1) * width;
185
- let missing = 0;
186
- while (mapPos < expectedPos) if (map[mapPos++] == 0) missing++;
187
- if (missing)
188
- (problems || (problems = [])).push({ type: "missing", row, n: missing });
189
- pos++;
190
- }
191
- if (width === 0 || height === 0)
192
- (problems || (problems = [])).push({ type: "zero_sized" });
193
- const tableMap = new TableMap(width, height, map, problems);
194
- let badWidths = false;
195
- for (let i = 0; !badWidths && i < colWidths.length; i += 2)
196
- if (colWidths[i] != null && colWidths[i + 1] < height) badWidths = true;
197
- if (badWidths) findBadColWidths(tableMap, colWidths, table);
198
- return tableMap;
199
- }
200
- function findWidth(table) {
201
- let width = -1;
202
- let hasRowSpan = false;
203
- for (let row = 0; row < table.childCount; row++) {
204
- const rowNode = table.child(row);
205
- let rowWidth = 0;
206
- if (hasRowSpan)
207
- for (let j = 0; j < row; j++) {
208
- const prevRow = table.child(j);
209
- for (let i = 0; i < prevRow.childCount; i++) {
210
- const cell = prevRow.child(i);
211
- if (j + cell.attrs.rowspan > row) rowWidth += cell.attrs.colspan;
212
- }
213
- }
214
- for (let i = 0; i < rowNode.childCount; i++) {
215
- const cell = rowNode.child(i);
216
- rowWidth += cell.attrs.colspan;
217
- if (cell.attrs.rowspan > 1) hasRowSpan = true;
218
- }
219
- if (width == -1) width = rowWidth;
220
- else if (width != rowWidth) width = Math.max(width, rowWidth);
221
- }
222
- return width;
223
- }
224
- function findBadColWidths(map, colWidths, table) {
225
- if (!map.problems) map.problems = [];
226
- const seen = {};
227
- for (let i = 0; i < map.map.length; i++) {
228
- const pos = map.map[i];
229
- if (seen[pos]) continue;
230
- seen[pos] = true;
231
- const node = table.nodeAt(pos);
232
- if (!node) {
233
- throw new RangeError(`No cell with offset ${pos} found`);
234
- }
235
- let updated = null;
236
- const attrs = node.attrs;
237
- for (let j = 0; j < attrs.colspan; j++) {
238
- const col = (i + j) % map.width;
239
- const colWidth = colWidths[col * 2];
240
- if (colWidth != null && (!attrs.colwidth || attrs.colwidth[j] != colWidth))
241
- (updated || (updated = freshColWidth(attrs)))[j] = colWidth;
242
- }
243
- if (updated)
244
- map.problems.unshift({
245
- type: "colwidth mismatch",
246
- pos,
247
- colwidth: updated
248
- });
249
- }
250
- }
251
- function freshColWidth(attrs) {
252
- if (attrs.colwidth) return attrs.colwidth.slice();
253
- const result = [];
254
- for (let i = 0; i < attrs.colspan; i++) result.push(0);
255
- return result;
256
- }
257
- function tableNodeTypes(schema) {
258
- let result = schema.cached.tableNodeTypes;
259
- if (!result) {
260
- result = schema.cached.tableNodeTypes = {};
261
- for (const name in schema.nodes) {
262
- const type = schema.nodes[name], role = type.spec.tableRole;
263
- if (role) result[role] = type;
264
- }
265
- }
266
- return result;
267
- }
268
- new PluginKey("selectingCells");
269
- function cellAround($pos) {
270
- for (let d = $pos.depth - 1; d > 0; d--)
271
- if ($pos.node(d).type.spec.tableRole == "row")
272
- return $pos.node(0).resolve($pos.before(d + 1));
273
- return null;
274
- }
275
- function isInTable(state) {
276
- const $head = state.selection.$head;
277
- for (let d = $head.depth; d > 0; d--)
278
- if ($head.node(d).type.spec.tableRole == "row") return true;
279
- return false;
280
- }
281
- function selectionCell(state) {
282
- const sel = state.selection;
283
- if ("$anchorCell" in sel && sel.$anchorCell) {
284
- return sel.$anchorCell.pos > sel.$headCell.pos ? sel.$anchorCell : sel.$headCell;
285
- } else if ("node" in sel && sel.node && sel.node.type.spec.tableRole == "cell") {
286
- return sel.$anchor;
287
- }
288
- const $cell = cellAround(sel.$head) || cellNear(sel.$head);
289
- if ($cell) {
290
- return $cell;
291
- }
292
- throw new RangeError(`No cell found around position ${sel.head}`);
293
- }
294
- function cellNear($pos) {
295
- for (let after = $pos.nodeAfter, pos = $pos.pos; after; after = after.firstChild, pos++) {
296
- const role = after.type.spec.tableRole;
297
- if (role == "cell" || role == "header_cell") return $pos.doc.resolve(pos);
298
- }
299
- for (let before = $pos.nodeBefore, pos = $pos.pos; before; before = before.lastChild, pos--) {
300
- const role = before.type.spec.tableRole;
301
- if (role == "cell" || role == "header_cell")
302
- return $pos.doc.resolve(pos - before.nodeSize);
303
- }
304
- }
305
- function pointsAtCell($pos) {
306
- return $pos.parent.type.spec.tableRole == "row" && !!$pos.nodeAfter;
307
- }
308
- function inSameTable($cellA, $cellB) {
309
- return $cellA.depth == $cellB.depth && $cellA.pos >= $cellB.start(-1) && $cellA.pos <= $cellB.end(-1);
310
- }
311
- function nextCell($pos, axis, dir) {
312
- const table = $pos.node(-1);
313
- const map = TableMap.get(table);
314
- const tableStart = $pos.start(-1);
315
- const moved = map.nextCell($pos.pos - tableStart, axis, dir);
316
- return moved == null ? null : $pos.node(0).resolve(tableStart + moved);
317
- }
318
- function removeColSpan(attrs, pos, n = 1) {
319
- const result = { ...attrs, colspan: attrs.colspan - n };
320
- if (result.colwidth) {
321
- result.colwidth = result.colwidth.slice();
322
- result.colwidth.splice(pos, n);
323
- if (!result.colwidth.some((w) => w > 0)) result.colwidth = null;
324
- }
325
- return result;
326
- }
327
- var CellSelection = class _CellSelection extends Selection {
328
- // A table selection is identified by its anchor and head cells. The
329
- // positions given to this constructor should point _before_ two
330
- // cells in the same table. They may be the same, to select a single
331
- // cell.
332
- constructor($anchorCell, $headCell = $anchorCell) {
333
- const table = $anchorCell.node(-1);
334
- const map = TableMap.get(table);
335
- const tableStart = $anchorCell.start(-1);
336
- const rect = map.rectBetween(
337
- $anchorCell.pos - tableStart,
338
- $headCell.pos - tableStart
339
- );
340
- const doc = $anchorCell.node(0);
341
- const cells = map.cellsInRect(rect).filter((p) => p != $headCell.pos - tableStart);
342
- cells.unshift($headCell.pos - tableStart);
343
- const ranges = cells.map((pos) => {
344
- const cell = table.nodeAt(pos);
345
- if (!cell) {
346
- throw RangeError(`No cell with offset ${pos} found`);
347
- }
348
- const from = tableStart + pos + 1;
349
- return new SelectionRange(
350
- doc.resolve(from),
351
- doc.resolve(from + cell.content.size)
352
- );
353
- });
354
- super(ranges[0].$from, ranges[0].$to, ranges);
355
- this.$anchorCell = $anchorCell;
356
- this.$headCell = $headCell;
357
- }
358
- map(doc, mapping) {
359
- const $anchorCell = doc.resolve(mapping.map(this.$anchorCell.pos));
360
- const $headCell = doc.resolve(mapping.map(this.$headCell.pos));
361
- if (pointsAtCell($anchorCell) && pointsAtCell($headCell) && inSameTable($anchorCell, $headCell)) {
362
- const tableChanged = this.$anchorCell.node(-1) != $anchorCell.node(-1);
363
- if (tableChanged && this.isRowSelection())
364
- return _CellSelection.rowSelection($anchorCell, $headCell);
365
- else if (tableChanged && this.isColSelection())
366
- return _CellSelection.colSelection($anchorCell, $headCell);
367
- else return new _CellSelection($anchorCell, $headCell);
368
- }
369
- return TextSelection.between($anchorCell, $headCell);
370
- }
371
- // Returns a rectangular slice of table rows containing the selected
372
- // cells.
373
- content() {
374
- const table = this.$anchorCell.node(-1);
375
- const map = TableMap.get(table);
376
- const tableStart = this.$anchorCell.start(-1);
377
- const rect = map.rectBetween(
378
- this.$anchorCell.pos - tableStart,
379
- this.$headCell.pos - tableStart
380
- );
381
- const seen = {};
382
- const rows = [];
383
- for (let row = rect.top; row < rect.bottom; row++) {
384
- const rowContent = [];
385
- for (let index = row * map.width + rect.left, col = rect.left; col < rect.right; col++, index++) {
386
- const pos = map.map[index];
387
- if (seen[pos]) continue;
388
- seen[pos] = true;
389
- const cellRect = map.findCell(pos);
390
- let cell = table.nodeAt(pos);
391
- if (!cell) {
392
- throw RangeError(`No cell with offset ${pos} found`);
393
- }
394
- const extraLeft = rect.left - cellRect.left;
395
- const extraRight = cellRect.right - rect.right;
396
- if (extraLeft > 0 || extraRight > 0) {
397
- let attrs = cell.attrs;
398
- if (extraLeft > 0) {
399
- attrs = removeColSpan(attrs, 0, extraLeft);
400
- }
401
- if (extraRight > 0) {
402
- attrs = removeColSpan(
403
- attrs,
404
- attrs.colspan - extraRight,
405
- extraRight
406
- );
407
- }
408
- if (cellRect.left < rect.left) {
409
- cell = cell.type.createAndFill(attrs);
410
- if (!cell) {
411
- throw RangeError(
412
- `Could not create cell with attrs ${JSON.stringify(attrs)}`
413
- );
414
- }
415
- } else {
416
- cell = cell.type.create(attrs, cell.content);
417
- }
418
- }
419
- if (cellRect.top < rect.top || cellRect.bottom > rect.bottom) {
420
- const attrs = {
421
- ...cell.attrs,
422
- rowspan: Math.min(cellRect.bottom, rect.bottom) - Math.max(cellRect.top, rect.top)
423
- };
424
- if (cellRect.top < rect.top) {
425
- cell = cell.type.createAndFill(attrs);
426
- } else {
427
- cell = cell.type.create(attrs, cell.content);
428
- }
429
- }
430
- rowContent.push(cell);
431
- }
432
- rows.push(table.child(row).copy(Fragment.from(rowContent)));
433
- }
434
- const fragment = this.isColSelection() && this.isRowSelection() ? table : rows;
435
- return new Slice(Fragment.from(fragment), 1, 1);
436
- }
437
- replace(tr, content = Slice.empty) {
438
- const mapFrom = tr.steps.length, ranges = this.ranges;
439
- for (let i = 0; i < ranges.length; i++) {
440
- const { $from, $to } = ranges[i], mapping = tr.mapping.slice(mapFrom);
441
- tr.replace(
442
- mapping.map($from.pos),
443
- mapping.map($to.pos),
444
- i ? Slice.empty : content
445
- );
446
- }
447
- const sel = Selection.findFrom(
448
- tr.doc.resolve(tr.mapping.slice(mapFrom).map(this.to)),
449
- -1
450
- );
451
- if (sel) tr.setSelection(sel);
452
- }
453
- replaceWith(tr, node) {
454
- this.replace(tr, new Slice(Fragment.from(node), 0, 0));
455
- }
456
- forEachCell(f) {
457
- const table = this.$anchorCell.node(-1);
458
- const map = TableMap.get(table);
459
- const tableStart = this.$anchorCell.start(-1);
460
- const cells = map.cellsInRect(
461
- map.rectBetween(
462
- this.$anchorCell.pos - tableStart,
463
- this.$headCell.pos - tableStart
464
- )
465
- );
466
- for (let i = 0; i < cells.length; i++) {
467
- f(table.nodeAt(cells[i]), tableStart + cells[i]);
468
- }
469
- }
470
- // True if this selection goes all the way from the top to the
471
- // bottom of the table.
472
- isColSelection() {
473
- const anchorTop = this.$anchorCell.index(-1);
474
- const headTop = this.$headCell.index(-1);
475
- if (Math.min(anchorTop, headTop) > 0) return false;
476
- const anchorBottom = anchorTop + this.$anchorCell.nodeAfter.attrs.rowspan;
477
- const headBottom = headTop + this.$headCell.nodeAfter.attrs.rowspan;
478
- return Math.max(anchorBottom, headBottom) == this.$headCell.node(-1).childCount;
479
- }
480
- // Returns the smallest column selection that covers the given anchor
481
- // and head cell.
482
- static colSelection($anchorCell, $headCell = $anchorCell) {
483
- const table = $anchorCell.node(-1);
484
- const map = TableMap.get(table);
485
- const tableStart = $anchorCell.start(-1);
486
- const anchorRect = map.findCell($anchorCell.pos - tableStart);
487
- const headRect = map.findCell($headCell.pos - tableStart);
488
- const doc = $anchorCell.node(0);
489
- if (anchorRect.top <= headRect.top) {
490
- if (anchorRect.top > 0)
491
- $anchorCell = doc.resolve(tableStart + map.map[anchorRect.left]);
492
- if (headRect.bottom < map.height)
493
- $headCell = doc.resolve(
494
- tableStart + map.map[map.width * (map.height - 1) + headRect.right - 1]
495
- );
496
- } else {
497
- if (headRect.top > 0)
498
- $headCell = doc.resolve(tableStart + map.map[headRect.left]);
499
- if (anchorRect.bottom < map.height)
500
- $anchorCell = doc.resolve(
501
- tableStart + map.map[map.width * (map.height - 1) + anchorRect.right - 1]
502
- );
503
- }
504
- return new _CellSelection($anchorCell, $headCell);
505
- }
506
- // True if this selection goes all the way from the left to the
507
- // right of the table.
508
- isRowSelection() {
509
- const table = this.$anchorCell.node(-1);
510
- const map = TableMap.get(table);
511
- const tableStart = this.$anchorCell.start(-1);
512
- const anchorLeft = map.colCount(this.$anchorCell.pos - tableStart);
513
- const headLeft = map.colCount(this.$headCell.pos - tableStart);
514
- if (Math.min(anchorLeft, headLeft) > 0) return false;
515
- const anchorRight = anchorLeft + this.$anchorCell.nodeAfter.attrs.colspan;
516
- const headRight = headLeft + this.$headCell.nodeAfter.attrs.colspan;
517
- return Math.max(anchorRight, headRight) == map.width;
518
- }
519
- eq(other) {
520
- return other instanceof _CellSelection && other.$anchorCell.pos == this.$anchorCell.pos && other.$headCell.pos == this.$headCell.pos;
521
- }
522
- // Returns the smallest row selection that covers the given anchor
523
- // and head cell.
524
- static rowSelection($anchorCell, $headCell = $anchorCell) {
525
- const table = $anchorCell.node(-1);
526
- const map = TableMap.get(table);
527
- const tableStart = $anchorCell.start(-1);
528
- const anchorRect = map.findCell($anchorCell.pos - tableStart);
529
- const headRect = map.findCell($headCell.pos - tableStart);
530
- const doc = $anchorCell.node(0);
531
- if (anchorRect.left <= headRect.left) {
532
- if (anchorRect.left > 0)
533
- $anchorCell = doc.resolve(
534
- tableStart + map.map[anchorRect.top * map.width]
535
- );
536
- if (headRect.right < map.width)
537
- $headCell = doc.resolve(
538
- tableStart + map.map[map.width * (headRect.top + 1) - 1]
539
- );
540
- } else {
541
- if (headRect.left > 0)
542
- $headCell = doc.resolve(tableStart + map.map[headRect.top * map.width]);
543
- if (anchorRect.right < map.width)
544
- $anchorCell = doc.resolve(
545
- tableStart + map.map[map.width * (anchorRect.top + 1) - 1]
546
- );
547
- }
548
- return new _CellSelection($anchorCell, $headCell);
549
- }
550
- toJSON() {
551
- return {
552
- type: "cell",
553
- anchor: this.$anchorCell.pos,
554
- head: this.$headCell.pos
555
- };
556
- }
557
- static fromJSON(doc, json) {
558
- return new _CellSelection(doc.resolve(json.anchor), doc.resolve(json.head));
559
- }
560
- static create(doc, anchorCell, headCell = anchorCell) {
561
- return new _CellSelection(doc.resolve(anchorCell), doc.resolve(headCell));
562
- }
563
- getBookmark() {
564
- return new CellBookmark(this.$anchorCell.pos, this.$headCell.pos);
565
- }
566
- };
567
- CellSelection.prototype.visible = false;
568
- Selection.jsonID("cell", CellSelection);
569
- var CellBookmark = class _CellBookmark {
570
- constructor(anchor, head) {
571
- this.anchor = anchor;
572
- this.head = head;
573
- }
574
- map(mapping) {
575
- return new _CellBookmark(mapping.map(this.anchor), mapping.map(this.head));
576
- }
577
- resolve(doc) {
578
- const $anchorCell = doc.resolve(this.anchor), $headCell = doc.resolve(this.head);
579
- if ($anchorCell.parent.type.spec.tableRole == "row" && $headCell.parent.type.spec.tableRole == "row" && $anchorCell.index() < $anchorCell.parent.childCount && $headCell.index() < $headCell.parent.childCount && inSameTable($anchorCell, $headCell))
580
- return new CellSelection($anchorCell, $headCell);
581
- else return Selection.near($headCell, 1);
582
- }
583
- };
584
- new PluginKey("fix-tables");
585
- function selectedRect(state) {
586
- const sel = state.selection;
587
- const $pos = selectionCell(state);
588
- const table = $pos.node(-1);
589
- const tableStart = $pos.start(-1);
590
- const map = TableMap.get(table);
591
- const rect = sel instanceof CellSelection ? map.rectBetween(
592
- sel.$anchorCell.pos - tableStart,
593
- sel.$headCell.pos - tableStart
594
- ) : map.findCell($pos.pos - tableStart);
595
- return { ...rect, tableStart, map, table };
596
- }
597
- function deprecated_toggleHeader(type) {
598
- return function(state, dispatch) {
599
- if (!isInTable(state)) return false;
600
- if (dispatch) {
601
- const types = tableNodeTypes(state.schema);
602
- const rect = selectedRect(state), tr = state.tr;
603
- const cells = rect.map.cellsInRect(
604
- type == "column" ? {
605
- left: rect.left,
606
- top: 0,
607
- right: rect.right,
608
- bottom: rect.map.height
609
- } : type == "row" ? {
610
- left: 0,
611
- top: rect.top,
612
- right: rect.map.width,
613
- bottom: rect.bottom
614
- } : rect
615
- );
616
- const nodes = cells.map((pos) => rect.table.nodeAt(pos));
617
- for (let i = 0; i < cells.length; i++)
618
- if (nodes[i].type == types.header_cell)
619
- tr.setNodeMarkup(
620
- rect.tableStart + cells[i],
621
- types.cell,
622
- nodes[i].attrs
623
- );
624
- if (tr.steps.length == 0)
625
- for (let i = 0; i < cells.length; i++)
626
- tr.setNodeMarkup(
627
- rect.tableStart + cells[i],
628
- types.header_cell,
629
- nodes[i].attrs
630
- );
631
- dispatch(tr);
632
- }
633
- return true;
634
- };
635
- }
636
- function isHeaderEnabledByType(type, rect, types) {
637
- const cellPositions = rect.map.cellsInRect({
638
- left: 0,
639
- top: 0,
640
- right: type == "row" ? rect.map.width : 1,
641
- bottom: type == "column" ? rect.map.height : 1
642
- });
643
- for (let i = 0; i < cellPositions.length; i++) {
644
- const cell = rect.table.nodeAt(cellPositions[i]);
645
- if (cell && cell.type !== types.header_cell) {
646
- return false;
647
- }
648
- }
649
- return true;
650
- }
651
- function toggleHeader(type, options) {
652
- options = options || { useDeprecatedLogic: false };
653
- if (options.useDeprecatedLogic) return deprecated_toggleHeader(type);
654
- return function(state, dispatch) {
655
- if (!isInTable(state)) return false;
656
- if (dispatch) {
657
- const types = tableNodeTypes(state.schema);
658
- const rect = selectedRect(state), tr = state.tr;
659
- const isHeaderRowEnabled = isHeaderEnabledByType("row", rect, types);
660
- const isHeaderColumnEnabled = isHeaderEnabledByType(
661
- "column",
662
- rect,
663
- types
664
- );
665
- const isHeaderEnabled = type === "column" ? isHeaderRowEnabled : type === "row" ? isHeaderColumnEnabled : false;
666
- const selectionStartsAt = isHeaderEnabled ? 1 : 0;
667
- const cellsRect = type == "column" ? {
668
- left: 0,
669
- top: selectionStartsAt,
670
- right: 1,
671
- bottom: rect.map.height
672
- } : type == "row" ? {
673
- left: selectionStartsAt,
674
- top: 0,
675
- right: rect.map.width,
676
- bottom: 1
677
- } : rect;
678
- const newType = type == "column" ? isHeaderColumnEnabled ? types.cell : types.header_cell : type == "row" ? isHeaderRowEnabled ? types.cell : types.header_cell : types.cell;
679
- rect.map.cellsInRect(cellsRect).forEach((relativeCellPos) => {
680
- const cellPos = relativeCellPos + rect.tableStart;
681
- const cell = tr.doc.nodeAt(cellPos);
682
- if (cell) {
683
- tr.setNodeMarkup(cellPos, newType, cell.attrs);
684
- }
685
- });
686
- dispatch(tr);
687
- }
688
- return true;
689
- };
690
- }
691
- toggleHeader("row", {
692
- useDeprecatedLogic: true
693
- });
694
- toggleHeader("column", {
695
- useDeprecatedLogic: true
696
- });
697
- toggleHeader("cell", {
698
- useDeprecatedLogic: true
699
- });
700
- function deleteCellSelection(state, dispatch) {
701
- const sel = state.selection;
702
- if (!(sel instanceof CellSelection)) return false;
703
- if (dispatch) {
704
- const tr = state.tr;
705
- const baseContent = tableNodeTypes(state.schema).cell.createAndFill().content;
706
- sel.forEachCell((cell, pos) => {
707
- if (!cell.content.eq(baseContent))
708
- tr.replace(
709
- tr.mapping.map(pos + 1),
710
- tr.mapping.map(pos + cell.nodeSize - 1),
711
- new Slice(baseContent, 0, 0)
712
- );
713
- });
714
- if (tr.docChanged) dispatch(tr);
715
- }
716
- return true;
717
- }
718
- keydownHandler({
719
- ArrowLeft: arrow("horiz", -1),
720
- ArrowRight: arrow("horiz", 1),
721
- ArrowUp: arrow("vert", -1),
722
- ArrowDown: arrow("vert", 1),
723
- "Shift-ArrowLeft": shiftArrow("horiz", -1),
724
- "Shift-ArrowRight": shiftArrow("horiz", 1),
725
- "Shift-ArrowUp": shiftArrow("vert", -1),
726
- "Shift-ArrowDown": shiftArrow("vert", 1),
727
- Backspace: deleteCellSelection,
728
- "Mod-Backspace": deleteCellSelection,
729
- Delete: deleteCellSelection,
730
- "Mod-Delete": deleteCellSelection
731
- });
732
- function maybeSetSelection(state, dispatch, selection) {
733
- if (selection.eq(state.selection)) return false;
734
- if (dispatch) dispatch(state.tr.setSelection(selection).scrollIntoView());
735
- return true;
736
- }
737
- function arrow(axis, dir) {
738
- return (state, dispatch, view) => {
739
- if (!view) return false;
740
- const sel = state.selection;
741
- if (sel instanceof CellSelection) {
742
- return maybeSetSelection(
743
- state,
744
- dispatch,
745
- Selection.near(sel.$headCell, dir)
746
- );
747
- }
748
- if (axis != "horiz" && !sel.empty) return false;
749
- const end = atEndOfCell(view, axis, dir);
750
- if (end == null) return false;
751
- if (axis == "horiz") {
752
- return maybeSetSelection(
753
- state,
754
- dispatch,
755
- Selection.near(state.doc.resolve(sel.head + dir), dir)
756
- );
757
- } else {
758
- const $cell = state.doc.resolve(end);
759
- const $next = nextCell($cell, axis, dir);
760
- let newSel;
761
- if ($next) newSel = Selection.near($next, 1);
762
- else if (dir < 0)
763
- newSel = Selection.near(state.doc.resolve($cell.before(-1)), -1);
764
- else newSel = Selection.near(state.doc.resolve($cell.after(-1)), 1);
765
- return maybeSetSelection(state, dispatch, newSel);
766
- }
767
- };
768
- }
769
- function shiftArrow(axis, dir) {
770
- return (state, dispatch, view) => {
771
- if (!view) return false;
772
- const sel = state.selection;
773
- let cellSel;
774
- if (sel instanceof CellSelection) {
775
- cellSel = sel;
776
- } else {
777
- const end = atEndOfCell(view, axis, dir);
778
- if (end == null) return false;
779
- cellSel = new CellSelection(state.doc.resolve(end));
780
- }
781
- const $head = nextCell(cellSel.$headCell, axis, dir);
782
- if (!$head) return false;
783
- return maybeSetSelection(
784
- state,
785
- dispatch,
786
- new CellSelection(cellSel.$anchorCell, $head)
787
- );
788
- };
789
- }
790
- function atEndOfCell(view, axis, dir) {
791
- if (!(view.state.selection instanceof TextSelection)) return null;
792
- const { $head } = view.state.selection;
793
- for (let d = $head.depth - 1; d >= 0; d--) {
794
- const parent = $head.node(d), index = dir < 0 ? $head.index(d) : $head.indexAfter(d);
795
- if (index != (dir < 0 ? 0 : parent.childCount)) return null;
796
- if (parent.type.spec.tableRole == "cell" || parent.type.spec.tableRole == "header_cell") {
797
- const cellPos = $head.before(d);
798
- const dirStr = axis == "vert" ? dir > 0 ? "down" : "up" : dir > 0 ? "right" : "left";
799
- return view.endOfTextblock(dirStr) ? cellPos : null;
800
- }
801
- }
802
- return null;
803
- }
804
- new PluginKey(
805
- "tableColumnResizing"
806
- );
807
- function combineDOMRects(rect1, rect2) {
808
- const top = Math.min(rect1.top, rect2.top);
809
- const bottom = Math.max(rect1.bottom, rect2.bottom);
810
- const left = Math.min(rect1.left, rect2.left);
811
- const right = Math.max(rect1.right, rect2.right);
812
- const width = right - left;
813
- const height = bottom - top;
814
- const x = left;
815
- const y = top;
816
- return new DOMRect(x, y, width, height);
817
- }
818
- var BubbleMenuView = class {
819
- constructor({
820
- editor,
821
- element,
822
- view,
823
- updateDelay = 250,
824
- resizeDelay = 60,
825
- shouldShow,
826
- appendTo,
827
- getReferencedVirtualElement,
828
- options
829
- }) {
830
- this.preventHide = false;
831
- this.isVisible = false;
832
- this.scrollTarget = window;
833
- this.floatingUIOptions = {
834
- strategy: "absolute",
835
- placement: "top",
836
- offset: 8,
837
- flip: {},
838
- shift: {},
839
- arrow: false,
840
- size: false,
841
- autoPlacement: false,
842
- hide: false,
843
- inline: false,
844
- onShow: void 0,
845
- onHide: void 0,
846
- onUpdate: void 0,
847
- onDestroy: void 0
848
- };
849
- this.shouldShow = ({ view: view2, state, from, to }) => {
850
- const { doc, selection } = state;
851
- const { empty } = selection;
852
- const isEmptyTextBlock = !doc.textBetween(from, to).length && isTextSelection(state.selection);
853
- const isChildOfMenu = this.element.contains(document.activeElement);
854
- const hasEditorFocus = view2.hasFocus() || isChildOfMenu;
855
- if (!hasEditorFocus || empty || isEmptyTextBlock || !this.editor.isEditable) {
856
- return false;
857
- }
858
- return true;
859
- };
860
- this.mousedownHandler = () => {
861
- this.preventHide = true;
862
- };
863
- this.dragstartHandler = () => {
864
- this.hide();
865
- };
866
- this.resizeHandler = () => {
867
- if (this.resizeDebounceTimer) {
868
- clearTimeout(this.resizeDebounceTimer);
869
- }
870
- this.resizeDebounceTimer = window.setTimeout(() => {
871
- this.updatePosition();
872
- }, this.resizeDelay);
873
- };
874
- this.focusHandler = () => {
875
- setTimeout(() => this.update(this.editor.view));
876
- };
877
- this.blurHandler = ({ event }) => {
878
- var _a2;
879
- if (this.editor.isDestroyed) {
880
- this.destroy();
881
- return;
882
- }
883
- if (this.preventHide) {
884
- this.preventHide = false;
885
- return;
886
- }
887
- if ((event == null ? void 0 : event.relatedTarget) && ((_a2 = this.element.parentNode) == null ? void 0 : _a2.contains(event.relatedTarget))) {
888
- return;
889
- }
890
- if ((event == null ? void 0 : event.relatedTarget) === this.editor.view.dom) {
891
- return;
892
- }
893
- this.hide();
894
- };
895
- this.handleDebouncedUpdate = (view2, oldState) => {
896
- const selectionChanged = !(oldState == null ? void 0 : oldState.selection.eq(view2.state.selection));
897
- const docChanged = !(oldState == null ? void 0 : oldState.doc.eq(view2.state.doc));
898
- if (!selectionChanged && !docChanged) {
899
- return;
900
- }
901
- if (this.updateDebounceTimer) {
902
- clearTimeout(this.updateDebounceTimer);
903
- }
904
- this.updateDebounceTimer = window.setTimeout(() => {
905
- this.updateHandler(view2, selectionChanged, docChanged, oldState);
906
- }, this.updateDelay);
907
- };
908
- this.updateHandler = (view2, selectionChanged, docChanged, oldState) => {
909
- const { composing } = view2;
910
- const isSame = !selectionChanged && !docChanged;
911
- if (composing || isSame) {
912
- return;
913
- }
914
- const shouldShow2 = this.getShouldShow(oldState);
915
- if (!shouldShow2) {
916
- this.hide();
917
- return;
918
- }
919
- this.updatePosition();
920
- this.show();
921
- };
922
- this.transactionHandler = ({ transaction: tr }) => {
923
- const meta = tr.getMeta("bubbleMenu");
924
- if (meta === "updatePosition") {
925
- this.updatePosition();
926
- }
927
- };
928
- var _a;
929
- this.editor = editor;
930
- this.element = element;
931
- this.view = view;
932
- this.updateDelay = updateDelay;
933
- this.resizeDelay = resizeDelay;
934
- this.appendTo = appendTo;
935
- this.scrollTarget = (_a = options == null ? void 0 : options.scrollTarget) != null ? _a : window;
936
- this.getReferencedVirtualElement = getReferencedVirtualElement;
937
- this.floatingUIOptions = {
938
- ...this.floatingUIOptions,
939
- ...options
940
- };
941
- this.element.tabIndex = 0;
942
- if (shouldShow) {
943
- this.shouldShow = shouldShow;
944
- }
945
- this.element.addEventListener("mousedown", this.mousedownHandler, { capture: true });
946
- this.view.dom.addEventListener("dragstart", this.dragstartHandler);
947
- this.editor.on("focus", this.focusHandler);
948
- this.editor.on("blur", this.blurHandler);
949
- this.editor.on("transaction", this.transactionHandler);
950
- window.addEventListener("resize", this.resizeHandler);
951
- this.scrollTarget.addEventListener("scroll", this.resizeHandler);
952
- this.update(view, view.state);
953
- if (this.getShouldShow()) {
954
- this.show();
955
- this.updatePosition();
956
- }
957
- }
958
- get middlewares() {
959
- const middlewares = [];
960
- if (this.floatingUIOptions.flip) {
961
- middlewares.push(flip(typeof this.floatingUIOptions.flip !== "boolean" ? this.floatingUIOptions.flip : void 0));
962
- }
963
- if (this.floatingUIOptions.shift) {
964
- middlewares.push(
965
- shift(typeof this.floatingUIOptions.shift !== "boolean" ? this.floatingUIOptions.shift : void 0)
966
- );
967
- }
968
- if (this.floatingUIOptions.offset) {
969
- middlewares.push(
970
- offset(typeof this.floatingUIOptions.offset !== "boolean" ? this.floatingUIOptions.offset : void 0)
971
- );
972
- }
973
- if (this.floatingUIOptions.arrow) {
974
- middlewares.push(arrow$1(this.floatingUIOptions.arrow));
975
- }
976
- if (this.floatingUIOptions.size) {
977
- middlewares.push(size(typeof this.floatingUIOptions.size !== "boolean" ? this.floatingUIOptions.size : void 0));
978
- }
979
- if (this.floatingUIOptions.autoPlacement) {
980
- middlewares.push(
981
- autoPlacement(
982
- typeof this.floatingUIOptions.autoPlacement !== "boolean" ? this.floatingUIOptions.autoPlacement : void 0
983
- )
984
- );
985
- }
986
- if (this.floatingUIOptions.hide) {
987
- middlewares.push(hide(typeof this.floatingUIOptions.hide !== "boolean" ? this.floatingUIOptions.hide : void 0));
988
- }
989
- if (this.floatingUIOptions.inline) {
990
- middlewares.push(
991
- inline(typeof this.floatingUIOptions.inline !== "boolean" ? this.floatingUIOptions.inline : void 0)
992
- );
993
- }
994
- return middlewares;
995
- }
996
- get virtualElement() {
997
- var _a;
998
- const { selection } = this.editor.state;
999
- const referencedVirtualElement = (_a = this.getReferencedVirtualElement) == null ? void 0 : _a.call(this);
1000
- if (referencedVirtualElement) {
1001
- return referencedVirtualElement;
1002
- }
1003
- const domRect = posToDOMRect(this.view, selection.from, selection.to);
1004
- let virtualElement = {
1005
- getBoundingClientRect: () => domRect,
1006
- getClientRects: () => [domRect]
1007
- };
1008
- if (selection instanceof NodeSelection) {
1009
- let node = this.view.nodeDOM(selection.from);
1010
- const nodeViewWrapper = node.dataset.nodeViewWrapper ? node : node.querySelector("[data-node-view-wrapper]");
1011
- if (nodeViewWrapper) {
1012
- node = nodeViewWrapper;
1013
- }
1014
- if (node) {
1015
- virtualElement = {
1016
- getBoundingClientRect: () => node.getBoundingClientRect(),
1017
- getClientRects: () => [node.getBoundingClientRect()]
1018
- };
1019
- }
1020
- }
1021
- if (selection instanceof CellSelection) {
1022
- const { $anchorCell, $headCell } = selection;
1023
- const from = $anchorCell ? $anchorCell.pos : $headCell.pos;
1024
- const to = $headCell ? $headCell.pos : $anchorCell.pos;
1025
- const fromDOM = this.view.nodeDOM(from);
1026
- const toDOM = this.view.nodeDOM(to);
1027
- if (!fromDOM || !toDOM) {
1028
- return;
1029
- }
1030
- const clientRect = fromDOM === toDOM ? fromDOM.getBoundingClientRect() : combineDOMRects(
1031
- fromDOM.getBoundingClientRect(),
1032
- toDOM.getBoundingClientRect()
1033
- );
1034
- virtualElement = {
1035
- getBoundingClientRect: () => clientRect,
1036
- getClientRects: () => [clientRect]
1037
- };
1038
- }
1039
- return virtualElement;
1040
- }
1041
- updatePosition() {
1042
- const virtualElement = this.virtualElement;
1043
- if (!virtualElement) {
1044
- return;
1045
- }
1046
- computePosition(virtualElement, this.element, {
1047
- placement: this.floatingUIOptions.placement,
1048
- strategy: this.floatingUIOptions.strategy,
1049
- middleware: this.middlewares
1050
- }).then(({ x, y, strategy }) => {
1051
- this.element.style.width = "max-content";
1052
- this.element.style.position = strategy;
1053
- this.element.style.left = `${x}px`;
1054
- this.element.style.top = `${y}px`;
1055
- if (this.isVisible && this.floatingUIOptions.onUpdate) {
1056
- this.floatingUIOptions.onUpdate();
1057
- }
1058
- });
1059
- }
1060
- update(view, oldState) {
1061
- const { state } = view;
1062
- const hasValidSelection = state.selection.from !== state.selection.to;
1063
- if (this.updateDelay > 0 && hasValidSelection) {
1064
- this.handleDebouncedUpdate(view, oldState);
1065
- return;
1066
- }
1067
- const selectionChanged = !(oldState == null ? void 0 : oldState.selection.eq(view.state.selection));
1068
- const docChanged = !(oldState == null ? void 0 : oldState.doc.eq(view.state.doc));
1069
- this.updateHandler(view, selectionChanged, docChanged, oldState);
1070
- }
1071
- getShouldShow(oldState) {
1072
- var _a;
1073
- const { state } = this.view;
1074
- const { selection } = state;
1075
- const { ranges } = selection;
1076
- const from = Math.min(...ranges.map((range) => range.$from.pos));
1077
- const to = Math.max(...ranges.map((range) => range.$to.pos));
1078
- const shouldShow = (_a = this.shouldShow) == null ? void 0 : _a.call(this, {
1079
- editor: this.editor,
1080
- element: this.element,
1081
- view: this.view,
1082
- state,
1083
- oldState,
1084
- from,
1085
- to
1086
- });
1087
- return shouldShow || false;
1088
- }
1089
- show() {
1090
- var _a;
1091
- if (this.isVisible) {
1092
- return;
1093
- }
1094
- this.element.style.visibility = "visible";
1095
- this.element.style.opacity = "1";
1096
- const appendToElement = typeof this.appendTo === "function" ? this.appendTo() : this.appendTo;
1097
- (_a = appendToElement != null ? appendToElement : this.view.dom.parentElement) == null ? void 0 : _a.appendChild(this.element);
1098
- if (this.floatingUIOptions.onShow) {
1099
- this.floatingUIOptions.onShow();
1100
- }
1101
- this.isVisible = true;
1102
- }
1103
- hide() {
1104
- if (!this.isVisible) {
1105
- return;
1106
- }
1107
- this.element.style.visibility = "hidden";
1108
- this.element.style.opacity = "0";
1109
- this.element.remove();
1110
- if (this.floatingUIOptions.onHide) {
1111
- this.floatingUIOptions.onHide();
1112
- }
1113
- this.isVisible = false;
1114
- }
1115
- destroy() {
1116
- this.hide();
1117
- this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: true });
1118
- this.view.dom.removeEventListener("dragstart", this.dragstartHandler);
1119
- window.removeEventListener("resize", this.resizeHandler);
1120
- this.scrollTarget.removeEventListener("scroll", this.resizeHandler);
1121
- this.editor.off("focus", this.focusHandler);
1122
- this.editor.off("blur", this.blurHandler);
1123
- this.editor.off("transaction", this.transactionHandler);
1124
- if (this.floatingUIOptions.onDestroy) {
1125
- this.floatingUIOptions.onDestroy();
1126
- }
1127
- }
1128
- };
1129
- var BubbleMenuPlugin = (options) => {
1130
- return new Plugin({
1131
- key: typeof options.pluginKey === "string" ? new PluginKey(options.pluginKey) : options.pluginKey,
1132
- view: (view) => new BubbleMenuView({ view, ...options })
1133
- });
1134
- };
1135
- var BubbleMenu = defineComponent({
1136
- name: "BubbleMenu",
1137
- inheritAttrs: false,
1138
- props: {
1139
- pluginKey: {
1140
- type: [String, Object],
1141
- default: "bubbleMenu"
1142
- },
1143
- editor: {
1144
- type: Object,
1145
- required: true
1146
- },
1147
- updateDelay: {
1148
- type: Number,
1149
- default: void 0
1150
- },
1151
- resizeDelay: {
1152
- type: Number,
1153
- default: void 0
1154
- },
1155
- options: {
1156
- type: Object,
1157
- default: () => ({})
1158
- },
1159
- appendTo: {
1160
- type: Object,
1161
- default: void 0
1162
- },
1163
- shouldShow: {
1164
- type: Function,
1165
- default: null
1166
- },
1167
- getReferencedVirtualElement: {
1168
- type: Function,
1169
- default: void 0
1170
- }
1171
- },
1172
- setup(props, { slots, attrs }) {
1173
- const root = ref(null);
1174
- onMounted(() => {
1175
- const {
1176
- editor,
1177
- options,
1178
- pluginKey,
1179
- resizeDelay,
1180
- appendTo,
1181
- shouldShow,
1182
- getReferencedVirtualElement,
1183
- updateDelay
1184
- } = props;
1185
- const el = root.value;
1186
- if (!el) {
1187
- return;
1188
- }
1189
- el.style.visibility = "hidden";
1190
- el.style.position = "absolute";
1191
- el.remove();
1192
- nextTick(() => {
1193
- editor.registerPlugin(
1194
- BubbleMenuPlugin({
1195
- editor,
1196
- element: el,
1197
- options,
1198
- pluginKey,
1199
- resizeDelay,
1200
- appendTo,
1201
- shouldShow,
1202
- getReferencedVirtualElement,
1203
- updateDelay
1204
- })
1205
- );
1206
- });
1207
- });
1208
- onBeforeUnmount(() => {
1209
- const { pluginKey, editor } = props;
1210
- editor.unregisterPlugin(pluginKey);
1211
- });
1212
- return () => {
1213
- var _a;
1214
- return h("div", { ref: root, ...attrs }, (_a = slots.default) == null ? void 0 : _a.call(slots));
1215
- };
1216
- }
1217
- });
1218
- var FloatingMenuView = class {
1219
- constructor({ editor, element, view, options, appendTo, shouldShow }) {
1220
- this.preventHide = false;
1221
- this.isVisible = false;
1222
- this.shouldShow = ({ view: view2, state }) => {
1223
- const { selection } = state;
1224
- const { $anchor, empty } = selection;
1225
- const isRootDepth = $anchor.depth === 1;
1226
- const isEmptyTextBlock = $anchor.parent.isTextblock && !$anchor.parent.type.spec.code && !$anchor.parent.textContent && $anchor.parent.childCount === 0 && !this.getTextContent($anchor.parent);
1227
- if (!view2.hasFocus() || !empty || !isRootDepth || !isEmptyTextBlock || !this.editor.isEditable) {
1228
- return false;
1229
- }
1230
- return true;
1231
- };
1232
- this.floatingUIOptions = {
1233
- strategy: "absolute",
1234
- placement: "right",
1235
- offset: 8,
1236
- flip: {},
1237
- shift: {},
1238
- arrow: false,
1239
- size: false,
1240
- autoPlacement: false,
1241
- hide: false,
1242
- inline: false
1243
- };
1244
- this.updateHandler = (view2, selectionChanged, docChanged, oldState) => {
1245
- const { composing } = view2;
1246
- const isSame = !selectionChanged && !docChanged;
1247
- if (composing || isSame) {
1248
- return;
1249
- }
1250
- const shouldShow2 = this.getShouldShow(oldState);
1251
- if (!shouldShow2) {
1252
- this.hide();
1253
- return;
1254
- }
1255
- this.updatePosition();
1256
- this.show();
1257
- };
1258
- this.mousedownHandler = () => {
1259
- this.preventHide = true;
1260
- };
1261
- this.focusHandler = () => {
1262
- setTimeout(() => this.update(this.editor.view));
1263
- };
1264
- this.blurHandler = ({ event }) => {
1265
- var _a;
1266
- if (this.preventHide) {
1267
- this.preventHide = false;
1268
- return;
1269
- }
1270
- if ((event == null ? void 0 : event.relatedTarget) && ((_a = this.element.parentNode) == null ? void 0 : _a.contains(event.relatedTarget))) {
1271
- return;
1272
- }
1273
- if ((event == null ? void 0 : event.relatedTarget) === this.editor.view.dom) {
1274
- return;
1275
- }
1276
- this.hide();
1277
- };
1278
- this.editor = editor;
1279
- this.element = element;
1280
- this.view = view;
1281
- this.appendTo = appendTo;
1282
- this.floatingUIOptions = {
1283
- ...this.floatingUIOptions,
1284
- ...options
1285
- };
1286
- this.element.tabIndex = 0;
1287
- if (shouldShow) {
1288
- this.shouldShow = shouldShow;
1289
- }
1290
- this.element.addEventListener("mousedown", this.mousedownHandler, { capture: true });
1291
- this.editor.on("focus", this.focusHandler);
1292
- this.editor.on("blur", this.blurHandler);
1293
- this.update(view, view.state);
1294
- if (this.getShouldShow()) {
1295
- this.show();
1296
- this.updatePosition();
1297
- }
1298
- }
1299
- getTextContent(node) {
1300
- return getText(node, { textSerializers: getTextSerializersFromSchema(this.editor.schema) });
1301
- }
1302
- get middlewares() {
1303
- const middlewares = [];
1304
- if (this.floatingUIOptions.flip) {
1305
- middlewares.push(flip(typeof this.floatingUIOptions.flip !== "boolean" ? this.floatingUIOptions.flip : void 0));
1306
- }
1307
- if (this.floatingUIOptions.shift) {
1308
- middlewares.push(
1309
- shift(typeof this.floatingUIOptions.shift !== "boolean" ? this.floatingUIOptions.shift : void 0)
1310
- );
1311
- }
1312
- if (this.floatingUIOptions.offset) {
1313
- middlewares.push(
1314
- offset(typeof this.floatingUIOptions.offset !== "boolean" ? this.floatingUIOptions.offset : void 0)
1315
- );
1316
- }
1317
- if (this.floatingUIOptions.arrow) {
1318
- middlewares.push(arrow$1(this.floatingUIOptions.arrow));
1319
- }
1320
- if (this.floatingUIOptions.size) {
1321
- middlewares.push(size(typeof this.floatingUIOptions.size !== "boolean" ? this.floatingUIOptions.size : void 0));
1322
- }
1323
- if (this.floatingUIOptions.autoPlacement) {
1324
- middlewares.push(
1325
- autoPlacement(
1326
- typeof this.floatingUIOptions.autoPlacement !== "boolean" ? this.floatingUIOptions.autoPlacement : void 0
1327
- )
1328
- );
1329
- }
1330
- if (this.floatingUIOptions.hide) {
1331
- middlewares.push(hide(typeof this.floatingUIOptions.hide !== "boolean" ? this.floatingUIOptions.hide : void 0));
1332
- }
1333
- if (this.floatingUIOptions.inline) {
1334
- middlewares.push(
1335
- inline(typeof this.floatingUIOptions.inline !== "boolean" ? this.floatingUIOptions.inline : void 0)
1336
- );
1337
- }
1338
- return middlewares;
1339
- }
1340
- getShouldShow(oldState) {
1341
- var _a;
1342
- const { state } = this.view;
1343
- const { selection } = state;
1344
- const { ranges } = selection;
1345
- const from = Math.min(...ranges.map((range) => range.$from.pos));
1346
- const to = Math.max(...ranges.map((range) => range.$to.pos));
1347
- const shouldShow = (_a = this.shouldShow) == null ? void 0 : _a.call(this, {
1348
- editor: this.editor,
1349
- view: this.view,
1350
- state,
1351
- oldState,
1352
- from,
1353
- to
1354
- });
1355
- return shouldShow;
1356
- }
1357
- updatePosition() {
1358
- const { selection } = this.editor.state;
1359
- const domRect = posToDOMRect(this.view, selection.from, selection.to);
1360
- const virtualElement = {
1361
- getBoundingClientRect: () => domRect,
1362
- getClientRects: () => [domRect]
1363
- };
1364
- computePosition(virtualElement, this.element, {
1365
- placement: this.floatingUIOptions.placement,
1366
- strategy: this.floatingUIOptions.strategy,
1367
- middleware: this.middlewares
1368
- }).then(({ x, y, strategy }) => {
1369
- this.element.style.width = "max-content";
1370
- this.element.style.position = strategy;
1371
- this.element.style.left = `${x}px`;
1372
- this.element.style.top = `${y}px`;
1373
- if (this.isVisible && this.floatingUIOptions.onUpdate) {
1374
- this.floatingUIOptions.onUpdate();
1375
- }
1376
- });
1377
- }
1378
- update(view, oldState) {
1379
- const selectionChanged = !(oldState == null ? void 0 : oldState.selection.eq(view.state.selection));
1380
- const docChanged = !(oldState == null ? void 0 : oldState.doc.eq(view.state.doc));
1381
- this.updateHandler(view, selectionChanged, docChanged, oldState);
1382
- }
1383
- show() {
1384
- var _a;
1385
- if (this.isVisible) {
1386
- return;
1387
- }
1388
- this.element.style.visibility = "visible";
1389
- this.element.style.opacity = "1";
1390
- const appendToElement = typeof this.appendTo === "function" ? this.appendTo() : this.appendTo;
1391
- (_a = appendToElement != null ? appendToElement : this.view.dom.parentElement) == null ? void 0 : _a.appendChild(this.element);
1392
- if (this.floatingUIOptions.onShow) {
1393
- this.floatingUIOptions.onShow();
1394
- }
1395
- this.isVisible = true;
1396
- }
1397
- hide() {
1398
- if (!this.isVisible) {
1399
- return;
1400
- }
1401
- this.element.style.visibility = "hidden";
1402
- this.element.style.opacity = "0";
1403
- this.element.remove();
1404
- if (this.floatingUIOptions.onHide) {
1405
- this.floatingUIOptions.onHide();
1406
- }
1407
- this.isVisible = false;
1408
- }
1409
- destroy() {
1410
- this.hide();
1411
- this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: true });
1412
- this.editor.off("focus", this.focusHandler);
1413
- this.editor.off("blur", this.blurHandler);
1414
- if (this.floatingUIOptions.onDestroy) {
1415
- this.floatingUIOptions.onDestroy();
1416
- }
1417
- }
1418
- };
1419
- var FloatingMenuPlugin = (options) => {
1420
- return new Plugin({
1421
- key: typeof options.pluginKey === "string" ? new PluginKey(options.pluginKey) : options.pluginKey,
1422
- view: (view) => new FloatingMenuView({ view, ...options })
1423
- });
1424
- };
1425
- defineComponent({
1426
- name: "FloatingMenu",
1427
- inheritAttrs: false,
1428
- props: {
1429
- pluginKey: {
1430
- // TODO: TypeScript breaks :(
1431
- // type: [String, Object as PropType<Exclude<FloatingMenuPluginProps['pluginKey'], string>>],
1432
- type: null,
1433
- default: "floatingMenu"
1434
- },
1435
- editor: {
1436
- type: Object,
1437
- required: true
1438
- },
1439
- options: {
1440
- type: Object,
1441
- default: () => ({})
1442
- },
1443
- appendTo: {
1444
- type: Object,
1445
- default: void 0
1446
- },
1447
- shouldShow: {
1448
- type: Function,
1449
- default: null
1450
- }
1451
- },
1452
- setup(props, { slots, attrs }) {
1453
- const root = ref(null);
1454
- onMounted(() => {
1455
- const { pluginKey, editor, options, appendTo, shouldShow } = props;
1456
- const el = root.value;
1457
- if (!el) {
1458
- return;
1459
- }
1460
- el.style.visibility = "hidden";
1461
- el.style.position = "absolute";
1462
- el.remove();
1463
- editor.registerPlugin(
1464
- FloatingMenuPlugin({
1465
- pluginKey,
1466
- editor,
1467
- element: el,
1468
- options,
1469
- appendTo,
1470
- shouldShow
1471
- })
1472
- );
1473
- });
1474
- onBeforeUnmount(() => {
1475
- const { pluginKey, editor } = props;
1476
- editor.unregisterPlugin(pluginKey);
1477
- });
1478
- return () => {
1479
- var _a;
1480
- return h("div", { ref: root, ...attrs }, (_a = slots.default) == null ? void 0 : _a.call(slots));
1481
- };
1482
- }
1483
- });
1484
- export {
1485
- BubbleMenu
1486
- };