@proyecto-viviana/solidaria 0.4.3 → 0.6.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1482) hide show
  1. package/LICENSE-APACHE-2.0 +201 -0
  2. package/NOTICE +91 -0
  3. package/README.md +54 -27
  4. package/dist/_chunk/DragManager.js +79 -31
  5. package/dist/_chunk/DragManager.js.map +1 -1
  6. package/dist/_chunk/DragManager.jsx +79 -31
  7. package/dist/_chunk/DragManager.jsx.map +1 -1
  8. package/dist/_chunk/FocusScope.js +380 -73
  9. package/dist/_chunk/FocusScope.js.map +1 -1
  10. package/dist/_chunk/FocusScope.jsx +373 -62
  11. package/dist/_chunk/FocusScope.jsx.map +1 -1
  12. package/dist/_chunk/ListKeyboardDelegate.js +270 -0
  13. package/dist/_chunk/ListKeyboardDelegate.js.map +1 -0
  14. package/dist/_chunk/ListKeyboardDelegate.jsx +270 -0
  15. package/dist/_chunk/ListKeyboardDelegate.jsx.map +1 -0
  16. package/dist/_chunk/actiongroup.js +46 -22
  17. package/dist/_chunk/actiongroup.js.map +1 -1
  18. package/dist/_chunk/actiongroup.jsx +46 -22
  19. package/dist/_chunk/actiongroup.jsx.map +1 -1
  20. package/dist/_chunk/announce.js +24 -9
  21. package/dist/_chunk/announce.js.map +1 -1
  22. package/dist/_chunk/announce.jsx +24 -9
  23. package/dist/_chunk/announce.jsx.map +1 -1
  24. package/dist/_chunk/ariaHideOutside.js +212 -10
  25. package/dist/_chunk/ariaHideOutside.js.map +1 -1
  26. package/dist/_chunk/ariaHideOutside.jsx +212 -10
  27. package/dist/_chunk/ariaHideOutside.jsx.map +1 -1
  28. package/dist/_chunk/autocomplete.js +92 -12
  29. package/dist/_chunk/autocomplete.js.map +1 -1
  30. package/dist/_chunk/autocomplete.jsx +92 -12
  31. package/dist/_chunk/autocomplete.jsx.map +1 -1
  32. package/dist/_chunk/breadcrumbs.js +70 -8
  33. package/dist/_chunk/breadcrumbs.js.map +1 -1
  34. package/dist/_chunk/breadcrumbs.jsx +70 -8
  35. package/dist/_chunk/breadcrumbs.jsx.map +1 -1
  36. package/dist/_chunk/button.js +61 -24
  37. package/dist/_chunk/button.js.map +1 -1
  38. package/dist/_chunk/button.jsx +61 -24
  39. package/dist/_chunk/button.jsx.map +1 -1
  40. package/dist/_chunk/calendar.js +661 -112
  41. package/dist/_chunk/calendar.js.map +1 -1
  42. package/dist/_chunk/calendar.jsx +661 -112
  43. package/dist/_chunk/calendar.jsx.map +1 -1
  44. package/dist/_chunk/callEventHandler.js +21 -0
  45. package/dist/_chunk/callEventHandler.js.map +1 -0
  46. package/dist/_chunk/callEventHandler.jsx +21 -0
  47. package/dist/_chunk/callEventHandler.jsx.map +1 -0
  48. package/dist/_chunk/checkbox.js +142 -48
  49. package/dist/_chunk/checkbox.js.map +1 -1
  50. package/dist/_chunk/checkbox.jsx +142 -48
  51. package/dist/_chunk/checkbox.jsx.map +1 -1
  52. package/dist/_chunk/color.js +495 -73
  53. package/dist/_chunk/color.js.map +1 -1
  54. package/dist/_chunk/color.jsx +495 -73
  55. package/dist/_chunk/color.jsx.map +1 -1
  56. package/dist/_chunk/combobox.js +213 -128
  57. package/dist/_chunk/combobox.js.map +1 -1
  58. package/dist/_chunk/combobox.jsx +213 -128
  59. package/dist/_chunk/combobox.jsx.map +1 -1
  60. package/dist/_chunk/constants.js +12 -0
  61. package/dist/_chunk/constants.js.map +1 -1
  62. package/dist/_chunk/constants.jsx +12 -0
  63. package/dist/_chunk/constants.jsx.map +1 -1
  64. package/dist/_chunk/createCollator.js +12 -0
  65. package/dist/_chunk/createCollator.js.map +1 -1
  66. package/dist/_chunk/createCollator.jsx +12 -0
  67. package/dist/_chunk/createCollator.jsx.map +1 -1
  68. package/dist/_chunk/createCollectionRowInteraction.js +51 -15
  69. package/dist/_chunk/createCollectionRowInteraction.js.map +1 -1
  70. package/dist/_chunk/createCollectionRowInteraction.jsx +51 -15
  71. package/dist/_chunk/createCollectionRowInteraction.jsx.map +1 -1
  72. package/dist/_chunk/createDescription.js +117 -0
  73. package/dist/_chunk/createDescription.js.map +1 -0
  74. package/dist/_chunk/createDescription.jsx +117 -0
  75. package/dist/_chunk/createDescription.jsx.map +1 -0
  76. package/dist/_chunk/createField.js +35 -25
  77. package/dist/_chunk/createField.js.map +1 -1
  78. package/dist/_chunk/createField.jsx +35 -25
  79. package/dist/_chunk/createField.jsx.map +1 -1
  80. package/dist/_chunk/createFocus.js +18 -5
  81. package/dist/_chunk/createFocus.js.map +1 -1
  82. package/dist/_chunk/createFocus.jsx +18 -5
  83. package/dist/_chunk/createFocus.jsx.map +1 -1
  84. package/dist/_chunk/createFocusRing.js +16 -7
  85. package/dist/_chunk/createFocusRing.js.map +1 -1
  86. package/dist/_chunk/createFocusRing.jsx +16 -7
  87. package/dist/_chunk/createFocusRing.jsx.map +1 -1
  88. package/dist/_chunk/createFocusWithin.js +36 -9
  89. package/dist/_chunk/createFocusWithin.js.map +1 -1
  90. package/dist/_chunk/createFocusWithin.jsx +36 -9
  91. package/dist/_chunk/createFocusWithin.jsx.map +1 -1
  92. package/dist/_chunk/createFocusable.js +51 -53
  93. package/dist/_chunk/createFocusable.js.map +1 -1
  94. package/dist/_chunk/createFocusable.jsx +51 -53
  95. package/dist/_chunk/createFocusable.jsx.map +1 -1
  96. package/dist/_chunk/createFormReset.js +194 -13
  97. package/dist/_chunk/createFormReset.js.map +1 -1
  98. package/dist/_chunk/createFormReset.jsx +194 -13
  99. package/dist/_chunk/createFormReset.jsx.map +1 -1
  100. package/dist/_chunk/createGrid.js +869 -0
  101. package/dist/_chunk/createGrid.js.map +1 -0
  102. package/dist/_chunk/createGrid.jsx +869 -0
  103. package/dist/_chunk/createGrid.jsx.map +1 -0
  104. package/dist/_chunk/createGridListItem.js +480 -0
  105. package/dist/_chunk/createGridListItem.js.map +1 -0
  106. package/dist/_chunk/createGridListItem.jsx +480 -0
  107. package/dist/_chunk/createGridListItem.jsx.map +1 -0
  108. package/dist/_chunk/createHasTabbableChild.js +63 -0
  109. package/dist/_chunk/createHasTabbableChild.js.map +1 -0
  110. package/dist/_chunk/createHasTabbableChild.jsx +63 -0
  111. package/dist/_chunk/createHasTabbableChild.jsx.map +1 -0
  112. package/dist/_chunk/createHover.js +58 -45
  113. package/dist/_chunk/createHover.js.map +1 -1
  114. package/dist/_chunk/createHover.jsx +58 -45
  115. package/dist/_chunk/createHover.jsx.map +1 -1
  116. package/dist/_chunk/createInteractionModality.js +179 -34
  117. package/dist/_chunk/createInteractionModality.js.map +1 -1
  118. package/dist/_chunk/createInteractionModality.jsx +179 -34
  119. package/dist/_chunk/createInteractionModality.jsx.map +1 -1
  120. package/dist/_chunk/createKeyboard.js +206 -0
  121. package/dist/_chunk/createKeyboard.js.map +1 -0
  122. package/dist/_chunk/createKeyboard.jsx +206 -0
  123. package/dist/_chunk/createKeyboard.jsx.map +1 -0
  124. package/dist/_chunk/createLabel.js +17 -4
  125. package/dist/_chunk/createLabel.js.map +1 -1
  126. package/dist/_chunk/createLabel.jsx +17 -4
  127. package/dist/_chunk/createLabel.jsx.map +1 -1
  128. package/dist/_chunk/createLabels.js +13 -1
  129. package/dist/_chunk/createLabels.js.map +1 -1
  130. package/dist/_chunk/createLabels.jsx +13 -1
  131. package/dist/_chunk/createLabels.jsx.map +1 -1
  132. package/dist/_chunk/createLandmark.js +342 -117
  133. package/dist/_chunk/createLandmark.js.map +1 -1
  134. package/dist/_chunk/createLandmark.jsx +342 -117
  135. package/dist/_chunk/createLandmark.jsx.map +1 -1
  136. package/dist/_chunk/createLongPress.js +127 -0
  137. package/dist/_chunk/createLongPress.js.map +1 -0
  138. package/dist/_chunk/createLongPress.jsx +127 -0
  139. package/dist/_chunk/createLongPress.jsx.map +1 -0
  140. package/dist/_chunk/createOverlay.js +198 -124
  141. package/dist/_chunk/createOverlay.js.map +1 -1
  142. package/dist/_chunk/createOverlay.jsx +198 -124
  143. package/dist/_chunk/createOverlay.jsx.map +1 -1
  144. package/dist/_chunk/createOverlayTrigger.js +58 -0
  145. package/dist/_chunk/createOverlayTrigger.js.map +1 -0
  146. package/dist/_chunk/createOverlayTrigger.jsx +58 -0
  147. package/dist/_chunk/createOverlayTrigger.jsx.map +1 -0
  148. package/dist/_chunk/createPress.js +57 -46
  149. package/dist/_chunk/createPress.js.map +1 -1
  150. package/dist/_chunk/createPress.jsx +57 -46
  151. package/dist/_chunk/createPress.jsx.map +1 -1
  152. package/dist/_chunk/createProgressBar.js +21 -5
  153. package/dist/_chunk/createProgressBar.js.map +1 -1
  154. package/dist/_chunk/createProgressBar.jsx +21 -5
  155. package/dist/_chunk/createProgressBar.jsx.map +1 -1
  156. package/dist/_chunk/createSelectableCollection.js +468 -0
  157. package/dist/_chunk/createSelectableCollection.js.map +1 -0
  158. package/dist/_chunk/createSelectableCollection.jsx +468 -0
  159. package/dist/_chunk/createSelectableCollection.jsx.map +1 -0
  160. package/dist/_chunk/createSelectableItem.js +121 -89
  161. package/dist/_chunk/createSelectableItem.js.map +1 -1
  162. package/dist/_chunk/createSelectableItem.jsx +121 -89
  163. package/dist/_chunk/createSelectableItem.jsx.map +1 -1
  164. package/dist/_chunk/createSelectableList.js +70 -0
  165. package/dist/_chunk/createSelectableList.js.map +1 -0
  166. package/dist/_chunk/createSelectableList.jsx +70 -0
  167. package/dist/_chunk/createSelectableList.jsx.map +1 -0
  168. package/dist/_chunk/createStringFormatter.js +350 -5
  169. package/dist/_chunk/createStringFormatter.js.map +1 -1
  170. package/dist/_chunk/createStringFormatter.jsx +350 -5
  171. package/dist/_chunk/createStringFormatter.jsx.map +1 -1
  172. package/dist/_chunk/createToggle.js +108 -23
  173. package/dist/_chunk/createToggle.js.map +1 -1
  174. package/dist/_chunk/createToggle.jsx +108 -23
  175. package/dist/_chunk/createToggle.jsx.map +1 -1
  176. package/dist/_chunk/createTypeSelect.js +18 -3
  177. package/dist/_chunk/createTypeSelect.js.map +1 -1
  178. package/dist/_chunk/createTypeSelect.jsx +18 -3
  179. package/dist/_chunk/createTypeSelect.jsx.map +1 -1
  180. package/dist/_chunk/{visually-hidden.js → createVisuallyHidden.js} +16 -4
  181. package/dist/_chunk/createVisuallyHidden.js.map +1 -0
  182. package/dist/_chunk/{visually-hidden.jsx → createVisuallyHidden.jsx} +16 -4
  183. package/dist/_chunk/createVisuallyHidden.jsx.map +1 -0
  184. package/dist/_chunk/datepicker.js +223 -80
  185. package/dist/_chunk/datepicker.js.map +1 -1
  186. package/dist/_chunk/datepicker.jsx +223 -80
  187. package/dist/_chunk/datepicker.jsx.map +1 -1
  188. package/dist/_chunk/dialog.js +49 -19
  189. package/dist/_chunk/dialog.js.map +1 -1
  190. package/dist/_chunk/dialog.jsx +49 -19
  191. package/dist/_chunk/dialog.jsx.map +1 -1
  192. package/dist/_chunk/disclosure.js +52 -31
  193. package/dist/_chunk/disclosure.js.map +1 -1
  194. package/dist/_chunk/disclosure.jsx +52 -31
  195. package/dist/_chunk/disclosure.jsx.map +1 -1
  196. package/dist/_chunk/dnd.js +1482 -1209
  197. package/dist/_chunk/dnd.js.map +1 -1
  198. package/dist/_chunk/dnd.jsx +1482 -1209
  199. package/dist/_chunk/dnd.jsx.map +1 -1
  200. package/dist/_chunk/dom.js +624 -0
  201. package/dist/_chunk/dom.js.map +1 -0
  202. package/dist/_chunk/dom.jsx +624 -0
  203. package/dist/_chunk/dom.jsx.map +1 -0
  204. package/dist/_chunk/env.js +11 -56
  205. package/dist/_chunk/env.js.map +1 -1
  206. package/dist/_chunk/env.jsx +11 -56
  207. package/dist/_chunk/env.jsx.map +1 -1
  208. package/dist/_chunk/filterDOMProps.js +32 -7
  209. package/dist/_chunk/filterDOMProps.js.map +1 -1
  210. package/dist/_chunk/filterDOMProps.jsx +32 -7
  211. package/dist/_chunk/filterDOMProps.jsx.map +1 -1
  212. package/dist/_chunk/focus.js +588 -336
  213. package/dist/_chunk/focus.js.map +1 -1
  214. package/dist/_chunk/focus.jsx +588 -336
  215. package/dist/_chunk/focus.jsx.map +1 -1
  216. package/dist/_chunk/grid.js +40 -428
  217. package/dist/_chunk/grid.js.map +1 -1
  218. package/dist/_chunk/grid.jsx +40 -428
  219. package/dist/_chunk/grid.jsx.map +1 -1
  220. package/dist/_chunk/gridlist.js +36 -282
  221. package/dist/_chunk/gridlist.js.map +1 -1
  222. package/dist/_chunk/gridlist.jsx +36 -282
  223. package/dist/_chunk/gridlist.jsx.map +1 -1
  224. package/dist/_chunk/i18n.js +70 -2
  225. package/dist/_chunk/i18n.js.map +1 -1
  226. package/dist/_chunk/i18n.jsx +70 -2
  227. package/dist/_chunk/i18n.jsx.map +1 -1
  228. package/dist/_chunk/interactions.js +38 -102
  229. package/dist/_chunk/interactions.js.map +1 -1
  230. package/dist/_chunk/interactions.jsx +38 -100
  231. package/dist/_chunk/interactions.jsx.map +1 -1
  232. package/dist/_chunk/link.js +44 -18
  233. package/dist/_chunk/link.js.map +1 -1
  234. package/dist/_chunk/link.jsx +44 -18
  235. package/dist/_chunk/link.jsx.map +1 -1
  236. package/dist/_chunk/listbox.js +108 -175
  237. package/dist/_chunk/listbox.js.map +1 -1
  238. package/dist/_chunk/listbox.jsx +108 -175
  239. package/dist/_chunk/listbox.jsx.map +1 -1
  240. package/dist/_chunk/locale.js +67 -13
  241. package/dist/_chunk/locale.js.map +1 -1
  242. package/dist/_chunk/locale.jsx +66 -12
  243. package/dist/_chunk/locale.jsx.map +1 -1
  244. package/dist/_chunk/menu.js +343 -239
  245. package/dist/_chunk/menu.js.map +1 -1
  246. package/dist/_chunk/menu.jsx +343 -239
  247. package/dist/_chunk/menu.jsx.map +1 -1
  248. package/dist/_chunk/mergeProps.js +216 -0
  249. package/dist/_chunk/mergeProps.js.map +1 -0
  250. package/dist/_chunk/mergeProps.jsx +216 -0
  251. package/dist/_chunk/mergeProps.jsx.map +1 -0
  252. package/dist/_chunk/meter.js +16 -4
  253. package/dist/_chunk/meter.js.map +1 -1
  254. package/dist/_chunk/meter.jsx +16 -4
  255. package/dist/_chunk/meter.jsx.map +1 -1
  256. package/dist/_chunk/numberfield.js +496 -41
  257. package/dist/_chunk/numberfield.js.map +1 -1
  258. package/dist/_chunk/numberfield.jsx +496 -41
  259. package/dist/_chunk/numberfield.jsx.map +1 -1
  260. package/dist/_chunk/overlays.js +91 -78
  261. package/dist/_chunk/overlays.js.map +1 -1
  262. package/dist/_chunk/overlays.jsx +71 -57
  263. package/dist/_chunk/overlays.jsx.map +1 -1
  264. package/dist/_chunk/owner.js +23 -0
  265. package/dist/_chunk/owner.js.map +1 -0
  266. package/dist/_chunk/owner.jsx +23 -0
  267. package/dist/_chunk/owner.jsx.map +1 -0
  268. package/dist/_chunk/popover.js +201 -55
  269. package/dist/_chunk/popover.js.map +1 -1
  270. package/dist/_chunk/popover.jsx +201 -55
  271. package/dist/_chunk/popover.jsx.map +1 -1
  272. package/dist/_chunk/radio.js +140 -71
  273. package/dist/_chunk/radio.js.map +1 -1
  274. package/dist/_chunk/radio.jsx +140 -71
  275. package/dist/_chunk/radio.jsx.map +1 -1
  276. package/dist/_chunk/reactivity.js.map +1 -1
  277. package/dist/_chunk/reactivity.jsx.map +1 -1
  278. package/dist/_chunk/refs.js +41 -0
  279. package/dist/_chunk/refs.js.map +1 -0
  280. package/dist/_chunk/refs.jsx +41 -0
  281. package/dist/_chunk/refs.jsx.map +1 -0
  282. package/dist/_chunk/searchfield.js +72 -3
  283. package/dist/_chunk/searchfield.js.map +1 -1
  284. package/dist/_chunk/searchfield.jsx +72 -3
  285. package/dist/_chunk/searchfield.jsx.map +1 -1
  286. package/dist/_chunk/select.js +238 -117
  287. package/dist/_chunk/select.js.map +1 -1
  288. package/dist/_chunk/select.jsx +174 -107
  289. package/dist/_chunk/select.jsx.map +1 -1
  290. package/dist/_chunk/selection.js +19 -637
  291. package/dist/_chunk/selection.js.map +1 -1
  292. package/dist/_chunk/selection.jsx +19 -637
  293. package/dist/_chunk/selection.jsx.map +1 -1
  294. package/dist/_chunk/separator.js +12 -0
  295. package/dist/_chunk/separator.js.map +1 -1
  296. package/dist/_chunk/separator.jsx +12 -0
  297. package/dist/_chunk/separator.jsx.map +1 -1
  298. package/dist/_chunk/slider.js +403 -203
  299. package/dist/_chunk/slider.js.map +1 -1
  300. package/dist/_chunk/slider.jsx +403 -203
  301. package/dist/_chunk/slider.jsx.map +1 -1
  302. package/dist/_chunk/spinbutton.js +18 -8
  303. package/dist/_chunk/spinbutton.js.map +1 -1
  304. package/dist/_chunk/spinbutton.jsx +18 -8
  305. package/dist/_chunk/spinbutton.jsx.map +1 -1
  306. package/dist/_chunk/steplist.js +110 -34
  307. package/dist/_chunk/steplist.js.map +1 -1
  308. package/dist/_chunk/steplist.jsx +110 -34
  309. package/dist/_chunk/steplist.jsx.map +1 -1
  310. package/dist/_chunk/switch.js +21 -3
  311. package/dist/_chunk/switch.js.map +1 -1
  312. package/dist/_chunk/switch.jsx +21 -3
  313. package/dist/_chunk/switch.jsx.map +1 -1
  314. package/dist/_chunk/table.js +1004 -208
  315. package/dist/_chunk/table.js.map +1 -1
  316. package/dist/_chunk/table.jsx +1004 -208
  317. package/dist/_chunk/table.jsx.map +1 -1
  318. package/dist/_chunk/tabs.js +86 -32
  319. package/dist/_chunk/tabs.js.map +1 -1
  320. package/dist/_chunk/tabs.jsx +86 -32
  321. package/dist/_chunk/tabs.jsx.map +1 -1
  322. package/dist/_chunk/tag.js +355 -164
  323. package/dist/_chunk/tag.js.map +1 -1
  324. package/dist/_chunk/tag.jsx +355 -164
  325. package/dist/_chunk/tag.jsx.map +1 -1
  326. package/dist/_chunk/textfield.js +87 -12
  327. package/dist/_chunk/textfield.js.map +1 -1
  328. package/dist/_chunk/textfield.jsx +87 -12
  329. package/dist/_chunk/textfield.jsx.map +1 -1
  330. package/dist/_chunk/toast.js +247 -47
  331. package/dist/_chunk/toast.js.map +1 -1
  332. package/dist/_chunk/toast.jsx +247 -47
  333. package/dist/_chunk/toast.jsx.map +1 -1
  334. package/dist/_chunk/tokenfield.js +629 -0
  335. package/dist/_chunk/tokenfield.js.map +1 -0
  336. package/dist/_chunk/tokenfield.jsx +629 -0
  337. package/dist/_chunk/tokenfield.jsx.map +1 -0
  338. package/dist/_chunk/toolbar.js +26 -8
  339. package/dist/_chunk/toolbar.js.map +1 -1
  340. package/dist/_chunk/toolbar.jsx +26 -8
  341. package/dist/_chunk/toolbar.jsx.map +1 -1
  342. package/dist/_chunk/tooltip.js +381 -11
  343. package/dist/_chunk/tooltip.js.map +1 -1
  344. package/dist/_chunk/tooltip.jsx +381 -11
  345. package/dist/_chunk/tooltip.jsx.map +1 -1
  346. package/dist/_chunk/tree.js +297 -82
  347. package/dist/_chunk/tree.js.map +1 -1
  348. package/dist/_chunk/tree.jsx +297 -82
  349. package/dist/_chunk/tree.jsx.map +1 -1
  350. package/dist/_chunk/utils.js +602 -297
  351. package/dist/_chunk/utils.js.map +1 -1
  352. package/dist/_chunk/utils.jsx +602 -297
  353. package/dist/_chunk/utils.jsx.map +1 -1
  354. package/dist/_chunk/utils2.js +77 -0
  355. package/dist/_chunk/utils2.js.map +1 -0
  356. package/dist/_chunk/utils2.jsx +77 -0
  357. package/dist/_chunk/utils2.jsx.map +1 -0
  358. package/dist/_chunk/virtualFocus.js +54 -0
  359. package/dist/_chunk/virtualFocus.js.map +1 -0
  360. package/dist/_chunk/virtualFocus.jsx +54 -0
  361. package/dist/_chunk/virtualFocus.jsx.map +1 -0
  362. package/dist/_chunk/virtualizer.js +202 -0
  363. package/dist/_chunk/virtualizer.js.map +1 -0
  364. package/dist/_chunk/virtualizer.jsx +202 -0
  365. package/dist/_chunk/virtualizer.jsx.map +1 -0
  366. package/dist/actiongroup/createActionGroup.d.ts +2 -1
  367. package/dist/actiongroup/createActionGroup.d.ts.map +1 -1
  368. package/dist/autocomplete/createAutocomplete.d.ts +1 -9
  369. package/dist/autocomplete/createAutocomplete.d.ts.map +1 -1
  370. package/dist/autocomplete/intl/index.d.ts +13 -0
  371. package/dist/autocomplete/intl/index.d.ts.map +1 -0
  372. package/dist/breadcrumbs/createBreadcrumbs.d.ts +0 -6
  373. package/dist/breadcrumbs/createBreadcrumbs.d.ts.map +1 -1
  374. package/dist/breadcrumbs/intl/index.d.ts +13 -0
  375. package/dist/breadcrumbs/intl/index.d.ts.map +1 -0
  376. package/dist/button/createButton.d.ts +2 -1
  377. package/dist/button/createButton.d.ts.map +1 -1
  378. package/dist/button/createToggleButton.d.ts.map +1 -1
  379. package/dist/button/createToggleButtonGroup.d.ts +1 -1
  380. package/dist/button/createToggleButtonGroup.d.ts.map +1 -1
  381. package/dist/button/types.d.ts +14 -0
  382. package/dist/button/types.d.ts.map +1 -1
  383. package/dist/calendar/createCalendar.d.ts +13 -11
  384. package/dist/calendar/createCalendar.d.ts.map +1 -1
  385. package/dist/calendar/createCalendarCell.d.ts +5 -6
  386. package/dist/calendar/createCalendarCell.d.ts.map +1 -1
  387. package/dist/calendar/createCalendarGrid.d.ts +2 -8
  388. package/dist/calendar/createCalendarGrid.d.ts.map +1 -1
  389. package/dist/calendar/createCalendarMonthPicker.d.ts +0 -8
  390. package/dist/calendar/createCalendarMonthPicker.d.ts.map +1 -1
  391. package/dist/calendar/createCalendarYearPicker.d.ts +0 -8
  392. package/dist/calendar/createCalendarYearPicker.d.ts.map +1 -1
  393. package/dist/calendar/createRangeCalendar.d.ts +25 -9
  394. package/dist/calendar/createRangeCalendar.d.ts.map +1 -1
  395. package/dist/calendar/createRangeCalendarCell.d.ts +7 -6
  396. package/dist/calendar/createRangeCalendarCell.d.ts.map +1 -1
  397. package/dist/calendar/intl/index.d.ts.map +1 -1
  398. package/dist/calendar/utils.d.ts +24 -4
  399. package/dist/calendar/utils.d.ts.map +1 -1
  400. package/dist/checkbox/createCheckbox.d.ts +2 -1
  401. package/dist/checkbox/createCheckbox.d.ts.map +1 -1
  402. package/dist/checkbox/createCheckboxGroup.d.ts +7 -2
  403. package/dist/checkbox/createCheckboxGroup.d.ts.map +1 -1
  404. package/dist/checkbox/createCheckboxGroupItem.d.ts +0 -8
  405. package/dist/checkbox/createCheckboxGroupItem.d.ts.map +1 -1
  406. package/dist/collections/index.d.ts +1 -1
  407. package/dist/collections/index.d.ts.map +1 -1
  408. package/dist/collections/index.js +34 -17
  409. package/dist/collections/index.js.map +1 -1
  410. package/dist/collections/index.jsx +34 -17
  411. package/dist/collections/index.jsx.map +1 -1
  412. package/dist/color/createColorArea.d.ts +2 -7
  413. package/dist/color/createColorArea.d.ts.map +1 -1
  414. package/dist/color/createColorField.d.ts +2 -7
  415. package/dist/color/createColorField.d.ts.map +1 -1
  416. package/dist/color/createColorSlider.d.ts +1 -6
  417. package/dist/color/createColorSlider.d.ts.map +1 -1
  418. package/dist/color/createColorSwatch.d.ts +1 -6
  419. package/dist/color/createColorSwatch.d.ts.map +1 -1
  420. package/dist/color/createColorWheel.d.ts +1 -6
  421. package/dist/color/createColorWheel.d.ts.map +1 -1
  422. package/dist/color/intl/index.d.ts.map +1 -1
  423. package/dist/color/types.d.ts +49 -1
  424. package/dist/color/types.d.ts.map +1 -1
  425. package/dist/combobox/createComboBox.d.ts +18 -9
  426. package/dist/combobox/createComboBox.d.ts.map +1 -1
  427. package/dist/combobox/intl/generated-locales.d.ts +3 -0
  428. package/dist/combobox/intl/generated-locales.d.ts.map +1 -1
  429. package/dist/combobox/intl/index.d.ts +3 -2
  430. package/dist/combobox/intl/index.d.ts.map +1 -1
  431. package/dist/datepicker/createDateField.d.ts +2 -12
  432. package/dist/datepicker/createDateField.d.ts.map +1 -1
  433. package/dist/datepicker/createDatePicker.d.ts +2 -18
  434. package/dist/datepicker/createDatePicker.d.ts.map +1 -1
  435. package/dist/datepicker/createDatePickerGroup.d.ts +2 -2
  436. package/dist/datepicker/createDatePickerGroup.d.ts.map +1 -1
  437. package/dist/datepicker/createDateRangePicker.d.ts +8 -22
  438. package/dist/datepicker/createDateRangePicker.d.ts.map +1 -1
  439. package/dist/datepicker/createDateSegment.d.ts +0 -9
  440. package/dist/datepicker/createDateSegment.d.ts.map +1 -1
  441. package/dist/datepicker/createDisplayNames.d.ts +1 -9
  442. package/dist/datepicker/createDisplayNames.d.ts.map +1 -1
  443. package/dist/datepicker/createTimeField.d.ts.map +1 -1
  444. package/dist/datepicker/intl.d.ts.map +1 -1
  445. package/dist/dialog/createDialog.d.ts +2 -4
  446. package/dist/dialog/createDialog.d.ts.map +1 -1
  447. package/dist/dialog/types.d.ts +14 -0
  448. package/dist/dialog/types.d.ts.map +1 -1
  449. package/dist/disclosure/createDisclosure.d.ts +1 -8
  450. package/dist/disclosure/createDisclosure.d.ts.map +1 -1
  451. package/dist/disclosure/createDisclosureGroup.d.ts +3 -4
  452. package/dist/disclosure/createDisclosureGroup.d.ts.map +1 -1
  453. package/dist/dnd/DragManager.d.ts +1 -16
  454. package/dist/dnd/DragManager.d.ts.map +1 -1
  455. package/dist/dnd/DropTargetKeyboardNavigation.d.ts +2 -2
  456. package/dist/dnd/createDrag.d.ts +1 -7
  457. package/dist/dnd/createDrag.d.ts.map +1 -1
  458. package/dist/dnd/createDraggableCollection.d.ts +1 -7
  459. package/dist/dnd/createDraggableCollection.d.ts.map +1 -1
  460. package/dist/dnd/createDraggableItem.d.ts +2 -7
  461. package/dist/dnd/createDraggableItem.d.ts.map +1 -1
  462. package/dist/dnd/createDrop.d.ts +1 -7
  463. package/dist/dnd/createDrop.d.ts.map +1 -1
  464. package/dist/dnd/createDropIndicator.d.ts +27 -0
  465. package/dist/dnd/createDropIndicator.d.ts.map +1 -0
  466. package/dist/dnd/createDroppableCollection.d.ts +6 -8
  467. package/dist/dnd/createDroppableCollection.d.ts.map +1 -1
  468. package/dist/dnd/createDroppableItem.d.ts +12 -10
  469. package/dist/dnd/createDroppableItem.d.ts.map +1 -1
  470. package/dist/dnd/index.d.ts +3 -1
  471. package/dist/dnd/index.d.ts.map +1 -1
  472. package/dist/dnd/index.js +2 -2
  473. package/dist/dnd/index.jsx +2 -2
  474. package/dist/dnd/intl/index.d.ts +6 -4
  475. package/dist/dnd/intl/index.d.ts.map +1 -1
  476. package/dist/dnd/types.d.ts +20 -1
  477. package/dist/dnd/types.d.ts.map +1 -1
  478. package/dist/dnd/utils.d.ts +4 -0
  479. package/dist/dnd/utils.d.ts.map +1 -1
  480. package/dist/focus/FocusScope.d.ts +9 -5
  481. package/dist/focus/FocusScope.d.ts.map +1 -1
  482. package/dist/focus/createAutoFocus.d.ts +3 -0
  483. package/dist/focus/createAutoFocus.d.ts.map +1 -1
  484. package/dist/focus/createFocusRestore.d.ts +3 -0
  485. package/dist/focus/createFocusRestore.d.ts.map +1 -1
  486. package/dist/focus/createHasTabbableChild.d.ts +13 -0
  487. package/dist/focus/createHasTabbableChild.d.ts.map +1 -0
  488. package/dist/focus/createVirtualFocus.d.ts +4 -1
  489. package/dist/focus/createVirtualFocus.d.ts.map +1 -1
  490. package/dist/focus/index.js +3 -2
  491. package/dist/focus/index.jsx +3 -2
  492. package/dist/focus/virtualFocus.d.ts +1 -1
  493. package/dist/form/createFormReset.d.ts +1 -7
  494. package/dist/form/createFormReset.d.ts.map +1 -1
  495. package/dist/form/createFormValidation.d.ts +13 -9
  496. package/dist/form/createFormValidation.d.ts.map +1 -1
  497. package/dist/form/index.js +1 -2
  498. package/dist/form/index.jsx +1 -2
  499. package/dist/grid/GridKeyboardDelegate.d.ts.map +1 -1
  500. package/dist/grid/createGrid.d.ts +40 -5
  501. package/dist/grid/createGrid.d.ts.map +1 -1
  502. package/dist/grid/createGridCell.d.ts +1 -5
  503. package/dist/grid/createGridCell.d.ts.map +1 -1
  504. package/dist/grid/createGridRow.d.ts +1 -5
  505. package/dist/grid/createGridRow.d.ts.map +1 -1
  506. package/dist/grid/index.d.ts +2 -2
  507. package/dist/grid/index.js +2 -1
  508. package/dist/grid/index.jsx +2 -1
  509. package/dist/grid/intl/index.d.ts +18 -0
  510. package/dist/grid/intl/index.d.ts.map +1 -0
  511. package/dist/grid/types.d.ts +25 -2
  512. package/dist/grid/types.d.ts.map +1 -1
  513. package/dist/gridlist/createGridList.d.ts +5 -7
  514. package/dist/gridlist/createGridList.d.ts.map +1 -1
  515. package/dist/gridlist/createGridListItem.d.ts +2 -6
  516. package/dist/gridlist/createGridListItem.d.ts.map +1 -1
  517. package/dist/gridlist/createGridListSection.d.ts +0 -4
  518. package/dist/gridlist/createGridListSection.d.ts.map +1 -1
  519. package/dist/gridlist/createGridListSelectionCheckbox.d.ts +1 -5
  520. package/dist/gridlist/createGridListSelectionCheckbox.d.ts.map +1 -1
  521. package/dist/gridlist/index.js +2 -1
  522. package/dist/gridlist/index.jsx +2 -1
  523. package/dist/gridlist/intl/index.d.ts +14 -0
  524. package/dist/gridlist/intl/index.d.ts.map +1 -0
  525. package/dist/gridlist/types.d.ts +87 -2
  526. package/dist/gridlist/types.d.ts.map +1 -1
  527. package/dist/i18n/compileIcu.d.ts +24 -0
  528. package/dist/i18n/compileIcu.d.ts.map +1 -0
  529. package/dist/i18n/createCollator.d.ts +0 -7
  530. package/dist/i18n/createCollator.d.ts.map +1 -1
  531. package/dist/i18n/createDateFormatter.d.ts +2 -8
  532. package/dist/i18n/createDateFormatter.d.ts.map +1 -1
  533. package/dist/i18n/createFilter.d.ts +0 -7
  534. package/dist/i18n/createFilter.d.ts.map +1 -1
  535. package/dist/i18n/createListFormatter.d.ts +9 -0
  536. package/dist/i18n/createListFormatter.d.ts.map +1 -0
  537. package/dist/i18n/createNumberFormatter.d.ts +0 -7
  538. package/dist/i18n/createNumberFormatter.d.ts.map +1 -1
  539. package/dist/i18n/createStringFormatter.d.ts +14 -4
  540. package/dist/i18n/createStringFormatter.d.ts.map +1 -1
  541. package/dist/i18n/index.d.ts +1 -0
  542. package/dist/i18n/index.d.ts.map +1 -1
  543. package/dist/i18n/index.js +2 -2
  544. package/dist/i18n/index.jsx +2 -2
  545. package/dist/i18n/locale.d.ts +2 -8
  546. package/dist/i18n/locale.d.ts.map +1 -1
  547. package/dist/i18n/utils.d.ts +0 -7
  548. package/dist/i18n/utils.d.ts.map +1 -1
  549. package/dist/index.d.ts +12 -9
  550. package/dist/index.d.ts.map +1 -1
  551. package/dist/index.js +39 -27
  552. package/dist/index.jsx +39 -27
  553. package/dist/interactions/FocusableProvider.d.ts +3 -2
  554. package/dist/interactions/FocusableProvider.d.ts.map +1 -1
  555. package/dist/interactions/PressEvent.d.ts +2 -1
  556. package/dist/interactions/PressEvent.d.ts.map +1 -1
  557. package/dist/interactions/createContextMenu.d.ts +24 -0
  558. package/dist/interactions/createContextMenu.d.ts.map +1 -0
  559. package/dist/interactions/createFocus.d.ts +12 -4
  560. package/dist/interactions/createFocus.d.ts.map +1 -1
  561. package/dist/interactions/createFocusRing.d.ts +12 -3
  562. package/dist/interactions/createFocusRing.d.ts.map +1 -1
  563. package/dist/interactions/createFocusWithin.d.ts +12 -8
  564. package/dist/interactions/createFocusWithin.d.ts.map +1 -1
  565. package/dist/interactions/createFocusable.d.ts +2 -6
  566. package/dist/interactions/createFocusable.d.ts.map +1 -1
  567. package/dist/interactions/createHover.d.ts +3 -10
  568. package/dist/interactions/createHover.d.ts.map +1 -1
  569. package/dist/interactions/createInteractionModality.d.ts +12 -10
  570. package/dist/interactions/createInteractionModality.d.ts.map +1 -1
  571. package/dist/interactions/createKeyboard.d.ts +12 -3
  572. package/dist/interactions/createKeyboard.d.ts.map +1 -1
  573. package/dist/interactions/createKeyboardShortcutHandler.d.ts +24 -0
  574. package/dist/interactions/createKeyboardShortcutHandler.d.ts.map +1 -0
  575. package/dist/interactions/createLongPress.d.ts +4 -7
  576. package/dist/interactions/createLongPress.d.ts.map +1 -1
  577. package/dist/interactions/createMove.d.ts +1 -6
  578. package/dist/interactions/createMove.d.ts.map +1 -1
  579. package/dist/interactions/createPress.d.ts +3 -7
  580. package/dist/interactions/createPress.d.ts.map +1 -1
  581. package/dist/interactions/index.d.ts +1 -1
  582. package/dist/interactions/index.d.ts.map +1 -1
  583. package/dist/interactions/index.js +5 -3
  584. package/dist/interactions/index.jsx +5 -3
  585. package/dist/label/createField.d.ts +7 -1
  586. package/dist/label/createField.d.ts.map +1 -1
  587. package/dist/label/createLabel.d.ts +1 -1
  588. package/dist/label/createLabel.d.ts.map +1 -1
  589. package/dist/label/createLabels.d.ts +0 -7
  590. package/dist/label/createLabels.d.ts.map +1 -1
  591. package/dist/landmark/createLandmark.d.ts +63 -6
  592. package/dist/landmark/createLandmark.d.ts.map +1 -1
  593. package/dist/link/createLink.d.ts +1 -1
  594. package/dist/link/createLink.d.ts.map +1 -1
  595. package/dist/listbox/createListBox.d.ts +27 -7
  596. package/dist/listbox/createListBox.d.ts.map +1 -1
  597. package/dist/listbox/createOption.d.ts +7 -1
  598. package/dist/listbox/createOption.d.ts.map +1 -1
  599. package/dist/live-announcer/announce.d.ts +7 -16
  600. package/dist/live-announcer/announce.d.ts.map +1 -1
  601. package/dist/menu/createMenu.d.ts +3 -7
  602. package/dist/menu/createMenu.d.ts.map +1 -1
  603. package/dist/menu/createMenuItem.d.ts +7 -2
  604. package/dist/menu/createMenuItem.d.ts.map +1 -1
  605. package/dist/menu/createMenuTrigger.d.ts +24 -20
  606. package/dist/menu/createMenuTrigger.d.ts.map +1 -1
  607. package/dist/menu/index.d.ts +1 -1
  608. package/dist/menu/index.d.ts.map +1 -1
  609. package/dist/menu/intl/index.d.ts +4 -0
  610. package/dist/menu/intl/index.d.ts.map +1 -0
  611. package/dist/meter/createMeter.d.ts +2 -1
  612. package/dist/meter/createMeter.d.ts.map +1 -1
  613. package/dist/numberfield/createNumberField.d.ts +44 -6
  614. package/dist/numberfield/createNumberField.d.ts.map +1 -1
  615. package/dist/numberfield/index.d.ts +1 -0
  616. package/dist/numberfield/index.d.ts.map +1 -1
  617. package/dist/numberfield/index.js +2 -2
  618. package/dist/numberfield/index.jsx +2 -2
  619. package/dist/numberfield/intl.d.ts +10 -0
  620. package/dist/numberfield/intl.d.ts.map +1 -0
  621. package/dist/overlays/ariaHideOutside.d.ts +0 -4
  622. package/dist/overlays/ariaHideOutside.d.ts.map +1 -1
  623. package/dist/overlays/createCloseOnScroll.d.ts +11 -0
  624. package/dist/overlays/createCloseOnScroll.d.ts.map +1 -0
  625. package/dist/overlays/createInteractOutside.d.ts +2 -5
  626. package/dist/overlays/createInteractOutside.d.ts.map +1 -1
  627. package/dist/overlays/createModal.d.ts +3 -6
  628. package/dist/overlays/createModal.d.ts.map +1 -1
  629. package/dist/overlays/createOverlay.d.ts +1 -5
  630. package/dist/overlays/createOverlay.d.ts.map +1 -1
  631. package/dist/overlays/createOverlayTrigger.d.ts +2 -6
  632. package/dist/overlays/createOverlayTrigger.d.ts.map +1 -1
  633. package/dist/overlays/createPreventScroll.d.ts +0 -4
  634. package/dist/overlays/createPreventScroll.d.ts.map +1 -1
  635. package/dist/overlays/index.d.ts +2 -0
  636. package/dist/overlays/index.d.ts.map +1 -1
  637. package/dist/overlays/index.js +4 -3
  638. package/dist/overlays/index.jsx +4 -3
  639. package/dist/overlays/intl/index.d.ts +13 -0
  640. package/dist/overlays/intl/index.d.ts.map +1 -0
  641. package/dist/popover/calculatePosition.d.ts +1 -1
  642. package/dist/popover/calculatePosition.d.ts.map +1 -1
  643. package/dist/popover/createOverlayPosition.d.ts +1 -7
  644. package/dist/popover/createOverlayPosition.d.ts.map +1 -1
  645. package/dist/popover/createPopover.d.ts +8 -8
  646. package/dist/popover/createPopover.d.ts.map +1 -1
  647. package/dist/progress/createProgressBar.d.ts +2 -10
  648. package/dist/progress/createProgressBar.d.ts.map +1 -1
  649. package/dist/radio/createRadio.d.ts +8 -1
  650. package/dist/radio/createRadio.d.ts.map +1 -1
  651. package/dist/radio/createRadioGroup.d.ts +1 -11
  652. package/dist/radio/createRadioGroup.d.ts.map +1 -1
  653. package/dist/searchfield/createSearchField.d.ts +1 -1
  654. package/dist/searchfield/createSearchField.d.ts.map +1 -1
  655. package/dist/searchfield/intl/index.d.ts +13 -0
  656. package/dist/searchfield/intl/index.d.ts.map +1 -0
  657. package/dist/select/createHiddenSelect.d.ts +7 -14
  658. package/dist/select/createHiddenSelect.d.ts.map +1 -1
  659. package/dist/select/createSelect.d.ts +13 -9
  660. package/dist/select/createSelect.d.ts.map +1 -1
  661. package/dist/selection/DOMLayoutDelegate.d.ts.map +1 -1
  662. package/dist/selection/ListKeyboardDelegate.d.ts +4 -2
  663. package/dist/selection/ListKeyboardDelegate.d.ts.map +1 -1
  664. package/dist/selection/constants.d.ts.map +1 -1
  665. package/dist/selection/createCollectionRowInteraction.d.ts +12 -1
  666. package/dist/selection/createCollectionRowInteraction.d.ts.map +1 -1
  667. package/dist/selection/createScrollIntoViewOnFocus.d.ts +0 -11
  668. package/dist/selection/createScrollIntoViewOnFocus.d.ts.map +1 -1
  669. package/dist/selection/createSelectableCollection.d.ts +1 -23
  670. package/dist/selection/createSelectableCollection.d.ts.map +1 -1
  671. package/dist/selection/createSelectableItem.d.ts +3 -29
  672. package/dist/selection/createSelectableItem.d.ts.map +1 -1
  673. package/dist/selection/createSelectableList.d.ts +7 -18
  674. package/dist/selection/createSelectableList.d.ts.map +1 -1
  675. package/dist/selection/createTypeSelect.d.ts +7 -8
  676. package/dist/selection/createTypeSelect.d.ts.map +1 -1
  677. package/dist/selection/index.js +6 -2
  678. package/dist/selection/index.jsx +6 -2
  679. package/dist/selection/selectItem.d.ts.map +1 -1
  680. package/dist/selection/utils.d.ts +1 -1
  681. package/dist/selection/utils.d.ts.map +1 -1
  682. package/dist/separator/createSeparator.d.ts +3 -1
  683. package/dist/separator/createSeparator.d.ts.map +1 -1
  684. package/dist/slider/createSlider.d.ts +25 -14
  685. package/dist/slider/createSlider.d.ts.map +1 -1
  686. package/dist/slider/createSliderThumb.d.ts +12 -0
  687. package/dist/slider/createSliderThumb.d.ts.map +1 -0
  688. package/dist/slider/index.d.ts +1 -0
  689. package/dist/slider/index.d.ts.map +1 -1
  690. package/dist/slider/index.js +2 -2
  691. package/dist/slider/index.jsx +2 -2
  692. package/dist/spinbutton/createSpinButton.d.ts +0 -9
  693. package/dist/spinbutton/createSpinButton.d.ts.map +1 -1
  694. package/dist/spinbutton/intl.d.ts.map +1 -1
  695. package/dist/ssr/index.d.ts +3 -28
  696. package/dist/ssr/index.d.ts.map +1 -1
  697. package/dist/ssr/index.js +52 -26
  698. package/dist/ssr/index.js.map +1 -1
  699. package/dist/ssr/index.jsx +52 -26
  700. package/dist/ssr/index.jsx.map +1 -1
  701. package/dist/steplist/createStepList.d.ts +19 -7
  702. package/dist/steplist/createStepList.d.ts.map +1 -1
  703. package/dist/steplist/index.d.ts +1 -1
  704. package/dist/steplist/index.d.ts.map +1 -1
  705. package/dist/steplist/index.js +2 -2
  706. package/dist/steplist/index.jsx +2 -2
  707. package/dist/steplist/intl/index.d.ts +12 -0
  708. package/dist/steplist/intl/index.d.ts.map +1 -0
  709. package/dist/switch/createSwitch.d.ts +2 -1
  710. package/dist/switch/createSwitch.d.ts.map +1 -1
  711. package/dist/table/createTable.d.ts +1 -5
  712. package/dist/table/createTable.d.ts.map +1 -1
  713. package/dist/table/createTableCell.d.ts +1 -5
  714. package/dist/table/createTableCell.d.ts.map +1 -1
  715. package/dist/table/createTableColumnHeader.d.ts +1 -5
  716. package/dist/table/createTableColumnHeader.d.ts.map +1 -1
  717. package/dist/table/createTableColumnResize.d.ts +16 -10
  718. package/dist/table/createTableColumnResize.d.ts.map +1 -1
  719. package/dist/table/createTableHeaderRow.d.ts +2 -6
  720. package/dist/table/createTableHeaderRow.d.ts.map +1 -1
  721. package/dist/table/createTableRow.d.ts +1 -5
  722. package/dist/table/createTableRow.d.ts.map +1 -1
  723. package/dist/table/createTableRowGroup.d.ts +1 -5
  724. package/dist/table/createTableRowGroup.d.ts.map +1 -1
  725. package/dist/table/createTableSelectAllCheckbox.d.ts +1 -5
  726. package/dist/table/createTableSelectAllCheckbox.d.ts.map +1 -1
  727. package/dist/table/createTableSelectionCheckbox.d.ts +1 -5
  728. package/dist/table/createTableSelectionCheckbox.d.ts.map +1 -1
  729. package/dist/table/index.d.ts +2 -2
  730. package/dist/table/intl/index.d.ts +23 -0
  731. package/dist/table/intl/index.d.ts.map +1 -0
  732. package/dist/table/types.d.ts +44 -2
  733. package/dist/table/types.d.ts.map +1 -1
  734. package/dist/table/utils.d.ts +6 -0
  735. package/dist/table/utils.d.ts.map +1 -1
  736. package/dist/tabs/createTabs.d.ts +14 -9
  737. package/dist/tabs/createTabs.d.ts.map +1 -1
  738. package/dist/tag/createTag.d.ts +4 -8
  739. package/dist/tag/createTag.d.ts.map +1 -1
  740. package/dist/tag/createTagGroup.d.ts +12 -13
  741. package/dist/tag/createTagGroup.d.ts.map +1 -1
  742. package/dist/tag/intl/index.d.ts +14 -0
  743. package/dist/tag/intl/index.d.ts.map +1 -0
  744. package/dist/textfield/createTextField.d.ts +16 -8
  745. package/dist/textfield/createTextField.d.ts.map +1 -1
  746. package/dist/toast/createToast.d.ts +3 -9
  747. package/dist/toast/createToast.d.ts.map +1 -1
  748. package/dist/toast/createToastRegion.d.ts +9 -19
  749. package/dist/toast/createToastRegion.d.ts.map +1 -1
  750. package/dist/toast/intl/index.d.ts +14 -0
  751. package/dist/toast/intl/index.d.ts.map +1 -0
  752. package/dist/toggle/createToggle.d.ts +13 -2
  753. package/dist/toggle/createToggle.d.ts.map +1 -1
  754. package/dist/tokenfield/createToken.d.ts +15 -0
  755. package/dist/tokenfield/createToken.d.ts.map +1 -0
  756. package/dist/tokenfield/createTokenField.d.ts +52 -0
  757. package/dist/tokenfield/createTokenField.d.ts.map +1 -0
  758. package/dist/tokenfield/index.d.ts +3 -0
  759. package/dist/tokenfield/index.d.ts.map +1 -0
  760. package/dist/tokenfield/index.js +2 -0
  761. package/dist/tokenfield/index.jsx +2 -0
  762. package/dist/toolbar/createToolbar.d.ts +1 -1
  763. package/dist/toolbar/createToolbar.d.ts.map +1 -1
  764. package/dist/tooltip/createPreviewTrigger.d.ts +23 -0
  765. package/dist/tooltip/createPreviewTrigger.d.ts.map +1 -0
  766. package/dist/tooltip/createSafeArea.d.ts +20 -0
  767. package/dist/tooltip/createSafeArea.d.ts.map +1 -0
  768. package/dist/tooltip/createTooltip.d.ts +1 -1
  769. package/dist/tooltip/createTooltip.d.ts.map +1 -1
  770. package/dist/tooltip/createTooltipTrigger.d.ts +1 -9
  771. package/dist/tooltip/createTooltipTrigger.d.ts.map +1 -1
  772. package/dist/tooltip/index.d.ts +2 -0
  773. package/dist/tooltip/index.d.ts.map +1 -1
  774. package/dist/tooltip/index.js +2 -2
  775. package/dist/tooltip/index.jsx +2 -2
  776. package/dist/tooltip/intl/index.d.ts +4 -0
  777. package/dist/tooltip/intl/index.d.ts.map +1 -0
  778. package/dist/tree/createTree.d.ts +1 -5
  779. package/dist/tree/createTree.d.ts.map +1 -1
  780. package/dist/tree/createTreeItem.d.ts +1 -5
  781. package/dist/tree/createTreeItem.d.ts.map +1 -1
  782. package/dist/tree/createTreeSelectionCheckbox.d.ts +1 -5
  783. package/dist/tree/createTreeSelectionCheckbox.d.ts.map +1 -1
  784. package/dist/tree/intl/index.d.ts +14 -0
  785. package/dist/tree/intl/index.d.ts.map +1 -0
  786. package/dist/tree/types.d.ts +37 -3
  787. package/dist/tree/types.d.ts.map +1 -1
  788. package/dist/utils/ShadowTreeWalker.d.ts +30 -0
  789. package/dist/utils/ShadowTreeWalker.d.ts.map +1 -0
  790. package/dist/utils/animation.d.ts +1 -29
  791. package/dist/utils/animation.d.ts.map +1 -1
  792. package/dist/utils/callEventHandler.d.ts +7 -0
  793. package/dist/utils/callEventHandler.d.ts.map +1 -0
  794. package/dist/utils/capture.d.ts +14 -0
  795. package/dist/utils/capture.d.ts.map +1 -0
  796. package/dist/utils/createDescription.d.ts +1 -25
  797. package/dist/utils/createDescription.d.ts.map +1 -1
  798. package/dist/utils/dom.d.ts +58 -11
  799. package/dist/utils/dom.d.ts.map +1 -1
  800. package/dist/utils/domAttrs.d.ts +16 -0
  801. package/dist/utils/domAttrs.d.ts.map +1 -0
  802. package/dist/utils/env.d.ts +30 -2
  803. package/dist/utils/env.d.ts.map +1 -1
  804. package/dist/utils/events.d.ts +0 -4
  805. package/dist/utils/events.d.ts.map +1 -1
  806. package/dist/utils/filterDOMProps.d.ts +0 -6
  807. package/dist/utils/filterDOMProps.d.ts.map +1 -1
  808. package/dist/utils/focus.d.ts +14 -10
  809. package/dist/utils/focus.d.ts.map +1 -1
  810. package/dist/utils/focusWithoutScrolling.d.ts +10 -0
  811. package/dist/utils/focusWithoutScrolling.d.ts.map +1 -0
  812. package/dist/utils/geometry.d.ts +1 -1
  813. package/dist/utils/geometry.d.ts.map +1 -1
  814. package/dist/utils/getMetaValue.d.ts +13 -0
  815. package/dist/utils/getMetaValue.d.ts.map +1 -0
  816. package/dist/utils/getNonce.d.ts +9 -0
  817. package/dist/utils/getNonce.d.ts.map +1 -0
  818. package/dist/utils/globalListeners.d.ts +0 -6
  819. package/dist/utils/globalListeners.d.ts.map +1 -1
  820. package/dist/utils/index.d.ts +10 -3
  821. package/dist/utils/index.d.ts.map +1 -1
  822. package/dist/utils/index.js +9 -4
  823. package/dist/utils/index.jsx +9 -4
  824. package/dist/utils/keyboard.d.ts +0 -4
  825. package/dist/utils/keyboard.d.ts.map +1 -1
  826. package/dist/utils/mergeProps.d.ts +5 -2
  827. package/dist/utils/mergeProps.d.ts.map +1 -1
  828. package/dist/utils/openLink.d.ts +52 -0
  829. package/dist/utils/openLink.d.ts.map +1 -0
  830. package/dist/utils/owner.d.ts +14 -0
  831. package/dist/utils/owner.d.ts.map +1 -0
  832. package/dist/utils/platform.d.ts +10 -13
  833. package/dist/utils/platform.d.ts.map +1 -1
  834. package/dist/utils/reactivity.d.ts +2 -0
  835. package/dist/utils/reactivity.d.ts.map +1 -1
  836. package/dist/utils/refs.d.ts +20 -0
  837. package/dist/utils/refs.d.ts.map +1 -0
  838. package/dist/utils/runAfterTransition.d.ts +2 -0
  839. package/dist/utils/runAfterTransition.d.ts.map +1 -0
  840. package/dist/utils/scrollIntoView.d.ts +0 -4
  841. package/dist/utils/scrollIntoView.d.ts.map +1 -1
  842. package/dist/utils/splitProps.d.ts +17 -0
  843. package/dist/utils/splitProps.d.ts.map +1 -0
  844. package/dist/utils/textSelection.d.ts +5 -12
  845. package/dist/utils/textSelection.d.ts.map +1 -1
  846. package/dist/virtualizer/ScrollView.d.ts +38 -0
  847. package/dist/virtualizer/ScrollView.d.ts.map +1 -0
  848. package/dist/virtualizer/index.d.ts +3 -0
  849. package/dist/virtualizer/index.d.ts.map +1 -0
  850. package/dist/virtualizer/index.js +2 -0
  851. package/dist/virtualizer/index.jsx +2 -0
  852. package/dist/virtualizer/utils.d.ts +10 -0
  853. package/dist/virtualizer/utils.d.ts.map +1 -0
  854. package/dist/visually-hidden/createVisuallyHidden.d.ts +2 -9
  855. package/dist/visually-hidden/createVisuallyHidden.d.ts.map +1 -1
  856. package/dist/visually-hidden/index.js +1 -1
  857. package/dist/visually-hidden/index.jsx +1 -1
  858. package/package.json +28 -11
  859. package/src/actiongroup/createActionGroup.ts +56 -31
  860. package/src/autocomplete/createAutocomplete.ts +91 -20
  861. package/src/autocomplete/intl/ar-AE.json +3 -0
  862. package/src/autocomplete/intl/bg-BG.json +3 -0
  863. package/src/autocomplete/intl/cs-CZ.json +3 -0
  864. package/src/autocomplete/intl/da-DK.json +3 -0
  865. package/src/autocomplete/intl/de-DE.json +3 -0
  866. package/src/autocomplete/intl/el-GR.json +3 -0
  867. package/src/autocomplete/intl/en-US.json +3 -0
  868. package/src/autocomplete/intl/es-ES.json +3 -0
  869. package/src/autocomplete/intl/et-EE.json +3 -0
  870. package/src/autocomplete/intl/fi-FI.json +3 -0
  871. package/src/autocomplete/intl/fr-FR.json +3 -0
  872. package/src/autocomplete/intl/he-IL.json +3 -0
  873. package/src/autocomplete/intl/hr-HR.json +3 -0
  874. package/src/autocomplete/intl/hu-HU.json +3 -0
  875. package/src/autocomplete/intl/index.ts +122 -0
  876. package/src/autocomplete/intl/it-IT.json +3 -0
  877. package/src/autocomplete/intl/ja-JP.json +3 -0
  878. package/src/autocomplete/intl/ko-KR.json +3 -0
  879. package/src/autocomplete/intl/lt-LT.json +3 -0
  880. package/src/autocomplete/intl/lv-LV.json +3 -0
  881. package/src/autocomplete/intl/nb-NO.json +3 -0
  882. package/src/autocomplete/intl/nl-NL.json +3 -0
  883. package/src/autocomplete/intl/pl-PL.json +3 -0
  884. package/src/autocomplete/intl/pt-BR.json +3 -0
  885. package/src/autocomplete/intl/pt-PT.json +3 -0
  886. package/src/autocomplete/intl/ro-RO.json +3 -0
  887. package/src/autocomplete/intl/ru-RU.json +3 -0
  888. package/src/autocomplete/intl/sk-SK.json +3 -0
  889. package/src/autocomplete/intl/sl-SI.json +3 -0
  890. package/src/autocomplete/intl/sr-SP.json +3 -0
  891. package/src/autocomplete/intl/sv-SE.json +3 -0
  892. package/src/autocomplete/intl/tr-TR.json +3 -0
  893. package/src/autocomplete/intl/uk-UA.json +3 -0
  894. package/src/autocomplete/intl/zh-CN.json +3 -0
  895. package/src/autocomplete/intl/zh-TW.json +3 -0
  896. package/src/breadcrumbs/createBreadcrumbs.ts +47 -12
  897. package/src/breadcrumbs/intl/ar-AE.json +3 -0
  898. package/src/breadcrumbs/intl/bg-BG.json +3 -0
  899. package/src/breadcrumbs/intl/cs-CZ.json +3 -0
  900. package/src/breadcrumbs/intl/da-DK.json +3 -0
  901. package/src/breadcrumbs/intl/de-DE.json +3 -0
  902. package/src/breadcrumbs/intl/el-GR.json +3 -0
  903. package/src/breadcrumbs/intl/en-US.json +3 -0
  904. package/src/breadcrumbs/intl/es-ES.json +3 -0
  905. package/src/breadcrumbs/intl/et-EE.json +3 -0
  906. package/src/breadcrumbs/intl/fi-FI.json +3 -0
  907. package/src/breadcrumbs/intl/fr-FR.json +3 -0
  908. package/src/breadcrumbs/intl/he-IL.json +3 -0
  909. package/src/breadcrumbs/intl/hr-HR.json +3 -0
  910. package/src/breadcrumbs/intl/hu-HU.json +3 -0
  911. package/src/breadcrumbs/intl/index.ts +122 -0
  912. package/src/breadcrumbs/intl/it-IT.json +3 -0
  913. package/src/breadcrumbs/intl/ja-JP.json +3 -0
  914. package/src/breadcrumbs/intl/ko-KR.json +3 -0
  915. package/src/breadcrumbs/intl/lt-LT.json +3 -0
  916. package/src/breadcrumbs/intl/lv-LV.json +3 -0
  917. package/src/breadcrumbs/intl/nb-NO.json +3 -0
  918. package/src/breadcrumbs/intl/nl-NL.json +3 -0
  919. package/src/breadcrumbs/intl/pl-PL.json +3 -0
  920. package/src/breadcrumbs/intl/pt-BR.json +3 -0
  921. package/src/breadcrumbs/intl/pt-PT.json +3 -0
  922. package/src/breadcrumbs/intl/ro-RO.json +3 -0
  923. package/src/breadcrumbs/intl/ru-RU.json +3 -0
  924. package/src/breadcrumbs/intl/sk-SK.json +3 -0
  925. package/src/breadcrumbs/intl/sl-SI.json +3 -0
  926. package/src/breadcrumbs/intl/sr-SP.json +3 -0
  927. package/src/breadcrumbs/intl/sv-SE.json +3 -0
  928. package/src/breadcrumbs/intl/tr-TR.json +3 -0
  929. package/src/breadcrumbs/intl/uk-UA.json +3 -0
  930. package/src/breadcrumbs/intl/zh-CN.json +3 -0
  931. package/src/breadcrumbs/intl/zh-TW.json +3 -0
  932. package/src/button/createButton.ts +22 -3
  933. package/src/button/createToggleButton.ts +27 -15
  934. package/src/button/createToggleButtonGroup.ts +23 -8
  935. package/src/button/types.ts +16 -0
  936. package/src/calendar/createCalendar.ts +121 -28
  937. package/src/calendar/createCalendarCell.ts +111 -31
  938. package/src/calendar/createCalendarGrid.ts +70 -18
  939. package/src/calendar/createCalendarMonthPicker.ts +14 -0
  940. package/src/calendar/createCalendarYearPicker.ts +18 -2
  941. package/src/calendar/createRangeCalendar.ts +209 -19
  942. package/src/calendar/createRangeCalendarCell.ts +343 -51
  943. package/src/calendar/intl/index.ts +37 -0
  944. package/src/calendar/utils.ts +175 -62
  945. package/src/checkbox/createCheckbox.ts +46 -35
  946. package/src/checkbox/createCheckboxGroup.ts +76 -20
  947. package/src/checkbox/createCheckboxGroupItem.ts +82 -6
  948. package/src/collections/index.ts +37 -18
  949. package/src/color/createColorArea.ts +271 -40
  950. package/src/color/createColorField.ts +264 -34
  951. package/src/color/createColorSlider.ts +38 -4
  952. package/src/color/createColorSwatch.ts +18 -1
  953. package/src/color/createColorWheel.ts +103 -13
  954. package/src/color/intl/index.ts +35 -0
  955. package/src/color/types.ts +49 -1
  956. package/src/combobox/createComboBox.ts +343 -196
  957. package/src/combobox/intl/generated-locales.ts +38 -1
  958. package/src/combobox/intl/index.ts +38 -2
  959. package/src/datepicker/createDateField.ts +51 -38
  960. package/src/datepicker/createDatePicker.ts +46 -4
  961. package/src/datepicker/createDatePickerGroup.ts +24 -13
  962. package/src/datepicker/createDateRangePicker.ts +57 -5
  963. package/src/datepicker/createDateSegment.ts +93 -24
  964. package/src/datepicker/createDisplayNames.ts +16 -1
  965. package/src/datepicker/createTimeField.ts +14 -0
  966. package/src/datepicker/intl.ts +36 -0
  967. package/src/dialog/createDialog.ts +57 -30
  968. package/src/dialog/types.ts +14 -0
  969. package/src/disclosure/createDisclosure.ts +36 -10
  970. package/src/disclosure/createDisclosureGroup.ts +3 -4
  971. package/src/dnd/DragManager.ts +72 -11
  972. package/src/dnd/DropTargetKeyboardNavigation.ts +2 -2
  973. package/src/dnd/createDrag.ts +18 -1
  974. package/src/dnd/createDraggableCollection.ts +96 -32
  975. package/src/dnd/createDraggableItem.ts +150 -72
  976. package/src/dnd/createDrop.ts +71 -4
  977. package/src/dnd/createDropIndicator.ts +182 -0
  978. package/src/dnd/createDroppableCollection.ts +106 -40
  979. package/src/dnd/createDroppableItem.ts +193 -13
  980. package/src/dnd/index.ts +3 -0
  981. package/src/dnd/intl/index.ts +77 -66
  982. package/src/dnd/types.ts +20 -1
  983. package/src/dnd/utils.ts +19 -0
  984. package/src/focus/FocusScope.tsx +704 -156
  985. package/src/focus/createAutoFocus.ts +120 -69
  986. package/src/focus/createFocusRestore.ts +16 -12
  987. package/src/focus/createHasTabbableChild.ts +78 -0
  988. package/src/focus/createVirtualFocus.ts +21 -5
  989. package/src/focus/virtualFocus.ts +1 -1
  990. package/src/form/createFormReset.ts +40 -17
  991. package/src/form/createFormValidation.ts +158 -88
  992. package/src/grid/GridKeyboardDelegate.ts +14 -0
  993. package/src/grid/createGrid.ts +264 -5
  994. package/src/grid/createGridCell.ts +26 -5
  995. package/src/grid/createGridRow.ts +17 -2
  996. package/src/grid/index.ts +2 -2
  997. package/src/grid/intl/ar-AE.json +8 -0
  998. package/src/grid/intl/bg-BG.json +8 -0
  999. package/src/grid/intl/cs-CZ.json +8 -0
  1000. package/src/grid/intl/da-DK.json +8 -0
  1001. package/src/grid/intl/de-DE.json +8 -0
  1002. package/src/grid/intl/el-GR.json +8 -0
  1003. package/src/grid/intl/en-US.json +8 -0
  1004. package/src/grid/intl/es-ES.json +8 -0
  1005. package/src/grid/intl/et-EE.json +8 -0
  1006. package/src/grid/intl/fi-FI.json +8 -0
  1007. package/src/grid/intl/fr-FR.json +8 -0
  1008. package/src/grid/intl/he-IL.json +8 -0
  1009. package/src/grid/intl/hr-HR.json +8 -0
  1010. package/src/grid/intl/hu-HU.json +8 -0
  1011. package/src/grid/intl/index.ts +127 -0
  1012. package/src/grid/intl/it-IT.json +8 -0
  1013. package/src/grid/intl/ja-JP.json +8 -0
  1014. package/src/grid/intl/ko-KR.json +8 -0
  1015. package/src/grid/intl/lt-LT.json +8 -0
  1016. package/src/grid/intl/lv-LV.json +8 -0
  1017. package/src/grid/intl/nb-NO.json +8 -0
  1018. package/src/grid/intl/nl-NL.json +8 -0
  1019. package/src/grid/intl/pl-PL.json +8 -0
  1020. package/src/grid/intl/pt-BR.json +8 -0
  1021. package/src/grid/intl/pt-PT.json +8 -0
  1022. package/src/grid/intl/ro-RO.json +8 -0
  1023. package/src/grid/intl/ru-RU.json +8 -0
  1024. package/src/grid/intl/sk-SK.json +8 -0
  1025. package/src/grid/intl/sl-SI.json +8 -0
  1026. package/src/grid/intl/sr-SP.json +8 -0
  1027. package/src/grid/intl/sv-SE.json +8 -0
  1028. package/src/grid/intl/tr-TR.json +8 -0
  1029. package/src/grid/intl/uk-UA.json +8 -0
  1030. package/src/grid/intl/zh-CN.json +8 -0
  1031. package/src/grid/intl/zh-TW.json +8 -0
  1032. package/src/grid/types.ts +25 -2
  1033. package/src/gridlist/createGridList.ts +252 -47
  1034. package/src/gridlist/createGridListItem.ts +90 -20
  1035. package/src/gridlist/createGridListSection.ts +14 -0
  1036. package/src/gridlist/createGridListSelectionCheckbox.ts +31 -4
  1037. package/src/gridlist/intl/ar-AE.json +4 -0
  1038. package/src/gridlist/intl/bg-BG.json +4 -0
  1039. package/src/gridlist/intl/cs-CZ.json +4 -0
  1040. package/src/gridlist/intl/da-DK.json +4 -0
  1041. package/src/gridlist/intl/de-DE.json +4 -0
  1042. package/src/gridlist/intl/el-GR.json +4 -0
  1043. package/src/gridlist/intl/en-US.json +4 -0
  1044. package/src/gridlist/intl/es-ES.json +4 -0
  1045. package/src/gridlist/intl/et-EE.json +4 -0
  1046. package/src/gridlist/intl/fi-FI.json +4 -0
  1047. package/src/gridlist/intl/fr-FR.json +4 -0
  1048. package/src/gridlist/intl/he-IL.json +4 -0
  1049. package/src/gridlist/intl/hr-HR.json +4 -0
  1050. package/src/gridlist/intl/hu-HU.json +4 -0
  1051. package/src/gridlist/intl/index.ts +123 -0
  1052. package/src/gridlist/intl/it-IT.json +4 -0
  1053. package/src/gridlist/intl/ja-JP.json +4 -0
  1054. package/src/gridlist/intl/ko-KR.json +4 -0
  1055. package/src/gridlist/intl/lt-LT.json +4 -0
  1056. package/src/gridlist/intl/lv-LV.json +4 -0
  1057. package/src/gridlist/intl/nb-NO.json +4 -0
  1058. package/src/gridlist/intl/nl-NL.json +4 -0
  1059. package/src/gridlist/intl/pl-PL.json +4 -0
  1060. package/src/gridlist/intl/pt-BR.json +4 -0
  1061. package/src/gridlist/intl/pt-PT.json +4 -0
  1062. package/src/gridlist/intl/ro-RO.json +4 -0
  1063. package/src/gridlist/intl/ru-RU.json +4 -0
  1064. package/src/gridlist/intl/sk-SK.json +4 -0
  1065. package/src/gridlist/intl/sl-SI.json +4 -0
  1066. package/src/gridlist/intl/sr-SP.json +4 -0
  1067. package/src/gridlist/intl/sv-SE.json +4 -0
  1068. package/src/gridlist/intl/tr-TR.json +4 -0
  1069. package/src/gridlist/intl/uk-UA.json +4 -0
  1070. package/src/gridlist/intl/zh-CN.json +4 -0
  1071. package/src/gridlist/intl/zh-TW.json +4 -0
  1072. package/src/gridlist/types.ts +86 -2
  1073. package/src/i18n/compileIcu.ts +440 -0
  1074. package/src/i18n/createCollator.ts +14 -0
  1075. package/src/i18n/createDateFormatter.ts +17 -2
  1076. package/src/i18n/createFilter.ts +14 -0
  1077. package/src/i18n/createListFormatter.ts +38 -0
  1078. package/src/i18n/createNumberFormatter.ts +14 -0
  1079. package/src/i18n/createStringFormatter.ts +64 -8
  1080. package/src/i18n/index.ts +3 -0
  1081. package/src/i18n/locale.tsx +77 -20
  1082. package/src/i18n/utils.ts +14 -0
  1083. package/src/index.ts +81 -3
  1084. package/src/interactions/FocusableProvider.tsx +28 -11
  1085. package/src/interactions/PressEvent.ts +16 -1
  1086. package/src/interactions/createContextMenu.ts +108 -0
  1087. package/src/interactions/createFocus.ts +35 -8
  1088. package/src/interactions/createFocusRing.ts +39 -18
  1089. package/src/interactions/createFocusWithin.ts +61 -10
  1090. package/src/interactions/createFocusable.ts +67 -31
  1091. package/src/interactions/createHover.ts +98 -94
  1092. package/src/interactions/createInteractionModality.ts +135 -45
  1093. package/src/interactions/createKeyboard.ts +85 -9
  1094. package/src/interactions/createKeyboardShortcutHandler.ts +157 -0
  1095. package/src/interactions/createLongPress.ts +74 -22
  1096. package/src/interactions/createMove.ts +24 -3
  1097. package/src/interactions/createPress.ts +109 -74
  1098. package/src/interactions/index.ts +1 -0
  1099. package/src/label/createField.ts +58 -63
  1100. package/src/label/createLabel.ts +21 -4
  1101. package/src/label/createLabels.ts +17 -0
  1102. package/src/landmark/createLandmark.ts +491 -167
  1103. package/src/link/createLink.ts +48 -41
  1104. package/src/listbox/createListBox.ts +114 -310
  1105. package/src/listbox/createOption.ts +50 -14
  1106. package/src/live-announcer/announce.ts +27 -10
  1107. package/src/menu/createMenu.ts +123 -315
  1108. package/src/menu/createMenuItem.ts +84 -60
  1109. package/src/menu/createMenuTrigger.ts +179 -51
  1110. package/src/menu/index.ts +2 -0
  1111. package/src/menu/intl/index.ts +130 -0
  1112. package/src/meter/createMeter.ts +20 -5
  1113. package/src/numberfield/createNumberField.ts +459 -41
  1114. package/src/numberfield/index.ts +7 -0
  1115. package/src/numberfield/intl.ts +240 -0
  1116. package/src/overlays/ariaHideOutside.ts +76 -11
  1117. package/src/overlays/createCloseOnScroll.ts +90 -0
  1118. package/src/overlays/createInteractOutside.ts +73 -68
  1119. package/src/overlays/createModal.tsx +42 -27
  1120. package/src/overlays/createOverlay.ts +72 -67
  1121. package/src/overlays/createOverlayTrigger.ts +21 -6
  1122. package/src/overlays/createPreventScroll.ts +92 -62
  1123. package/src/overlays/index.ts +5 -0
  1124. package/src/overlays/intl/ar-AE.json +3 -0
  1125. package/src/overlays/intl/bg-BG.json +3 -0
  1126. package/src/overlays/intl/cs-CZ.json +3 -0
  1127. package/src/overlays/intl/da-DK.json +3 -0
  1128. package/src/overlays/intl/de-DE.json +3 -0
  1129. package/src/overlays/intl/el-GR.json +3 -0
  1130. package/src/overlays/intl/en-US.json +3 -0
  1131. package/src/overlays/intl/es-ES.json +3 -0
  1132. package/src/overlays/intl/et-EE.json +3 -0
  1133. package/src/overlays/intl/fi-FI.json +3 -0
  1134. package/src/overlays/intl/fr-FR.json +3 -0
  1135. package/src/overlays/intl/he-IL.json +3 -0
  1136. package/src/overlays/intl/hr-HR.json +3 -0
  1137. package/src/overlays/intl/hu-HU.json +3 -0
  1138. package/src/overlays/intl/index.ts +122 -0
  1139. package/src/overlays/intl/it-IT.json +3 -0
  1140. package/src/overlays/intl/ja-JP.json +3 -0
  1141. package/src/overlays/intl/ko-KR.json +3 -0
  1142. package/src/overlays/intl/lt-LT.json +3 -0
  1143. package/src/overlays/intl/lv-LV.json +3 -0
  1144. package/src/overlays/intl/nb-NO.json +3 -0
  1145. package/src/overlays/intl/nl-NL.json +3 -0
  1146. package/src/overlays/intl/pl-PL.json +3 -0
  1147. package/src/overlays/intl/pt-BR.json +3 -0
  1148. package/src/overlays/intl/pt-PT.json +3 -0
  1149. package/src/overlays/intl/ro-RO.json +3 -0
  1150. package/src/overlays/intl/ru-RU.json +3 -0
  1151. package/src/overlays/intl/sk-SK.json +3 -0
  1152. package/src/overlays/intl/sl-SI.json +3 -0
  1153. package/src/overlays/intl/sr-SP.json +3 -0
  1154. package/src/overlays/intl/sv-SE.json +3 -0
  1155. package/src/overlays/intl/tr-TR.json +3 -0
  1156. package/src/overlays/intl/uk-UA.json +3 -0
  1157. package/src/overlays/intl/zh-CN.json +3 -0
  1158. package/src/overlays/intl/zh-TW.json +3 -0
  1159. package/src/popover/calculatePosition.ts +21 -3
  1160. package/src/popover/createOverlayPosition.ts +154 -63
  1161. package/src/popover/createPopover.ts +121 -27
  1162. package/src/progress/createProgressBar.ts +23 -5
  1163. package/src/radio/createRadio.ts +65 -26
  1164. package/src/radio/createRadioGroup.ts +131 -86
  1165. package/src/searchfield/createSearchField.ts +34 -2
  1166. package/src/searchfield/intl/ar-AE.json +3 -0
  1167. package/src/searchfield/intl/bg-BG.json +3 -0
  1168. package/src/searchfield/intl/cs-CZ.json +3 -0
  1169. package/src/searchfield/intl/da-DK.json +3 -0
  1170. package/src/searchfield/intl/de-DE.json +3 -0
  1171. package/src/searchfield/intl/el-GR.json +3 -0
  1172. package/src/searchfield/intl/en-US.json +3 -0
  1173. package/src/searchfield/intl/es-ES.json +3 -0
  1174. package/src/searchfield/intl/et-EE.json +3 -0
  1175. package/src/searchfield/intl/fi-FI.json +3 -0
  1176. package/src/searchfield/intl/fr-FR.json +3 -0
  1177. package/src/searchfield/intl/he-IL.json +3 -0
  1178. package/src/searchfield/intl/hr-HR.json +3 -0
  1179. package/src/searchfield/intl/hu-HU.json +3 -0
  1180. package/src/searchfield/intl/index.ts +122 -0
  1181. package/src/searchfield/intl/it-IT.json +3 -0
  1182. package/src/searchfield/intl/ja-JP.json +3 -0
  1183. package/src/searchfield/intl/ko-KR.json +3 -0
  1184. package/src/searchfield/intl/lt-LT.json +3 -0
  1185. package/src/searchfield/intl/lv-LV.json +3 -0
  1186. package/src/searchfield/intl/nb-NO.json +3 -0
  1187. package/src/searchfield/intl/nl-NL.json +3 -0
  1188. package/src/searchfield/intl/pl-PL.json +3 -0
  1189. package/src/searchfield/intl/pt-BR.json +3 -0
  1190. package/src/searchfield/intl/pt-PT.json +3 -0
  1191. package/src/searchfield/intl/ro-RO.json +3 -0
  1192. package/src/searchfield/intl/ru-RU.json +3 -0
  1193. package/src/searchfield/intl/sk-SK.json +3 -0
  1194. package/src/searchfield/intl/sl-SI.json +3 -0
  1195. package/src/searchfield/intl/sr-SP.json +3 -0
  1196. package/src/searchfield/intl/sv-SE.json +3 -0
  1197. package/src/searchfield/intl/tr-TR.json +3 -0
  1198. package/src/searchfield/intl/uk-UA.json +3 -0
  1199. package/src/searchfield/intl/zh-CN.json +3 -0
  1200. package/src/searchfield/intl/zh-TW.json +3 -0
  1201. package/src/select/createHiddenSelect.tsx +157 -110
  1202. package/src/select/createSelect.ts +139 -61
  1203. package/src/selection/DOMLayoutDelegate.ts +14 -0
  1204. package/src/selection/ListKeyboardDelegate.ts +26 -4
  1205. package/src/selection/constants.ts +14 -0
  1206. package/src/selection/createCollectionRowInteraction.ts +77 -8
  1207. package/src/selection/createScrollIntoViewOnFocus.ts +23 -8
  1208. package/src/selection/createSelectableCollection.ts +394 -245
  1209. package/src/selection/createSelectableItem.ts +220 -45
  1210. package/src/selection/createSelectableList.ts +26 -3
  1211. package/src/selection/createTypeSelect.ts +34 -11
  1212. package/src/selection/selectItem.ts +14 -0
  1213. package/src/selection/utils.ts +15 -1
  1214. package/src/separator/createSeparator.ts +17 -1
  1215. package/src/slider/createSlider.ts +561 -302
  1216. package/src/slider/createSliderThumb.ts +46 -0
  1217. package/src/slider/index.ts +1 -0
  1218. package/src/spinbutton/createSpinButton.ts +16 -2
  1219. package/src/spinbutton/intl.ts +36 -0
  1220. package/src/ssr/index.tsx +93 -48
  1221. package/src/steplist/createStepList.ts +112 -48
  1222. package/src/steplist/index.ts +3 -0
  1223. package/src/steplist/intl/ar-AE.json +3 -0
  1224. package/src/steplist/intl/bg-BG.json +3 -0
  1225. package/src/steplist/intl/cs-CZ.json +3 -0
  1226. package/src/steplist/intl/da-DK.json +3 -0
  1227. package/src/steplist/intl/de-DE.json +3 -0
  1228. package/src/steplist/intl/el-GR.json +3 -0
  1229. package/src/steplist/intl/en-US.json +3 -0
  1230. package/src/steplist/intl/es-ES.json +3 -0
  1231. package/src/steplist/intl/et-EE.json +3 -0
  1232. package/src/steplist/intl/fi-FI.json +3 -0
  1233. package/src/steplist/intl/fr-FR.json +3 -0
  1234. package/src/steplist/intl/he-IL.json +3 -0
  1235. package/src/steplist/intl/hr-HR.json +3 -0
  1236. package/src/steplist/intl/hu-HU.json +3 -0
  1237. package/src/steplist/intl/index.ts +88 -0
  1238. package/src/steplist/intl/it-IT.json +3 -0
  1239. package/src/steplist/intl/ja-JP.json +3 -0
  1240. package/src/steplist/intl/ko-KR.json +3 -0
  1241. package/src/steplist/intl/lt-LT.json +3 -0
  1242. package/src/steplist/intl/lv-LV.json +3 -0
  1243. package/src/steplist/intl/nb-NO.json +3 -0
  1244. package/src/steplist/intl/nl-NL.json +3 -0
  1245. package/src/steplist/intl/pl-PL.json +3 -0
  1246. package/src/steplist/intl/pt-BR.json +3 -0
  1247. package/src/steplist/intl/pt-PT.json +3 -0
  1248. package/src/steplist/intl/ro-RO.json +3 -0
  1249. package/src/steplist/intl/ru-RU.json +3 -0
  1250. package/src/steplist/intl/sk-SK.json +3 -0
  1251. package/src/steplist/intl/sl-SI.json +3 -0
  1252. package/src/steplist/intl/sr-SP.json +3 -0
  1253. package/src/steplist/intl/sv-SE.json +3 -0
  1254. package/src/steplist/intl/tr-TR.json +3 -0
  1255. package/src/steplist/intl/uk-UA.json +3 -0
  1256. package/src/steplist/intl/zh-CN.json +3 -0
  1257. package/src/steplist/intl/zh-TW.json +3 -0
  1258. package/src/switch/createSwitch.ts +25 -4
  1259. package/src/table/createTable.ts +247 -82
  1260. package/src/table/createTableCell.ts +26 -6
  1261. package/src/table/createTableColumnHeader.ts +61 -13
  1262. package/src/table/createTableColumnResize.ts +303 -102
  1263. package/src/table/createTableHeaderRow.ts +20 -5
  1264. package/src/table/createTableRow.ts +48 -25
  1265. package/src/table/createTableRowGroup.ts +18 -3
  1266. package/src/table/createTableSelectAllCheckbox.ts +30 -14
  1267. package/src/table/createTableSelectionCheckbox.ts +21 -3
  1268. package/src/table/index.ts +2 -2
  1269. package/src/table/intl/ar-AE.json +13 -0
  1270. package/src/table/intl/bg-BG.json +13 -0
  1271. package/src/table/intl/cs-CZ.json +13 -0
  1272. package/src/table/intl/da-DK.json +13 -0
  1273. package/src/table/intl/de-DE.json +13 -0
  1274. package/src/table/intl/el-GR.json +13 -0
  1275. package/src/table/intl/en-US.json +13 -0
  1276. package/src/table/intl/es-ES.json +13 -0
  1277. package/src/table/intl/et-EE.json +13 -0
  1278. package/src/table/intl/fi-FI.json +13 -0
  1279. package/src/table/intl/fr-FR.json +13 -0
  1280. package/src/table/intl/he-IL.json +13 -0
  1281. package/src/table/intl/hr-HR.json +13 -0
  1282. package/src/table/intl/hu-HU.json +13 -0
  1283. package/src/table/intl/index.ts +132 -0
  1284. package/src/table/intl/it-IT.json +13 -0
  1285. package/src/table/intl/ja-JP.json +13 -0
  1286. package/src/table/intl/ko-KR.json +13 -0
  1287. package/src/table/intl/lt-LT.json +13 -0
  1288. package/src/table/intl/lv-LV.json +13 -0
  1289. package/src/table/intl/nb-NO.json +13 -0
  1290. package/src/table/intl/nl-NL.json +13 -0
  1291. package/src/table/intl/pl-PL.json +13 -0
  1292. package/src/table/intl/pt-BR.json +13 -0
  1293. package/src/table/intl/pt-PT.json +13 -0
  1294. package/src/table/intl/ro-RO.json +13 -0
  1295. package/src/table/intl/ru-RU.json +13 -0
  1296. package/src/table/intl/sk-SK.json +13 -0
  1297. package/src/table/intl/sl-SI.json +13 -0
  1298. package/src/table/intl/sr-SP.json +13 -0
  1299. package/src/table/intl/sv-SE.json +13 -0
  1300. package/src/table/intl/tr-TR.json +13 -0
  1301. package/src/table/intl/uk-UA.json +13 -0
  1302. package/src/table/intl/zh-CN.json +13 -0
  1303. package/src/table/intl/zh-TW.json +13 -0
  1304. package/src/table/types.ts +44 -2
  1305. package/src/table/utils.ts +27 -1
  1306. package/src/tabs/createTabs.ts +140 -67
  1307. package/src/tag/createTag.ts +157 -180
  1308. package/src/tag/createTagGroup.ts +160 -105
  1309. package/src/tag/intl/ar-AE.json +4 -0
  1310. package/src/tag/intl/bg-BG.json +4 -0
  1311. package/src/tag/intl/cs-CZ.json +4 -0
  1312. package/src/tag/intl/da-DK.json +4 -0
  1313. package/src/tag/intl/de-DE.json +4 -0
  1314. package/src/tag/intl/el-GR.json +4 -0
  1315. package/src/tag/intl/en-US.json +4 -0
  1316. package/src/tag/intl/es-ES.json +4 -0
  1317. package/src/tag/intl/et-EE.json +4 -0
  1318. package/src/tag/intl/fi-FI.json +4 -0
  1319. package/src/tag/intl/fr-FR.json +4 -0
  1320. package/src/tag/intl/he-IL.json +4 -0
  1321. package/src/tag/intl/hr-HR.json +4 -0
  1322. package/src/tag/intl/hu-HU.json +4 -0
  1323. package/src/tag/intl/index.ts +123 -0
  1324. package/src/tag/intl/it-IT.json +4 -0
  1325. package/src/tag/intl/ja-JP.json +4 -0
  1326. package/src/tag/intl/ko-KR.json +4 -0
  1327. package/src/tag/intl/lt-LT.json +4 -0
  1328. package/src/tag/intl/lv-LV.json +4 -0
  1329. package/src/tag/intl/nb-NO.json +4 -0
  1330. package/src/tag/intl/nl-NL.json +4 -0
  1331. package/src/tag/intl/pl-PL.json +4 -0
  1332. package/src/tag/intl/pt-BR.json +4 -0
  1333. package/src/tag/intl/pt-PT.json +4 -0
  1334. package/src/tag/intl/ro-RO.json +4 -0
  1335. package/src/tag/intl/ru-RU.json +4 -0
  1336. package/src/tag/intl/sk-SK.json +4 -0
  1337. package/src/tag/intl/sl-SI.json +4 -0
  1338. package/src/tag/intl/sr-SP.json +4 -0
  1339. package/src/tag/intl/sv-SE.json +4 -0
  1340. package/src/tag/intl/tr-TR.json +4 -0
  1341. package/src/tag/intl/uk-UA.json +4 -0
  1342. package/src/tag/intl/zh-CN.json +4 -0
  1343. package/src/tag/intl/zh-TW.json +4 -0
  1344. package/src/textfield/createTextField.ts +120 -14
  1345. package/src/toast/createToast.ts +72 -22
  1346. package/src/toast/createToastRegion.ts +60 -24
  1347. package/src/toast/intl/ar-AE.json +4 -0
  1348. package/src/toast/intl/bg-BG.json +4 -0
  1349. package/src/toast/intl/cs-CZ.json +4 -0
  1350. package/src/toast/intl/da-DK.json +4 -0
  1351. package/src/toast/intl/de-DE.json +4 -0
  1352. package/src/toast/intl/el-GR.json +4 -0
  1353. package/src/toast/intl/en-US.json +4 -0
  1354. package/src/toast/intl/es-ES.json +4 -0
  1355. package/src/toast/intl/et-EE.json +4 -0
  1356. package/src/toast/intl/fi-FI.json +4 -0
  1357. package/src/toast/intl/fr-FR.json +4 -0
  1358. package/src/toast/intl/he-IL.json +4 -0
  1359. package/src/toast/intl/hr-HR.json +4 -0
  1360. package/src/toast/intl/hu-HU.json +4 -0
  1361. package/src/toast/intl/index.ts +123 -0
  1362. package/src/toast/intl/it-IT.json +4 -0
  1363. package/src/toast/intl/ja-JP.json +4 -0
  1364. package/src/toast/intl/ko-KR.json +4 -0
  1365. package/src/toast/intl/lt-LT.json +4 -0
  1366. package/src/toast/intl/lv-LV.json +4 -0
  1367. package/src/toast/intl/nb-NO.json +4 -0
  1368. package/src/toast/intl/nl-NL.json +4 -0
  1369. package/src/toast/intl/pl-PL.json +4 -0
  1370. package/src/toast/intl/pt-BR.json +4 -0
  1371. package/src/toast/intl/pt-PT.json +4 -0
  1372. package/src/toast/intl/ro-RO.json +4 -0
  1373. package/src/toast/intl/ru-RU.json +4 -0
  1374. package/src/toast/intl/sk-SK.json +4 -0
  1375. package/src/toast/intl/sl-SI.json +4 -0
  1376. package/src/toast/intl/sr-SP.json +4 -0
  1377. package/src/toast/intl/sv-SE.json +4 -0
  1378. package/src/toast/intl/tr-TR.json +4 -0
  1379. package/src/toast/intl/uk-UA.json +4 -0
  1380. package/src/toast/intl/zh-CN.json +4 -0
  1381. package/src/toast/intl/zh-TW.json +4 -0
  1382. package/src/toggle/createToggle.ts +169 -21
  1383. package/src/tokenfield/createToken.ts +100 -0
  1384. package/src/tokenfield/createTokenField.ts +955 -0
  1385. package/src/tokenfield/index.ts +10 -0
  1386. package/src/toolbar/createToolbar.ts +26 -5
  1387. package/src/tooltip/createPreviewTrigger.ts +301 -0
  1388. package/src/tooltip/createSafeArea.ts +165 -0
  1389. package/src/tooltip/createTooltip.ts +15 -1
  1390. package/src/tooltip/createTooltipTrigger.ts +25 -11
  1391. package/src/tooltip/index.ts +7 -0
  1392. package/src/tooltip/intl/index.ts +76 -0
  1393. package/src/tree/createTree.ts +83 -48
  1394. package/src/tree/createTreeItem.ts +92 -35
  1395. package/src/tree/createTreeSelectionCheckbox.ts +34 -30
  1396. package/src/tree/intl/ar-AE.json +4 -0
  1397. package/src/tree/intl/bg-BG.json +4 -0
  1398. package/src/tree/intl/cs-CZ.json +4 -0
  1399. package/src/tree/intl/da-DK.json +4 -0
  1400. package/src/tree/intl/de-DE.json +4 -0
  1401. package/src/tree/intl/el-GR.json +4 -0
  1402. package/src/tree/intl/en-US.json +4 -0
  1403. package/src/tree/intl/es-ES.json +4 -0
  1404. package/src/tree/intl/et-EE.json +4 -0
  1405. package/src/tree/intl/fi-FI.json +4 -0
  1406. package/src/tree/intl/fr-FR.json +4 -0
  1407. package/src/tree/intl/he-IL.json +4 -0
  1408. package/src/tree/intl/hr-HR.json +4 -0
  1409. package/src/tree/intl/hu-HU.json +4 -0
  1410. package/src/tree/intl/index.ts +123 -0
  1411. package/src/tree/intl/it-IT.json +4 -0
  1412. package/src/tree/intl/ja-JP.json +4 -0
  1413. package/src/tree/intl/ko-KR.json +4 -0
  1414. package/src/tree/intl/lt-LT.json +4 -0
  1415. package/src/tree/intl/lv-LV.json +4 -0
  1416. package/src/tree/intl/nb-NO.json +4 -0
  1417. package/src/tree/intl/nl-NL.json +4 -0
  1418. package/src/tree/intl/pl-PL.json +4 -0
  1419. package/src/tree/intl/pt-BR.json +4 -0
  1420. package/src/tree/intl/pt-PT.json +4 -0
  1421. package/src/tree/intl/ro-RO.json +4 -0
  1422. package/src/tree/intl/ru-RU.json +4 -0
  1423. package/src/tree/intl/sk-SK.json +4 -0
  1424. package/src/tree/intl/sl-SI.json +4 -0
  1425. package/src/tree/intl/sr-SP.json +4 -0
  1426. package/src/tree/intl/sv-SE.json +4 -0
  1427. package/src/tree/intl/tr-TR.json +4 -0
  1428. package/src/tree/intl/uk-UA.json +4 -0
  1429. package/src/tree/intl/zh-CN.json +4 -0
  1430. package/src/tree/intl/zh-TW.json +4 -0
  1431. package/src/tree/types.ts +37 -3
  1432. package/src/utils/ShadowTreeWalker.ts +249 -0
  1433. package/src/utils/animation.ts +84 -107
  1434. package/src/utils/callEventHandler.ts +23 -0
  1435. package/src/utils/capture.ts +68 -0
  1436. package/src/utils/createDescription.ts +31 -8
  1437. package/src/utils/dom.ts +382 -72
  1438. package/src/utils/domAttrs.ts +84 -0
  1439. package/src/utils/env.ts +34 -3
  1440. package/src/utils/events.ts +39 -3
  1441. package/src/utils/filterDOMProps.ts +34 -2
  1442. package/src/utils/focus.ts +165 -78
  1443. package/src/utils/focusWithoutScrolling.ts +95 -0
  1444. package/src/utils/geometry.ts +15 -1
  1445. package/src/utils/getMetaValue.ts +57 -0
  1446. package/src/utils/getNonce.ts +40 -0
  1447. package/src/utils/globalListeners.ts +16 -3
  1448. package/src/utils/index.ts +40 -1
  1449. package/src/utils/keyboard.ts +15 -1
  1450. package/src/utils/mergeProps.ts +149 -16
  1451. package/src/utils/openLink.ts +241 -0
  1452. package/src/utils/owner.ts +26 -0
  1453. package/src/utils/platform.ts +81 -35
  1454. package/src/utils/reactivity.ts +2 -0
  1455. package/src/utils/refs.ts +53 -0
  1456. package/src/utils/runAfterTransition.ts +117 -0
  1457. package/src/utils/scrollIntoView.ts +14 -0
  1458. package/src/utils/splitProps.ts +70 -0
  1459. package/src/utils/textSelection.ts +53 -66
  1460. package/src/virtualizer/ScrollView.ts +210 -0
  1461. package/src/virtualizer/index.ts +2 -0
  1462. package/src/virtualizer/utils.ts +100 -0
  1463. package/src/visually-hidden/createVisuallyHidden.ts +20 -4
  1464. package/dist/_chunk/createFormValidation.js +0 -135
  1465. package/dist/_chunk/createFormValidation.js.map +0 -1
  1466. package/dist/_chunk/createFormValidation.jsx +0 -135
  1467. package/dist/_chunk/createFormValidation.jsx.map +0 -1
  1468. package/dist/_chunk/focus2.js +0 -631
  1469. package/dist/_chunk/focus2.js.map +0 -1
  1470. package/dist/_chunk/focus2.jsx +0 -631
  1471. package/dist/_chunk/focus2.jsx.map +0 -1
  1472. package/dist/_chunk/visually-hidden.js.map +0 -1
  1473. package/dist/_chunk/visually-hidden.jsx.map +0 -1
  1474. package/dist/checkbox/createCheckboxGroupState.d.ts +0 -71
  1475. package/dist/checkbox/createCheckboxGroupState.d.ts.map +0 -1
  1476. package/dist/radio/createRadioGroupState.d.ts +0 -77
  1477. package/dist/radio/createRadioGroupState.d.ts.map +0 -1
  1478. package/dist/toggle/createToggleState.d.ts +0 -34
  1479. package/dist/toggle/createToggleState.d.ts.map +0 -1
  1480. package/src/checkbox/createCheckboxGroupState.ts +0 -174
  1481. package/src/radio/createRadioGroupState.ts +0 -177
  1482. package/src/toggle/createToggleState.ts +0 -86
@@ -1 +1 @@
1
- {"version":3,"file":"DragManager.js","names":[],"sources":["../../src/dnd/utils.ts","../../src/dnd/DragManager.ts"],"sourcesContent":["/**\n * Drag and Drop utilities for solidaria.\n */\n\nimport type {\n DragItem,\n DragType,\n DropItem,\n TextDropItem,\n FileDropItem,\n DirectoryDropItem,\n DropOperation,\n} from \"@proyecto-viviana/solid-stately\";\nimport { DIRECTORY_DRAG_TYPE } from \"@proyecto-viviana/solid-stately\";\nimport { getInteractionModality } from \"../interactions\";\n\n// Native drag types that can be transferred between applications\nexport const NATIVE_DRAG_TYPES: Set<string> = new Set([\"text/plain\", \"text/uri-list\", \"text/html\"]);\n\n// Custom drag type for serializing multiple items\nexport const CUSTOM_DRAG_TYPE = \"application/vnd.solidaria.items+json\";\n\n// Generic type for unknown file types\nexport const GENERIC_TYPE = \"application/octet-stream\";\n\n// Drop operation bit flags\nexport enum DROP_OPERATION {\n none = 0,\n cancel = 0,\n move = 1 << 0,\n copy = 1 << 1,\n link = 1 << 2,\n all = (1 << 0) | (1 << 1) | (1 << 2),\n}\n\n// Map from effectAllowed to DROP_OPERATION\nexport const DROP_OPERATION_ALLOWED: Record<string, number> = {\n none: DROP_OPERATION.none,\n copy: DROP_OPERATION.copy,\n copyLink: DROP_OPERATION.copy | DROP_OPERATION.link,\n copyMove: DROP_OPERATION.copy | DROP_OPERATION.move,\n link: DROP_OPERATION.link,\n linkMove: DROP_OPERATION.link | DROP_OPERATION.move,\n move: DROP_OPERATION.move,\n all: DROP_OPERATION.all,\n uninitialized: DROP_OPERATION.all,\n};\n\n// Map from DROP_OPERATION to effectAllowed\nexport const EFFECT_ALLOWED: Record<number, string> = {\n [DROP_OPERATION.none]: \"none\",\n [DROP_OPERATION.move]: \"move\",\n [DROP_OPERATION.copy]: \"copy\",\n [DROP_OPERATION.copy | DROP_OPERATION.move]: \"copyMove\",\n [DROP_OPERATION.link]: \"link\",\n [DROP_OPERATION.link | DROP_OPERATION.move]: \"linkMove\",\n [DROP_OPERATION.copy | DROP_OPERATION.link]: \"copyLink\",\n [DROP_OPERATION.all]: \"all\",\n};\n\n// Map from dropEffect to DropOperation\nexport const DROP_EFFECT_TO_DROP_OPERATION: Record<string, DropOperation> = {\n none: \"cancel\",\n link: \"link\",\n copy: \"copy\",\n move: \"move\",\n};\n\n// Map from DropOperation to dropEffect\nexport const DROP_OPERATION_TO_DROP_EFFECT: Record<DropOperation, string> = {\n cancel: \"none\",\n link: \"link\",\n copy: \"copy\",\n move: \"move\",\n};\n\n/**\n * Maps the current interaction modality onto the drag modality used for\n * announcements and descriptions. Mirrors @react-aria/dnd `mapModality`:\n * pointer collapses to virtual, and a virtual modality on a coarse pointer\n * (touch screen reader) becomes touch.\n */\nfunction mapModality(modality: string | null): string {\n if (!modality) {\n modality = \"virtual\";\n }\n\n if (modality === \"pointer\") {\n modality = \"virtual\";\n }\n\n if (\n modality === \"virtual\" &&\n typeof window !== \"undefined\" &&\n typeof window.matchMedia === \"function\" &&\n window.matchMedia(\"(pointer: coarse)\").matches\n ) {\n modality = \"touch\";\n }\n\n return modality;\n}\n\n/**\n * Returns the drag modality ('keyboard' | 'virtual' | 'touch') for the current\n * interaction. Mirrors @react-aria/dnd `getDragModality`.\n */\nexport function getDragModality(): string {\n return mapModality(getInteractionModality());\n}\n\n/**\n * Get the types present in drag items.\n */\nexport function getTypes(items: DragItem[]): Set<string> {\n const types = new Set<string>();\n for (const item of items) {\n for (const type of Object.keys(item)) {\n types.add(type);\n }\n }\n return types;\n}\n\n/**\n * Write drag items to a DataTransfer object.\n */\nexport function writeToDataTransfer(dataTransfer: DataTransfer, items: DragItem[]): void {\n const groupedByType = new Map<string, string[]>();\n let needsCustomData = false;\n const customData: object[] = [];\n\n for (const item of items) {\n const types = Object.keys(item);\n if (types.length > 1) {\n needsCustomData = true;\n }\n\n const dataByType: Record<string, string> = {};\n for (const type of types) {\n let typeItems = groupedByType.get(type);\n if (!typeItems) {\n typeItems = [];\n groupedByType.set(type, typeItems);\n } else {\n needsCustomData = true;\n }\n\n const data = item[type];\n dataByType[type] = data;\n typeItems.push(data);\n }\n\n customData.push(dataByType);\n }\n\n for (const [type, typeItems] of groupedByType) {\n if (NATIVE_DRAG_TYPES.has(type)) {\n // Join all items of this type with newlines\n const data = typeItems.join(\"\\n\");\n dataTransfer.items.add(data, type);\n } else {\n // Set first item for non-native types\n dataTransfer.items.add(typeItems[0], type);\n }\n }\n\n if (needsCustomData) {\n const data = JSON.stringify(customData);\n dataTransfer.items.add(data, CUSTOM_DRAG_TYPE);\n }\n}\n\n/**\n * Read drop items from a DataTransfer object.\n */\nexport function readFromDataTransfer(dataTransfer: DataTransfer): DropItem[] {\n const items: DropItem[] = [];\n\n if (!dataTransfer) {\n return items;\n }\n\n // Check for custom drag type first\n let hasCustomType = false;\n if (dataTransfer.types.includes(CUSTOM_DRAG_TYPE)) {\n try {\n const data = dataTransfer.getData(CUSTOM_DRAG_TYPE);\n const parsed = JSON.parse(data);\n for (const item of parsed) {\n items.push({\n kind: \"text\",\n types: new Set(Object.keys(item)),\n getText: (type) => Promise.resolve(item[type]),\n });\n }\n hasCustomType = true;\n } catch {\n // ignore parsing errors\n }\n }\n\n // Fall back to native items\n if (!hasCustomType) {\n const stringItems = new Map<string, string>();\n\n for (const item of dataTransfer.items) {\n if (item.kind === \"string\") {\n const type = item.type || GENERIC_TYPE;\n stringItems.set(type, dataTransfer.getData(item.type));\n } else if (item.kind === \"file\") {\n const file = item.getAsFile();\n if (file) {\n items.push(createFileItem(file));\n }\n }\n }\n\n if (stringItems.size > 0) {\n items.push({\n kind: \"text\",\n types: new Set(stringItems.keys()),\n getText: (type) => Promise.resolve(stringItems.get(type) ?? \"\"),\n });\n }\n }\n\n return items;\n}\n\n/**\n * Create a FileDropItem from a File object.\n */\nfunction createFileItem(file: File): FileDropItem {\n return {\n kind: \"file\",\n type: file.type || GENERIC_TYPE,\n name: file.name,\n getText: () => file.text(),\n getFile: () => Promise.resolve(file),\n };\n}\n\n/**\n * DragTypes implementation for checking drag types.\n */\nexport class DragTypesImpl {\n private types: Set<string>;\n private includesUnknownTypes: boolean;\n\n constructor(dataTransfer: DataTransfer) {\n this.types = new Set<string>();\n let hasFiles = false;\n\n for (const item of dataTransfer.items) {\n if (item.type !== CUSTOM_DRAG_TYPE) {\n if (item.kind === \"file\") {\n hasFiles = true;\n }\n if (item.type) {\n this.types.add(item.type);\n } else {\n this.types.add(GENERIC_TYPE);\n }\n }\n }\n\n // Safari doesn't expose file types until drop\n this.includesUnknownTypes = !hasFiles && dataTransfer.types.includes(\"Files\");\n }\n\n has(type: DragType | DragType[]): boolean {\n if (Array.isArray(type)) {\n return type.some((t) => this.has(t));\n }\n\n if (\n this.includesUnknownTypes ||\n (type === DIRECTORY_DRAG_TYPE && this.types.has(GENERIC_TYPE)) ||\n type === \"*/*\"\n ) {\n return true;\n }\n\n if (typeof type === \"string\") {\n // Wildcard MIME match, e.g. \"image/*\" accepts \"image/png\".\n if (type.endsWith(\"/*\")) {\n for (const key of this.types) {\n if (key.startsWith(type.slice(0, -2))) {\n return true;\n }\n }\n return false;\n }\n return this.types.has(type);\n }\n\n return false;\n }\n}\n\n/**\n * Check if a drop item is a text item.\n */\nexport function isTextDropItem(dropItem: DropItem): dropItem is TextDropItem {\n return dropItem.kind === \"text\";\n}\n\n/**\n * Check if a drop item is a file item.\n */\nexport function isFileDropItem(dropItem: DropItem): dropItem is FileDropItem {\n return dropItem.kind === \"file\";\n}\n\n/**\n * Check if a drop item is a directory item.\n */\nexport function isDirectoryDropItem(dropItem: DropItem): dropItem is DirectoryDropItem {\n return dropItem.kind === \"directory\";\n}\n\n// Global state for tracking drag operations\nlet globalDropEffect: string | undefined;\nlet globalAllowedDropOperations: number = DROP_OPERATION.none;\n\nexport function setGlobalDropEffect(effect: string | undefined): void {\n globalDropEffect = effect;\n}\n\nexport function getGlobalDropEffect(): string | undefined {\n return globalDropEffect;\n}\n\nexport function setGlobalAllowedDropOperations(ops: number): void {\n globalAllowedDropOperations = ops;\n}\n\nexport function getGlobalAllowedDropOperations(): number {\n return globalAllowedDropOperations;\n}\n","/**\n * Global keyboard/virtual drag session manager.\n *\n * Faithful port of @react-aria/dnd `DragManager` (react-aria 3.50). A single\n * module-level singleton owns the active drag session: it registers drop targets\n * and drop items across every collection on the page, drives Tab/Shift+Tab\n * cycling between them, Enter-to-drop / Escape-to-cancel, and the aria-live\n * announcements — providing the accessible keyboard alternative to native\n * pointer drag and drop.\n *\n * The only framework-specific adaptation from upstream is the reactive\n * subscription: React's `useDragSession` (useState + a subscription Set) becomes\n * a module-level Solid signal exposed through `createDragSession()`. Element refs\n * (upstream `RefObject.current`) become Solid element accessors (`() => el`).\n */\n\nimport { createSignal, type Accessor } from \"solid-js\";\n\nimport { announce } from \"../live-announcer/announce\";\nimport { ariaHideOutside } from \"../overlays/ariaHideOutside\";\nimport type {\n DragEndEvent,\n DragItem,\n DropActivateEvent,\n DropEnterEvent,\n DropEvent,\n DropExitEvent,\n DropItem,\n DropOperation,\n DropTarget as DroppableCollectionTarget,\n} from \"@proyecto-viviana/solid-stately\";\nimport { getActiveElement, getEventTarget, nodeContains } from \"../utils/dom\";\nimport { getDragModality, getTypes } from \"./utils\";\nimport { isVirtualClick, isVirtualPointerEvent } from \"../utils/events\";\nimport type { LocalizedStringFormatter } from \"@internationalized/string\";\n\n/** A Solid element accessor, replacing upstream's `RefObject<T>.current`. */\ntype ElementAccessor = () => HTMLElement | null;\n\nlet dropTargets = new Map<Element, DropTarget>();\nlet dropItems = new Map<Element, DroppableItem>();\nlet dragSession: DragSession | null = null;\n\n// Reactive mirror of `dragSession` for `createDragSession()`. Solid's signal is\n// the notification mechanism, replacing upstream's `subscriptions` Set.\nconst [trackedDragSession, setTrackedDragSession] = createSignal<DragSession | null>(null);\n\ninterface DropTarget {\n element: HTMLElement;\n preventFocusOnDrop?: boolean;\n getDropOperation?: (types: Set<string>, allowedOperations: DropOperation[]) => DropOperation;\n onDropEnter?: (e: DropEnterEvent, dragTarget: DragTarget) => void;\n onDropExit?: (e: DropExitEvent) => void;\n onDropTargetEnter?: (target: DroppableCollectionTarget | null) => void;\n onDropActivate?: (e: DropActivateEvent, target: DroppableCollectionTarget | null) => void;\n onDrop?: (e: DropEvent, target: DroppableCollectionTarget | null) => void;\n onKeyDown?: (e: KeyboardEvent, dragTarget: DragTarget) => void;\n activateButtonRef?: ElementAccessor;\n}\n\nexport function registerDropTarget(target: DropTarget): () => void {\n dropTargets.set(target.element, target);\n dragSession?.updateValidDropTargets();\n return (): void => {\n dropTargets.delete(target.element);\n dragSession?.updateValidDropTargets();\n };\n}\n\ninterface DroppableItem {\n element: HTMLElement;\n target: DroppableCollectionTarget;\n getDropOperation?: (types: Set<string>, allowedOperations: DropOperation[]) => DropOperation;\n activateButtonRef?: ElementAccessor;\n}\n\nexport function registerDropItem(item: DroppableItem): () => void {\n dropItems.set(item.element, item);\n return (): void => {\n dropItems.delete(item.element);\n };\n}\n\ninterface DragTarget {\n element: HTMLElement;\n items: DragItem[];\n allowedDropOperations: DropOperation[];\n onDragEnd?: (e: DragEndEvent) => void;\n}\n\nexport function beginDragging(target: DragTarget, stringFormatter: LocalizedStringFormatter): void {\n if (dragSession) {\n throw new Error(\"Cannot begin dragging while already dragging\");\n }\n\n dragSession = new DragSession(target, stringFormatter);\n setTrackedDragSession(dragSession);\n requestAnimationFrame(() => {\n if (dragSession) {\n dragSession.setup();\n if (getDragModality() === \"keyboard\") {\n dragSession.next();\n }\n }\n });\n}\n\n/** Reactive accessor for the active drag session, or null. */\nexport function createDragSession(): Accessor<DragSession | null> {\n return trackedDragSession;\n}\n\n/** @private */\nexport function isVirtualDragging(): boolean {\n return !!dragSession;\n}\n\nfunction endDragging() {\n dragSession = null;\n setTrackedDragSession(null);\n}\n\nexport function isValidDropTarget(element: Element): boolean {\n for (let target of dropTargets.keys()) {\n if (nodeContains(target, element)) {\n return true;\n }\n }\n\n return false;\n}\n\nconst CANCELED_EVENTS = [\n \"pointerdown\",\n \"pointermove\",\n \"pointerenter\",\n \"pointerleave\",\n \"pointerover\",\n \"pointerout\",\n \"pointerup\",\n \"mousedown\",\n \"mousemove\",\n \"mouseenter\",\n \"mouseleave\",\n \"mouseover\",\n \"mouseout\",\n \"mouseup\",\n \"touchstart\",\n \"touchmove\",\n \"touchend\",\n \"focusin\",\n \"focusout\",\n];\n\nconst CLICK_EVENTS = [\"pointerup\", \"mouseup\", \"touchend\"];\n\nconst MESSAGES = {\n keyboard: \"dragStartedKeyboard\",\n touch: \"dragStartedTouch\",\n virtual: \"dragStartedVirtual\",\n};\n\nclass DragSession {\n dragTarget: DragTarget;\n validDropTargets: DropTarget[] = [];\n currentDropTarget: DropTarget | null = null;\n currentDropItem: DroppableItem | null = null;\n dropOperation: DropOperation | null = null;\n private mutationObserver: MutationObserver | null = null;\n private restoreAriaHidden: (() => void) | null = null;\n private stringFormatter: LocalizedStringFormatter;\n private isVirtualClick: boolean = false;\n private initialFocused: boolean;\n\n constructor(target: DragTarget, stringFormatter: LocalizedStringFormatter) {\n this.dragTarget = target;\n this.stringFormatter = stringFormatter;\n\n this.onKeyDown = this.onKeyDown.bind(this);\n this.onKeyUp = this.onKeyUp.bind(this);\n this.onFocus = this.onFocus.bind(this);\n this.onBlur = this.onBlur.bind(this);\n this.onClick = this.onClick.bind(this);\n this.onPointerDown = this.onPointerDown.bind(this);\n this.cancelEvent = this.cancelEvent.bind(this);\n this.initialFocused = false;\n }\n\n setup(): void {\n document.addEventListener(\"keydown\", this.onKeyDown, true);\n document.addEventListener(\"keyup\", this.onKeyUp, true);\n window.addEventListener(\"focus\", this.onFocus, true);\n window.addEventListener(\"blur\", this.onBlur, true);\n document.addEventListener(\"click\", this.onClick, true);\n document.addEventListener(\"pointerdown\", this.onPointerDown, true);\n\n for (let event of CANCELED_EVENTS) {\n document.addEventListener(event, this.cancelEvent, true);\n }\n\n this.mutationObserver = new MutationObserver(() => this.updateValidDropTargets());\n this.updateValidDropTargets();\n\n announce(this.stringFormatter.format(MESSAGES[getDragModality() as keyof typeof MESSAGES]));\n }\n\n teardown(): void {\n document.removeEventListener(\"keydown\", this.onKeyDown, true);\n document.removeEventListener(\"keyup\", this.onKeyUp, true);\n window.removeEventListener(\"focus\", this.onFocus, true);\n window.removeEventListener(\"blur\", this.onBlur, true);\n document.removeEventListener(\"click\", this.onClick, true);\n document.removeEventListener(\"pointerdown\", this.onPointerDown, true);\n\n for (let event of CANCELED_EVENTS) {\n document.removeEventListener(event, this.cancelEvent, true);\n }\n\n this.mutationObserver?.disconnect();\n this.restoreAriaHidden?.();\n }\n\n onKeyDown(e: KeyboardEvent): void {\n this.cancelEvent(e);\n\n if (e.key === \"Escape\") {\n this.cancel();\n return;\n }\n\n if (e.key === \"Tab\" && !(e.metaKey || e.altKey || e.ctrlKey)) {\n if (e.shiftKey) {\n this.previous();\n } else {\n this.next();\n }\n }\n\n if (typeof this.currentDropTarget?.onKeyDown === \"function\") {\n this.currentDropTarget.onKeyDown(e, this.dragTarget);\n }\n }\n\n onKeyUp(e: KeyboardEvent): void {\n this.cancelEvent(e);\n\n if (e.key === \"Enter\") {\n if (e.altKey || nodeContains(this.getCurrentActivateButton(), getEventTarget<Node>(e))) {\n this.activate(this.currentDropTarget, this.currentDropItem);\n } else {\n this.drop();\n }\n }\n }\n\n getCurrentActivateButton(): HTMLElement | null {\n return (\n this.currentDropItem?.activateButtonRef?.() ??\n this.currentDropTarget?.activateButtonRef?.() ??\n null\n );\n }\n\n onFocus(e: FocusEvent): void {\n let activateButton = this.getCurrentActivateButton();\n let eventTarget = getEventTarget<HTMLElement>(e);\n if (eventTarget === activateButton) {\n // TODO: canceling this breaks the focus ring. Revisit when we support tabbing.\n this.cancelEvent(e);\n return;\n }\n\n // Prevent focus events, except to the original drag target.\n if (eventTarget !== this.dragTarget.element) {\n this.cancelEvent(e);\n }\n\n // Ignore focus events on the window/document (JSDOM). Will be handled in onBlur, below.\n if (!(eventTarget instanceof HTMLElement) || eventTarget === this.dragTarget.element) {\n return;\n }\n\n let dropTarget =\n this.validDropTargets.find((target) => target.element === eventTarget) ||\n this.validDropTargets.find((target) => nodeContains(target.element, eventTarget));\n\n if (!dropTarget) {\n if (this.currentDropTarget) {\n this.currentDropTarget.element.focus();\n } else {\n this.dragTarget.element.focus();\n }\n return;\n }\n\n let item = dropItems.get(eventTarget);\n if (dropTarget) {\n this.setCurrentDropTarget(dropTarget, item);\n }\n }\n\n onBlur(e: FocusEvent): void {\n let activateButton = this.getCurrentActivateButton();\n // Guard activateButton non-null so this doesn't trip on the case where\n // there's no activate button and the focused element loses focus to nothing\n // (browsers and jsdom 26+ both set relatedTarget to null in that case).\n if (activateButton && e.relatedTarget === activateButton) {\n this.cancelEvent(e);\n return;\n }\n\n if (getEventTarget(e) !== this.dragTarget.element) {\n this.cancelEvent(e);\n }\n\n // If nothing is gaining focus, or e.relatedTarget is the window/document (JSDOM),\n // restore focus back to the current drop target if any, or the original drag target.\n if (!e.relatedTarget || !(e.relatedTarget instanceof HTMLElement)) {\n if (this.currentDropTarget) {\n this.currentDropTarget.element.focus();\n } else {\n this.dragTarget.element.focus();\n }\n }\n }\n\n onClick(e: MouseEvent): void {\n this.cancelEvent(e);\n if (isVirtualClick(e) || this.isVirtualClick) {\n let dropElements = dropItems.values();\n let eventTarget = getEventTarget<HTMLElement>(e);\n let item = [...dropElements].find(\n (item) =>\n item.element === eventTarget ||\n nodeContains(item.activateButtonRef?.() ?? null, eventTarget),\n );\n let dropTarget = this.validDropTargets.find((target) =>\n nodeContains(target.element, eventTarget),\n );\n let activateButton = item?.activateButtonRef?.() ?? dropTarget?.activateButtonRef?.() ?? null;\n if (nodeContains(activateButton, eventTarget) && dropTarget) {\n this.activate(dropTarget, item);\n return;\n }\n\n if (getEventTarget(e) === this.dragTarget.element) {\n this.cancel();\n return;\n }\n\n if (dropTarget) {\n this.setCurrentDropTarget(dropTarget, item);\n this.drop(item);\n }\n }\n }\n\n onPointerDown(e: PointerEvent): void {\n // Android Talkback double tap has e.detail = 1 for onClick. Detect the virtual click in onPointerDown before onClick fires\n // so we can properly perform cancel and drop operations.\n this.cancelEvent(e);\n this.isVirtualClick = isVirtualPointerEvent(e);\n }\n\n cancelEvent(e: Event): void {\n // Allow focusin and focusout on the drag target so focus ring works properly.\n let eventTarget = getEventTarget(e);\n if (\n (e.type === \"focusin\" || e.type === \"focusout\") &&\n (eventTarget === this.dragTarget?.element || eventTarget === this.getCurrentActivateButton())\n ) {\n return;\n }\n\n // Allow default for events that might cancel a click event\n if (!CLICK_EVENTS.includes(e.type)) {\n e.preventDefault();\n }\n\n e.stopPropagation();\n e.stopImmediatePropagation();\n }\n\n updateValidDropTargets(): void {\n if (!this.mutationObserver) {\n return;\n }\n\n this.mutationObserver.disconnect();\n if (this.restoreAriaHidden) {\n this.restoreAriaHidden();\n }\n\n this.validDropTargets = findValidDropTargets(this.dragTarget);\n\n // Shuffle drop target order based on starting drag target.\n if (this.validDropTargets.length > 0) {\n let nearestIndex = this.findNearestDropTarget();\n this.validDropTargets = [\n ...this.validDropTargets.slice(nearestIndex),\n ...this.validDropTargets.slice(0, nearestIndex),\n ];\n }\n\n if (this.currentDropTarget && !this.validDropTargets.includes(this.currentDropTarget)) {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n }\n\n // Find valid drop items within collections\n let types = getTypes(this.dragTarget.items);\n let validDropItems = [...dropItems.values()].filter((item) => {\n if (typeof item.getDropOperation === \"function\") {\n return item.getDropOperation(types, this.dragTarget.allowedDropOperations) !== \"cancel\";\n }\n\n return true;\n });\n\n // Filter out drop targets that contain valid items. We don't want to stop hiding elements\n // other than the drop items that exist inside the collection.\n let visibleDropTargets = this.validDropTargets.filter(\n (target) => !validDropItems.some((item) => nodeContains(target.element, item.element)),\n );\n\n this.restoreAriaHidden = ariaHideOutside(\n [\n this.dragTarget.element,\n ...validDropItems.flatMap((item) => {\n let button = item.activateButtonRef?.();\n return button ? [item.element, button] : [item.element];\n }),\n ...visibleDropTargets.flatMap((target) => {\n let button = target.activateButtonRef?.();\n return button ? [target.element, button] : [target.element];\n }),\n ],\n { shouldUseInert: true },\n );\n\n this.mutationObserver.observe(document.body, {\n subtree: true,\n attributes: true,\n attributeFilter: [\"aria-hidden\", \"inert\"],\n });\n }\n\n next(): void {\n // TODO: Allow tabbing to the activate button. Revisit once we fix the focus ring.\n // For now, the activate button is reachable by screen readers and ArrowLeft/ArrowRight\n // is usable specifically by Tree. Will need tabbing for other components.\n\n if (!this.currentDropTarget) {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n return;\n }\n\n let index = this.validDropTargets.indexOf(this.currentDropTarget);\n if (index < 0) {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n return;\n }\n\n // If we've reached the end of the valid drop targets, cycle back to the original drag target.\n // This lets the user cancel the drag in case they don't have an Escape key (e.g. iPad keyboard case).\n if (index === this.validDropTargets.length - 1) {\n if (!this.dragTarget.element.closest('[aria-hidden=\"true\"], [inert]')) {\n this.setCurrentDropTarget(null);\n this.dragTarget.element.focus();\n } else {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n }\n } else {\n this.setCurrentDropTarget(this.validDropTargets[index + 1]);\n }\n }\n\n previous(): void {\n if (!this.currentDropTarget) {\n this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);\n return;\n }\n\n let index = this.validDropTargets.indexOf(this.currentDropTarget);\n if (index < 0) {\n this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);\n return;\n }\n\n // If we've reached the start of the valid drop targets, cycle back to the original drag target.\n // This lets the user cancel the drag in case they don't have an Escape key (e.g. iPad keyboard case).\n if (index === 0) {\n if (!this.dragTarget.element.closest('[aria-hidden=\"true\"], [inert]')) {\n this.setCurrentDropTarget(null);\n this.dragTarget.element.focus();\n } else {\n this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);\n }\n } else {\n this.setCurrentDropTarget(this.validDropTargets[index - 1]);\n }\n }\n\n findNearestDropTarget(): number {\n let dragTargetRect = this.dragTarget.element.getBoundingClientRect();\n\n let minDistance = Infinity;\n let nearest = -1;\n for (let i = 0; i < this.validDropTargets.length; i++) {\n let dropTarget = this.validDropTargets[i];\n let rect = dropTarget.element.getBoundingClientRect();\n let dx = rect.left - dragTargetRect.left;\n let dy = rect.top - dragTargetRect.top;\n let dist = dx * dx + dy * dy;\n if (dist < minDistance) {\n minDistance = dist;\n nearest = i;\n }\n }\n\n return nearest;\n }\n\n setCurrentDropTarget(dropTarget: DropTarget | null, item?: DroppableItem): void {\n if (dropTarget !== this.currentDropTarget) {\n if (this.currentDropTarget && typeof this.currentDropTarget.onDropExit === \"function\") {\n let rect = this.currentDropTarget.element.getBoundingClientRect();\n this.currentDropTarget.onDropExit({\n type: \"dropexit\",\n x: rect.left + rect.width / 2,\n y: rect.top + rect.height / 2,\n });\n }\n\n this.currentDropTarget = dropTarget;\n\n if (dropTarget) {\n if (typeof dropTarget.onDropEnter === \"function\") {\n let rect = dropTarget.element.getBoundingClientRect();\n dropTarget.onDropEnter(\n {\n type: \"dropenter\",\n x: rect.left + rect.width / 2,\n y: rect.top + rect.height / 2,\n },\n this.dragTarget,\n );\n }\n\n if (!item) {\n dropTarget?.element.focus();\n }\n }\n }\n\n if (item != null && item !== this.currentDropItem) {\n if (\n this.currentDropTarget &&\n typeof this.currentDropTarget.onDropTargetEnter === \"function\"\n ) {\n this.currentDropTarget.onDropTargetEnter(item.target);\n }\n item.element.focus();\n this.currentDropItem = item;\n\n // Announce first drop target after drag start announcement finishes.\n // Otherwise, it will never get announced because drag start announcement is assertive.\n if (!this.initialFocused) {\n let label = item?.element.getAttribute(\"aria-label\");\n if (label) {\n announce(label, \"polite\");\n }\n this.initialFocused = true;\n }\n }\n }\n\n end(): void {\n this.teardown();\n endDragging();\n\n if (typeof this.dragTarget.onDragEnd === \"function\") {\n let target =\n this.currentDropTarget && this.dropOperation !== \"cancel\"\n ? this.currentDropTarget\n : this.dragTarget;\n let rect = target.element.getBoundingClientRect();\n this.dragTarget.onDragEnd({\n type: \"dragend\",\n x: rect.x + rect.width / 2,\n y: rect.y + rect.height / 2,\n dropOperation: this.dropOperation || \"cancel\",\n });\n }\n\n if (this.currentDropTarget && !this.currentDropTarget.preventFocusOnDrop) {\n // Re-trigger focus event on active element, since it will not have received it during dragging (see cancelEvent).\n // This corrects state such as whether focus ring should appear.\n // useDroppableCollection handles this itself, so this is only for standalone drop zones.\n getActiveElement()?.dispatchEvent(new FocusEvent(\"focusin\", { bubbles: true }));\n }\n\n this.setCurrentDropTarget(null);\n }\n\n cancel(): void {\n this.setCurrentDropTarget(null);\n this.end();\n if (!this.dragTarget.element.closest('[aria-hidden=\"true\"], [inert]')) {\n this.dragTarget.element.focus();\n }\n\n // Re-trigger focus event on active element, since it will not have received it during dragging (see cancelEvent).\n getActiveElement()?.dispatchEvent(new FocusEvent(\"focusin\", { bubbles: true }));\n\n announce(this.stringFormatter.format(\"dropCanceled\"));\n }\n\n drop(item?: DroppableItem): void {\n if (!this.currentDropTarget) {\n this.cancel();\n return;\n }\n\n if (typeof item?.getDropOperation === \"function\") {\n let types = getTypes(this.dragTarget.items);\n this.dropOperation = item.getDropOperation(types, this.dragTarget.allowedDropOperations);\n } else if (typeof this.currentDropTarget.getDropOperation === \"function\") {\n let types = getTypes(this.dragTarget.items);\n this.dropOperation = this.currentDropTarget.getDropOperation(\n types,\n this.dragTarget.allowedDropOperations,\n );\n } else {\n // TODO: show menu ??\n this.dropOperation = this.dragTarget.allowedDropOperations[0];\n }\n\n if (typeof this.currentDropTarget.onDrop === \"function\") {\n let items: DropItem[] = this.dragTarget.items.map((item) => ({\n kind: \"text\",\n types: new Set(Object.keys(item)),\n getText: (type: string) => Promise.resolve(item[type]),\n }));\n\n let rect = this.currentDropTarget.element.getBoundingClientRect();\n this.currentDropTarget.onDrop(\n {\n type: \"drop\",\n x: rect.left + rect.width / 2,\n y: rect.top + rect.height / 2,\n items,\n dropOperation: this.dropOperation,\n },\n item?.target ?? null,\n );\n }\n\n this.end();\n announce(this.stringFormatter.format(\"dropComplete\"));\n }\n\n activate(dropTarget: DropTarget | null, dropItem: DroppableItem | null | undefined): void {\n if (dropTarget && typeof dropTarget.onDropActivate === \"function\") {\n let target = dropItem?.target ?? null;\n let rect = dropTarget.element.getBoundingClientRect();\n dropTarget.onDropActivate(\n {\n type: \"dropactivate\",\n x: rect.left + rect.width / 2,\n y: rect.top + rect.height / 2,\n },\n target,\n );\n }\n }\n}\n\nfunction findValidDropTargets(options: DragTarget): DropTarget[] {\n let types = getTypes(options.items);\n return [...dropTargets.values()].filter((target) => {\n if (target.element.closest('[aria-hidden=\"true\"], [inert]')) {\n return false;\n }\n\n if (typeof target.getDropOperation === \"function\") {\n return target.getDropOperation(types, options.allowedDropOperations) !== \"cancel\";\n }\n\n return true;\n });\n}\n\nexport type { DragTarget, DropTarget, DroppableItem, DragSession };\n"],"mappings":";;;;;;;;AAiBA,MAAa,oBAAiC,IAAI,IAAI;CAAC;CAAc;CAAiB;AAAW,CAAC;AAGlG,MAAa,mBAAmB;AAGhC,MAAa,eAAe;AAG5B,IAAY,iBAAL,yBAAA,gBAAA;CACL,eAAA,eAAA,UAAA,KAAA;CACA,eAAA,eAAA,YAAA,KAAA;CACA,eAAA,eAAA,UAAA,KAAA;CACA,eAAA,eAAA,UAAA,KAAA;CACA,eAAA,eAAA,UAAA,KAAA;CACA,eAAA,eAAA,SAAA,KAAA;;AACF,EAAA,CAAA,CAAA;AAGA,MAAa,yBAAiD;CAC5D,MAAA;CACA,MAAA;CACA,UAAU;CACV,UAAU;CACV,MAAA;CACA,UAAU;CACV,MAAA;CACA,KAAA;CACA,eAAA;AACF;AAGA,MAAa,iBAAyC;MAC7B;MACA;MACA;EACtB,IAA4C;MACtB;EACtB,IAA4C;EAC5C,IAA4C;MACvB;AACxB;AAGA,MAAa,gCAA+D;CAC1E,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;AACR;AAGA,MAAa,gCAA+D;CAC1E,QAAQ;CACR,MAAM;CACN,MAAM;CACN,MAAM;AACR;;;;;;;AAQA,SAAS,YAAY,UAAiC;CACpD,IAAI,CAAC,UACH,WAAW;CAGb,IAAI,aAAa,WACf,WAAW;CAGb,IACE,aAAa,aACb,OAAO,WAAW,eAClB,OAAO,OAAO,eAAe,cAC7B,OAAO,WAAW,mBAAmB,CAAC,CAAC,SAEvC,WAAW;CAGb,OAAO;AACT;;;;;AAMA,SAAgB,kBAA0B;CACxC,OAAO,YAAY,u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,GAAG,KAAK,OAAO,KAAK,QAAQ;IAC5B,GAAG,KAAK,MAAM,KAAK,SAAS;IAC5B;IACA,eAAe,KAAK;GACtB,GACA,MAAM,UAAU,IAClB;EACF;EAEA,KAAK,IAAI;EACT,SAAS,KAAK,gBAAgB,OAAO,cAAc,CAAC;CACtD;CAEA,SAAS,YAA+B,UAAkD;EACxF,IAAI,cAAc,OAAO,WAAW,mBAAmB,YAAY;GACjE,IAAI,SAAS,UAAU,UAAU;GACjC,IAAI,OAAO,WAAW,QAAQ,sBAAsB;GACpD,WAAW,eACT;IACE,MAAM;IACN,GAAG,KAAK,OAAO,KAAK,QAAQ;IAC5B,GAAG,KAAK,MAAM,KAAK,SAAS;GAC9B,GACA,MACF;EACF;CACF;AACF;AAEA,SAAS,qBAAqB,SAAmC;CAC/D,IAAI,QAAQ,SAAS,QAAQ,KAAK;CAClC,OAAO,CAAC,GAAG,YAAY,OAAO,CAAC,CAAC,CAAC,QAAQ,WAAW;EAClD,IAAI,OAAO,QAAQ,QAAQ,iCAA+B,GACxD,OAAO;EAGT,IAAI,OAAO,OAAO,qBAAqB,YACrC,OAAO,OAAO,iBAAiB,OAAO,QAAQ,qBAAqB,MAAM;EAG3E,OAAO;CACT,CAAC;AACH"}
1
+ {"version":3,"file":"DragManager.js","names":[],"sources":["../../src/dnd/utils.ts","../../src/dnd/DragManager.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria/src/dnd/constants.ts\n// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria/src/dnd/utils.ts\n\n/**\n * Drag and Drop utilities for solidaria.\n *\n * Ported from:\n * - packages/react-aria/src/dnd/constants.ts\n * - packages/react-aria/src/dnd/utils.ts\n */\n\nimport type {\n DragItem,\n DragType,\n DropItem,\n TextDropItem,\n FileDropItem,\n DirectoryDropItem,\n DropOperation,\n} from \"@proyecto-viviana/solid-stately\";\nimport { DIRECTORY_DRAG_TYPE } from \"@proyecto-viviana/solid-stately\";\nimport { getInteractionModality } from \"../interactions\";\n\n// Native drag types that can be transferred between applications\nexport const NATIVE_DRAG_TYPES: Set<string> = new Set([\"text/plain\", \"text/uri-list\", \"text/html\"]);\n\n// Custom drag type for serializing multiple items\nexport const CUSTOM_DRAG_TYPE = \"application/vnd.solidaria.items+json\";\n\n// Generic type for unknown file types\nexport const GENERIC_TYPE = \"application/octet-stream\";\n\n// Drop operation bit flags\nexport enum DROP_OPERATION {\n none = 0,\n cancel = 0,\n move = 1 << 0,\n copy = 1 << 1,\n link = 1 << 2,\n all = (1 << 0) | (1 << 1) | (1 << 2),\n}\n\n// Map from effectAllowed to DROP_OPERATION\nexport const DROP_OPERATION_ALLOWED: Record<string, number> = {\n none: DROP_OPERATION.none,\n copy: DROP_OPERATION.copy,\n copyLink: DROP_OPERATION.copy | DROP_OPERATION.link,\n copyMove: DROP_OPERATION.copy | DROP_OPERATION.move,\n link: DROP_OPERATION.link,\n linkMove: DROP_OPERATION.link | DROP_OPERATION.move,\n move: DROP_OPERATION.move,\n all: DROP_OPERATION.all,\n uninitialized: DROP_OPERATION.all,\n};\n\n// Map from DROP_OPERATION to effectAllowed\nexport const EFFECT_ALLOWED: Record<number, string> = {\n [DROP_OPERATION.none]: \"none\",\n [DROP_OPERATION.move]: \"move\",\n [DROP_OPERATION.copy]: \"copy\",\n [DROP_OPERATION.copy | DROP_OPERATION.move]: \"copyMove\",\n [DROP_OPERATION.link]: \"link\",\n [DROP_OPERATION.link | DROP_OPERATION.move]: \"linkMove\",\n [DROP_OPERATION.copy | DROP_OPERATION.link]: \"copyLink\",\n [DROP_OPERATION.all]: \"all\",\n};\n\n// Map from dropEffect to DropOperation\nexport const DROP_EFFECT_TO_DROP_OPERATION: Record<string, DropOperation> = {\n none: \"cancel\",\n link: \"link\",\n copy: \"copy\",\n move: \"move\",\n};\n\n// Map from DropOperation to dropEffect\nexport const DROP_OPERATION_TO_DROP_EFFECT: Record<DropOperation, string> = {\n cancel: \"none\",\n link: \"link\",\n copy: \"copy\",\n move: \"move\",\n};\n\n/**\n * Maps the current interaction modality onto the drag modality used for\n * announcements and descriptions. Mirrors @react-aria/dnd `mapModality`:\n * pointer collapses to virtual, and a virtual modality on a coarse pointer\n * (touch screen reader) becomes touch.\n */\nfunction mapModality(modality: string | null): string {\n if (!modality) {\n modality = \"virtual\";\n }\n\n if (modality === \"pointer\") {\n modality = \"virtual\";\n }\n\n if (\n modality === \"virtual\" &&\n typeof window !== \"undefined\" &&\n typeof window.matchMedia === \"function\" &&\n window.matchMedia(\"(pointer: coarse)\").matches\n ) {\n modality = \"touch\";\n }\n\n return modality;\n}\n\n/**\n * Returns the drag modality ('keyboard' | 'virtual' | 'touch') for the current\n * interaction. Mirrors @react-aria/dnd `getDragModality`.\n */\nexport function getDragModality(): string {\n return mapModality(getInteractionModality());\n}\n\n/**\n * Get the types present in drag items.\n */\nexport function getTypes(items: DragItem[]): Set<string> {\n const types = new Set<string>();\n for (const item of items) {\n for (const type of Object.keys(item)) {\n types.add(type);\n }\n }\n return types;\n}\n\n/**\n * Write drag items to a DataTransfer object.\n */\nexport function writeToDataTransfer(dataTransfer: DataTransfer, items: DragItem[]): void {\n const groupedByType = new Map<string, string[]>();\n let needsCustomData = false;\n const customData: object[] = [];\n\n for (const item of items) {\n const types = Object.keys(item);\n if (types.length > 1) {\n needsCustomData = true;\n }\n\n const dataByType: Record<string, string> = {};\n for (const type of types) {\n let typeItems = groupedByType.get(type);\n if (!typeItems) {\n typeItems = [];\n groupedByType.set(type, typeItems);\n } else {\n needsCustomData = true;\n }\n\n const data = item[type];\n dataByType[type] = data;\n typeItems.push(data);\n }\n\n customData.push(dataByType);\n }\n\n for (const [type, typeItems] of groupedByType) {\n if (NATIVE_DRAG_TYPES.has(type)) {\n // Join all items of this type with newlines\n const data = typeItems.join(\"\\n\");\n dataTransfer.items.add(data, type);\n } else {\n // Set first item for non-native types\n dataTransfer.items.add(typeItems[0], type);\n }\n }\n\n if (needsCustomData) {\n const data = JSON.stringify(customData);\n dataTransfer.items.add(data, CUSTOM_DRAG_TYPE);\n }\n}\n\n/**\n * Read drop items from a DataTransfer object.\n */\nexport function readFromDataTransfer(dataTransfer: DataTransfer): DropItem[] {\n const items: DropItem[] = [];\n\n if (!dataTransfer) {\n return items;\n }\n\n // Check for custom drag type first\n let hasCustomType = false;\n if (dataTransfer.types.includes(CUSTOM_DRAG_TYPE)) {\n try {\n const data = dataTransfer.getData(CUSTOM_DRAG_TYPE);\n const parsed = JSON.parse(data);\n for (const item of parsed) {\n items.push({\n kind: \"text\",\n types: new Set(Object.keys(item)),\n getText: (type) => Promise.resolve(item[type]),\n });\n }\n hasCustomType = true;\n } catch {\n // ignore parsing errors\n }\n }\n\n // Fall back to native items\n if (!hasCustomType) {\n const stringItems = new Map<string, string>();\n\n for (const item of dataTransfer.items) {\n if (item.kind === \"string\") {\n const type = item.type || GENERIC_TYPE;\n stringItems.set(type, dataTransfer.getData(item.type));\n } else if (item.kind === \"file\") {\n const file = item.getAsFile();\n if (file) {\n items.push(createFileItem(file));\n }\n }\n }\n\n if (stringItems.size > 0) {\n items.push({\n kind: \"text\",\n types: new Set(stringItems.keys()),\n getText: (type) => Promise.resolve(stringItems.get(type) ?? \"\"),\n });\n }\n }\n\n return items;\n}\n\n/**\n * Create a FileDropItem from a File object.\n */\nfunction createFileItem(file: File): FileDropItem {\n return {\n kind: \"file\",\n type: file.type || GENERIC_TYPE,\n name: file.name,\n getText: () => file.text(),\n getFile: () => Promise.resolve(file),\n };\n}\n\n/**\n * DragTypes implementation for checking drag types.\n */\nexport class DragTypesImpl {\n private types: Set<string>;\n private includesUnknownTypes: boolean;\n\n constructor(dataTransfer: DataTransfer) {\n this.types = new Set<string>();\n let hasFiles = false;\n\n for (const item of dataTransfer.items) {\n if (item.type !== CUSTOM_DRAG_TYPE) {\n if (item.kind === \"file\") {\n hasFiles = true;\n }\n if (item.type) {\n this.types.add(item.type);\n } else {\n this.types.add(GENERIC_TYPE);\n }\n }\n }\n\n // Safari doesn't expose file types until drop\n this.includesUnknownTypes = !hasFiles && dataTransfer.types.includes(\"Files\");\n }\n\n has(type: DragType | DragType[]): boolean {\n if (Array.isArray(type)) {\n return type.some((t) => this.has(t));\n }\n\n if (\n this.includesUnknownTypes ||\n (type === DIRECTORY_DRAG_TYPE && this.types.has(GENERIC_TYPE)) ||\n type === \"*/*\"\n ) {\n return true;\n }\n\n if (typeof type === \"string\") {\n // Wildcard MIME match, e.g. \"image/*\" accepts \"image/png\".\n if (type.endsWith(\"/*\")) {\n for (const key of this.types) {\n if (key.startsWith(type.slice(0, -2))) {\n return true;\n }\n }\n return false;\n }\n return this.types.has(type);\n }\n\n return false;\n }\n}\n\n/**\n * Check if a drop item is a text item.\n */\nexport function isTextDropItem(dropItem: DropItem): dropItem is TextDropItem {\n return dropItem.kind === \"text\";\n}\n\n/**\n * Check if a drop item is a file item.\n */\nexport function isFileDropItem(dropItem: DropItem): dropItem is FileDropItem {\n return dropItem.kind === \"file\";\n}\n\n/**\n * Check if a drop item is a directory item.\n */\nexport function isDirectoryDropItem(dropItem: DropItem): dropItem is DirectoryDropItem {\n return dropItem.kind === \"directory\";\n}\n\n// Global state for tracking drag operations\nlet globalDropEffect: string | undefined;\nlet globalAllowedDropOperations: number = DROP_OPERATION.none;\n\nexport function setGlobalDropEffect(effect: string | undefined): void {\n globalDropEffect = effect;\n}\n\nexport function getGlobalDropEffect(): string | undefined {\n return globalDropEffect;\n}\n\nexport function setGlobalAllowedDropOperations(ops: number): void {\n globalAllowedDropOperations = ops;\n}\n\nexport function getGlobalAllowedDropOperations(): number {\n return globalAllowedDropOperations;\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Ported to SolidJS for Proyecto Viviana; based on packages/react-aria/src/dnd/DragManager.ts\n\n/**\n * Global keyboard/virtual drag session manager.\n *\n * Faithful port of @react-aria/dnd `DragManager` (react-aria 3.50). A single\n * module-level singleton owns the active drag session: it registers drop targets\n * and drop items across every collection on the page, drives Tab/Shift+Tab\n * cycling between them, Enter-to-drop / Escape-to-cancel, and the aria-live\n * announcements — providing the accessible keyboard alternative to native\n * pointer drag and drop.\n *\n * The only framework-specific adaptation from upstream is the reactive\n * subscription: React's `useDragSession` (useState + a subscription Set) becomes\n * a module-level Solid signal exposed through `createDragSession()`. Element refs\n * (upstream `RefObject.current`) become Solid element accessors (`() => el`).\n */\n\nimport { createSignal } from \"solid-js\";\nimport type { Accessor } from \"solid-js\";\n\nimport { announce } from \"../live-announcer/announce\";\nimport { ariaHideOutside } from \"../overlays/ariaHideOutside\";\nimport type {\n DragEndEvent,\n DragItem,\n DropActivateEvent,\n DropEnterEvent,\n DropEvent,\n DropExitEvent,\n DropItem,\n DropOperation,\n DropTarget as DroppableCollectionTarget,\n} from \"@proyecto-viviana/solid-stately\";\nimport { getActiveElement, getEventTarget, nodeContains } from \"../utils/dom\";\nimport { getDragModality, getTypes } from \"./utils\";\nimport { isVirtualClick, isVirtualPointerEvent } from \"../utils/events\";\nimport type { LocalizedStringFormatter } from \"@internationalized/string\";\n\n/** A Solid element accessor, replacing upstream's `RefObject<T>.current`. */\ntype ElementAccessor = () => HTMLElement | null;\n\nlet dropTargets = new Map<Element, DropTarget>();\nlet dropItems = new Map<Element, DroppableItem>();\nlet dragSession: DragSession | null = null;\n\n// Reactive mirror of `dragSession` for `createDragSession()`. Solid's signal is\n// the notification mechanism, replacing upstream's `subscriptions` Set.\nconst [trackedDragSession, setTrackedDragSession] = createSignal<DragSession | null>(null);\n\ninterface DropTarget {\n element: HTMLElement;\n preventFocusOnDrop?: boolean;\n getDropOperation?: (types: Set<string>, allowedOperations: DropOperation[]) => DropOperation;\n onDropEnter?: (e: DropEnterEvent, dragTarget: DragTarget) => void;\n onDropExit?: (e: DropExitEvent) => void;\n onDropTargetEnter?: (target: DroppableCollectionTarget | null) => void;\n onDropActivate?: (e: DropActivateEvent, target: DroppableCollectionTarget | null) => void;\n onDrop?: (e: DropEvent, target: DroppableCollectionTarget | null) => void;\n onKeyDown?: (e: KeyboardEvent, dragTarget: DragTarget) => void;\n activateButtonRef?: ElementAccessor;\n}\n\nexport function registerDropTarget(target: DropTarget): () => void {\n dropTargets.set(target.element, target);\n dragSession?.updateValidDropTargets();\n return (): void => {\n dropTargets.delete(target.element);\n dragSession?.updateValidDropTargets();\n };\n}\n\ninterface DroppableItem {\n element: HTMLElement;\n target: DroppableCollectionTarget;\n getDropOperation?: (types: Set<string>, allowedOperations: DropOperation[]) => DropOperation;\n activateButtonRef?: ElementAccessor;\n}\n\nexport function registerDropItem(item: DroppableItem): () => void {\n dropItems.set(item.element, item);\n dragSession?.updateValidDropTargets();\n return (): void => {\n dropItems.delete(item.element);\n dragSession?.updateValidDropTargets();\n };\n}\n\ninterface DragTarget {\n element: HTMLElement;\n items: DragItem[];\n allowedDropOperations: DropOperation[];\n onDragEnd?: (e: DragEndEvent) => void;\n}\n\nexport function beginDragging(target: DragTarget, stringFormatter: LocalizedStringFormatter): void {\n if (dragSession) {\n throw new Error(\"Cannot begin dragging while already dragging\");\n }\n\n dragSession = new DragSession(target, stringFormatter);\n setTrackedDragSession(dragSession);\n // Upstream defers setup to a frame so React can commit drop targets. Solid\n // has already flushed those registrations in the signal write above, so the\n // session listens immediately: the drag button is still focused, and a second\n // Enter would otherwise start another drag. The first-target focus waits\n // until this keyup returns. aria-hide blurs the button while\n // currentDropTarget is still null, and onBlur would pull focus back before\n // the insertion indicator's drop target sticks.\n if (dragSession) {\n const session = dragSession;\n session.setup();\n if (getDragModality() === \"keyboard\") {\n queueMicrotask(() => {\n if (dragSession === session) {\n session.next();\n }\n });\n }\n }\n}\n\n/** Reactive accessor for the active drag session, or null. */\nexport function createDragSession(): Accessor<DragSession | null> {\n return trackedDragSession;\n}\n\n/** @private */\nexport function isVirtualDragging(): boolean {\n return !!dragSession;\n}\n\nfunction endDragging() {\n dragSession = null;\n setTrackedDragSession(null);\n}\n\nexport function isValidDropTarget(element: Element): boolean {\n for (let target of dropTargets.keys()) {\n if (nodeContains(target, element)) {\n return true;\n }\n }\n\n return false;\n}\n\nconst CANCELED_EVENTS = [\n \"pointerdown\",\n \"pointermove\",\n \"pointerenter\",\n \"pointerleave\",\n \"pointerover\",\n \"pointerout\",\n \"pointerup\",\n \"mousedown\",\n \"mousemove\",\n \"mouseenter\",\n \"mouseleave\",\n \"mouseover\",\n \"mouseout\",\n \"mouseup\",\n \"touchstart\",\n \"touchmove\",\n \"touchend\",\n \"focusin\",\n \"focusout\",\n];\n\nconst CLICK_EVENTS = [\"pointerup\", \"mouseup\", \"touchend\"];\n\nconst MESSAGES = {\n keyboard: \"dragStartedKeyboard\",\n touch: \"dragStartedTouch\",\n virtual: \"dragStartedVirtual\",\n};\n\nclass DragSession {\n dragTarget: DragTarget;\n validDropTargets: DropTarget[] = [];\n currentDropTarget: DropTarget | null = null;\n currentDropItem: DroppableItem | null = null;\n dropOperation: DropOperation | null = null;\n private mutationObserver: MutationObserver | null = null;\n private restoreAriaHidden: (() => void) | null = null;\n private stringFormatter: LocalizedStringFormatter;\n private isVirtualClick: boolean = false;\n private initialFocused: boolean;\n\n constructor(target: DragTarget, stringFormatter: LocalizedStringFormatter) {\n this.dragTarget = target;\n this.stringFormatter = stringFormatter;\n\n this.onKeyDown = this.onKeyDown.bind(this);\n this.onKeyUp = this.onKeyUp.bind(this);\n this.onFocus = this.onFocus.bind(this);\n this.onBlur = this.onBlur.bind(this);\n this.onClick = this.onClick.bind(this);\n this.onPointerDown = this.onPointerDown.bind(this);\n this.cancelEvent = this.cancelEvent.bind(this);\n this.initialFocused = false;\n }\n\n setup(): void {\n document.addEventListener(\"keydown\", this.onKeyDown, true);\n document.addEventListener(\"keyup\", this.onKeyUp, true);\n window.addEventListener(\"focus\", this.onFocus, true);\n window.addEventListener(\"blur\", this.onBlur, true);\n document.addEventListener(\"click\", this.onClick, true);\n document.addEventListener(\"pointerdown\", this.onPointerDown, true);\n\n for (let event of CANCELED_EVENTS) {\n document.addEventListener(event, this.cancelEvent, true);\n }\n\n this.mutationObserver = new MutationObserver(() => this.updateValidDropTargets());\n this.updateValidDropTargets();\n\n announce(this.stringFormatter.format(MESSAGES[getDragModality() as keyof typeof MESSAGES]));\n }\n\n teardown(): void {\n document.removeEventListener(\"keydown\", this.onKeyDown, true);\n document.removeEventListener(\"keyup\", this.onKeyUp, true);\n window.removeEventListener(\"focus\", this.onFocus, true);\n window.removeEventListener(\"blur\", this.onBlur, true);\n document.removeEventListener(\"click\", this.onClick, true);\n document.removeEventListener(\"pointerdown\", this.onPointerDown, true);\n\n for (let event of CANCELED_EVENTS) {\n document.removeEventListener(event, this.cancelEvent, true);\n }\n\n this.mutationObserver?.disconnect();\n this.restoreAriaHidden?.();\n }\n\n onKeyDown(e: KeyboardEvent): void {\n this.cancelEvent(e);\n\n if (e.key === \"Escape\") {\n this.cancel();\n return;\n }\n\n if (e.key === \"Tab\" && !(e.metaKey || e.altKey || e.ctrlKey)) {\n if (e.shiftKey) {\n this.previous();\n } else {\n this.next();\n }\n }\n\n if (typeof this.currentDropTarget?.onKeyDown === \"function\") {\n this.currentDropTarget.onKeyDown(e, this.dragTarget);\n }\n }\n\n onKeyUp(e: KeyboardEvent): void {\n this.cancelEvent(e);\n\n if (e.key === \"Enter\") {\n if (e.altKey || nodeContains(this.getCurrentActivateButton(), getEventTarget<Node>(e))) {\n this.activate(this.currentDropTarget, this.currentDropItem);\n } else {\n this.drop();\n }\n }\n }\n\n getCurrentActivateButton(): HTMLElement | null {\n return (\n this.currentDropItem?.activateButtonRef?.() ??\n this.currentDropTarget?.activateButtonRef?.() ??\n null\n );\n }\n\n onFocus(e: FocusEvent): void {\n let activateButton = this.getCurrentActivateButton();\n let eventTarget = getEventTarget<HTMLElement>(e);\n if (eventTarget === activateButton) {\n // TODO: canceling this breaks the focus ring. Revisit when we support tabbing.\n this.cancelEvent(e);\n return;\n }\n\n // Prevent focus events, except to the original drag target.\n if (eventTarget !== this.dragTarget.element) {\n this.cancelEvent(e);\n }\n\n // Ignore focus events on the window/document (JSDOM). Will be handled in onBlur, below.\n if (!(eventTarget instanceof HTMLElement) || eventTarget === this.dragTarget.element) {\n return;\n }\n\n let dropTarget =\n this.validDropTargets.find((target) => target.element === eventTarget) ||\n this.validDropTargets.find((target) => nodeContains(target.element, eventTarget));\n\n if (!dropTarget) {\n if (this.currentDropTarget) {\n this.currentDropTarget.element.focus();\n } else {\n this.dragTarget.element.focus();\n }\n return;\n }\n\n let item = dropItems.get(eventTarget);\n if (dropTarget) {\n this.setCurrentDropTarget(dropTarget, item);\n }\n }\n\n onBlur(e: FocusEvent): void {\n let activateButton = this.getCurrentActivateButton();\n // Guard activateButton non-null so this doesn't trip on the case where\n // there's no activate button and the focused element loses focus to nothing\n // (browsers and jsdom 26+ both set relatedTarget to null in that case).\n if (activateButton && e.relatedTarget === activateButton) {\n this.cancelEvent(e);\n return;\n }\n\n if (getEventTarget(e) !== this.dragTarget.element) {\n this.cancelEvent(e);\n }\n\n // If nothing is gaining focus, or e.relatedTarget is the window/document (JSDOM),\n // restore focus back to the current drop target if any, or the original drag target.\n if (!e.relatedTarget || !(e.relatedTarget instanceof HTMLElement)) {\n if (this.currentDropTarget) {\n this.currentDropTarget.element.focus();\n } else {\n this.dragTarget.element.focus();\n }\n }\n }\n\n onClick(e: MouseEvent): void {\n this.cancelEvent(e);\n if (isVirtualClick(e) || this.isVirtualClick) {\n let dropElements = dropItems.values();\n let eventTarget = getEventTarget<HTMLElement>(e);\n let item = [...dropElements].find(\n (item) =>\n item.element === eventTarget ||\n nodeContains(item.activateButtonRef?.() ?? null, eventTarget),\n );\n let dropTarget = this.validDropTargets.find((target) =>\n nodeContains(target.element, eventTarget),\n );\n let activateButton = item?.activateButtonRef?.() ?? dropTarget?.activateButtonRef?.() ?? null;\n if (nodeContains(activateButton, eventTarget) && dropTarget) {\n this.activate(dropTarget, item);\n return;\n }\n\n if (getEventTarget(e) === this.dragTarget.element) {\n this.cancel();\n return;\n }\n\n if (dropTarget) {\n this.setCurrentDropTarget(dropTarget, item);\n this.drop(item);\n }\n }\n }\n\n onPointerDown(e: PointerEvent): void {\n // Android Talkback double tap has e.detail = 1 for onClick. Detect the virtual click in onPointerDown before onClick fires\n // so we can properly perform cancel and drop operations.\n this.cancelEvent(e);\n this.isVirtualClick = isVirtualPointerEvent(e);\n }\n\n cancelEvent(e: Event): void {\n // Allow focusin and focusout on the drag target so focus ring works properly.\n let eventTarget = getEventTarget(e);\n if (\n (e.type === \"focusin\" || e.type === \"focusout\") &&\n (eventTarget === this.dragTarget?.element || eventTarget === this.getCurrentActivateButton())\n ) {\n return;\n }\n\n // Allow default for events that might cancel a click event\n if (!CLICK_EVENTS.includes(e.type)) {\n e.preventDefault();\n }\n\n e.stopPropagation();\n e.stopImmediatePropagation();\n }\n\n updateValidDropTargets(): void {\n if (!this.mutationObserver) {\n return;\n }\n\n this.mutationObserver.disconnect();\n if (this.restoreAriaHidden) {\n this.restoreAriaHidden();\n }\n\n this.validDropTargets = findValidDropTargets(this.dragTarget);\n\n // Shuffle drop target order based on starting drag target.\n if (this.validDropTargets.length > 0) {\n let nearestIndex = this.findNearestDropTarget();\n this.validDropTargets = [\n ...this.validDropTargets.slice(nearestIndex),\n ...this.validDropTargets.slice(0, nearestIndex),\n ];\n }\n\n // RAC `DragManager.ts:421-423` uses object identity (`includes`). If the\n // collection hook re-registers a new DropTarget for the same element\n // mid-session, identity fails and `setCurrentDropTarget` without an item\n // focuses the collection (`listbox:Permissions`) instead of the indicator.\n // Match by element and swap the descriptor in place so keyboard handlers\n // stay current without bouncing DOM focus.\n if (this.currentDropTarget) {\n const currentEl = this.currentDropTarget.element;\n const replacement = this.validDropTargets.find((target) => target.element === currentEl);\n if (replacement) {\n this.currentDropTarget = replacement;\n } else {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n }\n }\n\n // Find valid drop items within collections\n let types = getTypes(this.dragTarget.items);\n let validDropItems = [...dropItems.values()].filter((item) => {\n if (typeof item.getDropOperation === \"function\") {\n return item.getDropOperation(types, this.dragTarget.allowedDropOperations) !== \"cancel\";\n }\n\n return true;\n });\n\n // Keyboard pickup calls `setCurrentDropTarget(collection)` with no item, so\n // the collection element is focused. RAC then focuses the active indicator\n // from `useDroppableItem`. If that effect loses the race (inert mutations\n // re-enter this method), `active` stays `listbox:Permissions`. When an\n // indicator already has `data-drop-target`, hand it to `setCurrentDropTarget`\n // as the item so focus lands there before aria-hide.\n if (this.currentDropTarget && this.currentDropItem == null) {\n const activeItem = validDropItems.find((item) =>\n item.element.hasAttribute(\"data-drop-target\"),\n );\n if (activeItem) {\n this.setCurrentDropTarget(this.currentDropTarget, activeItem);\n }\n }\n\n // Filter out drop targets that contain valid items. We don't want to stop hiding elements\n // other than the drop items that exist inside the collection.\n let visibleDropTargets = this.validDropTargets.filter(\n (target) => !validDropItems.some((item) => nodeContains(target.element, item.element)),\n );\n\n this.restoreAriaHidden = ariaHideOutside(\n [\n this.dragTarget.element,\n ...validDropItems.flatMap((item) => {\n let button = item.activateButtonRef?.();\n return button ? [item.element, button] : [item.element];\n }),\n ...visibleDropTargets.flatMap((target) => {\n let button = target.activateButtonRef?.();\n return button ? [target.element, button] : [target.element];\n }),\n ],\n { shouldUseInert: true },\n );\n\n this.mutationObserver.observe(document.body, {\n subtree: true,\n attributes: true,\n attributeFilter: [\"aria-hidden\", \"inert\"],\n });\n }\n\n next(): void {\n // TODO: Allow tabbing to the activate button. Revisit once we fix the focus ring.\n // For now, the activate button is reachable by screen readers and ArrowLeft/ArrowRight\n // is usable specifically by Tree. Will need tabbing for other components.\n\n if (!this.currentDropTarget) {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n return;\n }\n\n let index = this.validDropTargets.indexOf(this.currentDropTarget);\n if (index < 0) {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n return;\n }\n\n // If we've reached the end of the valid drop targets, cycle back to the original drag target.\n // This lets the user cancel the drag in case they don't have an Escape key (e.g. iPad keyboard case).\n if (index === this.validDropTargets.length - 1) {\n if (!this.dragTarget.element.closest('[aria-hidden=\"true\"], [inert]')) {\n this.setCurrentDropTarget(null);\n this.dragTarget.element.focus();\n } else {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n }\n } else {\n this.setCurrentDropTarget(this.validDropTargets[index + 1]);\n }\n }\n\n previous(): void {\n if (!this.currentDropTarget) {\n this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);\n return;\n }\n\n let index = this.validDropTargets.indexOf(this.currentDropTarget);\n if (index < 0) {\n this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);\n return;\n }\n\n // If we've reached the start of the valid drop targets, cycle back to the original drag target.\n // This lets the user cancel the drag in case they don't have an Escape key (e.g. iPad keyboard case).\n if (index === 0) {\n if (!this.dragTarget.element.closest('[aria-hidden=\"true\"], [inert]')) {\n this.setCurrentDropTarget(null);\n this.dragTarget.element.focus();\n } else {\n this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);\n }\n } else {\n this.setCurrentDropTarget(this.validDropTargets[index - 1]);\n }\n }\n\n findNearestDropTarget(): number {\n let dragTargetRect = this.dragTarget.element.getBoundingClientRect();\n\n let minDistance = Infinity;\n let nearest = -1;\n let ancestor = -1;\n for (let i = 0; i < this.validDropTargets.length; i++) {\n let dropTarget = this.validDropTargets[i];\n // RAC `DragManager.ts:535-537`: prefer the collection that contains the\n // drag source so nested/side-by-side collections don't steal the session.\n if (ancestor < 0 && nodeContains(dropTarget.element, this.dragTarget.element)) {\n ancestor = i;\n }\n\n let rect = dropTarget.element.getBoundingClientRect();\n let dx = rect.left - dragTargetRect.left;\n let dy = rect.top - dragTargetRect.top;\n let dist = dx * dx + dy * dy;\n if (dist < minDistance) {\n minDistance = dist;\n nearest = i;\n }\n }\n\n return ancestor >= 0 ? ancestor : nearest;\n }\n\n setCurrentDropTarget(dropTarget: DropTarget | null, item?: DroppableItem): void {\n if (dropTarget !== this.currentDropTarget) {\n if (this.currentDropTarget && typeof this.currentDropTarget.onDropExit === \"function\") {\n let rect = this.currentDropTarget.element.getBoundingClientRect();\n this.currentDropTarget.onDropExit({\n type: \"dropexit\",\n x: rect.left + rect.width / 2,\n y: rect.top + rect.height / 2,\n });\n }\n\n this.currentDropTarget = dropTarget;\n\n if (dropTarget) {\n if (typeof dropTarget.onDropEnter === \"function\") {\n let rect = dropTarget.element.getBoundingClientRect();\n dropTarget.onDropEnter(\n {\n type: \"dropenter\",\n x: rect.left + rect.width / 2,\n y: rect.top + rect.height / 2,\n },\n this.dragTarget,\n );\n }\n\n if (!item) {\n dropTarget?.element.focus();\n }\n }\n }\n\n if (item != null && item !== this.currentDropItem) {\n if (\n this.currentDropTarget &&\n typeof this.currentDropTarget.onDropTargetEnter === \"function\"\n ) {\n this.currentDropTarget.onDropTargetEnter(item.target);\n }\n item.element.focus();\n this.currentDropItem = item;\n\n // Announce first drop target after drag start announcement finishes.\n // Otherwise, it will never get announced because drag start announcement is assertive.\n if (!this.initialFocused) {\n let label = item?.element.getAttribute(\"aria-label\");\n if (label) {\n announce(label, \"polite\");\n }\n this.initialFocused = true;\n }\n }\n }\n\n end(): void {\n this.teardown();\n endDragging();\n\n if (typeof this.dragTarget.onDragEnd === \"function\") {\n let target =\n this.currentDropTarget && this.dropOperation !== \"cancel\"\n ? this.currentDropTarget\n : this.dragTarget;\n let rect = target.element.getBoundingClientRect();\n this.dragTarget.onDragEnd({\n type: \"dragend\",\n x: rect.x + rect.width / 2,\n y: rect.y + rect.height / 2,\n dropOperation: this.dropOperation || \"cancel\",\n });\n }\n\n if (this.currentDropTarget && !this.currentDropTarget.preventFocusOnDrop) {\n // Re-trigger focus event on active element, since it will not have received it during dragging (see cancelEvent).\n // This corrects state such as whether focus ring should appear.\n // useDroppableCollection handles this itself, so this is only for standalone drop zones.\n getActiveElement()?.dispatchEvent(new FocusEvent(\"focusin\", { bubbles: true }));\n }\n\n this.setCurrentDropTarget(null);\n }\n\n cancel(): void {\n this.setCurrentDropTarget(null);\n this.end();\n if (!this.dragTarget.element.closest('[aria-hidden=\"true\"], [inert]')) {\n this.dragTarget.element.focus();\n }\n\n // Re-trigger focus event on active element, since it will not have received it during dragging (see cancelEvent).\n getActiveElement()?.dispatchEvent(new FocusEvent(\"focusin\", { bubbles: true }));\n\n announce(this.stringFormatter.format(\"dropCanceled\"));\n }\n\n drop(item?: DroppableItem): void {\n if (!this.currentDropTarget) {\n this.cancel();\n return;\n }\n\n if (typeof item?.getDropOperation === \"function\") {\n let types = getTypes(this.dragTarget.items);\n this.dropOperation = item.getDropOperation(types, this.dragTarget.allowedDropOperations);\n } else if (typeof this.currentDropTarget.getDropOperation === \"function\") {\n let types = getTypes(this.dragTarget.items);\n this.dropOperation = this.currentDropTarget.getDropOperation(\n types,\n this.dragTarget.allowedDropOperations,\n );\n } else {\n // TODO: show menu ??\n this.dropOperation = this.dragTarget.allowedDropOperations[0];\n }\n\n if (typeof this.currentDropTarget.onDrop === \"function\") {\n let items: DropItem[] = this.dragTarget.items.map((item) => ({\n kind: \"text\",\n types: new Set(Object.keys(item)),\n getText: (type: string) => Promise.resolve(item[type]),\n }));\n\n let rect = this.currentDropTarget.element.getBoundingClientRect();\n this.currentDropTarget.onDrop(\n {\n type: \"drop\",\n x: rect.left + rect.width / 2,\n y: rect.top + rect.height / 2,\n items,\n dropOperation: this.dropOperation,\n },\n item?.target ?? null,\n );\n }\n\n this.end();\n announce(this.stringFormatter.format(\"dropComplete\"));\n }\n\n activate(dropTarget: DropTarget | null, dropItem: DroppableItem | null | undefined): void {\n if (dropTarget && typeof dropTarget.onDropActivate === \"function\") {\n let target = dropItem?.target ?? null;\n let rect = dropTarget.element.getBoundingClientRect();\n dropTarget.onDropActivate(\n {\n type: \"dropactivate\",\n x: rect.left + rect.width / 2,\n y: rect.top + rect.height / 2,\n },\n target,\n );\n }\n }\n}\n\nfunction findValidDropTargets(options: DragTarget): DropTarget[] {\n let types = getTypes(options.items);\n return [...dropTargets.values()].filter((target) => {\n if (target.element.closest('[aria-hidden=\"true\"], [inert]')) {\n return false;\n }\n\n if (typeof target.getDropOperation === \"function\") {\n return target.getDropOperation(types, options.allowedDropOperations) !== \"cancel\";\n }\n\n return true;\n });\n}\n\nexport type { DragTarget, DropTarget, DroppableItem, DragSession };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAa,oCAAiC,IAAI,IAAI;CAAC;CAAc;CAAiB;AAAW,CAAC;AAGlG,MAAa,mBAAmB;AAGhC,MAAa,eAAe;AAG5B,IAAY,iBAAL,yBAAA,gBAAA;CACL,eAAA,eAAA,UAAA,KAAA;CACA,eAAA,eAAA,YAAA,KAAA;CACA,eAAA,eAAA,UAAA,KAAA;CACA,eAAA,eAAA,UAAA,KAAA;CACA,eAAA,eAAA,UAAA,KAAA;CACA,eAAA,eAAA,SAAA,KAAA;;AACF,EAAA,CAAA,CAAA;AAGA,MAAa,yBAAiD;CAC5D,MAAA;CACA,MAAA;CACA,UAAU;CACV,UAAU;CACV,MAAA;CACA,UAAU;CACV,MAAA;CACA,KAAA;CACA,eAAA;AACF;AAGA,MAAa,iBAAyC;EAC7B,IAAA;EACA,IAAA;EACA,IAAA;EACtB,IAA4C;EACtB,IAAA;EACtB,IAA4C;EAC5C,IAA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,mBAAmB,YAAY;GACjE,IAAI,SAAS,UAAU,UAAU;GACjC,IAAI,OAAO,WAAW,QAAQ,sBAAsB;GACpD,WAAW,eACT;IACE,MAAM;IACN,GAAG,KAAK,OAAO,KAAK,QAAQ;IAC5B,GAAG,KAAK,MAAM,KAAK,SAAS;GAC9B,GACA,MACF;EACF;CACF;AACF;AAEA,SAAS,qBAAqB,SAAmC;CAC/D,IAAI,QAAQ,SAAS,QAAQ,KAAK;CAClC,OAAO,CAAC,GAAG,YAAY,OAAO,CAAC,CAAC,CAAC,QAAQ,WAAW;EAClD,IAAI,OAAO,QAAQ,QAAQ,iCAA+B,GACxD,OAAO;EAGT,IAAI,OAAO,OAAO,qBAAqB,YACrC,OAAO,OAAO,iBAAiB,OAAO,QAAQ,qBAAqB,MAAM;EAG3E,OAAO;CACT,CAAC;AACH"}
@@ -1,12 +1,36 @@
1
- import { m as isVirtualPointerEvent, p as isVirtualClick } from "./utils.jsx";
2
- import { a as getEventTarget, i as getActiveElement, y as nodeContains } from "./focus.jsx";
3
- import { o as getInteractionModality } from "./createInteractionModality.jsx";
4
- import { t as ariaHideOutside } from "./ariaHideOutside.jsx";
1
+ /*
2
+ * Copyright 2020 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ // Ported to SolidJS for Proyecto Viviana; based on packages/react-aria/src/dnd/DragManager.ts
13
+ /*
14
+ * Copyright 2020 Adobe. All rights reserved.
15
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
16
+ * you may not use this file except in compliance with the License. You may obtain a copy
17
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
18
+ *
19
+ * Unless required by applicable law or agreed to in writing, software distributed under
20
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
21
+ * OF ANY KIND, either express or implied. See the License for the specific language
22
+ * governing permissions and limitations under the License.
23
+ */
24
+ // Ported to SolidJS for Proyecto Viviana; based on packages/react-aria/src/dnd/constants.ts
25
+ // Ported to SolidJS for Proyecto Viviana; based on packages/react-aria/src/dnd/utils.ts
26
+ import { a as getEventTarget, i as getActiveElement, x as nodeContains } from "./dom.jsx";
27
+ import { g as isVirtualPointerEvent, h as isVirtualClick, o as getInteractionModality } from "./createInteractionModality.jsx";
5
28
  import { t as announce } from "./announce.jsx";
29
+ import { t as ariaHideOutside } from "./ariaHideOutside.jsx";
6
30
  import { createSignal } from "solid-js";
7
31
  import { DIRECTORY_DRAG_TYPE } from "@proyecto-viviana/solid-stately";
8
32
  //#region src/dnd/utils.ts
9
- const NATIVE_DRAG_TYPES = new Set([
33
+ const NATIVE_DRAG_TYPES = /* @__PURE__ */ new Set([
10
34
  "text/plain",
11
35
  "text/uri-list",
12
36
  "text/html"
@@ -252,20 +276,23 @@ function registerDropTarget(target) {
252
276
  }
253
277
  function registerDropItem(item) {
254
278
  dropItems.set(item.element, item);
279
+ dragSession?.updateValidDropTargets();
255
280
  return () => {
256
281
  dropItems.delete(item.element);
282
+ dragSession?.updateValidDropTargets();
257
283
  };
258
284
  }
259
285
  function beginDragging(target, stringFormatter) {
260
286
  if (dragSession) throw new Error("Cannot begin dragging while already dragging");
261
287
  dragSession = new DragSession(target, stringFormatter);
262
288
  setTrackedDragSession(dragSession);
263
- requestAnimationFrame(() => {
264
- if (dragSession) {
265
- dragSession.setup();
266
- if (getDragModality() === "keyboard") dragSession.next();
267
- }
268
- });
289
+ if (dragSession) {
290
+ const session = dragSession;
291
+ session.setup();
292
+ if (getDragModality() === "keyboard") queueMicrotask(() => {
293
+ if (dragSession === session) session.next();
294
+ });
295
+ }
269
296
  }
270
297
  /** Reactive accessor for the active drag session, or null. */
271
298
  function createDragSession() {
@@ -362,14 +389,18 @@ var DragSession = class {
362
389
  this.cancel();
363
390
  return;
364
391
  }
365
- if (e.key === "Tab" && !(e.metaKey || e.altKey || e.ctrlKey)) if (e.shiftKey) this.previous();
366
- else this.next();
392
+ if (e.key === "Tab" && !(e.metaKey || e.altKey || e.ctrlKey)) {
393
+ if (e.shiftKey) this.previous();
394
+ else this.next();
395
+ }
367
396
  if (typeof this.currentDropTarget?.onKeyDown === "function") this.currentDropTarget.onKeyDown(e, this.dragTarget);
368
397
  }
369
398
  onKeyUp(e) {
370
399
  this.cancelEvent(e);
371
- if (e.key === "Enter") if (e.altKey || nodeContains(this.getCurrentActivateButton(), getEventTarget(e))) this.activate(this.currentDropTarget, this.currentDropItem);
372
- else this.drop();
400
+ if (e.key === "Enter") {
401
+ if (e.altKey || nodeContains(this.getCurrentActivateButton(), getEventTarget(e))) this.activate(this.currentDropTarget, this.currentDropItem);
402
+ else this.drop();
403
+ }
373
404
  }
374
405
  getCurrentActivateButton() {
375
406
  return this.currentDropItem?.activateButtonRef?.() ?? this.currentDropTarget?.activateButtonRef?.() ?? null;
@@ -399,8 +430,10 @@ var DragSession = class {
399
430
  return;
400
431
  }
401
432
  if (getEventTarget(e) !== this.dragTarget.element) this.cancelEvent(e);
402
- if (!e.relatedTarget || !(e.relatedTarget instanceof HTMLElement)) if (this.currentDropTarget) this.currentDropTarget.element.focus();
403
- else this.dragTarget.element.focus();
433
+ if (!e.relatedTarget || !(e.relatedTarget instanceof HTMLElement)) {
434
+ if (this.currentDropTarget) this.currentDropTarget.element.focus();
435
+ else this.dragTarget.element.focus();
436
+ }
404
437
  }
405
438
  onClick(e) {
406
439
  this.cancelEvent(e);
@@ -409,7 +442,8 @@ var DragSession = class {
409
442
  let eventTarget = getEventTarget(e);
410
443
  let item = [...dropElements].find((item) => item.element === eventTarget || nodeContains(item.activateButtonRef?.() ?? null, eventTarget));
411
444
  let dropTarget = this.validDropTargets.find((target) => nodeContains(target.element, eventTarget));
412
- if (nodeContains(item?.activateButtonRef?.() ?? dropTarget?.activateButtonRef?.() ?? null, eventTarget) && dropTarget) {
445
+ let activateButton = item?.activateButtonRef?.() ?? dropTarget?.activateButtonRef?.() ?? null;
446
+ if (nodeContains(activateButton, eventTarget) && dropTarget) {
413
447
  this.activate(dropTarget, item);
414
448
  return;
415
449
  }
@@ -443,12 +477,21 @@ var DragSession = class {
443
477
  let nearestIndex = this.findNearestDropTarget();
444
478
  this.validDropTargets = [...this.validDropTargets.slice(nearestIndex), ...this.validDropTargets.slice(0, nearestIndex)];
445
479
  }
446
- if (this.currentDropTarget && !this.validDropTargets.includes(this.currentDropTarget)) this.setCurrentDropTarget(this.validDropTargets[0]);
480
+ if (this.currentDropTarget) {
481
+ const currentEl = this.currentDropTarget.element;
482
+ const replacement = this.validDropTargets.find((target) => target.element === currentEl);
483
+ if (replacement) this.currentDropTarget = replacement;
484
+ else this.setCurrentDropTarget(this.validDropTargets[0]);
485
+ }
447
486
  let types = getTypes(this.dragTarget.items);
448
487
  let validDropItems = [...dropItems.values()].filter((item) => {
449
488
  if (typeof item.getDropOperation === "function") return item.getDropOperation(types, this.dragTarget.allowedDropOperations) !== "cancel";
450
489
  return true;
451
490
  });
491
+ if (this.currentDropTarget && this.currentDropItem == null) {
492
+ const activeItem = validDropItems.find((item) => item.element.hasAttribute("data-drop-target"));
493
+ if (activeItem) this.setCurrentDropTarget(this.currentDropTarget, activeItem);
494
+ }
452
495
  let visibleDropTargets = this.validDropTargets.filter((target) => !validDropItems.some((item) => nodeContains(target.element, item.element)));
453
496
  this.restoreAriaHidden = ariaHideOutside([
454
497
  this.dragTarget.element,
@@ -477,11 +520,12 @@ var DragSession = class {
477
520
  this.setCurrentDropTarget(this.validDropTargets[0]);
478
521
  return;
479
522
  }
480
- if (index === this.validDropTargets.length - 1) if (!this.dragTarget.element.closest("[aria-hidden=\"true\"], [inert]")) {
481
- this.setCurrentDropTarget(null);
482
- this.dragTarget.element.focus();
483
- } else this.setCurrentDropTarget(this.validDropTargets[0]);
484
- else this.setCurrentDropTarget(this.validDropTargets[index + 1]);
523
+ if (index === this.validDropTargets.length - 1) {
524
+ if (!this.dragTarget.element.closest("[aria-hidden=\"true\"], [inert]")) {
525
+ this.setCurrentDropTarget(null);
526
+ this.dragTarget.element.focus();
527
+ } else this.setCurrentDropTarget(this.validDropTargets[0]);
528
+ } else this.setCurrentDropTarget(this.validDropTargets[index + 1]);
485
529
  }
486
530
  previous() {
487
531
  if (!this.currentDropTarget) {
@@ -493,18 +537,22 @@ var DragSession = class {
493
537
  this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);
494
538
  return;
495
539
  }
496
- if (index === 0) if (!this.dragTarget.element.closest("[aria-hidden=\"true\"], [inert]")) {
497
- this.setCurrentDropTarget(null);
498
- this.dragTarget.element.focus();
499
- } else this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);
500
- else this.setCurrentDropTarget(this.validDropTargets[index - 1]);
540
+ if (index === 0) {
541
+ if (!this.dragTarget.element.closest("[aria-hidden=\"true\"], [inert]")) {
542
+ this.setCurrentDropTarget(null);
543
+ this.dragTarget.element.focus();
544
+ } else this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);
545
+ } else this.setCurrentDropTarget(this.validDropTargets[index - 1]);
501
546
  }
502
547
  findNearestDropTarget() {
503
548
  let dragTargetRect = this.dragTarget.element.getBoundingClientRect();
504
549
  let minDistance = Infinity;
505
550
  let nearest = -1;
551
+ let ancestor = -1;
506
552
  for (let i = 0; i < this.validDropTargets.length; i++) {
507
- let rect = this.validDropTargets[i].element.getBoundingClientRect();
553
+ let dropTarget = this.validDropTargets[i];
554
+ if (ancestor < 0 && nodeContains(dropTarget.element, this.dragTarget.element)) ancestor = i;
555
+ let rect = dropTarget.element.getBoundingClientRect();
508
556
  let dx = rect.left - dragTargetRect.left;
509
557
  let dy = rect.top - dragTargetRect.top;
510
558
  let dist = dx * dx + dy * dy;
@@ -513,7 +561,7 @@ var DragSession = class {
513
561
  nearest = i;
514
562
  }
515
563
  }
516
- return nearest;
564
+ return ancestor >= 0 ? ancestor : nearest;
517
565
  }
518
566
  setCurrentDropTarget(dropTarget, item) {
519
567
  if (dropTarget !== this.currentDropTarget) {