@proyecto-viviana/solidaria 0.6.0-rc.0 → 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 (674) hide show
  1. package/README.md +54 -27
  2. package/dist/_chunk/DragManager.js +9 -7
  3. package/dist/_chunk/DragManager.js.map +1 -1
  4. package/dist/_chunk/DragManager.jsx +9 -7
  5. package/dist/_chunk/DragManager.jsx.map +1 -1
  6. package/dist/_chunk/FocusScope.js +152 -60
  7. package/dist/_chunk/FocusScope.js.map +1 -1
  8. package/dist/_chunk/FocusScope.jsx +150 -58
  9. package/dist/_chunk/FocusScope.jsx.map +1 -1
  10. package/dist/_chunk/ListKeyboardDelegate.js +270 -0
  11. package/dist/_chunk/ListKeyboardDelegate.js.map +1 -0
  12. package/dist/_chunk/ListKeyboardDelegate.jsx +270 -0
  13. package/dist/_chunk/ListKeyboardDelegate.jsx.map +1 -0
  14. package/dist/_chunk/actiongroup.js +4 -4
  15. package/dist/_chunk/actiongroup.js.map +1 -1
  16. package/dist/_chunk/actiongroup.jsx +4 -4
  17. package/dist/_chunk/actiongroup.jsx.map +1 -1
  18. package/dist/_chunk/announce.js +8 -6
  19. package/dist/_chunk/announce.js.map +1 -1
  20. package/dist/_chunk/announce.jsx +8 -6
  21. package/dist/_chunk/announce.jsx.map +1 -1
  22. package/dist/_chunk/ariaHideOutside.js +1 -1
  23. package/dist/_chunk/ariaHideOutside.jsx +1 -1
  24. package/dist/_chunk/autocomplete.js +68 -7
  25. package/dist/_chunk/autocomplete.js.map +1 -1
  26. package/dist/_chunk/autocomplete.jsx +68 -7
  27. package/dist/_chunk/autocomplete.jsx.map +1 -1
  28. package/dist/_chunk/breadcrumbs.js +53 -6
  29. package/dist/_chunk/breadcrumbs.js.map +1 -1
  30. package/dist/_chunk/breadcrumbs.jsx +53 -6
  31. package/dist/_chunk/breadcrumbs.jsx.map +1 -1
  32. package/dist/_chunk/button.js +11 -7
  33. package/dist/_chunk/button.js.map +1 -1
  34. package/dist/_chunk/button.jsx +11 -7
  35. package/dist/_chunk/button.jsx.map +1 -1
  36. package/dist/_chunk/calendar.js +413 -149
  37. package/dist/_chunk/calendar.js.map +1 -1
  38. package/dist/_chunk/calendar.jsx +413 -149
  39. package/dist/_chunk/calendar.jsx.map +1 -1
  40. package/dist/_chunk/callEventHandler.js +21 -0
  41. package/dist/_chunk/callEventHandler.js.map +1 -0
  42. package/dist/_chunk/callEventHandler.jsx +21 -0
  43. package/dist/_chunk/callEventHandler.jsx.map +1 -0
  44. package/dist/_chunk/checkbox.js +90 -39
  45. package/dist/_chunk/checkbox.js.map +1 -1
  46. package/dist/_chunk/checkbox.jsx +90 -39
  47. package/dist/_chunk/checkbox.jsx.map +1 -1
  48. package/dist/_chunk/color.js +201 -38
  49. package/dist/_chunk/color.js.map +1 -1
  50. package/dist/_chunk/color.jsx +201 -38
  51. package/dist/_chunk/color.jsx.map +1 -1
  52. package/dist/_chunk/combobox.js +47 -52
  53. package/dist/_chunk/combobox.js.map +1 -1
  54. package/dist/_chunk/combobox.jsx +47 -52
  55. package/dist/_chunk/combobox.jsx.map +1 -1
  56. package/dist/_chunk/createCollectionRowInteraction.js +3 -4
  57. package/dist/_chunk/createCollectionRowInteraction.js.map +1 -1
  58. package/dist/_chunk/createCollectionRowInteraction.jsx +3 -4
  59. package/dist/_chunk/createCollectionRowInteraction.jsx.map +1 -1
  60. package/dist/_chunk/createDescription.js +117 -0
  61. package/dist/_chunk/createDescription.js.map +1 -0
  62. package/dist/_chunk/createDescription.jsx +117 -0
  63. package/dist/_chunk/createDescription.jsx.map +1 -0
  64. package/dist/_chunk/createFocus.js +1 -1
  65. package/dist/_chunk/createFocus.js.map +1 -1
  66. package/dist/_chunk/createFocus.jsx +1 -1
  67. package/dist/_chunk/createFocus.jsx.map +1 -1
  68. package/dist/_chunk/createFocusRing.js +1 -1
  69. package/dist/_chunk/createFocusRing.js.map +1 -1
  70. package/dist/_chunk/createFocusRing.jsx +1 -1
  71. package/dist/_chunk/createFocusRing.jsx.map +1 -1
  72. package/dist/_chunk/createFocusWithin.js +22 -7
  73. package/dist/_chunk/createFocusWithin.js.map +1 -1
  74. package/dist/_chunk/createFocusWithin.jsx +22 -7
  75. package/dist/_chunk/createFocusWithin.jsx.map +1 -1
  76. package/dist/_chunk/createFocusable.js +16 -4
  77. package/dist/_chunk/createFocusable.js.map +1 -1
  78. package/dist/_chunk/createFocusable.jsx +16 -4
  79. package/dist/_chunk/createFocusable.jsx.map +1 -1
  80. package/dist/_chunk/createFormReset.js +170 -1
  81. package/dist/_chunk/createFormReset.js.map +1 -1
  82. package/dist/_chunk/createFormReset.jsx +170 -1
  83. package/dist/_chunk/createFormReset.jsx.map +1 -1
  84. package/dist/_chunk/createGrid.js +869 -0
  85. package/dist/_chunk/createGrid.js.map +1 -0
  86. package/dist/_chunk/createGrid.jsx +869 -0
  87. package/dist/_chunk/createGrid.jsx.map +1 -0
  88. package/dist/_chunk/createGridListItem.js +480 -0
  89. package/dist/_chunk/createGridListItem.js.map +1 -0
  90. package/dist/_chunk/createGridListItem.jsx +480 -0
  91. package/dist/_chunk/createGridListItem.jsx.map +1 -0
  92. package/dist/_chunk/createHasTabbableChild.js +63 -0
  93. package/dist/_chunk/createHasTabbableChild.js.map +1 -0
  94. package/dist/_chunk/createHasTabbableChild.jsx +63 -0
  95. package/dist/_chunk/createHasTabbableChild.jsx.map +1 -0
  96. package/dist/_chunk/createHover.js +12 -13
  97. package/dist/_chunk/createHover.js.map +1 -1
  98. package/dist/_chunk/createHover.jsx +12 -13
  99. package/dist/_chunk/createHover.jsx.map +1 -1
  100. package/dist/_chunk/createInteractionModality.js +413 -0
  101. package/dist/_chunk/createInteractionModality.js.map +1 -0
  102. package/dist/_chunk/createInteractionModality.jsx +413 -0
  103. package/dist/_chunk/createInteractionModality.jsx.map +1 -0
  104. package/dist/_chunk/createKeyboard.js +4 -3
  105. package/dist/_chunk/createKeyboard.js.map +1 -1
  106. package/dist/_chunk/createKeyboard.jsx +4 -3
  107. package/dist/_chunk/createKeyboard.jsx.map +1 -1
  108. package/dist/_chunk/createLabel.js +1 -1
  109. package/dist/_chunk/createLabel.jsx +1 -1
  110. package/dist/_chunk/createLabels.js +1 -1
  111. package/dist/_chunk/createLabels.js.map +1 -1
  112. package/dist/_chunk/createLabels.jsx +1 -1
  113. package/dist/_chunk/createLabels.jsx.map +1 -1
  114. package/dist/_chunk/createLandmark.js +327 -118
  115. package/dist/_chunk/createLandmark.js.map +1 -1
  116. package/dist/_chunk/createLandmark.jsx +327 -118
  117. package/dist/_chunk/createLandmark.jsx.map +1 -1
  118. package/dist/_chunk/createLongPress.js +35 -13
  119. package/dist/_chunk/createLongPress.js.map +1 -1
  120. package/dist/_chunk/createLongPress.jsx +35 -13
  121. package/dist/_chunk/createLongPress.jsx.map +1 -1
  122. package/dist/_chunk/createOverlay.js +56 -91
  123. package/dist/_chunk/createOverlay.js.map +1 -1
  124. package/dist/_chunk/createOverlay.jsx +56 -91
  125. package/dist/_chunk/createOverlay.jsx.map +1 -1
  126. package/dist/_chunk/createPress.js +21 -20
  127. package/dist/_chunk/createPress.js.map +1 -1
  128. package/dist/_chunk/createPress.jsx +21 -20
  129. package/dist/_chunk/createPress.jsx.map +1 -1
  130. package/dist/_chunk/createProgressBar.js +4 -1
  131. package/dist/_chunk/createProgressBar.js.map +1 -1
  132. package/dist/_chunk/createProgressBar.jsx +4 -1
  133. package/dist/_chunk/createProgressBar.jsx.map +1 -1
  134. package/dist/_chunk/createSelectableCollection.js +468 -0
  135. package/dist/_chunk/createSelectableCollection.js.map +1 -0
  136. package/dist/_chunk/createSelectableCollection.jsx +468 -0
  137. package/dist/_chunk/createSelectableCollection.jsx.map +1 -0
  138. package/dist/_chunk/createSelectableItem.js +87 -93
  139. package/dist/_chunk/createSelectableItem.js.map +1 -1
  140. package/dist/_chunk/createSelectableItem.jsx +87 -93
  141. package/dist/_chunk/createSelectableItem.jsx.map +1 -1
  142. package/dist/_chunk/createSelectableList.js +6 -712
  143. package/dist/_chunk/createSelectableList.js.map +1 -1
  144. package/dist/_chunk/createSelectableList.jsx +6 -712
  145. package/dist/_chunk/createSelectableList.jsx.map +1 -1
  146. package/dist/_chunk/createToggle.js +49 -13
  147. package/dist/_chunk/createToggle.js.map +1 -1
  148. package/dist/_chunk/createToggle.jsx +49 -13
  149. package/dist/_chunk/createToggle.jsx.map +1 -1
  150. package/dist/_chunk/createTypeSelect.js +3 -0
  151. package/dist/_chunk/createTypeSelect.js.map +1 -1
  152. package/dist/_chunk/createTypeSelect.jsx +3 -0
  153. package/dist/_chunk/createTypeSelect.jsx.map +1 -1
  154. package/dist/_chunk/datepicker.js +104 -46
  155. package/dist/_chunk/datepicker.js.map +1 -1
  156. package/dist/_chunk/datepicker.jsx +104 -46
  157. package/dist/_chunk/datepicker.jsx.map +1 -1
  158. package/dist/_chunk/dialog.js +1 -1
  159. package/dist/_chunk/dialog.jsx +1 -1
  160. package/dist/_chunk/disclosure.js +4 -3
  161. package/dist/_chunk/disclosure.js.map +1 -1
  162. package/dist/_chunk/disclosure.jsx +4 -3
  163. package/dist/_chunk/disclosure.jsx.map +1 -1
  164. package/dist/_chunk/dnd.js +150 -45
  165. package/dist/_chunk/dnd.js.map +1 -1
  166. package/dist/_chunk/dnd.jsx +150 -45
  167. package/dist/_chunk/dnd.jsx.map +1 -1
  168. package/dist/_chunk/dom.js +121 -697
  169. package/dist/_chunk/dom.js.map +1 -1
  170. package/dist/_chunk/dom.jsx +121 -697
  171. package/dist/_chunk/dom.jsx.map +1 -1
  172. package/dist/_chunk/env.js +12 -1
  173. package/dist/_chunk/env.js.map +1 -1
  174. package/dist/_chunk/env.jsx +12 -1
  175. package/dist/_chunk/env.jsx.map +1 -1
  176. package/dist/_chunk/focus.js +37 -17
  177. package/dist/_chunk/focus.js.map +1 -1
  178. package/dist/_chunk/focus.jsx +37 -17
  179. package/dist/_chunk/focus.jsx.map +1 -1
  180. package/dist/_chunk/grid.js +7 -449
  181. package/dist/_chunk/grid.js.map +1 -1
  182. package/dist/_chunk/grid.jsx +7 -449
  183. package/dist/_chunk/grid.jsx.map +1 -1
  184. package/dist/_chunk/gridlist.js +5 -390
  185. package/dist/_chunk/gridlist.js.map +1 -1
  186. package/dist/_chunk/gridlist.jsx +5 -390
  187. package/dist/_chunk/gridlist.jsx.map +1 -1
  188. package/dist/_chunk/i18n.js +2 -1
  189. package/dist/_chunk/i18n.js.map +1 -1
  190. package/dist/_chunk/i18n.jsx +2 -1
  191. package/dist/_chunk/i18n.jsx.map +1 -1
  192. package/dist/_chunk/interactions.js +3 -3
  193. package/dist/_chunk/interactions.js.map +1 -1
  194. package/dist/_chunk/interactions.jsx +1 -1
  195. package/dist/_chunk/link.js +30 -15
  196. package/dist/_chunk/link.js.map +1 -1
  197. package/dist/_chunk/link.jsx +30 -15
  198. package/dist/_chunk/link.jsx.map +1 -1
  199. package/dist/_chunk/listbox.js +12 -3
  200. package/dist/_chunk/listbox.js.map +1 -1
  201. package/dist/_chunk/listbox.jsx +12 -3
  202. package/dist/_chunk/listbox.jsx.map +1 -1
  203. package/dist/_chunk/locale.js +11 -3
  204. package/dist/_chunk/locale.js.map +1 -1
  205. package/dist/_chunk/locale.jsx +9 -1
  206. package/dist/_chunk/locale.jsx.map +1 -1
  207. package/dist/_chunk/menu.js +69 -206
  208. package/dist/_chunk/menu.js.map +1 -1
  209. package/dist/_chunk/menu.jsx +69 -206
  210. package/dist/_chunk/menu.jsx.map +1 -1
  211. package/dist/_chunk/numberfield.js +338 -28
  212. package/dist/_chunk/numberfield.js.map +1 -1
  213. package/dist/_chunk/numberfield.jsx +338 -28
  214. package/dist/_chunk/numberfield.jsx.map +1 -1
  215. package/dist/_chunk/overlays.js +7 -7
  216. package/dist/_chunk/overlays.js.map +1 -1
  217. package/dist/_chunk/popover.js +30 -22
  218. package/dist/_chunk/popover.js.map +1 -1
  219. package/dist/_chunk/popover.jsx +30 -22
  220. package/dist/_chunk/popover.jsx.map +1 -1
  221. package/dist/_chunk/radio.js +71 -62
  222. package/dist/_chunk/radio.js.map +1 -1
  223. package/dist/_chunk/radio.jsx +71 -62
  224. package/dist/_chunk/radio.jsx.map +1 -1
  225. package/dist/_chunk/searchfield.js +3 -0
  226. package/dist/_chunk/searchfield.js.map +1 -1
  227. package/dist/_chunk/searchfield.jsx +3 -0
  228. package/dist/_chunk/searchfield.jsx.map +1 -1
  229. package/dist/_chunk/select.js +66 -87
  230. package/dist/_chunk/select.js.map +1 -1
  231. package/dist/_chunk/select.jsx +59 -80
  232. package/dist/_chunk/select.jsx.map +1 -1
  233. package/dist/_chunk/selection.js +2 -2
  234. package/dist/_chunk/selection.jsx +2 -2
  235. package/dist/_chunk/slider.js +390 -199
  236. package/dist/_chunk/slider.js.map +1 -1
  237. package/dist/_chunk/slider.jsx +390 -199
  238. package/dist/_chunk/slider.jsx.map +1 -1
  239. package/dist/_chunk/steplist.js +97 -34
  240. package/dist/_chunk/steplist.js.map +1 -1
  241. package/dist/_chunk/steplist.jsx +97 -34
  242. package/dist/_chunk/steplist.jsx.map +1 -1
  243. package/dist/_chunk/table.js +724 -506
  244. package/dist/_chunk/table.js.map +1 -1
  245. package/dist/_chunk/table.jsx +724 -506
  246. package/dist/_chunk/table.jsx.map +1 -1
  247. package/dist/_chunk/tabs.js +31 -75
  248. package/dist/_chunk/tabs.js.map +1 -1
  249. package/dist/_chunk/tabs.jsx +31 -75
  250. package/dist/_chunk/tabs.jsx.map +1 -1
  251. package/dist/_chunk/tag.js +164 -174
  252. package/dist/_chunk/tag.js.map +1 -1
  253. package/dist/_chunk/tag.jsx +164 -174
  254. package/dist/_chunk/tag.jsx.map +1 -1
  255. package/dist/_chunk/textfield.js +6 -2
  256. package/dist/_chunk/textfield.js.map +1 -1
  257. package/dist/_chunk/textfield.jsx +6 -2
  258. package/dist/_chunk/textfield.jsx.map +1 -1
  259. package/dist/_chunk/toast.js +188 -21
  260. package/dist/_chunk/toast.js.map +1 -1
  261. package/dist/_chunk/toast.jsx +188 -21
  262. package/dist/_chunk/toast.jsx.map +1 -1
  263. package/dist/_chunk/tokenfield.js +133 -71
  264. package/dist/_chunk/tokenfield.js.map +1 -1
  265. package/dist/_chunk/tokenfield.jsx +133 -71
  266. package/dist/_chunk/tokenfield.jsx.map +1 -1
  267. package/dist/_chunk/toolbar.js +2 -1
  268. package/dist/_chunk/toolbar.js.map +1 -1
  269. package/dist/_chunk/toolbar.jsx +2 -1
  270. package/dist/_chunk/toolbar.jsx.map +1 -1
  271. package/dist/_chunk/tooltip.js +4 -7
  272. package/dist/_chunk/tooltip.js.map +1 -1
  273. package/dist/_chunk/tooltip.jsx +4 -7
  274. package/dist/_chunk/tooltip.jsx.map +1 -1
  275. package/dist/_chunk/tree.js +23 -19
  276. package/dist/_chunk/tree.js.map +1 -1
  277. package/dist/_chunk/tree.jsx +23 -19
  278. package/dist/_chunk/tree.jsx.map +1 -1
  279. package/dist/_chunk/utils.js +434 -171
  280. package/dist/_chunk/utils.js.map +1 -1
  281. package/dist/_chunk/utils.jsx +434 -171
  282. package/dist/_chunk/utils.jsx.map +1 -1
  283. package/dist/_chunk/utils2.js +77 -0
  284. package/dist/_chunk/utils2.js.map +1 -0
  285. package/dist/_chunk/utils2.jsx +77 -0
  286. package/dist/_chunk/utils2.jsx.map +1 -0
  287. package/dist/_chunk/virtualFocus.js +1 -1
  288. package/dist/_chunk/virtualFocus.jsx +1 -1
  289. package/dist/_chunk/virtualizer.js +1 -1
  290. package/dist/_chunk/virtualizer.jsx +1 -1
  291. package/dist/actiongroup/createActionGroup.d.ts.map +1 -1
  292. package/dist/autocomplete/createAutocomplete.d.ts.map +1 -1
  293. package/dist/breadcrumbs/createBreadcrumbs.d.ts +0 -8
  294. package/dist/breadcrumbs/createBreadcrumbs.d.ts.map +1 -1
  295. package/dist/button/createButton.d.ts +2 -1
  296. package/dist/button/createButton.d.ts.map +1 -1
  297. package/dist/button/createToggleButton.d.ts.map +1 -1
  298. package/dist/calendar/createCalendar.d.ts +12 -4
  299. package/dist/calendar/createCalendar.d.ts.map +1 -1
  300. package/dist/calendar/createCalendarCell.d.ts +5 -0
  301. package/dist/calendar/createCalendarCell.d.ts.map +1 -1
  302. package/dist/calendar/createCalendarGrid.d.ts +2 -2
  303. package/dist/calendar/createCalendarGrid.d.ts.map +1 -1
  304. package/dist/calendar/createCalendarYearPicker.d.ts.map +1 -1
  305. package/dist/calendar/createRangeCalendar.d.ts +13 -3
  306. package/dist/calendar/createRangeCalendar.d.ts.map +1 -1
  307. package/dist/calendar/createRangeCalendarCell.d.ts +5 -0
  308. package/dist/calendar/createRangeCalendarCell.d.ts.map +1 -1
  309. package/dist/calendar/utils.d.ts +24 -4
  310. package/dist/calendar/utils.d.ts.map +1 -1
  311. package/dist/checkbox/createCheckbox.d.ts.map +1 -1
  312. package/dist/checkbox/createCheckboxGroup.d.ts +14 -1
  313. package/dist/checkbox/createCheckboxGroup.d.ts.map +1 -1
  314. package/dist/checkbox/createCheckboxGroupItem.d.ts.map +1 -1
  315. package/dist/collections/index.d.ts.map +1 -1
  316. package/dist/collections/index.js +16 -15
  317. package/dist/collections/index.js.map +1 -1
  318. package/dist/collections/index.jsx +16 -15
  319. package/dist/collections/index.jsx.map +1 -1
  320. package/dist/color/createColorArea.d.ts.map +1 -1
  321. package/dist/color/createColorField.d.ts.map +1 -1
  322. package/dist/color/createColorSlider.d.ts.map +1 -1
  323. package/dist/color/createColorWheel.d.ts.map +1 -1
  324. package/dist/color/types.d.ts +2 -0
  325. package/dist/color/types.d.ts.map +1 -1
  326. package/dist/combobox/createComboBox.d.ts +3 -3
  327. package/dist/combobox/createComboBox.d.ts.map +1 -1
  328. package/dist/datepicker/createDateField.d.ts +2 -2
  329. package/dist/datepicker/createDateField.d.ts.map +1 -1
  330. package/dist/datepicker/createDatePicker.d.ts +2 -2
  331. package/dist/datepicker/createDatePicker.d.ts.map +1 -1
  332. package/dist/datepicker/createDatePickerGroup.d.ts +1 -1
  333. package/dist/datepicker/createDatePickerGroup.d.ts.map +1 -1
  334. package/dist/datepicker/createDateRangePicker.d.ts +8 -1
  335. package/dist/datepicker/createDateRangePicker.d.ts.map +1 -1
  336. package/dist/datepicker/createDateSegment.d.ts.map +1 -1
  337. package/dist/disclosure/createDisclosure.d.ts.map +1 -1
  338. package/dist/dnd/DragManager.d.ts.map +1 -1
  339. package/dist/dnd/createDraggableItem.d.ts.map +1 -1
  340. package/dist/dnd/createDrop.d.ts.map +1 -1
  341. package/dist/dnd/createDropIndicator.d.ts.map +1 -1
  342. package/dist/dnd/createDroppableItem.d.ts.map +1 -1
  343. package/dist/focus/FocusScope.d.ts.map +1 -1
  344. package/dist/focus/createAutoFocus.d.ts.map +1 -1
  345. package/dist/focus/index.js +1 -1
  346. package/dist/focus/index.jsx +1 -1
  347. package/dist/form/createFormValidation.d.ts +12 -0
  348. package/dist/form/createFormValidation.d.ts.map +1 -1
  349. package/dist/form/index.js +1 -2
  350. package/dist/form/index.jsx +1 -2
  351. package/dist/grid/createGrid.d.ts +39 -0
  352. package/dist/grid/createGrid.d.ts.map +1 -1
  353. package/dist/grid/createGridCell.d.ts.map +1 -1
  354. package/dist/grid/index.js +2 -1
  355. package/dist/grid/index.jsx +2 -1
  356. package/dist/gridlist/createGridList.d.ts +2 -2
  357. package/dist/gridlist/createGridList.d.ts.map +1 -1
  358. package/dist/gridlist/createGridListItem.d.ts +1 -1
  359. package/dist/gridlist/createGridListItem.d.ts.map +1 -1
  360. package/dist/gridlist/index.js +2 -1
  361. package/dist/gridlist/index.jsx +2 -1
  362. package/dist/gridlist/types.d.ts +32 -1
  363. package/dist/gridlist/types.d.ts.map +1 -1
  364. package/dist/i18n/createDateFormatter.d.ts +2 -1
  365. package/dist/i18n/createDateFormatter.d.ts.map +1 -1
  366. package/dist/i18n/locale.d.ts.map +1 -1
  367. package/dist/index.d.ts +5 -5
  368. package/dist/index.d.ts.map +1 -1
  369. package/dist/index.js +20 -14
  370. package/dist/index.jsx +20 -14
  371. package/dist/interactions/createFocus.d.ts +9 -2
  372. package/dist/interactions/createFocus.d.ts.map +1 -1
  373. package/dist/interactions/createFocusRing.d.ts +10 -2
  374. package/dist/interactions/createFocusRing.d.ts.map +1 -1
  375. package/dist/interactions/createFocusWithin.d.ts +11 -2
  376. package/dist/interactions/createFocusWithin.d.ts.map +1 -1
  377. package/dist/interactions/createFocusable.d.ts.map +1 -1
  378. package/dist/interactions/createHover.d.ts.map +1 -1
  379. package/dist/interactions/createLongPress.d.ts.map +1 -1
  380. package/dist/interactions/createPress.d.ts +1 -0
  381. package/dist/interactions/createPress.d.ts.map +1 -1
  382. package/dist/interactions/index.js +1 -1
  383. package/dist/interactions/index.jsx +1 -1
  384. package/dist/label/createLabels.d.ts.map +1 -1
  385. package/dist/landmark/createLandmark.d.ts +59 -5
  386. package/dist/landmark/createLandmark.d.ts.map +1 -1
  387. package/dist/link/createLink.d.ts.map +1 -1
  388. package/dist/listbox/createListBox.d.ts +19 -0
  389. package/dist/listbox/createListBox.d.ts.map +1 -1
  390. package/dist/live-announcer/announce.d.ts +6 -4
  391. package/dist/live-announcer/announce.d.ts.map +1 -1
  392. package/dist/menu/createMenu.d.ts +1 -1
  393. package/dist/menu/createMenu.d.ts.map +1 -1
  394. package/dist/menu/createMenuItem.d.ts +5 -1
  395. package/dist/menu/createMenuItem.d.ts.map +1 -1
  396. package/dist/numberfield/createNumberField.d.ts +15 -0
  397. package/dist/numberfield/createNumberField.d.ts.map +1 -1
  398. package/dist/numberfield/index.d.ts +1 -0
  399. package/dist/numberfield/index.d.ts.map +1 -1
  400. package/dist/numberfield/index.js +2 -2
  401. package/dist/numberfield/index.jsx +2 -2
  402. package/dist/numberfield/intl.d.ts +10 -0
  403. package/dist/numberfield/intl.d.ts.map +1 -0
  404. package/dist/overlays/createCloseOnScroll.d.ts +11 -0
  405. package/dist/overlays/createCloseOnScroll.d.ts.map +1 -0
  406. package/dist/overlays/createInteractOutside.d.ts.map +1 -1
  407. package/dist/overlays/createOverlay.d.ts.map +1 -1
  408. package/dist/overlays/index.d.ts +1 -0
  409. package/dist/overlays/index.d.ts.map +1 -1
  410. package/dist/overlays/index.js +2 -2
  411. package/dist/overlays/index.jsx +2 -2
  412. package/dist/popover/createOverlayPosition.d.ts.map +1 -1
  413. package/dist/popover/createPopover.d.ts +2 -1
  414. package/dist/popover/createPopover.d.ts.map +1 -1
  415. package/dist/progress/createProgressBar.d.ts.map +1 -1
  416. package/dist/radio/createRadio.d.ts.map +1 -1
  417. package/dist/radio/createRadioGroup.d.ts +0 -2
  418. package/dist/radio/createRadioGroup.d.ts.map +1 -1
  419. package/dist/searchfield/createSearchField.d.ts.map +1 -1
  420. package/dist/select/createHiddenSelect.d.ts +5 -5
  421. package/dist/select/createHiddenSelect.d.ts.map +1 -1
  422. package/dist/select/createSelect.d.ts +3 -3
  423. package/dist/select/createSelect.d.ts.map +1 -1
  424. package/dist/selection/ListKeyboardDelegate.d.ts +2 -1
  425. package/dist/selection/ListKeyboardDelegate.d.ts.map +1 -1
  426. package/dist/selection/createCollectionRowInteraction.d.ts.map +1 -1
  427. package/dist/selection/createSelectableCollection.d.ts.map +1 -1
  428. package/dist/selection/createSelectableItem.d.ts +1 -0
  429. package/dist/selection/createSelectableItem.d.ts.map +1 -1
  430. package/dist/selection/createSelectableList.d.ts +3 -1
  431. package/dist/selection/createSelectableList.d.ts.map +1 -1
  432. package/dist/selection/createTypeSelect.d.ts +5 -0
  433. package/dist/selection/createTypeSelect.d.ts.map +1 -1
  434. package/dist/selection/index.js +5 -2
  435. package/dist/selection/index.jsx +5 -2
  436. package/dist/slider/createSlider.d.ts +25 -9
  437. package/dist/slider/createSlider.d.ts.map +1 -1
  438. package/dist/slider/createSliderThumb.d.ts +12 -0
  439. package/dist/slider/createSliderThumb.d.ts.map +1 -0
  440. package/dist/slider/index.d.ts +1 -0
  441. package/dist/slider/index.d.ts.map +1 -1
  442. package/dist/slider/index.js +2 -2
  443. package/dist/slider/index.jsx +2 -2
  444. package/dist/ssr/index.d.ts +0 -19
  445. package/dist/ssr/index.d.ts.map +1 -1
  446. package/dist/ssr/index.js +11 -6
  447. package/dist/ssr/index.js.map +1 -1
  448. package/dist/ssr/index.jsx +9 -4
  449. package/dist/ssr/index.jsx.map +1 -1
  450. package/dist/steplist/createStepList.d.ts +18 -6
  451. package/dist/steplist/createStepList.d.ts.map +1 -1
  452. package/dist/steplist/index.d.ts +1 -1
  453. package/dist/steplist/index.d.ts.map +1 -1
  454. package/dist/steplist/index.js +2 -2
  455. package/dist/steplist/index.jsx +2 -2
  456. package/dist/steplist/intl/index.d.ts +12 -0
  457. package/dist/steplist/intl/index.d.ts.map +1 -0
  458. package/dist/table/createTable.d.ts.map +1 -1
  459. package/dist/table/createTableCell.d.ts.map +1 -1
  460. package/dist/table/createTableColumnHeader.d.ts.map +1 -1
  461. package/dist/table/createTableColumnResize.d.ts +14 -2
  462. package/dist/table/createTableColumnResize.d.ts.map +1 -1
  463. package/dist/table/createTableHeaderRow.d.ts +1 -1
  464. package/dist/table/createTableHeaderRow.d.ts.map +1 -1
  465. package/dist/table/createTableRow.d.ts.map +1 -1
  466. package/dist/table/utils.d.ts +6 -0
  467. package/dist/table/utils.d.ts.map +1 -1
  468. package/dist/tabs/createTabs.d.ts +9 -0
  469. package/dist/tabs/createTabs.d.ts.map +1 -1
  470. package/dist/tag/createTag.d.ts.map +1 -1
  471. package/dist/tag/createTagGroup.d.ts +12 -4
  472. package/dist/tag/createTagGroup.d.ts.map +1 -1
  473. package/dist/textfield/createTextField.d.ts +10 -0
  474. package/dist/textfield/createTextField.d.ts.map +1 -1
  475. package/dist/toast/createToast.d.ts +2 -1
  476. package/dist/toast/createToast.d.ts.map +1 -1
  477. package/dist/toast/createToastRegion.d.ts +2 -1
  478. package/dist/toast/createToastRegion.d.ts.map +1 -1
  479. package/dist/toggle/createToggle.d.ts +5 -1
  480. package/dist/toggle/createToggle.d.ts.map +1 -1
  481. package/dist/tokenfield/createToken.d.ts.map +1 -1
  482. package/dist/tokenfield/createTokenField.d.ts +2 -2
  483. package/dist/tokenfield/createTokenField.d.ts.map +1 -1
  484. package/dist/tooltip/createTooltipTrigger.d.ts.map +1 -1
  485. package/dist/tree/createTree.d.ts.map +1 -1
  486. package/dist/tree/createTreeItem.d.ts.map +1 -1
  487. package/dist/tree/createTreeSelectionCheckbox.d.ts.map +1 -1
  488. package/dist/tree/types.d.ts +2 -1
  489. package/dist/tree/types.d.ts.map +1 -1
  490. package/dist/utils/animation.d.ts.map +1 -1
  491. package/dist/utils/callEventHandler.d.ts +7 -0
  492. package/dist/utils/callEventHandler.d.ts.map +1 -0
  493. package/dist/utils/capture.d.ts +2 -2
  494. package/dist/utils/capture.d.ts.map +1 -1
  495. package/dist/utils/dom.d.ts +13 -0
  496. package/dist/utils/dom.d.ts.map +1 -1
  497. package/dist/utils/env.d.ts +28 -2
  498. package/dist/utils/env.d.ts.map +1 -1
  499. package/dist/utils/focus.d.ts +2 -11
  500. package/dist/utils/focus.d.ts.map +1 -1
  501. package/dist/utils/focusWithoutScrolling.d.ts +10 -0
  502. package/dist/utils/focusWithoutScrolling.d.ts.map +1 -0
  503. package/dist/utils/index.d.ts +5 -3
  504. package/dist/utils/index.d.ts.map +1 -1
  505. package/dist/utils/index.js +6 -4
  506. package/dist/utils/index.jsx +6 -4
  507. package/dist/utils/openLink.d.ts +52 -0
  508. package/dist/utils/openLink.d.ts.map +1 -0
  509. package/dist/utils/platform.d.ts +10 -9
  510. package/dist/utils/platform.d.ts.map +1 -1
  511. package/dist/utils/textSelection.d.ts +5 -4
  512. package/dist/utils/textSelection.d.ts.map +1 -1
  513. package/package.json +2 -2
  514. package/src/actiongroup/createActionGroup.ts +8 -8
  515. package/src/autocomplete/createAutocomplete.ts +59 -15
  516. package/src/breadcrumbs/createBreadcrumbs.ts +29 -11
  517. package/src/button/createButton.ts +7 -2
  518. package/src/button/createToggleButton.ts +9 -10
  519. package/src/calendar/createCalendar.ts +99 -25
  520. package/src/calendar/createCalendarCell.ts +72 -81
  521. package/src/calendar/createCalendarGrid.ts +33 -5
  522. package/src/calendar/createCalendarYearPicker.ts +4 -2
  523. package/src/calendar/createRangeCalendar.ts +87 -20
  524. package/src/calendar/createRangeCalendarCell.ts +247 -94
  525. package/src/calendar/utils.ts +161 -62
  526. package/src/checkbox/createCheckbox.ts +19 -23
  527. package/src/checkbox/createCheckboxGroup.ts +55 -17
  528. package/src/checkbox/createCheckboxGroupItem.ts +67 -5
  529. package/src/collections/index.ts +16 -15
  530. package/src/color/createColorArea.ts +48 -14
  531. package/src/color/createColorField.ts +174 -20
  532. package/src/color/createColorSlider.ts +14 -1
  533. package/src/color/createColorWheel.ts +76 -8
  534. package/src/color/types.ts +2 -0
  535. package/src/combobox/createComboBox.ts +77 -81
  536. package/src/datepicker/createDateField.ts +16 -17
  537. package/src/datepicker/createDatePicker.ts +32 -4
  538. package/src/datepicker/createDatePickerGroup.ts +27 -24
  539. package/src/datepicker/createDateRangePicker.ts +43 -5
  540. package/src/datepicker/createDateSegment.ts +33 -20
  541. package/src/disclosure/createDisclosure.ts +8 -4
  542. package/src/dnd/DragManager.ts +17 -7
  543. package/src/dnd/createDraggableItem.ts +94 -56
  544. package/src/dnd/createDrop.ts +53 -3
  545. package/src/dnd/createDropIndicator.ts +92 -2
  546. package/src/dnd/createDroppableItem.ts +33 -1
  547. package/src/focus/FocusScope.tsx +257 -94
  548. package/src/focus/createAutoFocus.ts +46 -21
  549. package/src/form/createFormValidation.ts +52 -24
  550. package/src/grid/createGrid.ts +248 -4
  551. package/src/grid/createGridCell.ts +9 -3
  552. package/src/gridlist/createGridList.ts +98 -23
  553. package/src/gridlist/createGridListItem.ts +43 -11
  554. package/src/gridlist/types.ts +33 -1
  555. package/src/i18n/createDateFormatter.ts +3 -2
  556. package/src/i18n/locale.tsx +17 -1
  557. package/src/index.ts +35 -5
  558. package/src/interactions/createFocus.ts +9 -2
  559. package/src/interactions/createFocusRing.ts +11 -5
  560. package/src/interactions/createFocusWithin.ts +38 -7
  561. package/src/interactions/createFocusable.ts +23 -4
  562. package/src/interactions/createHover.ts +10 -27
  563. package/src/interactions/createKeyboard.ts +3 -3
  564. package/src/interactions/createLongPress.ts +43 -13
  565. package/src/interactions/createPress.ts +25 -34
  566. package/src/label/createLabels.ts +4 -11
  567. package/src/landmark/createLandmark.ts +470 -169
  568. package/src/link/createLink.ts +29 -30
  569. package/src/listbox/createListBox.ts +28 -0
  570. package/src/live-announcer/announce.ts +9 -7
  571. package/src/menu/createMenu.ts +62 -341
  572. package/src/menu/createMenuItem.ts +51 -44
  573. package/src/numberfield/createNumberField.ts +209 -31
  574. package/src/numberfield/index.ts +7 -0
  575. package/src/numberfield/intl.ts +240 -0
  576. package/src/overlays/createCloseOnScroll.ts +90 -0
  577. package/src/overlays/createInteractOutside.ts +9 -31
  578. package/src/overlays/createOverlay.ts +0 -36
  579. package/src/overlays/index.ts +3 -0
  580. package/src/popover/createOverlayPosition.ts +13 -30
  581. package/src/popover/createPopover.ts +35 -6
  582. package/src/progress/createProgressBar.ts +4 -1
  583. package/src/radio/createRadio.ts +5 -21
  584. package/src/radio/createRadioGroup.ts +98 -87
  585. package/src/searchfield/createSearchField.ts +3 -0
  586. package/src/select/createHiddenSelect.tsx +50 -100
  587. package/src/select/createSelect.ts +82 -47
  588. package/src/selection/ListKeyboardDelegate.ts +10 -3
  589. package/src/selection/createCollectionRowInteraction.ts +2 -2
  590. package/src/selection/createSelectableCollection.ts +76 -53
  591. package/src/selection/createSelectableItem.ts +174 -38
  592. package/src/selection/createSelectableList.ts +5 -2
  593. package/src/selection/createTypeSelect.ts +15 -8
  594. package/src/slider/createSlider.ts +546 -293
  595. package/src/slider/createSliderThumb.ts +46 -0
  596. package/src/slider/index.ts +1 -0
  597. package/src/ssr/index.tsx +21 -7
  598. package/src/steplist/createStepList.ts +96 -47
  599. package/src/steplist/index.ts +3 -0
  600. package/src/steplist/intl/ar-AE.json +3 -0
  601. package/src/steplist/intl/bg-BG.json +3 -0
  602. package/src/steplist/intl/cs-CZ.json +3 -0
  603. package/src/steplist/intl/da-DK.json +3 -0
  604. package/src/steplist/intl/de-DE.json +3 -0
  605. package/src/steplist/intl/el-GR.json +3 -0
  606. package/src/steplist/intl/en-US.json +3 -0
  607. package/src/steplist/intl/es-ES.json +3 -0
  608. package/src/steplist/intl/et-EE.json +3 -0
  609. package/src/steplist/intl/fi-FI.json +3 -0
  610. package/src/steplist/intl/fr-FR.json +3 -0
  611. package/src/steplist/intl/he-IL.json +3 -0
  612. package/src/steplist/intl/hr-HR.json +3 -0
  613. package/src/steplist/intl/hu-HU.json +3 -0
  614. package/src/steplist/intl/index.ts +88 -0
  615. package/src/steplist/intl/it-IT.json +3 -0
  616. package/src/steplist/intl/ja-JP.json +3 -0
  617. package/src/steplist/intl/ko-KR.json +3 -0
  618. package/src/steplist/intl/lt-LT.json +3 -0
  619. package/src/steplist/intl/lv-LV.json +3 -0
  620. package/src/steplist/intl/nb-NO.json +3 -0
  621. package/src/steplist/intl/nl-NL.json +3 -0
  622. package/src/steplist/intl/pl-PL.json +3 -0
  623. package/src/steplist/intl/pt-BR.json +3 -0
  624. package/src/steplist/intl/pt-PT.json +3 -0
  625. package/src/steplist/intl/ro-RO.json +3 -0
  626. package/src/steplist/intl/ru-RU.json +3 -0
  627. package/src/steplist/intl/sk-SK.json +3 -0
  628. package/src/steplist/intl/sl-SI.json +3 -0
  629. package/src/steplist/intl/sr-SP.json +3 -0
  630. package/src/steplist/intl/sv-SE.json +3 -0
  631. package/src/steplist/intl/tr-TR.json +3 -0
  632. package/src/steplist/intl/uk-UA.json +3 -0
  633. package/src/steplist/intl/zh-CN.json +3 -0
  634. package/src/steplist/intl/zh-TW.json +3 -0
  635. package/src/table/createTable.ts +154 -42
  636. package/src/table/createTableCell.ts +9 -4
  637. package/src/table/createTableColumnHeader.ts +42 -12
  638. package/src/table/createTableColumnResize.ts +286 -101
  639. package/src/table/createTableHeaderRow.ts +3 -3
  640. package/src/table/createTableRow.ts +20 -4
  641. package/src/table/utils.ts +13 -1
  642. package/src/tabs/createTabs.ts +46 -40
  643. package/src/tag/createTag.ts +103 -207
  644. package/src/tag/createTagGroup.ts +141 -94
  645. package/src/textfield/createTextField.ts +16 -0
  646. package/src/toast/createToast.ts +33 -16
  647. package/src/toast/createToastRegion.ts +32 -9
  648. package/src/toggle/createToggle.ts +78 -11
  649. package/src/tokenfield/createToken.ts +21 -3
  650. package/src/tokenfield/createTokenField.ts +194 -98
  651. package/src/tooltip/createTooltipTrigger.ts +1 -8
  652. package/src/tree/createTree.ts +19 -3
  653. package/src/tree/createTreeItem.ts +8 -15
  654. package/src/tree/createTreeSelectionCheckbox.ts +6 -3
  655. package/src/tree/types.ts +2 -1
  656. package/src/utils/animation.ts +8 -52
  657. package/src/utils/callEventHandler.ts +23 -0
  658. package/src/utils/capture.ts +23 -6
  659. package/src/utils/dom.ts +69 -40
  660. package/src/utils/env.ts +32 -3
  661. package/src/utils/focus.ts +5 -72
  662. package/src/utils/focusWithoutScrolling.ts +95 -0
  663. package/src/utils/index.ts +26 -1
  664. package/src/utils/openLink.ts +241 -0
  665. package/src/utils/platform.ts +66 -34
  666. package/src/utils/textSelection.ts +38 -65
  667. package/dist/_chunk/createFormValidation.js +0 -159
  668. package/dist/_chunk/createFormValidation.js.map +0 -1
  669. package/dist/_chunk/createFormValidation.jsx +0 -159
  670. package/dist/_chunk/createFormValidation.jsx.map +0 -1
  671. package/dist/_chunk/intl.js +0 -280
  672. package/dist/_chunk/intl.js.map +0 -1
  673. package/dist/_chunk/intl.jsx +0 -280
  674. package/dist/_chunk/intl.jsx.map +0 -1
package/README.md CHANGED
@@ -1,59 +1,86 @@
1
1
  # @proyecto-viviana/solidaria
2
2
 
3
- SolidJS port of React Aria hooks and accessibility behavior primitives.
3
+ A Solid port of Adobe's React Aria: the behavior layer. Its hooks give you
4
+ ARIA attributes, press, hover, focus, keyboard, and internationalization, and
5
+ leave every element and every class to you.
4
6
 
5
- This package is the behavior layer below `solidaria-components`. It provides
6
- hooks such as `createButton`, `createPress`, `createListBox`, `createSelect`,
7
- `createDatePicker`, `createCalendar`, `createTable`, and drag-and-drop helpers.
7
+ If you know React Aria, the shape is the same: `createButton` where upstream
8
+ has `useButton`. Solid's hooks return accessors where React's return values.
8
9
 
9
10
  ## Install
10
11
 
12
+ Requires **Solid 2**. `solid-js` and `@solidjs/web` are peer dependencies, at
13
+ `>=2.0.0-rc.9 <3`.
14
+
11
15
  ```bash
12
- npm install @proyecto-viviana/solidaria @proyecto-viviana/solid-stately solid-js
16
+ npm install @proyecto-viviana/solidaria@rc solid-js@next @solidjs/web@next
13
17
  ```
14
18
 
15
- ## Usage
19
+ The release candidate is on the `rc` tag. The `latest` tag is the Solid 1
20
+ line.
21
+
22
+ ## Example
23
+
24
+ Spread the returned props onto the exact element that owns the role.
16
25
 
17
26
  ```tsx
18
27
  import { createButton } from "@proyecto-viviana/solidaria";
19
28
 
20
- export function Button(props) {
21
- let ref!: HTMLButtonElement;
22
- const { buttonProps, isPressed } = createButton(props, () => ref);
29
+ export function Button(props: { onPress?: () => void; children?: string }) {
30
+ const { buttonProps, isPressed } = createButton(props);
23
31
 
24
32
  return (
25
- <button {...buttonProps} ref={ref} data-pressed={isPressed() || undefined}>
33
+ <button {...buttonProps} data-pressed={isPressed() || undefined}>
26
34
  {props.children}
27
35
  </button>
28
36
  );
29
37
  }
30
38
  ```
31
39
 
32
- Most hooks return prop objects and reactive state accessors. Spread the returned
33
- props onto the exact element that owns the ARIA role or interaction.
40
+ ## In the chain
41
+
42
+ ```text
43
+ solid-stately
44
+ ↓
45
+ solidaria ← you are here
46
+ ↓
47
+ solidaria-components
48
+ ↓
49
+ solid-spectrum · @proyecto-viviana/ui · kumo · geist
50
+ ```
34
51
 
35
- ## Public Surface
52
+ It depends on `@proyecto-viviana/solid-stately` and the
53
+ `@internationalized/*` packages.
36
54
 
37
- The source of truth is [`src/index.ts`](src/index.ts). Keep README examples
38
- small; use tests and the barrel for the actual export inventory.
55
+ ## Status
39
56
 
40
- Major areas currently covered:
57
+ Published, and part of a port that is not finished. An export is a floor, not
58
+ proof that a behavior matches upstream.
59
+ [`src/index.ts`](src/index.ts) is the only source of truth for the public
60
+ surface.
41
61
 
42
- - interactions: press, hover, focus, long press, move, keyboard;
43
- - labels and fields;
44
- - overlays, modal behavior, popovers, and focus scope;
45
- - buttons, toggles, links, forms, and validation;
46
- - collection widgets: listbox, menu, select, combo box, grid, table, tree;
47
- - date, time, calendar, and date picker primitives;
48
- - color, drag-and-drop, landmarks, i18n, SSR, and visually hidden utilities.
62
+ What this release candidate is known to get wrong is listed under
63
+ [known gaps](https://github.com/proyecto-viviana/ui#known-gaps-in-this-release-candidate).
49
64
 
50
- ## Verification
65
+ ## Evidence
51
66
 
52
67
  ```bash
53
68
  vp run --filter @proyecto-viviana/solidaria build
54
- vp test run packages
69
+ vp run test:run
55
70
  vp run guard:rac-export-gap
56
71
  ```
57
72
 
58
- Behavior changes need tests that assert ARIA attributes, focus movement,
59
- keyboard behavior, and user-visible event semantics.
73
+ A behavior change carries tests that assert ARIA attributes, focus movement,
74
+ keyboard behavior, and event semantics. What "ported" means here is
75
+ [the evidence bar](https://github.com/proyecto-viviana/ui/blob/main/.claude/current/certification.md).
76
+
77
+ ## Links
78
+
79
+ - Documentation: <https://ui.proyectoviviana.org>
80
+ - Repository: <https://github.com/proyecto-viviana/ui>
81
+
82
+ ## License
83
+
84
+ MIT AND Apache-2.0. Our work is MIT; the port of Adobe's React Aria keeps
85
+ Apache-2.0. A ported Microsoft Tabster file keeps its MIT notice. All of them
86
+ ship in this package's `NOTICE`.
@@ -23,7 +23,8 @@
23
23
  */
24
24
  // Ported to SolidJS for Proyecto Viviana; based on packages/react-aria/src/dnd/constants.ts
25
25
  // Ported to SolidJS for Proyecto Viviana; based on packages/react-aria/src/dnd/utils.ts
26
- import { H as isVirtualPointerEvent, N as getInteractionModality, V as isVirtualClick, n as getActiveElement, r as getEventTarget, v as nodeContains } from "./dom.js";
26
+ import { a as getEventTarget, i as getActiveElement, x as nodeContains } from "./dom.js";
27
+ import { g as isVirtualPointerEvent, h as isVirtualClick, o as getInteractionModality } from "./createInteractionModality.js";
27
28
  import { t as announce } from "./announce.js";
28
29
  import { t as ariaHideOutside } from "./ariaHideOutside.js";
29
30
  import { createSignal } from "solid-js";
@@ -285,12 +286,13 @@ function beginDragging(target, stringFormatter) {
285
286
  if (dragSession) throw new Error("Cannot begin dragging while already dragging");
286
287
  dragSession = new DragSession(target, stringFormatter);
287
288
  setTrackedDragSession(dragSession);
288
- requestAnimationFrame(() => {
289
- if (dragSession) {
290
- dragSession.setup();
291
- if (getDragModality() === "keyboard") dragSession.next();
292
- }
293
- });
289
+ if (dragSession) {
290
+ const session = dragSession;
291
+ session.setup();
292
+ if (getDragModality() === "keyboard") queueMicrotask(() => {
293
+ if (dragSession === session) session.next();
294
+ });
295
+ }
294
296
  }
295
297
  /** Reactive accessor for the active drag session, or null. */
296
298
  function createDragSession() {
@@ -1 +1 @@
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 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 // 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,IAA4C;EACvB,IAAA;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,uBAAuB,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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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vD,IAAI,QAAoB,KAAK,WAAW,MAAM,KAAK,UAAU;IAC3D,MAAM;IACN,OAAO,IAAI,IAAI,OAAO,KAAK,IAAI,CAAC;IAChC,UAAU,SAAiB,QAAQ,QAAQ,KAAK,KAAK;GACvD,EAAE;GAEF,IAAI,OAAO,KAAK,kBAAkB,QAAQ,sBAAsB;GAChE,KAAK,kBAAkB,OACrB;IACE,MAAM;IACN,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"}
@@ -23,7 +23,8 @@
23
23
  */
24
24
  // Ported to SolidJS for Proyecto Viviana; based on packages/react-aria/src/dnd/constants.ts
25
25
  // Ported to SolidJS for Proyecto Viviana; based on packages/react-aria/src/dnd/utils.ts
26
- import { H as isVirtualPointerEvent, N as getInteractionModality, V as isVirtualClick, n as getActiveElement, r as getEventTarget, v as nodeContains } from "./dom.jsx";
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";
27
28
  import { t as announce } from "./announce.jsx";
28
29
  import { t as ariaHideOutside } from "./ariaHideOutside.jsx";
29
30
  import { createSignal } from "solid-js";
@@ -285,12 +286,13 @@ function beginDragging(target, stringFormatter) {
285
286
  if (dragSession) throw new Error("Cannot begin dragging while already dragging");
286
287
  dragSession = new DragSession(target, stringFormatter);
287
288
  setTrackedDragSession(dragSession);
288
- requestAnimationFrame(() => {
289
- if (dragSession) {
290
- dragSession.setup();
291
- if (getDragModality() === "keyboard") dragSession.next();
292
- }
293
- });
289
+ if (dragSession) {
290
+ const session = dragSession;
291
+ session.setup();
292
+ if (getDragModality() === "keyboard") queueMicrotask(() => {
293
+ if (dragSession === session) session.next();
294
+ });
295
+ }
294
296
  }
295
297
  /** Reactive accessor for the active drag session, or null. */
296
298
  function createDragSession() {