@react-aria/dnd 3.7.3-nightly.5042 → 3.7.4

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.
@@ -331,7 +331,8 @@ class $28e10663603f5ea1$var$DragSession {
331
331
  // Announce first drop target after drag start announcement finishes.
332
332
  // Otherwise, it will never get announced because drag start announcement is assertive.
333
333
  if (!this.initialFocused) {
334
- (0, $hMqHl$reactarialiveannouncer.announce)(item === null || item === void 0 ? void 0 : item.element.getAttribute('aria-label'), 'polite');
334
+ let label = item === null || item === void 0 ? void 0 : item.element.getAttribute('aria-label');
335
+ if (label) (0, $hMqHl$reactarialiveannouncer.announce)(label, 'polite');
335
336
  this.initialFocused = true;
336
337
  }
337
338
  }
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAUD,IAAI,oCAAc,IAAI;AACtB,IAAI,kCAAY,IAAI;AACpB,IAAI,oCAA2B;AAC/B,IAAI,sCAAgB,IAAI;AAcjB,SAAS,0CAAmB,MAAkB;IACnD,kCAAY,GAAG,CAAC,OAAO,OAAO,EAAE;IAChC,8CAAA,wDAAA,kCAAa,sBAAsB;IACnC,OAAO;QACL,kCAAY,MAAM,CAAC,OAAO,OAAO;QACjC,8CAAA,wDAAA,kCAAa,sBAAsB;IACrC;AACF;AAQO,SAAS,0CAAiB,IAAmB;IAClD,gCAAU,GAAG,CAAC,KAAK,OAAO,EAAE;IAC5B,OAAO;QACL,gCAAU,MAAM,CAAC,KAAK,OAAO;IAC/B;AACF;AASO,SAAS,0CAAc,MAAkB,EAAE,eAAyC;IACzF,IAAI,mCACF,MAAM,IAAI,MAAM;IAGlB,oCAAc,IAAI,kCAAY,QAAQ;IACtC,sBAAsB;QACpB,kCAAY,KAAK;QACjB,IAAI,CAAA,GAAA,yCAAc,QAAQ,YACxB,kCAAY,IAAI;IAEpB;IAEA,KAAK,IAAI,MAAM,oCACb;AAEJ;AAEO,SAAS;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IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI;QACrC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI;QACjD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI;QAC7C,IAAI,CAAC,cAAc,GAAG;IACxB;AAqZF;AAEA,SAAS,2CAAqB,OAAmB;IAC/C,IAAI,QAAQ,CAAA,GAAA,kCAAO,EAAE,QAAQ,KAAK;IAClC,OAAO;WAAI,kCAAY,MAAM;KAAG,CAAC,MAAM,CAAC,CAAA;QACtC,IAAI,OAAO,OAAO,CAAC,OAAO,CAAC,yBACzB,OAAO;QAGT,IAAI,OAAO,OAAO,gBAAgB,KAAK,YACrC,OAAO,OAAO,gBAAgB,CAAC,OAAO,QAAQ,qBAAqB,MAAM;QAG3E,OAAO;IACT;AACF","sources":["packages/@react-aria/dnd/src/DragManager.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {announce} from '@react-aria/live-announcer';\nimport {ariaHideOutside} from '@react-aria/overlays';\nimport {DragEndEvent, DragItem, DropActivateEvent, DropEnterEvent, DropEvent, DropExitEvent, DropItem, DropOperation, DropTarget as DroppableCollectionTarget, FocusableElement} from '@react-types/shared';\nimport {getDragModality, getTypes} from './utils';\nimport {isVirtualClick, isVirtualPointerEvent} from '@react-aria/utils';\nimport type {LocalizedStringFormatter} from '@internationalized/string';\nimport {useEffect, useState} from 'react';\n\nlet dropTargets = new Map<Element, DropTarget>();\nlet dropItems = new Map<Element, DroppableItem>();\nlet dragSession: DragSession = null;\nlet subscriptions = new Set<() => void>();\n\ninterface DropTarget {\n element: FocusableElement,\n preventFocusOnDrop?: boolean,\n getDropOperation?: (types: Set<string>, allowedOperations: DropOperation[]) => DropOperation,\n onDropEnter?: (e: DropEnterEvent, dragTarget: DragTarget) => void,\n onDropExit?: (e: DropExitEvent) => void,\n onDropTargetEnter?: (target?: DroppableCollectionTarget) => void,\n onDropActivate?: (e: DropActivateEvent, target?: DroppableCollectionTarget) => void,\n onDrop?: (e: DropEvent, target?: DroppableCollectionTarget) => void,\n onKeyDown?: (e: KeyboardEvent, dragTarget: DragTarget) => void\n}\n\nexport function registerDropTarget(target: DropTarget) {\n dropTargets.set(target.element, target);\n dragSession?.updateValidDropTargets();\n return () => {\n dropTargets.delete(target.element);\n dragSession?.updateValidDropTargets();\n };\n}\n\ninterface DroppableItem {\n element: FocusableElement,\n target: DroppableCollectionTarget,\n getDropOperation?: (types: Set<string>, allowedOperations: DropOperation[]) => DropOperation\n}\n\nexport function registerDropItem(item: DroppableItem) {\n dropItems.set(item.element, item);\n return () => {\n dropItems.delete(item.element);\n };\n}\n\ninterface DragTarget {\n element: FocusableElement,\n items: DragItem[],\n allowedDropOperations: DropOperation[],\n onDragEnd?: (e: DragEndEvent) => void\n}\n\nexport function beginDragging(target: DragTarget, stringFormatter: LocalizedStringFormatter) {\n if (dragSession) {\n throw new Error('Cannot begin dragging while already dragging');\n }\n\n dragSession = new DragSession(target, stringFormatter);\n requestAnimationFrame(() => {\n dragSession.setup();\n if (getDragModality() === 'keyboard') {\n dragSession.next();\n }\n });\n\n for (let cb of subscriptions) {\n cb();\n }\n}\n\nexport function useDragSession() {\n let [session, setSession] = useState(dragSession);\n\n useEffect(() => {\n let cb = () => setSession(dragSession);\n subscriptions.add(cb);\n return () => {\n subscriptions.delete(cb);\n };\n }, []);\n\n return session;\n}\n\n/** @private */\nexport function isVirtualDragging(): boolean {\n return !!dragSession;\n}\n\nfunction endDragging() {\n dragSession = null;\n for (let cb of subscriptions) {\n cb();\n }\n}\n\nexport function isValidDropTarget(element: Element): boolean {\n for (let target of dropTargets.keys()) {\n if (target.contains(element)) {\n return true;\n }\n }\n\n return false;\n}\n\nconst CANCELED_EVENTS = [\n 'pointerdown',\n 'pointermove',\n 'pointerenter',\n 'pointerleave',\n 'pointerover',\n 'pointerout',\n 'pointerup',\n 'mousedown',\n 'mousemove',\n 'mouseenter',\n 'mouseleave',\n 'mouseover',\n 'mouseout',\n 'mouseup',\n 'touchstart',\n 'touchmove',\n 'touchend',\n 'focusin',\n 'focusout'\n];\n\nconst CLICK_EVENTS = [\n 'pointerup',\n 'mouseup',\n 'touchend'\n];\n\nconst MESSAGES = {\n keyboard: 'dragStartedKeyboard',\n touch: 'dragStartedTouch',\n virtual: 'dragStartedVirtual'\n};\n\nclass DragSession {\n dragTarget: DragTarget;\n validDropTargets: DropTarget[];\n currentDropTarget: DropTarget;\n currentDropItem: DroppableItem;\n dropOperation: DropOperation;\n private mutationObserver: MutationObserver;\n private restoreAriaHidden: () => void;\n private stringFormatter: LocalizedStringFormatter;\n private isVirtualClick: boolean;\n private initialFocused: boolean;\n\n constructor(target: DragTarget, stringFormatter: LocalizedStringFormatter) {\n this.dragTarget = target;\n this.stringFormatter = stringFormatter;\n\n this.onKeyDown = this.onKeyDown.bind(this);\n this.onKeyUp = this.onKeyUp.bind(this);\n this.onFocus = this.onFocus.bind(this);\n this.onBlur = this.onBlur.bind(this);\n this.onClick = this.onClick.bind(this);\n this.onPointerDown = this.onPointerDown.bind(this);\n this.cancelEvent = this.cancelEvent.bind(this);\n this.initialFocused = false;\n }\n\n setup() {\n document.addEventListener('keydown', this.onKeyDown, true);\n document.addEventListener('keyup', this.onKeyUp, true);\n window.addEventListener('focus', this.onFocus, true);\n window.addEventListener('blur', this.onBlur, true);\n document.addEventListener('click', this.onClick, true);\n document.addEventListener('pointerdown', this.onPointerDown, true);\n\n for (let event of CANCELED_EVENTS) {\n document.addEventListener(event, this.cancelEvent, true);\n }\n\n this.mutationObserver = new MutationObserver(() =>\n this.updateValidDropTargets()\n );\n this.updateValidDropTargets();\n\n announce(this.stringFormatter.format(MESSAGES[getDragModality()]));\n }\n\n teardown() {\n document.removeEventListener('keydown', this.onKeyDown, true);\n document.removeEventListener('keyup', this.onKeyUp, true);\n window.removeEventListener('focus', this.onFocus, true);\n window.removeEventListener('blur', this.onBlur, true);\n document.removeEventListener('click', this.onClick, true);\n document.removeEventListener('pointerdown', this.onPointerDown, true);\n\n for (let event of CANCELED_EVENTS) {\n document.removeEventListener(event, this.cancelEvent, true);\n }\n\n this.mutationObserver.disconnect();\n this.restoreAriaHidden();\n }\n\n onKeyDown(e: KeyboardEvent) {\n this.cancelEvent(e);\n\n if (e.key === 'Escape') {\n this.cancel();\n return;\n }\n\n if (e.key === 'Tab' && !(e.metaKey || e.altKey || e.ctrlKey)) {\n if (e.shiftKey) {\n this.previous();\n } else {\n this.next();\n }\n }\n\n if (typeof this.currentDropTarget?.onKeyDown === 'function') {\n this.currentDropTarget.onKeyDown(e, this.dragTarget);\n }\n }\n\n onKeyUp(e: KeyboardEvent) {\n this.cancelEvent(e);\n\n if (e.key === 'Enter') {\n if (e.altKey) {\n this.activate();\n } else {\n this.drop();\n }\n }\n }\n\n onFocus(e: FocusEvent) {\n // Prevent focus events, except to the original drag target.\n if (e.target !== this.dragTarget.element) {\n this.cancelEvent(e);\n }\n\n // Ignore focus events on the window/document (JSDOM). Will be handled in onBlur, below.\n if (!(e.target instanceof HTMLElement) || e.target === this.dragTarget.element) {\n return;\n }\n\n let dropTarget =\n this.validDropTargets.find(target => target.element === e.target as HTMLElement) ||\n this.validDropTargets.find(target => target.element.contains(e.target as HTMLElement));\n\n if (!dropTarget) {\n if (this.currentDropTarget) {\n this.currentDropTarget.element.focus();\n } else {\n this.dragTarget.element.focus();\n }\n return;\n }\n\n let item = dropItems.get(e.target as HTMLElement);\n this.setCurrentDropTarget(dropTarget, item);\n }\n\n onBlur(e: FocusEvent) {\n if (e.target !== this.dragTarget.element) {\n this.cancelEvent(e);\n }\n\n // If nothing is gaining focus, or e.relatedTarget is the window/document (JSDOM),\n // restore focus back to the current drop target if any, or the original drag target.\n if (!e.relatedTarget || !(e.relatedTarget instanceof HTMLElement)) {\n if (this.currentDropTarget) {\n this.currentDropTarget.element.focus();\n } else {\n this.dragTarget.element.focus();\n }\n }\n }\n\n onClick(e: MouseEvent) {\n this.cancelEvent(e);\n if (isVirtualClick(e) || this.isVirtualClick) {\n if (e.target === this.dragTarget.element) {\n this.cancel();\n return;\n }\n\n let dropTarget = this.validDropTargets.find(target => target.element.contains(e.target as HTMLElement));\n if (dropTarget) {\n let item = dropItems.get(e.target as HTMLElement);\n this.setCurrentDropTarget(dropTarget, item);\n this.drop(item);\n }\n }\n }\n\n onPointerDown(e: PointerEvent) {\n // Android Talkback double tap has e.detail = 1 for onClick. Detect the virtual click in onPointerDown before onClick fires\n // so we can properly perform cancel and drop operations.\n this.cancelEvent(e);\n this.isVirtualClick = isVirtualPointerEvent(e);\n }\n\n cancelEvent(e: Event) {\n // Allow focusin and focusout on the drag target so focus ring works properly.\n if ((e.type === 'focusin' || e.type === 'focusout') && e.target === this.dragTarget?.element) {\n return;\n }\n\n // Allow default for events that might cancel a click event\n if (!CLICK_EVENTS.includes(e.type)) {\n e.preventDefault();\n }\n\n e.stopPropagation();\n e.stopImmediatePropagation();\n }\n\n updateValidDropTargets() {\n if (!this.mutationObserver) {\n return;\n }\n\n this.mutationObserver.disconnect();\n if (this.restoreAriaHidden) {\n this.restoreAriaHidden();\n }\n\n this.validDropTargets = findValidDropTargets(this.dragTarget);\n\n // Shuffle drop target order based on starting drag target.\n if (this.validDropTargets.length > 0) {\n let nearestIndex = this.findNearestDropTarget();\n this.validDropTargets = [\n ...this.validDropTargets.slice(nearestIndex),\n ...this.validDropTargets.slice(0, nearestIndex)\n ];\n }\n\n if (this.currentDropTarget && !this.validDropTargets.includes(this.currentDropTarget)) {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n }\n\n // Find valid drop items within collections\n let types = getTypes(this.dragTarget.items);\n let validDropItems = [...dropItems.values()].filter(item => {\n if (typeof item.getDropOperation === 'function') {\n return item.getDropOperation(types, this.dragTarget.allowedDropOperations) !== 'cancel';\n }\n\n return true;\n });\n\n // Filter out drop targets that contain valid items. We don't want to stop hiding elements\n // other than the drop items that exist inside the collection.\n let visibleDropTargets = this.validDropTargets.filter(target =>\n !validDropItems.some(item => target.element.contains(item.element))\n );\n\n this.restoreAriaHidden = ariaHideOutside([\n this.dragTarget.element,\n ...validDropItems.map(item => item.element),\n ...visibleDropTargets.map(target => target.element)\n ]);\n\n this.mutationObserver.observe(document.body, {subtree: true, attributes: true, attributeFilter: ['aria-hidden']});\n }\n\n next() {\n if (!this.currentDropTarget) {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n return;\n }\n\n let index = this.validDropTargets.indexOf(this.currentDropTarget);\n if (index < 0) {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n return;\n }\n\n // If we've reached the end of the valid drop targets, cycle back to the original drag target.\n // This lets the user cancel the drag in case they don't have an Escape key (e.g. iPad keyboard case).\n if (index === this.validDropTargets.length - 1) {\n if (!this.dragTarget.element.closest('[aria-hidden=\"true\"]')) {\n this.setCurrentDropTarget(null);\n this.dragTarget.element.focus();\n } else {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n }\n } else {\n this.setCurrentDropTarget(this.validDropTargets[index + 1]);\n }\n }\n\n previous() {\n if (!this.currentDropTarget) {\n this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);\n return;\n }\n\n let index = this.validDropTargets.indexOf(this.currentDropTarget);\n if (index < 0) {\n this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);\n return;\n }\n\n // If we've reached the start of the valid drop targets, cycle back to the original drag target.\n // This lets the user cancel the drag in case they don't have an Escape key (e.g. iPad keyboard case).\n if (index === 0) {\n if (!this.dragTarget.element.closest('[aria-hidden=\"true\"]')) {\n this.setCurrentDropTarget(null);\n this.dragTarget.element.focus();\n } else {\n this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);\n }\n } else {\n this.setCurrentDropTarget(this.validDropTargets[index - 1]);\n }\n }\n\n findNearestDropTarget(): number {\n let dragTargetRect = this.dragTarget.element.getBoundingClientRect();\n\n let minDistance = Infinity;\n let nearest = -1;\n for (let i = 0; i < this.validDropTargets.length; i++) {\n let dropTarget = this.validDropTargets[i];\n let rect = dropTarget.element.getBoundingClientRect();\n let dx = rect.left - dragTargetRect.left;\n let dy = rect.top - dragTargetRect.top;\n let dist = (dx * dx) + (dy * dy);\n if (dist < minDistance) {\n minDistance = dist;\n nearest = i;\n }\n }\n\n return nearest;\n }\n\n setCurrentDropTarget(dropTarget: DropTarget, item?: DroppableItem) {\n if (dropTarget !== this.currentDropTarget) {\n if (this.currentDropTarget && typeof this.currentDropTarget.onDropExit === 'function') {\n let rect = this.currentDropTarget.element.getBoundingClientRect();\n this.currentDropTarget.onDropExit({\n type: 'dropexit',\n x: rect.left + (rect.width / 2),\n y: rect.top + (rect.height / 2)\n });\n }\n\n this.currentDropTarget = dropTarget;\n\n if (dropTarget) {\n if (typeof dropTarget.onDropEnter === 'function') {\n let rect = dropTarget.element.getBoundingClientRect();\n dropTarget.onDropEnter({\n type: 'dropenter',\n x: rect.left + (rect.width / 2),\n y: rect.top + (rect.height / 2)\n }, this.dragTarget);\n }\n\n if (!item) {\n dropTarget?.element.focus();\n }\n }\n }\n\n if (item !== this.currentDropItem) {\n if (item && typeof this.currentDropTarget.onDropTargetEnter === 'function') {\n this.currentDropTarget.onDropTargetEnter(item?.target);\n }\n\n item?.element.focus();\n this.currentDropItem = item;\n\n // Announce first drop target after drag start announcement finishes.\n // Otherwise, it will never get announced because drag start announcement is assertive.\n if (!this.initialFocused) {\n announce(item?.element.getAttribute('aria-label'), 'polite');\n this.initialFocused = true;\n }\n }\n }\n\n end() {\n this.teardown();\n endDragging();\n\n if (typeof this.dragTarget.onDragEnd === 'function') {\n let target = this.currentDropTarget && this.dropOperation !== 'cancel' ? this.currentDropTarget : this.dragTarget;\n let rect = target.element.getBoundingClientRect();\n this.dragTarget.onDragEnd({\n type: 'dragend',\n x: rect.x + (rect.width / 2),\n y: rect.y + (rect.height / 2),\n dropOperation: this.dropOperation || 'cancel'\n });\n }\n\n if (this.currentDropTarget && !this.currentDropTarget.preventFocusOnDrop) {\n // Re-trigger focus event on active element, since it will not have received it during dragging (see cancelEvent).\n // This corrects state such as whether focus ring should appear.\n // useDroppableCollection handles this itself, so this is only for standalone drop zones.\n document.activeElement.dispatchEvent(new FocusEvent('focusin', {bubbles: true}));\n }\n\n this.setCurrentDropTarget(null);\n }\n\n cancel() {\n this.setCurrentDropTarget(null);\n this.end();\n if (!this.dragTarget.element.closest('[aria-hidden=\"true\"]')) {\n this.dragTarget.element.focus();\n }\n\n announce(this.stringFormatter.format('dropCanceled'));\n }\n\n drop(item?: DroppableItem) {\n if (!this.currentDropTarget) {\n this.cancel();\n return;\n }\n\n if (typeof item?.getDropOperation === 'function') {\n let types = getTypes(this.dragTarget.items);\n this.dropOperation = item.getDropOperation(types, this.dragTarget.allowedDropOperations);\n } else if (typeof this.currentDropTarget.getDropOperation === 'function') {\n let types = getTypes(this.dragTarget.items);\n this.dropOperation = this.currentDropTarget.getDropOperation(types, this.dragTarget.allowedDropOperations);\n } else {\n // TODO: show menu ??\n this.dropOperation = this.dragTarget.allowedDropOperations[0];\n }\n\n if (typeof this.currentDropTarget.onDrop === 'function') {\n let items: DropItem[] = this.dragTarget.items.map(item => ({\n kind: 'text',\n types: new Set(Object.keys(item)),\n getText: (type: string) => Promise.resolve(item[type])\n }));\n\n let rect = this.currentDropTarget.element.getBoundingClientRect();\n this.currentDropTarget.onDrop({\n type: 'drop',\n x: rect.left + (rect.width / 2),\n y: rect.top + (rect.height / 2),\n items,\n dropOperation: this.dropOperation\n }, item?.target);\n }\n\n this.end();\n announce(this.stringFormatter.format('dropComplete'));\n }\n\n activate() {\n if (this.currentDropTarget && typeof this.currentDropTarget.onDropActivate === 'function') {\n let rect = this.currentDropTarget.element.getBoundingClientRect();\n this.currentDropTarget.onDropActivate({\n type: 'dropactivate',\n x: rect.left + (rect.width / 2),\n y: rect.top + (rect.height / 2)\n });\n }\n }\n}\n\nfunction findValidDropTargets(options: DragTarget) {\n let types = getTypes(options.items);\n return [...dropTargets.values()].filter(target => {\n if (target.element.closest('[aria-hidden=\"true\"]')) {\n return false;\n }\n\n if (typeof target.getDropOperation === 'function') {\n return target.getDropOperation(types, options.allowedDropOperations) !== 'cancel';\n }\n\n return true;\n });\n}\n"],"names":[],"version":3,"file":"DragManager.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAUD,IAAI,oCAAc,IAAI;AACtB,IAAI,kCAAY,IAAI;AACpB,IAAI,oCAA2B;AAC/B,IAAI,sCAAgB,IAAI;AAcjB,SAAS,0CAAmB,MAAkB;IACnD,kCAAY,GAAG,CAAC,OAAO,OAAO,EAAE;IAChC,8CAAA,wDAAA,kCAAa,sBAAsB;IACnC,OAAO;QACL,kCAAY,MAAM,CAAC,OAAO,OAAO;QACjC,8CAAA,wDAAA,kCAAa,sBAAsB;IACrC;AACF;AAQO,SAAS,0CAAiB,IAAmB;IAClD,gCAAU,GAAG,CAAC,KAAK,OAAO,EAAE;IAC5B,OAAO;QACL,gCAAU,MAAM,CAAC,KAAK,OAAO;IAC/B;AACF;AASO,SAAS,0CAAc,MAAkB,EAAE,eAAyC;IACzF,IAAI,mCACF,MAAM,IAAI,MAAM;IAGlB,oCAAc,IAAI,kCAAY,QAAQ;IACtC,sBAAsB;QACpB,kCAAY,KAAK;QACjB,IAAI,CAAA,GAAA,yCAAc,QAAQ,YACxB,kCAAY,IAAI;IAEpB;IAEA,KAAK,IAAI,MAAM,oCACb;AAEJ;AAEO,SAAS;IACd,IAAI,CAAC,SAAS,WAAW,GAAG,CAAA,GAAA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AO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI;QACrC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI;QACjD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI;QAC7C,IAAI,CAAC,cAAc,GAAG;IACxB;AAwZF;AAEA,SAAS,2CAAqB,OAAmB;IAC/C,IAAI,QAAQ,CAAA,GAAA,kCAAO,EAAE,QAAQ,KAAK;IAClC,OAAO;WAAI,kCAAY,MAAM;KAAG,CAAC,MAAM,CAAC,CAAA;QACtC,IAAI,OAAO,OAAO,CAAC,OAAO,CAAC,yBACzB,OAAO;QAGT,IAAI,OAAO,OAAO,gBAAgB,KAAK,YACrC,OAAO,OAAO,gBAAgB,CAAC,OAAO,QAAQ,qBAAqB,MAAM;QAG3E,OAAO;IACT;AACF","sources":["packages/@react-aria/dnd/src/DragManager.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {announce} from '@react-aria/live-announcer';\nimport {ariaHideOutside} from '@react-aria/overlays';\nimport {DragEndEvent, DragItem, DropActivateEvent, DropEnterEvent, DropEvent, DropExitEvent, DropItem, DropOperation, DropTarget as DroppableCollectionTarget, FocusableElement} from '@react-types/shared';\nimport {getDragModality, getTypes} from './utils';\nimport {isVirtualClick, isVirtualPointerEvent} from '@react-aria/utils';\nimport type {LocalizedStringFormatter} from '@internationalized/string';\nimport {useEffect, useState} from 'react';\n\nlet dropTargets = new Map<Element, DropTarget>();\nlet dropItems = new Map<Element, DroppableItem>();\nlet dragSession: DragSession = null;\nlet subscriptions = new Set<() => void>();\n\ninterface DropTarget {\n element: FocusableElement,\n preventFocusOnDrop?: boolean,\n getDropOperation?: (types: Set<string>, allowedOperations: DropOperation[]) => DropOperation,\n onDropEnter?: (e: DropEnterEvent, dragTarget: DragTarget) => void,\n onDropExit?: (e: DropExitEvent) => void,\n onDropTargetEnter?: (target?: DroppableCollectionTarget) => void,\n onDropActivate?: (e: DropActivateEvent, target?: DroppableCollectionTarget) => void,\n onDrop?: (e: DropEvent, target?: DroppableCollectionTarget) => void,\n onKeyDown?: (e: KeyboardEvent, dragTarget: DragTarget) => void\n}\n\nexport function registerDropTarget(target: DropTarget) {\n dropTargets.set(target.element, target);\n dragSession?.updateValidDropTargets();\n return () => {\n dropTargets.delete(target.element);\n dragSession?.updateValidDropTargets();\n };\n}\n\ninterface DroppableItem {\n element: FocusableElement,\n target: DroppableCollectionTarget,\n getDropOperation?: (types: Set<string>, allowedOperations: DropOperation[]) => DropOperation\n}\n\nexport function registerDropItem(item: DroppableItem) {\n dropItems.set(item.element, item);\n return () => {\n dropItems.delete(item.element);\n };\n}\n\ninterface DragTarget {\n element: FocusableElement,\n items: DragItem[],\n allowedDropOperations: DropOperation[],\n onDragEnd?: (e: DragEndEvent) => void\n}\n\nexport function beginDragging(target: DragTarget, stringFormatter: LocalizedStringFormatter) {\n if (dragSession) {\n throw new Error('Cannot begin dragging while already dragging');\n }\n\n dragSession = new DragSession(target, stringFormatter);\n requestAnimationFrame(() => {\n dragSession.setup();\n if (getDragModality() === 'keyboard') {\n dragSession.next();\n }\n });\n\n for (let cb of subscriptions) {\n cb();\n }\n}\n\nexport function useDragSession() {\n let [session, setSession] = useState(dragSession);\n\n useEffect(() => {\n let cb = () => setSession(dragSession);\n subscriptions.add(cb);\n return () => {\n subscriptions.delete(cb);\n };\n }, []);\n\n return session;\n}\n\n/** @private */\nexport function isVirtualDragging(): boolean {\n return !!dragSession;\n}\n\nfunction endDragging() {\n dragSession = null;\n for (let cb of subscriptions) {\n cb();\n }\n}\n\nexport function isValidDropTarget(element: Element): boolean {\n for (let target of dropTargets.keys()) {\n if (target.contains(element)) {\n return true;\n }\n }\n\n return false;\n}\n\nconst CANCELED_EVENTS = [\n 'pointerdown',\n 'pointermove',\n 'pointerenter',\n 'pointerleave',\n 'pointerover',\n 'pointerout',\n 'pointerup',\n 'mousedown',\n 'mousemove',\n 'mouseenter',\n 'mouseleave',\n 'mouseover',\n 'mouseout',\n 'mouseup',\n 'touchstart',\n 'touchmove',\n 'touchend',\n 'focusin',\n 'focusout'\n];\n\nconst CLICK_EVENTS = [\n 'pointerup',\n 'mouseup',\n 'touchend'\n];\n\nconst MESSAGES = {\n keyboard: 'dragStartedKeyboard',\n touch: 'dragStartedTouch',\n virtual: 'dragStartedVirtual'\n};\n\nclass DragSession {\n dragTarget: DragTarget;\n validDropTargets: DropTarget[];\n currentDropTarget: DropTarget;\n currentDropItem: DroppableItem;\n dropOperation: DropOperation;\n private mutationObserver: MutationObserver;\n private restoreAriaHidden: () => void;\n private stringFormatter: LocalizedStringFormatter;\n private isVirtualClick: boolean;\n private initialFocused: boolean;\n\n constructor(target: DragTarget, stringFormatter: LocalizedStringFormatter) {\n this.dragTarget = target;\n this.stringFormatter = stringFormatter;\n\n this.onKeyDown = this.onKeyDown.bind(this);\n this.onKeyUp = this.onKeyUp.bind(this);\n this.onFocus = this.onFocus.bind(this);\n this.onBlur = this.onBlur.bind(this);\n this.onClick = this.onClick.bind(this);\n this.onPointerDown = this.onPointerDown.bind(this);\n this.cancelEvent = this.cancelEvent.bind(this);\n this.initialFocused = false;\n }\n\n setup() {\n document.addEventListener('keydown', this.onKeyDown, true);\n document.addEventListener('keyup', this.onKeyUp, true);\n window.addEventListener('focus', this.onFocus, true);\n window.addEventListener('blur', this.onBlur, true);\n document.addEventListener('click', this.onClick, true);\n document.addEventListener('pointerdown', this.onPointerDown, true);\n\n for (let event of CANCELED_EVENTS) {\n document.addEventListener(event, this.cancelEvent, true);\n }\n\n this.mutationObserver = new MutationObserver(() =>\n this.updateValidDropTargets()\n );\n this.updateValidDropTargets();\n\n announce(this.stringFormatter.format(MESSAGES[getDragModality()]));\n }\n\n teardown() {\n document.removeEventListener('keydown', this.onKeyDown, true);\n document.removeEventListener('keyup', this.onKeyUp, true);\n window.removeEventListener('focus', this.onFocus, true);\n window.removeEventListener('blur', this.onBlur, true);\n document.removeEventListener('click', this.onClick, true);\n document.removeEventListener('pointerdown', this.onPointerDown, true);\n\n for (let event of CANCELED_EVENTS) {\n document.removeEventListener(event, this.cancelEvent, true);\n }\n\n this.mutationObserver.disconnect();\n this.restoreAriaHidden();\n }\n\n onKeyDown(e: KeyboardEvent) {\n this.cancelEvent(e);\n\n if (e.key === 'Escape') {\n this.cancel();\n return;\n }\n\n if (e.key === 'Tab' && !(e.metaKey || e.altKey || e.ctrlKey)) {\n if (e.shiftKey) {\n this.previous();\n } else {\n this.next();\n }\n }\n\n if (typeof this.currentDropTarget?.onKeyDown === 'function') {\n this.currentDropTarget.onKeyDown(e, this.dragTarget);\n }\n }\n\n onKeyUp(e: KeyboardEvent) {\n this.cancelEvent(e);\n\n if (e.key === 'Enter') {\n if (e.altKey) {\n this.activate();\n } else {\n this.drop();\n }\n }\n }\n\n onFocus(e: FocusEvent) {\n // Prevent focus events, except to the original drag target.\n if (e.target !== this.dragTarget.element) {\n this.cancelEvent(e);\n }\n\n // Ignore focus events on the window/document (JSDOM). Will be handled in onBlur, below.\n if (!(e.target instanceof HTMLElement) || e.target === this.dragTarget.element) {\n return;\n }\n\n let dropTarget =\n this.validDropTargets.find(target => target.element === e.target as HTMLElement) ||\n this.validDropTargets.find(target => target.element.contains(e.target as HTMLElement));\n\n if (!dropTarget) {\n if (this.currentDropTarget) {\n this.currentDropTarget.element.focus();\n } else {\n this.dragTarget.element.focus();\n }\n return;\n }\n\n let item = dropItems.get(e.target as HTMLElement);\n this.setCurrentDropTarget(dropTarget, item);\n }\n\n onBlur(e: FocusEvent) {\n if (e.target !== this.dragTarget.element) {\n this.cancelEvent(e);\n }\n\n // If nothing is gaining focus, or e.relatedTarget is the window/document (JSDOM),\n // restore focus back to the current drop target if any, or the original drag target.\n if (!e.relatedTarget || !(e.relatedTarget instanceof HTMLElement)) {\n if (this.currentDropTarget) {\n this.currentDropTarget.element.focus();\n } else {\n this.dragTarget.element.focus();\n }\n }\n }\n\n onClick(e: MouseEvent) {\n this.cancelEvent(e);\n if (isVirtualClick(e) || this.isVirtualClick) {\n if (e.target === this.dragTarget.element) {\n this.cancel();\n return;\n }\n\n let dropTarget = this.validDropTargets.find(target => target.element.contains(e.target as HTMLElement));\n if (dropTarget) {\n let item = dropItems.get(e.target as HTMLElement);\n this.setCurrentDropTarget(dropTarget, item);\n this.drop(item);\n }\n }\n }\n\n onPointerDown(e: PointerEvent) {\n // Android Talkback double tap has e.detail = 1 for onClick. Detect the virtual click in onPointerDown before onClick fires\n // so we can properly perform cancel and drop operations.\n this.cancelEvent(e);\n this.isVirtualClick = isVirtualPointerEvent(e);\n }\n\n cancelEvent(e: Event) {\n // Allow focusin and focusout on the drag target so focus ring works properly.\n if ((e.type === 'focusin' || e.type === 'focusout') && e.target === this.dragTarget?.element) {\n return;\n }\n\n // Allow default for events that might cancel a click event\n if (!CLICK_EVENTS.includes(e.type)) {\n e.preventDefault();\n }\n\n e.stopPropagation();\n e.stopImmediatePropagation();\n }\n\n updateValidDropTargets() {\n if (!this.mutationObserver) {\n return;\n }\n\n this.mutationObserver.disconnect();\n if (this.restoreAriaHidden) {\n this.restoreAriaHidden();\n }\n\n this.validDropTargets = findValidDropTargets(this.dragTarget);\n\n // Shuffle drop target order based on starting drag target.\n if (this.validDropTargets.length > 0) {\n let nearestIndex = this.findNearestDropTarget();\n this.validDropTargets = [\n ...this.validDropTargets.slice(nearestIndex),\n ...this.validDropTargets.slice(0, nearestIndex)\n ];\n }\n\n if (this.currentDropTarget && !this.validDropTargets.includes(this.currentDropTarget)) {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n }\n\n // Find valid drop items within collections\n let types = getTypes(this.dragTarget.items);\n let validDropItems = [...dropItems.values()].filter(item => {\n if (typeof item.getDropOperation === 'function') {\n return item.getDropOperation(types, this.dragTarget.allowedDropOperations) !== 'cancel';\n }\n\n return true;\n });\n\n // Filter out drop targets that contain valid items. We don't want to stop hiding elements\n // other than the drop items that exist inside the collection.\n let visibleDropTargets = this.validDropTargets.filter(target =>\n !validDropItems.some(item => target.element.contains(item.element))\n );\n\n this.restoreAriaHidden = ariaHideOutside([\n this.dragTarget.element,\n ...validDropItems.map(item => item.element),\n ...visibleDropTargets.map(target => target.element)\n ]);\n\n this.mutationObserver.observe(document.body, {subtree: true, attributes: true, attributeFilter: ['aria-hidden']});\n }\n\n next() {\n if (!this.currentDropTarget) {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n return;\n }\n\n let index = this.validDropTargets.indexOf(this.currentDropTarget);\n if (index < 0) {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n return;\n }\n\n // If we've reached the end of the valid drop targets, cycle back to the original drag target.\n // This lets the user cancel the drag in case they don't have an Escape key (e.g. iPad keyboard case).\n if (index === this.validDropTargets.length - 1) {\n if (!this.dragTarget.element.closest('[aria-hidden=\"true\"]')) {\n this.setCurrentDropTarget(null);\n this.dragTarget.element.focus();\n } else {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n }\n } else {\n this.setCurrentDropTarget(this.validDropTargets[index + 1]);\n }\n }\n\n previous() {\n if (!this.currentDropTarget) {\n this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);\n return;\n }\n\n let index = this.validDropTargets.indexOf(this.currentDropTarget);\n if (index < 0) {\n this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);\n return;\n }\n\n // If we've reached the start of the valid drop targets, cycle back to the original drag target.\n // This lets the user cancel the drag in case they don't have an Escape key (e.g. iPad keyboard case).\n if (index === 0) {\n if (!this.dragTarget.element.closest('[aria-hidden=\"true\"]')) {\n this.setCurrentDropTarget(null);\n this.dragTarget.element.focus();\n } else {\n this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);\n }\n } else {\n this.setCurrentDropTarget(this.validDropTargets[index - 1]);\n }\n }\n\n findNearestDropTarget(): number {\n let dragTargetRect = this.dragTarget.element.getBoundingClientRect();\n\n let minDistance = Infinity;\n let nearest = -1;\n for (let i = 0; i < this.validDropTargets.length; i++) {\n let dropTarget = this.validDropTargets[i];\n let rect = dropTarget.element.getBoundingClientRect();\n let dx = rect.left - dragTargetRect.left;\n let dy = rect.top - dragTargetRect.top;\n let dist = (dx * dx) + (dy * dy);\n if (dist < minDistance) {\n minDistance = dist;\n nearest = i;\n }\n }\n\n return nearest;\n }\n\n setCurrentDropTarget(dropTarget: DropTarget, item?: DroppableItem) {\n if (dropTarget !== this.currentDropTarget) {\n if (this.currentDropTarget && typeof this.currentDropTarget.onDropExit === 'function') {\n let rect = this.currentDropTarget.element.getBoundingClientRect();\n this.currentDropTarget.onDropExit({\n type: 'dropexit',\n x: rect.left + (rect.width / 2),\n y: rect.top + (rect.height / 2)\n });\n }\n\n this.currentDropTarget = dropTarget;\n\n if (dropTarget) {\n if (typeof dropTarget.onDropEnter === 'function') {\n let rect = dropTarget.element.getBoundingClientRect();\n dropTarget.onDropEnter({\n type: 'dropenter',\n x: rect.left + (rect.width / 2),\n y: rect.top + (rect.height / 2)\n }, this.dragTarget);\n }\n\n if (!item) {\n dropTarget?.element.focus();\n }\n }\n }\n\n if (item !== this.currentDropItem) {\n if (item && typeof this.currentDropTarget.onDropTargetEnter === 'function') {\n this.currentDropTarget.onDropTargetEnter(item?.target);\n }\n\n item?.element.focus();\n this.currentDropItem = item;\n\n // Announce first drop target after drag start announcement finishes.\n // Otherwise, it will never get announced because drag start announcement is assertive.\n if (!this.initialFocused) {\n let label = item?.element.getAttribute('aria-label');\n if (label) {\n announce(label, 'polite');\n }\n this.initialFocused = true;\n }\n }\n }\n\n end() {\n this.teardown();\n endDragging();\n\n if (typeof this.dragTarget.onDragEnd === 'function') {\n let target = this.currentDropTarget && this.dropOperation !== 'cancel' ? this.currentDropTarget : this.dragTarget;\n let rect = target.element.getBoundingClientRect();\n this.dragTarget.onDragEnd({\n type: 'dragend',\n x: rect.x + (rect.width / 2),\n y: rect.y + (rect.height / 2),\n dropOperation: this.dropOperation || 'cancel'\n });\n }\n\n if (this.currentDropTarget && !this.currentDropTarget.preventFocusOnDrop) {\n // Re-trigger focus event on active element, since it will not have received it during dragging (see cancelEvent).\n // This corrects state such as whether focus ring should appear.\n // useDroppableCollection handles this itself, so this is only for standalone drop zones.\n document.activeElement.dispatchEvent(new FocusEvent('focusin', {bubbles: true}));\n }\n\n this.setCurrentDropTarget(null);\n }\n\n cancel() {\n this.setCurrentDropTarget(null);\n this.end();\n if (!this.dragTarget.element.closest('[aria-hidden=\"true\"]')) {\n this.dragTarget.element.focus();\n }\n\n announce(this.stringFormatter.format('dropCanceled'));\n }\n\n drop(item?: DroppableItem) {\n if (!this.currentDropTarget) {\n this.cancel();\n return;\n }\n\n if (typeof item?.getDropOperation === 'function') {\n let types = getTypes(this.dragTarget.items);\n this.dropOperation = item.getDropOperation(types, this.dragTarget.allowedDropOperations);\n } else if (typeof this.currentDropTarget.getDropOperation === 'function') {\n let types = getTypes(this.dragTarget.items);\n this.dropOperation = this.currentDropTarget.getDropOperation(types, this.dragTarget.allowedDropOperations);\n } else {\n // TODO: show menu ??\n this.dropOperation = this.dragTarget.allowedDropOperations[0];\n }\n\n if (typeof this.currentDropTarget.onDrop === 'function') {\n let items: DropItem[] = this.dragTarget.items.map(item => ({\n kind: 'text',\n types: new Set(Object.keys(item)),\n getText: (type: string) => Promise.resolve(item[type])\n }));\n\n let rect = this.currentDropTarget.element.getBoundingClientRect();\n this.currentDropTarget.onDrop({\n type: 'drop',\n x: rect.left + (rect.width / 2),\n y: rect.top + (rect.height / 2),\n items,\n dropOperation: this.dropOperation\n }, item?.target);\n }\n\n this.end();\n announce(this.stringFormatter.format('dropComplete'));\n }\n\n activate() {\n if (this.currentDropTarget && typeof this.currentDropTarget.onDropActivate === 'function') {\n let rect = this.currentDropTarget.element.getBoundingClientRect();\n this.currentDropTarget.onDropActivate({\n type: 'dropactivate',\n x: rect.left + (rect.width / 2),\n y: rect.top + (rect.height / 2)\n });\n }\n }\n}\n\nfunction findValidDropTargets(options: DragTarget) {\n let types = getTypes(options.items);\n return [...dropTargets.values()].filter(target => {\n if (target.element.closest('[aria-hidden=\"true\"]')) {\n return false;\n }\n\n if (typeof target.getDropOperation === 'function') {\n return target.getDropOperation(types, options.allowedDropOperations) !== 'cancel';\n }\n\n return true;\n });\n}\n"],"names":[],"version":3,"file":"DragManager.main.js.map"}
@@ -321,7 +321,8 @@ class $67560de7c78cb232$var$DragSession {
321
321
  // Announce first drop target after drag start announcement finishes.
322
322
  // Otherwise, it will never get announced because drag start announcement is assertive.
323
323
  if (!this.initialFocused) {
324
- (0, $irqIb$announce)(item === null || item === void 0 ? void 0 : item.element.getAttribute('aria-label'), 'polite');
324
+ let label = item === null || item === void 0 ? void 0 : item.element.getAttribute('aria-label');
325
+ if (label) (0, $irqIb$announce)(label, 'polite');
325
326
  this.initialFocused = true;
326
327
  }
327
328
  }
@@ -321,7 +321,8 @@ class $67560de7c78cb232$var$DragSession {
321
321
  // Announce first drop target after drag start announcement finishes.
322
322
  // Otherwise, it will never get announced because drag start announcement is assertive.
323
323
  if (!this.initialFocused) {
324
- (0, $irqIb$announce)(item === null || item === void 0 ? void 0 : item.element.getAttribute('aria-label'), 'polite');
324
+ let label = item === null || item === void 0 ? void 0 : item.element.getAttribute('aria-label');
325
+ if (label) (0, $irqIb$announce)(label, 'polite');
325
326
  this.initialFocused = true;
326
327
  }
327
328
  }
@@ -1 +1 @@
1
- {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAUD,IAAI,oCAAc,IAAI;AACtB,IAAI,kCAAY,IAAI;AACpB,IAAI,oCAA2B;AAC/B,IAAI,sCAAgB,IAA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obe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {announce} from '@react-aria/live-announcer';\nimport {ariaHideOutside} from '@react-aria/overlays';\nimport {DragEndEvent, DragItem, DropActivateEvent, DropEnterEvent, DropEvent, DropExitEvent, DropItem, DropOperation, DropTarget as DroppableCollectionTarget, FocusableElement} from '@react-types/shared';\nimport {getDragModality, getTypes} from './utils';\nimport {isVirtualClick, isVirtualPointerEvent} from '@react-aria/utils';\nimport type {LocalizedStringFormatter} from '@internationalized/string';\nimport {useEffect, useState} from 'react';\n\nlet dropTargets = new Map<Element, DropTarget>();\nlet dropItems = new Map<Element, DroppableItem>();\nlet dragSession: DragSession = null;\nlet subscriptions = new Set<() => void>();\n\ninterface DropTarget {\n element: FocusableElement,\n preventFocusOnDrop?: boolean,\n getDropOperation?: (types: Set<string>, allowedOperations: DropOperation[]) => DropOperation,\n onDropEnter?: (e: DropEnterEvent, dragTarget: DragTarget) => void,\n onDropExit?: (e: DropExitEvent) => void,\n onDropTargetEnter?: (target?: DroppableCollectionTarget) => void,\n onDropActivate?: (e: DropActivateEvent, target?: DroppableCollectionTarget) => void,\n onDrop?: (e: DropEvent, target?: DroppableCollectionTarget) => void,\n onKeyDown?: (e: KeyboardEvent, dragTarget: DragTarget) => void\n}\n\nexport function registerDropTarget(target: DropTarget) {\n dropTargets.set(target.element, target);\n dragSession?.updateValidDropTargets();\n return () => {\n dropTargets.delete(target.element);\n dragSession?.updateValidDropTargets();\n };\n}\n\ninterface DroppableItem {\n element: FocusableElement,\n target: DroppableCollectionTarget,\n getDropOperation?: (types: Set<string>, allowedOperations: DropOperation[]) => DropOperation\n}\n\nexport function registerDropItem(item: DroppableItem) {\n dropItems.set(item.element, item);\n return () => {\n dropItems.delete(item.element);\n };\n}\n\ninterface DragTarget {\n element: FocusableElement,\n items: DragItem[],\n allowedDropOperations: DropOperation[],\n onDragEnd?: (e: DragEndEvent) => void\n}\n\nexport function beginDragging(target: DragTarget, stringFormatter: LocalizedStringFormatter) {\n if (dragSession) {\n throw new Error('Cannot begin dragging while already dragging');\n }\n\n dragSession = new DragSession(target, stringFormatter);\n requestAnimationFrame(() => {\n dragSession.setup();\n if (getDragModality() === 'keyboard') {\n dragSession.next();\n }\n });\n\n for (let cb of subscriptions) {\n cb();\n }\n}\n\nexport function useDragSession() {\n let [session, setSession] = useState(dragSession);\n\n useEffect(() => {\n let cb = () => setSession(dragSession);\n subscriptions.add(cb);\n return () => {\n subscriptions.delete(cb);\n };\n }, []);\n\n return session;\n}\n\n/** @private */\nexport function isVirtualDragging(): boolean {\n return !!dragSession;\n}\n\nfunction endDragging() {\n dragSession = null;\n for (let cb of subscriptions) {\n cb();\n }\n}\n\nexport function isValidDropTarget(element: Element): boolean {\n for (let target of dropTargets.keys()) {\n if (target.contains(element)) {\n return true;\n }\n }\n\n return false;\n}\n\nconst CANCELED_EVENTS = [\n 'pointerdown',\n 'pointermove',\n 'pointerenter',\n 'pointerleave',\n 'pointerover',\n 'pointerout',\n 'pointerup',\n 'mousedown',\n 'mousemove',\n 'mouseenter',\n 'mouseleave',\n 'mouseover',\n 'mouseout',\n 'mouseup',\n 'touchstart',\n 'touchmove',\n 'touchend',\n 'focusin',\n 'focusout'\n];\n\nconst CLICK_EVENTS = [\n 'pointerup',\n 'mouseup',\n 'touchend'\n];\n\nconst MESSAGES = {\n keyboard: 'dragStartedKeyboard',\n touch: 'dragStartedTouch',\n virtual: 'dragStartedVirtual'\n};\n\nclass DragSession {\n dragTarget: DragTarget;\n validDropTargets: DropTarget[];\n currentDropTarget: DropTarget;\n currentDropItem: DroppableItem;\n dropOperation: DropOperation;\n private mutationObserver: MutationObserver;\n private restoreAriaHidden: () => void;\n private stringFormatter: LocalizedStringFormatter;\n private isVirtualClick: boolean;\n private initialFocused: boolean;\n\n constructor(target: DragTarget, stringFormatter: LocalizedStringFormatter) {\n this.dragTarget = target;\n this.stringFormatter = stringFormatter;\n\n this.onKeyDown = this.onKeyDown.bind(this);\n this.onKeyUp = this.onKeyUp.bind(this);\n this.onFocus = this.onFocus.bind(this);\n this.onBlur = this.onBlur.bind(this);\n this.onClick = this.onClick.bind(this);\n this.onPointerDown = this.onPointerDown.bind(this);\n this.cancelEvent = this.cancelEvent.bind(this);\n this.initialFocused = false;\n }\n\n setup() {\n document.addEventListener('keydown', this.onKeyDown, true);\n document.addEventListener('keyup', this.onKeyUp, true);\n window.addEventListener('focus', this.onFocus, true);\n window.addEventListener('blur', this.onBlur, true);\n document.addEventListener('click', this.onClick, true);\n document.addEventListener('pointerdown', this.onPointerDown, true);\n\n for (let event of CANCELED_EVENTS) {\n document.addEventListener(event, this.cancelEvent, true);\n }\n\n this.mutationObserver = new MutationObserver(() =>\n this.updateValidDropTargets()\n );\n this.updateValidDropTargets();\n\n announce(this.stringFormatter.format(MESSAGES[getDragModality()]));\n }\n\n teardown() {\n document.removeEventListener('keydown', this.onKeyDown, true);\n document.removeEventListener('keyup', this.onKeyUp, true);\n window.removeEventListener('focus', this.onFocus, true);\n window.removeEventListener('blur', this.onBlur, true);\n document.removeEventListener('click', this.onClick, true);\n document.removeEventListener('pointerdown', this.onPointerDown, true);\n\n for (let event of CANCELED_EVENTS) {\n document.removeEventListener(event, this.cancelEvent, true);\n }\n\n this.mutationObserver.disconnect();\n this.restoreAriaHidden();\n }\n\n onKeyDown(e: KeyboardEvent) {\n this.cancelEvent(e);\n\n if (e.key === 'Escape') {\n this.cancel();\n return;\n }\n\n if (e.key === 'Tab' && !(e.metaKey || e.altKey || e.ctrlKey)) {\n if (e.shiftKey) {\n this.previous();\n } else {\n this.next();\n }\n }\n\n if (typeof this.currentDropTarget?.onKeyDown === 'function') {\n this.currentDropTarget.onKeyDown(e, this.dragTarget);\n }\n }\n\n onKeyUp(e: KeyboardEvent) {\n this.cancelEvent(e);\n\n if (e.key === 'Enter') {\n if (e.altKey) {\n this.activate();\n } else {\n this.drop();\n }\n }\n }\n\n onFocus(e: FocusEvent) {\n // Prevent focus events, except to the original drag target.\n if (e.target !== this.dragTarget.element) {\n this.cancelEvent(e);\n }\n\n // Ignore focus events on the window/document (JSDOM). Will be handled in onBlur, below.\n if (!(e.target instanceof HTMLElement) || e.target === this.dragTarget.element) {\n return;\n }\n\n let dropTarget =\n this.validDropTargets.find(target => target.element === e.target as HTMLElement) ||\n this.validDropTargets.find(target => target.element.contains(e.target as HTMLElement));\n\n if (!dropTarget) {\n if (this.currentDropTarget) {\n this.currentDropTarget.element.focus();\n } else {\n this.dragTarget.element.focus();\n }\n return;\n }\n\n let item = dropItems.get(e.target as HTMLElement);\n this.setCurrentDropTarget(dropTarget, item);\n }\n\n onBlur(e: FocusEvent) {\n if (e.target !== this.dragTarget.element) {\n this.cancelEvent(e);\n }\n\n // If nothing is gaining focus, or e.relatedTarget is the window/document (JSDOM),\n // restore focus back to the current drop target if any, or the original drag target.\n if (!e.relatedTarget || !(e.relatedTarget instanceof HTMLElement)) {\n if (this.currentDropTarget) {\n this.currentDropTarget.element.focus();\n } else {\n this.dragTarget.element.focus();\n }\n }\n }\n\n onClick(e: MouseEvent) {\n this.cancelEvent(e);\n if (isVirtualClick(e) || this.isVirtualClick) {\n if (e.target === this.dragTarget.element) {\n this.cancel();\n return;\n }\n\n let dropTarget = this.validDropTargets.find(target => target.element.contains(e.target as HTMLElement));\n if (dropTarget) {\n let item = dropItems.get(e.target as HTMLElement);\n this.setCurrentDropTarget(dropTarget, item);\n this.drop(item);\n }\n }\n }\n\n onPointerDown(e: PointerEvent) {\n // Android Talkback double tap has e.detail = 1 for onClick. Detect the virtual click in onPointerDown before onClick fires\n // so we can properly perform cancel and drop operations.\n this.cancelEvent(e);\n this.isVirtualClick = isVirtualPointerEvent(e);\n }\n\n cancelEvent(e: Event) {\n // Allow focusin and focusout on the drag target so focus ring works properly.\n if ((e.type === 'focusin' || e.type === 'focusout') && e.target === this.dragTarget?.element) {\n return;\n }\n\n // Allow default for events that might cancel a click event\n if (!CLICK_EVENTS.includes(e.type)) {\n e.preventDefault();\n }\n\n e.stopPropagation();\n e.stopImmediatePropagation();\n }\n\n updateValidDropTargets() {\n if (!this.mutationObserver) {\n return;\n }\n\n this.mutationObserver.disconnect();\n if (this.restoreAriaHidden) {\n this.restoreAriaHidden();\n }\n\n this.validDropTargets = findValidDropTargets(this.dragTarget);\n\n // Shuffle drop target order based on starting drag target.\n if (this.validDropTargets.length > 0) {\n let nearestIndex = this.findNearestDropTarget();\n this.validDropTargets = [\n ...this.validDropTargets.slice(nearestIndex),\n ...this.validDropTargets.slice(0, nearestIndex)\n ];\n }\n\n if (this.currentDropTarget && !this.validDropTargets.includes(this.currentDropTarget)) {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n }\n\n // Find valid drop items within collections\n let types = getTypes(this.dragTarget.items);\n let validDropItems = [...dropItems.values()].filter(item => {\n if (typeof item.getDropOperation === 'function') {\n return item.getDropOperation(types, this.dragTarget.allowedDropOperations) !== 'cancel';\n }\n\n return true;\n });\n\n // Filter out drop targets that contain valid items. We don't want to stop hiding elements\n // other than the drop items that exist inside the collection.\n let visibleDropTargets = this.validDropTargets.filter(target =>\n !validDropItems.some(item => target.element.contains(item.element))\n );\n\n this.restoreAriaHidden = ariaHideOutside([\n this.dragTarget.element,\n ...validDropItems.map(item => item.element),\n ...visibleDropTargets.map(target => target.element)\n ]);\n\n this.mutationObserver.observe(document.body, {subtree: true, attributes: true, attributeFilter: ['aria-hidden']});\n }\n\n next() {\n if (!this.currentDropTarget) {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n return;\n }\n\n let index = this.validDropTargets.indexOf(this.currentDropTarget);\n if (index < 0) {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n return;\n }\n\n // If we've reached the end of the valid drop targets, cycle back to the original drag target.\n // This lets the user cancel the drag in case they don't have an Escape key (e.g. iPad keyboard case).\n if (index === this.validDropTargets.length - 1) {\n if (!this.dragTarget.element.closest('[aria-hidden=\"true\"]')) {\n this.setCurrentDropTarget(null);\n this.dragTarget.element.focus();\n } else {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n }\n } else {\n this.setCurrentDropTarget(this.validDropTargets[index + 1]);\n }\n }\n\n previous() {\n if (!this.currentDropTarget) {\n this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);\n return;\n }\n\n let index = this.validDropTargets.indexOf(this.currentDropTarget);\n if (index < 0) {\n this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);\n return;\n }\n\n // If we've reached the start of the valid drop targets, cycle back to the original drag target.\n // This lets the user cancel the drag in case they don't have an Escape key (e.g. iPad keyboard case).\n if (index === 0) {\n if (!this.dragTarget.element.closest('[aria-hidden=\"true\"]')) {\n this.setCurrentDropTarget(null);\n this.dragTarget.element.focus();\n } else {\n this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);\n }\n } else {\n this.setCurrentDropTarget(this.validDropTargets[index - 1]);\n }\n }\n\n findNearestDropTarget(): number {\n let dragTargetRect = this.dragTarget.element.getBoundingClientRect();\n\n let minDistance = Infinity;\n let nearest = -1;\n for (let i = 0; i < this.validDropTargets.length; i++) {\n let dropTarget = this.validDropTargets[i];\n let rect = dropTarget.element.getBoundingClientRect();\n let dx = rect.left - dragTargetRect.left;\n let dy = rect.top - dragTargetRect.top;\n let dist = (dx * dx) + (dy * dy);\n if (dist < minDistance) {\n minDistance = dist;\n nearest = i;\n }\n }\n\n return nearest;\n }\n\n setCurrentDropTarget(dropTarget: DropTarget, item?: DroppableItem) {\n if (dropTarget !== this.currentDropTarget) {\n if (this.currentDropTarget && typeof this.currentDropTarget.onDropExit === 'function') {\n let rect = this.currentDropTarget.element.getBoundingClientRect();\n this.currentDropTarget.onDropExit({\n type: 'dropexit',\n x: rect.left + (rect.width / 2),\n y: rect.top + (rect.height / 2)\n });\n }\n\n this.currentDropTarget = dropTarget;\n\n if (dropTarget) {\n if (typeof dropTarget.onDropEnter === 'function') {\n let rect = dropTarget.element.getBoundingClientRect();\n dropTarget.onDropEnter({\n type: 'dropenter',\n x: rect.left + (rect.width / 2),\n y: rect.top + (rect.height / 2)\n }, this.dragTarget);\n }\n\n if (!item) {\n dropTarget?.element.focus();\n }\n }\n }\n\n if (item !== this.currentDropItem) {\n if (item && typeof this.currentDropTarget.onDropTargetEnter === 'function') {\n this.currentDropTarget.onDropTargetEnter(item?.target);\n }\n\n item?.element.focus();\n this.currentDropItem = item;\n\n // Announce first drop target after drag start announcement finishes.\n // Otherwise, it will never get announced because drag start announcement is assertive.\n if (!this.initialFocused) {\n announce(item?.element.getAttribute('aria-label'), 'polite');\n this.initialFocused = true;\n }\n }\n }\n\n end() {\n this.teardown();\n endDragging();\n\n if (typeof this.dragTarget.onDragEnd === 'function') {\n let target = this.currentDropTarget && this.dropOperation !== 'cancel' ? this.currentDropTarget : this.dragTarget;\n let rect = target.element.getBoundingClientRect();\n this.dragTarget.onDragEnd({\n type: 'dragend',\n x: rect.x + (rect.width / 2),\n y: rect.y + (rect.height / 2),\n dropOperation: this.dropOperation || 'cancel'\n });\n }\n\n if (this.currentDropTarget && !this.currentDropTarget.preventFocusOnDrop) {\n // Re-trigger focus event on active element, since it will not have received it during dragging (see cancelEvent).\n // This corrects state such as whether focus ring should appear.\n // useDroppableCollection handles this itself, so this is only for standalone drop zones.\n document.activeElement.dispatchEvent(new FocusEvent('focusin', {bubbles: true}));\n }\n\n this.setCurrentDropTarget(null);\n }\n\n cancel() {\n this.setCurrentDropTarget(null);\n this.end();\n if (!this.dragTarget.element.closest('[aria-hidden=\"true\"]')) {\n this.dragTarget.element.focus();\n }\n\n announce(this.stringFormatter.format('dropCanceled'));\n }\n\n drop(item?: DroppableItem) {\n if (!this.currentDropTarget) {\n this.cancel();\n return;\n }\n\n if (typeof item?.getDropOperation === 'function') {\n let types = getTypes(this.dragTarget.items);\n this.dropOperation = item.getDropOperation(types, this.dragTarget.allowedDropOperations);\n } else if (typeof this.currentDropTarget.getDropOperation === 'function') {\n let types = getTypes(this.dragTarget.items);\n this.dropOperation = this.currentDropTarget.getDropOperation(types, this.dragTarget.allowedDropOperations);\n } else {\n // TODO: show menu ??\n this.dropOperation = this.dragTarget.allowedDropOperations[0];\n }\n\n if (typeof this.currentDropTarget.onDrop === 'function') {\n let items: DropItem[] = this.dragTarget.items.map(item => ({\n kind: 'text',\n types: new Set(Object.keys(item)),\n getText: (type: string) => Promise.resolve(item[type])\n }));\n\n let rect = this.currentDropTarget.element.getBoundingClientRect();\n this.currentDropTarget.onDrop({\n type: 'drop',\n x: rect.left + (rect.width / 2),\n y: rect.top + (rect.height / 2),\n items,\n dropOperation: this.dropOperation\n }, item?.target);\n }\n\n this.end();\n announce(this.stringFormatter.format('dropComplete'));\n }\n\n activate() {\n if (this.currentDropTarget && typeof this.currentDropTarget.onDropActivate === 'function') {\n let rect = this.currentDropTarget.element.getBoundingClientRect();\n this.currentDropTarget.onDropActivate({\n type: 'dropactivate',\n x: rect.left + (rect.width / 2),\n y: rect.top + (rect.height / 2)\n });\n }\n }\n}\n\nfunction findValidDropTargets(options: DragTarget) {\n let types = getTypes(options.items);\n return [...dropTargets.values()].filter(target => {\n if (target.element.closest('[aria-hidden=\"true\"]')) {\n return false;\n }\n\n if (typeof target.getDropOperation === 'function') {\n return target.getDropOperation(types, options.allowedDropOperations) !== 'cancel';\n }\n\n return true;\n });\n}\n"],"names":[],"version":3,"file":"DragManager.module.js.map"}
1
+ {"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAUD,IAAI,oCAAc,IAAI;AACtB,IAAI,kCAAY,IAAI;AACpB,IAAI,oCAA2B;AAC/B,IAAI,sCAAgB,IAAI;AAcjB,SAAS,0CAAmB,MAAkB;IACnD,kCAAY,GAAG,CAAC,OAAO,O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CAAC,iBAAiB,CAAC,cAAc,CAAC;gBACpC,MAAM;gBACN,GAAG,KAAK,IAAI,GAAI,KAAK,KAAK,GAAG;gBAC7B,GAAG,KAAK,GAAG,GAAI,KAAK,MAAM,GAAG;YAC/B;QACF;IACF;IAnaA,YAAY,MAAkB,EAAE,eAAyC,CAAE;QACzE,IAAI,CAAC,UAAU,GAAG;QAClB,IAAI,CAAC,eAAe,GAAG;QAEvB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI;QACzC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI;QACrC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI;QACrC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI;QACnC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI;QACrC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI;QACjD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI;QAC7C,IAAI,CAAC,cAAc,GAAG;IACxB;AAwZF;AAEA,SAAS,2CAAqB,OAAmB;IAC/C,IAAI,QAAQ,CAAA,GAAA,yCAAO,EAAE,QAAQ,KAAK;IAClC,OAAO;WAAI,kCAAY,MAAM;KAAG,CAAC,MAAM,CAAC,CAAA;QACtC,IAAI,OAAO,OAAO,CAAC,OAAO,CAAC,yBACzB,OAAO;QAGT,IAAI,OAAO,OAAO,gBAAgB,KAAK,YACrC,OAAO,OAAO,gBAAgB,CAAC,OAAO,QAAQ,qBAAqB,MAAM;QAG3E,OAAO;IACT;AACF","sources":["packages/@react-aria/dnd/src/DragManager.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {announce} from '@react-aria/live-announcer';\nimport {ariaHideOutside} from '@react-aria/overlays';\nimport {DragEndEvent, DragItem, DropActivateEvent, DropEnterEvent, DropEvent, DropExitEvent, DropItem, DropOperation, DropTarget as DroppableCollectionTarget, FocusableElement} from '@react-types/shared';\nimport {getDragModality, getTypes} from './utils';\nimport {isVirtualClick, isVirtualPointerEvent} from '@react-aria/utils';\nimport type {LocalizedStringFormatter} from '@internationalized/string';\nimport {useEffect, useState} from 'react';\n\nlet dropTargets = new Map<Element, DropTarget>();\nlet dropItems = new Map<Element, DroppableItem>();\nlet dragSession: DragSession = null;\nlet subscriptions = new Set<() => void>();\n\ninterface DropTarget {\n element: FocusableElement,\n preventFocusOnDrop?: boolean,\n getDropOperation?: (types: Set<string>, allowedOperations: DropOperation[]) => DropOperation,\n onDropEnter?: (e: DropEnterEvent, dragTarget: DragTarget) => void,\n onDropExit?: (e: DropExitEvent) => void,\n onDropTargetEnter?: (target?: DroppableCollectionTarget) => void,\n onDropActivate?: (e: DropActivateEvent, target?: DroppableCollectionTarget) => void,\n onDrop?: (e: DropEvent, target?: DroppableCollectionTarget) => void,\n onKeyDown?: (e: KeyboardEvent, dragTarget: DragTarget) => void\n}\n\nexport function registerDropTarget(target: DropTarget) {\n dropTargets.set(target.element, target);\n dragSession?.updateValidDropTargets();\n return () => {\n dropTargets.delete(target.element);\n dragSession?.updateValidDropTargets();\n };\n}\n\ninterface DroppableItem {\n element: FocusableElement,\n target: DroppableCollectionTarget,\n getDropOperation?: (types: Set<string>, allowedOperations: DropOperation[]) => DropOperation\n}\n\nexport function registerDropItem(item: DroppableItem) {\n dropItems.set(item.element, item);\n return () => {\n dropItems.delete(item.element);\n };\n}\n\ninterface DragTarget {\n element: FocusableElement,\n items: DragItem[],\n allowedDropOperations: DropOperation[],\n onDragEnd?: (e: DragEndEvent) => void\n}\n\nexport function beginDragging(target: DragTarget, stringFormatter: LocalizedStringFormatter) {\n if (dragSession) {\n throw new Error('Cannot begin dragging while already dragging');\n }\n\n dragSession = new DragSession(target, stringFormatter);\n requestAnimationFrame(() => {\n dragSession.setup();\n if (getDragModality() === 'keyboard') {\n dragSession.next();\n }\n });\n\n for (let cb of subscriptions) {\n cb();\n }\n}\n\nexport function useDragSession() {\n let [session, setSession] = useState(dragSession);\n\n useEffect(() => {\n let cb = () => setSession(dragSession);\n subscriptions.add(cb);\n return () => {\n subscriptions.delete(cb);\n };\n }, []);\n\n return session;\n}\n\n/** @private */\nexport function isVirtualDragging(): boolean {\n return !!dragSession;\n}\n\nfunction endDragging() {\n dragSession = null;\n for (let cb of subscriptions) {\n cb();\n }\n}\n\nexport function isValidDropTarget(element: Element): boolean {\n for (let target of dropTargets.keys()) {\n if (target.contains(element)) {\n return true;\n }\n }\n\n return false;\n}\n\nconst CANCELED_EVENTS = [\n 'pointerdown',\n 'pointermove',\n 'pointerenter',\n 'pointerleave',\n 'pointerover',\n 'pointerout',\n 'pointerup',\n 'mousedown',\n 'mousemove',\n 'mouseenter',\n 'mouseleave',\n 'mouseover',\n 'mouseout',\n 'mouseup',\n 'touchstart',\n 'touchmove',\n 'touchend',\n 'focusin',\n 'focusout'\n];\n\nconst CLICK_EVENTS = [\n 'pointerup',\n 'mouseup',\n 'touchend'\n];\n\nconst MESSAGES = {\n keyboard: 'dragStartedKeyboard',\n touch: 'dragStartedTouch',\n virtual: 'dragStartedVirtual'\n};\n\nclass DragSession {\n dragTarget: DragTarget;\n validDropTargets: DropTarget[];\n currentDropTarget: DropTarget;\n currentDropItem: DroppableItem;\n dropOperation: DropOperation;\n private mutationObserver: MutationObserver;\n private restoreAriaHidden: () => void;\n private stringFormatter: LocalizedStringFormatter;\n private isVirtualClick: boolean;\n private initialFocused: boolean;\n\n constructor(target: DragTarget, stringFormatter: LocalizedStringFormatter) {\n this.dragTarget = target;\n this.stringFormatter = stringFormatter;\n\n this.onKeyDown = this.onKeyDown.bind(this);\n this.onKeyUp = this.onKeyUp.bind(this);\n this.onFocus = this.onFocus.bind(this);\n this.onBlur = this.onBlur.bind(this);\n this.onClick = this.onClick.bind(this);\n this.onPointerDown = this.onPointerDown.bind(this);\n this.cancelEvent = this.cancelEvent.bind(this);\n this.initialFocused = false;\n }\n\n setup() {\n document.addEventListener('keydown', this.onKeyDown, true);\n document.addEventListener('keyup', this.onKeyUp, true);\n window.addEventListener('focus', this.onFocus, true);\n window.addEventListener('blur', this.onBlur, true);\n document.addEventListener('click', this.onClick, true);\n document.addEventListener('pointerdown', this.onPointerDown, true);\n\n for (let event of CANCELED_EVENTS) {\n document.addEventListener(event, this.cancelEvent, true);\n }\n\n this.mutationObserver = new MutationObserver(() =>\n this.updateValidDropTargets()\n );\n this.updateValidDropTargets();\n\n announce(this.stringFormatter.format(MESSAGES[getDragModality()]));\n }\n\n teardown() {\n document.removeEventListener('keydown', this.onKeyDown, true);\n document.removeEventListener('keyup', this.onKeyUp, true);\n window.removeEventListener('focus', this.onFocus, true);\n window.removeEventListener('blur', this.onBlur, true);\n document.removeEventListener('click', this.onClick, true);\n document.removeEventListener('pointerdown', this.onPointerDown, true);\n\n for (let event of CANCELED_EVENTS) {\n document.removeEventListener(event, this.cancelEvent, true);\n }\n\n this.mutationObserver.disconnect();\n this.restoreAriaHidden();\n }\n\n onKeyDown(e: KeyboardEvent) {\n this.cancelEvent(e);\n\n if (e.key === 'Escape') {\n this.cancel();\n return;\n }\n\n if (e.key === 'Tab' && !(e.metaKey || e.altKey || e.ctrlKey)) {\n if (e.shiftKey) {\n this.previous();\n } else {\n this.next();\n }\n }\n\n if (typeof this.currentDropTarget?.onKeyDown === 'function') {\n this.currentDropTarget.onKeyDown(e, this.dragTarget);\n }\n }\n\n onKeyUp(e: KeyboardEvent) {\n this.cancelEvent(e);\n\n if (e.key === 'Enter') {\n if (e.altKey) {\n this.activate();\n } else {\n this.drop();\n }\n }\n }\n\n onFocus(e: FocusEvent) {\n // Prevent focus events, except to the original drag target.\n if (e.target !== this.dragTarget.element) {\n this.cancelEvent(e);\n }\n\n // Ignore focus events on the window/document (JSDOM). Will be handled in onBlur, below.\n if (!(e.target instanceof HTMLElement) || e.target === this.dragTarget.element) {\n return;\n }\n\n let dropTarget =\n this.validDropTargets.find(target => target.element === e.target as HTMLElement) ||\n this.validDropTargets.find(target => target.element.contains(e.target as HTMLElement));\n\n if (!dropTarget) {\n if (this.currentDropTarget) {\n this.currentDropTarget.element.focus();\n } else {\n this.dragTarget.element.focus();\n }\n return;\n }\n\n let item = dropItems.get(e.target as HTMLElement);\n this.setCurrentDropTarget(dropTarget, item);\n }\n\n onBlur(e: FocusEvent) {\n if (e.target !== this.dragTarget.element) {\n this.cancelEvent(e);\n }\n\n // If nothing is gaining focus, or e.relatedTarget is the window/document (JSDOM),\n // restore focus back to the current drop target if any, or the original drag target.\n if (!e.relatedTarget || !(e.relatedTarget instanceof HTMLElement)) {\n if (this.currentDropTarget) {\n this.currentDropTarget.element.focus();\n } else {\n this.dragTarget.element.focus();\n }\n }\n }\n\n onClick(e: MouseEvent) {\n this.cancelEvent(e);\n if (isVirtualClick(e) || this.isVirtualClick) {\n if (e.target === this.dragTarget.element) {\n this.cancel();\n return;\n }\n\n let dropTarget = this.validDropTargets.find(target => target.element.contains(e.target as HTMLElement));\n if (dropTarget) {\n let item = dropItems.get(e.target as HTMLElement);\n this.setCurrentDropTarget(dropTarget, item);\n this.drop(item);\n }\n }\n }\n\n onPointerDown(e: PointerEvent) {\n // Android Talkback double tap has e.detail = 1 for onClick. Detect the virtual click in onPointerDown before onClick fires\n // so we can properly perform cancel and drop operations.\n this.cancelEvent(e);\n this.isVirtualClick = isVirtualPointerEvent(e);\n }\n\n cancelEvent(e: Event) {\n // Allow focusin and focusout on the drag target so focus ring works properly.\n if ((e.type === 'focusin' || e.type === 'focusout') && e.target === this.dragTarget?.element) {\n return;\n }\n\n // Allow default for events that might cancel a click event\n if (!CLICK_EVENTS.includes(e.type)) {\n e.preventDefault();\n }\n\n e.stopPropagation();\n e.stopImmediatePropagation();\n }\n\n updateValidDropTargets() {\n if (!this.mutationObserver) {\n return;\n }\n\n this.mutationObserver.disconnect();\n if (this.restoreAriaHidden) {\n this.restoreAriaHidden();\n }\n\n this.validDropTargets = findValidDropTargets(this.dragTarget);\n\n // Shuffle drop target order based on starting drag target.\n if (this.validDropTargets.length > 0) {\n let nearestIndex = this.findNearestDropTarget();\n this.validDropTargets = [\n ...this.validDropTargets.slice(nearestIndex),\n ...this.validDropTargets.slice(0, nearestIndex)\n ];\n }\n\n if (this.currentDropTarget && !this.validDropTargets.includes(this.currentDropTarget)) {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n }\n\n // Find valid drop items within collections\n let types = getTypes(this.dragTarget.items);\n let validDropItems = [...dropItems.values()].filter(item => {\n if (typeof item.getDropOperation === 'function') {\n return item.getDropOperation(types, this.dragTarget.allowedDropOperations) !== 'cancel';\n }\n\n return true;\n });\n\n // Filter out drop targets that contain valid items. We don't want to stop hiding elements\n // other than the drop items that exist inside the collection.\n let visibleDropTargets = this.validDropTargets.filter(target =>\n !validDropItems.some(item => target.element.contains(item.element))\n );\n\n this.restoreAriaHidden = ariaHideOutside([\n this.dragTarget.element,\n ...validDropItems.map(item => item.element),\n ...visibleDropTargets.map(target => target.element)\n ]);\n\n this.mutationObserver.observe(document.body, {subtree: true, attributes: true, attributeFilter: ['aria-hidden']});\n }\n\n next() {\n if (!this.currentDropTarget) {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n return;\n }\n\n let index = this.validDropTargets.indexOf(this.currentDropTarget);\n if (index < 0) {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n return;\n }\n\n // If we've reached the end of the valid drop targets, cycle back to the original drag target.\n // This lets the user cancel the drag in case they don't have an Escape key (e.g. iPad keyboard case).\n if (index === this.validDropTargets.length - 1) {\n if (!this.dragTarget.element.closest('[aria-hidden=\"true\"]')) {\n this.setCurrentDropTarget(null);\n this.dragTarget.element.focus();\n } else {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n }\n } else {\n this.setCurrentDropTarget(this.validDropTargets[index + 1]);\n }\n }\n\n previous() {\n if (!this.currentDropTarget) {\n this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);\n return;\n }\n\n let index = this.validDropTargets.indexOf(this.currentDropTarget);\n if (index < 0) {\n this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);\n return;\n }\n\n // If we've reached the start of the valid drop targets, cycle back to the original drag target.\n // This lets the user cancel the drag in case they don't have an Escape key (e.g. iPad keyboard case).\n if (index === 0) {\n if (!this.dragTarget.element.closest('[aria-hidden=\"true\"]')) {\n this.setCurrentDropTarget(null);\n this.dragTarget.element.focus();\n } else {\n this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);\n }\n } else {\n this.setCurrentDropTarget(this.validDropTargets[index - 1]);\n }\n }\n\n findNearestDropTarget(): number {\n let dragTargetRect = this.dragTarget.element.getBoundingClientRect();\n\n let minDistance = Infinity;\n let nearest = -1;\n for (let i = 0; i < this.validDropTargets.length; i++) {\n let dropTarget = this.validDropTargets[i];\n let rect = dropTarget.element.getBoundingClientRect();\n let dx = rect.left - dragTargetRect.left;\n let dy = rect.top - dragTargetRect.top;\n let dist = (dx * dx) + (dy * dy);\n if (dist < minDistance) {\n minDistance = dist;\n nearest = i;\n }\n }\n\n return nearest;\n }\n\n setCurrentDropTarget(dropTarget: DropTarget, item?: DroppableItem) {\n if (dropTarget !== this.currentDropTarget) {\n if (this.currentDropTarget && typeof this.currentDropTarget.onDropExit === 'function') {\n let rect = this.currentDropTarget.element.getBoundingClientRect();\n this.currentDropTarget.onDropExit({\n type: 'dropexit',\n x: rect.left + (rect.width / 2),\n y: rect.top + (rect.height / 2)\n });\n }\n\n this.currentDropTarget = dropTarget;\n\n if (dropTarget) {\n if (typeof dropTarget.onDropEnter === 'function') {\n let rect = dropTarget.element.getBoundingClientRect();\n dropTarget.onDropEnter({\n type: 'dropenter',\n x: rect.left + (rect.width / 2),\n y: rect.top + (rect.height / 2)\n }, this.dragTarget);\n }\n\n if (!item) {\n dropTarget?.element.focus();\n }\n }\n }\n\n if (item !== this.currentDropItem) {\n if (item && typeof this.currentDropTarget.onDropTargetEnter === 'function') {\n this.currentDropTarget.onDropTargetEnter(item?.target);\n }\n\n item?.element.focus();\n this.currentDropItem = item;\n\n // Announce first drop target after drag start announcement finishes.\n // Otherwise, it will never get announced because drag start announcement is assertive.\n if (!this.initialFocused) {\n let label = item?.element.getAttribute('aria-label');\n if (label) {\n announce(label, 'polite');\n }\n this.initialFocused = true;\n }\n }\n }\n\n end() {\n this.teardown();\n endDragging();\n\n if (typeof this.dragTarget.onDragEnd === 'function') {\n let target = this.currentDropTarget && this.dropOperation !== 'cancel' ? this.currentDropTarget : this.dragTarget;\n let rect = target.element.getBoundingClientRect();\n this.dragTarget.onDragEnd({\n type: 'dragend',\n x: rect.x + (rect.width / 2),\n y: rect.y + (rect.height / 2),\n dropOperation: this.dropOperation || 'cancel'\n });\n }\n\n if (this.currentDropTarget && !this.currentDropTarget.preventFocusOnDrop) {\n // Re-trigger focus event on active element, since it will not have received it during dragging (see cancelEvent).\n // This corrects state such as whether focus ring should appear.\n // useDroppableCollection handles this itself, so this is only for standalone drop zones.\n document.activeElement.dispatchEvent(new FocusEvent('focusin', {bubbles: true}));\n }\n\n this.setCurrentDropTarget(null);\n }\n\n cancel() {\n this.setCurrentDropTarget(null);\n this.end();\n if (!this.dragTarget.element.closest('[aria-hidden=\"true\"]')) {\n this.dragTarget.element.focus();\n }\n\n announce(this.stringFormatter.format('dropCanceled'));\n }\n\n drop(item?: DroppableItem) {\n if (!this.currentDropTarget) {\n this.cancel();\n return;\n }\n\n if (typeof item?.getDropOperation === 'function') {\n let types = getTypes(this.dragTarget.items);\n this.dropOperation = item.getDropOperation(types, this.dragTarget.allowedDropOperations);\n } else if (typeof this.currentDropTarget.getDropOperation === 'function') {\n let types = getTypes(this.dragTarget.items);\n this.dropOperation = this.currentDropTarget.getDropOperation(types, this.dragTarget.allowedDropOperations);\n } else {\n // TODO: show menu ??\n this.dropOperation = this.dragTarget.allowedDropOperations[0];\n }\n\n if (typeof this.currentDropTarget.onDrop === 'function') {\n let items: DropItem[] = this.dragTarget.items.map(item => ({\n kind: 'text',\n types: new Set(Object.keys(item)),\n getText: (type: string) => Promise.resolve(item[type])\n }));\n\n let rect = this.currentDropTarget.element.getBoundingClientRect();\n this.currentDropTarget.onDrop({\n type: 'drop',\n x: rect.left + (rect.width / 2),\n y: rect.top + (rect.height / 2),\n items,\n dropOperation: this.dropOperation\n }, item?.target);\n }\n\n this.end();\n announce(this.stringFormatter.format('dropComplete'));\n }\n\n activate() {\n if (this.currentDropTarget && typeof this.currentDropTarget.onDropActivate === 'function') {\n let rect = this.currentDropTarget.element.getBoundingClientRect();\n this.currentDropTarget.onDropActivate({\n type: 'dropactivate',\n x: rect.left + (rect.width / 2),\n y: rect.top + (rect.height / 2)\n });\n }\n }\n}\n\nfunction findValidDropTargets(options: DragTarget) {\n let types = getTypes(options.items);\n return [...dropTargets.values()].filter(target => {\n if (target.element.closest('[aria-hidden=\"true\"]')) {\n return false;\n }\n\n if (typeof target.getDropOperation === 'function') {\n return target.getDropOperation(types, options.allowedDropOperations) !== 'cancel';\n }\n\n return true;\n });\n}\n"],"names":[],"version":3,"file":"DragManager.module.js.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-aria/dnd",
3
- "version": "3.7.3-nightly.5042+68403fe55",
3
+ "version": "3.7.4",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -22,15 +22,15 @@
22
22
  "url": "https://github.com/adobe/react-spectrum"
23
23
  },
24
24
  "dependencies": {
25
- "@internationalized/string": "3.2.4-nightly.5042+68403fe55",
26
- "@react-aria/i18n": "3.0.0-nightly.3114+68403fe55",
27
- "@react-aria/interactions": "3.0.0-nightly.3114+68403fe55",
28
- "@react-aria/live-announcer": "3.0.0-nightly.3114+68403fe55",
29
- "@react-aria/overlays": "3.0.0-nightly.3114+68403fe55",
30
- "@react-aria/utils": "3.0.0-nightly.3114+68403fe55",
31
- "@react-stately/dnd": "3.4.3-nightly.5042+68403fe55",
32
- "@react-types/button": "3.9.7-nightly.5042+68403fe55",
33
- "@react-types/shared": "3.0.0-nightly.3114+68403fe55",
25
+ "@internationalized/string": "^3.2.4",
26
+ "@react-aria/i18n": "^3.12.3",
27
+ "@react-aria/interactions": "^3.22.4",
28
+ "@react-aria/live-announcer": "^3.4.0",
29
+ "@react-aria/overlays": "^3.23.4",
30
+ "@react-aria/utils": "^3.25.3",
31
+ "@react-stately/dnd": "^3.4.3",
32
+ "@react-types/button": "^3.10.0",
33
+ "@react-types/shared": "^3.25.0",
34
34
  "@swc/helpers": "^0.5.0"
35
35
  },
36
36
  "peerDependencies": {
@@ -40,5 +40,5 @@
40
40
  "publishConfig": {
41
41
  "access": "public"
42
42
  },
43
- "gitHead": "68403fe55489dce3de1b3094c957d598ad719861"
43
+ "gitHead": "8e0a28d188cdbdbd2b32296fa034b1b02ddde229"
44
44
  }
@@ -492,7 +492,10 @@ class DragSession {
492
492
  // Announce first drop target after drag start announcement finishes.
493
493
  // Otherwise, it will never get announced because drag start announcement is assertive.
494
494
  if (!this.initialFocused) {
495
- announce(item?.element.getAttribute('aria-label'), 'polite');
495
+ let label = item?.element.getAttribute('aria-label');
496
+ if (label) {
497
+ announce(label, 'polite');
498
+ }
496
499
  this.initialFocused = true;
497
500
  }
498
501
  }