@react-aria/dnd
Advanced tools
Comparing version 3.0.0-nightly-12920fc91-241104 to 3.0.0-nightly-19bc0b845-241211
@@ -24,4 +24,3 @@ | ||
* governing permissions and limitations under the License. | ||
*/ var $76b1e110a27b1ccd$export$60b7b4bcf3903d8e; | ||
(function(DROP_OPERATION) { | ||
*/ var $76b1e110a27b1ccd$export$60b7b4bcf3903d8e = /*#__PURE__*/ function(DROP_OPERATION) { | ||
DROP_OPERATION[DROP_OPERATION["none"] = 0] = "none"; | ||
@@ -33,3 +32,4 @@ DROP_OPERATION[DROP_OPERATION["cancel"] = 0] = "cancel"; | ||
DROP_OPERATION[DROP_OPERATION["all"] = 7] = "all"; | ||
})($76b1e110a27b1ccd$export$60b7b4bcf3903d8e || ($76b1e110a27b1ccd$export$60b7b4bcf3903d8e = {})); | ||
return DROP_OPERATION; | ||
}({}); | ||
const $76b1e110a27b1ccd$export$9bbdfc78cf083e16 = { | ||
@@ -36,0 +36,0 @@ ...$76b1e110a27b1ccd$export$60b7b4bcf3903d8e, |
@@ -11,4 +11,3 @@ /* | ||
* governing permissions and limitations under the License. | ||
*/ var $103790afe9474d1c$export$60b7b4bcf3903d8e; | ||
(function(DROP_OPERATION) { | ||
*/ var $103790afe9474d1c$export$60b7b4bcf3903d8e = /*#__PURE__*/ function(DROP_OPERATION) { | ||
DROP_OPERATION[DROP_OPERATION["none"] = 0] = "none"; | ||
@@ -20,3 +19,4 @@ DROP_OPERATION[DROP_OPERATION["cancel"] = 0] = "cancel"; | ||
DROP_OPERATION[DROP_OPERATION["all"] = 7] = "all"; | ||
})($103790afe9474d1c$export$60b7b4bcf3903d8e || ($103790afe9474d1c$export$60b7b4bcf3903d8e = {})); | ||
return DROP_OPERATION; | ||
}({}); | ||
const $103790afe9474d1c$export$9bbdfc78cf083e16 = { | ||
@@ -23,0 +23,0 @@ ...$103790afe9474d1c$export$60b7b4bcf3903d8e, |
@@ -26,3 +26,3 @@ var $l6JIF$reactdom = require("react-dom"); | ||
function $2dccaca1f4baa446$var$DragPreview(props, ref) { | ||
const $2dccaca1f4baa446$export$905ab40ac2179daa = /*#__PURE__*/ (0, ($parcel$interopDefault($l6JIF$react))).forwardRef(function DragPreview(props, ref) { | ||
let render = props.children; | ||
@@ -62,6 +62,5 @@ let [children, setChildren] = (0, $l6JIF$react.useState)(null); | ||
}, children); | ||
} | ||
let $2dccaca1f4baa446$export$905ab40ac2179daa = /*#__PURE__*/ (0, ($parcel$interopDefault($l6JIF$react))).forwardRef($2dccaca1f4baa446$var$DragPreview); | ||
}); | ||
//# sourceMappingURL=DragPreview.main.js.map |
@@ -16,3 +16,3 @@ import {flushSync as $eLjnH$flushSync} from "react-dom"; | ||
function $ad0e3f3d9c50e4ba$var$DragPreview(props, ref) { | ||
const $ad0e3f3d9c50e4ba$export$905ab40ac2179daa = /*#__PURE__*/ (0, $eLjnH$react).forwardRef(function DragPreview(props, ref) { | ||
let render = props.children; | ||
@@ -52,4 +52,3 @@ let [children, setChildren] = (0, $eLjnH$useState)(null); | ||
}, children); | ||
} | ||
let $ad0e3f3d9c50e4ba$export$905ab40ac2179daa = /*#__PURE__*/ (0, $eLjnH$react).forwardRef($ad0e3f3d9c50e4ba$var$DragPreview); | ||
}); | ||
@@ -56,0 +55,0 @@ |
@@ -179,5 +179,5 @@ import { DirectoryDropItem, DropItem, FileDropItem, TextDropItem, DropActivateEvent, DropEnterEvent, DropEvent, DropExitEvent, DropMoveEvent, DropOperation, FocusableElement, DragTypes, RefObject, DroppableCollectionProps, DropTargetDelegate, KeyboardDelegate, DropTarget, DragEndEvent, DragItem, DragMoveEvent, DragPreviewRenderer, DragStartEvent, Key, DOMAttributes, Direction, Node, Orientation } from "@react-types/shared"; | ||
export interface DragPreviewProps { | ||
children: (items: DragItem[]) => JSX.Element; | ||
children: (items: DragItem[]) => JSX.Element | null; | ||
} | ||
export let DragPreview: React.ForwardRefExoticComponent<DragPreviewProps & React.RefAttributes<DragPreviewRenderer>>; | ||
export const DragPreview: React.ForwardRefExoticComponent<DragPreviewProps & React.RefAttributes<DragPreviewRenderer | null>>; | ||
export interface ClipboardProps { | ||
@@ -184,0 +184,0 @@ /** A function that returns the items to copy. */ |
@@ -208,3 +208,3 @@ var $4620ae0dc40f0031$exports = require("./utils.main.js"); | ||
} | ||
} else if (state.selectionManager.focusedKey === prevFocusedKey && isInternal && target.type === 'item' && target.dropPosition !== 'on' && draggingKeys.has((_state_collection_getItem = state.collection.getItem(prevFocusedKey)) === null || _state_collection_getItem === void 0 ? void 0 : _state_collection_getItem.parentKey)) { | ||
} else if (prevFocusedKey != null && state.selectionManager.focusedKey === prevFocusedKey && isInternal && target.type === 'item' && target.dropPosition !== 'on' && draggingKeys.has((_state_collection_getItem = state.collection.getItem(prevFocusedKey)) === null || _state_collection_getItem === void 0 ? void 0 : _state_collection_getItem.parentKey)) { | ||
var _state_collection_getItem1; | ||
@@ -221,3 +221,3 @@ var _state_collection_getItem_parentKey; | ||
(0, $foOxf$reactariainteractions.setInteractionModality)('keyboard'); | ||
} else if (!state.selectionManager.isSelected(state.selectionManager.focusedKey)) (0, $foOxf$reactariainteractions.setInteractionModality)('keyboard'); | ||
} else if (state.selectionManager.focusedKey != null && !state.selectionManager.isSelected(state.selectionManager.focusedKey)) (0, $foOxf$reactariainteractions.setInteractionModality)('keyboard'); | ||
state.selectionManager.setFocused(true); | ||
@@ -406,3 +406,3 @@ } | ||
// For now, we assume that individual cells cannot be dropped on. | ||
let item = localState.state.collection.getItem(key); | ||
let item = key != null ? localState.state.collection.getItem(key) : null; | ||
if ((item === null || item === void 0 ? void 0 : item.type) === 'cell') key = item.parentKey; | ||
@@ -409,0 +409,0 @@ // If the focused item is also selected, the default drop target is after the last selected item. |
@@ -202,3 +202,3 @@ import {clearGlobalDnDState as $7252cd45fc48c07c$export$70936501603e6c57, DIRECTORY_DRAG_TYPE as $7252cd45fc48c07c$export$990fced5dfac2637, droppableCollectionMap as $7252cd45fc48c07c$export$dfdf5deeaf27473f, getTypes as $7252cd45fc48c07c$export$e1d41611756c6326, globalDndState as $7252cd45fc48c07c$export$6ca6700462636d0b, isInternalDropOperation as $7252cd45fc48c07c$export$78bf638634500fa5, setDropCollectionRef as $7252cd45fc48c07c$export$dac8db29d42db9a1} from "./utils.module.js"; | ||
} | ||
} else if (state.selectionManager.focusedKey === prevFocusedKey && isInternal && target.type === 'item' && target.dropPosition !== 'on' && draggingKeys.has((_state_collection_getItem = state.collection.getItem(prevFocusedKey)) === null || _state_collection_getItem === void 0 ? void 0 : _state_collection_getItem.parentKey)) { | ||
} else if (prevFocusedKey != null && state.selectionManager.focusedKey === prevFocusedKey && isInternal && target.type === 'item' && target.dropPosition !== 'on' && draggingKeys.has((_state_collection_getItem = state.collection.getItem(prevFocusedKey)) === null || _state_collection_getItem === void 0 ? void 0 : _state_collection_getItem.parentKey)) { | ||
var _state_collection_getItem1; | ||
@@ -215,3 +215,3 @@ var _state_collection_getItem_parentKey; | ||
(0, $4ZR0C$setInteractionModality)('keyboard'); | ||
} else if (!state.selectionManager.isSelected(state.selectionManager.focusedKey)) (0, $4ZR0C$setInteractionModality)('keyboard'); | ||
} else if (state.selectionManager.focusedKey != null && !state.selectionManager.isSelected(state.selectionManager.focusedKey)) (0, $4ZR0C$setInteractionModality)('keyboard'); | ||
state.selectionManager.setFocused(true); | ||
@@ -400,3 +400,3 @@ } | ||
// For now, we assume that individual cells cannot be dropped on. | ||
let item = localState.state.collection.getItem(key); | ||
let item = key != null ? localState.state.collection.getItem(key) : null; | ||
if ((item === null || item === void 0 ? void 0 : item.type) === 'cell') key = item.parentKey; | ||
@@ -403,0 +403,0 @@ // If the focused item is also selected, the default drop target is after the last selected item. |
{ | ||
"name": "@react-aria/dnd", | ||
"version": "3.0.0-nightly-12920fc91-241104", | ||
"version": "3.0.0-nightly-19bc0b845-241211", | ||
"description": "Spectrum UI components in React", | ||
@@ -25,16 +25,16 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@internationalized/string": "^3.0.0-nightly-12920fc91-241104", | ||
"@react-aria/i18n": "^3.0.0-nightly-12920fc91-241104", | ||
"@react-aria/interactions": "^3.0.0-nightly-12920fc91-241104", | ||
"@react-aria/live-announcer": "^3.0.0-nightly-12920fc91-241104", | ||
"@react-aria/overlays": "^3.0.0-nightly-12920fc91-241104", | ||
"@react-aria/utils": "^3.0.0-nightly-12920fc91-241104", | ||
"@react-stately/dnd": "^3.0.0-nightly-12920fc91-241104", | ||
"@react-types/button": "^3.0.0-nightly-12920fc91-241104", | ||
"@react-types/shared": "^3.0.0-nightly-12920fc91-241104", | ||
"@internationalized/string": "^3.0.0-nightly-19bc0b845-241211", | ||
"@react-aria/i18n": "^3.0.0-nightly-19bc0b845-241211", | ||
"@react-aria/interactions": "^3.0.0-nightly-19bc0b845-241211", | ||
"@react-aria/live-announcer": "^3.0.0-nightly-19bc0b845-241211", | ||
"@react-aria/overlays": "^3.0.0-nightly-19bc0b845-241211", | ||
"@react-aria/utils": "^3.0.0-nightly-19bc0b845-241211", | ||
"@react-stately/dnd": "^3.0.0-nightly-19bc0b845-241211", | ||
"@react-types/button": "^3.0.0-nightly-19bc0b845-241211", | ||
"@react-types/shared": "^3.0.0-nightly-19bc0b845-241211", | ||
"@swc/helpers": "^0.5.0" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0", | ||
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0" | ||
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1", | ||
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" | ||
}, | ||
@@ -44,3 +44,3 @@ "publishConfig": { | ||
}, | ||
"stableVersion": "3.7.4" | ||
"stableVersion": "3.8.0" | ||
} |
@@ -59,3 +59,3 @@ /* | ||
collection: Collection<Node<unknown>>, | ||
focusedKey: Key, | ||
focusedKey: Key | null, | ||
selectedKeys: Set<Key>, | ||
@@ -277,2 +277,3 @@ target: DropTarget, | ||
} else if ( | ||
prevFocusedKey != null && | ||
state.selectionManager.focusedKey === prevFocusedKey && | ||
@@ -298,3 +299,3 @@ isInternal && | ||
setInteractionModality('keyboard'); | ||
} else if (!state.selectionManager.isSelected(state.selectionManager.focusedKey)) { | ||
} else if (state.selectionManager.focusedKey != null && !state.selectionManager.isSelected(state.selectionManager.focusedKey)) { | ||
setInteractionModality('keyboard'); | ||
@@ -539,3 +540,3 @@ } | ||
// For now, we assume that individual cells cannot be dropped on. | ||
let item = localState.state.collection.getItem(key); | ||
let item = key != null ? localState.state.collection.getItem(key) : null; | ||
if (item?.type === 'cell') { | ||
@@ -542,0 +543,0 @@ key = item.parentKey; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1726148
16216