@proyecto-viviana/solidaria 0.3.0 → 0.4.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.
- package/dist/_chunk/DragManager.js +627 -0
- package/dist/_chunk/DragManager.js.map +1 -0
- package/dist/_chunk/DragManager.jsx +627 -0
- package/dist/_chunk/DragManager.jsx.map +1 -0
- package/dist/_chunk/FocusScope.js +400 -0
- package/dist/_chunk/FocusScope.js.map +1 -0
- package/dist/_chunk/FocusScope.jsx +375 -0
- package/dist/_chunk/FocusScope.jsx.map +1 -0
- package/dist/_chunk/actiongroup.js +141 -0
- package/dist/_chunk/actiongroup.js.map +1 -0
- package/dist/_chunk/actiongroup.jsx +141 -0
- package/dist/_chunk/actiongroup.jsx.map +1 -0
- package/dist/_chunk/announce.js +207 -0
- package/dist/_chunk/announce.js.map +1 -0
- package/dist/_chunk/announce.jsx +207 -0
- package/dist/_chunk/announce.jsx.map +1 -0
- package/dist/_chunk/ariaHideOutside.js +122 -0
- package/dist/_chunk/ariaHideOutside.js.map +1 -0
- package/dist/_chunk/ariaHideOutside.jsx +122 -0
- package/dist/_chunk/ariaHideOutside.jsx.map +1 -0
- package/dist/_chunk/autocomplete.js +244 -0
- package/dist/_chunk/autocomplete.js.map +1 -0
- package/dist/_chunk/autocomplete.jsx +244 -0
- package/dist/_chunk/autocomplete.jsx.map +1 -0
- package/dist/_chunk/breadcrumbs.js +121 -0
- package/dist/_chunk/breadcrumbs.js.map +1 -0
- package/dist/_chunk/breadcrumbs.jsx +121 -0
- package/dist/_chunk/breadcrumbs.jsx.map +1 -0
- package/dist/_chunk/button.js +275 -0
- package/dist/_chunk/button.js.map +1 -0
- package/dist/_chunk/button.jsx +275 -0
- package/dist/_chunk/button.jsx.map +1 -0
- package/dist/_chunk/calendar.js +1037 -0
- package/dist/_chunk/calendar.js.map +1 -0
- package/dist/_chunk/calendar.jsx +1037 -0
- package/dist/_chunk/calendar.jsx.map +1 -0
- package/dist/_chunk/checkbox.js +235 -0
- package/dist/_chunk/checkbox.js.map +1 -0
- package/dist/_chunk/checkbox.jsx +235 -0
- package/dist/_chunk/checkbox.jsx.map +1 -0
- package/dist/_chunk/color.js +1458 -0
- package/dist/_chunk/color.js.map +1 -0
- package/dist/_chunk/color.jsx +1458 -0
- package/dist/_chunk/color.jsx.map +1 -0
- package/dist/_chunk/combobox.js +1062 -0
- package/dist/_chunk/combobox.js.map +1 -0
- package/dist/_chunk/combobox.jsx +1062 -0
- package/dist/_chunk/combobox.jsx.map +1 -0
- package/dist/_chunk/constants.js +19 -0
- package/dist/_chunk/constants.js.map +1 -0
- package/dist/_chunk/constants.jsx +19 -0
- package/dist/_chunk/constants.jsx.map +1 -0
- package/dist/_chunk/createCollator.js +61 -0
- package/dist/_chunk/createCollator.js.map +1 -0
- package/dist/_chunk/createCollator.jsx +61 -0
- package/dist/_chunk/createCollator.jsx.map +1 -0
- package/dist/_chunk/createCollectionRowInteraction.js +133 -0
- package/dist/_chunk/createCollectionRowInteraction.js.map +1 -0
- package/dist/_chunk/createCollectionRowInteraction.jsx +133 -0
- package/dist/_chunk/createCollectionRowInteraction.jsx.map +1 -0
- package/dist/_chunk/createField.js +55 -0
- package/dist/_chunk/createField.js.map +1 -0
- package/dist/_chunk/createField.jsx +55 -0
- package/dist/_chunk/createField.jsx.map +1 -0
- package/dist/_chunk/createFocus.js +105 -0
- package/dist/_chunk/createFocus.js.map +1 -0
- package/dist/_chunk/createFocus.jsx +105 -0
- package/dist/_chunk/createFocus.jsx.map +1 -0
- package/dist/_chunk/createFocusRing.js +54 -0
- package/dist/_chunk/createFocusRing.js.map +1 -0
- package/dist/_chunk/createFocusRing.jsx +54 -0
- package/dist/_chunk/createFocusRing.jsx.map +1 -0
- package/dist/_chunk/createFocusWithin.js +120 -0
- package/dist/_chunk/createFocusWithin.js.map +1 -0
- package/dist/_chunk/createFocusWithin.jsx +120 -0
- package/dist/_chunk/createFocusWithin.jsx.map +1 -0
- package/dist/_chunk/createFocusable.js +131 -0
- package/dist/_chunk/createFocusable.js.map +1 -0
- package/dist/_chunk/createFocusable.jsx +131 -0
- package/dist/_chunk/createFocusable.jsx.map +1 -0
- package/dist/_chunk/createFormReset.js +39 -0
- package/dist/_chunk/createFormReset.js.map +1 -0
- package/dist/_chunk/createFormReset.jsx +39 -0
- package/dist/_chunk/createFormReset.jsx.map +1 -0
- package/dist/_chunk/createFormValidation.js +135 -0
- package/dist/_chunk/createFormValidation.js.map +1 -0
- package/dist/_chunk/createFormValidation.jsx +135 -0
- package/dist/_chunk/createFormValidation.jsx.map +1 -0
- package/dist/_chunk/createHover.js +131 -0
- package/dist/_chunk/createHover.js.map +1 -0
- package/dist/_chunk/createHover.jsx +131 -0
- package/dist/_chunk/createHover.jsx.map +1 -0
- package/dist/_chunk/createInteractionModality.js +268 -0
- package/dist/_chunk/createInteractionModality.js.map +1 -0
- package/dist/_chunk/createInteractionModality.jsx +268 -0
- package/dist/_chunk/createInteractionModality.jsx.map +1 -0
- package/dist/_chunk/createLabel.js +47 -0
- package/dist/_chunk/createLabel.js.map +1 -0
- package/dist/_chunk/createLabel.jsx +47 -0
- package/dist/_chunk/createLabel.jsx.map +1 -0
- package/dist/_chunk/createLabels.js +32 -0
- package/dist/_chunk/createLabels.js.map +1 -0
- package/dist/_chunk/createLabels.jsx +32 -0
- package/dist/_chunk/createLabels.jsx.map +1 -0
- package/dist/_chunk/createLandmark.js +198 -0
- package/dist/_chunk/createLandmark.js.map +1 -0
- package/dist/_chunk/createLandmark.jsx +198 -0
- package/dist/_chunk/createLandmark.jsx.map +1 -0
- package/dist/_chunk/createOverlay.js +327 -0
- package/dist/_chunk/createOverlay.js.map +1 -0
- package/dist/_chunk/createOverlay.jsx +327 -0
- package/dist/_chunk/createOverlay.jsx.map +1 -0
- package/dist/_chunk/createPress.js +526 -0
- package/dist/_chunk/createPress.js.map +1 -0
- package/dist/_chunk/createPress.jsx +526 -0
- package/dist/_chunk/createPress.jsx.map +1 -0
- package/dist/_chunk/createProgressBar.js +82 -0
- package/dist/_chunk/createProgressBar.js.map +1 -0
- package/dist/_chunk/createProgressBar.jsx +82 -0
- package/dist/_chunk/createProgressBar.jsx.map +1 -0
- package/dist/_chunk/createSelectableItem.js +302 -0
- package/dist/_chunk/createSelectableItem.js.map +1 -0
- package/dist/_chunk/createSelectableItem.jsx +302 -0
- package/dist/_chunk/createSelectableItem.jsx.map +1 -0
- package/dist/_chunk/createStringFormatter.js +61 -0
- package/dist/_chunk/createStringFormatter.js.map +1 -0
- package/dist/_chunk/createStringFormatter.jsx +61 -0
- package/dist/_chunk/createStringFormatter.jsx.map +1 -0
- package/dist/_chunk/createToggle.js +159 -0
- package/dist/_chunk/createToggle.js.map +1 -0
- package/dist/_chunk/createToggle.jsx +159 -0
- package/dist/_chunk/createToggle.jsx.map +1 -0
- package/dist/_chunk/createTypeSelect.js +125 -0
- package/dist/_chunk/createTypeSelect.js.map +1 -0
- package/dist/_chunk/createTypeSelect.jsx +125 -0
- package/dist/_chunk/createTypeSelect.jsx.map +1 -0
- package/dist/_chunk/datepicker.js +1706 -0
- package/dist/_chunk/datepicker.js.map +1 -0
- package/dist/_chunk/datepicker.jsx +1706 -0
- package/dist/_chunk/datepicker.jsx.map +1 -0
- package/dist/_chunk/dialog.js +62 -0
- package/dist/_chunk/dialog.js.map +1 -0
- package/dist/_chunk/dialog.jsx +62 -0
- package/dist/_chunk/dialog.jsx.map +1 -0
- package/dist/_chunk/disclosure.js +185 -0
- package/dist/_chunk/disclosure.js.map +1 -0
- package/dist/_chunk/disclosure.jsx +185 -0
- package/dist/_chunk/disclosure.jsx.map +1 -0
- package/dist/_chunk/dnd.js +2395 -0
- package/dist/_chunk/dnd.js.map +1 -0
- package/dist/_chunk/dnd.jsx +2395 -0
- package/dist/_chunk/dnd.jsx.map +1 -0
- package/dist/_chunk/env.js +87 -0
- package/dist/_chunk/env.js.map +1 -0
- package/dist/_chunk/env.jsx +87 -0
- package/dist/_chunk/env.jsx.map +1 -0
- package/dist/_chunk/filterDOMProps.js +82 -0
- package/dist/_chunk/filterDOMProps.js.map +1 -0
- package/dist/_chunk/filterDOMProps.jsx +82 -0
- package/dist/_chunk/filterDOMProps.jsx.map +1 -0
- package/dist/_chunk/focus.js +399 -0
- package/dist/_chunk/focus.js.map +1 -0
- package/dist/_chunk/focus.jsx +399 -0
- package/dist/_chunk/focus.jsx.map +1 -0
- package/dist/_chunk/focus2.js +631 -0
- package/dist/_chunk/focus2.js.map +1 -0
- package/dist/_chunk/focus2.jsx +631 -0
- package/dist/_chunk/focus2.jsx.map +1 -0
- package/dist/_chunk/grid.js +623 -0
- package/dist/_chunk/grid.js.map +1 -0
- package/dist/_chunk/grid.jsx +623 -0
- package/dist/_chunk/grid.jsx.map +1 -0
- package/dist/_chunk/gridlist.js +369 -0
- package/dist/_chunk/gridlist.js.map +1 -0
- package/dist/_chunk/gridlist.jsx +369 -0
- package/dist/_chunk/gridlist.jsx.map +1 -0
- package/dist/_chunk/i18n.js +199 -0
- package/dist/_chunk/i18n.js.map +1 -0
- package/dist/_chunk/i18n.jsx +199 -0
- package/dist/_chunk/i18n.jsx.map +1 -0
- package/dist/_chunk/interactions.js +331 -0
- package/dist/_chunk/interactions.js.map +1 -0
- package/dist/_chunk/interactions.jsx +325 -0
- package/dist/_chunk/interactions.jsx.map +1 -0
- package/dist/_chunk/link.js +97 -0
- package/dist/_chunk/link.js.map +1 -0
- package/dist/_chunk/link.jsx +97 -0
- package/dist/_chunk/link.jsx.map +1 -0
- package/dist/_chunk/listbox.js +356 -0
- package/dist/_chunk/listbox.js.map +1 -0
- package/dist/_chunk/listbox.jsx +356 -0
- package/dist/_chunk/listbox.jsx.map +1 -0
- package/dist/_chunk/locale.js +173 -0
- package/dist/_chunk/locale.js.map +1 -0
- package/dist/_chunk/locale.jsx +167 -0
- package/dist/_chunk/locale.jsx.map +1 -0
- package/dist/_chunk/menu.js +519 -0
- package/dist/_chunk/menu.js.map +1 -0
- package/dist/_chunk/menu.jsx +519 -0
- package/dist/_chunk/menu.jsx.map +1 -0
- package/dist/_chunk/meter.js +33 -0
- package/dist/_chunk/meter.js.map +1 -0
- package/dist/_chunk/meter.jsx +33 -0
- package/dist/_chunk/meter.jsx.map +1 -0
- package/dist/_chunk/numberfield.js +259 -0
- package/dist/_chunk/numberfield.js.map +1 -0
- package/dist/_chunk/numberfield.jsx +259 -0
- package/dist/_chunk/numberfield.jsx.map +1 -0
- package/dist/_chunk/overlays.js +186 -0
- package/dist/_chunk/overlays.js.map +1 -0
- package/dist/_chunk/overlays.jsx +162 -0
- package/dist/_chunk/overlays.jsx.map +1 -0
- package/dist/_chunk/popover.js +574 -0
- package/dist/_chunk/popover.js.map +1 -0
- package/dist/_chunk/popover.jsx +574 -0
- package/dist/_chunk/popover.jsx.map +1 -0
- package/dist/_chunk/radio.js +320 -0
- package/dist/_chunk/radio.js.map +1 -0
- package/dist/_chunk/radio.jsx +320 -0
- package/dist/_chunk/radio.jsx.map +1 -0
- package/dist/_chunk/reactivity.js +21 -0
- package/dist/_chunk/reactivity.js.map +1 -0
- package/dist/_chunk/reactivity.jsx +21 -0
- package/dist/_chunk/reactivity.jsx.map +1 -0
- package/dist/_chunk/searchfield.js +210 -0
- package/dist/_chunk/searchfield.js.map +1 -0
- package/dist/_chunk/searchfield.jsx +210 -0
- package/dist/_chunk/searchfield.jsx.map +1 -0
- package/dist/_chunk/select.js +406 -0
- package/dist/_chunk/select.js.map +1 -0
- package/dist/_chunk/select.jsx +397 -0
- package/dist/_chunk/select.jsx.map +1 -0
- package/dist/_chunk/selection.js +666 -0
- package/dist/_chunk/selection.js.map +1 -0
- package/dist/_chunk/selection.jsx +666 -0
- package/dist/_chunk/selection.jsx.map +1 -0
- package/dist/_chunk/separator.js +29 -0
- package/dist/_chunk/separator.js.map +1 -0
- package/dist/_chunk/separator.jsx +29 -0
- package/dist/_chunk/separator.jsx.map +1 -0
- package/dist/_chunk/slider.js +256 -0
- package/dist/_chunk/slider.js.map +1 -0
- package/dist/_chunk/slider.jsx +256 -0
- package/dist/_chunk/slider.jsx.map +1 -0
- package/dist/_chunk/spinbutton.js +153 -0
- package/dist/_chunk/spinbutton.js.map +1 -0
- package/dist/_chunk/spinbutton.jsx +153 -0
- package/dist/_chunk/spinbutton.jsx.map +1 -0
- package/dist/_chunk/steplist.js +66 -0
- package/dist/_chunk/steplist.js.map +1 -0
- package/dist/_chunk/steplist.jsx +66 -0
- package/dist/_chunk/steplist.jsx.map +1 -0
- package/dist/_chunk/switch.js +34 -0
- package/dist/_chunk/switch.js.map +1 -0
- package/dist/_chunk/switch.jsx +34 -0
- package/dist/_chunk/switch.jsx.map +1 -0
- package/dist/_chunk/table.js +1088 -0
- package/dist/_chunk/table.js.map +1 -0
- package/dist/_chunk/table.jsx +1088 -0
- package/dist/_chunk/table.jsx.map +1 -0
- package/dist/_chunk/tabs.js +263 -0
- package/dist/_chunk/tabs.js.map +1 -0
- package/dist/_chunk/tabs.jsx +263 -0
- package/dist/_chunk/tabs.jsx.map +1 -0
- package/dist/_chunk/tag.js +322 -0
- package/dist/_chunk/tag.js.map +1 -0
- package/dist/_chunk/tag.jsx +322 -0
- package/dist/_chunk/tag.jsx.map +1 -0
- package/dist/_chunk/textfield.js +110 -0
- package/dist/_chunk/textfield.js.map +1 -0
- package/dist/_chunk/textfield.jsx +110 -0
- package/dist/_chunk/textfield.jsx.map +1 -0
- package/dist/_chunk/toast.js +250 -0
- package/dist/_chunk/toast.js.map +1 -0
- package/dist/_chunk/toast.jsx +250 -0
- package/dist/_chunk/toast.jsx.map +1 -0
- package/dist/_chunk/toolbar.js +226 -0
- package/dist/_chunk/toolbar.js.map +1 -0
- package/dist/_chunk/toolbar.jsx +226 -0
- package/dist/_chunk/toolbar.jsx.map +1 -0
- package/dist/_chunk/tooltip.js +185 -0
- package/dist/_chunk/tooltip.js.map +1 -0
- package/dist/_chunk/tooltip.jsx +185 -0
- package/dist/_chunk/tooltip.jsx.map +1 -0
- package/dist/_chunk/tree.js +452 -0
- package/dist/_chunk/tree.js.map +1 -0
- package/dist/_chunk/tree.jsx +452 -0
- package/dist/_chunk/tree.jsx.map +1 -0
- package/dist/_chunk/utils.js +705 -0
- package/dist/_chunk/utils.js.map +1 -0
- package/dist/_chunk/utils.jsx +705 -0
- package/dist/_chunk/utils.jsx.map +1 -0
- package/dist/_chunk/visually-hidden.js +93 -0
- package/dist/_chunk/visually-hidden.js.map +1 -0
- package/dist/_chunk/visually-hidden.jsx +93 -0
- package/dist/_chunk/visually-hidden.jsx.map +1 -0
- package/dist/actiongroup/createActionGroup.d.ts.map +1 -1
- package/dist/actiongroup/index.js +2 -0
- package/dist/actiongroup/index.jsx +2 -0
- package/dist/autocomplete/createAutocomplete.d.ts +12 -7
- package/dist/autocomplete/createAutocomplete.d.ts.map +1 -1
- package/dist/autocomplete/index.js +2 -0
- package/dist/autocomplete/index.jsx +2 -0
- package/dist/breadcrumbs/createBreadcrumbs.d.ts.map +1 -1
- package/dist/breadcrumbs/index.js +2 -0
- package/dist/breadcrumbs/index.jsx +2 -0
- package/dist/button/createToggleButtonGroup.d.ts.map +1 -1
- package/dist/button/index.js +2 -0
- package/dist/button/index.jsx +2 -0
- package/dist/calendar/createCalendar.d.ts.map +1 -1
- package/dist/calendar/createCalendarCell.d.ts.map +1 -1
- package/dist/calendar/createCalendarGrid.d.ts.map +1 -1
- package/dist/calendar/createCalendarMonthPicker.d.ts +41 -0
- package/dist/calendar/createCalendarMonthPicker.d.ts.map +1 -0
- package/dist/calendar/createCalendarYearPicker.d.ts +49 -0
- package/dist/calendar/createCalendarYearPicker.d.ts.map +1 -0
- package/dist/calendar/createRangeCalendar.d.ts.map +1 -1
- package/dist/calendar/createRangeCalendarCell.d.ts.map +1 -1
- package/dist/calendar/index.d.ts +2 -0
- package/dist/calendar/index.d.ts.map +1 -1
- package/dist/calendar/index.js +2 -0
- package/dist/calendar/index.jsx +2 -0
- package/dist/calendar/intl/index.d.ts +1 -1
- package/dist/calendar/intl/index.d.ts.map +1 -1
- package/dist/calendar/utils.d.ts +4 -0
- package/dist/calendar/utils.d.ts.map +1 -1
- package/dist/checkbox/createCheckbox.d.ts +4 -0
- package/dist/checkbox/createCheckbox.d.ts.map +1 -1
- package/dist/checkbox/createCheckboxGroupItem.d.ts.map +1 -1
- package/dist/checkbox/index.js +2 -0
- package/dist/checkbox/index.jsx +2 -0
- package/dist/collections/index.js +160 -0
- package/dist/collections/index.js.map +1 -0
- package/dist/collections/index.jsx +160 -0
- package/dist/collections/index.jsx.map +1 -0
- package/dist/color/createColorArea.d.ts.map +1 -1
- package/dist/color/createColorField.d.ts.map +1 -1
- package/dist/color/createColorSlider.d.ts.map +1 -1
- package/dist/color/createColorSwatch.d.ts.map +1 -1
- package/dist/color/createColorWheel.d.ts.map +1 -1
- package/dist/color/index.js +2 -0
- package/dist/color/index.jsx +2 -0
- package/dist/color/intl/index.d.ts +30 -0
- package/dist/color/intl/index.d.ts.map +1 -0
- package/dist/combobox/createComboBox.d.ts.map +1 -1
- package/dist/combobox/index.js +2 -0
- package/dist/combobox/index.jsx +2 -0
- package/dist/combobox/intl/generated-locales.d.ts +16 -0
- package/dist/combobox/intl/generated-locales.d.ts.map +1 -0
- package/dist/combobox/intl/index.d.ts +2 -2
- package/dist/combobox/intl/index.d.ts.map +1 -1
- package/dist/datepicker/createDateField.d.ts +45 -23
- package/dist/datepicker/createDateField.d.ts.map +1 -1
- package/dist/datepicker/createDatePicker.d.ts +34 -6
- package/dist/datepicker/createDatePicker.d.ts.map +1 -1
- package/dist/datepicker/createDatePickerGroup.d.ts +13 -13
- package/dist/datepicker/createDatePickerGroup.d.ts.map +1 -1
- package/dist/datepicker/createDateRangePicker.d.ts +55 -7
- package/dist/datepicker/createDateRangePicker.d.ts.map +1 -1
- package/dist/datepicker/createDateSegment.d.ts +6 -15
- package/dist/datepicker/createDateSegment.d.ts.map +1 -1
- package/dist/datepicker/createDisplayNames.d.ts +17 -0
- package/dist/datepicker/createDisplayNames.d.ts.map +1 -0
- package/dist/datepicker/createTimeField.d.ts +12 -49
- package/dist/datepicker/createTimeField.d.ts.map +1 -1
- package/dist/datepicker/index.d.ts +3 -3
- package/dist/datepicker/index.d.ts.map +1 -1
- package/dist/datepicker/index.js +2 -0
- package/dist/datepicker/index.jsx +2 -0
- package/dist/datepicker/intl.d.ts +12 -0
- package/dist/datepicker/intl.d.ts.map +1 -0
- package/dist/dialog/index.js +2 -0
- package/dist/dialog/index.jsx +2 -0
- package/dist/disclosure/index.js +2 -0
- package/dist/disclosure/index.jsx +2 -0
- package/dist/dnd/DragManager.d.ts +86 -0
- package/dist/dnd/DragManager.d.ts.map +1 -0
- package/dist/dnd/DropTargetKeyboardNavigation.d.ts +42 -0
- package/dist/dnd/DropTargetKeyboardNavigation.d.ts.map +1 -0
- package/dist/dnd/createDrag.d.ts.map +1 -1
- package/dist/dnd/createDraggableCollection.d.ts.map +1 -1
- package/dist/dnd/createDraggableItem.d.ts +12 -7
- package/dist/dnd/createDraggableItem.d.ts.map +1 -1
- package/dist/dnd/createDroppableCollection.d.ts +7 -15
- package/dist/dnd/createDroppableCollection.d.ts.map +1 -1
- package/dist/dnd/index.d.ts +5 -1
- package/dist/dnd/index.d.ts.map +1 -1
- package/dist/dnd/index.js +3 -0
- package/dist/dnd/index.jsx +3 -0
- package/dist/dnd/intl/index.d.ts +39 -0
- package/dist/dnd/intl/index.d.ts.map +1 -0
- package/dist/dnd/utils.d.ts +7 -2
- package/dist/dnd/utils.d.ts.map +1 -1
- package/dist/focus/FocusScope.d.ts +7 -0
- package/dist/focus/FocusScope.d.ts.map +1 -1
- package/dist/focus/index.d.ts +2 -1
- package/dist/focus/index.d.ts.map +1 -1
- package/dist/focus/index.js +3 -0
- package/dist/focus/index.jsx +3 -0
- package/dist/focus/virtualFocus.d.ts +26 -0
- package/dist/focus/virtualFocus.d.ts.map +1 -0
- package/dist/form/createFormValidation.d.ts.map +1 -1
- package/dist/form/index.js +3 -0
- package/dist/form/index.jsx +3 -0
- package/dist/grid/index.js +2 -0
- package/dist/grid/index.jsx +2 -0
- package/dist/gridlist/createGridList.d.ts +7 -1
- package/dist/gridlist/createGridList.d.ts.map +1 -1
- package/dist/gridlist/createGridListItem.d.ts +1 -1
- package/dist/gridlist/createGridListItem.d.ts.map +1 -1
- package/dist/gridlist/createGridListSection.d.ts +15 -0
- package/dist/gridlist/createGridListSection.d.ts.map +1 -0
- package/dist/gridlist/index.d.ts +2 -1
- package/dist/gridlist/index.d.ts.map +1 -1
- package/dist/gridlist/index.js +2 -0
- package/dist/gridlist/index.jsx +2 -0
- package/dist/gridlist/types.d.ts +50 -0
- package/dist/gridlist/types.d.ts.map +1 -1
- package/dist/i18n/index.js +5 -0
- package/dist/i18n/index.jsx +5 -0
- package/dist/index.d.ts +10 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +77 -18311
- package/dist/index.jsx +77 -18242
- package/dist/interactions/FocusableProvider.d.ts.map +1 -1
- package/dist/interactions/PressEvent.d.ts +11 -0
- package/dist/interactions/PressEvent.d.ts.map +1 -1
- package/dist/interactions/createFocus.d.ts.map +1 -1
- package/dist/interactions/createFocusWithin.d.ts.map +1 -1
- package/dist/interactions/createInteractionModality.d.ts +0 -1
- package/dist/interactions/createInteractionModality.d.ts.map +1 -1
- package/dist/interactions/createKeyboard.d.ts.map +1 -1
- package/dist/interactions/createPress.d.ts.map +1 -1
- package/dist/interactions/index.js +9 -0
- package/dist/interactions/index.jsx +9 -0
- package/dist/label/createLabels.d.ts.map +1 -1
- package/dist/label/index.js +4 -0
- package/dist/label/index.jsx +4 -0
- package/dist/landmark/index.js +2 -0
- package/dist/landmark/index.jsx +2 -0
- package/dist/link/index.js +2 -0
- package/dist/link/index.jsx +2 -0
- package/dist/listbox/createListBox.d.ts +37 -0
- package/dist/listbox/createListBox.d.ts.map +1 -1
- package/dist/listbox/createOption.d.ts +7 -1
- package/dist/listbox/createOption.d.ts.map +1 -1
- package/dist/listbox/index.js +2 -0
- package/dist/listbox/index.jsx +2 -0
- package/dist/live-announcer/index.js +2 -0
- package/dist/live-announcer/index.jsx +2 -0
- package/dist/menu/createMenu.d.ts +7 -4
- package/dist/menu/createMenu.d.ts.map +1 -1
- package/dist/menu/createMenuItem.d.ts +9 -1
- package/dist/menu/createMenuItem.d.ts.map +1 -1
- package/dist/menu/index.js +2 -0
- package/dist/menu/index.jsx +2 -0
- package/dist/meter/index.js +2 -0
- package/dist/meter/index.jsx +2 -0
- package/dist/numberfield/createNumberField.d.ts.map +1 -1
- package/dist/numberfield/index.js +2 -0
- package/dist/numberfield/index.jsx +2 -0
- package/dist/overlays/index.js +4 -0
- package/dist/overlays/index.jsx +4 -0
- package/dist/popover/calculatePosition.d.ts +2 -0
- package/dist/popover/calculatePosition.d.ts.map +1 -1
- package/dist/popover/createOverlayPosition.d.ts +8 -0
- package/dist/popover/createOverlayPosition.d.ts.map +1 -1
- package/dist/popover/index.js +2 -0
- package/dist/popover/index.jsx +2 -0
- package/dist/progress/index.js +2 -0
- package/dist/progress/index.jsx +2 -0
- package/dist/radio/createRadio.d.ts +2 -0
- package/dist/radio/createRadio.d.ts.map +1 -1
- package/dist/radio/index.js +2 -0
- package/dist/radio/index.jsx +2 -0
- package/dist/searchfield/index.js +2 -0
- package/dist/searchfield/index.jsx +2 -0
- package/dist/select/createSelect.d.ts +2 -0
- package/dist/select/createSelect.d.ts.map +1 -1
- package/dist/select/index.js +2 -0
- package/dist/select/index.jsx +2 -0
- package/dist/selection/DOMLayoutDelegate.d.ts +58 -0
- package/dist/selection/DOMLayoutDelegate.d.ts.map +1 -0
- package/dist/selection/ListKeyboardDelegate.d.ts +95 -0
- package/dist/selection/ListKeyboardDelegate.d.ts.map +1 -0
- package/dist/selection/constants.d.ts +15 -0
- package/dist/selection/constants.d.ts.map +1 -0
- package/dist/selection/createCollectionRowInteraction.d.ts +13 -0
- package/dist/selection/createCollectionRowInteraction.d.ts.map +1 -0
- package/dist/selection/createScrollIntoViewOnFocus.d.ts +31 -0
- package/dist/selection/createScrollIntoViewOnFocus.d.ts.map +1 -0
- package/dist/selection/createSelectableCollection.d.ts +69 -0
- package/dist/selection/createSelectableCollection.d.ts.map +1 -0
- package/dist/selection/createSelectableItem.d.ts +154 -0
- package/dist/selection/createSelectableItem.d.ts.map +1 -0
- package/dist/selection/createSelectableList.d.ts +43 -0
- package/dist/selection/createSelectableList.d.ts.map +1 -0
- package/dist/selection/createTypeSelect.d.ts.map +1 -1
- package/dist/selection/index.d.ts +9 -0
- package/dist/selection/index.d.ts.map +1 -1
- package/dist/selection/index.js +5 -0
- package/dist/selection/index.jsx +5 -0
- package/dist/selection/selectItem.d.ts +29 -0
- package/dist/selection/selectItem.d.ts.map +1 -0
- package/dist/selection/utils.d.ts +40 -0
- package/dist/selection/utils.d.ts.map +1 -0
- package/dist/separator/index.js +2 -0
- package/dist/separator/index.jsx +2 -0
- package/dist/slider/createSlider.d.ts.map +1 -1
- package/dist/slider/index.js +2 -0
- package/dist/slider/index.jsx +2 -0
- package/dist/spinbutton/createSpinButton.d.ts +41 -0
- package/dist/spinbutton/createSpinButton.d.ts.map +1 -0
- package/dist/spinbutton/index.d.ts +3 -0
- package/dist/spinbutton/index.d.ts.map +1 -0
- package/dist/spinbutton/index.js +2 -0
- package/dist/spinbutton/index.jsx +2 -0
- package/dist/spinbutton/intl.d.ts +5 -0
- package/dist/spinbutton/intl.d.ts.map +1 -0
- package/dist/ssr/index.d.ts +17 -0
- package/dist/ssr/index.d.ts.map +1 -1
- package/dist/ssr/index.js +299 -0
- package/dist/ssr/index.js.map +1 -0
- package/dist/ssr/index.jsx +292 -0
- package/dist/ssr/index.jsx.map +1 -0
- package/dist/steplist/index.js +2 -0
- package/dist/steplist/index.jsx +2 -0
- package/dist/switch/createSwitch.d.ts +4 -0
- package/dist/switch/createSwitch.d.ts.map +1 -1
- package/dist/switch/index.js +2 -0
- package/dist/switch/index.jsx +2 -0
- package/dist/table/createTable.d.ts.map +1 -1
- package/dist/table/createTableColumnHeader.d.ts.map +1 -1
- package/dist/table/createTableRow.d.ts +1 -1
- package/dist/table/createTableRow.d.ts.map +1 -1
- package/dist/table/createTableSelectAllCheckbox.d.ts.map +1 -1
- package/dist/table/createTableSelectionCheckbox.d.ts.map +1 -1
- package/dist/table/index.js +2 -0
- package/dist/table/index.jsx +2 -0
- package/dist/table/types.d.ts +35 -1
- package/dist/table/types.d.ts.map +1 -1
- package/dist/table/utils.d.ts +15 -0
- package/dist/table/utils.d.ts.map +1 -0
- package/dist/tabs/createTabs.d.ts +5 -3
- package/dist/tabs/createTabs.d.ts.map +1 -1
- package/dist/tabs/index.js +2 -0
- package/dist/tabs/index.jsx +2 -0
- package/dist/tag/createTag.d.ts +2 -0
- package/dist/tag/createTag.d.ts.map +1 -1
- package/dist/tag/createTagGroup.d.ts +7 -0
- package/dist/tag/createTagGroup.d.ts.map +1 -1
- package/dist/tag/index.js +2 -0
- package/dist/tag/index.jsx +2 -0
- package/dist/textfield/index.js +2 -0
- package/dist/textfield/index.jsx +2 -0
- package/dist/toast/createToast.d.ts.map +1 -1
- package/dist/toast/index.js +2 -0
- package/dist/toast/index.jsx +2 -0
- package/dist/toggle/createToggle.d.ts +4 -0
- package/dist/toggle/createToggle.d.ts.map +1 -1
- package/dist/toggle/index.js +3 -0
- package/dist/toggle/index.jsx +3 -0
- package/dist/toolbar/createToolbar.d.ts +1 -1
- package/dist/toolbar/createToolbar.d.ts.map +1 -1
- package/dist/toolbar/index.js +2 -0
- package/dist/toolbar/index.jsx +2 -0
- package/dist/tooltip/index.js +2 -0
- package/dist/tooltip/index.jsx +2 -0
- package/dist/tree/createTree.d.ts +5 -1
- package/dist/tree/createTree.d.ts.map +1 -1
- package/dist/tree/createTreeItem.d.ts +1 -1
- package/dist/tree/createTreeItem.d.ts.map +1 -1
- package/dist/tree/createTreeSelectionCheckbox.d.ts.map +1 -1
- package/dist/tree/index.js +2 -0
- package/dist/tree/index.jsx +2 -0
- package/dist/tree/types.d.ts +10 -0
- package/dist/tree/types.d.ts.map +1 -1
- package/dist/utils/animation.d.ts +60 -0
- package/dist/utils/animation.d.ts.map +1 -0
- package/dist/utils/dom.d.ts +49 -2
- package/dist/utils/dom.d.ts.map +1 -1
- package/dist/utils/index.d.ts +4 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +6 -0
- package/dist/utils/index.jsx +6 -0
- package/dist/utils/keyboard.d.ts +17 -0
- package/dist/utils/keyboard.d.ts.map +1 -0
- package/dist/utils/mergeProps.d.ts.map +1 -1
- package/dist/utils/scrollIntoView.d.ts +30 -0
- package/dist/utils/scrollIntoView.d.ts.map +1 -0
- package/dist/visually-hidden/index.js +2 -0
- package/dist/visually-hidden/index.jsx +2 -0
- package/package.json +304 -3
- package/src/actiongroup/createActionGroup.ts +26 -109
- package/src/autocomplete/createAutocomplete.ts +202 -35
- package/src/breadcrumbs/createBreadcrumbs.ts +12 -4
- package/src/button/createToggleButtonGroup.ts +19 -14
- package/src/calendar/createCalendar.ts +5 -4
- package/src/calendar/createCalendarCell.ts +36 -5
- package/src/calendar/createCalendarGrid.ts +47 -12
- package/src/calendar/createCalendarMonthPicker.ts +105 -0
- package/src/calendar/createCalendarYearPicker.ts +144 -0
- package/src/calendar/createRangeCalendar.ts +27 -15
- package/src/calendar/createRangeCalendarCell.ts +17 -3
- package/src/calendar/index.ts +17 -0
- package/src/calendar/intl/index.ts +8 -0
- package/src/calendar/utils.ts +4 -0
- package/src/checkbox/createCheckbox.ts +10 -0
- package/src/checkbox/createCheckboxGroupItem.ts +12 -16
- package/src/color/createColorArea.ts +17 -10
- package/src/color/createColorField.ts +8 -1
- package/src/color/createColorSlider.ts +1 -2
- package/src/color/createColorSwatch.ts +4 -2
- package/src/color/createColorWheel.ts +0 -6
- package/src/color/intl/index.ts +316 -0
- package/src/combobox/createComboBox.ts +35 -4
- package/src/combobox/intl/generated-locales.ts +635 -0
- package/src/combobox/intl/index.ts +8 -2
- package/src/datepicker/createDateField.ts +228 -213
- package/src/datepicker/createDatePicker.ts +157 -146
- package/src/datepicker/createDatePickerGroup.ts +88 -82
- package/src/datepicker/createDateRangePicker.ts +230 -179
- package/src/datepicker/createDateSegment.ts +386 -384
- package/src/datepicker/createDisplayNames.ts +45 -0
- package/src/datepicker/createTimeField.ts +36 -129
- package/src/datepicker/index.ts +13 -14
- package/src/datepicker/intl.ts +633 -0
- package/src/dnd/DragManager.ts +693 -0
- package/src/dnd/DropTargetKeyboardNavigation.ts +337 -0
- package/src/dnd/createDrag.ts +31 -5
- package/src/dnd/createDraggableCollection.ts +33 -15
- package/src/dnd/createDraggableItem.ts +92 -5
- package/src/dnd/createDroppableCollection.ts +488 -371
- package/src/dnd/index.ts +11 -0
- package/src/dnd/intl/ar-AE.json +29 -0
- package/src/dnd/intl/bg-BG.json +29 -0
- package/src/dnd/intl/cs-CZ.json +29 -0
- package/src/dnd/intl/da-DK.json +29 -0
- package/src/dnd/intl/de-DE.json +29 -0
- package/src/dnd/intl/el-GR.json +29 -0
- package/src/dnd/intl/en-US.json +29 -0
- package/src/dnd/intl/es-ES.json +29 -0
- package/src/dnd/intl/et-EE.json +29 -0
- package/src/dnd/intl/fi-FI.json +29 -0
- package/src/dnd/intl/fr-FR.json +29 -0
- package/src/dnd/intl/he-IL.json +29 -0
- package/src/dnd/intl/hr-HR.json +29 -0
- package/src/dnd/intl/hu-HU.json +29 -0
- package/src/dnd/intl/index.ts +139 -0
- package/src/dnd/intl/it-IT.json +29 -0
- package/src/dnd/intl/ja-JP.json +29 -0
- package/src/dnd/intl/ko-KR.json +29 -0
- package/src/dnd/intl/lt-LT.json +29 -0
- package/src/dnd/intl/lv-LV.json +29 -0
- package/src/dnd/intl/nb-NO.json +29 -0
- package/src/dnd/intl/nl-NL.json +29 -0
- package/src/dnd/intl/pl-PL.json +29 -0
- package/src/dnd/intl/pt-BR.json +29 -0
- package/src/dnd/intl/pt-PT.json +29 -0
- package/src/dnd/intl/ro-RO.json +29 -0
- package/src/dnd/intl/ru-RU.json +29 -0
- package/src/dnd/intl/sk-SK.json +29 -0
- package/src/dnd/intl/sl-SI.json +29 -0
- package/src/dnd/intl/sr-SP.json +29 -0
- package/src/dnd/intl/sv-SE.json +29 -0
- package/src/dnd/intl/tr-TR.json +29 -0
- package/src/dnd/intl/uk-UA.json +29 -0
- package/src/dnd/intl/zh-CN.json +29 -0
- package/src/dnd/intl/zh-TW.json +29 -0
- package/src/dnd/utils.ts +63 -3
- package/src/focus/FocusScope.tsx +266 -24
- package/src/focus/index.ts +8 -0
- package/src/focus/virtualFocus.ts +55 -0
- package/src/form/createFormValidation.ts +8 -1
- package/src/gridlist/createGridList.ts +187 -48
- package/src/gridlist/createGridListItem.ts +87 -155
- package/src/gridlist/createGridListSection.ts +54 -0
- package/src/gridlist/index.ts +3 -0
- package/src/gridlist/types.ts +47 -0
- package/src/index.ts +51 -3
- package/src/interactions/FocusableProvider.tsx +11 -6
- package/src/interactions/PressEvent.ts +14 -0
- package/src/interactions/createFocus.ts +26 -21
- package/src/interactions/createFocusWithin.ts +23 -24
- package/src/interactions/createInteractionModality.ts +26 -15
- package/src/interactions/createKeyboard.ts +10 -0
- package/src/interactions/createPress.ts +29 -6
- package/src/label/createLabels.ts +7 -4
- package/src/listbox/createListBox.ts +203 -10
- package/src/listbox/createOption.ts +84 -74
- package/src/menu/createMenu.ts +93 -16
- package/src/menu/createMenuItem.ts +253 -41
- package/src/numberfield/createNumberField.ts +82 -14
- package/src/popover/calculatePosition.ts +19 -7
- package/src/popover/createOverlayPosition.ts +9 -0
- package/src/radio/createRadio.ts +19 -2
- package/src/select/createSelect.ts +41 -4
- package/src/selection/DOMLayoutDelegate.ts +102 -0
- package/src/selection/ListKeyboardDelegate.ts +398 -0
- package/src/selection/constants.ts +16 -0
- package/src/selection/createCollectionRowInteraction.ts +209 -0
- package/src/selection/createScrollIntoViewOnFocus.ts +65 -0
- package/src/selection/createSelectableCollection.ts +645 -0
- package/src/selection/createSelectableItem.ts +512 -0
- package/src/selection/createSelectableList.ts +93 -0
- package/src/selection/createTypeSelect.ts +112 -51
- package/src/selection/index.ts +31 -0
- package/src/selection/selectItem.ts +80 -0
- package/src/selection/utils.ts +82 -0
- package/src/slider/createSlider.ts +48 -1
- package/src/spinbutton/createSpinButton.ts +163 -0
- package/src/spinbutton/index.ts +10 -0
- package/src/spinbutton/intl.ts +115 -0
- package/src/ssr/index.tsx +31 -0
- package/src/switch/createSwitch.ts +10 -0
- package/src/table/createTable.ts +82 -27
- package/src/table/createTableColumnHeader.ts +10 -0
- package/src/table/createTableRow.ts +208 -203
- package/src/table/createTableSelectAllCheckbox.ts +3 -4
- package/src/table/createTableSelectionCheckbox.ts +24 -1
- package/src/table/types.ts +37 -1
- package/src/table/utils.ts +41 -0
- package/src/tabs/createTabs.ts +95 -24
- package/src/tag/createTag.ts +30 -36
- package/src/tag/createTagGroup.ts +92 -0
- package/src/toast/createToast.ts +1 -0
- package/src/toggle/createToggle.ts +20 -0
- package/src/toolbar/createToolbar.ts +43 -94
- package/src/tree/createTree.ts +165 -52
- package/src/tree/createTreeItem.ts +105 -120
- package/src/tree/createTreeSelectionCheckbox.ts +14 -1
- package/src/tree/types.ts +10 -0
- package/src/utils/animation.ts +243 -0
- package/src/utils/dom.ts +216 -25
- package/src/utils/index.ts +10 -0
- package/src/utils/keyboard.ts +25 -0
- package/src/utils/mergeProps.ts +8 -1
- package/src/utils/scrollIntoView.ts +181 -0
- package/dist/datepicker/createTimeSegment.d.ts +0 -29
- package/dist/datepicker/createTimeSegment.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.jsx.map +0 -1
- package/src/datepicker/createTimeSegment.ts +0 -352
|
@@ -0,0 +1,627 @@
|
|
|
1
|
+
import { m as isVirtualPointerEvent, p as isVirtualClick } from "./utils.js";
|
|
2
|
+
import { a as getEventTarget, i as getActiveElement, y as nodeContains } from "./focus.js";
|
|
3
|
+
import { o as getInteractionModality } from "./createInteractionModality.js";
|
|
4
|
+
import { t as ariaHideOutside } from "./ariaHideOutside.js";
|
|
5
|
+
import { t as announce } from "./announce.js";
|
|
6
|
+
import { createSignal } from "solid-js";
|
|
7
|
+
import { DIRECTORY_DRAG_TYPE } from "@proyecto-viviana/solid-stately";
|
|
8
|
+
//#region src/dnd/utils.ts
|
|
9
|
+
const NATIVE_DRAG_TYPES = new Set([
|
|
10
|
+
"text/plain",
|
|
11
|
+
"text/uri-list",
|
|
12
|
+
"text/html"
|
|
13
|
+
]);
|
|
14
|
+
const CUSTOM_DRAG_TYPE = "application/vnd.solidaria.items+json";
|
|
15
|
+
const GENERIC_TYPE = "application/octet-stream";
|
|
16
|
+
let DROP_OPERATION = /* @__PURE__ */ function(DROP_OPERATION) {
|
|
17
|
+
DROP_OPERATION[DROP_OPERATION["none"] = 0] = "none";
|
|
18
|
+
DROP_OPERATION[DROP_OPERATION["cancel"] = 0] = "cancel";
|
|
19
|
+
DROP_OPERATION[DROP_OPERATION["move"] = 1] = "move";
|
|
20
|
+
DROP_OPERATION[DROP_OPERATION["copy"] = 2] = "copy";
|
|
21
|
+
DROP_OPERATION[DROP_OPERATION["link"] = 4] = "link";
|
|
22
|
+
DROP_OPERATION[DROP_OPERATION["all"] = 7] = "all";
|
|
23
|
+
return DROP_OPERATION;
|
|
24
|
+
}({});
|
|
25
|
+
const DROP_OPERATION_ALLOWED = {
|
|
26
|
+
none: 0,
|
|
27
|
+
copy: 2,
|
|
28
|
+
copyLink: 6,
|
|
29
|
+
copyMove: 3,
|
|
30
|
+
link: 4,
|
|
31
|
+
linkMove: 5,
|
|
32
|
+
move: 1,
|
|
33
|
+
all: 7,
|
|
34
|
+
uninitialized: 7
|
|
35
|
+
};
|
|
36
|
+
const EFFECT_ALLOWED = {
|
|
37
|
+
[0]: "none",
|
|
38
|
+
[1]: "move",
|
|
39
|
+
[2]: "copy",
|
|
40
|
+
[3]: "copyMove",
|
|
41
|
+
[4]: "link",
|
|
42
|
+
[5]: "linkMove",
|
|
43
|
+
[6]: "copyLink",
|
|
44
|
+
[7]: "all"
|
|
45
|
+
};
|
|
46
|
+
const DROP_EFFECT_TO_DROP_OPERATION = {
|
|
47
|
+
none: "cancel",
|
|
48
|
+
link: "link",
|
|
49
|
+
copy: "copy",
|
|
50
|
+
move: "move"
|
|
51
|
+
};
|
|
52
|
+
const DROP_OPERATION_TO_DROP_EFFECT = {
|
|
53
|
+
cancel: "none",
|
|
54
|
+
link: "link",
|
|
55
|
+
copy: "copy",
|
|
56
|
+
move: "move"
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Maps the current interaction modality onto the drag modality used for
|
|
60
|
+
* announcements and descriptions. Mirrors @react-aria/dnd `mapModality`:
|
|
61
|
+
* pointer collapses to virtual, and a virtual modality on a coarse pointer
|
|
62
|
+
* (touch screen reader) becomes touch.
|
|
63
|
+
*/
|
|
64
|
+
function mapModality(modality) {
|
|
65
|
+
if (!modality) modality = "virtual";
|
|
66
|
+
if (modality === "pointer") modality = "virtual";
|
|
67
|
+
if (modality === "virtual" && typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia("(pointer: coarse)").matches) modality = "touch";
|
|
68
|
+
return modality;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Returns the drag modality ('keyboard' | 'virtual' | 'touch') for the current
|
|
72
|
+
* interaction. Mirrors @react-aria/dnd `getDragModality`.
|
|
73
|
+
*/
|
|
74
|
+
function getDragModality() {
|
|
75
|
+
return mapModality(getInteractionModality());
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Get the types present in drag items.
|
|
79
|
+
*/
|
|
80
|
+
function getTypes(items) {
|
|
81
|
+
const types = /* @__PURE__ */ new Set();
|
|
82
|
+
for (const item of items) for (const type of Object.keys(item)) types.add(type);
|
|
83
|
+
return types;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Write drag items to a DataTransfer object.
|
|
87
|
+
*/
|
|
88
|
+
function writeToDataTransfer(dataTransfer, items) {
|
|
89
|
+
const groupedByType = /* @__PURE__ */ new Map();
|
|
90
|
+
let needsCustomData = false;
|
|
91
|
+
const customData = [];
|
|
92
|
+
for (const item of items) {
|
|
93
|
+
const types = Object.keys(item);
|
|
94
|
+
if (types.length > 1) needsCustomData = true;
|
|
95
|
+
const dataByType = {};
|
|
96
|
+
for (const type of types) {
|
|
97
|
+
let typeItems = groupedByType.get(type);
|
|
98
|
+
if (!typeItems) {
|
|
99
|
+
typeItems = [];
|
|
100
|
+
groupedByType.set(type, typeItems);
|
|
101
|
+
} else needsCustomData = true;
|
|
102
|
+
const data = item[type];
|
|
103
|
+
dataByType[type] = data;
|
|
104
|
+
typeItems.push(data);
|
|
105
|
+
}
|
|
106
|
+
customData.push(dataByType);
|
|
107
|
+
}
|
|
108
|
+
for (const [type, typeItems] of groupedByType) if (NATIVE_DRAG_TYPES.has(type)) {
|
|
109
|
+
const data = typeItems.join("\n");
|
|
110
|
+
dataTransfer.items.add(data, type);
|
|
111
|
+
} else dataTransfer.items.add(typeItems[0], type);
|
|
112
|
+
if (needsCustomData) {
|
|
113
|
+
const data = JSON.stringify(customData);
|
|
114
|
+
dataTransfer.items.add(data, CUSTOM_DRAG_TYPE);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Read drop items from a DataTransfer object.
|
|
119
|
+
*/
|
|
120
|
+
function readFromDataTransfer(dataTransfer) {
|
|
121
|
+
const items = [];
|
|
122
|
+
if (!dataTransfer) return items;
|
|
123
|
+
let hasCustomType = false;
|
|
124
|
+
if (dataTransfer.types.includes("application/vnd.solidaria.items+json")) try {
|
|
125
|
+
const data = dataTransfer.getData(CUSTOM_DRAG_TYPE);
|
|
126
|
+
const parsed = JSON.parse(data);
|
|
127
|
+
for (const item of parsed) items.push({
|
|
128
|
+
kind: "text",
|
|
129
|
+
types: new Set(Object.keys(item)),
|
|
130
|
+
getText: (type) => Promise.resolve(item[type])
|
|
131
|
+
});
|
|
132
|
+
hasCustomType = true;
|
|
133
|
+
} catch {}
|
|
134
|
+
if (!hasCustomType) {
|
|
135
|
+
const stringItems = /* @__PURE__ */ new Map();
|
|
136
|
+
for (const item of dataTransfer.items) if (item.kind === "string") {
|
|
137
|
+
const type = item.type || "application/octet-stream";
|
|
138
|
+
stringItems.set(type, dataTransfer.getData(item.type));
|
|
139
|
+
} else if (item.kind === "file") {
|
|
140
|
+
const file = item.getAsFile();
|
|
141
|
+
if (file) items.push(createFileItem(file));
|
|
142
|
+
}
|
|
143
|
+
if (stringItems.size > 0) items.push({
|
|
144
|
+
kind: "text",
|
|
145
|
+
types: new Set(stringItems.keys()),
|
|
146
|
+
getText: (type) => Promise.resolve(stringItems.get(type) ?? "")
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
return items;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Create a FileDropItem from a File object.
|
|
153
|
+
*/
|
|
154
|
+
function createFileItem(file) {
|
|
155
|
+
return {
|
|
156
|
+
kind: "file",
|
|
157
|
+
type: file.type || "application/octet-stream",
|
|
158
|
+
name: file.name,
|
|
159
|
+
getText: () => file.text(),
|
|
160
|
+
getFile: () => Promise.resolve(file)
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* DragTypes implementation for checking drag types.
|
|
165
|
+
*/
|
|
166
|
+
var DragTypesImpl = class {
|
|
167
|
+
types;
|
|
168
|
+
includesUnknownTypes;
|
|
169
|
+
constructor(dataTransfer) {
|
|
170
|
+
this.types = /* @__PURE__ */ new Set();
|
|
171
|
+
let hasFiles = false;
|
|
172
|
+
for (const item of dataTransfer.items) if (item.type !== "application/vnd.solidaria.items+json") {
|
|
173
|
+
if (item.kind === "file") hasFiles = true;
|
|
174
|
+
if (item.type) this.types.add(item.type);
|
|
175
|
+
else this.types.add(GENERIC_TYPE);
|
|
176
|
+
}
|
|
177
|
+
this.includesUnknownTypes = !hasFiles && dataTransfer.types.includes("Files");
|
|
178
|
+
}
|
|
179
|
+
has(type) {
|
|
180
|
+
if (Array.isArray(type)) return type.some((t) => this.has(t));
|
|
181
|
+
if (this.includesUnknownTypes || type === DIRECTORY_DRAG_TYPE && this.types.has("application/octet-stream") || type === "*/*") return true;
|
|
182
|
+
if (typeof type === "string") {
|
|
183
|
+
if (type.endsWith("/*")) {
|
|
184
|
+
for (const key of this.types) if (key.startsWith(type.slice(0, -2))) return true;
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
return this.types.has(type);
|
|
188
|
+
}
|
|
189
|
+
return false;
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* Check if a drop item is a text item.
|
|
194
|
+
*/
|
|
195
|
+
function isTextDropItem(dropItem) {
|
|
196
|
+
return dropItem.kind === "text";
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Check if a drop item is a file item.
|
|
200
|
+
*/
|
|
201
|
+
function isFileDropItem(dropItem) {
|
|
202
|
+
return dropItem.kind === "file";
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Check if a drop item is a directory item.
|
|
206
|
+
*/
|
|
207
|
+
function isDirectoryDropItem(dropItem) {
|
|
208
|
+
return dropItem.kind === "directory";
|
|
209
|
+
}
|
|
210
|
+
let globalDropEffect;
|
|
211
|
+
let globalAllowedDropOperations = 0;
|
|
212
|
+
function setGlobalDropEffect(effect) {
|
|
213
|
+
globalDropEffect = effect;
|
|
214
|
+
}
|
|
215
|
+
function getGlobalDropEffect() {
|
|
216
|
+
return globalDropEffect;
|
|
217
|
+
}
|
|
218
|
+
function setGlobalAllowedDropOperations(ops) {
|
|
219
|
+
globalAllowedDropOperations = ops;
|
|
220
|
+
}
|
|
221
|
+
function getGlobalAllowedDropOperations() {
|
|
222
|
+
return globalAllowedDropOperations;
|
|
223
|
+
}
|
|
224
|
+
//#endregion
|
|
225
|
+
//#region src/dnd/DragManager.ts
|
|
226
|
+
/**
|
|
227
|
+
* Global keyboard/virtual drag session manager.
|
|
228
|
+
*
|
|
229
|
+
* Faithful port of @react-aria/dnd `DragManager` (react-aria 3.50). A single
|
|
230
|
+
* module-level singleton owns the active drag session: it registers drop targets
|
|
231
|
+
* and drop items across every collection on the page, drives Tab/Shift+Tab
|
|
232
|
+
* cycling between them, Enter-to-drop / Escape-to-cancel, and the aria-live
|
|
233
|
+
* announcements — providing the accessible keyboard alternative to native
|
|
234
|
+
* pointer drag and drop.
|
|
235
|
+
*
|
|
236
|
+
* The only framework-specific adaptation from upstream is the reactive
|
|
237
|
+
* subscription: React's `useDragSession` (useState + a subscription Set) becomes
|
|
238
|
+
* a module-level Solid signal exposed through `createDragSession()`. Element refs
|
|
239
|
+
* (upstream `RefObject.current`) become Solid element accessors (`() => el`).
|
|
240
|
+
*/
|
|
241
|
+
let dropTargets = /* @__PURE__ */ new Map();
|
|
242
|
+
let dropItems = /* @__PURE__ */ new Map();
|
|
243
|
+
let dragSession = null;
|
|
244
|
+
const [trackedDragSession, setTrackedDragSession] = createSignal(null);
|
|
245
|
+
function registerDropTarget(target) {
|
|
246
|
+
dropTargets.set(target.element, target);
|
|
247
|
+
dragSession?.updateValidDropTargets();
|
|
248
|
+
return () => {
|
|
249
|
+
dropTargets.delete(target.element);
|
|
250
|
+
dragSession?.updateValidDropTargets();
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
function registerDropItem(item) {
|
|
254
|
+
dropItems.set(item.element, item);
|
|
255
|
+
return () => {
|
|
256
|
+
dropItems.delete(item.element);
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
function beginDragging(target, stringFormatter) {
|
|
260
|
+
if (dragSession) throw new Error("Cannot begin dragging while already dragging");
|
|
261
|
+
dragSession = new DragSession(target, stringFormatter);
|
|
262
|
+
setTrackedDragSession(dragSession);
|
|
263
|
+
requestAnimationFrame(() => {
|
|
264
|
+
if (dragSession) {
|
|
265
|
+
dragSession.setup();
|
|
266
|
+
if (getDragModality() === "keyboard") dragSession.next();
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
/** Reactive accessor for the active drag session, or null. */
|
|
271
|
+
function createDragSession() {
|
|
272
|
+
return trackedDragSession;
|
|
273
|
+
}
|
|
274
|
+
/** @private */
|
|
275
|
+
function isVirtualDragging() {
|
|
276
|
+
return !!dragSession;
|
|
277
|
+
}
|
|
278
|
+
function endDragging() {
|
|
279
|
+
dragSession = null;
|
|
280
|
+
setTrackedDragSession(null);
|
|
281
|
+
}
|
|
282
|
+
const CANCELED_EVENTS = [
|
|
283
|
+
"pointerdown",
|
|
284
|
+
"pointermove",
|
|
285
|
+
"pointerenter",
|
|
286
|
+
"pointerleave",
|
|
287
|
+
"pointerover",
|
|
288
|
+
"pointerout",
|
|
289
|
+
"pointerup",
|
|
290
|
+
"mousedown",
|
|
291
|
+
"mousemove",
|
|
292
|
+
"mouseenter",
|
|
293
|
+
"mouseleave",
|
|
294
|
+
"mouseover",
|
|
295
|
+
"mouseout",
|
|
296
|
+
"mouseup",
|
|
297
|
+
"touchstart",
|
|
298
|
+
"touchmove",
|
|
299
|
+
"touchend",
|
|
300
|
+
"focusin",
|
|
301
|
+
"focusout"
|
|
302
|
+
];
|
|
303
|
+
const CLICK_EVENTS = [
|
|
304
|
+
"pointerup",
|
|
305
|
+
"mouseup",
|
|
306
|
+
"touchend"
|
|
307
|
+
];
|
|
308
|
+
const MESSAGES = {
|
|
309
|
+
keyboard: "dragStartedKeyboard",
|
|
310
|
+
touch: "dragStartedTouch",
|
|
311
|
+
virtual: "dragStartedVirtual"
|
|
312
|
+
};
|
|
313
|
+
var DragSession = class {
|
|
314
|
+
dragTarget;
|
|
315
|
+
validDropTargets = [];
|
|
316
|
+
currentDropTarget = null;
|
|
317
|
+
currentDropItem = null;
|
|
318
|
+
dropOperation = null;
|
|
319
|
+
mutationObserver = null;
|
|
320
|
+
restoreAriaHidden = null;
|
|
321
|
+
stringFormatter;
|
|
322
|
+
isVirtualClick = false;
|
|
323
|
+
initialFocused;
|
|
324
|
+
constructor(target, stringFormatter) {
|
|
325
|
+
this.dragTarget = target;
|
|
326
|
+
this.stringFormatter = stringFormatter;
|
|
327
|
+
this.onKeyDown = this.onKeyDown.bind(this);
|
|
328
|
+
this.onKeyUp = this.onKeyUp.bind(this);
|
|
329
|
+
this.onFocus = this.onFocus.bind(this);
|
|
330
|
+
this.onBlur = this.onBlur.bind(this);
|
|
331
|
+
this.onClick = this.onClick.bind(this);
|
|
332
|
+
this.onPointerDown = this.onPointerDown.bind(this);
|
|
333
|
+
this.cancelEvent = this.cancelEvent.bind(this);
|
|
334
|
+
this.initialFocused = false;
|
|
335
|
+
}
|
|
336
|
+
setup() {
|
|
337
|
+
document.addEventListener("keydown", this.onKeyDown, true);
|
|
338
|
+
document.addEventListener("keyup", this.onKeyUp, true);
|
|
339
|
+
window.addEventListener("focus", this.onFocus, true);
|
|
340
|
+
window.addEventListener("blur", this.onBlur, true);
|
|
341
|
+
document.addEventListener("click", this.onClick, true);
|
|
342
|
+
document.addEventListener("pointerdown", this.onPointerDown, true);
|
|
343
|
+
for (let event of CANCELED_EVENTS) document.addEventListener(event, this.cancelEvent, true);
|
|
344
|
+
this.mutationObserver = new MutationObserver(() => this.updateValidDropTargets());
|
|
345
|
+
this.updateValidDropTargets();
|
|
346
|
+
announce(this.stringFormatter.format(MESSAGES[getDragModality()]));
|
|
347
|
+
}
|
|
348
|
+
teardown() {
|
|
349
|
+
document.removeEventListener("keydown", this.onKeyDown, true);
|
|
350
|
+
document.removeEventListener("keyup", this.onKeyUp, true);
|
|
351
|
+
window.removeEventListener("focus", this.onFocus, true);
|
|
352
|
+
window.removeEventListener("blur", this.onBlur, true);
|
|
353
|
+
document.removeEventListener("click", this.onClick, true);
|
|
354
|
+
document.removeEventListener("pointerdown", this.onPointerDown, true);
|
|
355
|
+
for (let event of CANCELED_EVENTS) document.removeEventListener(event, this.cancelEvent, true);
|
|
356
|
+
this.mutationObserver?.disconnect();
|
|
357
|
+
this.restoreAriaHidden?.();
|
|
358
|
+
}
|
|
359
|
+
onKeyDown(e) {
|
|
360
|
+
this.cancelEvent(e);
|
|
361
|
+
if (e.key === "Escape") {
|
|
362
|
+
this.cancel();
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
if (e.key === "Tab" && !(e.metaKey || e.altKey || e.ctrlKey)) if (e.shiftKey) this.previous();
|
|
366
|
+
else this.next();
|
|
367
|
+
if (typeof this.currentDropTarget?.onKeyDown === "function") this.currentDropTarget.onKeyDown(e, this.dragTarget);
|
|
368
|
+
}
|
|
369
|
+
onKeyUp(e) {
|
|
370
|
+
this.cancelEvent(e);
|
|
371
|
+
if (e.key === "Enter") if (e.altKey || nodeContains(this.getCurrentActivateButton(), getEventTarget(e))) this.activate(this.currentDropTarget, this.currentDropItem);
|
|
372
|
+
else this.drop();
|
|
373
|
+
}
|
|
374
|
+
getCurrentActivateButton() {
|
|
375
|
+
return this.currentDropItem?.activateButtonRef?.() ?? this.currentDropTarget?.activateButtonRef?.() ?? null;
|
|
376
|
+
}
|
|
377
|
+
onFocus(e) {
|
|
378
|
+
let activateButton = this.getCurrentActivateButton();
|
|
379
|
+
let eventTarget = getEventTarget(e);
|
|
380
|
+
if (eventTarget === activateButton) {
|
|
381
|
+
this.cancelEvent(e);
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
if (eventTarget !== this.dragTarget.element) this.cancelEvent(e);
|
|
385
|
+
if (!(eventTarget instanceof HTMLElement) || eventTarget === this.dragTarget.element) return;
|
|
386
|
+
let dropTarget = this.validDropTargets.find((target) => target.element === eventTarget) || this.validDropTargets.find((target) => nodeContains(target.element, eventTarget));
|
|
387
|
+
if (!dropTarget) {
|
|
388
|
+
if (this.currentDropTarget) this.currentDropTarget.element.focus();
|
|
389
|
+
else this.dragTarget.element.focus();
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
let item = dropItems.get(eventTarget);
|
|
393
|
+
if (dropTarget) this.setCurrentDropTarget(dropTarget, item);
|
|
394
|
+
}
|
|
395
|
+
onBlur(e) {
|
|
396
|
+
let activateButton = this.getCurrentActivateButton();
|
|
397
|
+
if (activateButton && e.relatedTarget === activateButton) {
|
|
398
|
+
this.cancelEvent(e);
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
if (getEventTarget(e) !== this.dragTarget.element) this.cancelEvent(e);
|
|
402
|
+
if (!e.relatedTarget || !(e.relatedTarget instanceof HTMLElement)) if (this.currentDropTarget) this.currentDropTarget.element.focus();
|
|
403
|
+
else this.dragTarget.element.focus();
|
|
404
|
+
}
|
|
405
|
+
onClick(e) {
|
|
406
|
+
this.cancelEvent(e);
|
|
407
|
+
if (isVirtualClick(e) || this.isVirtualClick) {
|
|
408
|
+
let dropElements = dropItems.values();
|
|
409
|
+
let eventTarget = getEventTarget(e);
|
|
410
|
+
let item = [...dropElements].find((item) => item.element === eventTarget || nodeContains(item.activateButtonRef?.() ?? null, eventTarget));
|
|
411
|
+
let dropTarget = this.validDropTargets.find((target) => nodeContains(target.element, eventTarget));
|
|
412
|
+
if (nodeContains(item?.activateButtonRef?.() ?? dropTarget?.activateButtonRef?.() ?? null, eventTarget) && dropTarget) {
|
|
413
|
+
this.activate(dropTarget, item);
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
if (getEventTarget(e) === this.dragTarget.element) {
|
|
417
|
+
this.cancel();
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
if (dropTarget) {
|
|
421
|
+
this.setCurrentDropTarget(dropTarget, item);
|
|
422
|
+
this.drop(item);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
onPointerDown(e) {
|
|
427
|
+
this.cancelEvent(e);
|
|
428
|
+
this.isVirtualClick = isVirtualPointerEvent(e);
|
|
429
|
+
}
|
|
430
|
+
cancelEvent(e) {
|
|
431
|
+
let eventTarget = getEventTarget(e);
|
|
432
|
+
if ((e.type === "focusin" || e.type === "focusout") && (eventTarget === this.dragTarget?.element || eventTarget === this.getCurrentActivateButton())) return;
|
|
433
|
+
if (!CLICK_EVENTS.includes(e.type)) e.preventDefault();
|
|
434
|
+
e.stopPropagation();
|
|
435
|
+
e.stopImmediatePropagation();
|
|
436
|
+
}
|
|
437
|
+
updateValidDropTargets() {
|
|
438
|
+
if (!this.mutationObserver) return;
|
|
439
|
+
this.mutationObserver.disconnect();
|
|
440
|
+
if (this.restoreAriaHidden) this.restoreAriaHidden();
|
|
441
|
+
this.validDropTargets = findValidDropTargets(this.dragTarget);
|
|
442
|
+
if (this.validDropTargets.length > 0) {
|
|
443
|
+
let nearestIndex = this.findNearestDropTarget();
|
|
444
|
+
this.validDropTargets = [...this.validDropTargets.slice(nearestIndex), ...this.validDropTargets.slice(0, nearestIndex)];
|
|
445
|
+
}
|
|
446
|
+
if (this.currentDropTarget && !this.validDropTargets.includes(this.currentDropTarget)) this.setCurrentDropTarget(this.validDropTargets[0]);
|
|
447
|
+
let types = getTypes(this.dragTarget.items);
|
|
448
|
+
let validDropItems = [...dropItems.values()].filter((item) => {
|
|
449
|
+
if (typeof item.getDropOperation === "function") return item.getDropOperation(types, this.dragTarget.allowedDropOperations) !== "cancel";
|
|
450
|
+
return true;
|
|
451
|
+
});
|
|
452
|
+
let visibleDropTargets = this.validDropTargets.filter((target) => !validDropItems.some((item) => nodeContains(target.element, item.element)));
|
|
453
|
+
this.restoreAriaHidden = ariaHideOutside([
|
|
454
|
+
this.dragTarget.element,
|
|
455
|
+
...validDropItems.flatMap((item) => {
|
|
456
|
+
let button = item.activateButtonRef?.();
|
|
457
|
+
return button ? [item.element, button] : [item.element];
|
|
458
|
+
}),
|
|
459
|
+
...visibleDropTargets.flatMap((target) => {
|
|
460
|
+
let button = target.activateButtonRef?.();
|
|
461
|
+
return button ? [target.element, button] : [target.element];
|
|
462
|
+
})
|
|
463
|
+
], { shouldUseInert: true });
|
|
464
|
+
this.mutationObserver.observe(document.body, {
|
|
465
|
+
subtree: true,
|
|
466
|
+
attributes: true,
|
|
467
|
+
attributeFilter: ["aria-hidden", "inert"]
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
next() {
|
|
471
|
+
if (!this.currentDropTarget) {
|
|
472
|
+
this.setCurrentDropTarget(this.validDropTargets[0]);
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
let index = this.validDropTargets.indexOf(this.currentDropTarget);
|
|
476
|
+
if (index < 0) {
|
|
477
|
+
this.setCurrentDropTarget(this.validDropTargets[0]);
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
if (index === this.validDropTargets.length - 1) if (!this.dragTarget.element.closest("[aria-hidden=\"true\"], [inert]")) {
|
|
481
|
+
this.setCurrentDropTarget(null);
|
|
482
|
+
this.dragTarget.element.focus();
|
|
483
|
+
} else this.setCurrentDropTarget(this.validDropTargets[0]);
|
|
484
|
+
else this.setCurrentDropTarget(this.validDropTargets[index + 1]);
|
|
485
|
+
}
|
|
486
|
+
previous() {
|
|
487
|
+
if (!this.currentDropTarget) {
|
|
488
|
+
this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
let index = this.validDropTargets.indexOf(this.currentDropTarget);
|
|
492
|
+
if (index < 0) {
|
|
493
|
+
this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
496
|
+
if (index === 0) if (!this.dragTarget.element.closest("[aria-hidden=\"true\"], [inert]")) {
|
|
497
|
+
this.setCurrentDropTarget(null);
|
|
498
|
+
this.dragTarget.element.focus();
|
|
499
|
+
} else this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);
|
|
500
|
+
else this.setCurrentDropTarget(this.validDropTargets[index - 1]);
|
|
501
|
+
}
|
|
502
|
+
findNearestDropTarget() {
|
|
503
|
+
let dragTargetRect = this.dragTarget.element.getBoundingClientRect();
|
|
504
|
+
let minDistance = Infinity;
|
|
505
|
+
let nearest = -1;
|
|
506
|
+
for (let i = 0; i < this.validDropTargets.length; i++) {
|
|
507
|
+
let rect = this.validDropTargets[i].element.getBoundingClientRect();
|
|
508
|
+
let dx = rect.left - dragTargetRect.left;
|
|
509
|
+
let dy = rect.top - dragTargetRect.top;
|
|
510
|
+
let dist = dx * dx + dy * dy;
|
|
511
|
+
if (dist < minDistance) {
|
|
512
|
+
minDistance = dist;
|
|
513
|
+
nearest = i;
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
return nearest;
|
|
517
|
+
}
|
|
518
|
+
setCurrentDropTarget(dropTarget, item) {
|
|
519
|
+
if (dropTarget !== this.currentDropTarget) {
|
|
520
|
+
if (this.currentDropTarget && typeof this.currentDropTarget.onDropExit === "function") {
|
|
521
|
+
let rect = this.currentDropTarget.element.getBoundingClientRect();
|
|
522
|
+
this.currentDropTarget.onDropExit({
|
|
523
|
+
type: "dropexit",
|
|
524
|
+
x: rect.left + rect.width / 2,
|
|
525
|
+
y: rect.top + rect.height / 2
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
this.currentDropTarget = dropTarget;
|
|
529
|
+
if (dropTarget) {
|
|
530
|
+
if (typeof dropTarget.onDropEnter === "function") {
|
|
531
|
+
let rect = dropTarget.element.getBoundingClientRect();
|
|
532
|
+
dropTarget.onDropEnter({
|
|
533
|
+
type: "dropenter",
|
|
534
|
+
x: rect.left + rect.width / 2,
|
|
535
|
+
y: rect.top + rect.height / 2
|
|
536
|
+
}, this.dragTarget);
|
|
537
|
+
}
|
|
538
|
+
if (!item) dropTarget?.element.focus();
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
if (item != null && item !== this.currentDropItem) {
|
|
542
|
+
if (this.currentDropTarget && typeof this.currentDropTarget.onDropTargetEnter === "function") this.currentDropTarget.onDropTargetEnter(item.target);
|
|
543
|
+
item.element.focus();
|
|
544
|
+
this.currentDropItem = item;
|
|
545
|
+
if (!this.initialFocused) {
|
|
546
|
+
let label = item?.element.getAttribute("aria-label");
|
|
547
|
+
if (label) announce(label, "polite");
|
|
548
|
+
this.initialFocused = true;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
end() {
|
|
553
|
+
this.teardown();
|
|
554
|
+
endDragging();
|
|
555
|
+
if (typeof this.dragTarget.onDragEnd === "function") {
|
|
556
|
+
let rect = (this.currentDropTarget && this.dropOperation !== "cancel" ? this.currentDropTarget : this.dragTarget).element.getBoundingClientRect();
|
|
557
|
+
this.dragTarget.onDragEnd({
|
|
558
|
+
type: "dragend",
|
|
559
|
+
x: rect.x + rect.width / 2,
|
|
560
|
+
y: rect.y + rect.height / 2,
|
|
561
|
+
dropOperation: this.dropOperation || "cancel"
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
if (this.currentDropTarget && !this.currentDropTarget.preventFocusOnDrop) getActiveElement()?.dispatchEvent(new FocusEvent("focusin", { bubbles: true }));
|
|
565
|
+
this.setCurrentDropTarget(null);
|
|
566
|
+
}
|
|
567
|
+
cancel() {
|
|
568
|
+
this.setCurrentDropTarget(null);
|
|
569
|
+
this.end();
|
|
570
|
+
if (!this.dragTarget.element.closest("[aria-hidden=\"true\"], [inert]")) this.dragTarget.element.focus();
|
|
571
|
+
getActiveElement()?.dispatchEvent(new FocusEvent("focusin", { bubbles: true }));
|
|
572
|
+
announce(this.stringFormatter.format("dropCanceled"));
|
|
573
|
+
}
|
|
574
|
+
drop(item) {
|
|
575
|
+
if (!this.currentDropTarget) {
|
|
576
|
+
this.cancel();
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
579
|
+
if (typeof item?.getDropOperation === "function") {
|
|
580
|
+
let types = getTypes(this.dragTarget.items);
|
|
581
|
+
this.dropOperation = item.getDropOperation(types, this.dragTarget.allowedDropOperations);
|
|
582
|
+
} else if (typeof this.currentDropTarget.getDropOperation === "function") {
|
|
583
|
+
let types = getTypes(this.dragTarget.items);
|
|
584
|
+
this.dropOperation = this.currentDropTarget.getDropOperation(types, this.dragTarget.allowedDropOperations);
|
|
585
|
+
} else this.dropOperation = this.dragTarget.allowedDropOperations[0];
|
|
586
|
+
if (typeof this.currentDropTarget.onDrop === "function") {
|
|
587
|
+
let items = this.dragTarget.items.map((item) => ({
|
|
588
|
+
kind: "text",
|
|
589
|
+
types: new Set(Object.keys(item)),
|
|
590
|
+
getText: (type) => Promise.resolve(item[type])
|
|
591
|
+
}));
|
|
592
|
+
let rect = this.currentDropTarget.element.getBoundingClientRect();
|
|
593
|
+
this.currentDropTarget.onDrop({
|
|
594
|
+
type: "drop",
|
|
595
|
+
x: rect.left + rect.width / 2,
|
|
596
|
+
y: rect.top + rect.height / 2,
|
|
597
|
+
items,
|
|
598
|
+
dropOperation: this.dropOperation
|
|
599
|
+
}, item?.target ?? null);
|
|
600
|
+
}
|
|
601
|
+
this.end();
|
|
602
|
+
announce(this.stringFormatter.format("dropComplete"));
|
|
603
|
+
}
|
|
604
|
+
activate(dropTarget, dropItem) {
|
|
605
|
+
if (dropTarget && typeof dropTarget.onDropActivate === "function") {
|
|
606
|
+
let target = dropItem?.target ?? null;
|
|
607
|
+
let rect = dropTarget.element.getBoundingClientRect();
|
|
608
|
+
dropTarget.onDropActivate({
|
|
609
|
+
type: "dropactivate",
|
|
610
|
+
x: rect.left + rect.width / 2,
|
|
611
|
+
y: rect.top + rect.height / 2
|
|
612
|
+
}, target);
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
};
|
|
616
|
+
function findValidDropTargets(options) {
|
|
617
|
+
let types = getTypes(options.items);
|
|
618
|
+
return [...dropTargets.values()].filter((target) => {
|
|
619
|
+
if (target.element.closest("[aria-hidden=\"true\"], [inert]")) return false;
|
|
620
|
+
if (typeof target.getDropOperation === "function") return target.getDropOperation(types, options.allowedDropOperations) !== "cancel";
|
|
621
|
+
return true;
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
//#endregion
|
|
625
|
+
export { setGlobalAllowedDropOperations as C, readFromDataTransfer as S, writeToDataTransfer as T, getGlobalDropEffect as _, registerDropTarget as a, isFileDropItem as b, DROP_OPERATION as c, DragTypesImpl as d, EFFECT_ALLOWED as f, getGlobalAllowedDropOperations as g, getDragModality as h, registerDropItem as i, DROP_OPERATION_ALLOWED as l, NATIVE_DRAG_TYPES as m, createDragSession as n, CUSTOM_DRAG_TYPE as o, GENERIC_TYPE as p, isVirtualDragging as r, DROP_EFFECT_TO_DROP_OPERATION as s, beginDragging as t, DROP_OPERATION_TO_DROP_EFFECT as u, getTypes as v, setGlobalDropEffect as w, isTextDropItem as x, isDirectoryDropItem as y };
|
|
626
|
+
|
|
627
|
+
//# sourceMappingURL=DragManager.js.map
|