@youcan/celeste 0.6.57 → 0.6.60

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 (449) hide show
  1. package/dist/celeste.css +3316 -2516
  2. package/dist/cjs/alert.js +1 -0
  3. package/dist/cjs/badge.js +1 -0
  4. package/dist/cjs/button.js +1 -0
  5. package/dist/cjs/checkbox-card.js +1 -0
  6. package/dist/cjs/checkbox-label.js +1 -0
  7. package/dist/cjs/checkbox.js +3 -2
  8. package/dist/cjs/chunks/alpha-slider.js +1 -1
  9. package/dist/cjs/chunks/collapsible-content.js +27 -0
  10. package/dist/cjs/chunks/collapsible-trigger.js +22 -0
  11. package/dist/cjs/chunks/collapsible.js +28 -0
  12. package/dist/cjs/chunks/index.js +385 -1
  13. package/dist/cjs/chunks/index2.js +18 -0
  14. package/dist/cjs/chunks/index3.js +240 -1425
  15. package/dist/cjs/chunks/index4.js +1336 -16336
  16. package/dist/cjs/chunks/index5.js +16457 -0
  17. package/dist/cjs/chunks/pagination-first.js +32 -0
  18. package/dist/cjs/chunks/pagination-item.js +32 -0
  19. package/dist/cjs/chunks/pagination-last.js +32 -0
  20. package/dist/cjs/chunks/pagination-next.js +32 -0
  21. package/dist/cjs/chunks/pagination-previous.js +32 -0
  22. package/dist/cjs/chunks/rich-editor.vue_vue_type_style_index_0_scoped_dbc85b1a_lang.js +4575 -0
  23. package/dist/cjs/chunks/sheet-trigger.js +22 -0
  24. package/dist/cjs/chunks/sheet.js +26 -0
  25. package/dist/cjs/chunks/sidebar-content.js +21 -0
  26. package/dist/cjs/chunks/sidebar-element.js +28 -0
  27. package/dist/cjs/chunks/sidebar-footer.js +21 -0
  28. package/dist/cjs/chunks/sidebar-group-label.js +29 -0
  29. package/dist/cjs/chunks/sidebar-group.js +21 -0
  30. package/dist/cjs/chunks/sidebar-header.js +21 -0
  31. package/dist/cjs/chunks/sidebar-menu-action.js +34 -0
  32. package/dist/cjs/chunks/sidebar-menu-badge.js +29 -0
  33. package/dist/cjs/chunks/sidebar-menu-button.js +39 -0
  34. package/dist/cjs/chunks/sidebar-menu-item.js +21 -0
  35. package/dist/cjs/chunks/sidebar-menu-sub-button.js +37 -0
  36. package/dist/cjs/chunks/sidebar-menu-sub-item.js +21 -0
  37. package/dist/cjs/chunks/sidebar-menu-sub.js +21 -0
  38. package/dist/cjs/chunks/sidebar-menu.js +21 -0
  39. package/dist/cjs/chunks/sidebar-provider.vue_vue_type_style_index_0_lang.js +63 -0
  40. package/dist/cjs/chunks/sidebar-separator.vue_vue_type_style_index_0_lang.js +128 -0
  41. package/dist/cjs/chunks/sidebar.js +84 -0
  42. package/dist/cjs/chunks/{use-color-model.js → tinycolor.js} +0 -30
  43. package/dist/cjs/chunks/tooltip-provider.js +26 -0
  44. package/dist/cjs/chunks/tooltip-root.js +36 -0
  45. package/dist/cjs/chunks/tooltip-trigger.js +23 -0
  46. package/dist/cjs/chunks/tooltip.js +84 -0
  47. package/dist/cjs/collapsible-content.js +4 -0
  48. package/dist/cjs/collapsible-trigger.js +3 -0
  49. package/dist/cjs/collapsible.js +3 -0
  50. package/dist/cjs/color-area.js +2 -1
  51. package/dist/cjs/color-picker.js +13 -11
  52. package/dist/cjs/color-swatch.js +5 -3
  53. package/dist/cjs/combobox-empty.js +1 -0
  54. package/dist/cjs/combobox-group.js +1 -0
  55. package/dist/cjs/combobox-input.js +1 -0
  56. package/dist/cjs/combobox-item.js +4 -2
  57. package/dist/cjs/combobox-list.js +1 -0
  58. package/dist/cjs/combobox-root.js +1 -0
  59. package/dist/cjs/combobox-separator.js +1 -0
  60. package/dist/cjs/combobox-trigger.js +1 -0
  61. package/dist/cjs/combobox.js +1 -0
  62. package/dist/cjs/compact-button.js +1 -0
  63. package/dist/cjs/counter-input.js +3 -2
  64. package/dist/cjs/digit-input-group.js +1 -0
  65. package/dist/cjs/digit-input-slot.js +1 -0
  66. package/dist/cjs/digit-input.js +1 -0
  67. package/dist/cjs/dropdown-menu-content.js +1 -0
  68. package/dist/cjs/dropdown-menu-group.js +1 -0
  69. package/dist/cjs/dropdown-menu-item.js +1 -0
  70. package/dist/cjs/dropdown-menu-label.js +1 -0
  71. package/dist/cjs/dropdown-menu-separator.js +1 -0
  72. package/dist/cjs/dropdown-menu-sub-content.js +1 -0
  73. package/dist/cjs/dropdown-menu-sub-trigger.js +1 -0
  74. package/dist/cjs/dropdown-menu-trigger.js +1 -0
  75. package/dist/cjs/dropdown-menu.js +1 -0
  76. package/dist/cjs/extra-settings.js +3 -2
  77. package/dist/cjs/file-upload-area.js +3 -142
  78. package/dist/cjs/hint-text.js +1 -0
  79. package/dist/cjs/hue-slider.js +1 -0
  80. package/dist/cjs/index.js +180 -21
  81. package/dist/cjs/label.js +3 -2
  82. package/dist/cjs/link-bubble.js +5 -3
  83. package/dist/cjs/modal-body.js +1 -0
  84. package/dist/cjs/modal-content.js +1 -0
  85. package/dist/cjs/modal-footer.js +1 -0
  86. package/dist/cjs/modal-header.js +1 -0
  87. package/dist/cjs/pagination-content.js +31 -0
  88. package/dist/cjs/pagination-ellipsis.js +35 -0
  89. package/dist/cjs/pagination-first.js +3 -0
  90. package/dist/cjs/pagination-item.js +3 -0
  91. package/dist/cjs/pagination-last.js +3 -0
  92. package/dist/cjs/pagination-next.js +3 -0
  93. package/dist/cjs/pagination-previous.js +3 -0
  94. package/dist/cjs/pagination.js +60 -0
  95. package/dist/cjs/popover-content.js +1 -0
  96. package/dist/cjs/popover-trigger.js +1 -0
  97. package/dist/cjs/progress-bar.js +1 -0
  98. package/dist/cjs/progress-circle.js +1 -0
  99. package/dist/cjs/radio-group-card.js +1 -0
  100. package/dist/cjs/radio-group-item.js +3 -2
  101. package/dist/cjs/radio-group-label.js +1 -0
  102. package/dist/cjs/radio-group.js +3 -2
  103. package/dist/cjs/rich-editor.js +11 -4577
  104. package/dist/cjs/scroll-bar.js +1 -0
  105. package/dist/cjs/segmented-control-item.js +1 -0
  106. package/dist/cjs/segmented-control.js +1 -0
  107. package/dist/cjs/select-content.js +1 -0
  108. package/dist/cjs/select-item.js +1 -0
  109. package/dist/cjs/select-trigger.js +1 -0
  110. package/dist/cjs/select-value.js +1 -0
  111. package/dist/cjs/sheet-close.js +29 -0
  112. package/dist/cjs/sheet-content.js +61 -0
  113. package/dist/cjs/sheet-description.js +31 -0
  114. package/dist/cjs/sheet-footer.js +28 -0
  115. package/dist/cjs/sheet-header.js +23 -0
  116. package/dist/cjs/sheet-title.js +31 -0
  117. package/dist/cjs/sheet-trigger.js +3 -0
  118. package/dist/cjs/sheet.js +3 -0
  119. package/dist/cjs/sidebar-content.js +4 -0
  120. package/dist/cjs/sidebar-element.js +4 -0
  121. package/dist/cjs/sidebar-footer.js +4 -0
  122. package/dist/cjs/sidebar-group-content.js +24 -0
  123. package/dist/cjs/sidebar-group-label.js +4 -0
  124. package/dist/cjs/sidebar-group.js +4 -0
  125. package/dist/cjs/sidebar-header.js +4 -0
  126. package/dist/cjs/sidebar-menu-action.js +4 -0
  127. package/dist/cjs/sidebar-menu-badge.js +4 -0
  128. package/dist/cjs/sidebar-menu-button.js +4 -0
  129. package/dist/cjs/sidebar-menu-item.js +4 -0
  130. package/dist/cjs/sidebar-menu-sub-button.js +4 -0
  131. package/dist/cjs/sidebar-menu-sub-item.js +4 -0
  132. package/dist/cjs/sidebar-menu-sub.js +4 -0
  133. package/dist/cjs/sidebar-menu.js +4 -0
  134. package/dist/cjs/sidebar-provider.js +3 -0
  135. package/dist/cjs/sidebar-separator.js +3 -0
  136. package/dist/cjs/sidebar-trigger.js +34 -0
  137. package/dist/cjs/sidebar.js +4 -0
  138. package/dist/cjs/slider.js +3 -2
  139. package/dist/cjs/sonner-alert.js +1 -0
  140. package/dist/cjs/status-badge.js +1 -0
  141. package/dist/cjs/switch.js +3 -2
  142. package/dist/cjs/tab-menu-content.js +1 -0
  143. package/dist/cjs/tab-menu-item.js +1 -0
  144. package/dist/cjs/tab-menu-list.js +1 -0
  145. package/dist/cjs/tab-menu.js +1 -0
  146. package/dist/cjs/tag.js +1 -0
  147. package/dist/cjs/text-input-button.js +1 -0
  148. package/dist/cjs/text-input.js +1 -0
  149. package/dist/cjs/textarea.js +1 -0
  150. package/dist/cjs/tooltip-content.js +94 -0
  151. package/dist/cjs/tooltip-provider.js +3 -0
  152. package/dist/cjs/tooltip-root.js +3 -0
  153. package/dist/cjs/tooltip-trigger.js +3 -0
  154. package/dist/cjs/tooltip.js +2 -114
  155. package/dist/cjs/use-color-model.js +31 -4
  156. package/dist/cjs/use-sidebar.js +18 -0
  157. package/dist/components/collapsible/collapsible-content.d.ts +14 -0
  158. package/dist/components/collapsible/collapsible-trigger.d.ts +12 -0
  159. package/dist/components/collapsible/collapsible.d.ts +18 -0
  160. package/dist/components/collapsible/index.d.ts +6 -0
  161. package/dist/components/combobox/combobox-root.d.ts +2 -2
  162. package/dist/components/combobox/combobox.d.ts +2 -2
  163. package/dist/components/index.d.ts +4 -0
  164. package/dist/components/pagination/index.d.ts +16 -0
  165. package/dist/components/pagination/pagination-content.d.ts +21 -0
  166. package/dist/components/pagination/pagination-ellipsis.d.ts +14 -0
  167. package/dist/components/pagination/pagination-first.d.ts +14 -0
  168. package/dist/components/pagination/pagination-item.d.ts +16 -0
  169. package/dist/components/pagination/pagination-last.d.ts +14 -0
  170. package/dist/components/pagination/pagination-next.d.ts +14 -0
  171. package/dist/components/pagination/pagination-previous.d.ts +14 -0
  172. package/dist/components/pagination/pagination.d.ts +32 -0
  173. package/dist/components/select/select.d.ts +2 -2
  174. package/dist/components/sheet/index.d.ts +16 -0
  175. package/dist/components/sheet/sheet-close.d.ts +14 -0
  176. package/dist/components/sheet/sheet-content.d.ts +31 -0
  177. package/dist/components/sheet/sheet-description.d.ts +14 -0
  178. package/dist/components/sheet/sheet-footer.d.ts +13 -0
  179. package/dist/components/sheet/sheet-header.d.ts +13 -0
  180. package/dist/components/sheet/sheet-title.d.ts +14 -0
  181. package/dist/components/sheet/sheet-trigger.d.ts +12 -0
  182. package/dist/components/sheet/sheet.d.ts +22 -0
  183. package/dist/components/sidebar/index.d.ts +38 -0
  184. package/dist/components/sidebar/sidebar-content.d.ts +21 -0
  185. package/dist/components/sidebar/sidebar-element.d.ts +16 -0
  186. package/dist/components/sidebar/sidebar-footer.d.ts +13 -0
  187. package/dist/components/sidebar/sidebar-group-content.d.ts +21 -0
  188. package/dist/components/sidebar/sidebar-group-label.d.ts +22 -0
  189. package/dist/components/sidebar/sidebar-group.d.ts +21 -0
  190. package/dist/components/sidebar/sidebar-header.d.ts +13 -0
  191. package/dist/components/sidebar/sidebar-menu-action.d.ts +17 -0
  192. package/dist/components/sidebar/sidebar-menu-badge.d.ts +14 -0
  193. package/dist/components/sidebar/sidebar-menu-button.d.ts +28 -0
  194. package/dist/components/sidebar/sidebar-menu-item.d.ts +21 -0
  195. package/dist/components/sidebar/sidebar-menu-sub-button.d.ts +20 -0
  196. package/dist/components/sidebar/sidebar-menu-sub-item.d.ts +21 -0
  197. package/dist/components/sidebar/sidebar-menu-sub.d.ts +21 -0
  198. package/dist/components/sidebar/sidebar-menu.d.ts +21 -0
  199. package/dist/components/sidebar/sidebar-provider.d.ts +30 -0
  200. package/dist/components/sidebar/sidebar-separator.d.ts +6 -0
  201. package/dist/components/sidebar/sidebar-trigger.d.ts +6 -0
  202. package/dist/components/sidebar/sidebar.d.ts +19 -0
  203. package/dist/components/tooltip/index.d.ts +8 -0
  204. package/dist/components/tooltip/tooltip-content.d.ts +31 -0
  205. package/dist/components/tooltip/tooltip-provider.d.ts +14 -0
  206. package/dist/components/tooltip/tooltip-root.d.ts +16 -0
  207. package/dist/components/tooltip/tooltip-trigger.d.ts +12 -0
  208. package/dist/composables/index.d.ts +2 -0
  209. package/dist/composables/use-sidebar.d.ts +56 -0
  210. package/dist/es/alert.js +1 -0
  211. package/dist/es/badge.js +1 -0
  212. package/dist/es/button.js +2 -1
  213. package/dist/es/checkbox-card.js +2 -1
  214. package/dist/es/checkbox-label.js +2 -1
  215. package/dist/es/checkbox.js +2 -1
  216. package/dist/es/chunks/alpha-slider.js +1 -1
  217. package/dist/es/chunks/collapsible-content.js +28 -0
  218. package/dist/es/chunks/collapsible-trigger.js +23 -0
  219. package/dist/es/chunks/collapsible.js +29 -0
  220. package/dist/es/chunks/combobox-anchor.js +1 -1
  221. package/dist/es/chunks/content-divider.vue_vue_type_style_index_0_lang.js +1 -1
  222. package/dist/es/chunks/{counter-input.vue_vue_type_style_index_0_lang.js → counter-input.js} +1 -1
  223. package/dist/es/chunks/index.js +463 -79
  224. package/dist/es/chunks/index2.js +19 -1
  225. package/dist/es/chunks/index3.js +241 -1425
  226. package/dist/es/chunks/index4.js +1335 -16336
  227. package/dist/es/chunks/index5.js +16458 -0
  228. package/dist/es/chunks/pagination-first.js +33 -0
  229. package/dist/es/chunks/pagination-item.js +33 -0
  230. package/dist/es/chunks/pagination-last.js +33 -0
  231. package/dist/es/chunks/pagination-next.js +33 -0
  232. package/dist/es/chunks/pagination-previous.js +33 -0
  233. package/dist/es/chunks/popover.js +1 -1
  234. package/dist/es/chunks/{radio-group-item.vue_vue_type_style_index_0_lang.js → radio-group-item.js} +1 -1
  235. package/dist/es/chunks/rich-editor.vue_vue_type_style_index_0_scoped_dbc85b1a_lang.js +4576 -0
  236. package/dist/es/chunks/select-group.js +1 -1
  237. package/dist/es/chunks/sheet-trigger.js +23 -0
  238. package/dist/es/chunks/sheet.js +27 -0
  239. package/dist/es/chunks/sidebar-content.js +22 -0
  240. package/dist/es/chunks/sidebar-element.js +29 -0
  241. package/dist/es/chunks/sidebar-footer.js +22 -0
  242. package/dist/es/chunks/sidebar-group-label.js +30 -0
  243. package/dist/es/chunks/sidebar-group.js +22 -0
  244. package/dist/es/chunks/sidebar-header.js +22 -0
  245. package/dist/es/chunks/sidebar-menu-action.js +35 -0
  246. package/dist/es/chunks/sidebar-menu-badge.js +30 -0
  247. package/dist/es/chunks/sidebar-menu-button.js +40 -0
  248. package/dist/es/chunks/sidebar-menu-item.js +22 -0
  249. package/dist/es/chunks/sidebar-menu-sub-button.js +38 -0
  250. package/dist/es/chunks/sidebar-menu-sub-item.js +22 -0
  251. package/dist/es/chunks/sidebar-menu-sub.js +22 -0
  252. package/dist/es/chunks/sidebar-menu.js +22 -0
  253. package/dist/es/chunks/sidebar-provider.vue_vue_type_style_index_0_lang.js +64 -0
  254. package/dist/es/chunks/sidebar-separator.vue_vue_type_style_index_0_lang.js +129 -0
  255. package/dist/es/chunks/sidebar.js +85 -0
  256. package/dist/es/chunks/{slider.vue_vue_type_style_index_0_lang.js → slider.js} +1 -1
  257. package/dist/es/chunks/{switch.vue_vue_type_style_index_0_lang.js → switch.js} +1 -1
  258. package/dist/es/chunks/{use-color-model.js → tinycolor.js} +0 -30
  259. package/dist/es/chunks/tooltip-provider.js +27 -0
  260. package/dist/es/chunks/tooltip-root.js +37 -0
  261. package/dist/es/chunks/tooltip-trigger.js +24 -0
  262. package/dist/es/chunks/tooltip.js +85 -0
  263. package/dist/es/collapsible-content.js +5 -0
  264. package/dist/es/collapsible-trigger.js +4 -0
  265. package/dist/es/collapsible.js +4 -0
  266. package/dist/es/color-area.js +2 -1
  267. package/dist/es/color-picker.js +5 -3
  268. package/dist/es/color-swatch.js +3 -1
  269. package/dist/es/combobox-empty.js +1 -0
  270. package/dist/es/combobox-group.js +2 -1
  271. package/dist/es/combobox-input.js +2 -1
  272. package/dist/es/combobox-item.js +3 -1
  273. package/dist/es/combobox-list.js +2 -1
  274. package/dist/es/combobox-root.js +2 -1
  275. package/dist/es/combobox-separator.js +2 -1
  276. package/dist/es/combobox-trigger.js +2 -1
  277. package/dist/es/combobox.js +1 -0
  278. package/dist/es/command-group.js +1 -1
  279. package/dist/es/command-input.js +1 -1
  280. package/dist/es/command-list.js +1 -1
  281. package/dist/es/command-root.js +1 -1
  282. package/dist/es/command-separator.js +1 -1
  283. package/dist/es/compact-button.js +2 -1
  284. package/dist/es/counter-input.js +2 -1
  285. package/dist/es/digit-input-group.js +2 -1
  286. package/dist/es/digit-input-slot.js +2 -1
  287. package/dist/es/digit-input.js +2 -1
  288. package/dist/es/dropdown-menu-content.js +2 -1
  289. package/dist/es/dropdown-menu-group.js +2 -1
  290. package/dist/es/dropdown-menu-item.js +2 -1
  291. package/dist/es/dropdown-menu-label.js +2 -1
  292. package/dist/es/dropdown-menu-separator.js +2 -1
  293. package/dist/es/dropdown-menu-sub-content.js +2 -1
  294. package/dist/es/dropdown-menu-sub-trigger.js +2 -1
  295. package/dist/es/dropdown-menu-trigger.js +2 -1
  296. package/dist/es/dropdown-menu.js +2 -1
  297. package/dist/es/extra-settings.js +3 -2
  298. package/dist/es/fancy-button.js +1 -1
  299. package/dist/es/file-upload-area.js +3 -142
  300. package/dist/es/hint-text.js +1 -0
  301. package/dist/es/hue-slider.js +1 -0
  302. package/dist/es/index.js +212 -53
  303. package/dist/es/label.js +4 -3
  304. package/dist/es/link-bubble.js +4 -2
  305. package/dist/es/link-button.js +1 -1
  306. package/dist/es/modal-body.js +1 -0
  307. package/dist/es/modal-content.js +2 -1
  308. package/dist/es/modal-footer.js +1 -0
  309. package/dist/es/modal-header.js +2 -1
  310. package/dist/es/pagination-content.js +32 -0
  311. package/dist/es/pagination-ellipsis.js +36 -0
  312. package/dist/es/pagination-first.js +4 -0
  313. package/dist/es/pagination-item.js +4 -0
  314. package/dist/es/pagination-last.js +4 -0
  315. package/dist/es/pagination-next.js +4 -0
  316. package/dist/es/pagination-previous.js +4 -0
  317. package/dist/es/pagination.js +61 -0
  318. package/dist/es/popover-content.js +2 -1
  319. package/dist/es/popover-trigger.js +2 -1
  320. package/dist/es/progress-bar.js +2 -1
  321. package/dist/es/progress-circle.js +2 -1
  322. package/dist/es/radio-group-card.js +2 -1
  323. package/dist/es/radio-group-item.js +2 -1
  324. package/dist/es/radio-group-label.js +2 -1
  325. package/dist/es/radio-group.js +2 -1
  326. package/dist/es/rich-editor.js +16 -4582
  327. package/dist/es/scroll-bar.js +2 -1
  328. package/dist/es/segmented-control-item.js +2 -1
  329. package/dist/es/segmented-control.js +2 -1
  330. package/dist/es/select-content.js +2 -1
  331. package/dist/es/select-item.js +2 -1
  332. package/dist/es/select-label.js +1 -1
  333. package/dist/es/select-separator.js +1 -1
  334. package/dist/es/select-trigger.js +2 -1
  335. package/dist/es/select-value.js +2 -1
  336. package/dist/es/sheet-close.js +30 -0
  337. package/dist/es/sheet-content.js +62 -0
  338. package/dist/es/sheet-description.js +32 -0
  339. package/dist/es/sheet-footer.js +29 -0
  340. package/dist/es/sheet-header.js +24 -0
  341. package/dist/es/sheet-title.js +32 -0
  342. package/dist/es/sheet-trigger.js +4 -0
  343. package/dist/es/sheet.js +4 -0
  344. package/dist/es/sidebar-content.js +5 -0
  345. package/dist/es/sidebar-element.js +5 -0
  346. package/dist/es/sidebar-footer.js +5 -0
  347. package/dist/es/sidebar-group-content.js +25 -0
  348. package/dist/es/sidebar-group-label.js +5 -0
  349. package/dist/es/sidebar-group.js +5 -0
  350. package/dist/es/sidebar-header.js +5 -0
  351. package/dist/es/sidebar-menu-action.js +5 -0
  352. package/dist/es/sidebar-menu-badge.js +5 -0
  353. package/dist/es/sidebar-menu-button.js +5 -0
  354. package/dist/es/sidebar-menu-item.js +5 -0
  355. package/dist/es/sidebar-menu-sub-button.js +5 -0
  356. package/dist/es/sidebar-menu-sub-item.js +5 -0
  357. package/dist/es/sidebar-menu-sub.js +5 -0
  358. package/dist/es/sidebar-menu.js +5 -0
  359. package/dist/es/sidebar-provider.js +4 -0
  360. package/dist/es/sidebar-separator.js +4 -0
  361. package/dist/es/sidebar-trigger.js +35 -0
  362. package/dist/es/sidebar.js +5 -0
  363. package/dist/es/slider.js +2 -1
  364. package/dist/es/social-button.js +1 -1
  365. package/dist/es/sonner-alert.js +1 -0
  366. package/dist/es/status-badge.js +1 -0
  367. package/dist/es/switch.js +2 -1
  368. package/dist/es/tab-menu-content.js +2 -1
  369. package/dist/es/tab-menu-item.js +2 -1
  370. package/dist/es/tab-menu-list.js +2 -1
  371. package/dist/es/tab-menu.js +2 -1
  372. package/dist/es/tag.js +2 -1
  373. package/dist/es/text-input-button.js +1 -0
  374. package/dist/es/text-input.js +2 -1
  375. package/dist/es/textarea.js +1 -0
  376. package/dist/es/tooltip-content.js +95 -0
  377. package/dist/es/tooltip-provider.js +4 -0
  378. package/dist/es/tooltip-root.js +4 -0
  379. package/dist/es/tooltip-trigger.js +4 -0
  380. package/dist/es/tooltip.js +2 -114
  381. package/dist/es/use-color-model.js +31 -4
  382. package/dist/es/use-sidebar.js +18 -0
  383. package/dist/index.d.ts +1 -0
  384. package/package.json +4 -3
  385. package/src/components/collapsible/collapsible-content.vue +38 -0
  386. package/src/components/collapsible/collapsible-trigger.vue +16 -0
  387. package/src/components/collapsible/collapsible.vue +19 -0
  388. package/src/components/collapsible/index.ts +6 -0
  389. package/src/components/collapsible/stories/collapsible.stories.ts +67 -0
  390. package/src/components/index.ts +4 -0
  391. package/src/components/pagination/index.ts +23 -0
  392. package/src/components/pagination/pagination-content.vue +36 -0
  393. package/src/components/pagination/pagination-ellipsis.vue +47 -0
  394. package/src/components/pagination/pagination-first.vue +29 -0
  395. package/src/components/pagination/pagination-item.vue +28 -0
  396. package/src/components/pagination/pagination-last.vue +29 -0
  397. package/src/components/pagination/pagination-next.vue +29 -0
  398. package/src/components/pagination/pagination-previous.vue +33 -0
  399. package/src/components/pagination/pagination.vue +157 -0
  400. package/src/components/pagination/stories/pagination.stories.ts +154 -0
  401. package/src/components/sheet/index.ts +16 -0
  402. package/src/components/sheet/sheet-close.vue +26 -0
  403. package/src/components/sheet/sheet-content.vue +163 -0
  404. package/src/components/sheet/sheet-description.vue +33 -0
  405. package/src/components/sheet/sheet-footer.vue +40 -0
  406. package/src/components/sheet/sheet-header.vue +36 -0
  407. package/src/components/sheet/sheet-title.vue +33 -0
  408. package/src/components/sheet/sheet-trigger.vue +16 -0
  409. package/src/components/sheet/sheet.vue +15 -0
  410. package/src/components/sheet/stories/sheet.stories.ts +88 -0
  411. package/src/components/sidebar/index.ts +38 -0
  412. package/src/components/sidebar/sidebar-content.vue +32 -0
  413. package/src/components/sidebar/sidebar-element.vue +68 -0
  414. package/src/components/sidebar/sidebar-footer.vue +34 -0
  415. package/src/components/sidebar/sidebar-group-content.vue +24 -0
  416. package/src/components/sidebar/sidebar-group-label.vue +55 -0
  417. package/src/components/sidebar/sidebar-group.vue +28 -0
  418. package/src/components/sidebar/sidebar-header.vue +34 -0
  419. package/src/components/sidebar/sidebar-menu-action.vue +118 -0
  420. package/src/components/sidebar/sidebar-menu-badge.vue +70 -0
  421. package/src/components/sidebar/sidebar-menu-button.vue +141 -0
  422. package/src/components/sidebar/sidebar-menu-item.vue +23 -0
  423. package/src/components/sidebar/sidebar-menu-sub-button.vue +110 -0
  424. package/src/components/sidebar/sidebar-menu-sub-item.vue +23 -0
  425. package/src/components/sidebar/sidebar-menu-sub.vue +35 -0
  426. package/src/components/sidebar/sidebar-menu.vue +27 -0
  427. package/src/components/sidebar/sidebar-provider.vue +101 -0
  428. package/src/components/sidebar/sidebar-separator.vue +31 -0
  429. package/src/components/sidebar/sidebar-trigger.vue +39 -0
  430. package/src/components/sidebar/sidebar.vue +201 -0
  431. package/src/components/sidebar/stories/sidebar.stories.ts +358 -0
  432. package/src/components/switch/switch.vue +34 -16
  433. package/src/components/tooltip/index.ts +12 -0
  434. package/src/components/tooltip/tooltip-content.vue +249 -0
  435. package/src/components/tooltip/tooltip-provider.vue +17 -0
  436. package/src/components/tooltip/tooltip-root.vue +23 -0
  437. package/src/components/tooltip/tooltip-trigger.vue +17 -0
  438. package/src/components/tooltip/tooltip.vue +21 -214
  439. package/src/composables/index.ts +2 -0
  440. package/src/composables/use-sidebar.ts +19 -0
  441. package/src/index.ts +1 -0
  442. /package/dist/cjs/chunks/{checkbox.vue_vue_type_style_index_0_lang.js → checkbox.js} +0 -0
  443. /package/dist/cjs/chunks/{counter-input.vue_vue_type_style_index_0_lang.js → counter-input.js} +0 -0
  444. /package/dist/cjs/chunks/{radio-group-item.vue_vue_type_style_index_0_lang.js → radio-group-item.js} +0 -0
  445. /package/dist/cjs/chunks/{radio-group.vue_vue_type_style_index_0_lang.js → radio-group.js} +0 -0
  446. /package/dist/cjs/chunks/{slider.vue_vue_type_style_index_0_lang.js → slider.js} +0 -0
  447. /package/dist/cjs/chunks/{switch.vue_vue_type_style_index_0_lang.js → switch.js} +0 -0
  448. /package/dist/es/chunks/{checkbox.vue_vue_type_style_index_0_lang.js → checkbox.js} +0 -0
  449. /package/dist/es/chunks/{radio-group.vue_vue_type_style_index_0_lang.js → radio-group.js} +0 -0
@@ -1,1457 +1,273 @@
1
- import { P as PluginKey, S as Selection, k as keydownHandler, a as SelectionRange, T as TextSelection, F as Fragment, b as Slice, E as Extension, c as Plugin, i as isTextSelection, p as posToDOMRect, g as getText, d as getTextSerializersFromSchema } from "./index4.js";
2
- import { s as flip, u as shift, v as offset, w as arrow$1, B as size, C as autoPlacement, D as hide, E as inline, H as computePosition } from "./index.js";
3
- import { defineComponent, ref, onMounted, onBeforeUnmount, h, Teleport } 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 };
1
+ import { i as isClient, t as toArray, w as watchImmediate, a as tryOnScopeDispose, p as pxValue, b as isObject, c as isDef, d as injectLocal } from "./index2.js";
2
+ import { computed, toValue, shallowRef, watchEffect, getCurrentInstance, ref, watch, nextTick, unref, hasInjectionContext, onMounted } from "vue";
3
+ const defaultWindow = isClient ? window : void 0;
4
+ const defaultDocument = isClient ? window.document : void 0;
5
+ function unrefElement(elRef) {
6
+ var _a;
7
+ const plain = toValue(elRef);
8
+ return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
596
9
  }
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;
10
+ function useEventListener(...args) {
11
+ const cleanups = [];
12
+ const cleanup = () => {
13
+ cleanups.forEach((fn) => fn());
14
+ cleanups.length = 0;
634
15
  };
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
16
+ const register = (el, event, listener, options) => {
17
+ el.addEventListener(event, listener, options);
18
+ return () => el.removeEventListener(event, listener, options);
19
+ };
20
+ const firstParamTargets = computed(() => {
21
+ const test = toArray(toValue(args[0])).filter((e) => e != null);
22
+ return test.every((e) => typeof e !== "string") ? test : void 0;
642
23
  });
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
24
+ const stopWatch = watchImmediate(
25
+ () => {
26
+ var _a, _b;
27
+ return [
28
+ (_b = (_a = firstParamTargets.value) == null ? void 0 : _a.map((e) => unrefElement(e))) != null ? _b : [defaultWindow].filter((e) => e != null),
29
+ toArray(toValue(firstParamTargets.value ? args[1] : args[0])),
30
+ toArray(unref(firstParamTargets.value ? args[2] : args[1])),
31
+ // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
32
+ toValue(firstParamTargets.value ? args[3] : args[2])
33
+ ];
34
+ },
35
+ ([raw_targets, raw_events, raw_listeners, raw_options]) => {
36
+ cleanup();
37
+ if (!(raw_targets == null ? void 0 : raw_targets.length) || !(raw_events == null ? void 0 : raw_events.length) || !(raw_listeners == null ? void 0 : raw_listeners.length))
38
+ return;
39
+ const optionsClone = isObject(raw_options) ? { ...raw_options } : raw_options;
40
+ cleanups.push(
41
+ ...raw_targets.flatMap(
42
+ (el) => raw_events.flatMap(
43
+ (event) => raw_listeners.map((listener) => register(el, event, listener, optionsClone))
44
+ )
45
+ )
664
46
  );
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;
47
+ },
48
+ { flush: "post" }
49
+ );
50
+ const stop = () => {
51
+ stopWatch();
52
+ cleanup();
689
53
  };
54
+ tryOnScopeDispose(cleanup);
55
+ return stop;
690
56
  }
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);
57
+ // @__NO_SIDE_EFFECTS__
58
+ function useMounted() {
59
+ const isMounted = shallowRef(false);
60
+ const instance = getCurrentInstance();
61
+ if (instance) {
62
+ onMounted(() => {
63
+ isMounted.value = true;
64
+ }, instance);
715
65
  }
716
- return true;
66
+ return isMounted;
717
67
  }
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;
68
+ // @__NO_SIDE_EFFECTS__
69
+ function useSupported(callback) {
70
+ const isMounted = /* @__PURE__ */ useMounted();
71
+ return computed(() => {
72
+ isMounted.value;
73
+ return Boolean(callback());
74
+ });
736
75
  }
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
- };
76
+ const ssrWidthSymbol = Symbol("vueuse-ssr-width");
77
+ // @__NO_SIDE_EFFECTS__
78
+ function useSSRWidth() {
79
+ const ssrWidth = hasInjectionContext() ? injectLocal(ssrWidthSymbol, null) : null;
80
+ return typeof ssrWidth === "number" ? ssrWidth : void 0;
768
81
  }
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
- );
82
+ function useMediaQuery(query, options = {}) {
83
+ const { window: window2 = defaultWindow, ssrWidth = /* @__PURE__ */ useSSRWidth() } = options;
84
+ const isSupported = /* @__PURE__ */ useSupported(() => window2 && "matchMedia" in window2 && typeof window2.matchMedia === "function");
85
+ const ssrSupport = shallowRef(typeof ssrWidth === "number");
86
+ const mediaQuery = shallowRef();
87
+ const matches = shallowRef(false);
88
+ const handler = (event) => {
89
+ matches.value = event.matches;
788
90
  };
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
- options
827
- }) {
828
- this.preventHide = false;
829
- this.isVisible = false;
830
- this.floatingUIOptions = {
831
- strategy: "absolute",
832
- placement: "top",
833
- offset: 8,
834
- flip: {},
835
- shift: {},
836
- arrow: false,
837
- size: false,
838
- autoPlacement: false,
839
- hide: false,
840
- inline: false,
841
- onShow: void 0,
842
- onHide: void 0,
843
- onUpdate: void 0,
844
- onDestroy: void 0
845
- };
846
- this.shouldShow = ({ view: view2, state, from, to }) => {
847
- const { doc, selection } = state;
848
- const { empty } = selection;
849
- const isEmptyTextBlock = !doc.textBetween(from, to).length && isTextSelection(state.selection);
850
- const isChildOfMenu = this.element.contains(document.activeElement);
851
- const hasEditorFocus = view2.hasFocus() || isChildOfMenu;
852
- if (!hasEditorFocus || empty || isEmptyTextBlock || !this.editor.isEditable) {
853
- return false;
854
- }
855
- return true;
856
- };
857
- this.mousedownHandler = () => {
858
- this.preventHide = true;
859
- };
860
- this.dragstartHandler = () => {
861
- this.hide();
862
- };
863
- this.resizeHandler = () => {
864
- if (this.resizeDebounceTimer) {
865
- clearTimeout(this.resizeDebounceTimer);
866
- }
867
- this.resizeDebounceTimer = window.setTimeout(() => {
868
- this.updatePosition();
869
- }, this.resizeDelay);
870
- };
871
- this.focusHandler = () => {
872
- setTimeout(() => this.update(this.editor.view));
873
- };
874
- this.blurHandler = ({ event }) => {
875
- var _a;
876
- if (this.preventHide) {
877
- this.preventHide = false;
878
- return;
879
- }
880
- if ((event == null ? void 0 : event.relatedTarget) && ((_a = this.element.parentNode) == null ? void 0 : _a.contains(event.relatedTarget))) {
881
- return;
882
- }
883
- if ((event == null ? void 0 : event.relatedTarget) === this.editor.view.dom) {
884
- return;
885
- }
886
- this.hide();
887
- };
888
- this.handleDebouncedUpdate = (view2, oldState) => {
889
- const selectionChanged = !(oldState == null ? void 0 : oldState.selection.eq(view2.state.selection));
890
- const docChanged = !(oldState == null ? void 0 : oldState.doc.eq(view2.state.doc));
891
- if (!selectionChanged && !docChanged) {
892
- return;
893
- }
894
- if (this.updateDebounceTimer) {
895
- clearTimeout(this.updateDebounceTimer);
896
- }
897
- this.updateDebounceTimer = window.setTimeout(() => {
898
- this.updateHandler(view2, selectionChanged, docChanged, oldState);
899
- }, this.updateDelay);
900
- };
901
- this.updateHandler = (view2, selectionChanged, docChanged, oldState) => {
902
- const { composing } = view2;
903
- const isSame = !selectionChanged && !docChanged;
904
- if (composing || isSame) {
905
- return;
906
- }
907
- const shouldShow2 = this.getShouldShow(oldState);
908
- if (!shouldShow2) {
909
- this.hide();
910
- return;
911
- }
912
- this.updatePosition();
913
- this.show();
914
- };
915
- this.editor = editor;
916
- this.element = element;
917
- this.view = view;
918
- this.updateDelay = updateDelay;
919
- this.resizeDelay = resizeDelay;
920
- this.floatingUIOptions = {
921
- ...this.floatingUIOptions,
922
- ...options
923
- };
924
- this.element.tabIndex = 0;
925
- if (shouldShow) {
926
- this.shouldShow = shouldShow;
927
- }
928
- this.element.addEventListener("mousedown", this.mousedownHandler, { capture: true });
929
- this.view.dom.addEventListener("dragstart", this.dragstartHandler);
930
- this.editor.on("focus", this.focusHandler);
931
- this.editor.on("blur", this.blurHandler);
932
- window.addEventListener("resize", this.resizeHandler);
933
- this.update(view, view.state);
934
- if (this.getShouldShow()) {
935
- this.show();
936
- }
937
- }
938
- get middlewares() {
939
- const middlewares = [];
940
- if (this.floatingUIOptions.flip) {
941
- middlewares.push(flip(typeof this.floatingUIOptions.flip !== "boolean" ? this.floatingUIOptions.flip : void 0));
942
- }
943
- if (this.floatingUIOptions.shift) {
944
- middlewares.push(
945
- shift(typeof this.floatingUIOptions.shift !== "boolean" ? this.floatingUIOptions.shift : void 0)
946
- );
947
- }
948
- if (this.floatingUIOptions.offset) {
949
- middlewares.push(
950
- offset(typeof this.floatingUIOptions.offset !== "boolean" ? this.floatingUIOptions.offset : void 0)
951
- );
952
- }
953
- if (this.floatingUIOptions.arrow) {
954
- middlewares.push(arrow$1(this.floatingUIOptions.arrow));
955
- }
956
- if (this.floatingUIOptions.size) {
957
- middlewares.push(size(typeof this.floatingUIOptions.size !== "boolean" ? this.floatingUIOptions.size : void 0));
958
- }
959
- if (this.floatingUIOptions.autoPlacement) {
960
- middlewares.push(
961
- autoPlacement(
962
- typeof this.floatingUIOptions.autoPlacement !== "boolean" ? this.floatingUIOptions.autoPlacement : void 0
963
- )
964
- );
965
- }
966
- if (this.floatingUIOptions.hide) {
967
- middlewares.push(hide(typeof this.floatingUIOptions.hide !== "boolean" ? this.floatingUIOptions.hide : void 0));
968
- }
969
- if (this.floatingUIOptions.inline) {
970
- middlewares.push(
971
- inline(typeof this.floatingUIOptions.inline !== "boolean" ? this.floatingUIOptions.inline : void 0)
972
- );
973
- }
974
- return middlewares;
975
- }
976
- updatePosition() {
977
- const { selection } = this.editor.state;
978
- const domRect = posToDOMRect(this.view, selection.from, selection.to);
979
- let virtualElement = {
980
- getBoundingClientRect: () => domRect,
981
- getClientRects: () => [domRect]
982
- };
983
- if (selection instanceof CellSelection) {
984
- const { $anchorCell, $headCell } = selection;
985
- const from = $anchorCell ? $anchorCell.pos : $headCell.pos;
986
- const to = $headCell ? $headCell.pos : $anchorCell.pos;
987
- const fromDOM = this.view.nodeDOM(from);
988
- const toDOM = this.view.nodeDOM(to);
989
- if (!fromDOM || !toDOM) {
990
- return;
991
- }
992
- const clientRect = fromDOM === toDOM ? fromDOM.getBoundingClientRect() : combineDOMRects(
993
- fromDOM.getBoundingClientRect(),
994
- toDOM.getBoundingClientRect()
995
- );
996
- virtualElement = {
997
- getBoundingClientRect: () => clientRect,
998
- getClientRects: () => [clientRect]
999
- };
1000
- }
1001
- computePosition(virtualElement, this.element, {
1002
- placement: this.floatingUIOptions.placement,
1003
- strategy: this.floatingUIOptions.strategy,
1004
- middleware: this.middlewares
1005
- }).then(({ x, y, strategy }) => {
1006
- this.element.style.width = "max-content";
1007
- this.element.style.position = strategy;
1008
- this.element.style.left = `${x}px`;
1009
- this.element.style.top = `${y}px`;
1010
- if (this.isVisible && this.floatingUIOptions.onUpdate) {
1011
- this.floatingUIOptions.onUpdate();
1012
- }
1013
- });
1014
- }
1015
- update(view, oldState) {
1016
- const { state } = view;
1017
- const hasValidSelection = state.selection.from !== state.selection.to;
1018
- if (this.updateDelay > 0 && hasValidSelection) {
1019
- this.handleDebouncedUpdate(view, oldState);
1020
- return;
1021
- }
1022
- const selectionChanged = !(oldState == null ? void 0 : oldState.selection.eq(view.state.selection));
1023
- const docChanged = !(oldState == null ? void 0 : oldState.doc.eq(view.state.doc));
1024
- this.updateHandler(view, selectionChanged, docChanged, oldState);
1025
- }
1026
- getShouldShow(oldState) {
1027
- var _a;
1028
- const { state } = this.view;
1029
- const { selection } = state;
1030
- const { ranges } = selection;
1031
- const from = Math.min(...ranges.map((range) => range.$from.pos));
1032
- const to = Math.max(...ranges.map((range) => range.$to.pos));
1033
- const shouldShow = (_a = this.shouldShow) == null ? void 0 : _a.call(this, {
1034
- editor: this.editor,
1035
- element: this.element,
1036
- view: this.view,
1037
- state,
1038
- oldState,
1039
- from,
1040
- to
1041
- });
1042
- return shouldShow;
1043
- }
1044
- show() {
1045
- var _a;
1046
- if (this.isVisible) {
91
+ watchEffect(() => {
92
+ if (ssrSupport.value) {
93
+ ssrSupport.value = !isSupported.value;
94
+ const queryStrings = toValue(query).split(",");
95
+ matches.value = queryStrings.some((queryString) => {
96
+ const not = queryString.includes("not all");
97
+ const minWidth = queryString.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
98
+ const maxWidth = queryString.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
99
+ let res = Boolean(minWidth || maxWidth);
100
+ if (minWidth && res) {
101
+ res = ssrWidth >= pxValue(minWidth[1]);
102
+ }
103
+ if (maxWidth && res) {
104
+ res = ssrWidth <= pxValue(maxWidth[1]);
105
+ }
106
+ return not ? !res : res;
107
+ });
1047
108
  return;
1048
109
  }
1049
- this.element.style.visibility = "visible";
1050
- this.element.style.opacity = "1";
1051
- (_a = this.view.dom.parentElement) == null ? void 0 : _a.appendChild(this.element);
1052
- if (this.floatingUIOptions.onShow) {
1053
- this.floatingUIOptions.onShow();
1054
- }
1055
- this.isVisible = true;
1056
- }
1057
- hide() {
1058
- if (!this.isVisible) {
110
+ if (!isSupported.value)
1059
111
  return;
1060
- }
1061
- this.element.style.visibility = "hidden";
1062
- this.element.style.opacity = "0";
1063
- this.element.remove();
1064
- if (this.floatingUIOptions.onHide) {
1065
- this.floatingUIOptions.onHide();
1066
- }
1067
- this.isVisible = false;
1068
- }
1069
- destroy() {
1070
- this.hide();
1071
- this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: true });
1072
- this.view.dom.removeEventListener("dragstart", this.dragstartHandler);
1073
- window.removeEventListener("resize", this.resizeHandler);
1074
- this.editor.off("focus", this.focusHandler);
1075
- this.editor.off("blur", this.blurHandler);
1076
- if (this.floatingUIOptions.onDestroy) {
1077
- this.floatingUIOptions.onDestroy();
1078
- }
1079
- }
1080
- };
1081
- var BubbleMenuPlugin = (options) => {
1082
- return new Plugin({
1083
- key: typeof options.pluginKey === "string" ? new PluginKey(options.pluginKey) : options.pluginKey,
1084
- view: (view) => new BubbleMenuView({ view, ...options })
112
+ mediaQuery.value = window2.matchMedia(toValue(query));
113
+ matches.value = mediaQuery.value.matches;
1085
114
  });
1086
- };
1087
- Extension.create({
1088
- name: "bubbleMenu",
1089
- addOptions() {
1090
- return {
1091
- element: null,
1092
- pluginKey: "bubbleMenu",
1093
- updateDelay: void 0,
1094
- shouldShow: null
1095
- };
1096
- },
1097
- addProseMirrorPlugins() {
1098
- if (!this.options.element) {
1099
- return [];
1100
- }
1101
- return [
1102
- BubbleMenuPlugin({
1103
- pluginKey: this.options.pluginKey,
1104
- editor: this.editor,
1105
- element: this.options.element,
1106
- updateDelay: this.options.updateDelay,
1107
- options: this.options.options,
1108
- shouldShow: this.options.shouldShow
1109
- })
1110
- ];
1111
- }
1112
- });
1113
- var BubbleMenu2 = defineComponent({
1114
- name: "BubbleMenu",
1115
- props: {
1116
- pluginKey: {
1117
- type: [String, Object],
1118
- default: "bubbleMenu"
1119
- },
1120
- editor: {
1121
- type: Object,
1122
- required: true
1123
- },
1124
- updateDelay: {
1125
- type: Number,
1126
- default: void 0
1127
- },
1128
- resizeDelay: {
1129
- type: Number,
1130
- default: void 0
1131
- },
1132
- options: {
1133
- type: Object,
1134
- default: () => ({})
1135
- },
1136
- shouldShow: {
1137
- type: Function,
1138
- default: null
1139
- }
1140
- },
1141
- setup(props, { slots }) {
1142
- const root = ref(null);
1143
- onMounted(() => {
1144
- const { editor, options, pluginKey, resizeDelay, shouldShow, updateDelay } = props;
1145
- if (!root.value) {
1146
- return;
1147
- }
1148
- root.value.style.visibility = "hidden";
1149
- root.value.style.position = "absolute";
1150
- root.value.remove();
1151
- editor.registerPlugin(
1152
- BubbleMenuPlugin({
1153
- editor,
1154
- element: root.value,
1155
- options,
1156
- pluginKey,
1157
- resizeDelay,
1158
- shouldShow,
1159
- updateDelay
1160
- })
1161
- );
1162
- });
1163
- onBeforeUnmount(() => {
1164
- const { pluginKey, editor } = props;
1165
- editor.unregisterPlugin(pluginKey);
1166
- });
1167
- return () => {
1168
- var _a;
1169
- return h(Teleport, { to: "body" }, h("div", { ref: root }, (_a = slots.default) == null ? void 0 : _a.call(slots)));
115
+ useEventListener(mediaQuery, "change", handler, { passive: true });
116
+ return computed(() => matches.value);
117
+ }
118
+ function cloneFnJSON(source) {
119
+ return JSON.parse(JSON.stringify(source));
120
+ }
121
+ function useDropZone(target, options = {}) {
122
+ var _a, _b;
123
+ const isOverDropZone = shallowRef(false);
124
+ const files = shallowRef(null);
125
+ let counter = 0;
126
+ let isValid = true;
127
+ if (isClient) {
128
+ const _options = typeof options === "function" ? { onDrop: options } : options;
129
+ const multiple = (_a = _options.multiple) != null ? _a : true;
130
+ const preventDefaultForUnhandled = (_b = _options.preventDefaultForUnhandled) != null ? _b : false;
131
+ const getFiles = (event) => {
132
+ var _a2, _b2;
133
+ const list = Array.from((_b2 = (_a2 = event.dataTransfer) == null ? void 0 : _a2.files) != null ? _b2 : []);
134
+ return list.length === 0 ? null : multiple ? list : [list[0]];
1170
135
  };
1171
- }
1172
- });
1173
- var FloatingMenuView = class {
1174
- constructor({ editor, element, view, options, shouldShow }) {
1175
- this.preventHide = false;
1176
- this.isVisible = false;
1177
- this.shouldShow = ({ view: view2, state }) => {
1178
- const { selection } = state;
1179
- const { $anchor, empty } = selection;
1180
- const isRootDepth = $anchor.depth === 1;
1181
- const isEmptyTextBlock = $anchor.parent.isTextblock && !$anchor.parent.type.spec.code && !$anchor.parent.textContent && $anchor.parent.childCount === 0 && !this.getTextContent($anchor.parent);
1182
- if (!view2.hasFocus() || !empty || !isRootDepth || !isEmptyTextBlock || !this.editor.isEditable) {
136
+ const checkDataTypes = (types) => {
137
+ const dataTypes = unref(_options.dataTypes);
138
+ if (typeof dataTypes === "function")
139
+ return dataTypes(types);
140
+ if (!(dataTypes == null ? void 0 : dataTypes.length))
141
+ return true;
142
+ if (types.length === 0)
1183
143
  return false;
1184
- }
1185
- return true;
144
+ return types.every(
145
+ (type) => dataTypes.some((allowedType) => type.includes(allowedType))
146
+ );
1186
147
  };
1187
- this.floatingUIOptions = {
1188
- strategy: "absolute",
1189
- placement: "right",
1190
- offset: 8,
1191
- flip: {},
1192
- shift: {},
1193
- arrow: false,
1194
- size: false,
1195
- autoPlacement: false,
1196
- hide: false,
1197
- inline: false
148
+ const checkValidity = (items) => {
149
+ const types = Array.from(items != null ? items : []).map((item) => item.type);
150
+ const dataTypesValid = checkDataTypes(types);
151
+ const multipleFilesValid = multiple || items.length <= 1;
152
+ return dataTypesValid && multipleFilesValid;
1198
153
  };
1199
- this.updateHandler = (view2, selectionChanged, docChanged, oldState) => {
1200
- const { composing } = view2;
1201
- const isSame = !selectionChanged && !docChanged;
1202
- if (composing || isSame) {
1203
- return;
154
+ const isSafari = () => /^(?:(?!chrome|android).)*safari/i.test(navigator.userAgent) && !("chrome" in window);
155
+ const handleDragEvent = (event, eventType) => {
156
+ var _a2, _b2, _c, _d, _e, _f;
157
+ const dataTransferItemList = (_a2 = event.dataTransfer) == null ? void 0 : _a2.items;
158
+ isValid = (_b2 = dataTransferItemList && checkValidity(dataTransferItemList)) != null ? _b2 : false;
159
+ if (preventDefaultForUnhandled) {
160
+ event.preventDefault();
1204
161
  }
1205
- const shouldShow2 = this.getShouldShow(oldState);
1206
- if (!shouldShow2) {
1207
- this.hide();
162
+ if (!isSafari() && !isValid) {
163
+ if (event.dataTransfer) {
164
+ event.dataTransfer.dropEffect = "none";
165
+ }
1208
166
  return;
1209
167
  }
1210
- this.updatePosition();
1211
- this.show();
1212
- };
1213
- this.mousedownHandler = () => {
1214
- this.preventHide = true;
1215
- };
1216
- this.focusHandler = () => {
1217
- setTimeout(() => this.update(this.editor.view));
1218
- };
1219
- this.blurHandler = ({ event }) => {
1220
- var _a;
1221
- if (this.preventHide) {
1222
- this.preventHide = false;
1223
- return;
168
+ event.preventDefault();
169
+ if (event.dataTransfer) {
170
+ event.dataTransfer.dropEffect = "copy";
1224
171
  }
1225
- if ((event == null ? void 0 : event.relatedTarget) && ((_a = this.element.parentNode) == null ? void 0 : _a.contains(event.relatedTarget))) {
1226
- return;
1227
- }
1228
- if ((event == null ? void 0 : event.relatedTarget) === this.editor.view.dom) {
1229
- return;
172
+ const currentFiles = getFiles(event);
173
+ switch (eventType) {
174
+ case "enter":
175
+ counter += 1;
176
+ isOverDropZone.value = true;
177
+ (_c = _options.onEnter) == null ? void 0 : _c.call(_options, null, event);
178
+ break;
179
+ case "over":
180
+ (_d = _options.onOver) == null ? void 0 : _d.call(_options, null, event);
181
+ break;
182
+ case "leave":
183
+ counter -= 1;
184
+ if (counter === 0)
185
+ isOverDropZone.value = false;
186
+ (_e = _options.onLeave) == null ? void 0 : _e.call(_options, null, event);
187
+ break;
188
+ case "drop":
189
+ counter = 0;
190
+ isOverDropZone.value = false;
191
+ if (isValid) {
192
+ files.value = currentFiles;
193
+ (_f = _options.onDrop) == null ? void 0 : _f.call(_options, currentFiles, event);
194
+ }
195
+ break;
1230
196
  }
1231
- this.hide();
1232
197
  };
1233
- this.editor = editor;
1234
- this.element = element;
1235
- this.view = view;
1236
- this.floatingUIOptions = {
1237
- ...this.floatingUIOptions,
1238
- ...options
1239
- };
1240
- this.element.tabIndex = 0;
1241
- if (shouldShow) {
1242
- this.shouldShow = shouldShow;
1243
- }
1244
- this.element.addEventListener("mousedown", this.mousedownHandler, { capture: true });
1245
- this.editor.on("focus", this.focusHandler);
1246
- this.editor.on("blur", this.blurHandler);
1247
- this.update(view, view.state);
1248
- if (this.getShouldShow()) {
1249
- this.show();
1250
- }
1251
- }
1252
- getTextContent(node) {
1253
- return getText(node, { textSerializers: getTextSerializersFromSchema(this.editor.schema) });
1254
- }
1255
- get middlewares() {
1256
- const middlewares = [];
1257
- if (this.floatingUIOptions.flip) {
1258
- middlewares.push(flip(typeof this.floatingUIOptions.flip !== "boolean" ? this.floatingUIOptions.flip : void 0));
1259
- }
1260
- if (this.floatingUIOptions.shift) {
1261
- middlewares.push(
1262
- shift(typeof this.floatingUIOptions.shift !== "boolean" ? this.floatingUIOptions.shift : void 0)
1263
- );
1264
- }
1265
- if (this.floatingUIOptions.offset) {
1266
- middlewares.push(
1267
- offset(typeof this.floatingUIOptions.offset !== "boolean" ? this.floatingUIOptions.offset : void 0)
1268
- );
1269
- }
1270
- if (this.floatingUIOptions.arrow) {
1271
- middlewares.push(arrow$1(this.floatingUIOptions.arrow));
1272
- }
1273
- if (this.floatingUIOptions.size) {
1274
- middlewares.push(size(typeof this.floatingUIOptions.size !== "boolean" ? this.floatingUIOptions.size : void 0));
1275
- }
1276
- if (this.floatingUIOptions.autoPlacement) {
1277
- middlewares.push(
1278
- autoPlacement(
1279
- typeof this.floatingUIOptions.autoPlacement !== "boolean" ? this.floatingUIOptions.autoPlacement : void 0
1280
- )
1281
- );
1282
- }
1283
- if (this.floatingUIOptions.hide) {
1284
- middlewares.push(hide(typeof this.floatingUIOptions.hide !== "boolean" ? this.floatingUIOptions.hide : void 0));
1285
- }
1286
- if (this.floatingUIOptions.inline) {
1287
- middlewares.push(
1288
- inline(typeof this.floatingUIOptions.inline !== "boolean" ? this.floatingUIOptions.inline : void 0)
1289
- );
198
+ useEventListener(target, "dragenter", (event) => handleDragEvent(event, "enter"));
199
+ useEventListener(target, "dragover", (event) => handleDragEvent(event, "over"));
200
+ useEventListener(target, "dragleave", (event) => handleDragEvent(event, "leave"));
201
+ useEventListener(target, "drop", (event) => handleDragEvent(event, "drop"));
202
+ }
203
+ return {
204
+ files,
205
+ isOverDropZone
206
+ };
207
+ }
208
+ // @__NO_SIDE_EFFECTS__
209
+ function useVModel(props, key, emit, options = {}) {
210
+ var _a, _b, _c;
211
+ const {
212
+ clone = false,
213
+ passive = false,
214
+ eventName,
215
+ deep = false,
216
+ defaultValue,
217
+ shouldEmit
218
+ } = options;
219
+ const vm = getCurrentInstance();
220
+ const _emit = emit || (vm == null ? void 0 : vm.emit) || ((_a = vm == null ? void 0 : vm.$emit) == null ? void 0 : _a.bind(vm)) || ((_c = (_b = vm == null ? void 0 : vm.proxy) == null ? void 0 : _b.$emit) == null ? void 0 : _c.bind(vm == null ? void 0 : vm.proxy));
221
+ let event = eventName;
222
+ event = event || `update:${key.toString()}`;
223
+ const cloneFn = (val) => !clone ? val : typeof clone === "function" ? clone(val) : cloneFnJSON(val);
224
+ const getValue = () => isDef(props[key]) ? cloneFn(props[key]) : defaultValue;
225
+ const triggerEmit = (value) => {
226
+ if (shouldEmit) {
227
+ if (shouldEmit(value))
228
+ _emit(event, value);
229
+ } else {
230
+ _emit(event, value);
1290
231
  }
1291
- return middlewares;
1292
- }
1293
- getShouldShow(oldState) {
1294
- var _a;
1295
- const { state } = this.view;
1296
- const { selection } = state;
1297
- const { ranges } = selection;
1298
- const from = Math.min(...ranges.map((range) => range.$from.pos));
1299
- const to = Math.max(...ranges.map((range) => range.$to.pos));
1300
- const shouldShow = (_a = this.shouldShow) == null ? void 0 : _a.call(this, {
1301
- editor: this.editor,
1302
- view: this.view,
1303
- state,
1304
- oldState,
1305
- from,
1306
- to
1307
- });
1308
- return shouldShow;
1309
- }
1310
- updatePosition() {
1311
- const { selection } = this.editor.state;
1312
- const domRect = posToDOMRect(this.view, selection.from, selection.to);
1313
- const virtualElement = {
1314
- getBoundingClientRect: () => domRect,
1315
- getClientRects: () => [domRect]
1316
- };
1317
- computePosition(virtualElement, this.element, {
1318
- placement: this.floatingUIOptions.placement,
1319
- strategy: this.floatingUIOptions.strategy,
1320
- middleware: this.middlewares
1321
- }).then(({ x, y, strategy }) => {
1322
- this.element.style.width = "max-content";
1323
- this.element.style.position = strategy;
1324
- this.element.style.left = `${x}px`;
1325
- this.element.style.top = `${y}px`;
1326
- if (this.isVisible && this.floatingUIOptions.onUpdate) {
1327
- this.floatingUIOptions.onUpdate();
232
+ };
233
+ if (passive) {
234
+ const initialValue = getValue();
235
+ const proxy = ref(initialValue);
236
+ let isUpdating = false;
237
+ watch(
238
+ () => props[key],
239
+ (v) => {
240
+ if (!isUpdating) {
241
+ isUpdating = true;
242
+ proxy.value = cloneFn(v);
243
+ nextTick(() => isUpdating = false);
244
+ }
1328
245
  }
1329
- });
1330
- }
1331
- update(view, oldState) {
1332
- const selectionChanged = !(oldState == null ? void 0 : oldState.selection.eq(view.state.selection));
1333
- const docChanged = !(oldState == null ? void 0 : oldState.doc.eq(view.state.doc));
1334
- this.updateHandler(view, selectionChanged, docChanged, oldState);
1335
- }
1336
- show() {
1337
- var _a;
1338
- if (this.isVisible) {
1339
- return;
1340
- }
1341
- this.element.style.visibility = "visible";
1342
- this.element.style.opacity = "1";
1343
- (_a = this.view.dom.parentElement) == null ? void 0 : _a.appendChild(this.element);
1344
- if (this.floatingUIOptions.onShow) {
1345
- this.floatingUIOptions.onShow();
1346
- }
1347
- this.isVisible = true;
1348
- }
1349
- hide() {
1350
- if (!this.isVisible) {
1351
- return;
1352
- }
1353
- this.element.style.visibility = "hidden";
1354
- this.element.style.opacity = "0";
1355
- this.element.remove();
1356
- if (this.floatingUIOptions.onHide) {
1357
- this.floatingUIOptions.onHide();
1358
- }
1359
- this.isVisible = false;
1360
- }
1361
- destroy() {
1362
- this.hide();
1363
- this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: true });
1364
- this.editor.off("focus", this.focusHandler);
1365
- this.editor.off("blur", this.blurHandler);
1366
- if (this.floatingUIOptions.onDestroy) {
1367
- this.floatingUIOptions.onDestroy();
1368
- }
1369
- }
1370
- };
1371
- var FloatingMenuPlugin = (options) => {
1372
- return new Plugin({
1373
- key: typeof options.pluginKey === "string" ? new PluginKey(options.pluginKey) : options.pluginKey,
1374
- view: (view) => new FloatingMenuView({ view, ...options })
1375
- });
1376
- };
1377
- Extension.create({
1378
- name: "floatingMenu",
1379
- addOptions() {
1380
- return {
1381
- element: null,
1382
- options: {},
1383
- pluginKey: "floatingMenu",
1384
- shouldShow: null
1385
- };
1386
- },
1387
- addProseMirrorPlugins() {
1388
- if (!this.options.element) {
1389
- return [];
1390
- }
1391
- return [
1392
- FloatingMenuPlugin({
1393
- pluginKey: this.options.pluginKey,
1394
- editor: this.editor,
1395
- element: this.options.element,
1396
- options: this.options.options,
1397
- shouldShow: this.options.shouldShow
1398
- })
1399
- ];
1400
- }
1401
- });
1402
- var FloatingMenu2 = defineComponent({
1403
- name: "FloatingMenu",
1404
- props: {
1405
- pluginKey: {
1406
- // TODO: TypeScript breaks :(
1407
- // type: [String, Object as PropType<Exclude<FloatingMenuPluginProps['pluginKey'], string>>],
1408
- type: null,
1409
- default: "floatingMenu"
1410
- },
1411
- editor: {
1412
- type: Object,
1413
- required: true
1414
- },
1415
- options: {
1416
- type: Object,
1417
- default: () => ({})
1418
- },
1419
- shouldShow: {
1420
- type: Function,
1421
- default: null
1422
- }
1423
- },
1424
- setup(props, { slots }) {
1425
- const root = ref(null);
1426
- onMounted(() => {
1427
- const { pluginKey, editor, options, shouldShow } = props;
1428
- if (!root.value) {
1429
- return;
246
+ );
247
+ watch(
248
+ proxy,
249
+ (v) => {
250
+ if (!isUpdating && (v !== props[key] || deep))
251
+ triggerEmit(v);
252
+ },
253
+ { deep }
254
+ );
255
+ return proxy;
256
+ } else {
257
+ return computed({
258
+ get() {
259
+ return getValue();
260
+ },
261
+ set(value) {
262
+ triggerEmit(value);
1430
263
  }
1431
- root.value.style.visibility = "hidden";
1432
- root.value.style.position = "absolute";
1433
- root.value.remove();
1434
- editor.registerPlugin(
1435
- FloatingMenuPlugin({
1436
- pluginKey,
1437
- editor,
1438
- element: root.value,
1439
- options,
1440
- shouldShow
1441
- })
1442
- );
1443
- });
1444
- onBeforeUnmount(() => {
1445
- const { pluginKey, editor } = props;
1446
- editor.unregisterPlugin(pluginKey);
1447
264
  });
1448
- return () => {
1449
- var _a;
1450
- return h(Teleport, { to: "body" }, h("div", { ref: root }, (_a = slots.default) == null ? void 0 : _a.call(slots)));
1451
- };
1452
265
  }
1453
- });
266
+ }
1454
267
  export {
1455
- BubbleMenu2 as BubbleMenu,
1456
- FloatingMenu2 as FloatingMenu
268
+ useVModel as a,
269
+ useEventListener as b,
270
+ useDropZone as c,
271
+ defaultDocument as d,
272
+ useMediaQuery as u
1457
273
  };