@react-aria/dnd 3.11.3 → 3.11.5
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/DragManager.main.js +13 -9
- package/dist/DragManager.main.js.map +1 -1
- package/dist/DragManager.mjs +14 -10
- package/dist/DragManager.module.js +14 -10
- package/dist/DragManager.module.js.map +1 -1
- package/dist/DragPreview.main.js +1 -1
- package/dist/DragPreview.main.js.map +1 -1
- package/dist/DragPreview.mjs +1 -1
- package/dist/DragPreview.module.js +1 -1
- package/dist/DragPreview.module.js.map +1 -1
- package/dist/DropTargetKeyboardNavigation.main.js +11 -7
- package/dist/DropTargetKeyboardNavigation.main.js.map +1 -1
- package/dist/DropTargetKeyboardNavigation.mjs +11 -7
- package/dist/DropTargetKeyboardNavigation.module.js +11 -7
- package/dist/DropTargetKeyboardNavigation.module.js.map +1 -1
- package/dist/ListDropTargetDelegate.main.js +3 -0
- package/dist/ListDropTargetDelegate.main.js.map +1 -1
- package/dist/ListDropTargetDelegate.mjs +3 -0
- package/dist/ListDropTargetDelegate.module.js +3 -0
- package/dist/ListDropTargetDelegate.module.js.map +1 -1
- package/dist/es-ES.main.js +3 -3
- package/dist/es-ES.main.js.map +1 -1
- package/dist/es-ES.mjs +3 -3
- package/dist/es-ES.module.js +3 -3
- package/dist/es-ES.module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/useClipboard.main.js +1 -7
- package/dist/useClipboard.main.js.map +1 -1
- package/dist/useClipboard.mjs +1 -7
- package/dist/useClipboard.module.js +1 -7
- package/dist/useClipboard.module.js.map +1 -1
- package/dist/useDrop.main.js +2 -7
- package/dist/useDrop.main.js.map +1 -1
- package/dist/useDrop.mjs +3 -8
- package/dist/useDrop.module.js +3 -8
- package/dist/useDrop.module.js.map +1 -1
- package/package.json +10 -10
- package/src/DragManager.ts +11 -8
- package/src/DragPreview.tsx +1 -1
- package/src/DropTargetKeyboardNavigation.ts +17 -8
- package/src/ListDropT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CAAC,SAAS,YAAY,KAAuB,EAAE,GAA6C;IAC1G,IAAI,SAAS,MAAM,QAAQ;IAC3B,IAAI,CAAC,UAAU,YAAY,GAAG,CAAA,GAAA,qBAAO,EAAsB;IAC3D,IAAI,SAAS,CAAA,GAAA,mBAAK,EAAyB;IAC3C,IAAI,MAAM,CAAA,GAAA,mBAAK,EAAwD;IAEvE,CAAA,GAAA,gCAAkB,EAAE,KAAK,IAAM,CAAC,OAAmB;YACjD,qFAAqF;YACrF,kGAAkG;YAElG,IAAI,SAAS,OAAO;YACpB,IAAI;YACJ,IAAI;YACJ,IAAI;YAEJ,IAAI,UAAU,OAAO,WAAW,YAAY,aAAa,QAAQ;gBAC/D,UAAU,OAAO,OAAO;gBACxB,UAAU,OAAO,CAAC;gBAClB,UAAU,OAAO,CAAC;YACpB,OACE,UAAU;YAGZ,CAAA,GAAA,yBAAQ,EAAE;gBACR,YAAY;YACd;YAEA,+CAA+C;YAC/C,SAAS,OAAO,OAAO,EAAE,SAAS;YAElC,kFAAkF;YAClF,IAAI,OAAO,GAAG,sBAAsB;gBAClC,YAAY;YACd;QACF,GAAG;QAAC;KAAO;IAEX,CAAA,GAAA,sBAAQ,EAAE;QACR,OAAO;YACL,IAAI,IAAI,OAAO,EACb,qBAAqB,IAAI,OAAO;QAEpC;IACF,GAAG,EAAE;IAEL,IAAI,CAAC,UACH,OAAO;IAGT,qBACE,0DAAC;QAAI,OAAO;YAAC,QAAQ;YAAM,UAAU;YAAS,KAAK;YAAG,MAAM;QAAO;QAAG,KAAK;OACxE;AAGP","sources":["packages/@react-aria/dnd/src/DragPreview.tsx"],"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 {DragItem, DragPreviewRenderer} from '@react-types/shared';\nimport {flushSync} from 'react-dom';\nimport React, {ForwardedRef, JSX, useEffect, useImperativeHandle, useRef, useState} from 'react';\n\nexport interface DragPreviewProps {\n /**\n * A render function which returns a preview element, or an object containing the element\n * and a custom offset. If an object is returned, the provided `x` and `y` values will be\n * used as the drag preview offset instead of the default calculation.\n */\n children: (items: DragItem[]) => JSX.Element | {element: JSX.Element, x: number, y: number} | null\n}\n\nexport const DragPreview:\n React.ForwardRefExoticComponent<DragPreviewProps & React.RefAttributes<DragPreviewRenderer | null>> =\nReact.forwardRef(function DragPreview(props: DragPreviewProps, ref: ForwardedRef<DragPreviewRenderer | null>) {\n let render = props.children;\n let [children, setChildren] = useState<JSX.Element | null>(null);\n let domRef = useRef<HTMLDivElement | null>(null);\n let raf = useRef<ReturnType<typeof requestAnimationFrame> | undefined>(undefined);\n\n useImperativeHandle(ref, () => (items: DragItem[], callback: (node: HTMLElement | null, x?: number, y?: number) => void) => {\n // This will be called during the onDragStart event by useDrag. We need to render the\n // preview synchronously before this event returns so we can call event.dataTransfer.setDragImage.\n\n let result = render(items);\n let element: JSX.Element | null;\n let offsetX: number | undefined;\n let offsetY: number | undefined;\n\n if (result && typeof result === 'object' && 'element' in result) {\n element = result.element;\n offsetX = result.x;\n offsetY = result.y;\n } else {\n element = result as JSX.Element | null;\n }\n\n flushSync(() => {\n setChildren(element);\n });\n\n // Yield back to useDrag to set the drag image.\n callback(domRef.current, offsetX, offsetY);\n\n // Remove the preview from the DOM after a frame so the browser has time to paint.\n raf.current = requestAnimationFrame(() => {\n setChildren(null);\n });\n }, [render]);\n\n useEffect(() => {\n return () => {\n if (raf.current) {\n cancelAnimationFrame(raf.current);\n }\n };\n }, []);\n\n if (!children) {\n return null;\n }\n\n return (\n <div style={{zIndex: -100, position: 'fixed', top: 0, left: -100000}} ref={domRef}>\n {children}\n </div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IAC1G,IAAI,SAAS,MAAM,QAAQ;IAC3B,IAAI,CAAC,UAAU,YAAY,GAAG,CAAA,GAAA,eAAO,EAAsB;IAC3D,IAAI,SAAS,CAAA,GAAA,aAAK,EAAyB;IAC3C,IAAI,MAAM,CAAA,GAAA,aAAK,EAAwD;IAEvE,CAAA,GAAA,0BAAkB,EAAE,KAAK,IAAM,CAAC,OAAmB;YACjD,qFAAqF;YACrF,kGAAkG;YAElG,IAAI,SAAS,OAAO;YACpB,IAAI;YACJ,IAAI;YACJ,IAAI;YAEJ,IAAI,UAAU,OAAO,WAAW,YAAY,aAAa,QAAQ;gBAC/D,UAAU,OAAO,OAAO;gBACxB,UAAU,OAAO,CAAC;gBAClB,UAAU,OAAO,CAAC;YACpB,OACE,UAAU;YAGZ,CAAA,GAAA,gBAAQ,EAAE;gBACR,YAAY;YACd;YAEA,+CAA+C;YAC/C,SAAS,OAAO,OAAO,EAAE,SAAS;YAElC,kFAAkF;YAClF,IAAI,OAAO,GAAG,sBAAsB;gBAClC,YAAY;YACd;QACF,GAAG;QAAC;KAAO;IAEX,CAAA,GAAA,gBAAQ,EAAE;QACR,OAAO;YACL,IAAI,IAAI,OAAO,EACb,qBAAqB,IAAI,OAAO;QAEpC;IACF,GAAG,EAAE;IAEL,IAAI,CAAC,UACH,OAAO;IAGT,qBACE,gCAAC;QAAI,OAAO;YAAC,QAAQ;YAAM,UAAU;YAAS,KAAK;YAAG,MAAM;QAAO;QAAG,KAAK;OACxE;AAGP","sources":["packages/@react-aria/dnd/src/DragPreview.tsx"],"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 {DragItem, DragPreviewRenderer} from '@react-types/shared';\nimport {flushSync} from 'react-dom';\nimport React, {ForwardedRef, JSX, useEffect, useImperativeHandle, useRef, useState} from 'react';\n\nexport interface DragPreviewProps {\n /**\n * A render function which returns a preview element, or an object containing the element\n * and a custom offset. If an object is returned, the provided `x` and `y` values will be\n * used as the drag preview offset instead of the default calculation.\n */\n children: (items: DragItem[]) => JSX.Element | {element: JSX.Element, x: number, y: number} | null\n}\n\nexport const DragPreview:\n React.ForwardRefExoticComponent<DragPreviewProps & React.RefAttributes<DragPreviewRenderer | null>> =\nReact.forwardRef(function DragPreview(props: DragPreviewProps, ref: ForwardedRef<DragPreviewRenderer | null>) {\n let render = props.children;\n let [children, setChildren] = useState<JSX.Element | null>(null);\n let domRef = useRef<HTMLDivElement | null>(null);\n let raf = useRef<ReturnType<typeof requestAnimationFrame> | undefined>(undefined);\n\n useImperativeHandle(ref, () => (items: DragItem[], callback: (node: HTMLElement | null, x?: number, y?: number) => void) => {\n // This will be called during the onDragStart event by useDrag. We need to render the\n // preview synchronously before this event returns so we can call event.dataTransfer.setDragImage.\n\n let result = render(items);\n let element: JSX.Element | null;\n let offsetX: number | undefined;\n let offsetY: number | undefined;\n\n if (result && typeof result === 'object' && 'element' in result) {\n element = result.element;\n offsetX = result.x;\n offsetY = result.y;\n } else {\n element = result as JSX.Element | null;\n }\n\n flushSync(() => {\n setChildren(element);\n });\n\n // Yield back to useDrag to set the drag image.\n callback(domRef.current, offsetX, offsetY);\n\n // Remove the preview from the DOM after a frame so the browser has time to paint.\n raf.current = requestAnimationFrame(() => {\n setChildren(null);\n });\n }, [render]);\n\n useEffect(() => {\n return () => {\n if (raf.current) {\n cancelAnimationFrame(raf.current);\n }\n };\n }, []);\n\n if (!children) {\n return null;\n }\n\n return (\n <div style={{zIndex: -100, position: 'fixed', top: 0, left: -100000}} ref={domRef}>\n {children}\n </div>\n );\n});\n"],"names":[],"version":3,"file":"DragPreview.module.js.map"}
|
|
@@ -76,23 +76,26 @@ function $6e16de4c92a0f271$var$nextDropTarget(keyboardDelegate, collection, targ
|
|
|
76
76
|
{
|
|
77
77
|
// If this is the last sibling in a level, traverse to the parent.
|
|
78
78
|
let targetNode = collection.getItem(target.key);
|
|
79
|
-
|
|
79
|
+
let nextItemInSameLevel = (targetNode === null || targetNode === void 0 ? void 0 : targetNode.nextKey) != null ? collection.getItem(targetNode.nextKey) : null;
|
|
80
|
+
while(nextItemInSameLevel != null && nextItemInSameLevel.type !== 'item')nextItemInSameLevel = nextItemInSameLevel.nextKey != null ? collection.getItem(nextItemInSameLevel.nextKey) : null;
|
|
81
|
+
if (targetNode && nextItemInSameLevel == null && targetNode.parentKey != null) {
|
|
80
82
|
// If the parent item has an item after it, use the "before" position.
|
|
81
83
|
let parentNode = collection.getItem(targetNode.parentKey);
|
|
82
|
-
|
|
84
|
+
const nextNode = (parentNode === null || parentNode === void 0 ? void 0 : parentNode.nextKey) != null ? collection.getItem(parentNode.nextKey) : null;
|
|
85
|
+
if ((nextNode === null || nextNode === void 0 ? void 0 : nextNode.type) === 'item') return {
|
|
83
86
|
type: 'item',
|
|
84
|
-
key:
|
|
87
|
+
key: nextNode.key,
|
|
85
88
|
dropPosition: 'before'
|
|
86
89
|
};
|
|
87
|
-
if (parentNode) return {
|
|
90
|
+
if ((parentNode === null || parentNode === void 0 ? void 0 : parentNode.type) === 'item') return {
|
|
88
91
|
type: 'item',
|
|
89
92
|
key: parentNode.key,
|
|
90
93
|
dropPosition: 'after'
|
|
91
94
|
};
|
|
92
95
|
}
|
|
93
|
-
if (
|
|
96
|
+
if (nextItemInSameLevel) return {
|
|
94
97
|
type: 'item',
|
|
95
|
-
key:
|
|
98
|
+
key: nextItemInSameLevel.key,
|
|
96
99
|
dropPosition: 'on'
|
|
97
100
|
};
|
|
98
101
|
}
|
|
@@ -111,8 +114,9 @@ function $6e16de4c92a0f271$var$previousDropTarget(keyboardDelegate, collection,
|
|
|
111
114
|
let prevKey = null;
|
|
112
115
|
let lastKey = (_keyboardDelegate_getLastKey = keyboardDelegate.getLastKey) === null || _keyboardDelegate_getLastKey === void 0 ? void 0 : _keyboardDelegate_getLastKey.call(keyboardDelegate);
|
|
113
116
|
while(lastKey != null){
|
|
114
|
-
prevKey = lastKey;
|
|
115
117
|
let node = collection.getItem(lastKey);
|
|
118
|
+
if ((node === null || node === void 0 ? void 0 : node.type) !== 'item') break;
|
|
119
|
+
prevKey = lastKey;
|
|
116
120
|
lastKey = node === null || node === void 0 ? void 0 : node.parentKey;
|
|
117
121
|
}
|
|
118
122
|
if (prevKey != null) return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;AAGO,SAAS,0CACd,gBAAkC,EAClC,UAAqC,EACrC,MAAqC,EACrC,SAA2C,EAC3C,MAAM,KAAK,EACX,OAAO,KAAK;IAEZ,OAAQ;QACN,KAAK;YACH,OAAO,MACH,qCAAe,kBAAkB,YAAY,QAAQ,MAAM,UAC3D,yCAAmB,kBAAkB,YAAY,QAAQ,MAAM;QACrE,KAAK;YACH,OAAO,MACH,yCAAmB,kBAAkB,YAAY,QAAQ,MAAM,WAC/D,qCAAe,kBAAkB,YAAY,QAAQ,MAAM;QACjE,KAAK;YACH,OAAO,yCAAmB,kBAAkB,YAAY,QAAQ;QAClE,KAAK;YACH,OAAO,qCAAe,kBAAkB,YAAY,QAAQ;IAChE;AACF;AAEA,SAAS,qCACP,gBAAkC,EAClC,UAAqC,EACrC,MAAqC,EACrC,OAAO,KAAK,EACZ,aAAsC,IAAI;IAE1C,IAAI,CAAC,QACH,OAAO;QACL,MAAM;IACR;IAGF,IAAI,OAAO,IAAI,KAAK,QAAQ;YACZ;YAAA;QAAd,IAAI,UAAU,CAAA,kCAAA,gCAAA,iBAAiB,WAAW,cAA5B,oDAAA,mCAAA,+BAAA,4CAAA,iCAAoC;QAClD,IAAI,WAAW,MACb,OAAO;YACL,MAAM;YACN,KAAK;YACL,cAAc;QAChB;QAGF,OAAO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MAAM;YACN,KAAK,UAAU,GAAG;YAClB,cAAc;QAChB;IAEJ;IAEA,OAAO;AACT","sources":["packages/@react-aria/dnd/src/DropTargetKeyboardNavigation.ts"],"sourcesContent":["import {Collection, DropTarget, Key, KeyboardDelegate, Node} from '@react-types/shared';\nimport {getChildNodes} from '@react-stately/collections';\n\nexport function navigate(\n keyboardDelegate: KeyboardDelegate,\n collection: Collection<Node<unknown>>,\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: KeyboardDelegate,\n collection: Collection<Node<unknown>>,\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 = horizontal === 'right' ? keyboardDelegate.getKeyRightOf?.(target.key) : keyboardDelegate.getKeyLeftOf?.(target.key);\n } else {\n nextKey = keyboardDelegate.getKeyBelow?.(target.key);\n }\n let nextCollectionKey = collection.getKeyAfter(target.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 if (targetNode && targetNode.nextKey == 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 if (parentNode?.nextKey != null) {\n return {\n type: 'item',\n key: parentNode.nextKey,\n dropPosition: 'before'\n };\n }\n\n if (parentNode) {\n return {\n type: 'item',\n key: parentNode.key,\n dropPosition: 'after'\n };\n }\n }\n\n if (targetNode?.nextKey != null) {\n return {\n type: 'item',\n key: targetNode.nextKey,\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: KeyboardDelegate,\n collection: Collection<Node<unknown>>,\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 prevKey = lastKey;\n let node = collection.getItem(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 = horizontal === 'left' ? keyboardDelegate.getKeyLeftOf?.(target.key) : keyboardDelegate.getKeyRightOf?.(target.key);\n } else {\n prevKey = keyboardDelegate.getKeyAbove?.(target.key);\n }\n let prevCollectionKey = collection.getKeyBefore(target.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 (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 if (targetNode && targetNode.prevKey != null) {\n let lastChild = getLastChild(collection, targetNode.prevKey);\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<Node<unknown>>, 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 = collection.getKeyAfter(key);\n let nextNode = nextKey != null ? collection.getItem(nextKey) : null;\n if (targetNode && nextNode && nextNode.level > targetNode.level) {\n let children = getChildNodes(targetNode, collection);\n let lastChild: Node<unknown> | null = null;\n for (let child of children) {\n if (child.type === 'item') {\n lastChild = child;\n }\n }\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"],"names":[],"version":3,"file":"DropTargetKeyboardNavigation.main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;AAGO,SAAS,0CACd,gBAAkC,EAClC,UAAqC,EACrC,MAAqC,EACrC,SAA2C,EAC3C,MAAM,KAAK,EACX,OAAO,KAAK;IAEZ,OAAQ;QACN,KAAK;YACH,OAAO,MACH,qCAAe,kBAAkB,YAAY,QAAQ,MAAM,UAC3D,yCAAmB,kBAAkB,YAAY,QAAQ,MAAM;QACrE,KAAK;YACH,OAAO,MACH,yCAAmB,kBAAkB,YAAY,QAAQ,MAAM,WAC/D,qCAAe,kBAAkB,YAAY,QAAQ,MAAM;QACjE,KAAK;YACH,OAAO,yCAAmB,kBAAkB,YAAY,QAAQ;QAClE,KAAK;YACH,OAAO,qCAAe,kBAAkB,YAAY,QAAQ;IAChE;AACF;AAEA,SAAS,qCACP,gBAAkC,EAClC,UAAqC,EACrC,MAAqC,EACrC,OAAO,KAAK,EACZ,aAAsC,IAAI;IAE1C,IAAI,CAAC,QACH,OAAO;QACL,MAAM;IACR;IAGF,IAAI,OAAO,IAAI,KAAK,QAAQ;YACZ;YAAA;QAAd,IAAI,UAAU,CAAA,kCAAA,gCAAA,iBAAiB,WAAW,cAA5B,oDAAA,mCAAA,+BAAA,4CAAA,iCAAoC;QAClD,IAAI,WAAW,MACb,OAAO;YACL,MAAM;YACN,KAAK;YACL,cAAc;QAChB;QAGF,OAAO;IACT;IAEA,IAAI,OAAO,IAAI,KAAK,QAAQ;YAGW,iCAA+C,gCAExE;QAJZ,IAAI,UAAkC;QACtC,IAAI,YACF,UAAU,eAAe,WAAU,kCAAA,iBAAiB,aAAa,cAA9B,sDAAA,qCAAA,kBAAiC,OAAO,GAAG,KAAI,iCAAA,iBAAiB,YAAY,cAA7B,qDAAA,oCAAA,kBAAgC,OAAO,GAAG;aAE5H,WAAU,gCAAA,iBAAiB,W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AkC;QACtC,KAAK,IAAI,SAAS,SAChB,IAAI,MAAM,IAAI,KAAK,QACjB,YAAY;QAIhB,IAAI,WACF,OAAO;YACL,MAAM;YACN,KAAK,UAAU,GAAG;YAClB,cAAc;QAChB;IAEJ;IAEA,OAAO;AACT","sources":["packages/@react-aria/dnd/src/DropTargetKeyboardNavigation.ts"],"sourcesContent":["import {Collection, DropTarget, Key, KeyboardDelegate, Node} from '@react-types/shared';\nimport {getChildNodes} from '@react-stately/collections';\n\nexport function navigate(\n keyboardDelegate: KeyboardDelegate,\n collection: Collection<Node<unknown>>,\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: KeyboardDelegate,\n collection: Collection<Node<unknown>>,\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 = horizontal === 'right' ? keyboardDelegate.getKeyRightOf?.(target.key) : keyboardDelegate.getKeyLeftOf?.(target.key);\n } else {\n nextKey = keyboardDelegate.getKeyBelow?.(target.key);\n }\n let nextCollectionKey = collection.getKeyAfter(target.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 nextItemInSameLevel = targetNode?.nextKey != null ? collection.getItem(targetNode.nextKey) : null;\n while (nextItemInSameLevel != null && nextItemInSameLevel.type !== 'item') {\n nextItemInSameLevel = nextItemInSameLevel.nextKey != null ? collection.getItem(nextItemInSameLevel.nextKey) : 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 const nextNode = parentNode?.nextKey != null ? collection.getItem(parentNode.nextKey) : 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: KeyboardDelegate,\n collection: Collection<Node<unknown>>,\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 = horizontal === 'left' ? keyboardDelegate.getKeyLeftOf?.(target.key) : keyboardDelegate.getKeyRightOf?.(target.key);\n } else {\n prevKey = keyboardDelegate.getKeyAbove?.(target.key);\n }\n let prevCollectionKey = collection.getKeyBefore(target.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 (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 if (targetNode && targetNode.prevKey != null) {\n let lastChild = getLastChild(collection, targetNode.prevKey);\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<Node<unknown>>, 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 = collection.getKeyAfter(key);\n let nextNode = nextKey != null ? collection.getItem(nextKey) : null;\n if (targetNode && nextNode && nextNode.level > targetNode.level) {\n let children = getChildNodes(targetNode, collection);\n let lastChild: Node<unknown> | null = null;\n for (let child of children) {\n if (child.type === 'item') {\n lastChild = child;\n }\n }\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"],"names":[],"version":3,"file":"DropTargetKeyboardNavigation.main.js.map"}
|
|
@@ -70,23 +70,26 @@ function $e154566cef11553b$var$nextDropTarget(keyboardDelegate, collection, targ
|
|
|
70
70
|
{
|
|
71
71
|
// If this is the last sibling in a level, traverse to the parent.
|
|
72
72
|
let targetNode = collection.getItem(target.key);
|
|
73
|
-
|
|
73
|
+
let nextItemInSameLevel = (targetNode === null || targetNode === void 0 ? void 0 : targetNode.nextKey) != null ? collection.getItem(targetNode.nextKey) : null;
|
|
74
|
+
while(nextItemInSameLevel != null && nextItemInSameLevel.type !== 'item')nextItemInSameLevel = nextItemInSameLevel.nextKey != null ? collection.getItem(nextItemInSameLevel.nextKey) : null;
|
|
75
|
+
if (targetNode && nextItemInSameLevel == null && targetNode.parentKey != null) {
|
|
74
76
|
// If the parent item has an item after it, use the "before" position.
|
|
75
77
|
let parentNode = collection.getItem(targetNode.parentKey);
|
|
76
|
-
|
|
78
|
+
const nextNode = (parentNode === null || parentNode === void 0 ? void 0 : parentNode.nextKey) != null ? collection.getItem(parentNode.nextKey) : null;
|
|
79
|
+
if ((nextNode === null || nextNode === void 0 ? void 0 : nextNode.type) === 'item') return {
|
|
77
80
|
type: 'item',
|
|
78
|
-
key:
|
|
81
|
+
key: nextNode.key,
|
|
79
82
|
dropPosition: 'before'
|
|
80
83
|
};
|
|
81
|
-
if (parentNode) return {
|
|
84
|
+
if ((parentNode === null || parentNode === void 0 ? void 0 : parentNode.type) === 'item') return {
|
|
82
85
|
type: 'item',
|
|
83
86
|
key: parentNode.key,
|
|
84
87
|
dropPosition: 'after'
|
|
85
88
|
};
|
|
86
89
|
}
|
|
87
|
-
if (
|
|
90
|
+
if (nextItemInSameLevel) return {
|
|
88
91
|
type: 'item',
|
|
89
|
-
key:
|
|
92
|
+
key: nextItemInSameLevel.key,
|
|
90
93
|
dropPosition: 'on'
|
|
91
94
|
};
|
|
92
95
|
}
|
|
@@ -105,8 +108,9 @@ function $e154566cef11553b$var$previousDropTarget(keyboardDelegate, collection,
|
|
|
105
108
|
let prevKey = null;
|
|
106
109
|
let lastKey = (_keyboardDelegate_getLastKey = keyboardDelegate.getLastKey) === null || _keyboardDelegate_getLastKey === void 0 ? void 0 : _keyboardDelegate_getLastKey.call(keyboardDelegate);
|
|
107
110
|
while(lastKey != null){
|
|
108
|
-
prevKey = lastKey;
|
|
109
111
|
let node = collection.getItem(lastKey);
|
|
112
|
+
if ((node === null || node === void 0 ? void 0 : node.type) !== 'item') break;
|
|
113
|
+
prevKey = lastKey;
|
|
110
114
|
lastKey = node === null || node === void 0 ? void 0 : node.parentKey;
|
|
111
115
|
}
|
|
112
116
|
if (prevKey != null) return {
|
|
@@ -70,23 +70,26 @@ function $e154566cef11553b$var$nextDropTarget(keyboardDelegate, collection, targ
|
|
|
70
70
|
{
|
|
71
71
|
// If this is the last sibling in a level, traverse to the parent.
|
|
72
72
|
let targetNode = collection.getItem(target.key);
|
|
73
|
-
|
|
73
|
+
let nextItemInSameLevel = (targetNode === null || targetNode === void 0 ? void 0 : targetNode.nextKey) != null ? collection.getItem(targetNode.nextKey) : null;
|
|
74
|
+
while(nextItemInSameLevel != null && nextItemInSameLevel.type !== 'item')nextItemInSameLevel = nextItemInSameLevel.nextKey != null ? collection.getItem(nextItemInSameLevel.nextKey) : null;
|
|
75
|
+
if (targetNode && nextItemInSameLevel == null && targetNode.parentKey != null) {
|
|
74
76
|
// If the parent item has an item after it, use the "before" position.
|
|
75
77
|
let parentNode = collection.getItem(targetNode.parentKey);
|
|
76
|
-
|
|
78
|
+
const nextNode = (parentNode === null || parentNode === void 0 ? void 0 : parentNode.nextKey) != null ? collection.getItem(parentNode.nextKey) : null;
|
|
79
|
+
if ((nextNode === null || nextNode === void 0 ? void 0 : nextNode.type) === 'item') return {
|
|
77
80
|
type: 'item',
|
|
78
|
-
key:
|
|
81
|
+
key: nextNode.key,
|
|
79
82
|
dropPosition: 'before'
|
|
80
83
|
};
|
|
81
|
-
if (parentNode) return {
|
|
84
|
+
if ((parentNode === null || parentNode === void 0 ? void 0 : parentNode.type) === 'item') return {
|
|
82
85
|
type: 'item',
|
|
83
86
|
key: parentNode.key,
|
|
84
87
|
dropPosition: 'after'
|
|
85
88
|
};
|
|
86
89
|
}
|
|
87
|
-
if (
|
|
90
|
+
if (nextItemInSameLevel) return {
|
|
88
91
|
type: 'item',
|
|
89
|
-
key:
|
|
92
|
+
key: nextItemInSameLevel.key,
|
|
90
93
|
dropPosition: 'on'
|
|
91
94
|
};
|
|
92
95
|
}
|
|
@@ -105,8 +108,9 @@ function $e154566cef11553b$var$previousDropTarget(keyboardDelegate, collection,
|
|
|
105
108
|
let prevKey = null;
|
|
106
109
|
let lastKey = (_keyboardDelegate_getLastKey = keyboardDelegate.getLastKey) === null || _keyboardDelegate_getLastKey === void 0 ? void 0 : _keyboardDelegate_getLastKey.call(keyboardDelegate);
|
|
107
110
|
while(lastKey != null){
|
|
108
|
-
prevKey = lastKey;
|
|
109
111
|
let node = collection.getItem(lastKey);
|
|
112
|
+
if ((node === null || node === void 0 ? void 0 : node.type) !== 'item') break;
|
|
113
|
+
prevKey = lastKey;
|
|
110
114
|
lastKey = node === null || node === void 0 ? void 0 : node.parentKey;
|
|
111
115
|
}
|
|
112
116
|
if (prevKey != null) return {
|
|
@@ -1 +1 @@
|
|
|
1
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wBACL,cAAc;oBAChB;oBAGF,OAAO;wBACL,MAAM;oBACR;gBACF;YACA,KAAK;gBACH,OAAO;oBACL,MAAM;oBACN,KAAK,OAAO,GAAG;oBACf,cAAc;gBAChB;YAEF,KAAK;gBAAS;oBACZ,0CAA0C;oBAC1C,IAAI,YAAY,mCAAa,YAAY,OAAO,GAAG;oBACnD,IAAI,WACF,OAAO;oBAGT,OAAO;wBACL,MAAM;wBACN,KAAK,OAAO,GAAG;wBACf,cAAc;oBAChB;gBACF;QACF;IACF;IAEA,IAAI,OAAO,IAAI,KAAK,QAClB,OAAO;QACL,MAAM;IACR;IAGF,OAAO;AACT;AAEA,SAAS,mCAAa,UAAqC,EAAE,GAAQ;IACnE,gFAAgF;IAChF,qGAAqG;IACrG,IAAI,aAAa,WAAW,OAAO,CAAC;IACpC,IAAI,UAAU,WAAW,WAAW,CAAC;IACrC,IAAI,WAAW,WAAW,OAAO,WAAW,OAAO,CAAC,WAAW;IAC/D,IAAI,cAAc,YAAY,SAAS,KAAK,GAAG,WAAW,KAAK,EAAE;QAC/D,IAAI,WAAW,CAAA,GAAA,oBAAY,EAAE,YAAY;QACzC,IAAI,YAAkC;QACtC,KAAK,IAAI,SAAS,SAChB,IAAI,MAAM,IAAI,KAAK,QACjB,YAAY;QAIhB,IAAI,WACF,OAAO;YACL,MAAM;YACN,KAAK,UAAU,GAAG;YAClB,cAAc;QAChB;IAEJ;IAEA,OAAO;AACT","sources":["packages/@react-aria/dnd/src/DropTargetKeyboardNavigation.ts"],"sourcesContent":["import {Collection, DropTarget, Key, KeyboardDelegate, Node} from '@react-types/shared';\nimport {getChildNodes} from '@react-stately/collections';\n\nexport function navigate(\n keyboardDelegate: KeyboardDelegate,\n collection: Collection<Node<unknown>>,\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: KeyboardDelegate,\n collection: Collection<Node<unknown>>,\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 = horizontal === 'right' ? keyboardDelegate.getKeyRightOf?.(target.key) : keyboardDelegate.getKeyLeftOf?.(target.key);\n } else {\n nextKey = keyboardDelegate.getKeyBelow?.(target.key);\n }\n let nextCollectionKey = collection.getKeyAfter(target.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 if (targetNode && targetNode.nextKey == 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 if (parentNode?.nextKey != null) {\n return {\n type: 'item',\n key: parentNode.nextKey,\n dropPosition: 'before'\n };\n }\n\n if (parentNode) {\n return {\n type: 'item',\n key: parentNode.key,\n dropPosition: 'after'\n };\n }\n }\n\n if (targetNode?.nextKey != null) {\n return {\n type: 'item',\n key: targetNode.nextKey,\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: KeyboardDelegate,\n collection: Collection<Node<unknown>>,\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 prevKey = lastKey;\n let node = collection.getItem(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 = horizontal === 'left' ? keyboardDelegate.getKeyLeftOf?.(target.key) : keyboardDelegate.getKeyRightOf?.(target.key);\n } else {\n prevKey = keyboardDelegate.getKeyAbove?.(target.key);\n }\n let prevCollectionKey = collection.getKeyBefore(target.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 (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 if (targetNode && targetNode.prevKey != null) {\n let lastChild = getLastChild(collection, targetNode.prevKey);\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<Node<unknown>>, 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 = collection.getKeyAfter(key);\n let nextNode = nextKey != null ? collection.getItem(nextKey) : null;\n if (targetNode && nextNode && nextNode.level > targetNode.level) {\n let children = getChildNodes(targetNode, collection);\n let lastChild: Node<unknown> | null = null;\n for (let child of children) {\n if (child.type === 'item') {\n lastChild = child;\n }\n }\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"],"names":[],"version":3,"file":"DropTargetKeyboardNavigation.module.js.map"}
|
|
1
|
+
{"mappings":";;;AAGO,SAAS,0CACd,gBAAkC,EAClC,UAAqC,EACrC,MAAqC,EACrC,SAA2C,EAC3C,MAAM,KAAK,EACX,OAAO,KAAK;IAEZ,OAAQ;QACN,KAAK;YACH,OAAO,MACH,qCAAe,kBAAkB,YAAY,QAAQ,MAAM,UAC3D,yCAAmB,kBAAkB,YAAY,QAAQ,MAAM;QACrE,KAAK;YACH,OAAO,MACH,yCAAmB,kBAAkB,YAAY,QAA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OAAO;wBAC3D,IAAI,WACF,OAAO;oBAEX;oBAEA,IAAI,WAAW,MACb,OAAO;wBACL,MAAM;wBACN,KAAK;wBACL,cAAc;oBAChB;oBAGF,OAAO;wBACL,MAAM;oBACR;gBACF;YACA,KAAK;gBACH,OAAO;oBACL,MAAM;oBACN,KAAK,OAAO,GAAG;oBACf,cAAc;gBAChB;YAEF,KAAK;gBAAS;oBACZ,0CAA0C;oBAC1C,IAAI,YAAY,mCAAa,YAAY,OAAO,GAAG;oBACnD,IAAI,WACF,OAAO;oBAGT,OAAO;wBACL,MAAM;wBACN,KAAK,OAAO,GAAG;wBACf,cAAc;oBAChB;gBACF;QACF;IACF;IAEA,IAAI,OAAO,IAAI,KAAK,QAClB,OAAO;QACL,MAAM;IACR;IAGF,OAAO;AACT;AAEA,SAAS,mCAAa,UAAqC,EAAE,GAAQ;IACnE,gFAAgF;IAChF,qGAAqG;IACrG,IAAI,aAAa,WAAW,OAAO,CAAC;IACpC,IAAI,UAAU,WAAW,WAAW,CAAC;IACrC,IAAI,WAAW,WAAW,OAAO,WAAW,OAAO,CAAC,WAAW;IAC/D,IAAI,cAAc,YAAY,SAAS,KAAK,GAAG,WAAW,KAAK,EAAE;QAC/D,IAAI,WAAW,CAAA,GAAA,oBAAY,EAAE,YAAY;QACzC,IAAI,YAAkC;QACtC,KAAK,IAAI,SAAS,SAChB,IAAI,MAAM,IAAI,KAAK,QACjB,YAAY;QAIhB,IAAI,WACF,OAAO;YACL,MAAM;YACN,KAAK,UAAU,GAAG;YAClB,cAAc;QAChB;IAEJ;IAEA,OAAO;AACT","sources":["packages/@react-aria/dnd/src/DropTargetKeyboardNavigation.ts"],"sourcesContent":["import {Collection, DropTarget, Key, KeyboardDelegate, Node} from '@react-types/shared';\nimport {getChildNodes} from '@react-stately/collections';\n\nexport function navigate(\n keyboardDelegate: KeyboardDelegate,\n collection: Collection<Node<unknown>>,\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: KeyboardDelegate,\n collection: Collection<Node<unknown>>,\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 = horizontal === 'right' ? keyboardDelegate.getKeyRightOf?.(target.key) : keyboardDelegate.getKeyLeftOf?.(target.key);\n } else {\n nextKey = keyboardDelegate.getKeyBelow?.(target.key);\n }\n let nextCollectionKey = collection.getKeyAfter(target.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 nextItemInSameLevel = targetNode?.nextKey != null ? collection.getItem(targetNode.nextKey) : null;\n while (nextItemInSameLevel != null && nextItemInSameLevel.type !== 'item') {\n nextItemInSameLevel = nextItemInSameLevel.nextKey != null ? collection.getItem(nextItemInSameLevel.nextKey) : 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 const nextNode = parentNode?.nextKey != null ? collection.getItem(parentNode.nextKey) : 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: KeyboardDelegate,\n collection: Collection<Node<unknown>>,\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 = horizontal === 'left' ? keyboardDelegate.getKeyLeftOf?.(target.key) : keyboardDelegate.getKeyRightOf?.(target.key);\n } else {\n prevKey = keyboardDelegate.getKeyAbove?.(target.key);\n }\n let prevCollectionKey = collection.getKeyBefore(target.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 (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 if (targetNode && targetNode.prevKey != null) {\n let lastChild = getLastChild(collection, targetNode.prevKey);\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<Node<unknown>>, 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 = collection.getKeyAfter(key);\n let nextNode = nextKey != null ? collection.getItem(nextKey) : null;\n if (targetNode && nextNode && nextNode.level > targetNode.level) {\n let children = getChildNodes(targetNode, collection);\n let lastChild: Node<unknown> | null = null;\n for (let child of children) {\n if (child.type === 'item') {\n lastChild = child;\n }\n }\n\n if (lastChild) {\n return {\n type: 'item',\n key: lastChild.key,\n dropPosition: 'after'\n };\n }\n }\n\n return null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,GAAG,CAAC,OAAO,KAAK,GAAG;QAC5C,OAAO,oBAAA,8BAAA,QAAS,qBAAqB;QAErC,IAAI,QAAS,CAAA,UAAU,IAAI,CAAC,eAAe,CAAC,SAAS,KAAK,GAAG,CAAC,OAAO,IAAI,CAAC,YAAY,CAAC,SAAS,KAAK,GAAG,CAAC,OAAO,IAAI,CAAC,UAAU,CAAC,MAAK,GACnI,OAAO;YACL,MAAM;YACN,KAAK,KAAK,GAAG;YACb,cAAc,YAAY,UAAU;QACtC;QAGF,OAAO;YACL,MAAM;YACN,KAAK,KAAK,GAAG;YACb,cAAc,YAAY,WAAW;QACvC;IACF;IA1IA,YAAY,UAAmC,EAAE,GAAkC,EAAE,OAAuC,CAAE;QAC5H,IAAI,CAAC,UAAU,GAAG;QAClB,IAAI,CAAC,GAAG,GAAG;QACX,IAAI,CAAC,MAAM,GAAG,CAAA,oBAAA,8BAAA,QAAS,MAAM,KAAI;QACjC,IAAI,CAAC,WAAW,GAAG,CAAA,oBAAA,8BAAA,QAAS,WAAW,KAAI;QAC3C,IAAI,CAAC,SAAS,GAAG,CAAA,oBAAA,8BAAA,QAAS,SAAS,KAAI;IACzC;AAqIF","sources":["packages/@react-aria/dnd/src/ListDropTargetDelegate.ts"],"sourcesContent":["import {Direction, DropTarget, DropTargetDelegate, Node, Orientation, RefObject} from '@react-types/shared';\n\ninterface ListDropTargetDelegateOptions {\n /**\n * Whether the items are arranged in a stack or grid.\n * @default 'stack'\n */\n layout?: 'stack' | 'grid',\n /**\n * The primary orientation of the items. Usually this is the\n * direction that the collection scrolls.\n * @default 'vertical'\n */\n orientation?: Orientation,\n /**\n * The horizontal layout direction.\n * @default 'ltr'\n */\n direction?: Direction\n}\n\n// Terms used in the below code:\n// * \"Primary\" – The main layout direction. For stacks, this is the direction\n// that the stack is arranged in (e.g. horizontal or vertical).\n// For grids, this is the main scroll direction.\n// * \"Secondary\" – The secondary layout direction. For stacks, there is no secondary\n// layout direction. For grids, this is the opposite of the primary direction.\n// * \"Flow\" – The flow direction of the items. For stacks, this is the the primary\n// direction. For grids, it is the secondary direction.\n\nexport class ListDropTargetDelegate implements DropTargetDelegate {\n private collection: Iterable<Node<unknown>>;\n private ref: RefObject<HTMLElement | null>;\n private layout: 'stack' | 'grid';\n private orientation: Orientation;\n protected direction: Direction;\n\n constructor(collection: Iterable<Node<unknown>>, ref: RefObject<HTMLElement | null>, options?: ListDropTargetDelegateOptions) {\n this.collection = collection;\n this.ref = ref;\n this.layout = options?.layout || 'stack';\n this.orientation = options?.orientation || 'vertical';\n this.direction = options?.direction || 'ltr';\n }\n\n private getPrimaryStart(rect: DOMRect) {\n return this.orientation === 'horizontal' ? rect.left : rect.top;\n }\n\n private getPrimaryEnd(rect: DOMRect) {\n return this.orientation === 'horizontal' ? rect.right : rect.bottom;\n }\n\n private getSecondaryStart(rect: DOMRect) {\n return this.orientation === 'horizontal' ? rect.top : rect.left;\n }\n\n private getSecondaryEnd(rect: DOMRect) {\n return this.orientation === 'horizontal' ? rect.bottom : rect.right;\n }\n\n private getFlowStart(rect: DOMRect) {\n return this.layout === 'stack' ? this.getPrimaryStart(rect) : this.getSecondaryStart(rect);\n }\n\n private getFlowEnd(rect: DOMRect) {\n return this.layout === 'stack' ? this.getPrimaryEnd(rect) : this.getSecondaryEnd(rect);\n }\n\n private getFlowSize(rect: DOMRect) {\n return this.getFlowEnd(rect) - this.getFlowStart(rect);\n }\n\n getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget {\n if (this.collection[Symbol.iterator]().next().done || !this.ref.current) {\n return {type: 'root'};\n }\n\n let rect: DOMRect | undefined = this.ref.current.getBoundingClientRect();\n let primary = this.orientation === 'horizontal' ? x : y;\n let secondary = this.orientation === 'horizontal' ? y : x;\n primary += this.getPrimaryStart(rect);\n secondary += this.getSecondaryStart(rect);\n\n let flow = this.layout === 'stack' ? primary : secondary;\n let isPrimaryRTL = this.orientation === 'horizontal' && this.direction === 'rtl';\n let isSecondaryRTL = this.layout === 'grid' && this.orientation === 'vertical' && this.direction === 'rtl';\n let isFlowRTL = this.layout === 'stack' ? isPrimaryRTL : isSecondaryRTL;\n\n let collection = this.ref.current?.dataset.collection;\n let elements = this.ref.current.querySelectorAll(collection ? `[data-collection=\"${CSS.escape(collection)}\"]` : '[data-key]');\n let elementMap = new Map<string, HTMLElement>();\n for (let item of elements) {\n if (item instanceof HTMLElement && item.dataset.key != null) {\n elementMap.set(item.dataset.key, item);\n }\n }\n\n // TODO: assume that only item type items are valid drop targets. This is to prevent a crash when dragging over the loader\n // row since it doesn't have a data-key set on it. Will eventually need to handle the case with drag and drop and loaders located between rows aka tree.\n // Can see https://github.com/adobe/react-spectrum/pull/4210/files#diff-21e555e0c597a28215e36137f5be076a65a1e1456c92cd0fdd60f866929aae2a for additional logic\n // that may need to happen then\n let items = [...this.collection].filter(item => item.type === 'item');\n let low = 0;\n let high = items.length;\n while (low < high) {\n let mid = Math.floor((low + high) / 2);\n let item = items[mid];\n let element = elementMap.get(String(item.key));\n if (!element) {\n break;\n }\n let rect = element.getBoundingClientRect();\n let update = (isGreater: boolean) => {\n if (isGreater) {\n low = mid + 1;\n } else {\n high = mid;\n }\n };\n\n if (primary < this.getPrimaryStart(rect)) {\n update(isPrimaryRTL);\n } else if (primary > this.getPrimaryEnd(rect)) {\n update(!isPrimaryRTL);\n } else if (secondary < this.getSecondaryStart(rect)) {\n update(isSecondaryRTL);\n } else if (secondary > this.getSecondaryEnd(rect)) {\n update(!isSecondaryRTL);\n } else {\n let target: DropTarget = {\n type: 'item',\n key: item.key,\n dropPosition: 'on'\n };\n\n if (isValidDropTarget(target)) {\n // Otherwise, if dropping on the item is accepted, try the before/after positions if within 5px\n // of the start or end of the item.\n if (flow <= this.getFlowStart(rect) + 5 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = isFlowRTL ? 'after' : 'before';\n } else if (flow >= this.getFlowEnd(rect) - 5 && isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = isFlowRTL ? 'before' : 'after';\n }\n } else {\n // If dropping on the item isn't accepted, try the target before or after depending on the position.\n let mid = this.getFlowStart(rect) + this.getFlowSize(rect) / 2;\n if (flow <= mid && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = isFlowRTL ? 'after' : 'before';\n } else if (flow >= mid && isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = isFlowRTL ? 'before' : 'after';\n }\n }\n\n return target;\n }\n }\n\n let item = items[Math.min(low, items.length - 1)];\n let element = elementMap.get(String(item.key));\n rect = element?.getBoundingClientRect();\n\n if (rect && (primary < this.getPrimaryStart(rect) || Math.abs(flow - this.getFlowStart(rect)) < Math.abs(flow - this.getFlowEnd(rect)))) {\n return {\n type: 'item',\n key: item.key,\n dropPosition: isFlowRTL ? 'after' : 'before'\n };\n }\n\n return {\n type: 'item',\n key: item.key,\n dropPosition: isFlowRTL ? 'before' : 'after'\n };\n }\n}\n"],"names":[],"version":3,"file":"ListDropTargetDelegate.main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;AA8BO,MAAM;IAeH,gBAAgB,IAAa,EAAE;QACrC,OAAO,IAAI,CAAC,WAAW,KAAK,eAAe,KAAK,IAAI,GAAG,KAAK,GAAG;IACjE;IAEQ,cAAc,IAAa,EAAE;QACnC,OAAO,IAAI,CAAC,WAAW,KAAK,eAAe,KAAK,KAAK,GAAG,KAAK,MAAM;IACrE;IAEQ,kBAAkB,IAAa,EAAE;QACvC,OAAO,IAAI,CAAC,WAAW,KAAK,eAAe,KAAK,GAAG,GAAG,KAAK,IAAI;IACjE;IAEQ,gBAAgB,IAAa,EAAE;QACrC,OAAO,IAAI,CAAC,WAAW,KAAK,eAAe,KAAK,MAAM,GAAG,KAAK,KAAK;IACrE;IAEQ,aAAa,IAAa,EAAE;QAClC,OAAO,IAAI,CAAC,MAAM,KAAK,UAAU,IAAI,CAAC,eAAe,CAAC,QAAQ,IAAI,CAAC,iBAAiB,CAAC;IACvF;IAEQ,WAA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AAA,8BAAA,QAAS,WAAW,KAAI;QAC3C,IAAI,CAAC,SAAS,GAAG,CAAA,oBAAA,8BAAA,QAAS,SAAS,KAAI;IACzC;AA0IF","sources":["packages/@react-aria/dnd/src/ListDropTargetDelegate.ts"],"sourcesContent":["import {Direction, DropTarget, DropTargetDelegate, Node, Orientation, RefObject} from '@react-types/shared';\n\ninterface ListDropTargetDelegateOptions {\n /**\n * Whether the items are arranged in a stack or grid.\n * @default 'stack'\n */\n layout?: 'stack' | 'grid',\n /**\n * The primary orientation of the items. Usually this is the\n * direction that the collection scrolls.\n * @default 'vertical'\n */\n orientation?: Orientation,\n /**\n * The horizontal layout direction.\n * @default 'ltr'\n */\n direction?: Direction\n}\n\n// Terms used in the below code:\n// * \"Primary\" – The main layout direction. For stacks, this is the direction\n// that the stack is arranged in (e.g. horizontal or vertical).\n// For grids, this is the main scroll direction.\n// * \"Secondary\" – The secondary layout direction. For stacks, there is no secondary\n// layout direction. For grids, this is the opposite of the primary direction.\n// * \"Flow\" – The flow direction of the items. For stacks, this is the the primary\n// direction. For grids, it is the secondary direction.\n\nexport class ListDropTargetDelegate implements DropTargetDelegate {\n private collection: Iterable<Node<unknown>>;\n private ref: RefObject<HTMLElement | null>;\n private layout: 'stack' | 'grid';\n private orientation: Orientation;\n protected direction: Direction;\n\n constructor(collection: Iterable<Node<unknown>>, ref: RefObject<HTMLElement | null>, options?: ListDropTargetDelegateOptions) {\n this.collection = collection;\n this.ref = ref;\n this.layout = options?.layout || 'stack';\n this.orientation = options?.orientation || 'vertical';\n this.direction = options?.direction || 'ltr';\n }\n\n private getPrimaryStart(rect: DOMRect) {\n return this.orientation === 'horizontal' ? rect.left : rect.top;\n }\n\n private getPrimaryEnd(rect: DOMRect) {\n return this.orientation === 'horizontal' ? rect.right : rect.bottom;\n }\n\n private getSecondaryStart(rect: DOMRect) {\n return this.orientation === 'horizontal' ? rect.top : rect.left;\n }\n\n private getSecondaryEnd(rect: DOMRect) {\n return this.orientation === 'horizontal' ? rect.bottom : rect.right;\n }\n\n private getFlowStart(rect: DOMRect) {\n return this.layout === 'stack' ? this.getPrimaryStart(rect) : this.getSecondaryStart(rect);\n }\n\n private getFlowEnd(rect: DOMRect) {\n return this.layout === 'stack' ? this.getPrimaryEnd(rect) : this.getSecondaryEnd(rect);\n }\n\n private getFlowSize(rect: DOMRect) {\n return this.getFlowEnd(rect) - this.getFlowStart(rect);\n }\n\n getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget {\n if (this.collection[Symbol.iterator]().next().done || !this.ref.current) {\n return {type: 'root'};\n }\n\n let rect: DOMRect | undefined = this.ref.current.getBoundingClientRect();\n let primary = this.orientation === 'horizontal' ? x : y;\n let secondary = this.orientation === 'horizontal' ? y : x;\n primary += this.getPrimaryStart(rect);\n secondary += this.getSecondaryStart(rect);\n\n let flow = this.layout === 'stack' ? primary : secondary;\n let isPrimaryRTL = this.orientation === 'horizontal' && this.direction === 'rtl';\n let isSecondaryRTL = this.layout === 'grid' && this.orientation === 'vertical' && this.direction === 'rtl';\n let isFlowRTL = this.layout === 'stack' ? isPrimaryRTL : isSecondaryRTL;\n\n let collection = this.ref.current?.dataset.collection;\n let elements = this.ref.current.querySelectorAll(collection ? `[data-collection=\"${CSS.escape(collection)}\"]` : '[data-key]');\n let elementMap = new Map<string, HTMLElement>();\n for (let item of elements) {\n if (item instanceof HTMLElement && item.dataset.key != null) {\n elementMap.set(item.dataset.key, item);\n }\n }\n\n // TODO: assume that only item type items are valid drop targets. This is to prevent a crash when dragging over the loader\n // row since it doesn't have a data-key set on it. Will eventually need to handle the case with drag and drop and loaders located between rows aka tree.\n // Can see https://github.com/adobe/react-spectrum/pull/4210/files#diff-21e555e0c597a28215e36137f5be076a65a1e1456c92cd0fdd60f866929aae2a for additional logic\n // that may need to happen then\n let items = [...this.collection].filter(item => item.type === 'item');\n\n if (items.length < 1) {\n return {type: 'root'};\n }\n\n let low = 0;\n let high = items.length;\n while (low < high) {\n let mid = Math.floor((low + high) / 2);\n let item = items[mid];\n let element = elementMap.get(String(item.key));\n if (!element) {\n break;\n }\n let rect = element.getBoundingClientRect();\n let update = (isGreater: boolean) => {\n if (isGreater) {\n low = mid + 1;\n } else {\n high = mid;\n }\n };\n\n if (primary < this.getPrimaryStart(rect)) {\n update(isPrimaryRTL);\n } else if (primary > this.getPrimaryEnd(rect)) {\n update(!isPrimaryRTL);\n } else if (secondary < this.getSecondaryStart(rect)) {\n update(isSecondaryRTL);\n } else if (secondary > this.getSecondaryEnd(rect)) {\n update(!isSecondaryRTL);\n } else {\n let target: DropTarget = {\n type: 'item',\n key: item.key,\n dropPosition: 'on'\n };\n\n if (isValidDropTarget(target)) {\n // Otherwise, if dropping on the item is accepted, try the before/after positions if within 5px\n // of the start or end of the item.\n if (flow <= this.getFlowStart(rect) + 5 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = isFlowRTL ? 'after' : 'before';\n } else if (flow >= this.getFlowEnd(rect) - 5 && isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = isFlowRTL ? 'before' : 'after';\n }\n } else {\n // If dropping on the item isn't accepted, try the target before or after depending on the position.\n let mid = this.getFlowStart(rect) + this.getFlowSize(rect) / 2;\n if (flow <= mid && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = isFlowRTL ? 'after' : 'before';\n } else if (flow >= mid && isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = isFlowRTL ? 'before' : 'after';\n }\n }\n\n return target;\n }\n }\n\n let item = items[Math.min(low, items.length - 1)];\n let element = elementMap.get(String(item.key));\n rect = element?.getBoundingClientRect();\n\n if (rect && (primary < this.getPrimaryStart(rect) || Math.abs(flow - this.getFlowStart(rect)) < Math.abs(flow - this.getFlowEnd(rect)))) {\n return {\n type: 'item',\n key: item.key,\n dropPosition: isFlowRTL ? 'after' : 'before'\n };\n }\n\n return {\n type: 'item',\n key: item.key,\n dropPosition: isFlowRTL ? 'before' : 'after'\n };\n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AC,OAAO,KAAK,GAAG;QAC5C,OAAO,oBAAA,8BAAA,QAAS,qBAAqB;QAErC,IAAI,QAAS,CAAA,UAAU,IAAI,CAAC,eAAe,CAAC,SAAS,KAAK,GAAG,CAAC,OAAO,IAAI,CAAC,YAAY,CAAC,SAAS,KAAK,GAAG,CAAC,OAAO,IAAI,CAAC,UAAU,CAAC,MAAK,GACnI,OAAO;YACL,MAAM;YACN,KAAK,KAAK,GAAG;YACb,cAAc,YAAY,UAAU;QACtC;QAGF,OAAO;YACL,MAAM;YACN,KAAK,KAAK,GAAG;YACb,cAAc,YAAY,WAAW;QACvC;IACF;IA1IA,YAAY,UAAmC,EAAE,GAAkC,EAAE,OAAuC,CAAE;QAC5H,IAAI,CAAC,UAAU,GAAG;QAClB,IAAI,CAAC,GAAG,GAAG;QACX,IAAI,CAAC,MAAM,GAAG,CAAA,oBAAA,8BAAA,QAAS,MAAM,KAAI;QACjC,IAAI,CAAC,WAAW,GAAG,CAAA,oBAAA,8BAAA,QAAS,WAAW,KAAI;QAC3C,IAAI,CAAC,SAAS,GAAG,CAAA,oBAAA,8BAAA,QAAS,SAAS,KAAI;IACzC;AAqIF","sources":["packages/@react-aria/dnd/src/ListDropTargetDelegate.ts"],"sourcesContent":["import {Direction, DropTarget, DropTargetDelegate, Node, Orientation, RefObject} from '@react-types/shared';\n\ninterface ListDropTargetDelegateOptions {\n /**\n * Whether the items are arranged in a stack or grid.\n * @default 'stack'\n */\n layout?: 'stack' | 'grid',\n /**\n * The primary orientation of the items. Usually this is the\n * direction that the collection scrolls.\n * @default 'vertical'\n */\n orientation?: Orientation,\n /**\n * The horizontal layout direction.\n * @default 'ltr'\n */\n direction?: Direction\n}\n\n// Terms used in the below code:\n// * \"Primary\" – The main layout direction. For stacks, this is the direction\n// that the stack is arranged in (e.g. horizontal or vertical).\n// For grids, this is the main scroll direction.\n// * \"Secondary\" – The secondary layout direction. For stacks, there is no secondary\n// layout direction. For grids, this is the opposite of the primary direction.\n// * \"Flow\" – The flow direction of the items. For stacks, this is the the primary\n// direction. For grids, it is the secondary direction.\n\nexport class ListDropTargetDelegate implements DropTargetDelegate {\n private collection: Iterable<Node<unknown>>;\n private ref: RefObject<HTMLElement | null>;\n private layout: 'stack' | 'grid';\n private orientation: Orientation;\n protected direction: Direction;\n\n constructor(collection: Iterable<Node<unknown>>, ref: RefObject<HTMLElement | null>, options?: ListDropTargetDelegateOptions) {\n this.collection = collection;\n this.ref = ref;\n this.layout = options?.layout || 'stack';\n this.orientation = options?.orientation || 'vertical';\n this.direction = options?.direction || 'ltr';\n }\n\n private getPrimaryStart(rect: DOMRect) {\n return this.orientation === 'horizontal' ? rect.left : rect.top;\n }\n\n private getPrimaryEnd(rect: DOMRect) {\n return this.orientation === 'horizontal' ? rect.right : rect.bottom;\n }\n\n private getSecondaryStart(rect: DOMRect) {\n return this.orientation === 'horizontal' ? rect.top : rect.left;\n }\n\n private getSecondaryEnd(rect: DOMRect) {\n return this.orientation === 'horizontal' ? rect.bottom : rect.right;\n }\n\n private getFlowStart(rect: DOMRect) {\n return this.layout === 'stack' ? this.getPrimaryStart(rect) : this.getSecondaryStart(rect);\n }\n\n private getFlowEnd(rect: DOMRect) {\n return this.layout === 'stack' ? this.getPrimaryEnd(rect) : this.getSecondaryEnd(rect);\n }\n\n private getFlowSize(rect: DOMRect) {\n return this.getFlowEnd(rect) - this.getFlowStart(rect);\n }\n\n getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget {\n if (this.collection[Symbol.iterator]().next().done || !this.ref.current) {\n return {type: 'root'};\n }\n\n let rect: DOMRect | undefined = this.ref.current.getBoundingClientRect();\n let primary = this.orientation === 'horizontal' ? x : y;\n let secondary = this.orientation === 'horizontal' ? y : x;\n primary += this.getPrimaryStart(rect);\n secondary += this.getSecondaryStart(rect);\n\n let flow = this.layout === 'stack' ? primary : secondary;\n let isPrimaryRTL = this.orientation === 'horizontal' && this.direction === 'rtl';\n let isSecondaryRTL = this.layout === 'grid' && this.orientation === 'vertical' && this.direction === 'rtl';\n let isFlowRTL = this.layout === 'stack' ? isPrimaryRTL : isSecondaryRTL;\n\n let collection = this.ref.current?.dataset.collection;\n let elements = this.ref.current.querySelectorAll(collection ? `[data-collection=\"${CSS.escape(collection)}\"]` : '[data-key]');\n let elementMap = new Map<string, HTMLElement>();\n for (let item of elements) {\n if (item instanceof HTMLElement && item.dataset.key != null) {\n elementMap.set(item.dataset.key, item);\n }\n }\n\n // TODO: assume that only item type items are valid drop targets. This is to prevent a crash when dragging over the loader\n // row since it doesn't have a data-key set on it. Will eventually need to handle the case with drag and drop and loaders located between rows aka tree.\n // Can see https://github.com/adobe/react-spectrum/pull/4210/files#diff-21e555e0c597a28215e36137f5be076a65a1e1456c92cd0fdd60f866929aae2a for additional logic\n // that may need to happen then\n let items = [...this.collection].filter(item => item.type === 'item');\n let low = 0;\n let high = items.length;\n while (low < high) {\n let mid = Math.floor((low + high) / 2);\n let item = items[mid];\n let element = elementMap.get(String(item.key));\n if (!element) {\n break;\n }\n let rect = element.getBoundingClientRect();\n let update = (isGreater: boolean) => {\n if (isGreater) {\n low = mid + 1;\n } else {\n high = mid;\n }\n };\n\n if (primary < this.getPrimaryStart(rect)) {\n update(isPrimaryRTL);\n } else if (primary > this.getPrimaryEnd(rect)) {\n update(!isPrimaryRTL);\n } else if (secondary < this.getSecondaryStart(rect)) {\n update(isSecondaryRTL);\n } else if (secondary > this.getSecondaryEnd(rect)) {\n update(!isSecondaryRTL);\n } else {\n let target: DropTarget = {\n type: 'item',\n key: item.key,\n dropPosition: 'on'\n };\n\n if (isValidDropTarget(target)) {\n // Otherwise, if dropping on the item is accepted, try the before/after positions if within 5px\n // of the start or end of the item.\n if (flow <= this.getFlowStart(rect) + 5 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = isFlowRTL ? 'after' : 'before';\n } else if (flow >= this.getFlowEnd(rect) - 5 && isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = isFlowRTL ? 'before' : 'after';\n }\n } else {\n // If dropping on the item isn't accepted, try the target before or after depending on the position.\n let mid = this.getFlowStart(rect) + this.getFlowSize(rect) / 2;\n if (flow <= mid && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = isFlowRTL ? 'after' : 'before';\n } else if (flow >= mid && isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = isFlowRTL ? 'before' : 'after';\n }\n }\n\n return target;\n }\n }\n\n let item = items[Math.min(low, items.length - 1)];\n let element = elementMap.get(String(item.key));\n rect = element?.getBoundingClientRect();\n\n if (rect && (primary < this.getPrimaryStart(rect) || Math.abs(flow - this.getFlowStart(rect)) < Math.abs(flow - this.getFlowEnd(rect)))) {\n return {\n type: 'item',\n key: item.key,\n dropPosition: isFlowRTL ? 'after' : 'before'\n };\n }\n\n return {\n type: 'item',\n key: item.key,\n dropPosition: isFlowRTL ? 'before' : 'after'\n };\n }\n}\n"],"names":[],"version":3,"file":"ListDropTargetDelegate.module.js.map"}
|
|
1
|
+
{"mappings":"AA8BO,MAAM;IAeH,gBAAgB,IAAa,EAAE;QACrC,OAAO,IAAI,CAAC,WAAW,KAAK,eAAe,KAAK,IAAI,GAAG,KAAK,GAAG;IACjE;IAEQ,cAAc,IAAa,EAAE;QACnC,OAAO,IAAI,CAAC,WAAW,KAAK,eAAe,KAAK,KAAK,GAAG,KAAK,MAAM;IACrE;IAEQ,kBAAkB,IAAa,EAAE;QACvC,OAAO,IAAI,CAAC,WAAW,KAAK,eAAe,KAAK,GAAG,GAAG,KAAK,IAAI;IACjE;IAEQ,gBAAgB,IAAa,EAAE;QACrC,OAAO,IAAI,CAAC,WAAW,KAAK,eAAe,KAAK,MAAM,GAAG,KAAK,KAAK;IACrE;IAEQ,aAAa,IAAa,EAAE;QAClC,OAAO,IAAI,CAAC,MAAM,KAAK,UAAU,IAAI,CAAC,eAAe,CAAC,QAAQ,IAAI,CAAC,iBAAiB,CAAC;IACvF;IAEQ,WAAW,IAAa,EAAE;Q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S,WAAW,KAAI;QAC3C,IAAI,CAAC,SAAS,GAAG,CAAA,oBAAA,8BAAA,QAAS,SAAS,KAAI;IACzC;AA0IF","sources":["packages/@react-aria/dnd/src/ListDropTargetDelegate.ts"],"sourcesContent":["import {Direction, DropTarget, DropTargetDelegate, Node, Orientation, RefObject} from '@react-types/shared';\n\ninterface ListDropTargetDelegateOptions {\n /**\n * Whether the items are arranged in a stack or grid.\n * @default 'stack'\n */\n layout?: 'stack' | 'grid',\n /**\n * The primary orientation of the items. Usually this is the\n * direction that the collection scrolls.\n * @default 'vertical'\n */\n orientation?: Orientation,\n /**\n * The horizontal layout direction.\n * @default 'ltr'\n */\n direction?: Direction\n}\n\n// Terms used in the below code:\n// * \"Primary\" – The main layout direction. For stacks, this is the direction\n// that the stack is arranged in (e.g. horizontal or vertical).\n// For grids, this is the main scroll direction.\n// * \"Secondary\" – The secondary layout direction. For stacks, there is no secondary\n// layout direction. For grids, this is the opposite of the primary direction.\n// * \"Flow\" – The flow direction of the items. For stacks, this is the the primary\n// direction. For grids, it is the secondary direction.\n\nexport class ListDropTargetDelegate implements DropTargetDelegate {\n private collection: Iterable<Node<unknown>>;\n private ref: RefObject<HTMLElement | null>;\n private layout: 'stack' | 'grid';\n private orientation: Orientation;\n protected direction: Direction;\n\n constructor(collection: Iterable<Node<unknown>>, ref: RefObject<HTMLElement | null>, options?: ListDropTargetDelegateOptions) {\n this.collection = collection;\n this.ref = ref;\n this.layout = options?.layout || 'stack';\n this.orientation = options?.orientation || 'vertical';\n this.direction = options?.direction || 'ltr';\n }\n\n private getPrimaryStart(rect: DOMRect) {\n return this.orientation === 'horizontal' ? rect.left : rect.top;\n }\n\n private getPrimaryEnd(rect: DOMRect) {\n return this.orientation === 'horizontal' ? rect.right : rect.bottom;\n }\n\n private getSecondaryStart(rect: DOMRect) {\n return this.orientation === 'horizontal' ? rect.top : rect.left;\n }\n\n private getSecondaryEnd(rect: DOMRect) {\n return this.orientation === 'horizontal' ? rect.bottom : rect.right;\n }\n\n private getFlowStart(rect: DOMRect) {\n return this.layout === 'stack' ? this.getPrimaryStart(rect) : this.getSecondaryStart(rect);\n }\n\n private getFlowEnd(rect: DOMRect) {\n return this.layout === 'stack' ? this.getPrimaryEnd(rect) : this.getSecondaryEnd(rect);\n }\n\n private getFlowSize(rect: DOMRect) {\n return this.getFlowEnd(rect) - this.getFlowStart(rect);\n }\n\n getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget {\n if (this.collection[Symbol.iterator]().next().done || !this.ref.current) {\n return {type: 'root'};\n }\n\n let rect: DOMRect | undefined = this.ref.current.getBoundingClientRect();\n let primary = this.orientation === 'horizontal' ? x : y;\n let secondary = this.orientation === 'horizontal' ? y : x;\n primary += this.getPrimaryStart(rect);\n secondary += this.getSecondaryStart(rect);\n\n let flow = this.layout === 'stack' ? primary : secondary;\n let isPrimaryRTL = this.orientation === 'horizontal' && this.direction === 'rtl';\n let isSecondaryRTL = this.layout === 'grid' && this.orientation === 'vertical' && this.direction === 'rtl';\n let isFlowRTL = this.layout === 'stack' ? isPrimaryRTL : isSecondaryRTL;\n\n let collection = this.ref.current?.dataset.collection;\n let elements = this.ref.current.querySelectorAll(collection ? `[data-collection=\"${CSS.escape(collection)}\"]` : '[data-key]');\n let elementMap = new Map<string, HTMLElement>();\n for (let item of elements) {\n if (item instanceof HTMLElement && item.dataset.key != null) {\n elementMap.set(item.dataset.key, item);\n }\n }\n\n // TODO: assume that only item type items are valid drop targets. This is to prevent a crash when dragging over the loader\n // row since it doesn't have a data-key set on it. Will eventually need to handle the case with drag and drop and loaders located between rows aka tree.\n // Can see https://github.com/adobe/react-spectrum/pull/4210/files#diff-21e555e0c597a28215e36137f5be076a65a1e1456c92cd0fdd60f866929aae2a for additional logic\n // that may need to happen then\n let items = [...this.collection].filter(item => item.type === 'item');\n\n if (items.length < 1) {\n return {type: 'root'};\n }\n\n let low = 0;\n let high = items.length;\n while (low < high) {\n let mid = Math.floor((low + high) / 2);\n let item = items[mid];\n let element = elementMap.get(String(item.key));\n if (!element) {\n break;\n }\n let rect = element.getBoundingClientRect();\n let update = (isGreater: boolean) => {\n if (isGreater) {\n low = mid + 1;\n } else {\n high = mid;\n }\n };\n\n if (primary < this.getPrimaryStart(rect)) {\n update(isPrimaryRTL);\n } else if (primary > this.getPrimaryEnd(rect)) {\n update(!isPrimaryRTL);\n } else if (secondary < this.getSecondaryStart(rect)) {\n update(isSecondaryRTL);\n } else if (secondary > this.getSecondaryEnd(rect)) {\n update(!isSecondaryRTL);\n } else {\n let target: DropTarget = {\n type: 'item',\n key: item.key,\n dropPosition: 'on'\n };\n\n if (isValidDropTarget(target)) {\n // Otherwise, if dropping on the item is accepted, try the before/after positions if within 5px\n // of the start or end of the item.\n if (flow <= this.getFlowStart(rect) + 5 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = isFlowRTL ? 'after' : 'before';\n } else if (flow >= this.getFlowEnd(rect) - 5 && isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = isFlowRTL ? 'before' : 'after';\n }\n } else {\n // If dropping on the item isn't accepted, try the target before or after depending on the position.\n let mid = this.getFlowStart(rect) + this.getFlowSize(rect) / 2;\n if (flow <= mid && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = isFlowRTL ? 'after' : 'before';\n } else if (flow >= mid && isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = isFlowRTL ? 'before' : 'after';\n }\n }\n\n return target;\n }\n }\n\n let item = items[Math.min(low, items.length - 1)];\n let element = elementMap.get(String(item.key));\n rect = element?.getBoundingClientRect();\n\n if (rect && (primary < this.getPrimaryStart(rect) || Math.abs(flow - this.getFlowStart(rect)) < Math.abs(flow - this.getFlowEnd(rect)))) {\n return {\n type: 'item',\n key: item.key,\n dropPosition: isFlowRTL ? 'after' : 'before'\n };\n }\n\n return {\n type: 'item',\n key: item.key,\n dropPosition: isFlowRTL ? 'before' : 'after'\n };\n }\n}\n"],"names":[],"version":3,"file":"ListDropTargetDelegate.module.js.map"}
|
package/dist/es-ES.main.js
CHANGED
|
@@ -21,9 +21,9 @@ module.exports = {
|
|
|
21
21
|
one: ()=>`${formatter.number(args.count)} elemento seleccionado`,
|
|
22
22
|
other: ()=>`${formatter.number(args.count)} elementos seleccionados`
|
|
23
23
|
})}.`,
|
|
24
|
-
"dragStartedKeyboard": `Se ha empezado a arrastrar. Pulse el tabulador para ir al
|
|
25
|
-
"dragStartedTouch": `Se ha empezado a arrastrar. Vaya al
|
|
26
|
-
"dragStartedVirtual": `Se ha empezado a arrastrar. Vaya al
|
|
24
|
+
"dragStartedKeyboard": `Se ha empezado a arrastrar. Pulse el tabulador para ir al destino donde se vaya a colocar y, a continuaci\xf3n, pulse Intro para soltar, o pulse Escape para cancelar.`,
|
|
25
|
+
"dragStartedTouch": `Se ha empezado a arrastrar. Vaya al destino donde se vaya a colocar y, a continuaci\xf3n, pulse dos veces para soltar.`,
|
|
26
|
+
"dragStartedVirtual": `Se ha empezado a arrastrar. Vaya al destino donde se vaya a colocar y, a continuaci\xf3n, haga clic o pulse Intro para soltar.`,
|
|
27
27
|
"dropCanceled": `Se ha cancelado la colocaci\xf3n.`,
|
|
28
28
|
"dropComplete": `Colocaci\xf3n finalizada.`,
|
|
29
29
|
"dropDescriptionKeyboard": `Pulse Intro para soltar. Pulse Escape para cancelar el arrastre.`,
|
package/dist/es-ES.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAAA,iBAAiB;IAAG,2BAA2B,CAAC,qCAAqC,CAAC;IACpF,8BAA8B,CAAC,qCAAqC,CAAC;IACrE,4BAA4B,CAAC,2CAA2C,CAAC;IACzE,wBAAwB,CAAC,yCAAyC,CAAC;IACnE,0BAA0B,CAAC,mCAAmC,CAAC;IAC/D,YAAY,CAAC,OAAS,CAAC,UAAU,EAAE,KAAK,QAAQ,EAAE;IAClD,qBAAqB,CAAC,MAAM,YAAc,CAAC,UAAU,EAAE,UAAU,MA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,CAAC,yBAAsB,CAAC;IACxC,2BAA2B,CAAC,gEAAgE,CAAC;IAC7F,wBAAwB,CAAC,4BAA4B,CAAC;IACtD,0BAA0B,CAAC,sBAAsB,CAAC;IAClD,iBAAiB,CAAC,0BAAuB,CAAC;IAC1C,cAAc,CAAC,OAAS,CAAC,UAAU,EAAE,KAAK,QAAQ,EAAE;IACpD,cAAc,CAAC,SAAS,CAAC;IACzB,mBAAmB,CAAC,mDAAmD,CAAC;IACxE,gBAAgB,CAAC,uDAAuD,CAAC;IACzE,kBAAkB,CAAC,iDAAiD,CAAC;IACrE,eAAe,CAAC,OAAS,CAAC,uBAAoB,EAAE,KAAK,QAAQ,EAAE;IAC/D,gBAAgB,CAAC,OAAS,CAAC,kBAAkB,EAAE,KAAK,QAAQ,EAAE;IAC9D,iBAAiB,CAAC,OAAS,CAAC,eAAe,EAAE,KAAK,cAAc,CAAC,GAAG,EAAE,KAAK,aAAa,EAAE;AAC5F","sources":["packages/@react-aria/dnd/intl/es-ES.json"],"sourcesContent":["{\n \"dragDescriptionKeyboard\": \"Pulse Intro para empezar a arrastrar.\",\n \"dragDescriptionKeyboardAlt\": \"Pulse Intro para empezar a arrastrar.\",\n \"dragDescriptionLongPress\": \"Mantenga pulsado para comenzar a arrastrar.\",\n \"dragDescriptionTouch\": \"Pulse dos veces para iniciar el arrastre.\",\n \"dragDescriptionVirtual\": \"Haga clic para iniciar el arrastre.\",\n \"dragItem\": \"Arrastrar {itemText}\",\n \"dragSelectedItems\": \"Arrastrar {count, plural, one {# elemento seleccionado} other {# elementos seleccionados}}\",\n \"dragSelectedKeyboard\": \"Pulse Intro para arrastrar {count, plural, one {# elemento seleccionado} other {# elementos seleccionados}}.\",\n \"dragSelectedKeyboardAlt\": \"Pulse Alt + Intro para arrastrar {count, plural, one {# elemento seleccionado} other {# elementos seleccionados}}.\",\n \"dragSelectedLongPress\": \"Mantenga pulsado para arrastrar {count, plural, one {# elemento seleccionado} other {# elementos seleccionados}}.\",\n \"dragStartedKeyboard\": \"Se ha empezado a arrastrar. Pulse el tabulador para ir al destino donde se vaya a colocar y, a continuación, pulse Intro para soltar, o pulse Escape para cancelar.\",\n \"dragStartedTouch\": \"Se ha empezado a arrastrar. Vaya al destino donde se vaya a colocar y, a continuación, pulse dos veces para soltar.\",\n \"dragStartedVirtual\": \"Se ha empezado a arrastrar. Vaya al destino donde se vaya a colocar y, a continuación, haga clic o pulse Intro para soltar.\",\n \"dropCanceled\": \"Se ha cancelado la colocación.\",\n \"dropComplete\": \"Colocación finalizada.\",\n \"dropDescriptionKeyboard\": \"Pulse Intro para soltar. Pulse Escape para cancelar el arrastre.\",\n \"dropDescriptionTouch\": \"Pulse dos veces para soltar.\",\n \"dropDescriptionVirtual\": \"Haga clic para soltar.\",\n \"dropIndicator\": \"indicador de colocación\",\n \"dropOnItem\": \"Soltar en {itemText}\",\n \"dropOnRoot\": \"Soltar en\",\n \"endDragKeyboard\": \"Arrastrando. Pulse Intro para cancelar el arrastre.\",\n \"endDragTouch\": \"Arrastrando. Pulse dos veces para cancelar el arrastre.\",\n \"endDragVirtual\": \"Arrastrando. Haga clic para cancelar el arrastre.\",\n \"insertAfter\": \"Insertar después de {itemText}\",\n \"insertBefore\": \"Insertar antes de {itemText}\",\n \"insertBetween\": \"Insertar entre {beforeItemText} y {afterItemText}\"\n}\n"],"names":[],"version":3,"file":"es-ES.main.js.map"}
|
package/dist/es-ES.mjs
CHANGED
|
@@ -22,9 +22,9 @@ $204b5c01bd3acf26$exports = {
|
|
|
22
22
|
one: ()=>`${formatter.number(args.count)} elemento seleccionado`,
|
|
23
23
|
other: ()=>`${formatter.number(args.count)} elementos seleccionados`
|
|
24
24
|
})}.`,
|
|
25
|
-
"dragStartedKeyboard": `Se ha empezado a arrastrar. Pulse el tabulador para ir al
|
|
26
|
-
"dragStartedTouch": `Se ha empezado a arrastrar. Vaya al
|
|
27
|
-
"dragStartedVirtual": `Se ha empezado a arrastrar. Vaya al
|
|
25
|
+
"dragStartedKeyboard": `Se ha empezado a arrastrar. Pulse el tabulador para ir al destino donde se vaya a colocar y, a continuaci\xf3n, pulse Intro para soltar, o pulse Escape para cancelar.`,
|
|
26
|
+
"dragStartedTouch": `Se ha empezado a arrastrar. Vaya al destino donde se vaya a colocar y, a continuaci\xf3n, pulse dos veces para soltar.`,
|
|
27
|
+
"dragStartedVirtual": `Se ha empezado a arrastrar. Vaya al destino donde se vaya a colocar y, a continuaci\xf3n, haga clic o pulse Intro para soltar.`,
|
|
28
28
|
"dropCanceled": `Se ha cancelado la colocaci\xf3n.`,
|
|
29
29
|
"dropComplete": `Colocaci\xf3n finalizada.`,
|
|
30
30
|
"dropDescriptionKeyboard": `Pulse Intro para soltar. Pulse Escape para cancelar el arrastre.`,
|
package/dist/es-ES.module.js
CHANGED
|
@@ -22,9 +22,9 @@ $204b5c01bd3acf26$exports = {
|
|
|
22
22
|
one: ()=>`${formatter.number(args.count)} elemento seleccionado`,
|
|
23
23
|
other: ()=>`${formatter.number(args.count)} elementos seleccionados`
|
|
24
24
|
})}.`,
|
|
25
|
-
"dragStartedKeyboard": `Se ha empezado a arrastrar. Pulse el tabulador para ir al
|
|
26
|
-
"dragStartedTouch": `Se ha empezado a arrastrar. Vaya al
|
|
27
|
-
"dragStartedVirtual": `Se ha empezado a arrastrar. Vaya al
|
|
25
|
+
"dragStartedKeyboard": `Se ha empezado a arrastrar. Pulse el tabulador para ir al destino donde se vaya a colocar y, a continuaci\xf3n, pulse Intro para soltar, o pulse Escape para cancelar.`,
|
|
26
|
+
"dragStartedTouch": `Se ha empezado a arrastrar. Vaya al destino donde se vaya a colocar y, a continuaci\xf3n, pulse dos veces para soltar.`,
|
|
27
|
+
"dragStartedVirtual": `Se ha empezado a arrastrar. Vaya al destino donde se vaya a colocar y, a continuaci\xf3n, haga clic o pulse Intro para soltar.`,
|
|
28
28
|
"dropCanceled": `Se ha cancelado la colocaci\xf3n.`,
|
|
29
29
|
"dropComplete": `Colocaci\xf3n finalizada.`,
|
|
30
30
|
"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AG,CAAC,CAAC;IACjQ,yBAAyB,CAAC,MAAM,YAAc,CAAC,gCAAgC,EAAE,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,sBAAsB,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,wBAAwB,CAAC;QAAA,GAAG,CAAC,CAAC;IAC9P,uBAAuB,CAAC,sKAAmK,CAAC;IAC5L,oBAAoB,CAAC,sHAAmH,CAAC;IACzI,sBAAsB,CAAC,8HAA2H,CAAC;IACnJ,gBAAgB,CAAC,iCAA8B,CAAC;IAChD,gBAAgB,CAAC,yBAAsB,CAAC;IACxC,2BAA2B,CAAC,gEAAgE,CAAC;IAC7F,wBAAwB,CAAC,4BAA4B,CAAC;IACtD,0BAA0B,CAAC,sBAAsB,CAAC;IAClD,iBAAiB,CAAC,0BAAuB,CAAC;IAC1C,cAAc,CAAC,OAAS,CAAC,UAAU,EAAE,KAAK,QAAQ,EAAE;IACpD,cAAc,CAAC,SAAS,CAAC;IACzB,mBAAmB,CAAC,mDAAmD,CAAC;IACxE,gBAAgB,CAAC,uDAAuD,CAAC;IACzE,kBAAkB,CAAC,iDAAiD,CAAC;IACrE,eAAe,CAAC,OAAS,CAAC,uBAAoB,EAAE,KAAK,QAAQ,EAAE;IAC/D,gBAAgB,CAAC,OAAS,CAAC,kBAAkB,EAAE,KAAK,QAAQ,EAAE;IAC9D,iBAAiB,CAAC,OAAS,CAAC,eAAe,EAAE,KAAK,cAAc,CAAC,GAAG,EAAE,KAAK,aAAa,EAAE;AAC5F","sources":["packages/@react-aria/dnd/intl/es-ES.json"],"sourcesContent":["{\n \"dragDescriptionKeyboard\": \"Pulse Intro para empezar a arrastrar.\",\n \"dragDescriptionKeyboardAlt\": \"Pulse Intro para empezar a arrastrar.\",\n \"dragDescriptionLongPress\": \"Mantenga pulsado para comenzar a arrastrar.\",\n \"dragDescriptionTouch\": \"Pulse dos veces para iniciar el arrastre.\",\n \"dragDescriptionVirtual\": \"Haga clic para iniciar el arrastre.\",\n \"dragItem\": \"Arrastrar {itemText}\",\n \"dragSelectedItems\": \"Arrastrar {count, plural, one {# elemento seleccionado} other {# elementos seleccionados}}\",\n \"dragSelectedKeyboard\": \"Pulse Intro para arrastrar {count, plural, one {# elemento seleccionado} other {# elementos seleccionados}}.\",\n \"dragSelectedKeyboardAlt\": \"Pulse Alt + Intro para arrastrar {count, plural, one {# elemento seleccionado} other {# elementos seleccionados}}.\",\n \"dragSelectedLongPress\": \"Mantenga pulsado para arrastrar {count, plural, one {# elemento seleccionado} other {# elementos seleccionados}}.\",\n \"dragStartedKeyboard\": \"Se ha empezado a arrastrar. Pulse el tabulador para ir al destino donde se vaya a colocar y, a continuación, pulse Intro para soltar, o pulse Escape para cancelar.\",\n \"dragStartedTouch\": \"Se ha empezado a arrastrar. Vaya al destino donde se vaya a colocar y, a continuación, pulse dos veces para soltar.\",\n \"dragStartedVirtual\": \"Se ha empezado a arrastrar. Vaya al destino donde se vaya a colocar y, a continuación, haga clic o pulse Intro para soltar.\",\n \"dropCanceled\": \"Se ha cancelado la colocación.\",\n \"dropComplete\": \"Colocación finalizada.\",\n \"dropDescriptionKeyboard\": \"Pulse Intro para soltar. Pulse Escape para cancelar el arrastre.\",\n \"dropDescriptionTouch\": \"Pulse dos veces para soltar.\",\n \"dropDescriptionVirtual\": \"Haga clic para soltar.\",\n \"dropIndicator\": \"indicador de colocación\",\n \"dropOnItem\": \"Soltar en {itemText}\",\n \"dropOnRoot\": \"Soltar en\",\n \"endDragKeyboard\": \"Arrastrando. Pulse Intro para cancelar el arrastre.\",\n \"endDragTouch\": \"Arrastrando. Pulse dos veces para cancelar el arrastre.\",\n \"endDragVirtual\": \"Arrastrando. Haga clic para cancelar el arrastre.\",\n \"insertAfter\": \"Insertar después de {itemText}\",\n \"insertBefore\": \"Insertar antes de {itemText}\",\n \"insertBetween\": \"Insertar entre {beforeItemText} y {afterItemText}\"\n}\n"],"names":[],"version":3,"file":"es-ES.module.js.map"}
|