@proyecto-viviana/solidaria 0.4.2 → 0.4.3
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.map +1 -1
- package/dist/_chunk/DragManager.jsx.map +1 -1
- package/dist/_chunk/actiongroup.js.map +1 -1
- package/dist/_chunk/actiongroup.jsx.map +1 -1
- package/dist/_chunk/datepicker.js +544 -544
- package/dist/_chunk/datepicker.js.map +1 -1
- package/dist/_chunk/datepicker.jsx +544 -544
- package/dist/_chunk/datepicker.jsx.map +1 -1
- package/dist/_chunk/dnd.js.map +1 -1
- package/dist/_chunk/dnd.jsx.map +1 -1
- package/dist/_chunk/select.js +6 -2
- package/dist/_chunk/select.js.map +1 -1
- package/dist/_chunk/select.jsx +6 -2
- package/dist/_chunk/select.jsx.map +1 -1
- package/dist/_chunk/spinbutton.js +34 -34
- package/dist/_chunk/spinbutton.js.map +1 -1
- package/dist/_chunk/spinbutton.jsx +34 -34
- package/dist/_chunk/spinbutton.jsx.map +1 -1
- package/dist/_chunk/table.js.map +1 -1
- package/dist/_chunk/table.jsx.map +1 -1
- package/dist/_chunk/tree.js.map +1 -1
- package/dist/_chunk/tree.jsx.map +1 -1
- package/dist/actiongroup/createActionGroup.d.ts.map +1 -1
- package/dist/datepicker/createDateField.d.ts.map +1 -1
- package/dist/datepicker/createDatePickerGroup.d.ts.map +1 -1
- package/dist/datepicker/createDateSegment.d.ts.map +1 -1
- package/dist/datepicker/createTimeField.d.ts.map +1 -1
- package/dist/datepicker/intl.d.ts.map +1 -1
- package/dist/dnd/DragManager.d.ts.map +1 -1
- package/dist/dnd/createDraggableItem.d.ts.map +1 -1
- package/dist/dnd/createDroppableCollection.d.ts.map +1 -1
- package/dist/select/createSelect.d.ts.map +1 -1
- package/dist/spinbutton/index.d.ts +2 -2
- package/dist/spinbutton/index.d.ts.map +1 -1
- package/dist/table/createTable.d.ts.map +1 -1
- package/dist/table/utils.d.ts.map +1 -1
- package/dist/tree/createTree.d.ts.map +1 -1
- package/package.json +4 -2
- package/src/actiongroup/createActionGroup.ts +1 -4
- package/src/datepicker/createDateField.ts +3 -1
- package/src/datepicker/createDatePickerGroup.ts +8 -4
- package/src/datepicker/createDateSegment.ts +47 -39
- package/src/datepicker/createTimeField.ts +1 -5
- package/src/datepicker/intl.ts +587 -544
- package/src/dnd/DragManager.ts +5 -5
- package/src/dnd/DropTargetKeyboardNavigation.ts +6 -4
- package/src/dnd/createDraggableItem.ts +3 -1
- package/src/dnd/createDroppableCollection.ts +7 -8
- package/src/select/createSelect.ts +19 -16
- package/src/spinbutton/index.ts +2 -10
- package/src/spinbutton/intl.ts +34 -34
- package/src/table/createTable.ts +2 -3
- package/src/table/utils.ts +1 -6
- package/src/tree/createTree.ts +1 -4
package/dist/_chunk/dnd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dnd.js","names":["arAE","bgBG","csCZ","daDK","deDE","elGR","enUS","esES","etEE","fiFI","frFR","heIL","hrHR","huHU","itIT","jaJP","koKR","ltLT","lvLV","nbNO","nlNL","plPL","ptBR","ptPT","roRO","ruRU","skSK","slSI","srSP","svSE","trTR","ukUA","zhCN","zhTW"],"sources":["../../src/dnd/createDraggableCollection.ts","../../src/dnd/intl/ar-AE.json","../../src/dnd/intl/bg-BG.json","../../src/dnd/intl/cs-CZ.json","../../src/dnd/intl/da-DK.json","../../src/dnd/intl/de-DE.json","../../src/dnd/intl/el-GR.json","../../src/dnd/intl/en-US.json","../../src/dnd/intl/es-ES.json","../../src/dnd/intl/et-EE.json","../../src/dnd/intl/fi-FI.json","../../src/dnd/intl/fr-FR.json","../../src/dnd/intl/he-IL.json","../../src/dnd/intl/hr-HR.json","../../src/dnd/intl/hu-HU.json","../../src/dnd/intl/it-IT.json","../../src/dnd/intl/ja-JP.json","../../src/dnd/intl/ko-KR.json","../../src/dnd/intl/lt-LT.json","../../src/dnd/intl/lv-LV.json","../../src/dnd/intl/nb-NO.json","../../src/dnd/intl/nl-NL.json","../../src/dnd/intl/pl-PL.json","../../src/dnd/intl/pt-BR.json","../../src/dnd/intl/pt-PT.json","../../src/dnd/intl/ro-RO.json","../../src/dnd/intl/ru-RU.json","../../src/dnd/intl/sk-SK.json","../../src/dnd/intl/sl-SI.json","../../src/dnd/intl/sr-SP.json","../../src/dnd/intl/sv-SE.json","../../src/dnd/intl/tr-TR.json","../../src/dnd/intl/uk-UA.json","../../src/dnd/intl/zh-CN.json","../../src/dnd/intl/zh-TW.json","../../src/dnd/intl/index.ts","../../src/dnd/createDrag.ts","../../src/dnd/createDrop.ts","../../src/dnd/DropTargetKeyboardNavigation.ts","../../src/dnd/createDroppableCollection.ts","../../src/dnd/createDraggableItem.ts","../../src/dnd/createDroppableItem.ts"],"sourcesContent":["/**\n * createDraggableCollection - ARIA hook for draggable collection items.\n *\n * Provides accessibility support for dragging items from a collection\n * component like ListBox, GridList, or Table.\n */\n\nimport {\n createMemo,\n createEffect,\n createSignal,\n onCleanup,\n untrack,\n type Accessor,\n} from \"solid-js\";\nimport type { DraggableCollectionState } from \"@proyecto-viviana/solid-stately\";\nimport { getTypes } from \"./utils\";\n\n// Global state for tracking the dragging collection. These back the reactive\n// `isVirtualDragging` gate that decides whether drop indicators render across\n// every mounted collection, so they must be Solid signals — React re-renders the\n// whole collection tree on a drag-state change, but Solid's fine-grained\n// reactivity only re-runs the indicator JSX if it subscribed to a signal. Plain\n// module `let`s would make the gate read a stale snapshot and never re-render.\nconst [globalDraggingCollectionRef, setGlobalDraggingCollectionRefSignal] =\n createSignal<HTMLElement | null>(null);\nconst [globalDraggingKeys, setGlobalDraggingKeysSignal] = createSignal<Set<string | number>>(\n new Set(),\n);\nconst [globalDraggingTypes, setGlobalDraggingTypesSignal] = createSignal<Set<string>>(new Set());\n\nexport function setGlobalDraggingCollectionRef(ref: HTMLElement | null): void {\n setGlobalDraggingCollectionRefSignal(ref);\n}\n\nexport function getGlobalDraggingCollectionRef(): HTMLElement | null {\n return globalDraggingCollectionRef();\n}\n\nexport function setGlobalDraggingKeys(keys: Set<string | number>): void {\n setGlobalDraggingKeysSignal(new Set(keys));\n}\n\nexport function getGlobalDraggingKeys(): Set<string | number> {\n return new Set(globalDraggingKeys());\n}\n\nexport function setGlobalDraggingTypes(types: Set<string>): void {\n setGlobalDraggingTypesSignal(new Set(types));\n}\n\nexport function getGlobalDraggingTypes(): Set<string> {\n return new Set(globalDraggingTypes());\n}\n\nexport interface DraggableCollectionOptions {\n /** Reference to the collection element. */\n ref: Accessor<HTMLElement | null>;\n}\n\nexport interface DraggableCollectionAria {\n /** The draggable collection state. */\n state: DraggableCollectionState;\n}\n\n/**\n * Creates ARIA support for a draggable collection.\n *\n * @param _options - Collection options\n * @param state - Draggable collection state\n * @returns Draggable collection ARIA result\n */\nexport function createDraggableCollection(\n options: DraggableCollectionOptions,\n state: DraggableCollectionState,\n): DraggableCollectionAria {\n const ref = createMemo(() => options.ref());\n\n // Track dragging state globally. This effect subscribes to THIS collection's\n // `state.draggingKeys`; the global-ref reads are untracked so writing the\n // globals (which are now signals) can't re-trigger this same effect into a\n // loop — only a real change in this collection's dragging keys should re-run it.\n createEffect(() => {\n const currentRef = ref();\n if (state.draggingKeys.size > 0) {\n if (untrack(getGlobalDraggingCollectionRef) !== currentRef) {\n setGlobalDraggingCollectionRef(currentRef);\n }\n setGlobalDraggingKeys(state.draggingKeys);\n setGlobalDraggingTypes(getTypes(state.getItems(state.draggingKeys)));\n return;\n }\n\n // Clear global drag tracking when this collection is no longer dragging.\n if (untrack(getGlobalDraggingCollectionRef) === currentRef) {\n setGlobalDraggingCollectionRef(null);\n setGlobalDraggingKeys(new Set());\n setGlobalDraggingTypes(new Set());\n }\n });\n\n // Clean up on unmount\n onCleanup(() => {\n if (untrack(getGlobalDraggingCollectionRef) === ref()) {\n setGlobalDraggingCollectionRef(null);\n setGlobalDraggingKeys(new Set());\n setGlobalDraggingTypes(new Set());\n }\n });\n\n return {\n state,\n };\n}\n","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","/**\n * Drag and Drop internationalization strings.\n *\n * Copied verbatim from @react-aria/dnd (react-aria 3.50 / RAC 1.19) intl/dnd.\n * All keys are plain ICU MessageFormat strings (no compiled announcement\n * functions), so the port's LocalizedStringFormatter consumes them directly.\n */\n\nimport type { LocalizedString, LocalizedStrings } from \"@internationalized/string\";\n\nimport arAE from \"./ar-AE.json\" with { type: \"json\" };\nimport bgBG from \"./bg-BG.json\" with { type: \"json\" };\nimport csCZ from \"./cs-CZ.json\" with { type: \"json\" };\nimport daDK from \"./da-DK.json\" with { type: \"json\" };\nimport deDE from \"./de-DE.json\" with { type: \"json\" };\nimport elGR from \"./el-GR.json\" with { type: \"json\" };\nimport enUS from \"./en-US.json\" with { type: \"json\" };\nimport esES from \"./es-ES.json\" with { type: \"json\" };\nimport etEE from \"./et-EE.json\" with { type: \"json\" };\nimport fiFI from \"./fi-FI.json\" with { type: \"json\" };\nimport frFR from \"./fr-FR.json\" with { type: \"json\" };\nimport heIL from \"./he-IL.json\" with { type: \"json\" };\nimport hrHR from \"./hr-HR.json\" with { type: \"json\" };\nimport huHU from \"./hu-HU.json\" with { type: \"json\" };\nimport itIT from \"./it-IT.json\" with { type: \"json\" };\nimport jaJP from \"./ja-JP.json\" with { type: \"json\" };\nimport koKR from \"./ko-KR.json\" with { type: \"json\" };\nimport ltLT from \"./lt-LT.json\" with { type: \"json\" };\nimport lvLV from \"./lv-LV.json\" with { type: \"json\" };\nimport nbNO from \"./nb-NO.json\" with { type: \"json\" };\nimport nlNL from \"./nl-NL.json\" with { type: \"json\" };\nimport plPL from \"./pl-PL.json\" with { type: \"json\" };\nimport ptBR from \"./pt-BR.json\" with { type: \"json\" };\nimport ptPT from \"./pt-PT.json\" with { type: \"json\" };\nimport roRO from \"./ro-RO.json\" with { type: \"json\" };\nimport ruRU from \"./ru-RU.json\" with { type: \"json\" };\nimport skSK from \"./sk-SK.json\" with { type: \"json\" };\nimport slSI from \"./sl-SI.json\" with { type: \"json\" };\nimport srSP from \"./sr-SP.json\" with { type: \"json\" };\nimport svSE from \"./sv-SE.json\" with { type: \"json\" };\nimport trTR from \"./tr-TR.json\" with { type: \"json\" };\nimport ukUA from \"./uk-UA.json\" with { type: \"json\" };\nimport zhCN from \"./zh-CN.json\" with { type: \"json\" };\nimport zhTW from \"./zh-TW.json\" with { type: \"json\" };\n\nexport type DndIntlStrings = {\n dragItem: string;\n dragSelectedItems: string;\n dragDescriptionKeyboard: string;\n dragDescriptionKeyboardAlt: string;\n dragDescriptionTouch: string;\n dragDescriptionVirtual: string;\n dragDescriptionLongPress: string;\n dragSelectedKeyboard: string;\n dragSelectedKeyboardAlt: string;\n dragSelectedLongPress: string;\n dragStartedKeyboard: string;\n dragStartedTouch: string;\n dragStartedVirtual: string;\n endDragKeyboard: string;\n endDragTouch: string;\n endDragVirtual: string;\n dropDescriptionKeyboard: string;\n dropDescriptionTouch: string;\n dropDescriptionVirtual: string;\n dropCanceled: string;\n dropComplete: string;\n dropIndicator: string;\n dropOnRoot: string;\n dropOnItem: string;\n insertBefore: string;\n insertBetween: string;\n insertAfter: string;\n};\n\n// `@internationalized/string`'s LocalizedStringFormatter only interpolates\n// variables when a message is a FUNCTION — a plain ICU-template string is\n// returned verbatim (`{itemText}` and friends never substituted). Upstream\n// react-aria compiles its intl JSON into functions at build time\n// (`@internationalized/string-compiler`); this port ships the raw JSON, so we\n// compile the SIMPLE `{var}` placeholders here at module load (mirroring the\n// hand-authored function forms in the color intl catalog). ICU plural/select\n// messages (any `{…,…}` group, e.g. `dragSelectedItems`) are left as strings —\n// they need the full ICU engine and are unused by the single-key drag path.\nconst SIMPLE_PLACEHOLDER = /\\{(\\w+)\\}/g;\nfunction compileSimpleIcu(message: string): LocalizedString {\n if (!SIMPLE_PLACEHOLDER.test(message)) return message;\n // Reset lastIndex (test() with /g advances it) before the plural probe.\n SIMPLE_PLACEHOLDER.lastIndex = 0;\n // Any comma inside a placeholder means real ICU (plural/select) — leave as-is.\n if (/\\{[^{}]*,[^{}]*\\}/.test(message)) return message;\n return (args?: Record<string, unknown>): string =>\n message.replace(SIMPLE_PLACEHOLDER, (_match, key: string) => String(args?.[key] ?? \"\"));\n}\n\nfunction compileLocale(strings: Record<string, string>): Record<string, LocalizedString> {\n const out: Record<string, LocalizedString> = {};\n for (const key of Object.keys(strings)) {\n out[key] = compileSimpleIcu(strings[key]);\n }\n return out;\n}\n\nexport const dndIntlStrings: LocalizedStrings<keyof DndIntlStrings, LocalizedString> = {\n \"ar-AE\": compileLocale(arAE),\n \"bg-BG\": compileLocale(bgBG),\n \"cs-CZ\": compileLocale(csCZ),\n \"da-DK\": compileLocale(daDK),\n \"de-DE\": compileLocale(deDE),\n \"el-GR\": compileLocale(elGR),\n \"en-US\": compileLocale(enUS),\n \"es-ES\": compileLocale(esES),\n \"et-EE\": compileLocale(etEE),\n \"fi-FI\": compileLocale(fiFI),\n \"fr-FR\": compileLocale(frFR),\n \"he-IL\": compileLocale(heIL),\n \"hr-HR\": compileLocale(hrHR),\n \"hu-HU\": compileLocale(huHU),\n \"it-IT\": compileLocale(itIT),\n \"ja-JP\": compileLocale(jaJP),\n \"ko-KR\": compileLocale(koKR),\n \"lt-LT\": compileLocale(ltLT),\n \"lv-LV\": compileLocale(lvLV),\n \"nb-NO\": compileLocale(nbNO),\n \"nl-NL\": compileLocale(nlNL),\n \"pl-PL\": compileLocale(plPL),\n \"pt-BR\": compileLocale(ptBR),\n \"pt-PT\": compileLocale(ptPT),\n \"ro-RO\": compileLocale(roRO),\n \"ru-RU\": compileLocale(ruRU),\n \"sk-SK\": compileLocale(skSK),\n \"sl-SI\": compileLocale(slSI),\n \"sr-SP\": compileLocale(srSP),\n \"sv-SE\": compileLocale(svSE),\n \"tr-TR\": compileLocale(trTR),\n \"uk-UA\": compileLocale(ukUA),\n \"zh-CN\": compileLocale(zhCN),\n \"zh-TW\": compileLocale(zhTW),\n};\n","/**\n * createDrag - ARIA hook for drag operations.\n *\n * Provides accessibility props for draggable elements with support for\n * mouse, touch, and keyboard interactions.\n */\n\nimport { createMemo, type Accessor } from \"solid-js\";\nimport { createDragState, type DropOperation } from \"@proyecto-viviana/solid-stately\";\nimport type { AriaDragOptions, DragAria } from \"./types\";\nimport {\n getTypes,\n writeToDataTransfer,\n DROP_OPERATION,\n EFFECT_ALLOWED,\n DROP_EFFECT_TO_DROP_OPERATION,\n setGlobalAllowedDropOperations,\n setGlobalDropEffect,\n getGlobalDropEffect,\n} from \"./utils\";\nimport { setGlobalDraggingTypes } from \"./createDraggableCollection\";\nimport { beginDragging } from \"./DragManager\";\nimport { createStringFormatter } from \"../i18n/createStringFormatter\";\nimport { dndIntlStrings } from \"./intl\";\n\n/**\n * Creates ARIA props for a draggable element.\n *\n * @param props - Accessor returning drag options\n * @returns Drag ARIA props and state\n */\nexport function createDrag(props: Accessor<AriaDragOptions>): DragAria {\n const getProps = createMemo(() => props());\n\n const state = createDragState(() => ({\n getItems: getProps().getItems,\n getAllowedDropOperations: getProps().getAllowedDropOperations,\n onDragStart: getProps().onDragStart,\n onDragMove: getProps().onDragMove,\n onDragEnd: getProps().onDragEnd,\n isDisabled: getProps().isDisabled,\n hasDragButton: getProps().hasDragButton,\n preview: getProps().preview,\n }));\n\n const stringFormatter = createStringFormatter(dndIntlStrings);\n\n let lastX = 0;\n let lastY = 0;\n\n const onDragStart = (e: DragEvent) => {\n if (e.defaultPrevented) return;\n e.stopPropagation();\n\n const p = getProps();\n\n state.startDrag(e.clientX, e.clientY);\n\n const items = state.getItems();\n setGlobalDraggingTypes(getTypes(items));\n e.dataTransfer?.clearData?.();\n if (e.dataTransfer) {\n writeToDataTransfer(e.dataTransfer, items);\n }\n\n let allowed = DROP_OPERATION.all;\n const allowedOps = state.getAllowedDropOperations();\n if (allowedOps.length > 0) {\n allowed = DROP_OPERATION.none;\n for (const op of allowedOps) {\n allowed |= DROP_OPERATION[op] || DROP_OPERATION.none;\n }\n }\n\n setGlobalAllowedDropOperations(allowed);\n const effectAllowed = EFFECT_ALLOWED[allowed] || \"none\";\n if (e.dataTransfer) {\n e.dataTransfer.effectAllowed = (\n effectAllowed === \"cancel\" ? \"none\" : effectAllowed\n ) as DataTransfer[\"effectAllowed\"];\n }\n\n if (typeof p.preview?.current === \"function\" && e.dataTransfer) {\n p.preview.current(items, (node, userX, userY) => {\n if (!node || !e.dataTransfer) return;\n\n const size = node.getBoundingClientRect();\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\n let defaultX = e.clientX - rect.x;\n let defaultY = e.clientY - rect.y;\n\n if (defaultX > size.width || defaultY > size.height) {\n defaultX = size.width / 2;\n defaultY = size.height / 2;\n }\n\n let offsetX = typeof userX === \"number\" ? userX : defaultX;\n let offsetY = typeof userY === \"number\" ? userY : defaultY;\n\n offsetX = Math.max(0, Math.min(offsetX, size.width));\n offsetY = Math.max(0, Math.min(offsetY, size.height));\n\n e.dataTransfer.setDragImage(node, offsetX, offsetY);\n });\n }\n\n lastX = e.clientX;\n lastY = e.clientY;\n };\n\n const onDrag = (e: DragEvent) => {\n e.stopPropagation();\n\n if (e.clientX === lastX && e.clientY === lastY) {\n return;\n }\n\n state.moveDrag(e.clientX, e.clientY);\n\n lastX = e.clientX;\n lastY = e.clientY;\n };\n\n const onDragEnd = (e: DragEvent) => {\n e.stopPropagation();\n\n let dropEffect: string = e.dataTransfer?.dropEffect ?? \"none\";\n // Chrome Android fix - use global drop effect\n if (getGlobalDropEffect()) {\n dropEffect = getGlobalDropEffect()!;\n }\n\n const dropOperation = DROP_EFFECT_TO_DROP_OPERATION[dropEffect];\n state.endDrag(e.clientX, e.clientY, dropOperation);\n\n setGlobalAllowedDropOperations(DROP_OPERATION.none);\n setGlobalDraggingTypes(new Set());\n setGlobalDropEffect(undefined);\n };\n\n // Keyboard/screen reader drag initiation\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"Enter\" && e.target === e.currentTarget) {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n\n const onKeyUp = (e: KeyboardEvent) => {\n if (e.key === \"Enter\" && e.target === e.currentTarget) {\n e.preventDefault();\n e.stopPropagation();\n\n const el = e.currentTarget as HTMLElement;\n const rect = el.getBoundingClientRect();\n state.startDrag(rect.x + rect.width / 2, rect.y + rect.height / 2);\n\n const items = state.getItems();\n setGlobalDraggingTypes(getTypes(items));\n\n const allowedOps = state.getAllowedDropOperations();\n let allowed = DROP_OPERATION.all;\n if (allowedOps.length > 0) {\n allowed = DROP_OPERATION.none;\n for (const op of allowedOps) {\n allowed |= DROP_OPERATION[op] || DROP_OPERATION.none;\n }\n }\n setGlobalAllowedDropOperations(allowed);\n\n // Hand control to the keyboard DragManager session: it installs the\n // document-capture listeners that drive Tab-cycling across drop targets,\n // Arrow navigation within a target, and Enter/Escape drop/cancel.\n beginDragging(\n {\n element: el,\n items,\n allowedDropOperations:\n allowedOps.length > 0 ? allowedOps : ([\"move\", \"copy\", \"link\"] as DropOperation[]),\n onDragEnd: (ev) => {\n state.endDrag(ev.x, ev.y, ev.dropOperation);\n setGlobalAllowedDropOperations(DROP_OPERATION.none);\n setGlobalDraggingTypes(new Set());\n setGlobalDropEffect(undefined);\n },\n },\n stringFormatter(),\n );\n }\n };\n\n const dragProps = createMemo(() => {\n const p = getProps();\n\n if (p.isDisabled) {\n return {\n draggable: false as const,\n };\n }\n\n const baseProps: Record<string, unknown> = {\n draggable: true as const,\n onDragStart,\n onDrag,\n onDragEnd,\n };\n\n if (!p.hasDragButton) {\n baseProps.onKeyDown = onKeyDown;\n baseProps.onKeyUp = onKeyUp;\n }\n\n return baseProps;\n });\n\n const dragButtonProps = createMemo(() => {\n const p = getProps();\n\n if (p.isDisabled) {\n return {\n disabled: true,\n };\n }\n\n return {\n type: \"button\" as const,\n \"aria-label\": \"Drag\",\n onKeyDown,\n onKeyUp,\n };\n });\n\n return {\n get dragProps() {\n return dragProps() as DragAria[\"dragProps\"];\n },\n get dragButtonProps() {\n return dragButtonProps() as DragAria[\"dragButtonProps\"];\n },\n get isDragging() {\n return state.isDragging;\n },\n };\n}\n","/**\n * createDrop - ARIA hook for drop operations.\n *\n * Provides accessibility props for drop target elements with support for\n * mouse, touch, and keyboard interactions.\n */\n\nimport { createMemo, type Accessor } from \"solid-js\";\nimport { createDropState } from \"@proyecto-viviana/solid-stately\";\nimport type { AriaDropOptions, DropAria } from \"./types\";\nimport {\n readFromDataTransfer,\n DragTypesImpl,\n DROP_OPERATION,\n DROP_OPERATION_ALLOWED,\n DROP_OPERATION_TO_DROP_EFFECT,\n DROP_EFFECT_TO_DROP_OPERATION,\n setGlobalDropEffect,\n getGlobalAllowedDropOperations,\n} from \"./utils\";\nimport type { DropOperation } from \"@proyecto-viviana/solid-stately\";\n\nconst DROP_ACTIVATE_TIMEOUT = 800;\n\n/**\n * Creates ARIA props for a drop target element.\n *\n * @param props - Accessor returning drop options\n * @returns Drop ARIA props and state\n */\nexport function createDrop(props: Accessor<AriaDropOptions>): DropAria {\n const getProps = createMemo(() => props());\n\n const state = createDropState(() => ({\n getDropOperation: getProps().getDropOperation,\n onDropEnter: getProps().onDropEnter,\n onDropMove: getProps().onDropMove,\n onDropActivate: getProps().onDropActivate,\n onDropExit: getProps().onDropExit,\n onDrop: getProps().onDrop,\n hasDropButton: getProps().hasDropButton,\n isDisabled: getProps().isDisabled,\n }));\n\n let x = 0;\n let y = 0;\n let dragOverElements = new Set<Element>();\n let dropEffect: DataTransfer[\"dropEffect\"] = \"none\";\n let allowedOperations = DROP_OPERATION.all;\n let dropActivateTimer: ReturnType<typeof setTimeout> | undefined;\n\n const fireDropEnter = (e: DragEvent) => {\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\n state.enterTarget(e.clientX - rect.x, e.clientY - rect.y);\n };\n\n const fireDropExit = (e: DragEvent) => {\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\n state.exitTarget(e.clientX - rect.x, e.clientY - rect.y);\n };\n\n const getAllowedOperations = (e: DragEvent): number => {\n let allowed =\n DROP_OPERATION_ALLOWED[e.dataTransfer?.effectAllowed ?? \"none\"] ?? DROP_OPERATION.none;\n\n // Use global allowed operations if set (for internal drags)\n const globalAllowed = getGlobalAllowedDropOperations();\n if (globalAllowed) {\n allowed &= globalAllowed;\n }\n\n let modifierAllowed = DROP_OPERATION.none;\n\n // macOS: Alt=copy, Ctrl=link, Cmd=move\n // Windows/Linux: Alt=link, Shift=move, Ctrl=copy\n const isMac = typeof navigator !== \"undefined\" && /mac/i.test(navigator.platform);\n\n if (isMac) {\n if (e.altKey) modifierAllowed |= DROP_OPERATION.copy;\n if (e.ctrlKey) modifierAllowed |= DROP_OPERATION.link;\n if (e.metaKey) modifierAllowed |= DROP_OPERATION.move;\n } else {\n if (e.altKey) modifierAllowed |= DROP_OPERATION.link;\n if (e.shiftKey) modifierAllowed |= DROP_OPERATION.move;\n if (e.ctrlKey) modifierAllowed |= DROP_OPERATION.copy;\n }\n\n if (modifierAllowed) {\n return allowed & modifierAllowed;\n }\n\n return allowed;\n };\n\n const allowedOperationsToArray = (ops: number): DropOperation[] => {\n const result: DropOperation[] = [];\n if (ops & DROP_OPERATION.move) result.push(\"move\");\n if (ops & DROP_OPERATION.copy) result.push(\"copy\");\n if (ops & DROP_OPERATION.link) result.push(\"link\");\n return result;\n };\n\n const getDropOperationForAllowed = (allowed: number, operation: DropOperation): DropOperation => {\n const op = DROP_OPERATION[operation];\n return allowed & op ? operation : \"cancel\";\n };\n\n const onDragEnter = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n\n dragOverElements.add(e.target as Element);\n if (dragOverElements.size > 1) {\n return;\n }\n\n const p = getProps();\n const allowedOpsBits = getAllowedOperations(e);\n const allowedOps = allowedOperationsToArray(allowedOpsBits);\n let dropOp: DropOperation = allowedOps[0] ?? \"cancel\";\n\n if (typeof p.getDropOperation === \"function\" && e.dataTransfer) {\n const types = new DragTypesImpl(e.dataTransfer);\n dropOp = getDropOperationForAllowed(allowedOpsBits, p.getDropOperation(types, allowedOps));\n }\n\n if (typeof p.getDropOperationForPoint === \"function\" && e.dataTransfer) {\n const types = new DragTypesImpl(e.dataTransfer);\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\n dropOp = getDropOperationForAllowed(\n allowedOpsBits,\n p.getDropOperationForPoint(types, allowedOps, e.clientX - rect.x, e.clientY - rect.y),\n );\n }\n\n x = e.clientX;\n y = e.clientY;\n allowedOperations = allowedOpsBits;\n dropEffect = (DROP_OPERATION_TO_DROP_EFFECT[dropOp] || \"none\") as DataTransfer[\"dropEffect\"];\n\n if (e.dataTransfer) {\n e.dataTransfer.dropEffect = dropEffect;\n }\n\n if (dropOp !== \"cancel\") {\n fireDropEnter(e);\n }\n };\n\n const onDragOver = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n\n const allowedOpsBits = getAllowedOperations(e);\n\n // Skip if position and operations haven't changed\n if (e.clientX === x && e.clientY === y && allowedOpsBits === allowedOperations) {\n if (e.dataTransfer) {\n e.dataTransfer.dropEffect = dropEffect;\n }\n return;\n }\n\n x = e.clientX;\n y = e.clientY;\n\n const prevDropEffect = dropEffect;\n const p = getProps();\n\n if (allowedOpsBits !== allowedOperations) {\n const allowedOps = allowedOperationsToArray(allowedOpsBits);\n let dropOp: DropOperation = allowedOps[0] ?? \"cancel\";\n\n if (typeof p.getDropOperation === \"function\" && e.dataTransfer) {\n const types = new DragTypesImpl(e.dataTransfer);\n dropOp = getDropOperationForAllowed(allowedOpsBits, p.getDropOperation(types, allowedOps));\n }\n dropEffect = (DROP_OPERATION_TO_DROP_EFFECT[dropOp] || \"none\") as DataTransfer[\"dropEffect\"];\n }\n\n if (typeof p.getDropOperationForPoint === \"function\" && e.dataTransfer) {\n const types = new DragTypesImpl(e.dataTransfer);\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\n const dropOp = getDropOperationForAllowed(\n allowedOpsBits,\n p.getDropOperationForPoint(\n types,\n allowedOperationsToArray(allowedOpsBits),\n x - rect.x,\n y - rect.y,\n ),\n );\n dropEffect = (DROP_OPERATION_TO_DROP_EFFECT[dropOp] || \"none\") as DataTransfer[\"dropEffect\"];\n }\n\n allowedOperations = allowedOpsBits;\n\n if (e.dataTransfer) {\n e.dataTransfer.dropEffect = dropEffect;\n }\n\n if (dropEffect === \"none\" && prevDropEffect !== \"none\") {\n fireDropExit(e);\n } else if (dropEffect !== \"none\" && prevDropEffect === \"none\") {\n fireDropEnter(e);\n }\n\n if (dropEffect !== \"none\") {\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\n state.moveInTarget(x - rect.x, y - rect.y);\n }\n\n clearTimeout(dropActivateTimer);\n\n if (typeof p.onDropActivate === \"function\" && dropEffect !== \"none\") {\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\n const activateX = x - rect.x;\n const activateY = y - rect.y;\n dropActivateTimer = setTimeout(() => {\n state.activateTarget(activateX, activateY);\n }, DROP_ACTIVATE_TIMEOUT);\n }\n };\n\n const onDragLeave = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n\n // Track drag over elements (WebKit workaround for relatedTarget being null)\n dragOverElements.delete(e.target as Element);\n\n for (const element of dragOverElements) {\n if (!e.currentTarget || !(e.currentTarget as Element).contains(element)) {\n dragOverElements.delete(element);\n }\n }\n\n if (dragOverElements.size > 0) {\n return;\n }\n\n if (dropEffect !== \"none\") {\n fireDropExit(e);\n }\n\n clearTimeout(dropActivateTimer);\n };\n\n const onDropHandler = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n\n // Track drop effect globally for Chrome Android\n setGlobalDropEffect(dropEffect);\n\n const p = getProps();\n if (typeof p.onDrop === \"function\" && e.dataTransfer) {\n const items = readFromDataTransfer(e.dataTransfer);\n const dropOperation = DROP_EFFECT_TO_DROP_OPERATION[dropEffect];\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\n\n state.drop(e.clientX - rect.x, e.clientY - rect.y, items, dropOperation);\n }\n\n dragOverElements.clear();\n fireDropExit(e);\n clearTimeout(dropActivateTimer);\n };\n\n const dropProps = createMemo(() => {\n const p = getProps();\n\n if (p.isDisabled) {\n return {};\n }\n\n const baseProps: Record<string, unknown> = {\n onDragEnter,\n onDragOver,\n onDragLeave,\n onDrop: onDropHandler,\n };\n\n return baseProps;\n });\n\n const dropButtonProps = createMemo(() => {\n const p = getProps();\n\n if (p.isDisabled) {\n return {\n disabled: true,\n };\n }\n\n return {\n type: \"button\" as const,\n \"aria-label\": \"Drop\",\n };\n });\n\n return {\n get dropProps() {\n return dropProps() as DropAria[\"dropProps\"];\n },\n get isDropTarget() {\n return state.isDropTarget;\n },\n get dropButtonProps() {\n return dropButtonProps() as DropAria[\"dropButtonProps\"];\n },\n };\n}\n","/**\n * Keyboard navigation between drop targets within a droppable collection.\n *\n * Faithful port of @react-aria/dnd `DropTargetKeyboardNavigation` (react-aria\n * 3.50). Given a keyboard delegate, the collection, and the current drop target,\n * returns the next/previous drop target in a given direction — cycling through\n * the `before`/`on`/`after` drop positions on each item and descending into\n * nested items.\n *\n * Upstream reads `node.nextKey` / `node.prevKey` (the flattened collection\n * linked-list pointers). In our collection model those are exactly what\n * `collection.getKeyAfter(key)` / `collection.getKeyBefore(key)` return, so they\n * are substituted 1:1 with no behavioral difference. Upstream's `lastChildKey`\n * fast-path is absent from our `CollectionNode`, so we always take upstream's\n * own `childNodes.findLast` fallback branch.\n */\n\nimport type { Collection, CollectionNode, Key } from \"@proyecto-viviana/solid-stately\";\nimport type { DropTarget } from \"@proyecto-viviana/solid-stately\";\n\n/**\n * Keyboard delegate shape consumed by drop-target navigation. Mirrors the\n * subset of `@react-types/shared` `KeyboardDelegate` that navigation uses,\n * including the `{includeDisabled}` option so drop positions around disabled\n * items remain reachable.\n */\nexport interface DropNavigationKeyboardDelegate {\n getKeyBelow?(key: Key, options?: { includeDisabled?: boolean }): Key | null;\n getKeyAbove?(key: Key, options?: { includeDisabled?: boolean }): Key | null;\n getKeyLeftOf?(key: Key, options?: { includeDisabled?: boolean }): Key | null;\n getKeyRightOf?(key: Key, options?: { includeDisabled?: boolean }): Key | null;\n getFirstKey?(key?: Key, global?: boolean): Key | null;\n getLastKey?(key?: Key, global?: boolean): Key | null;\n}\n\nexport function navigate(\n keyboardDelegate: DropNavigationKeyboardDelegate,\n collection: Collection,\n target: DropTarget | null | undefined,\n direction: \"left\" | \"right\" | \"up\" | \"down\",\n rtl = false,\n wrap = false,\n): DropTarget | null {\n switch (direction) {\n case \"left\":\n return rtl\n ? nextDropTarget(keyboardDelegate, collection, target, wrap, \"left\")\n : previousDropTarget(keyboardDelegate, collection, target, wrap, \"left\");\n case \"right\":\n return rtl\n ? previousDropTarget(keyboardDelegate, collection, target, wrap, \"right\")\n : nextDropTarget(keyboardDelegate, collection, target, wrap, \"right\");\n case \"up\":\n return previousDropTarget(keyboardDelegate, collection, target, wrap);\n case \"down\":\n return nextDropTarget(keyboardDelegate, collection, target, wrap);\n }\n}\n\nfunction nextDropTarget(\n keyboardDelegate: DropNavigationKeyboardDelegate,\n collection: Collection,\n target: DropTarget | null | undefined,\n wrap = false,\n horizontal: \"left\" | \"right\" | null = null,\n): DropTarget | null {\n if (!target) {\n return {\n type: \"root\",\n };\n }\n\n if (target.type === \"root\") {\n let nextKey = keyboardDelegate.getFirstKey?.() ?? null;\n if (nextKey != null) {\n return {\n type: \"item\",\n key: nextKey,\n dropPosition: \"before\",\n };\n }\n\n return null;\n }\n\n if (target.type === \"item\") {\n let nextKey: Key | null | undefined = null;\n if (horizontal) {\n nextKey =\n horizontal === \"right\"\n ? keyboardDelegate.getKeyRightOf?.(target.key, { includeDisabled: true })\n : keyboardDelegate.getKeyLeftOf?.(target.key, { includeDisabled: true });\n } else {\n nextKey = keyboardDelegate.getKeyBelow?.(target.key, { includeDisabled: true });\n }\n let nextCollectionKey = getNextItem(collection, target.key, (key) => collection.getKeyAfter(key));\n\n // If the keyboard delegate did not move to the next key in the collection,\n // jump to that key with the same drop position. Otherwise, try the other\n // drop positions on the current key first.\n if (nextKey != null && nextKey !== nextCollectionKey) {\n return {\n type: \"item\",\n key: nextKey,\n dropPosition: target.dropPosition,\n };\n }\n\n switch (target.dropPosition) {\n case \"before\": {\n return {\n type: \"item\",\n key: target.key,\n dropPosition: \"on\",\n };\n }\n case \"on\": {\n // If there are nested items, traverse to them prior to the \"after\" position of this target.\n // If the next key is on the same level, then its \"before\" position is equivalent to this item's \"after\" position.\n let targetNode = collection.getItem(target.key);\n let nextNode = nextKey != null ? collection.getItem(nextKey) : null;\n if (targetNode && nextNode && nextNode.level >= targetNode.level) {\n return {\n type: \"item\",\n key: nextNode.key,\n dropPosition: \"before\",\n };\n }\n\n return {\n type: \"item\",\n key: target.key,\n dropPosition: \"after\",\n };\n }\n case \"after\": {\n // If this is the last sibling in a level, traverse to the parent.\n let targetNode = collection.getItem(target.key);\n let nextSiblingKey = targetNode != null ? collection.getKeyAfter(targetNode.key) : null;\n let nextItemInSameLevel = nextSiblingKey != null ? collection.getItem(nextSiblingKey) : null;\n while (nextItemInSameLevel != null && nextItemInSameLevel.type !== \"item\") {\n let afterKey = collection.getKeyAfter(nextItemInSameLevel.key);\n nextItemInSameLevel = afterKey != null ? collection.getItem(afterKey) : null;\n }\n\n if (targetNode && nextItemInSameLevel == null && targetNode.parentKey != null) {\n // If the parent item has an item after it, use the \"before\" position.\n let parentNode = collection.getItem(targetNode.parentKey);\n let parentNextKey = parentNode != null ? collection.getKeyAfter(parentNode.key) : null;\n const nextNode = parentNextKey != null ? collection.getItem(parentNextKey) : null;\n if (nextNode?.type === \"item\") {\n return {\n type: \"item\",\n key: nextNode.key,\n dropPosition: \"before\",\n };\n }\n\n if (parentNode?.type === \"item\") {\n return {\n type: \"item\",\n key: parentNode.key,\n dropPosition: \"after\",\n };\n }\n }\n\n if (nextItemInSameLevel) {\n return {\n type: \"item\",\n key: nextItemInSameLevel.key,\n dropPosition: \"on\",\n };\n }\n }\n }\n }\n\n if (wrap) {\n return {\n type: \"root\",\n };\n }\n\n return null;\n}\n\nfunction previousDropTarget(\n keyboardDelegate: DropNavigationKeyboardDelegate,\n collection: Collection,\n target: DropTarget | null | undefined,\n wrap = false,\n horizontal: \"left\" | \"right\" | null = null,\n): DropTarget | null {\n // Start after the last root-level item.\n if (!target || (wrap && target.type === \"root\")) {\n // Keyboard delegate gets the deepest item but we want the shallowest.\n let prevKey: Key | null = null;\n let lastKey = keyboardDelegate.getLastKey?.();\n while (lastKey != null) {\n let node = collection.getItem(lastKey);\n if (node?.type !== \"item\") {\n break;\n }\n prevKey = lastKey;\n lastKey = node?.parentKey;\n }\n\n if (prevKey != null) {\n return {\n type: \"item\",\n key: prevKey,\n dropPosition: \"after\",\n };\n }\n\n return null;\n }\n\n if (target.type === \"item\") {\n let prevKey: Key | null | undefined = null;\n if (horizontal) {\n prevKey =\n horizontal === \"left\"\n ? keyboardDelegate.getKeyLeftOf?.(target.key, { includeDisabled: true })\n : keyboardDelegate.getKeyRightOf?.(target.key, { includeDisabled: true });\n } else {\n prevKey = keyboardDelegate.getKeyAbove?.(target.key, { includeDisabled: true });\n }\n let prevCollectionKey = getNextItem(collection, target.key, (key) =>\n collection.getKeyBefore(key),\n );\n\n // If the keyboard delegate did not move to the next key in the collection,\n // jump to that key with the same drop position. Otherwise, try the other\n // drop positions on the current key first.\n if (prevKey != null && prevKey !== prevCollectionKey) {\n return {\n type: \"item\",\n key: prevKey,\n dropPosition: target.dropPosition,\n };\n }\n\n switch (target.dropPosition) {\n case \"before\": {\n // Move after the last child of the previous item.\n let targetNode = collection.getItem(target.key);\n let targetPrevKey = targetNode != null ? collection.getKeyBefore(targetNode.key) : null;\n if (targetNode && targetPrevKey != null) {\n let lastChild = getLastChild(collection, targetPrevKey);\n if (lastChild) {\n return lastChild;\n }\n }\n\n if (prevKey != null) {\n return {\n type: \"item\",\n key: prevKey,\n dropPosition: \"on\",\n };\n }\n\n return {\n type: \"root\",\n };\n }\n case \"on\": {\n return {\n type: \"item\",\n key: target.key,\n dropPosition: \"before\",\n };\n }\n case \"after\": {\n // Move after the last child of this item.\n let lastChild = getLastChild(collection, target.key);\n if (lastChild) {\n return lastChild;\n }\n\n return {\n type: \"item\",\n key: target.key,\n dropPosition: \"on\",\n };\n }\n }\n }\n\n if (target.type !== \"root\") {\n return {\n type: \"root\",\n };\n }\n\n return null;\n}\n\nfunction getLastChild(collection: Collection, key: Key): DropTarget | null {\n // getChildNodes still returns child tree items even when the item is collapsed.\n // Checking if the next item has a greater level is a silly way to determine if the item is expanded.\n let targetNode = collection.getItem(key);\n let nextKey = getNextItem(collection, key, (key) => collection.getKeyAfter(key));\n let nextNode = nextKey != null ? collection.getItem(nextKey) : null;\n if (targetNode && nextNode && nextNode.level > targetNode.level) {\n let lastChild: CollectionNode | null = null;\n lastChild =\n Array.from(targetNode.childNodes).findLast((item) => item.type === \"item\") || null;\n\n if (lastChild) {\n return {\n type: \"item\",\n key: lastChild.key,\n dropPosition: \"after\",\n };\n }\n }\n\n return null;\n}\n\n// Find the next or previous item in a collection, skipping over other types of nodes (e.g. content).\nfunction getNextItem(\n collection: Collection,\n key: Key,\n getNextKey: (key: Key) => Key | null,\n): Key | null {\n let nextCollectionKey = getNextKey(key);\n let nextCollectionNode = nextCollectionKey != null ? collection.getItem(nextCollectionKey) : null;\n while (nextCollectionNode && nextCollectionNode.type !== \"item\") {\n nextCollectionKey = getNextKey(nextCollectionNode.key);\n nextCollectionNode = nextCollectionKey != null ? collection.getItem(nextCollectionKey) : null;\n }\n return nextCollectionKey;\n}\n","/**\n * createDroppableCollection - ARIA hook for droppable collection targets.\n *\n * Provides accessibility support for dropping items into a collection\n * component like ListBox, GridList, or Table.\n */\n\nimport { createEffect, createMemo, onCleanup, type Accessor } from \"solid-js\";\nimport type { JSX } from \"solid-js\";\nimport type {\n Collection,\n DroppableCollectionState,\n DropTarget,\n DropOperation,\n DropItem,\n DragType,\n DragTypes,\n Key,\n} from \"@proyecto-viviana/solid-stately\";\nimport { DIRECTORY_DRAG_TYPE } from \"@proyecto-viviana/solid-stately\";\nimport { createDrop } from \"./createDrop\";\nimport { getGlobalDraggingCollectionRef, getGlobalDraggingKeys } from \"./createDraggableCollection\";\nimport { getTypes } from \"./utils\";\nimport { registerDropTarget } from \"./DragManager\";\nimport { navigate, type DropNavigationKeyboardDelegate } from \"./DropTargetKeyboardNavigation\";\nimport { useLocale } from \"../i18n/locale\";\n\n// Global state for tracking the drop collection\nlet globalDropCollectionRef: HTMLElement | null = null;\n\nexport function setGlobalDropCollectionRef(ref: HTMLElement | null): void {\n globalDropCollectionRef = ref;\n}\n\nexport function getGlobalDropCollectionRef(): HTMLElement | null {\n return globalDropCollectionRef;\n}\n\nexport interface DropTargetDelegate {\n /**\n * Returns a drop target from a point within the collection.\n */\n getDropTargetFromPoint(\n x: number,\n y: number,\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget | null;\n /**\n * Returns the next keyboard-navigable drop target.\n */\n getKeyboardNavigationTarget?(\n target: DropTarget | null,\n direction: \"next\" | \"previous\",\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget | null;\n /**\n * Returns the next page-navigable drop target.\n */\n getKeyboardPageNavigationTarget?(\n target: DropTarget | null,\n direction: \"next\" | \"previous\",\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget | null;\n}\n\nexport interface KeyboardDelegateLike {\n getFirstKey?: () => string | number | null;\n getLastKey?: () => string | number | null;\n getKeyBelow?: (key: string | number) => string | number | null;\n getKeyAbove?: (key: string | number) => string | number | null;\n getKeyRightOf?: (key: string | number) => string | number | null;\n getKeyLeftOf?: (key: string | number) => string | number | null;\n getKeyPageBelow?: (key: string | number) => string | number | null;\n getKeyPageAbove?: (key: string | number) => string | number | null;\n}\n\ninterface CollectionNodeLike {\n type?: string;\n key: Key;\n parentKey?: Key | null;\n childNodes?: CollectionNodeLike[];\n isExpanded?: boolean;\n}\n\ninterface CollectionLike {\n getItem(key: Key): CollectionNodeLike | null;\n [Symbol.iterator](): Iterator<CollectionNodeLike>;\n}\n\nexport interface DroppableCollectionOptions {\n /** Reference to the collection element. */\n ref: Accessor<HTMLElement | null>;\n /** A delegate that provides drop targets for pointer coordinates. */\n dropTargetDelegate: DropTargetDelegate;\n /** Handler called when items are dropped to be inserted. */\n onInsert?: (e: { items: DropItem[]; target: DropTarget; dropOperation: DropOperation }) => void;\n /** Handler called when items are dropped on the root. */\n onRootDrop?: (e: { items: DropItem[]; dropOperation: DropOperation }) => void;\n /** Handler called when items are dropped on an item. */\n onItemDrop?: (e: {\n items: DropItem[];\n target: DropTarget;\n dropOperation: DropOperation;\n isInternal: boolean;\n }) => void;\n /** Handler called when items are reordered within the collection. */\n onReorder?: (e: {\n keys: Set<string | number>;\n target: DropTarget;\n dropOperation: DropOperation;\n }) => void;\n /** Handler called when items are moved within/between collections. */\n onMove?: (e: {\n keys: Set<string | number>;\n target: DropTarget;\n dropOperation: DropOperation;\n }) => void;\n /** Handler called when a drop occurs on any collection target. */\n onDrop?: (e: {\n items: DropItem[];\n target: DropTarget;\n dropOperation: DropOperation;\n x: number;\n y: number;\n }) => void;\n /** Handler called when the drop target is activated (held over). */\n onDropActivate?: (e: { target: DropTarget; x: number; y: number }) => void;\n /** Optional keyboard delegate used as fallback when drop-target delegates do not provide keyboard navigation methods. */\n keyboardDelegate?: KeyboardDelegateLike;\n /** Optional keyboard handler composed with internal drop target navigation keys. */\n onKeyDown?: (e: KeyboardEvent) => void;\n /**\n * The collection backing the droppable. Used both to restore focus/selection\n * after a drop mutates items and to drive keyboard drop-target navigation\n * (`navigate()` walks `getKeyAfter`/`getKeyBefore`).\n */\n collection?: Collection;\n /** Current collection selection used to avoid replacing user-updated selection after a drop. */\n selectedKeys?: \"all\" | Iterable<Key>;\n /** Sets collection selection after a drop when new rows were inserted and selection was unchanged. */\n setSelectedKeys?: (keys: Set<Key>) => void;\n /** Sets collection focus after a drop when new rows were inserted. */\n setFocusedKey?: (key: Key | null) => void;\n /** Whether the collection is disabled for dropping. */\n isDisabled?: boolean;\n /** Accepted drag types. 'all' accepts any type. */\n acceptedDragTypes?: \"all\" | Array<string | symbol>;\n}\n\nexport function getDropItemTypes(item: DropItem): Set<string | symbol> {\n if (item.kind === \"file\") {\n return new Set([item.type]);\n }\n if (item.kind === \"text\") {\n return new Set(item.types);\n }\n return new Set([DIRECTORY_DRAG_TYPE]);\n}\n\nexport interface DroppableCollectionAria {\n /** Props to spread on the collection element. */\n collectionProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n/**\n * Creates ARIA support for a droppable collection.\n *\n * @param options - Collection options accessor\n * @param state - Droppable collection state\n * @returns Droppable collection ARIA result\n */\nexport function createDroppableCollection(\n options: Accessor<DroppableCollectionOptions>,\n state: DroppableCollectionState,\n): DroppableCollectionAria {\n const getOptions = createMemo(() => options());\n\n // Layout direction drives keyboard drop-target navigation (Left/Right flip in\n // RTL). Read at the reactive owner so the registration effect re-runs on change.\n const locale = useLocale();\n\n // Track the next target during drag operations\n let nextTarget: DropTarget | null = null;\n let currentDropOperation: DropOperation | null = null;\n\n const isInternalDropOperation = (): boolean => {\n const ref = getOptions().ref();\n const draggingRef = getGlobalDraggingCollectionRef();\n return ref !== null && draggingRef === ref;\n };\n\n const getDropOperationForTarget = (\n target: DropTarget,\n types: DragTypes,\n allowedOperations: DropOperation[],\n ): DropOperation => {\n return state.getDropOperation(\n target,\n types,\n allowedOperations,\n isInternalDropOperation(),\n getGlobalDraggingKeys(),\n );\n };\n\n // Create base drop behavior\n const drop = createDrop(() => ({\n isDisabled: getOptions().isDisabled,\n getDropOperationForPoint: (types, allowedOperations, x, y) => {\n const opts = getOptions();\n const isValidDropTarget = (target: DropTarget) =>\n getDropOperationForTarget(target, types, allowedOperations) !== \"cancel\";\n\n const target = opts.dropTargetDelegate.getDropTargetFromPoint(x, y, isValidDropTarget);\n\n if (!target) {\n currentDropOperation = \"cancel\";\n nextTarget = null;\n return \"cancel\";\n }\n\n currentDropOperation = getDropOperationForTarget(target, types, allowedOperations);\n\n // If target doesn't accept, try root\n if (currentDropOperation === \"cancel\") {\n const rootTarget: DropTarget = { type: \"root\" };\n const rootOp = getDropOperationForTarget(rootTarget, types, allowedOperations);\n if (rootOp !== \"cancel\") {\n nextTarget = rootTarget;\n currentDropOperation = rootOp;\n return currentDropOperation;\n }\n }\n\n // Update drop collection ref\n const ref = opts.ref();\n if (target && currentDropOperation !== \"cancel\" && ref !== globalDropCollectionRef) {\n setGlobalDropCollectionRef(ref);\n }\n\n nextTarget = currentDropOperation === \"cancel\" ? null : target;\n return currentDropOperation;\n },\n onDropEnter: () => {\n if (nextTarget) {\n state.setTarget(nextTarget);\n }\n },\n onDropMove: () => {\n if (nextTarget) {\n state.setTarget(nextTarget);\n }\n },\n onDropExit: () => {\n setGlobalDropCollectionRef(null);\n state.setTarget(null);\n },\n onDropActivate: (e) => {\n const opts = getOptions();\n if (\n state.target?.type === \"item\" &&\n state.target.dropPosition === \"on\" &&\n typeof opts.onDropActivate === \"function\"\n ) {\n opts.onDropActivate({\n target: state.target,\n x: e.x,\n y: e.y,\n });\n }\n },\n onDrop: (e) => {\n setGlobalDropCollectionRef(getOptions().ref());\n if (state.target) {\n runDrop(e, state.target);\n }\n },\n }));\n\n // Shared drop handler for both the native-pointer path (createDrop, above) and\n // the keyboard path (the DragManager-registered drop target, below). Mirrors\n // upstream's `defaultOnDrop`, which `useDrop` and `DragManager` both invoke.\n const runDrop = (\n e: { items: DropItem[]; dropOperation: DropOperation; x: number; y: number },\n target: DropTarget,\n ) => {\n const opts = getOptions();\n const previousCollection = opts.collection;\n const previousSelectedKeys = normalizeSelection(opts.selectedKeys);\n opts.onDrop?.({\n items: e.items,\n target,\n dropOperation: e.dropOperation,\n x: e.x,\n y: e.y,\n });\n void Promise.resolve(handleDrop(e.items, target, e.dropOperation)).then(() => {\n queueMicrotask(() => {\n updateFocusAfterDrop(getOptions(), previousCollection, previousSelectedKeys, target);\n });\n });\n };\n\n const handleDrop = async (\n items: DropItem[],\n target: DropTarget,\n dropOperation: DropOperation,\n ) => {\n const opts = getOptions();\n const isInternal = isInternalDropOperation();\n // Capture the dragging keys ONCE up front, mirroring upstream's\n // `let {draggingKeys} = globalDndState` at the top of `defaultOnDrop`. In\n // Solid the global keys live in a signal whose drag-teardown effect flushes\n // synchronously during this same drop flow (React batches, so upstream never\n // observes the clear mid-handler). Re-reading the global in the onMove/onReorder\n // branches would therefore see an already-emptied set; the snapshot preserves it.\n const draggingKeys = getGlobalDraggingKeys();\n\n // Filter items by accepted types\n let filteredItems = items;\n const acceptedTypes = opts.acceptedDragTypes;\n if (acceptedTypes && acceptedTypes !== \"all\") {\n filteredItems = items.filter((item) => {\n const itemTypes = getDropItemTypes(item);\n return acceptedTypes.some((type) => itemTypes.has(type));\n });\n }\n\n if (filteredItems.length === 0) return;\n\n // Call appropriate handlers based on target type\n if (target.type === \"root\" && opts.onRootDrop) {\n await opts.onRootDrop({ items: filteredItems, dropOperation });\n }\n\n if (target.type === \"item\") {\n if (target.dropPosition === \"on\" && opts.onItemDrop) {\n await opts.onItemDrop({\n items: filteredItems,\n target,\n dropOperation,\n isInternal,\n });\n }\n\n // Handle move for internal operations\n if (opts.onMove && isInternal) {\n await opts.onMove({\n keys: draggingKeys,\n target,\n dropOperation,\n });\n }\n\n if (target.dropPosition !== \"on\") {\n if (!isInternal && opts.onInsert) {\n await opts.onInsert({\n items: filteredItems,\n target,\n dropOperation,\n });\n }\n\n if (isInternal && opts.onReorder) {\n await opts.onReorder({\n keys: draggingKeys,\n target,\n dropOperation,\n });\n }\n }\n }\n };\n\n // Clean up on unmount\n onCleanup(() => {\n const ref = getOptions().ref();\n if (globalDropCollectionRef === ref) {\n setGlobalDropCollectionRef(null);\n }\n });\n\n // Wrap the raw `Set<string>` the DragManager hands keyboard drop targets into\n // the `DragTypes` delegate the port state expects. Mirrors upstream, which\n // passes the raw Set to `state.getDropOperation` (no wildcard expansion — that\n // lives in the DataTransfer-backed DragTypes used by the native-pointer path).\n const wrapTypes = (types: Set<string>): DragTypes => ({\n has: (type: DragType | DragType[]) => {\n if (typeof type === \"string\") return types.has(type);\n if (Array.isArray(type)) return type.some((t) => typeof t === \"string\" && types.has(t));\n return false;\n },\n });\n\n const targetsEqual = (\n a: DropTarget | null | undefined,\n b: DropTarget | null | undefined,\n ): boolean => {\n if (!a || !b) return false;\n if (a.type !== b.type) return false;\n if (a.type === \"root\") return true;\n if (a.type !== \"item\" || b.type !== \"item\") return false;\n return a.key === b.key && a.dropPosition === b.dropPosition;\n };\n\n // Port substitute for upstream's `state.isDropTarget(target)` (the port state\n // exposes `isDropTarget` only as a \"drag is over this collection\" boolean, not\n // a per-target predicate): whether `target` equals the current drop target.\n const isCurrentTarget = (target: DropTarget | null | undefined): boolean =>\n targetsEqual(state.target, target);\n\n // Register the collection element as a keyboard/virtual drop target on the\n // DragManager singleton. This is the faithful port of upstream\n // `useDroppableCollection`'s `useEffect` (react-aria 3.50) that installs the\n // DragManager DropTarget — replacing the port's former self-contained\n // `collectionProps.onKeyDown` engine. Re-runs when the element or locale\n // direction changes (upstream keys the effect on `[localState, ref, onDrop, direction]`).\n createEffect(() => {\n const refEl = getOptions().ref();\n if (!refEl) return;\n const rtl = locale().direction === \"rtl\";\n\n const getNextTarget = (\n target: DropTarget | null | undefined,\n wrap = true,\n key: \"left\" | \"right\" | \"up\" | \"down\" = \"down\",\n ): DropTarget | null => {\n const opts = getOptions();\n const collection = opts.collection;\n const keyboardDelegate = opts.keyboardDelegate;\n if (!collection || !keyboardDelegate) return null;\n return navigate(\n keyboardDelegate as DropNavigationKeyboardDelegate,\n collection,\n target,\n key,\n rtl,\n wrap,\n );\n };\n\n const getPreviousTarget = (target: DropTarget | null | undefined, wrap = true) =>\n getNextTarget(target, wrap, \"up\");\n\n const nextValidTarget = (\n target: DropTarget | null | undefined,\n types: Set<string>,\n allowedDropOperations: DropOperation[],\n getNext: (target: DropTarget | null | undefined, wrap: boolean) => DropTarget | null,\n wrap = true,\n ): DropTarget | null => {\n let seenRoot = 0;\n let operation: DropOperation;\n do {\n const next = getNext(target, wrap);\n if (!next) return null;\n target = next;\n operation = getDropOperationForTarget(next, wrapTypes(types), allowedDropOperations);\n if (target.type === \"root\") {\n seenRoot++;\n }\n } while (operation === \"cancel\" && !isCurrentTarget(target) && seenRoot < 2);\n\n if (operation === \"cancel\") {\n return null;\n }\n\n return target;\n };\n\n const unregister = registerDropTarget({\n element: refEl,\n preventFocusOnDrop: true,\n getDropOperation(types, allowedOperations) {\n if (state.target) {\n return getDropOperationForTarget(state.target, wrapTypes(types), allowedOperations);\n }\n\n // Check if any of the targets accept the drop.\n const target = nextValidTarget(null, types, allowedOperations, (t, wrap) =>\n getNextTarget(t, wrap),\n );\n return target ? \"move\" : \"cancel\";\n },\n onDropEnter(_e, drag) {\n const types = getTypes(drag.items);\n // Update the drop collection ref tracker for createDroppableItem's isInternal check.\n setGlobalDropCollectionRef(getOptions().ref());\n\n // When entering the droppable collection for the first time, upstream's\n // default drop target is AFTER the focused key\n // (useDroppableCollection.ts:505-559). The port's DroppableCollectionState\n // carries no selectionManager, but at keyboard pickup the dragged item IS\n // the collection's focused item, so we recover the focused key from the\n // drag target element's `data-key` (createSelectableItem stamps it).\n const opts = getOptions();\n let key = keyFromDragElement(drag.element, opts.collection);\n let dropPosition: \"before\" | \"on\" | \"after\" = \"after\";\n\n // Mirror upstream's reorder heuristic: if the focused item is also\n // selected, drop after the last selected item; but if it is the first of\n // a multi-selection, drop before the first (select-down → move down,\n // select-up → move up). Single-key keyboard drags never hit this branch.\n const selected = normalizeSelection(opts.selectedKeys);\n if (key != null && opts.collection && selectionHas(selected, key)) {\n const ordered = orderedSelectedKeys(selected, opts.collection);\n if (ordered.length > 1 && ordered[0] === key) {\n dropPosition = \"before\";\n } else if (ordered.length > 0) {\n key = ordered[ordered.length - 1];\n }\n }\n\n let target: DropTarget | null = null;\n if (key != null) {\n target = { type: \"item\", key, dropPosition };\n // If the default target is not valid, find the next one that is, then\n // fall back to the previous. Mirrors useDroppableCollection.ts:538-551.\n if (\n getDropOperationForTarget(target, wrapTypes(types), drag.allowedDropOperations) ===\n \"cancel\"\n ) {\n target =\n nextValidTarget(\n target,\n types,\n drag.allowedDropOperations,\n (t, wrap) => getNextTarget(t, wrap),\n false,\n ) ??\n nextValidTarget(target, types, drag.allowedDropOperations, getPreviousTarget, false);\n }\n }\n\n // If no focused key, start from the root (upstream's fallback).\n if (!target) {\n target = nextValidTarget(null, types, drag.allowedDropOperations, (t, wrap) =>\n getNextTarget(t, wrap),\n );\n }\n\n state.setTarget(target);\n },\n onDropExit() {\n setGlobalDropCollectionRef(null);\n state.setTarget(null);\n },\n onDropTargetEnter(target) {\n state.setTarget(target);\n },\n onDropActivate(e, target) {\n const opts = getOptions();\n if (\n target?.type === \"item\" &&\n target?.dropPosition === \"on\" &&\n typeof opts.onDropActivate === \"function\"\n ) {\n opts.onDropActivate({ target, x: e.x, y: e.y });\n }\n },\n onDrop(e, target) {\n setGlobalDropCollectionRef(getOptions().ref());\n if (state.target) {\n runDrop(e, target || state.target);\n }\n },\n onKeyDown(e, drag) {\n const opts = getOptions();\n const keyboardDelegate = opts.keyboardDelegate;\n if (!keyboardDelegate) {\n opts.onKeyDown?.(e);\n return;\n }\n const types = getTypes(drag.items);\n switch (e.key) {\n case \"ArrowDown\": {\n if (keyboardDelegate.getKeyBelow) {\n const target = nextValidTarget(\n state.target,\n types,\n drag.allowedDropOperations,\n (t, wrap) => getNextTarget(t, wrap, \"down\"),\n );\n state.setTarget(target);\n }\n break;\n }\n case \"ArrowUp\": {\n if (keyboardDelegate.getKeyAbove) {\n const target = nextValidTarget(\n state.target,\n types,\n drag.allowedDropOperations,\n (t, wrap) => getNextTarget(t, wrap, \"up\"),\n );\n state.setTarget(target);\n }\n break;\n }\n case \"ArrowLeft\": {\n if (keyboardDelegate.getKeyLeftOf) {\n const target = nextValidTarget(\n state.target,\n types,\n drag.allowedDropOperations,\n (t, wrap) => getNextTarget(t, wrap, \"left\"),\n );\n state.setTarget(target);\n }\n break;\n }\n case \"ArrowRight\": {\n if (keyboardDelegate.getKeyRightOf) {\n const target = nextValidTarget(\n state.target,\n types,\n drag.allowedDropOperations,\n (t, wrap) => getNextTarget(t, wrap, \"right\"),\n );\n state.setTarget(target);\n }\n break;\n }\n case \"Home\": {\n if (keyboardDelegate.getFirstKey) {\n const target = nextValidTarget(null, types, drag.allowedDropOperations, (t, wrap) =>\n getNextTarget(t, wrap),\n );\n state.setTarget(target);\n }\n break;\n }\n case \"End\": {\n if (keyboardDelegate.getLastKey) {\n const target = nextValidTarget(\n null,\n types,\n drag.allowedDropOperations,\n getPreviousTarget,\n );\n state.setTarget(target);\n }\n break;\n }\n case \"PageDown\": {\n if (keyboardDelegate.getKeyPageBelow) {\n let target = state.target;\n if (!target) {\n target = nextValidTarget(null, types, drag.allowedDropOperations, (t, wrap) =>\n getNextTarget(t, wrap),\n );\n } else {\n // If on the root, go to the item a page below the top. Otherwise a page below the current item.\n let targetKey = keyboardDelegate.getFirstKey?.();\n if (target.type === \"item\") {\n targetKey = target.key;\n }\n let nextKey: Key | null = null;\n if (targetKey != null) {\n nextKey = keyboardDelegate.getKeyPageBelow(targetKey);\n }\n let dropPosition: \"before\" | \"on\" | \"after\" =\n target.type === \"item\" ? target.dropPosition : \"after\";\n\n // If there is no next key, or we are starting on the last key, jump to the last possible position.\n if (\n nextKey == null ||\n (target.type === \"item\" && target.key === keyboardDelegate.getLastKey?.())\n ) {\n nextKey = keyboardDelegate.getLastKey?.() ?? null;\n dropPosition = \"after\";\n }\n\n if (nextKey == null) {\n break;\n }\n target = {\n type: \"item\",\n key: nextKey,\n dropPosition,\n };\n\n // If the target does not accept the drop, find the next valid target.\n // If no next valid target, find the previous valid target.\n const operation = getDropOperationForTarget(\n target,\n wrapTypes(types),\n drag.allowedDropOperations,\n );\n if (operation === \"cancel\") {\n target =\n nextValidTarget(\n target,\n types,\n drag.allowedDropOperations,\n (t, wrap) => getNextTarget(t, wrap),\n false,\n ) ??\n nextValidTarget(\n target,\n types,\n drag.allowedDropOperations,\n getPreviousTarget,\n false,\n );\n }\n }\n\n state.setTarget(target ?? state.target);\n }\n break;\n }\n case \"PageUp\": {\n if (!keyboardDelegate.getKeyPageAbove) {\n break;\n }\n\n let target = state.target;\n if (!target) {\n target = nextValidTarget(\n null,\n types,\n drag.allowedDropOperations,\n getPreviousTarget,\n );\n } else if (target.type === \"item\") {\n // If at the top already, switch to the root. Otherwise navigate a page up.\n if (target.key === keyboardDelegate.getFirstKey?.()) {\n target = {\n type: \"root\",\n };\n } else {\n let nextKey: Key | null | undefined = keyboardDelegate.getKeyPageAbove(target.key);\n let dropPosition: \"before\" | \"on\" | \"after\" = target.dropPosition;\n if (nextKey == null) {\n nextKey = keyboardDelegate.getFirstKey?.();\n dropPosition = \"before\";\n }\n\n if (nextKey == null) {\n break;\n }\n target = {\n type: \"item\",\n key: nextKey,\n dropPosition,\n };\n }\n\n // If the target does not accept the drop, find the previous valid target.\n // If no next valid target, find the next valid target.\n const operation = getDropOperationForTarget(\n target,\n wrapTypes(types),\n drag.allowedDropOperations,\n );\n if (operation === \"cancel\") {\n target =\n nextValidTarget(\n target,\n types,\n drag.allowedDropOperations,\n getPreviousTarget,\n false,\n ) ??\n nextValidTarget(\n target,\n types,\n drag.allowedDropOperations,\n (t, wrap) => getNextTarget(t, wrap),\n false,\n );\n }\n }\n\n state.setTarget(target ?? state.target);\n break;\n }\n }\n opts.onKeyDown?.(e);\n },\n });\n\n onCleanup(unregister);\n });\n\n const collectionProps = createMemo<Record<string, unknown>>(() => ({\n ...drop.dropProps,\n // Remove description from the collection element. If dropping on the entire\n // collection, there should be a drop indicator that carries this\n // description, so no need to double-announce.\n \"aria-describedby\": null,\n }));\n\n return {\n get collectionProps() {\n return collectionProps() as DroppableCollectionAria[\"collectionProps\"];\n },\n };\n}\n\nfunction normalizeSelection(selection: \"all\" | Iterable<Key> | undefined): \"all\" | Set<Key> | null {\n if (selection == null) return null;\n if (selection === \"all\") return \"all\";\n return new Set(selection);\n}\n\n// Recover the collection key of a dragged/dropped DOM element. createSelectableItem\n// stamps `data-key={String(key)}`, so the attribute is the stringified key; map it\n// back to the real (possibly numeric) collection key by matching against the\n// collection's nodes.\nfunction keyFromDragElement(element: HTMLElement | null, collection: Collection | undefined): Key | null {\n if (!element) return null;\n const raw = element.getAttribute(\"data-key\") ?? element.closest(\"[data-key]\")?.getAttribute(\"data-key\");\n if (raw == null) return null;\n if (!collection) return raw;\n // Fast path: the raw string is already a valid key.\n if ((collection as unknown as CollectionLike).getItem(raw) != null) return raw;\n for (const node of collection as unknown as CollectionLike) {\n if (String(node.key) === raw) return node.key;\n }\n return raw;\n}\n\nfunction selectionHas(selection: \"all\" | Set<Key> | null, key: Key): boolean {\n if (selection === \"all\") return true;\n return selection != null && selection.has(key);\n}\n\n// The selected keys in collection (DOM) order, so [0] is the first selected item\n// and [length-1] the last — mirroring upstream's firstSelectedKey/lastSelectedKey.\nfunction orderedSelectedKeys(selection: \"all\" | Set<Key> | null, collection: Collection): Key[] {\n const out: Key[] = [];\n for (const node of collection as unknown as CollectionLike) {\n if (node.type === \"item\" && selectionHas(selection, node.key)) {\n out.push(node.key);\n }\n }\n return out;\n}\n\nfunction selectionEquals(a: \"all\" | Set<Key> | null, b: \"all\" | Set<Key> | null): boolean {\n if (a === b) return true;\n if (!a || !b || a === \"all\" || b === \"all\") return false;\n if (a.size !== b.size) return false;\n for (const key of a) {\n if (!b.has(key)) return false;\n }\n return true;\n}\n\nfunction getNewItemKeys(collection: CollectionLike, previousCollection: CollectionLike): Set<Key> {\n const keys = new Set<Key>();\n const visit = (node: CollectionNodeLike) => {\n if (node.type === \"item\" && !previousCollection.getItem(node.key)) {\n keys.add(node.key);\n }\n for (const child of node.childNodes ?? []) {\n visit(child);\n }\n };\n\n for (const node of collection) {\n visit(node);\n }\n return keys;\n}\n\nfunction updateFocusAfterDrop(\n opts: DroppableCollectionOptions,\n previousCollectionRaw: Collection | undefined,\n previousSelectedKeys: \"all\" | Set<Key> | null,\n target: DropTarget,\n): void {\n // Read the (real) collection through the structural `CollectionLike` view: it\n // exposes the optional cell/rowheader/isExpanded fields upstream inspects, which\n // are simply absent (undefined) for flat collections like ListBox.\n const collection = opts.collection as CollectionLike | undefined;\n const previousCollection = previousCollectionRaw as unknown as CollectionLike | undefined;\n if (!collection || !previousCollection) return;\n\n const newKeys = getNewItemKeys(collection, previousCollection);\n if (newKeys.size === 0) return;\n\n const currentSelectedKeys = normalizeSelection(opts.selectedKeys);\n if (\n opts.setSelectedKeys &&\n previousSelectedKeys &&\n selectionEquals(previousSelectedKeys, currentSelectedKeys)\n ) {\n opts.setSelectedKeys(newKeys);\n }\n\n const first = newKeys.values().next().value;\n if (first == null) return;\n\n let focusKey: Key | null = first;\n const item = collection.getItem(first);\n const parent = item?.parentKey != null ? collection.getItem(item.parentKey) : null;\n const isDroppedOnCollapsedParent =\n target.type === \"item\" &&\n target.dropPosition === \"on\" &&\n item?.parentKey != null &&\n parent?.isExpanded !== true;\n\n if (item && (item.type === \"cell\" || item.type === \"rowheader\" || isDroppedOnCollapsedParent)) {\n focusKey = item.parentKey ?? first;\n }\n\n opts.setFocusedKey?.(focusKey);\n\n queueMicrotask(() => {\n const row = opts.ref()?.querySelector<HTMLElement>('[role=\"row\"][tabindex=\"0\"]');\n row?.focus();\n });\n}\n","/**\n * createDraggableItem - ARIA hook for draggable items within a collection.\n *\n * Provides accessibility props for items that can be dragged from a collection.\n */\n\nimport { createMemo, type Accessor } from \"solid-js\";\nimport type { JSX } from \"solid-js\";\nimport type {\n DraggableCollectionState,\n DragPreviewRenderer,\n DropOperation,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n getTypes,\n writeToDataTransfer,\n getDragModality,\n DROP_OPERATION,\n EFFECT_ALLOWED,\n DROP_EFFECT_TO_DROP_OPERATION,\n setGlobalAllowedDropOperations,\n setGlobalDropEffect,\n getGlobalDropEffect,\n} from \"./utils\";\nimport { createInteractionModality } from \"../interactions\";\nimport { setGlobalDraggingTypes } from \"./createDraggableCollection\";\nimport { beginDragging } from \"./DragManager\";\nimport { createStringFormatter } from \"../i18n/createStringFormatter\";\nimport { dndIntlStrings } from \"./intl\";\nimport { createDescription } from \"../utils/createDescription\";\n\nexport interface DraggableItemOptions {\n /** The unique key of the item. */\n key: string | number;\n /** Whether the item has a separate drag button affordance. */\n hasDragButton?: boolean;\n /**\n * Whether the host item has a primary action (e.g. Enter on a GridList/Table\n * row) that conflicts with the Enter keyboard drag pickup. When true the drag\n * description switches to the Alt variant (mirrors upstream `hasAction`).\n */\n hasAction?: boolean;\n /**\n * The host collection's selection mode. Upstream only surfaces the drag\n * affordance description (aria-describedby → \"Press Enter to start dragging.\")\n * when the mode is not `'none'`.\n */\n selectionMode?: \"none\" | \"single\" | \"multiple\";\n /** Whether this item is disabled for dragging. */\n isDisabled?: boolean;\n /** Preview renderer function ref. */\n preview?: { current: DragPreviewRenderer | null };\n}\n\nexport interface DraggableItemAria {\n /** Props for the draggable item element. */\n dragProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the explicit drag button affordance, if any. */\n dragButtonProps: JSX.ButtonHTMLAttributes<HTMLButtonElement>;\n /** Whether the item is currently being dragged. */\n isDragging: boolean;\n}\n\n/**\n * Creates ARIA props for a draggable item within a collection.\n *\n * @param options - Accessor returning item options\n * @param state - Draggable collection state\n * @returns Draggable item ARIA props\n */\n// Drag description keys per interaction modality, mirroring upstream\n// useDraggableItem's MESSAGES table. The port always drags the single focused\n// key, so isSelected is always false → the `notSelected` row is used.\nconst DRAG_DESCRIPTION_MESSAGES: Record<string, string> = {\n keyboard: \"dragDescriptionKeyboard\",\n touch: \"dragDescriptionLongPress\",\n virtual: \"dragDescriptionVirtual\",\n};\n\nexport function createDraggableItem(\n options: Accessor<DraggableItemOptions>,\n state: DraggableCollectionState,\n): DraggableItemAria {\n const getOptions = createMemo(() => options());\n\n const stringFormatter = createStringFormatter(dndIntlStrings);\n const { modality } = createInteractionModality();\n\n // Track position for drag move\n let lastX = 0;\n let lastY = 0;\n\n const isDragging = createMemo(() => {\n const key = getOptions().key;\n return state.draggingKeys.has(key);\n });\n\n // Drag affordance description (aria-describedby → \"Press Enter to start\n // dragging.\"). Mirrors upstream useDraggableItem: surfaced only when the item\n // has no explicit drag button and the host selection mode is not 'none'. The\n // port only ever drags the single focused key (getKeysForDrag), so\n // numKeysForDrag === 1 → isSelected is always false → the base (notSelected)\n // keyboard message; a host primary action swaps in the Alt variant.\n const dragDescription = createMemo(() => {\n const opts = getOptions();\n if (opts.hasDragButton) return undefined;\n if (opts.selectionMode == null || opts.selectionMode === \"none\") return undefined;\n // Subscribe to modality changes, then resolve the drag modality the same way\n // upstream does (pointer → virtual, coarse-pointer virtual → touch). At rest\n // with no keyboard interaction this is 'virtual' → \"Click to start dragging.\".\n modality();\n const dragModality = getDragModality();\n let msg = DRAG_DESCRIPTION_MESSAGES[dragModality] ?? \"dragDescriptionVirtual\";\n if (opts.hasAction && dragModality === \"keyboard\") {\n msg += \"Alt\";\n }\n return stringFormatter().format(msg as Parameters<ReturnType<typeof stringFormatter>[\"format\"]>[0]);\n });\n const descriptionProps = createDescription(dragDescription);\n\n const getKeysForDrag = (): Set<string | number> => {\n const { key } = getOptions();\n // If the key is not selected, only drag that item\n // If it is selected, drag all selected items\n // For now, just return the single key\n return new Set([key]);\n };\n\n const onDragStart = (e: DragEvent) => {\n if (e.defaultPrevented) return;\n e.stopPropagation();\n\n const opts = getOptions();\n if (opts.isDisabled || state.isDisabled) return;\n\n const keys = getKeysForDrag();\n\n // Start drag state\n state.startDrag(keys, e.clientX, e.clientY);\n\n // Get items and write to data transfer\n const items = state.getItems(keys);\n setGlobalDraggingTypes(getTypes(items));\n e.dataTransfer?.clearData?.();\n if (e.dataTransfer) {\n writeToDataTransfer(e.dataTransfer, items);\n }\n\n // Set allowed drop operations\n let allowed = DROP_OPERATION.all;\n const allowedOps = state.getAllowedDropOperations();\n if (allowedOps.length > 0) {\n allowed = DROP_OPERATION.none;\n for (const op of allowedOps) {\n allowed |= DROP_OPERATION[op] || DROP_OPERATION.none;\n }\n }\n\n setGlobalAllowedDropOperations(allowed);\n const effectAllowed = EFFECT_ALLOWED[allowed] || \"none\";\n if (e.dataTransfer) {\n e.dataTransfer.effectAllowed = (\n effectAllowed === \"cancel\" ? \"none\" : effectAllowed\n ) as DataTransfer[\"effectAllowed\"];\n }\n\n // Handle custom preview from item options or collection state.\n const preview = opts.preview ?? state.preview;\n if (typeof preview?.current === \"function\" && e.dataTransfer) {\n preview.current(items, (node, userX, userY) => {\n if (!node || !e.dataTransfer) return;\n\n const size = node.getBoundingClientRect();\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\n let defaultX = e.clientX - rect.x;\n let defaultY = e.clientY - rect.y;\n\n if (defaultX > size.width || defaultY > size.height) {\n defaultX = size.width / 2;\n defaultY = size.height / 2;\n }\n\n let offsetX = typeof userX === \"number\" ? userX : defaultX;\n let offsetY = typeof userY === \"number\" ? userY : defaultY;\n\n offsetX = Math.max(0, Math.min(offsetX, size.width));\n offsetY = Math.max(0, Math.min(offsetY, size.height));\n\n e.dataTransfer.setDragImage(node, offsetX, offsetY);\n });\n }\n\n lastX = e.clientX;\n lastY = e.clientY;\n };\n\n const onDrag = (e: DragEvent) => {\n e.stopPropagation();\n\n if (e.clientX === lastX && e.clientY === lastY) {\n return;\n }\n\n state.moveDrag(e.clientX, e.clientY);\n\n lastX = e.clientX;\n lastY = e.clientY;\n };\n\n const onDragEnd = (e: DragEvent) => {\n e.stopPropagation();\n\n let dropEffect: string = e.dataTransfer?.dropEffect ?? \"none\";\n // Chrome Android fix - use global drop effect\n if (getGlobalDropEffect()) {\n dropEffect = getGlobalDropEffect()!;\n }\n\n const dropOperation = DROP_EFFECT_TO_DROP_OPERATION[dropEffect];\n const isInternal = false; // Would check global state\n state.endDrag(e.clientX, e.clientY, dropOperation, isInternal);\n\n setGlobalAllowedDropOperations(DROP_OPERATION.none);\n setGlobalDraggingTypes(new Set());\n setGlobalDropEffect(undefined);\n };\n\n // Keyboard/screen reader drag initiation\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"Enter\" && e.target === e.currentTarget) {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n\n const onKeyUp = (e: KeyboardEvent) => {\n if (e.key === \"Enter\" && e.target === e.currentTarget) {\n e.preventDefault();\n e.stopPropagation();\n\n const opts = getOptions();\n if (opts.isDisabled || state.isDisabled) return;\n\n const el = e.currentTarget as HTMLElement;\n const keys = getKeysForDrag();\n const rect = el.getBoundingClientRect();\n state.startDrag(keys, rect.x + rect.width / 2, rect.y + rect.height / 2);\n\n const items = state.getItems(keys);\n setGlobalDraggingTypes(getTypes(items));\n\n const allowedOps = state.getAllowedDropOperations();\n let allowed = DROP_OPERATION.all;\n if (allowedOps.length > 0) {\n allowed = DROP_OPERATION.none;\n for (const op of allowedOps) {\n allowed |= DROP_OPERATION[op] || DROP_OPERATION.none;\n }\n }\n setGlobalAllowedDropOperations(allowed);\n\n // Hand control to the keyboard DragManager session, which drives\n // Tab-cycling across drop targets and Enter/Escape drop/cancel.\n beginDragging(\n {\n element: el,\n items,\n allowedDropOperations:\n allowedOps.length > 0 ? allowedOps : ([\"move\", \"copy\", \"link\"] as DropOperation[]),\n onDragEnd: (ev) => {\n state.endDrag(ev.x, ev.y, ev.dropOperation, false);\n setGlobalAllowedDropOperations(DROP_OPERATION.none);\n setGlobalDraggingTypes(new Set());\n setGlobalDropEffect(undefined);\n },\n },\n stringFormatter(),\n );\n }\n };\n\n const dragProps = createMemo(() => {\n const opts = getOptions();\n\n if (opts.isDisabled || state.isDisabled) {\n return {\n draggable: false as const,\n };\n }\n\n const baseProps: Record<string, unknown> = {\n draggable: true as const,\n onDragStart,\n onDrag,\n onDragEnd,\n };\n\n // Add keyboard handlers if no separate drag button. Mirrors upstream\n // useDrag: the Enter pickup is wired in the CAPTURE phase so it runs before\n // the collection item's own press/selection handlers (which also claim\n // Enter) and can stopPropagation to suppress them — a bubble-phase handler\n // would never see the Enter keyup, since press consumes it first. In Solid,\n // capture-phase spread props use the `oncapture:` prefix.\n if (!opts.hasDragButton) {\n baseProps[\"oncapture:keydown\"] = onKeyDown;\n baseProps[\"oncapture:keyup\"] = onKeyUp;\n }\n\n // Reading the reactive getter here keeps this memo subscribed, so the id\n // appears once createDescription's effect has mounted the hidden element.\n const describedBy = descriptionProps[\"aria-describedby\"];\n if (describedBy) {\n baseProps[\"aria-describedby\"] = describedBy;\n }\n\n return baseProps;\n });\n\n const dragButtonProps = createMemo(() => {\n const opts = getOptions();\n\n if (opts.isDisabled || state.isDisabled) {\n return {\n disabled: true,\n };\n }\n\n return {\n type: \"button\" as const,\n \"aria-label\": \"Drag\",\n onKeyDown,\n onKeyUp,\n };\n });\n\n return {\n get dragProps() {\n return dragProps() as DraggableItemAria[\"dragProps\"];\n },\n get dragButtonProps() {\n return dragButtonProps() as DraggableItemAria[\"dragButtonProps\"];\n },\n get isDragging() {\n return isDragging();\n },\n };\n}\n","/**\n * createDroppableItem - ARIA hook for droppable items within a collection.\n *\n * Provides accessibility props for items that can receive drops.\n */\n\nimport { createMemo, type Accessor } from \"solid-js\";\nimport type { JSX } from \"solid-js\";\nimport type {\n DroppableCollectionState,\n DropTarget,\n DropOperation,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n DragTypesImpl,\n DROP_OPERATION,\n DROP_OPERATION_ALLOWED,\n DROP_OPERATION_TO_DROP_EFFECT,\n getGlobalAllowedDropOperations,\n} from \"./utils\";\n\nexport interface DroppableItemOptions {\n /** The unique key of the item. */\n key: string | number;\n /** Reference to the item element. */\n ref: Accessor<HTMLElement | null>;\n /** Whether this item is disabled for dropping. */\n isDisabled?: boolean;\n}\n\nexport interface DroppableItemAria {\n /** Props for the droppable item element. */\n dropProps: JSX.HTMLAttributes<HTMLElement>;\n /** Whether the item is currently a drop target. */\n isDropTarget: boolean;\n}\n\n/**\n * Creates ARIA props for a droppable item within a collection.\n *\n * @param options - Accessor returning item options\n * @param state - Droppable collection state\n * @returns Droppable item ARIA props\n */\nexport function createDroppableItem(\n options: Accessor<DroppableItemOptions>,\n state: DroppableCollectionState,\n): DroppableItemAria {\n const getOptions = createMemo(() => options());\n\n const isDropTarget = createMemo(() => {\n const { key } = getOptions();\n const target = state.target;\n return target?.type === \"item\" && target.key === key;\n });\n\n const getTarget = (dropPosition: \"before\" | \"on\" | \"after\"): DropTarget => {\n const { key } = getOptions();\n return {\n type: \"item\",\n key,\n dropPosition,\n };\n };\n\n const getDropOperation = (e: DragEvent, target: DropTarget): DropOperation => {\n if (!e.dataTransfer) return \"cancel\";\n\n const types = new DragTypesImpl(e.dataTransfer);\n let allowedBits = DROP_OPERATION_ALLOWED[e.dataTransfer.effectAllowed] || DROP_OPERATION.all;\n\n // Use global allowed operations for internal drags\n const globalAllowed = getGlobalAllowedDropOperations();\n if (globalAllowed) {\n allowedBits &= globalAllowed;\n }\n\n const allowedOperations: DropOperation[] = [];\n if (allowedBits & DROP_OPERATION.move) allowedOperations.push(\"move\");\n if (allowedBits & DROP_OPERATION.copy) allowedOperations.push(\"copy\");\n if (allowedBits & DROP_OPERATION.link) allowedOperations.push(\"link\");\n\n return state.getDropOperation(target, types, allowedOperations);\n };\n\n let dropActivateTimer: ReturnType<typeof setTimeout> | undefined;\n const DROP_ACTIVATE_TIMEOUT = 800;\n\n const onDragEnter = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n\n const opts = getOptions();\n if (opts.isDisabled) return;\n\n // Determine drop position based on cursor position\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\n const x = e.clientX - rect.x;\n const y = e.clientY - rect.y;\n const height = rect.height;\n\n let dropPosition: \"before\" | \"on\" | \"after\";\n if (y < height * 0.25) {\n dropPosition = \"before\";\n } else if (y > height * 0.75) {\n dropPosition = \"after\";\n } else {\n dropPosition = \"on\";\n }\n\n const target = getTarget(dropPosition);\n const operation = getDropOperation(e, target);\n\n if (operation !== \"cancel\") {\n state.setTarget(target);\n e.dataTransfer!.dropEffect = DROP_OPERATION_TO_DROP_EFFECT[\n operation\n ] as DataTransfer[\"dropEffect\"];\n }\n };\n\n const onDragOver = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n\n const opts = getOptions();\n if (opts.isDisabled) return;\n\n // Update drop position based on cursor\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\n const x = e.clientX - rect.x;\n const y = e.clientY - rect.y;\n const height = rect.height;\n\n let dropPosition: \"before\" | \"on\" | \"after\";\n if (y < height * 0.25) {\n dropPosition = \"before\";\n } else if (y > height * 0.75) {\n dropPosition = \"after\";\n } else {\n dropPosition = \"on\";\n }\n\n const target = getTarget(dropPosition);\n const operation = getDropOperation(e, target);\n\n if (operation !== \"cancel\") {\n state.setTarget(target);\n e.dataTransfer!.dropEffect = DROP_OPERATION_TO_DROP_EFFECT[\n operation\n ] as DataTransfer[\"dropEffect\"];\n\n // Handle drop activate for 'on' position\n clearTimeout(dropActivateTimer);\n if (dropPosition === \"on\") {\n dropActivateTimer = setTimeout(() => {\n state.activateTarget(x, y);\n }, DROP_ACTIVATE_TIMEOUT);\n }\n } else {\n e.dataTransfer!.dropEffect = \"none\";\n }\n };\n\n const onDragLeave = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n\n clearTimeout(dropActivateTimer);\n\n // Only clear target if leaving this item\n const relatedTarget = e.relatedTarget as HTMLElement | null;\n const currentTarget = e.currentTarget as HTMLElement;\n if (!relatedTarget || !currentTarget.contains(relatedTarget)) {\n // Clear if no longer over this item\n const { key } = getOptions();\n if (state.target?.type === \"item\" && state.target.key === key) {\n // State clearing handled by parent collection\n }\n }\n };\n\n const onDrop = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n\n clearTimeout(dropActivateTimer);\n\n // Drop handling is done by the parent collection\n };\n\n const dropProps = createMemo(() => {\n const opts = getOptions();\n\n if (opts.isDisabled) {\n return {};\n }\n\n return {\n onDragEnter,\n onDragOver,\n onDragLeave,\n onDrop,\n };\n });\n\n return {\n get dropProps() {\n return dropProps() as DroppableItemAria[\"dropProps\"];\n },\n get isDropTarget() {\n return isDropTarget();\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;AAwBA,MAAM,C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B,CAAC,cAAc,SAAS,aAAa,GAAG;GAE5D,MAAM,EAAE,QAAQ,WAAW;GAC3B,IAAI,MAAM,QAAQ,SAAS,UAAU,MAAM,OAAO,QAAQ,KAAK,CAE/D;EACF;CACF;CAEA,MAAM,UAAU,MAAiB;EAC/B,EAAE,eAAe;EACjB,EAAE,gBAAgB;EAElB,aAAa,iBAAiB;CAGhC;CAEA,MAAM,YAAY,iBAAiB;EAGjC,IAFa,WAEN,CAAC,CAAC,YACP,OAAO,CAAC;EAGV,OAAO;GACL;GACA;GACA;GACA;EACF;CACF,CAAC;CAED,OAAO;EACL,IAAI,YAAY;GACd,OAAO,UAAU;EACnB;EACA,IAAI,eAAe;GACjB,OAAO,aAAa;EACtB;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"dnd.js","names":["arAE","bgBG","csCZ","daDK","deDE","elGR","enUS","esES","etEE","fiFI","frFR","heIL","hrHR","huHU","itIT","jaJP","koKR","ltLT","lvLV","nbNO","nlNL","plPL","ptBR","ptPT","roRO","ruRU","skSK","slSI","srSP","svSE","trTR","ukUA","zhCN","zhTW"],"sources":["../../src/dnd/createDraggableCollection.ts","../../src/dnd/intl/ar-AE.json","../../src/dnd/intl/bg-BG.json","../../src/dnd/intl/cs-CZ.json","../../src/dnd/intl/da-DK.json","../../src/dnd/intl/de-DE.json","../../src/dnd/intl/el-GR.json","../../src/dnd/intl/en-US.json","../../src/dnd/intl/es-ES.json","../../src/dnd/intl/et-EE.json","../../src/dnd/intl/fi-FI.json","../../src/dnd/intl/fr-FR.json","../../src/dnd/intl/he-IL.json","../../src/dnd/intl/hr-HR.json","../../src/dnd/intl/hu-HU.json","../../src/dnd/intl/it-IT.json","../../src/dnd/intl/ja-JP.json","../../src/dnd/intl/ko-KR.json","../../src/dnd/intl/lt-LT.json","../../src/dnd/intl/lv-LV.json","../../src/dnd/intl/nb-NO.json","../../src/dnd/intl/nl-NL.json","../../src/dnd/intl/pl-PL.json","../../src/dnd/intl/pt-BR.json","../../src/dnd/intl/pt-PT.json","../../src/dnd/intl/ro-RO.json","../../src/dnd/intl/ru-RU.json","../../src/dnd/intl/sk-SK.json","../../src/dnd/intl/sl-SI.json","../../src/dnd/intl/sr-SP.json","../../src/dnd/intl/sv-SE.json","../../src/dnd/intl/tr-TR.json","../../src/dnd/intl/uk-UA.json","../../src/dnd/intl/zh-CN.json","../../src/dnd/intl/zh-TW.json","../../src/dnd/intl/index.ts","../../src/dnd/createDrag.ts","../../src/dnd/createDrop.ts","../../src/dnd/DropTargetKeyboardNavigation.ts","../../src/dnd/createDroppableCollection.ts","../../src/dnd/createDraggableItem.ts","../../src/dnd/createDroppableItem.ts"],"sourcesContent":["/**\n * createDraggableCollection - ARIA hook for draggable collection items.\n *\n * Provides accessibility support for dragging items from a collection\n * component like ListBox, GridList, or Table.\n */\n\nimport {\n createMemo,\n createEffect,\n createSignal,\n onCleanup,\n untrack,\n type Accessor,\n} from \"solid-js\";\nimport type { DraggableCollectionState } from \"@proyecto-viviana/solid-stately\";\nimport { getTypes } from \"./utils\";\n\n// Global state for tracking the dragging collection. These back the reactive\n// `isVirtualDragging` gate that decides whether drop indicators render across\n// every mounted collection, so they must be Solid signals — React re-renders the\n// whole collection tree on a drag-state change, but Solid's fine-grained\n// reactivity only re-runs the indicator JSX if it subscribed to a signal. Plain\n// module `let`s would make the gate read a stale snapshot and never re-render.\nconst [globalDraggingCollectionRef, setGlobalDraggingCollectionRefSignal] =\n createSignal<HTMLElement | null>(null);\nconst [globalDraggingKeys, setGlobalDraggingKeysSignal] = createSignal<Set<string | number>>(\n new Set(),\n);\nconst [globalDraggingTypes, setGlobalDraggingTypesSignal] = createSignal<Set<string>>(new Set());\n\nexport function setGlobalDraggingCollectionRef(ref: HTMLElement | null): void {\n setGlobalDraggingCollectionRefSignal(ref);\n}\n\nexport function getGlobalDraggingCollectionRef(): HTMLElement | null {\n return globalDraggingCollectionRef();\n}\n\nexport function setGlobalDraggingKeys(keys: Set<string | number>): void {\n setGlobalDraggingKeysSignal(new Set(keys));\n}\n\nexport function getGlobalDraggingKeys(): Set<string | number> {\n return new Set(globalDraggingKeys());\n}\n\nexport function setGlobalDraggingTypes(types: Set<string>): void {\n setGlobalDraggingTypesSignal(new Set(types));\n}\n\nexport function getGlobalDraggingTypes(): Set<string> {\n return new Set(globalDraggingTypes());\n}\n\nexport interface DraggableCollectionOptions {\n /** Reference to the collection element. */\n ref: Accessor<HTMLElement | null>;\n}\n\nexport interface DraggableCollectionAria {\n /** The draggable collection state. */\n state: DraggableCollectionState;\n}\n\n/**\n * Creates ARIA support for a draggable collection.\n *\n * @param _options - Collection options\n * @param state - Draggable collection state\n * @returns Draggable collection ARIA result\n */\nexport function createDraggableCollection(\n options: DraggableCollectionOptions,\n state: DraggableCollectionState,\n): DraggableCollectionAria {\n const ref = createMemo(() => options.ref());\n\n // Track dragging state globally. This effect subscribes to THIS collection's\n // `state.draggingKeys`; the global-ref reads are untracked so writing the\n // globals (which are now signals) can't re-trigger this same effect into a\n // loop — only a real change in this collection's dragging keys should re-run it.\n createEffect(() => {\n const currentRef = ref();\n if (state.draggingKeys.size > 0) {\n if (untrack(getGlobalDraggingCollectionRef) !== currentRef) {\n setGlobalDraggingCollectionRef(currentRef);\n }\n setGlobalDraggingKeys(state.draggingKeys);\n setGlobalDraggingTypes(getTypes(state.getItems(state.draggingKeys)));\n return;\n }\n\n // Clear global drag tracking when this collection is no longer dragging.\n if (untrack(getGlobalDraggingCollectionRef) === currentRef) {\n setGlobalDraggingCollectionRef(null);\n setGlobalDraggingKeys(new Set());\n setGlobalDraggingTypes(new Set());\n }\n });\n\n // Clean up on unmount\n onCleanup(() => {\n if (untrack(getGlobalDraggingCollectionRef) === ref()) {\n setGlobalDraggingCollectionRef(null);\n setGlobalDraggingKeys(new Set());\n setGlobalDraggingTypes(new Set());\n }\n });\n\n return {\n state,\n };\n}\n","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","/**\n * Drag and Drop internationalization strings.\n *\n * Copied verbatim from @react-aria/dnd (react-aria 3.50 / RAC 1.19) intl/dnd.\n * All keys are plain ICU MessageFormat strings (no compiled announcement\n * functions), so the port's LocalizedStringFormatter consumes them directly.\n */\n\nimport type { LocalizedString, LocalizedStrings } from \"@internationalized/string\";\n\nimport arAE from \"./ar-AE.json\" with { type: \"json\" };\nimport bgBG from \"./bg-BG.json\" with { type: \"json\" };\nimport csCZ from \"./cs-CZ.json\" with { type: \"json\" };\nimport daDK from \"./da-DK.json\" with { type: \"json\" };\nimport deDE from \"./de-DE.json\" with { type: \"json\" };\nimport elGR from \"./el-GR.json\" with { type: \"json\" };\nimport enUS from \"./en-US.json\" with { type: \"json\" };\nimport esES from \"./es-ES.json\" with { type: \"json\" };\nimport etEE from \"./et-EE.json\" with { type: \"json\" };\nimport fiFI from \"./fi-FI.json\" with { type: \"json\" };\nimport frFR from \"./fr-FR.json\" with { type: \"json\" };\nimport heIL from \"./he-IL.json\" with { type: \"json\" };\nimport hrHR from \"./hr-HR.json\" with { type: \"json\" };\nimport huHU from \"./hu-HU.json\" with { type: \"json\" };\nimport itIT from \"./it-IT.json\" with { type: \"json\" };\nimport jaJP from \"./ja-JP.json\" with { type: \"json\" };\nimport koKR from \"./ko-KR.json\" with { type: \"json\" };\nimport ltLT from \"./lt-LT.json\" with { type: \"json\" };\nimport lvLV from \"./lv-LV.json\" with { type: \"json\" };\nimport nbNO from \"./nb-NO.json\" with { type: \"json\" };\nimport nlNL from \"./nl-NL.json\" with { type: \"json\" };\nimport plPL from \"./pl-PL.json\" with { type: \"json\" };\nimport ptBR from \"./pt-BR.json\" with { type: \"json\" };\nimport ptPT from \"./pt-PT.json\" with { type: \"json\" };\nimport roRO from \"./ro-RO.json\" with { type: \"json\" };\nimport ruRU from \"./ru-RU.json\" with { type: \"json\" };\nimport skSK from \"./sk-SK.json\" with { type: \"json\" };\nimport slSI from \"./sl-SI.json\" with { type: \"json\" };\nimport srSP from \"./sr-SP.json\" with { type: \"json\" };\nimport svSE from \"./sv-SE.json\" with { type: \"json\" };\nimport trTR from \"./tr-TR.json\" with { type: \"json\" };\nimport ukUA from \"./uk-UA.json\" with { type: \"json\" };\nimport zhCN from \"./zh-CN.json\" with { type: \"json\" };\nimport zhTW from \"./zh-TW.json\" with { type: \"json\" };\n\nexport type DndIntlStrings = {\n dragItem: string;\n dragSelectedItems: string;\n dragDescriptionKeyboard: string;\n dragDescriptionKeyboardAlt: string;\n dragDescriptionTouch: string;\n dragDescriptionVirtual: string;\n dragDescriptionLongPress: string;\n dragSelectedKeyboard: string;\n dragSelectedKeyboardAlt: string;\n dragSelectedLongPress: string;\n dragStartedKeyboard: string;\n dragStartedTouch: string;\n dragStartedVirtual: string;\n endDragKeyboard: string;\n endDragTouch: string;\n endDragVirtual: string;\n dropDescriptionKeyboard: string;\n dropDescriptionTouch: string;\n dropDescriptionVirtual: string;\n dropCanceled: string;\n dropComplete: string;\n dropIndicator: string;\n dropOnRoot: string;\n dropOnItem: string;\n insertBefore: string;\n insertBetween: string;\n insertAfter: string;\n};\n\n// `@internationalized/string`'s LocalizedStringFormatter only interpolates\n// variables when a message is a FUNCTION — a plain ICU-template string is\n// returned verbatim (`{itemText}` and friends never substituted). Upstream\n// react-aria compiles its intl JSON into functions at build time\n// (`@internationalized/string-compiler`); this port ships the raw JSON, so we\n// compile the SIMPLE `{var}` placeholders here at module load (mirroring the\n// hand-authored function forms in the color intl catalog). ICU plural/select\n// messages (any `{…,…}` group, e.g. `dragSelectedItems`) are left as strings —\n// they need the full ICU engine and are unused by the single-key drag path.\nconst SIMPLE_PLACEHOLDER = /\\{(\\w+)\\}/g;\nfunction compileSimpleIcu(message: string): LocalizedString {\n if (!SIMPLE_PLACEHOLDER.test(message)) return message;\n // Reset lastIndex (test() with /g advances it) before the plural probe.\n SIMPLE_PLACEHOLDER.lastIndex = 0;\n // Any comma inside a placeholder means real ICU (plural/select) — leave as-is.\n if (/\\{[^{}]*,[^{}]*\\}/.test(message)) return message;\n return (args?: Record<string, unknown>): string =>\n message.replace(SIMPLE_PLACEHOLDER, (_match, key: string) => String(args?.[key] ?? \"\"));\n}\n\nfunction compileLocale(strings: Record<string, string>): Record<string, LocalizedString> {\n const out: Record<string, LocalizedString> = {};\n for (const key of Object.keys(strings)) {\n out[key] = compileSimpleIcu(strings[key]);\n }\n return out;\n}\n\nexport const dndIntlStrings: LocalizedStrings<keyof DndIntlStrings, LocalizedString> = {\n \"ar-AE\": compileLocale(arAE),\n \"bg-BG\": compileLocale(bgBG),\n \"cs-CZ\": compileLocale(csCZ),\n \"da-DK\": compileLocale(daDK),\n \"de-DE\": compileLocale(deDE),\n \"el-GR\": compileLocale(elGR),\n \"en-US\": compileLocale(enUS),\n \"es-ES\": compileLocale(esES),\n \"et-EE\": compileLocale(etEE),\n \"fi-FI\": compileLocale(fiFI),\n \"fr-FR\": compileLocale(frFR),\n \"he-IL\": compileLocale(heIL),\n \"hr-HR\": compileLocale(hrHR),\n \"hu-HU\": compileLocale(huHU),\n \"it-IT\": compileLocale(itIT),\n \"ja-JP\": compileLocale(jaJP),\n \"ko-KR\": compileLocale(koKR),\n \"lt-LT\": compileLocale(ltLT),\n \"lv-LV\": compileLocale(lvLV),\n \"nb-NO\": compileLocale(nbNO),\n \"nl-NL\": compileLocale(nlNL),\n \"pl-PL\": compileLocale(plPL),\n \"pt-BR\": compileLocale(ptBR),\n \"pt-PT\": compileLocale(ptPT),\n \"ro-RO\": compileLocale(roRO),\n \"ru-RU\": compileLocale(ruRU),\n \"sk-SK\": compileLocale(skSK),\n \"sl-SI\": compileLocale(slSI),\n \"sr-SP\": compileLocale(srSP),\n \"sv-SE\": compileLocale(svSE),\n \"tr-TR\": compileLocale(trTR),\n \"uk-UA\": compileLocale(ukUA),\n \"zh-CN\": compileLocale(zhCN),\n \"zh-TW\": compileLocale(zhTW),\n};\n","/**\n * createDrag - ARIA hook for drag operations.\n *\n * Provides accessibility props for draggable elements with support for\n * mouse, touch, and keyboard interactions.\n */\n\nimport { createMemo, type Accessor } from \"solid-js\";\nimport { createDragState, type DropOperation } from \"@proyecto-viviana/solid-stately\";\nimport type { AriaDragOptions, DragAria } from \"./types\";\nimport {\n getTypes,\n writeToDataTransfer,\n DROP_OPERATION,\n EFFECT_ALLOWED,\n DROP_EFFECT_TO_DROP_OPERATION,\n setGlobalAllowedDropOperations,\n setGlobalDropEffect,\n getGlobalDropEffect,\n} from \"./utils\";\nimport { setGlobalDraggingTypes } from \"./createDraggableCollection\";\nimport { beginDragging } from \"./DragManager\";\nimport { createStringFormatter } from \"../i18n/createStringFormatter\";\nimport { dndIntlStrings } from \"./intl\";\n\n/**\n * Creates ARIA props for a draggable element.\n *\n * @param props - Accessor returning drag options\n * @returns Drag ARIA props and state\n */\nexport function createDrag(props: Accessor<AriaDragOptions>): DragAria {\n const getProps = createMemo(() => props());\n\n const state = createDragState(() => ({\n getItems: getProps().getItems,\n getAllowedDropOperations: getProps().getAllowedDropOperations,\n onDragStart: getProps().onDragStart,\n onDragMove: getProps().onDragMove,\n onDragEnd: getProps().onDragEnd,\n isDisabled: getProps().isDisabled,\n hasDragButton: getProps().hasDragButton,\n preview: getProps().preview,\n }));\n\n const stringFormatter = createStringFormatter(dndIntlStrings);\n\n let lastX = 0;\n let lastY = 0;\n\n const onDragStart = (e: DragEvent) => {\n if (e.defaultPrevented) return;\n e.stopPropagation();\n\n const p = getProps();\n\n state.startDrag(e.clientX, e.clientY);\n\n const items = state.getItems();\n setGlobalDraggingTypes(getTypes(items));\n e.dataTransfer?.clearData?.();\n if (e.dataTransfer) {\n writeToDataTransfer(e.dataTransfer, items);\n }\n\n let allowed = DROP_OPERATION.all;\n const allowedOps = state.getAllowedDropOperations();\n if (allowedOps.length > 0) {\n allowed = DROP_OPERATION.none;\n for (const op of allowedOps) {\n allowed |= DROP_OPERATION[op] || DROP_OPERATION.none;\n }\n }\n\n setGlobalAllowedDropOperations(allowed);\n const effectAllowed = EFFECT_ALLOWED[allowed] || \"none\";\n if (e.dataTransfer) {\n e.dataTransfer.effectAllowed = (\n effectAllowed === \"cancel\" ? \"none\" : effectAllowed\n ) as DataTransfer[\"effectAllowed\"];\n }\n\n if (typeof p.preview?.current === \"function\" && e.dataTransfer) {\n p.preview.current(items, (node, userX, userY) => {\n if (!node || !e.dataTransfer) return;\n\n const size = node.getBoundingClientRect();\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\n let defaultX = e.clientX - rect.x;\n let defaultY = e.clientY - rect.y;\n\n if (defaultX > size.width || defaultY > size.height) {\n defaultX = size.width / 2;\n defaultY = size.height / 2;\n }\n\n let offsetX = typeof userX === \"number\" ? userX : defaultX;\n let offsetY = typeof userY === \"number\" ? userY : defaultY;\n\n offsetX = Math.max(0, Math.min(offsetX, size.width));\n offsetY = Math.max(0, Math.min(offsetY, size.height));\n\n e.dataTransfer.setDragImage(node, offsetX, offsetY);\n });\n }\n\n lastX = e.clientX;\n lastY = e.clientY;\n };\n\n const onDrag = (e: DragEvent) => {\n e.stopPropagation();\n\n if (e.clientX === lastX && e.clientY === lastY) {\n return;\n }\n\n state.moveDrag(e.clientX, e.clientY);\n\n lastX = e.clientX;\n lastY = e.clientY;\n };\n\n const onDragEnd = (e: DragEvent) => {\n e.stopPropagation();\n\n let dropEffect: string = e.dataTransfer?.dropEffect ?? \"none\";\n // Chrome Android fix - use global drop effect\n if (getGlobalDropEffect()) {\n dropEffect = getGlobalDropEffect()!;\n }\n\n const dropOperation = DROP_EFFECT_TO_DROP_OPERATION[dropEffect];\n state.endDrag(e.clientX, e.clientY, dropOperation);\n\n setGlobalAllowedDropOperations(DROP_OPERATION.none);\n setGlobalDraggingTypes(new Set());\n setGlobalDropEffect(undefined);\n };\n\n // Keyboard/screen reader drag initiation\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"Enter\" && e.target === e.currentTarget) {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n\n const onKeyUp = (e: KeyboardEvent) => {\n if (e.key === \"Enter\" && e.target === e.currentTarget) {\n e.preventDefault();\n e.stopPropagation();\n\n const el = e.currentTarget as HTMLElement;\n const rect = el.getBoundingClientRect();\n state.startDrag(rect.x + rect.width / 2, rect.y + rect.height / 2);\n\n const items = state.getItems();\n setGlobalDraggingTypes(getTypes(items));\n\n const allowedOps = state.getAllowedDropOperations();\n let allowed = DROP_OPERATION.all;\n if (allowedOps.length > 0) {\n allowed = DROP_OPERATION.none;\n for (const op of allowedOps) {\n allowed |= DROP_OPERATION[op] || DROP_OPERATION.none;\n }\n }\n setGlobalAllowedDropOperations(allowed);\n\n // Hand control to the keyboard DragManager session: it installs the\n // document-capture listeners that drive Tab-cycling across drop targets,\n // Arrow navigation within a target, and Enter/Escape drop/cancel.\n beginDragging(\n {\n element: el,\n items,\n allowedDropOperations:\n allowedOps.length > 0 ? allowedOps : ([\"move\", \"copy\", \"link\"] as DropOperation[]),\n onDragEnd: (ev) => {\n state.endDrag(ev.x, ev.y, ev.dropOperation);\n setGlobalAllowedDropOperations(DROP_OPERATION.none);\n setGlobalDraggingTypes(new Set());\n setGlobalDropEffect(undefined);\n },\n },\n stringFormatter(),\n );\n }\n };\n\n const dragProps = createMemo(() => {\n const p = getProps();\n\n if (p.isDisabled) {\n return {\n draggable: false as const,\n };\n }\n\n const baseProps: Record<string, unknown> = {\n draggable: true as const,\n onDragStart,\n onDrag,\n onDragEnd,\n };\n\n if (!p.hasDragButton) {\n baseProps.onKeyDown = onKeyDown;\n baseProps.onKeyUp = onKeyUp;\n }\n\n return baseProps;\n });\n\n const dragButtonProps = createMemo(() => {\n const p = getProps();\n\n if (p.isDisabled) {\n return {\n disabled: true,\n };\n }\n\n return {\n type: \"button\" as const,\n \"aria-label\": \"Drag\",\n onKeyDown,\n onKeyUp,\n };\n });\n\n return {\n get dragProps() {\n return dragProps() as DragAria[\"dragProps\"];\n },\n get dragButtonProps() {\n return dragButtonProps() as DragAria[\"dragButtonProps\"];\n },\n get isDragging() {\n return state.isDragging;\n },\n };\n}\n","/**\n * createDrop - ARIA hook for drop operations.\n *\n * Provides accessibility props for drop target elements with support for\n * mouse, touch, and keyboard interactions.\n */\n\nimport { createMemo, type Accessor } from \"solid-js\";\nimport { createDropState } from \"@proyecto-viviana/solid-stately\";\nimport type { AriaDropOptions, DropAria } from \"./types\";\nimport {\n readFromDataTransfer,\n DragTypesImpl,\n DROP_OPERATION,\n DROP_OPERATION_ALLOWED,\n DROP_OPERATION_TO_DROP_EFFECT,\n DROP_EFFECT_TO_DROP_OPERATION,\n setGlobalDropEffect,\n getGlobalAllowedDropOperations,\n} from \"./utils\";\nimport type { DropOperation } from \"@proyecto-viviana/solid-stately\";\n\nconst DROP_ACTIVATE_TIMEOUT = 800;\n\n/**\n * Creates ARIA props for a drop target element.\n *\n * @param props - Accessor returning drop options\n * @returns Drop ARIA props and state\n */\nexport function createDrop(props: Accessor<AriaDropOptions>): DropAria {\n const getProps = createMemo(() => props());\n\n const state = createDropState(() => ({\n getDropOperation: getProps().getDropOperation,\n onDropEnter: getProps().onDropEnter,\n onDropMove: getProps().onDropMove,\n onDropActivate: getProps().onDropActivate,\n onDropExit: getProps().onDropExit,\n onDrop: getProps().onDrop,\n hasDropButton: getProps().hasDropButton,\n isDisabled: getProps().isDisabled,\n }));\n\n let x = 0;\n let y = 0;\n let dragOverElements = new Set<Element>();\n let dropEffect: DataTransfer[\"dropEffect\"] = \"none\";\n let allowedOperations = DROP_OPERATION.all;\n let dropActivateTimer: ReturnType<typeof setTimeout> | undefined;\n\n const fireDropEnter = (e: DragEvent) => {\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\n state.enterTarget(e.clientX - rect.x, e.clientY - rect.y);\n };\n\n const fireDropExit = (e: DragEvent) => {\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\n state.exitTarget(e.clientX - rect.x, e.clientY - rect.y);\n };\n\n const getAllowedOperations = (e: DragEvent): number => {\n let allowed =\n DROP_OPERATION_ALLOWED[e.dataTransfer?.effectAllowed ?? \"none\"] ?? DROP_OPERATION.none;\n\n // Use global allowed operations if set (for internal drags)\n const globalAllowed = getGlobalAllowedDropOperations();\n if (globalAllowed) {\n allowed &= globalAllowed;\n }\n\n let modifierAllowed = DROP_OPERATION.none;\n\n // macOS: Alt=copy, Ctrl=link, Cmd=move\n // Windows/Linux: Alt=link, Shift=move, Ctrl=copy\n const isMac = typeof navigator !== \"undefined\" && /mac/i.test(navigator.platform);\n\n if (isMac) {\n if (e.altKey) modifierAllowed |= DROP_OPERATION.copy;\n if (e.ctrlKey) modifierAllowed |= DROP_OPERATION.link;\n if (e.metaKey) modifierAllowed |= DROP_OPERATION.move;\n } else {\n if (e.altKey) modifierAllowed |= DROP_OPERATION.link;\n if (e.shiftKey) modifierAllowed |= DROP_OPERATION.move;\n if (e.ctrlKey) modifierAllowed |= DROP_OPERATION.copy;\n }\n\n if (modifierAllowed) {\n return allowed & modifierAllowed;\n }\n\n return allowed;\n };\n\n const allowedOperationsToArray = (ops: number): DropOperation[] => {\n const result: DropOperation[] = [];\n if (ops & DROP_OPERATION.move) result.push(\"move\");\n if (ops & DROP_OPERATION.copy) result.push(\"copy\");\n if (ops & DROP_OPERATION.link) result.push(\"link\");\n return result;\n };\n\n const getDropOperationForAllowed = (allowed: number, operation: DropOperation): DropOperation => {\n const op = DROP_OPERATION[operation];\n return allowed & op ? operation : \"cancel\";\n };\n\n const onDragEnter = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n\n dragOverElements.add(e.target as Element);\n if (dragOverElements.size > 1) {\n return;\n }\n\n const p = getProps();\n const allowedOpsBits = getAllowedOperations(e);\n const allowedOps = allowedOperationsToArray(allowedOpsBits);\n let dropOp: DropOperation = allowedOps[0] ?? \"cancel\";\n\n if (typeof p.getDropOperation === \"function\" && e.dataTransfer) {\n const types = new DragTypesImpl(e.dataTransfer);\n dropOp = getDropOperationForAllowed(allowedOpsBits, p.getDropOperation(types, allowedOps));\n }\n\n if (typeof p.getDropOperationForPoint === \"function\" && e.dataTransfer) {\n const types = new DragTypesImpl(e.dataTransfer);\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\n dropOp = getDropOperationForAllowed(\n allowedOpsBits,\n p.getDropOperationForPoint(types, allowedOps, e.clientX - rect.x, e.clientY - rect.y),\n );\n }\n\n x = e.clientX;\n y = e.clientY;\n allowedOperations = allowedOpsBits;\n dropEffect = (DROP_OPERATION_TO_DROP_EFFECT[dropOp] || \"none\") as DataTransfer[\"dropEffect\"];\n\n if (e.dataTransfer) {\n e.dataTransfer.dropEffect = dropEffect;\n }\n\n if (dropOp !== \"cancel\") {\n fireDropEnter(e);\n }\n };\n\n const onDragOver = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n\n const allowedOpsBits = getAllowedOperations(e);\n\n // Skip if position and operations haven't changed\n if (e.clientX === x && e.clientY === y && allowedOpsBits === allowedOperations) {\n if (e.dataTransfer) {\n e.dataTransfer.dropEffect = dropEffect;\n }\n return;\n }\n\n x = e.clientX;\n y = e.clientY;\n\n const prevDropEffect = dropEffect;\n const p = getProps();\n\n if (allowedOpsBits !== allowedOperations) {\n const allowedOps = allowedOperationsToArray(allowedOpsBits);\n let dropOp: DropOperation = allowedOps[0] ?? \"cancel\";\n\n if (typeof p.getDropOperation === \"function\" && e.dataTransfer) {\n const types = new DragTypesImpl(e.dataTransfer);\n dropOp = getDropOperationForAllowed(allowedOpsBits, p.getDropOperation(types, allowedOps));\n }\n dropEffect = (DROP_OPERATION_TO_DROP_EFFECT[dropOp] || \"none\") as DataTransfer[\"dropEffect\"];\n }\n\n if (typeof p.getDropOperationForPoint === \"function\" && e.dataTransfer) {\n const types = new DragTypesImpl(e.dataTransfer);\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\n const dropOp = getDropOperationForAllowed(\n allowedOpsBits,\n p.getDropOperationForPoint(\n types,\n allowedOperationsToArray(allowedOpsBits),\n x - rect.x,\n y - rect.y,\n ),\n );\n dropEffect = (DROP_OPERATION_TO_DROP_EFFECT[dropOp] || \"none\") as DataTransfer[\"dropEffect\"];\n }\n\n allowedOperations = allowedOpsBits;\n\n if (e.dataTransfer) {\n e.dataTransfer.dropEffect = dropEffect;\n }\n\n if (dropEffect === \"none\" && prevDropEffect !== \"none\") {\n fireDropExit(e);\n } else if (dropEffect !== \"none\" && prevDropEffect === \"none\") {\n fireDropEnter(e);\n }\n\n if (dropEffect !== \"none\") {\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\n state.moveInTarget(x - rect.x, y - rect.y);\n }\n\n clearTimeout(dropActivateTimer);\n\n if (typeof p.onDropActivate === \"function\" && dropEffect !== \"none\") {\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\n const activateX = x - rect.x;\n const activateY = y - rect.y;\n dropActivateTimer = setTimeout(() => {\n state.activateTarget(activateX, activateY);\n }, DROP_ACTIVATE_TIMEOUT);\n }\n };\n\n const onDragLeave = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n\n // Track drag over elements (WebKit workaround for relatedTarget being null)\n dragOverElements.delete(e.target as Element);\n\n for (const element of dragOverElements) {\n if (!e.currentTarget || !(e.currentTarget as Element).contains(element)) {\n dragOverElements.delete(element);\n }\n }\n\n if (dragOverElements.size > 0) {\n return;\n }\n\n if (dropEffect !== \"none\") {\n fireDropExit(e);\n }\n\n clearTimeout(dropActivateTimer);\n };\n\n const onDropHandler = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n\n // Track drop effect globally for Chrome Android\n setGlobalDropEffect(dropEffect);\n\n const p = getProps();\n if (typeof p.onDrop === \"function\" && e.dataTransfer) {\n const items = readFromDataTransfer(e.dataTransfer);\n const dropOperation = DROP_EFFECT_TO_DROP_OPERATION[dropEffect];\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\n\n state.drop(e.clientX - rect.x, e.clientY - rect.y, items, dropOperation);\n }\n\n dragOverElements.clear();\n fireDropExit(e);\n clearTimeout(dropActivateTimer);\n };\n\n const dropProps = createMemo(() => {\n const p = getProps();\n\n if (p.isDisabled) {\n return {};\n }\n\n const baseProps: Record<string, unknown> = {\n onDragEnter,\n onDragOver,\n onDragLeave,\n onDrop: onDropHandler,\n };\n\n return baseProps;\n });\n\n const dropButtonProps = createMemo(() => {\n const p = getProps();\n\n if (p.isDisabled) {\n return {\n disabled: true,\n };\n }\n\n return {\n type: \"button\" as const,\n \"aria-label\": \"Drop\",\n };\n });\n\n return {\n get dropProps() {\n return dropProps() as DropAria[\"dropProps\"];\n },\n get isDropTarget() {\n return state.isDropTarget;\n },\n get dropButtonProps() {\n return dropButtonProps() as DropAria[\"dropButtonProps\"];\n },\n };\n}\n","/**\n * Keyboard navigation between drop targets within a droppable collection.\n *\n * Faithful port of @react-aria/dnd `DropTargetKeyboardNavigation` (react-aria\n * 3.50). Given a keyboard delegate, the collection, and the current drop target,\n * returns the next/previous drop target in a given direction — cycling through\n * the `before`/`on`/`after` drop positions on each item and descending into\n * nested items.\n *\n * Upstream reads `node.nextKey` / `node.prevKey` (the flattened collection\n * linked-list pointers). In our collection model those are exactly what\n * `collection.getKeyAfter(key)` / `collection.getKeyBefore(key)` return, so they\n * are substituted 1:1 with no behavioral difference. Upstream's `lastChildKey`\n * fast-path is absent from our `CollectionNode`, so we always take upstream's\n * own `childNodes.findLast` fallback branch.\n */\n\nimport type { Collection, CollectionNode, Key } from \"@proyecto-viviana/solid-stately\";\nimport type { DropTarget } from \"@proyecto-viviana/solid-stately\";\n\n/**\n * Keyboard delegate shape consumed by drop-target navigation. Mirrors the\n * subset of `@react-types/shared` `KeyboardDelegate` that navigation uses,\n * including the `{includeDisabled}` option so drop positions around disabled\n * items remain reachable.\n */\nexport interface DropNavigationKeyboardDelegate {\n getKeyBelow?(key: Key, options?: { includeDisabled?: boolean }): Key | null;\n getKeyAbove?(key: Key, options?: { includeDisabled?: boolean }): Key | null;\n getKeyLeftOf?(key: Key, options?: { includeDisabled?: boolean }): Key | null;\n getKeyRightOf?(key: Key, options?: { includeDisabled?: boolean }): Key | null;\n getFirstKey?(key?: Key, global?: boolean): Key | null;\n getLastKey?(key?: Key, global?: boolean): Key | null;\n}\n\nexport function navigate(\n keyboardDelegate: DropNavigationKeyboardDelegate,\n collection: Collection,\n target: DropTarget | null | undefined,\n direction: \"left\" | \"right\" | \"up\" | \"down\",\n rtl = false,\n wrap = false,\n): DropTarget | null {\n switch (direction) {\n case \"left\":\n return rtl\n ? nextDropTarget(keyboardDelegate, collection, target, wrap, \"left\")\n : previousDropTarget(keyboardDelegate, collection, target, wrap, \"left\");\n case \"right\":\n return rtl\n ? previousDropTarget(keyboardDelegate, collection, target, wrap, \"right\")\n : nextDropTarget(keyboardDelegate, collection, target, wrap, \"right\");\n case \"up\":\n return previousDropTarget(keyboardDelegate, collection, target, wrap);\n case \"down\":\n return nextDropTarget(keyboardDelegate, collection, target, wrap);\n }\n}\n\nfunction nextDropTarget(\n keyboardDelegate: DropNavigationKeyboardDelegate,\n collection: Collection,\n target: DropTarget | null | undefined,\n wrap = false,\n horizontal: \"left\" | \"right\" | null = null,\n): DropTarget | null {\n if (!target) {\n return {\n type: \"root\",\n };\n }\n\n if (target.type === \"root\") {\n let nextKey = keyboardDelegate.getFirstKey?.() ?? null;\n if (nextKey != null) {\n return {\n type: \"item\",\n key: nextKey,\n dropPosition: \"before\",\n };\n }\n\n return null;\n }\n\n if (target.type === \"item\") {\n let nextKey: Key | null | undefined = null;\n if (horizontal) {\n nextKey =\n horizontal === \"right\"\n ? keyboardDelegate.getKeyRightOf?.(target.key, { includeDisabled: true })\n : keyboardDelegate.getKeyLeftOf?.(target.key, { includeDisabled: true });\n } else {\n nextKey = keyboardDelegate.getKeyBelow?.(target.key, { includeDisabled: true });\n }\n let nextCollectionKey = getNextItem(collection, target.key, (key) =>\n collection.getKeyAfter(key),\n );\n\n // If the keyboard delegate did not move to the next key in the collection,\n // jump to that key with the same drop position. Otherwise, try the other\n // drop positions on the current key first.\n if (nextKey != null && nextKey !== nextCollectionKey) {\n return {\n type: \"item\",\n key: nextKey,\n dropPosition: target.dropPosition,\n };\n }\n\n switch (target.dropPosition) {\n case \"before\": {\n return {\n type: \"item\",\n key: target.key,\n dropPosition: \"on\",\n };\n }\n case \"on\": {\n // If there are nested items, traverse to them prior to the \"after\" position of this target.\n // If the next key is on the same level, then its \"before\" position is equivalent to this item's \"after\" position.\n let targetNode = collection.getItem(target.key);\n let nextNode = nextKey != null ? collection.getItem(nextKey) : null;\n if (targetNode && nextNode && nextNode.level >= targetNode.level) {\n return {\n type: \"item\",\n key: nextNode.key,\n dropPosition: \"before\",\n };\n }\n\n return {\n type: \"item\",\n key: target.key,\n dropPosition: \"after\",\n };\n }\n case \"after\": {\n // If this is the last sibling in a level, traverse to the parent.\n let targetNode = collection.getItem(target.key);\n let nextSiblingKey = targetNode != null ? collection.getKeyAfter(targetNode.key) : null;\n let nextItemInSameLevel =\n nextSiblingKey != null ? collection.getItem(nextSiblingKey) : null;\n while (nextItemInSameLevel != null && nextItemInSameLevel.type !== \"item\") {\n let afterKey = collection.getKeyAfter(nextItemInSameLevel.key);\n nextItemInSameLevel = afterKey != null ? collection.getItem(afterKey) : null;\n }\n\n if (targetNode && nextItemInSameLevel == null && targetNode.parentKey != null) {\n // If the parent item has an item after it, use the \"before\" position.\n let parentNode = collection.getItem(targetNode.parentKey);\n let parentNextKey = parentNode != null ? collection.getKeyAfter(parentNode.key) : null;\n const nextNode = parentNextKey != null ? collection.getItem(parentNextKey) : null;\n if (nextNode?.type === \"item\") {\n return {\n type: \"item\",\n key: nextNode.key,\n dropPosition: \"before\",\n };\n }\n\n if (parentNode?.type === \"item\") {\n return {\n type: \"item\",\n key: parentNode.key,\n dropPosition: \"after\",\n };\n }\n }\n\n if (nextItemInSameLevel) {\n return {\n type: \"item\",\n key: nextItemInSameLevel.key,\n dropPosition: \"on\",\n };\n }\n }\n }\n }\n\n if (wrap) {\n return {\n type: \"root\",\n };\n }\n\n return null;\n}\n\nfunction previousDropTarget(\n keyboardDelegate: DropNavigationKeyboardDelegate,\n collection: Collection,\n target: DropTarget | null | undefined,\n wrap = false,\n horizontal: \"left\" | \"right\" | null = null,\n): DropTarget | null {\n // Start after the last root-level item.\n if (!target || (wrap && target.type === \"root\")) {\n // Keyboard delegate gets the deepest item but we want the shallowest.\n let prevKey: Key | null = null;\n let lastKey = keyboardDelegate.getLastKey?.();\n while (lastKey != null) {\n let node = collection.getItem(lastKey);\n if (node?.type !== \"item\") {\n break;\n }\n prevKey = lastKey;\n lastKey = node?.parentKey;\n }\n\n if (prevKey != null) {\n return {\n type: \"item\",\n key: prevKey,\n dropPosition: \"after\",\n };\n }\n\n return null;\n }\n\n if (target.type === \"item\") {\n let prevKey: Key | null | undefined = null;\n if (horizontal) {\n prevKey =\n horizontal === \"left\"\n ? keyboardDelegate.getKeyLeftOf?.(target.key, { includeDisabled: true })\n : keyboardDelegate.getKeyRightOf?.(target.key, { includeDisabled: true });\n } else {\n prevKey = keyboardDelegate.getKeyAbove?.(target.key, { includeDisabled: true });\n }\n let prevCollectionKey = getNextItem(collection, target.key, (key) =>\n collection.getKeyBefore(key),\n );\n\n // If the keyboard delegate did not move to the next key in the collection,\n // jump to that key with the same drop position. Otherwise, try the other\n // drop positions on the current key first.\n if (prevKey != null && prevKey !== prevCollectionKey) {\n return {\n type: \"item\",\n key: prevKey,\n dropPosition: target.dropPosition,\n };\n }\n\n switch (target.dropPosition) {\n case \"before\": {\n // Move after the last child of the previous item.\n let targetNode = collection.getItem(target.key);\n let targetPrevKey = targetNode != null ? collection.getKeyBefore(targetNode.key) : null;\n if (targetNode && targetPrevKey != null) {\n let lastChild = getLastChild(collection, targetPrevKey);\n if (lastChild) {\n return lastChild;\n }\n }\n\n if (prevKey != null) {\n return {\n type: \"item\",\n key: prevKey,\n dropPosition: \"on\",\n };\n }\n\n return {\n type: \"root\",\n };\n }\n case \"on\": {\n return {\n type: \"item\",\n key: target.key,\n dropPosition: \"before\",\n };\n }\n case \"after\": {\n // Move after the last child of this item.\n let lastChild = getLastChild(collection, target.key);\n if (lastChild) {\n return lastChild;\n }\n\n return {\n type: \"item\",\n key: target.key,\n dropPosition: \"on\",\n };\n }\n }\n }\n\n if (target.type !== \"root\") {\n return {\n type: \"root\",\n };\n }\n\n return null;\n}\n\nfunction getLastChild(collection: Collection, key: Key): DropTarget | null {\n // getChildNodes still returns child tree items even when the item is collapsed.\n // Checking if the next item has a greater level is a silly way to determine if the item is expanded.\n let targetNode = collection.getItem(key);\n let nextKey = getNextItem(collection, key, (key) => collection.getKeyAfter(key));\n let nextNode = nextKey != null ? collection.getItem(nextKey) : null;\n if (targetNode && nextNode && nextNode.level > targetNode.level) {\n let lastChild: CollectionNode | null = null;\n lastChild = Array.from(targetNode.childNodes).findLast((item) => item.type === \"item\") || null;\n\n if (lastChild) {\n return {\n type: \"item\",\n key: lastChild.key,\n dropPosition: \"after\",\n };\n }\n }\n\n return null;\n}\n\n// Find the next or previous item in a collection, skipping over other types of nodes (e.g. content).\nfunction getNextItem(\n collection: Collection,\n key: Key,\n getNextKey: (key: Key) => Key | null,\n): Key | null {\n let nextCollectionKey = getNextKey(key);\n let nextCollectionNode = nextCollectionKey != null ? collection.getItem(nextCollectionKey) : null;\n while (nextCollectionNode && nextCollectionNode.type !== \"item\") {\n nextCollectionKey = getNextKey(nextCollectionNode.key);\n nextCollectionNode = nextCollectionKey != null ? collection.getItem(nextCollectionKey) : null;\n }\n return nextCollectionKey;\n}\n","/**\n * createDroppableCollection - ARIA hook for droppable collection targets.\n *\n * Provides accessibility support for dropping items into a collection\n * component like ListBox, GridList, or Table.\n */\n\nimport { createEffect, createMemo, onCleanup, type Accessor } from \"solid-js\";\nimport type { JSX } from \"solid-js\";\nimport type {\n Collection,\n DroppableCollectionState,\n DropTarget,\n DropOperation,\n DropItem,\n DragType,\n DragTypes,\n Key,\n} from \"@proyecto-viviana/solid-stately\";\nimport { DIRECTORY_DRAG_TYPE } from \"@proyecto-viviana/solid-stately\";\nimport { createDrop } from \"./createDrop\";\nimport { getGlobalDraggingCollectionRef, getGlobalDraggingKeys } from \"./createDraggableCollection\";\nimport { getTypes } from \"./utils\";\nimport { registerDropTarget } from \"./DragManager\";\nimport { navigate, type DropNavigationKeyboardDelegate } from \"./DropTargetKeyboardNavigation\";\nimport { useLocale } from \"../i18n/locale\";\n\n// Global state for tracking the drop collection\nlet globalDropCollectionRef: HTMLElement | null = null;\n\nexport function setGlobalDropCollectionRef(ref: HTMLElement | null): void {\n globalDropCollectionRef = ref;\n}\n\nexport function getGlobalDropCollectionRef(): HTMLElement | null {\n return globalDropCollectionRef;\n}\n\nexport interface DropTargetDelegate {\n /**\n * Returns a drop target from a point within the collection.\n */\n getDropTargetFromPoint(\n x: number,\n y: number,\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget | null;\n /**\n * Returns the next keyboard-navigable drop target.\n */\n getKeyboardNavigationTarget?(\n target: DropTarget | null,\n direction: \"next\" | \"previous\",\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget | null;\n /**\n * Returns the next page-navigable drop target.\n */\n getKeyboardPageNavigationTarget?(\n target: DropTarget | null,\n direction: \"next\" | \"previous\",\n isValidDropTarget: (target: DropTarget) => boolean,\n ): DropTarget | null;\n}\n\nexport interface KeyboardDelegateLike {\n getFirstKey?: () => string | number | null;\n getLastKey?: () => string | number | null;\n getKeyBelow?: (key: string | number) => string | number | null;\n getKeyAbove?: (key: string | number) => string | number | null;\n getKeyRightOf?: (key: string | number) => string | number | null;\n getKeyLeftOf?: (key: string | number) => string | number | null;\n getKeyPageBelow?: (key: string | number) => string | number | null;\n getKeyPageAbove?: (key: string | number) => string | number | null;\n}\n\ninterface CollectionNodeLike {\n type?: string;\n key: Key;\n parentKey?: Key | null;\n childNodes?: CollectionNodeLike[];\n isExpanded?: boolean;\n}\n\ninterface CollectionLike {\n getItem(key: Key): CollectionNodeLike | null;\n [Symbol.iterator](): Iterator<CollectionNodeLike>;\n}\n\nexport interface DroppableCollectionOptions {\n /** Reference to the collection element. */\n ref: Accessor<HTMLElement | null>;\n /** A delegate that provides drop targets for pointer coordinates. */\n dropTargetDelegate: DropTargetDelegate;\n /** Handler called when items are dropped to be inserted. */\n onInsert?: (e: { items: DropItem[]; target: DropTarget; dropOperation: DropOperation }) => void;\n /** Handler called when items are dropped on the root. */\n onRootDrop?: (e: { items: DropItem[]; dropOperation: DropOperation }) => void;\n /** Handler called when items are dropped on an item. */\n onItemDrop?: (e: {\n items: DropItem[];\n target: DropTarget;\n dropOperation: DropOperation;\n isInternal: boolean;\n }) => void;\n /** Handler called when items are reordered within the collection. */\n onReorder?: (e: {\n keys: Set<string | number>;\n target: DropTarget;\n dropOperation: DropOperation;\n }) => void;\n /** Handler called when items are moved within/between collections. */\n onMove?: (e: {\n keys: Set<string | number>;\n target: DropTarget;\n dropOperation: DropOperation;\n }) => void;\n /** Handler called when a drop occurs on any collection target. */\n onDrop?: (e: {\n items: DropItem[];\n target: DropTarget;\n dropOperation: DropOperation;\n x: number;\n y: number;\n }) => void;\n /** Handler called when the drop target is activated (held over). */\n onDropActivate?: (e: { target: DropTarget; x: number; y: number }) => void;\n /** Optional keyboard delegate used as fallback when drop-target delegates do not provide keyboard navigation methods. */\n keyboardDelegate?: KeyboardDelegateLike;\n /** Optional keyboard handler composed with internal drop target navigation keys. */\n onKeyDown?: (e: KeyboardEvent) => void;\n /**\n * The collection backing the droppable. Used both to restore focus/selection\n * after a drop mutates items and to drive keyboard drop-target navigation\n * (`navigate()` walks `getKeyAfter`/`getKeyBefore`).\n */\n collection?: Collection;\n /** Current collection selection used to avoid replacing user-updated selection after a drop. */\n selectedKeys?: \"all\" | Iterable<Key>;\n /** Sets collection selection after a drop when new rows were inserted and selection was unchanged. */\n setSelectedKeys?: (keys: Set<Key>) => void;\n /** Sets collection focus after a drop when new rows were inserted. */\n setFocusedKey?: (key: Key | null) => void;\n /** Whether the collection is disabled for dropping. */\n isDisabled?: boolean;\n /** Accepted drag types. 'all' accepts any type. */\n acceptedDragTypes?: \"all\" | Array<string | symbol>;\n}\n\nexport function getDropItemTypes(item: DropItem): Set<string | symbol> {\n if (item.kind === \"file\") {\n return new Set([item.type]);\n }\n if (item.kind === \"text\") {\n return new Set(item.types);\n }\n return new Set([DIRECTORY_DRAG_TYPE]);\n}\n\nexport interface DroppableCollectionAria {\n /** Props to spread on the collection element. */\n collectionProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n/**\n * Creates ARIA support for a droppable collection.\n *\n * @param options - Collection options accessor\n * @param state - Droppable collection state\n * @returns Droppable collection ARIA result\n */\nexport function createDroppableCollection(\n options: Accessor<DroppableCollectionOptions>,\n state: DroppableCollectionState,\n): DroppableCollectionAria {\n const getOptions = createMemo(() => options());\n\n // Layout direction drives keyboard drop-target navigation (Left/Right flip in\n // RTL). Read at the reactive owner so the registration effect re-runs on change.\n const locale = useLocale();\n\n // Track the next target during drag operations\n let nextTarget: DropTarget | null = null;\n let currentDropOperation: DropOperation | null = null;\n\n const isInternalDropOperation = (): boolean => {\n const ref = getOptions().ref();\n const draggingRef = getGlobalDraggingCollectionRef();\n return ref !== null && draggingRef === ref;\n };\n\n const getDropOperationForTarget = (\n target: DropTarget,\n types: DragTypes,\n allowedOperations: DropOperation[],\n ): DropOperation => {\n return state.getDropOperation(\n target,\n types,\n allowedOperations,\n isInternalDropOperation(),\n getGlobalDraggingKeys(),\n );\n };\n\n // Create base drop behavior\n const drop = createDrop(() => ({\n isDisabled: getOptions().isDisabled,\n getDropOperationForPoint: (types, allowedOperations, x, y) => {\n const opts = getOptions();\n const isValidDropTarget = (target: DropTarget) =>\n getDropOperationForTarget(target, types, allowedOperations) !== \"cancel\";\n\n const target = opts.dropTargetDelegate.getDropTargetFromPoint(x, y, isValidDropTarget);\n\n if (!target) {\n currentDropOperation = \"cancel\";\n nextTarget = null;\n return \"cancel\";\n }\n\n currentDropOperation = getDropOperationForTarget(target, types, allowedOperations);\n\n // If target doesn't accept, try root\n if (currentDropOperation === \"cancel\") {\n const rootTarget: DropTarget = { type: \"root\" };\n const rootOp = getDropOperationForTarget(rootTarget, types, allowedOperations);\n if (rootOp !== \"cancel\") {\n nextTarget = rootTarget;\n currentDropOperation = rootOp;\n return currentDropOperation;\n }\n }\n\n // Update drop collection ref\n const ref = opts.ref();\n if (target && currentDropOperation !== \"cancel\" && ref !== globalDropCollectionRef) {\n setGlobalDropCollectionRef(ref);\n }\n\n nextTarget = currentDropOperation === \"cancel\" ? null : target;\n return currentDropOperation;\n },\n onDropEnter: () => {\n if (nextTarget) {\n state.setTarget(nextTarget);\n }\n },\n onDropMove: () => {\n if (nextTarget) {\n state.setTarget(nextTarget);\n }\n },\n onDropExit: () => {\n setGlobalDropCollectionRef(null);\n state.setTarget(null);\n },\n onDropActivate: (e) => {\n const opts = getOptions();\n if (\n state.target?.type === \"item\" &&\n state.target.dropPosition === \"on\" &&\n typeof opts.onDropActivate === \"function\"\n ) {\n opts.onDropActivate({\n target: state.target,\n x: e.x,\n y: e.y,\n });\n }\n },\n onDrop: (e) => {\n setGlobalDropCollectionRef(getOptions().ref());\n if (state.target) {\n runDrop(e, state.target);\n }\n },\n }));\n\n // Shared drop handler for both the native-pointer path (createDrop, above) and\n // the keyboard path (the DragManager-registered drop target, below). Mirrors\n // upstream's `defaultOnDrop`, which `useDrop` and `DragManager` both invoke.\n const runDrop = (\n e: { items: DropItem[]; dropOperation: DropOperation; x: number; y: number },\n target: DropTarget,\n ) => {\n const opts = getOptions();\n const previousCollection = opts.collection;\n const previousSelectedKeys = normalizeSelection(opts.selectedKeys);\n opts.onDrop?.({\n items: e.items,\n target,\n dropOperation: e.dropOperation,\n x: e.x,\n y: e.y,\n });\n void Promise.resolve(handleDrop(e.items, target, e.dropOperation)).then(() => {\n queueMicrotask(() => {\n updateFocusAfterDrop(getOptions(), previousCollection, previousSelectedKeys, target);\n });\n });\n };\n\n const handleDrop = async (\n items: DropItem[],\n target: DropTarget,\n dropOperation: DropOperation,\n ) => {\n const opts = getOptions();\n const isInternal = isInternalDropOperation();\n // Capture the dragging keys ONCE up front, mirroring upstream's\n // `let {draggingKeys} = globalDndState` at the top of `defaultOnDrop`. In\n // Solid the global keys live in a signal whose drag-teardown effect flushes\n // synchronously during this same drop flow (React batches, so upstream never\n // observes the clear mid-handler). Re-reading the global in the onMove/onReorder\n // branches would therefore see an already-emptied set; the snapshot preserves it.\n const draggingKeys = getGlobalDraggingKeys();\n\n // Filter items by accepted types\n let filteredItems = items;\n const acceptedTypes = opts.acceptedDragTypes;\n if (acceptedTypes && acceptedTypes !== \"all\") {\n filteredItems = items.filter((item) => {\n const itemTypes = getDropItemTypes(item);\n return acceptedTypes.some((type) => itemTypes.has(type));\n });\n }\n\n if (filteredItems.length === 0) return;\n\n // Call appropriate handlers based on target type\n if (target.type === \"root\" && opts.onRootDrop) {\n await opts.onRootDrop({ items: filteredItems, dropOperation });\n }\n\n if (target.type === \"item\") {\n if (target.dropPosition === \"on\" && opts.onItemDrop) {\n await opts.onItemDrop({\n items: filteredItems,\n target,\n dropOperation,\n isInternal,\n });\n }\n\n // Handle move for internal operations\n if (opts.onMove && isInternal) {\n await opts.onMove({\n keys: draggingKeys,\n target,\n dropOperation,\n });\n }\n\n if (target.dropPosition !== \"on\") {\n if (!isInternal && opts.onInsert) {\n await opts.onInsert({\n items: filteredItems,\n target,\n dropOperation,\n });\n }\n\n if (isInternal && opts.onReorder) {\n await opts.onReorder({\n keys: draggingKeys,\n target,\n dropOperation,\n });\n }\n }\n }\n };\n\n // Clean up on unmount\n onCleanup(() => {\n const ref = getOptions().ref();\n if (globalDropCollectionRef === ref) {\n setGlobalDropCollectionRef(null);\n }\n });\n\n // Wrap the raw `Set<string>` the DragManager hands keyboard drop targets into\n // the `DragTypes` delegate the port state expects. Mirrors upstream, which\n // passes the raw Set to `state.getDropOperation` (no wildcard expansion — that\n // lives in the DataTransfer-backed DragTypes used by the native-pointer path).\n const wrapTypes = (types: Set<string>): DragTypes => ({\n has: (type: DragType | DragType[]) => {\n if (typeof type === \"string\") return types.has(type);\n if (Array.isArray(type)) return type.some((t) => typeof t === \"string\" && types.has(t));\n return false;\n },\n });\n\n const targetsEqual = (\n a: DropTarget | null | undefined,\n b: DropTarget | null | undefined,\n ): boolean => {\n if (!a || !b) return false;\n if (a.type !== b.type) return false;\n if (a.type === \"root\") return true;\n if (a.type !== \"item\" || b.type !== \"item\") return false;\n return a.key === b.key && a.dropPosition === b.dropPosition;\n };\n\n // Port substitute for upstream's `state.isDropTarget(target)` (the port state\n // exposes `isDropTarget` only as a \"drag is over this collection\" boolean, not\n // a per-target predicate): whether `target` equals the current drop target.\n const isCurrentTarget = (target: DropTarget | null | undefined): boolean =>\n targetsEqual(state.target, target);\n\n // Register the collection element as a keyboard/virtual drop target on the\n // DragManager singleton. This is the faithful port of upstream\n // `useDroppableCollection`'s `useEffect` (react-aria 3.50) that installs the\n // DragManager DropTarget — replacing the port's former self-contained\n // `collectionProps.onKeyDown` engine. Re-runs when the element or locale\n // direction changes (upstream keys the effect on `[localState, ref, onDrop, direction]`).\n createEffect(() => {\n const refEl = getOptions().ref();\n if (!refEl) return;\n const rtl = locale().direction === \"rtl\";\n\n const getNextTarget = (\n target: DropTarget | null | undefined,\n wrap = true,\n key: \"left\" | \"right\" | \"up\" | \"down\" = \"down\",\n ): DropTarget | null => {\n const opts = getOptions();\n const collection = opts.collection;\n const keyboardDelegate = opts.keyboardDelegate;\n if (!collection || !keyboardDelegate) return null;\n return navigate(\n keyboardDelegate as DropNavigationKeyboardDelegate,\n collection,\n target,\n key,\n rtl,\n wrap,\n );\n };\n\n const getPreviousTarget = (target: DropTarget | null | undefined, wrap = true) =>\n getNextTarget(target, wrap, \"up\");\n\n const nextValidTarget = (\n target: DropTarget | null | undefined,\n types: Set<string>,\n allowedDropOperations: DropOperation[],\n getNext: (target: DropTarget | null | undefined, wrap: boolean) => DropTarget | null,\n wrap = true,\n ): DropTarget | null => {\n let seenRoot = 0;\n let operation: DropOperation;\n do {\n const next = getNext(target, wrap);\n if (!next) return null;\n target = next;\n operation = getDropOperationForTarget(next, wrapTypes(types), allowedDropOperations);\n if (target.type === \"root\") {\n seenRoot++;\n }\n } while (operation === \"cancel\" && !isCurrentTarget(target) && seenRoot < 2);\n\n if (operation === \"cancel\") {\n return null;\n }\n\n return target;\n };\n\n const unregister = registerDropTarget({\n element: refEl,\n preventFocusOnDrop: true,\n getDropOperation(types, allowedOperations) {\n if (state.target) {\n return getDropOperationForTarget(state.target, wrapTypes(types), allowedOperations);\n }\n\n // Check if any of the targets accept the drop.\n const target = nextValidTarget(null, types, allowedOperations, (t, wrap) =>\n getNextTarget(t, wrap),\n );\n return target ? \"move\" : \"cancel\";\n },\n onDropEnter(_e, drag) {\n const types = getTypes(drag.items);\n // Update the drop collection ref tracker for createDroppableItem's isInternal check.\n setGlobalDropCollectionRef(getOptions().ref());\n\n // When entering the droppable collection for the first time, upstream's\n // default drop target is AFTER the focused key\n // (useDroppableCollection.ts:505-559). The port's DroppableCollectionState\n // carries no selectionManager, but at keyboard pickup the dragged item IS\n // the collection's focused item, so we recover the focused key from the\n // drag target element's `data-key` (createSelectableItem stamps it).\n const opts = getOptions();\n let key = keyFromDragElement(drag.element, opts.collection);\n let dropPosition: \"before\" | \"on\" | \"after\" = \"after\";\n\n // Mirror upstream's reorder heuristic: if the focused item is also\n // selected, drop after the last selected item; but if it is the first of\n // a multi-selection, drop before the first (select-down → move down,\n // select-up → move up). Single-key keyboard drags never hit this branch.\n const selected = normalizeSelection(opts.selectedKeys);\n if (key != null && opts.collection && selectionHas(selected, key)) {\n const ordered = orderedSelectedKeys(selected, opts.collection);\n if (ordered.length > 1 && ordered[0] === key) {\n dropPosition = \"before\";\n } else if (ordered.length > 0) {\n key = ordered[ordered.length - 1];\n }\n }\n\n let target: DropTarget | null = null;\n if (key != null) {\n target = { type: \"item\", key, dropPosition };\n // If the default target is not valid, find the next one that is, then\n // fall back to the previous. Mirrors useDroppableCollection.ts:538-551.\n if (\n getDropOperationForTarget(target, wrapTypes(types), drag.allowedDropOperations) ===\n \"cancel\"\n ) {\n target =\n nextValidTarget(\n target,\n types,\n drag.allowedDropOperations,\n (t, wrap) => getNextTarget(t, wrap),\n false,\n ) ??\n nextValidTarget(target, types, drag.allowedDropOperations, getPreviousTarget, false);\n }\n }\n\n // If no focused key, start from the root (upstream's fallback).\n if (!target) {\n target = nextValidTarget(null, types, drag.allowedDropOperations, (t, wrap) =>\n getNextTarget(t, wrap),\n );\n }\n\n state.setTarget(target);\n },\n onDropExit() {\n setGlobalDropCollectionRef(null);\n state.setTarget(null);\n },\n onDropTargetEnter(target) {\n state.setTarget(target);\n },\n onDropActivate(e, target) {\n const opts = getOptions();\n if (\n target?.type === \"item\" &&\n target?.dropPosition === \"on\" &&\n typeof opts.onDropActivate === \"function\"\n ) {\n opts.onDropActivate({ target, x: e.x, y: e.y });\n }\n },\n onDrop(e, target) {\n setGlobalDropCollectionRef(getOptions().ref());\n if (state.target) {\n runDrop(e, target || state.target);\n }\n },\n onKeyDown(e, drag) {\n const opts = getOptions();\n const keyboardDelegate = opts.keyboardDelegate;\n if (!keyboardDelegate) {\n opts.onKeyDown?.(e);\n return;\n }\n const types = getTypes(drag.items);\n switch (e.key) {\n case \"ArrowDown\": {\n if (keyboardDelegate.getKeyBelow) {\n const target = nextValidTarget(\n state.target,\n types,\n drag.allowedDropOperations,\n (t, wrap) => getNextTarget(t, wrap, \"down\"),\n );\n state.setTarget(target);\n }\n break;\n }\n case \"ArrowUp\": {\n if (keyboardDelegate.getKeyAbove) {\n const target = nextValidTarget(\n state.target,\n types,\n drag.allowedDropOperations,\n (t, wrap) => getNextTarget(t, wrap, \"up\"),\n );\n state.setTarget(target);\n }\n break;\n }\n case \"ArrowLeft\": {\n if (keyboardDelegate.getKeyLeftOf) {\n const target = nextValidTarget(\n state.target,\n types,\n drag.allowedDropOperations,\n (t, wrap) => getNextTarget(t, wrap, \"left\"),\n );\n state.setTarget(target);\n }\n break;\n }\n case \"ArrowRight\": {\n if (keyboardDelegate.getKeyRightOf) {\n const target = nextValidTarget(\n state.target,\n types,\n drag.allowedDropOperations,\n (t, wrap) => getNextTarget(t, wrap, \"right\"),\n );\n state.setTarget(target);\n }\n break;\n }\n case \"Home\": {\n if (keyboardDelegate.getFirstKey) {\n const target = nextValidTarget(null, types, drag.allowedDropOperations, (t, wrap) =>\n getNextTarget(t, wrap),\n );\n state.setTarget(target);\n }\n break;\n }\n case \"End\": {\n if (keyboardDelegate.getLastKey) {\n const target = nextValidTarget(\n null,\n types,\n drag.allowedDropOperations,\n getPreviousTarget,\n );\n state.setTarget(target);\n }\n break;\n }\n case \"PageDown\": {\n if (keyboardDelegate.getKeyPageBelow) {\n let target = state.target;\n if (!target) {\n target = nextValidTarget(null, types, drag.allowedDropOperations, (t, wrap) =>\n getNextTarget(t, wrap),\n );\n } else {\n // If on the root, go to the item a page below the top. Otherwise a page below the current item.\n let targetKey = keyboardDelegate.getFirstKey?.();\n if (target.type === \"item\") {\n targetKey = target.key;\n }\n let nextKey: Key | null = null;\n if (targetKey != null) {\n nextKey = keyboardDelegate.getKeyPageBelow(targetKey);\n }\n let dropPosition: \"before\" | \"on\" | \"after\" =\n target.type === \"item\" ? target.dropPosition : \"after\";\n\n // If there is no next key, or we are starting on the last key, jump to the last possible position.\n if (\n nextKey == null ||\n (target.type === \"item\" && target.key === keyboardDelegate.getLastKey?.())\n ) {\n nextKey = keyboardDelegate.getLastKey?.() ?? null;\n dropPosition = \"after\";\n }\n\n if (nextKey == null) {\n break;\n }\n target = {\n type: \"item\",\n key: nextKey,\n dropPosition,\n };\n\n // If the target does not accept the drop, find the next valid target.\n // If no next valid target, find the previous valid target.\n const operation = getDropOperationForTarget(\n target,\n wrapTypes(types),\n drag.allowedDropOperations,\n );\n if (operation === \"cancel\") {\n target =\n nextValidTarget(\n target,\n types,\n drag.allowedDropOperations,\n (t, wrap) => getNextTarget(t, wrap),\n false,\n ) ??\n nextValidTarget(\n target,\n types,\n drag.allowedDropOperations,\n getPreviousTarget,\n false,\n );\n }\n }\n\n state.setTarget(target ?? state.target);\n }\n break;\n }\n case \"PageUp\": {\n if (!keyboardDelegate.getKeyPageAbove) {\n break;\n }\n\n let target = state.target;\n if (!target) {\n target = nextValidTarget(null, types, drag.allowedDropOperations, getPreviousTarget);\n } else if (target.type === \"item\") {\n // If at the top already, switch to the root. Otherwise navigate a page up.\n if (target.key === keyboardDelegate.getFirstKey?.()) {\n target = {\n type: \"root\",\n };\n } else {\n let nextKey: Key | null | undefined = keyboardDelegate.getKeyPageAbove(target.key);\n let dropPosition: \"before\" | \"on\" | \"after\" = target.dropPosition;\n if (nextKey == null) {\n nextKey = keyboardDelegate.getFirstKey?.();\n dropPosition = \"before\";\n }\n\n if (nextKey == null) {\n break;\n }\n target = {\n type: \"item\",\n key: nextKey,\n dropPosition,\n };\n }\n\n // If the target does not accept the drop, find the previous valid target.\n // If no next valid target, find the next valid target.\n const operation = getDropOperationForTarget(\n target,\n wrapTypes(types),\n drag.allowedDropOperations,\n );\n if (operation === \"cancel\") {\n target =\n nextValidTarget(\n target,\n types,\n drag.allowedDropOperations,\n getPreviousTarget,\n false,\n ) ??\n nextValidTarget(\n target,\n types,\n drag.allowedDropOperations,\n (t, wrap) => getNextTarget(t, wrap),\n false,\n );\n }\n }\n\n state.setTarget(target ?? state.target);\n break;\n }\n }\n opts.onKeyDown?.(e);\n },\n });\n\n onCleanup(unregister);\n });\n\n const collectionProps = createMemo<Record<string, unknown>>(() => ({\n ...drop.dropProps,\n // Remove description from the collection element. If dropping on the entire\n // collection, there should be a drop indicator that carries this\n // description, so no need to double-announce.\n \"aria-describedby\": null,\n }));\n\n return {\n get collectionProps() {\n return collectionProps() as DroppableCollectionAria[\"collectionProps\"];\n },\n };\n}\n\nfunction normalizeSelection(selection: \"all\" | Iterable<Key> | undefined): \"all\" | Set<Key> | null {\n if (selection == null) return null;\n if (selection === \"all\") return \"all\";\n return new Set(selection);\n}\n\n// Recover the collection key of a dragged/dropped DOM element. createSelectableItem\n// stamps `data-key={String(key)}`, so the attribute is the stringified key; map it\n// back to the real (possibly numeric) collection key by matching against the\n// collection's nodes.\nfunction keyFromDragElement(\n element: HTMLElement | null,\n collection: Collection | undefined,\n): Key | null {\n if (!element) return null;\n const raw =\n element.getAttribute(\"data-key\") ?? element.closest(\"[data-key]\")?.getAttribute(\"data-key\");\n if (raw == null) return null;\n if (!collection) return raw;\n // Fast path: the raw string is already a valid key.\n if ((collection as unknown as CollectionLike).getItem(raw) != null) return raw;\n for (const node of collection as unknown as CollectionLike) {\n if (String(node.key) === raw) return node.key;\n }\n return raw;\n}\n\nfunction selectionHas(selection: \"all\" | Set<Key> | null, key: Key): boolean {\n if (selection === \"all\") return true;\n return selection != null && selection.has(key);\n}\n\n// The selected keys in collection (DOM) order, so [0] is the first selected item\n// and [length-1] the last — mirroring upstream's firstSelectedKey/lastSelectedKey.\nfunction orderedSelectedKeys(selection: \"all\" | Set<Key> | null, collection: Collection): Key[] {\n const out: Key[] = [];\n for (const node of collection as unknown as CollectionLike) {\n if (node.type === \"item\" && selectionHas(selection, node.key)) {\n out.push(node.key);\n }\n }\n return out;\n}\n\nfunction selectionEquals(a: \"all\" | Set<Key> | null, b: \"all\" | Set<Key> | null): boolean {\n if (a === b) return true;\n if (!a || !b || a === \"all\" || b === \"all\") return false;\n if (a.size !== b.size) return false;\n for (const key of a) {\n if (!b.has(key)) return false;\n }\n return true;\n}\n\nfunction getNewItemKeys(collection: CollectionLike, previousCollection: CollectionLike): Set<Key> {\n const keys = new Set<Key>();\n const visit = (node: CollectionNodeLike) => {\n if (node.type === \"item\" && !previousCollection.getItem(node.key)) {\n keys.add(node.key);\n }\n for (const child of node.childNodes ?? []) {\n visit(child);\n }\n };\n\n for (const node of collection) {\n visit(node);\n }\n return keys;\n}\n\nfunction updateFocusAfterDrop(\n opts: DroppableCollectionOptions,\n previousCollectionRaw: Collection | undefined,\n previousSelectedKeys: \"all\" | Set<Key> | null,\n target: DropTarget,\n): void {\n // Read the (real) collection through the structural `CollectionLike` view: it\n // exposes the optional cell/rowheader/isExpanded fields upstream inspects, which\n // are simply absent (undefined) for flat collections like ListBox.\n const collection = opts.collection as CollectionLike | undefined;\n const previousCollection = previousCollectionRaw as unknown as CollectionLike | undefined;\n if (!collection || !previousCollection) return;\n\n const newKeys = getNewItemKeys(collection, previousCollection);\n if (newKeys.size === 0) return;\n\n const currentSelectedKeys = normalizeSelection(opts.selectedKeys);\n if (\n opts.setSelectedKeys &&\n previousSelectedKeys &&\n selectionEquals(previousSelectedKeys, currentSelectedKeys)\n ) {\n opts.setSelectedKeys(newKeys);\n }\n\n const first = newKeys.values().next().value;\n if (first == null) return;\n\n let focusKey: Key | null = first;\n const item = collection.getItem(first);\n const parent = item?.parentKey != null ? collection.getItem(item.parentKey) : null;\n const isDroppedOnCollapsedParent =\n target.type === \"item\" &&\n target.dropPosition === \"on\" &&\n item?.parentKey != null &&\n parent?.isExpanded !== true;\n\n if (item && (item.type === \"cell\" || item.type === \"rowheader\" || isDroppedOnCollapsedParent)) {\n focusKey = item.parentKey ?? first;\n }\n\n opts.setFocusedKey?.(focusKey);\n\n queueMicrotask(() => {\n const row = opts.ref()?.querySelector<HTMLElement>('[role=\"row\"][tabindex=\"0\"]');\n row?.focus();\n });\n}\n","/**\n * createDraggableItem - ARIA hook for draggable items within a collection.\n *\n * Provides accessibility props for items that can be dragged from a collection.\n */\n\nimport { createMemo, type Accessor } from \"solid-js\";\nimport type { JSX } from \"solid-js\";\nimport type {\n DraggableCollectionState,\n DragPreviewRenderer,\n DropOperation,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n getTypes,\n writeToDataTransfer,\n getDragModality,\n DROP_OPERATION,\n EFFECT_ALLOWED,\n DROP_EFFECT_TO_DROP_OPERATION,\n setGlobalAllowedDropOperations,\n setGlobalDropEffect,\n getGlobalDropEffect,\n} from \"./utils\";\nimport { createInteractionModality } from \"../interactions\";\nimport { setGlobalDraggingTypes } from \"./createDraggableCollection\";\nimport { beginDragging } from \"./DragManager\";\nimport { createStringFormatter } from \"../i18n/createStringFormatter\";\nimport { dndIntlStrings } from \"./intl\";\nimport { createDescription } from \"../utils/createDescription\";\n\nexport interface DraggableItemOptions {\n /** The unique key of the item. */\n key: string | number;\n /** Whether the item has a separate drag button affordance. */\n hasDragButton?: boolean;\n /**\n * Whether the host item has a primary action (e.g. Enter on a GridList/Table\n * row) that conflicts with the Enter keyboard drag pickup. When true the drag\n * description switches to the Alt variant (mirrors upstream `hasAction`).\n */\n hasAction?: boolean;\n /**\n * The host collection's selection mode. Upstream only surfaces the drag\n * affordance description (aria-describedby → \"Press Enter to start dragging.\")\n * when the mode is not `'none'`.\n */\n selectionMode?: \"none\" | \"single\" | \"multiple\";\n /** Whether this item is disabled for dragging. */\n isDisabled?: boolean;\n /** Preview renderer function ref. */\n preview?: { current: DragPreviewRenderer | null };\n}\n\nexport interface DraggableItemAria {\n /** Props for the draggable item element. */\n dragProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the explicit drag button affordance, if any. */\n dragButtonProps: JSX.ButtonHTMLAttributes<HTMLButtonElement>;\n /** Whether the item is currently being dragged. */\n isDragging: boolean;\n}\n\n/**\n * Creates ARIA props for a draggable item within a collection.\n *\n * @param options - Accessor returning item options\n * @param state - Draggable collection state\n * @returns Draggable item ARIA props\n */\n// Drag description keys per interaction modality, mirroring upstream\n// useDraggableItem's MESSAGES table. The port always drags the single focused\n// key, so isSelected is always false → the `notSelected` row is used.\nconst DRAG_DESCRIPTION_MESSAGES: Record<string, string> = {\n keyboard: \"dragDescriptionKeyboard\",\n touch: \"dragDescriptionLongPress\",\n virtual: \"dragDescriptionVirtual\",\n};\n\nexport function createDraggableItem(\n options: Accessor<DraggableItemOptions>,\n state: DraggableCollectionState,\n): DraggableItemAria {\n const getOptions = createMemo(() => options());\n\n const stringFormatter = createStringFormatter(dndIntlStrings);\n const { modality } = createInteractionModality();\n\n // Track position for drag move\n let lastX = 0;\n let lastY = 0;\n\n const isDragging = createMemo(() => {\n const key = getOptions().key;\n return state.draggingKeys.has(key);\n });\n\n // Drag affordance description (aria-describedby → \"Press Enter to start\n // dragging.\"). Mirrors upstream useDraggableItem: surfaced only when the item\n // has no explicit drag button and the host selection mode is not 'none'. The\n // port only ever drags the single focused key (getKeysForDrag), so\n // numKeysForDrag === 1 → isSelected is always false → the base (notSelected)\n // keyboard message; a host primary action swaps in the Alt variant.\n const dragDescription = createMemo(() => {\n const opts = getOptions();\n if (opts.hasDragButton) return undefined;\n if (opts.selectionMode == null || opts.selectionMode === \"none\") return undefined;\n // Subscribe to modality changes, then resolve the drag modality the same way\n // upstream does (pointer → virtual, coarse-pointer virtual → touch). At rest\n // with no keyboard interaction this is 'virtual' → \"Click to start dragging.\".\n modality();\n const dragModality = getDragModality();\n let msg = DRAG_DESCRIPTION_MESSAGES[dragModality] ?? \"dragDescriptionVirtual\";\n if (opts.hasAction && dragModality === \"keyboard\") {\n msg += \"Alt\";\n }\n return stringFormatter().format(\n msg as Parameters<ReturnType<typeof stringFormatter>[\"format\"]>[0],\n );\n });\n const descriptionProps = createDescription(dragDescription);\n\n const getKeysForDrag = (): Set<string | number> => {\n const { key } = getOptions();\n // If the key is not selected, only drag that item\n // If it is selected, drag all selected items\n // For now, just return the single key\n return new Set([key]);\n };\n\n const onDragStart = (e: DragEvent) => {\n if (e.defaultPrevented) return;\n e.stopPropagation();\n\n const opts = getOptions();\n if (opts.isDisabled || state.isDisabled) return;\n\n const keys = getKeysForDrag();\n\n // Start drag state\n state.startDrag(keys, e.clientX, e.clientY);\n\n // Get items and write to data transfer\n const items = state.getItems(keys);\n setGlobalDraggingTypes(getTypes(items));\n e.dataTransfer?.clearData?.();\n if (e.dataTransfer) {\n writeToDataTransfer(e.dataTransfer, items);\n }\n\n // Set allowed drop operations\n let allowed = DROP_OPERATION.all;\n const allowedOps = state.getAllowedDropOperations();\n if (allowedOps.length > 0) {\n allowed = DROP_OPERATION.none;\n for (const op of allowedOps) {\n allowed |= DROP_OPERATION[op] || DROP_OPERATION.none;\n }\n }\n\n setGlobalAllowedDropOperations(allowed);\n const effectAllowed = EFFECT_ALLOWED[allowed] || \"none\";\n if (e.dataTransfer) {\n e.dataTransfer.effectAllowed = (\n effectAllowed === \"cancel\" ? \"none\" : effectAllowed\n ) as DataTransfer[\"effectAllowed\"];\n }\n\n // Handle custom preview from item options or collection state.\n const preview = opts.preview ?? state.preview;\n if (typeof preview?.current === \"function\" && e.dataTransfer) {\n preview.current(items, (node, userX, userY) => {\n if (!node || !e.dataTransfer) return;\n\n const size = node.getBoundingClientRect();\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\n let defaultX = e.clientX - rect.x;\n let defaultY = e.clientY - rect.y;\n\n if (defaultX > size.width || defaultY > size.height) {\n defaultX = size.width / 2;\n defaultY = size.height / 2;\n }\n\n let offsetX = typeof userX === \"number\" ? userX : defaultX;\n let offsetY = typeof userY === \"number\" ? userY : defaultY;\n\n offsetX = Math.max(0, Math.min(offsetX, size.width));\n offsetY = Math.max(0, Math.min(offsetY, size.height));\n\n e.dataTransfer.setDragImage(node, offsetX, offsetY);\n });\n }\n\n lastX = e.clientX;\n lastY = e.clientY;\n };\n\n const onDrag = (e: DragEvent) => {\n e.stopPropagation();\n\n if (e.clientX === lastX && e.clientY === lastY) {\n return;\n }\n\n state.moveDrag(e.clientX, e.clientY);\n\n lastX = e.clientX;\n lastY = e.clientY;\n };\n\n const onDragEnd = (e: DragEvent) => {\n e.stopPropagation();\n\n let dropEffect: string = e.dataTransfer?.dropEffect ?? \"none\";\n // Chrome Android fix - use global drop effect\n if (getGlobalDropEffect()) {\n dropEffect = getGlobalDropEffect()!;\n }\n\n const dropOperation = DROP_EFFECT_TO_DROP_OPERATION[dropEffect];\n const isInternal = false; // Would check global state\n state.endDrag(e.clientX, e.clientY, dropOperation, isInternal);\n\n setGlobalAllowedDropOperations(DROP_OPERATION.none);\n setGlobalDraggingTypes(new Set());\n setGlobalDropEffect(undefined);\n };\n\n // Keyboard/screen reader drag initiation\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"Enter\" && e.target === e.currentTarget) {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n\n const onKeyUp = (e: KeyboardEvent) => {\n if (e.key === \"Enter\" && e.target === e.currentTarget) {\n e.preventDefault();\n e.stopPropagation();\n\n const opts = getOptions();\n if (opts.isDisabled || state.isDisabled) return;\n\n const el = e.currentTarget as HTMLElement;\n const keys = getKeysForDrag();\n const rect = el.getBoundingClientRect();\n state.startDrag(keys, rect.x + rect.width / 2, rect.y + rect.height / 2);\n\n const items = state.getItems(keys);\n setGlobalDraggingTypes(getTypes(items));\n\n const allowedOps = state.getAllowedDropOperations();\n let allowed = DROP_OPERATION.all;\n if (allowedOps.length > 0) {\n allowed = DROP_OPERATION.none;\n for (const op of allowedOps) {\n allowed |= DROP_OPERATION[op] || DROP_OPERATION.none;\n }\n }\n setGlobalAllowedDropOperations(allowed);\n\n // Hand control to the keyboard DragManager session, which drives\n // Tab-cycling across drop targets and Enter/Escape drop/cancel.\n beginDragging(\n {\n element: el,\n items,\n allowedDropOperations:\n allowedOps.length > 0 ? allowedOps : ([\"move\", \"copy\", \"link\"] as DropOperation[]),\n onDragEnd: (ev) => {\n state.endDrag(ev.x, ev.y, ev.dropOperation, false);\n setGlobalAllowedDropOperations(DROP_OPERATION.none);\n setGlobalDraggingTypes(new Set());\n setGlobalDropEffect(undefined);\n },\n },\n stringFormatter(),\n );\n }\n };\n\n const dragProps = createMemo(() => {\n const opts = getOptions();\n\n if (opts.isDisabled || state.isDisabled) {\n return {\n draggable: false as const,\n };\n }\n\n const baseProps: Record<string, unknown> = {\n draggable: true as const,\n onDragStart,\n onDrag,\n onDragEnd,\n };\n\n // Add keyboard handlers if no separate drag button. Mirrors upstream\n // useDrag: the Enter pickup is wired in the CAPTURE phase so it runs before\n // the collection item's own press/selection handlers (which also claim\n // Enter) and can stopPropagation to suppress them — a bubble-phase handler\n // would never see the Enter keyup, since press consumes it first. In Solid,\n // capture-phase spread props use the `oncapture:` prefix.\n if (!opts.hasDragButton) {\n baseProps[\"oncapture:keydown\"] = onKeyDown;\n baseProps[\"oncapture:keyup\"] = onKeyUp;\n }\n\n // Reading the reactive getter here keeps this memo subscribed, so the id\n // appears once createDescription's effect has mounted the hidden element.\n const describedBy = descriptionProps[\"aria-describedby\"];\n if (describedBy) {\n baseProps[\"aria-describedby\"] = describedBy;\n }\n\n return baseProps;\n });\n\n const dragButtonProps = createMemo(() => {\n const opts = getOptions();\n\n if (opts.isDisabled || state.isDisabled) {\n return {\n disabled: true,\n };\n }\n\n return {\n type: \"button\" as const,\n \"aria-label\": \"Drag\",\n onKeyDown,\n onKeyUp,\n };\n });\n\n return {\n get dragProps() {\n return dragProps() as DraggableItemAria[\"dragProps\"];\n },\n get dragButtonProps() {\n return dragButtonProps() as DraggableItemAria[\"dragButtonProps\"];\n },\n get isDragging() {\n return isDragging();\n },\n };\n}\n","/**\n * createDroppableItem - ARIA hook for droppable items within a collection.\n *\n * Provides accessibility props for items that can receive drops.\n */\n\nimport { createMemo, type Accessor } from \"solid-js\";\nimport type { JSX } from \"solid-js\";\nimport type {\n DroppableCollectionState,\n DropTarget,\n DropOperation,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n DragTypesImpl,\n DROP_OPERATION,\n DROP_OPERATION_ALLOWED,\n DROP_OPERATION_TO_DROP_EFFECT,\n getGlobalAllowedDropOperations,\n} from \"./utils\";\n\nexport interface DroppableItemOptions {\n /** The unique key of the item. */\n key: string | number;\n /** Reference to the item element. */\n ref: Accessor<HTMLElement | null>;\n /** Whether this item is disabled for dropping. */\n isDisabled?: boolean;\n}\n\nexport interface DroppableItemAria {\n /** Props for the droppable item element. */\n dropProps: JSX.HTMLAttributes<HTMLElement>;\n /** Whether the item is currently a drop target. */\n isDropTarget: boolean;\n}\n\n/**\n * Creates ARIA props for a droppable item within a collection.\n *\n * @param options - Accessor returning item options\n * @param state - Droppable collection state\n * @returns Droppable item ARIA props\n */\nexport function createDroppableItem(\n options: Accessor<DroppableItemOptions>,\n state: DroppableCollectionState,\n): DroppableItemAria {\n const getOptions = createMemo(() => options());\n\n const isDropTarget = createMemo(() => {\n const { key } = getOptions();\n const target = state.target;\n return target?.type === \"item\" && target.key === key;\n });\n\n const getTarget = (dropPosition: \"before\" | \"on\" | \"after\"): DropTarget => {\n const { key } = getOptions();\n return {\n type: \"item\",\n key,\n dropPosition,\n };\n };\n\n const getDropOperation = (e: DragEvent, target: DropTarget): DropOperation => {\n if (!e.dataTransfer) return \"cancel\";\n\n const types = new DragTypesImpl(e.dataTransfer);\n let allowedBits = DROP_OPERATION_ALLOWED[e.dataTransfer.effectAllowed] || DROP_OPERATION.all;\n\n // Use global allowed operations for internal drags\n const globalAllowed = getGlobalAllowedDropOperations();\n if (globalAllowed) {\n allowedBits &= globalAllowed;\n }\n\n const allowedOperations: DropOperation[] = [];\n if (allowedBits & DROP_OPERATION.move) allowedOperations.push(\"move\");\n if (allowedBits & DROP_OPERATION.copy) allowedOperations.push(\"copy\");\n if (allowedBits & DROP_OPERATION.link) allowedOperations.push(\"link\");\n\n return state.getDropOperation(target, types, allowedOperations);\n };\n\n let dropActivateTimer: ReturnType<typeof setTimeout> | undefined;\n const DROP_ACTIVATE_TIMEOUT = 800;\n\n const onDragEnter = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n\n const opts = getOptions();\n if (opts.isDisabled) return;\n\n // Determine drop position based on cursor position\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\n const x = e.clientX - rect.x;\n const y = e.clientY - rect.y;\n const height = rect.height;\n\n let dropPosition: \"before\" | \"on\" | \"after\";\n if (y < height * 0.25) {\n dropPosition = \"before\";\n } else if (y > height * 0.75) {\n dropPosition = \"after\";\n } else {\n dropPosition = \"on\";\n }\n\n const target = getTarget(dropPosition);\n const operation = getDropOperation(e, target);\n\n if (operation !== \"cancel\") {\n state.setTarget(target);\n e.dataTransfer!.dropEffect = DROP_OPERATION_TO_DROP_EFFECT[\n operation\n ] as DataTransfer[\"dropEffect\"];\n }\n };\n\n const onDragOver = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n\n const opts = getOptions();\n if (opts.isDisabled) return;\n\n // Update drop position based on cursor\n const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();\n const x = e.clientX - rect.x;\n const y = e.clientY - rect.y;\n const height = rect.height;\n\n let dropPosition: \"before\" | \"on\" | \"after\";\n if (y < height * 0.25) {\n dropPosition = \"before\";\n } else if (y > height * 0.75) {\n dropPosition = \"after\";\n } else {\n dropPosition = \"on\";\n }\n\n const target = getTarget(dropPosition);\n const operation = getDropOperation(e, target);\n\n if (operation !== \"cancel\") {\n state.setTarget(target);\n e.dataTransfer!.dropEffect = DROP_OPERATION_TO_DROP_EFFECT[\n operation\n ] as DataTransfer[\"dropEffect\"];\n\n // Handle drop activate for 'on' position\n clearTimeout(dropActivateTimer);\n if (dropPosition === \"on\") {\n dropActivateTimer = setTimeout(() => {\n state.activateTarget(x, y);\n }, DROP_ACTIVATE_TIMEOUT);\n }\n } else {\n e.dataTransfer!.dropEffect = \"none\";\n }\n };\n\n const onDragLeave = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n\n clearTimeout(dropActivateTimer);\n\n // Only clear target if leaving this item\n const relatedTarget = e.relatedTarget as HTMLElement | null;\n const currentTarget = e.currentTarget as HTMLElement;\n if (!relatedTarget || !currentTarget.contains(relatedTarget)) {\n // Clear if no longer over this item\n const { key } = getOptions();\n if (state.target?.type === \"item\" && state.target.key === key) {\n // State clearing handled by parent collection\n }\n }\n };\n\n const onDrop = (e: DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n\n clearTimeout(dropActivateTimer);\n\n // Drop handling is done by the parent collection\n };\n\n const dropProps = createMemo(() => {\n const opts = getOptions();\n\n if (opts.isDisabled) {\n return {};\n }\n\n return {\n onDragEnter,\n onDragOver,\n onDragLeave,\n onDrop,\n };\n });\n\n return {\n get dropProps() {\n return dropProps() as DroppableItemAria[\"dropProps\"];\n },\n get isDropTarget() {\n return isDropTarget();\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;AAwBA,MAAM,CAAC,6BAA6B,wCAClC,aAAiC,IAAI;AACvC,MAAM,CAAC,oBAAoB,+BAA+B,6B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