@react-aria/dnd 3.5.4-nightly.4481 → 3.5.4-nightly.4486
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/import.mjs +17 -3
- package/dist/main.js +17 -3
- package/dist/main.js.map +1 -1
- package/dist/module.js +17 -3
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +6 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +11 -11
- package/src/useClipboard.ts +8 -2
- package/src/useDrop.ts +33 -19
package/dist/module.js
CHANGED
|
@@ -1167,7 +1167,7 @@ function $224594fe3e57ff1e$export$62447ad3d2ec7da6() {
|
|
|
1167
1167
|
|
|
1168
1168
|
const $5c06e4929e123553$var$DROP_ACTIVATE_TIMEOUT = 800;
|
|
1169
1169
|
function $5c06e4929e123553$export$ccdee5eaf73cf661(options) {
|
|
1170
|
-
let { hasDropButton: hasDropButton } = options;
|
|
1170
|
+
let { hasDropButton: hasDropButton, isDisabled: isDisabled } = options;
|
|
1171
1171
|
let [isDropTarget, setDropTarget] = (0, $fP8tg$useState)(false);
|
|
1172
1172
|
let state = (0, $fP8tg$useRef)({
|
|
1173
1173
|
x: 0,
|
|
@@ -1340,7 +1340,9 @@ function $5c06e4929e123553$export$ccdee5eaf73cf661(options) {
|
|
|
1340
1340
|
return allowedOperations[0];
|
|
1341
1341
|
});
|
|
1342
1342
|
let { ref: ref } = options;
|
|
1343
|
-
(0, $fP8tg$useLayoutEffect)(()
|
|
1343
|
+
(0, $fP8tg$useLayoutEffect)(()=>{
|
|
1344
|
+
if (isDisabled) return;
|
|
1345
|
+
return $67560de7c78cb232$export$c28d9fb4a54e471a({
|
|
1344
1346
|
element: ref.current,
|
|
1345
1347
|
getDropOperation: getDropOperationKeyboard,
|
|
1346
1348
|
onDropEnter (e) {
|
|
@@ -1353,7 +1355,9 @@ function $5c06e4929e123553$export$ccdee5eaf73cf661(options) {
|
|
|
1353
1355
|
},
|
|
1354
1356
|
onDrop: onKeyboardDrop,
|
|
1355
1357
|
onDropActivate: onDropActivate
|
|
1356
|
-
})
|
|
1358
|
+
});
|
|
1359
|
+
}, [
|
|
1360
|
+
isDisabled,
|
|
1357
1361
|
ref,
|
|
1358
1362
|
getDropOperationKeyboard,
|
|
1359
1363
|
onDropEnter,
|
|
@@ -1362,6 +1366,13 @@ function $5c06e4929e123553$export$ccdee5eaf73cf661(options) {
|
|
|
1362
1366
|
onDropActivate
|
|
1363
1367
|
]);
|
|
1364
1368
|
let { dropProps: dropProps } = (0, $224594fe3e57ff1e$export$62447ad3d2ec7da6)();
|
|
1369
|
+
if (isDisabled) return {
|
|
1370
|
+
dropProps: {},
|
|
1371
|
+
dropButtonProps: {
|
|
1372
|
+
isDisabled: true
|
|
1373
|
+
},
|
|
1374
|
+
isDropTarget: false
|
|
1375
|
+
};
|
|
1365
1376
|
return {
|
|
1366
1377
|
dropProps: {
|
|
1367
1378
|
...!hasDropButton && dropProps,
|
|
@@ -2378,6 +2389,7 @@ function $9fcc7f0d70d084ee$var$addGlobalEventListener(event, fn) {
|
|
|
2378
2389
|
};
|
|
2379
2390
|
}
|
|
2380
2391
|
function $9fcc7f0d70d084ee$export$2314ca2a3e892862(options) {
|
|
2392
|
+
let { isDisabled: isDisabled } = options;
|
|
2381
2393
|
let isFocusedRef = (0, $fP8tg$useRef)(false);
|
|
2382
2394
|
let { focusProps: focusProps } = (0, $fP8tg$useFocus)({
|
|
2383
2395
|
onFocusChange: (isFocused)=>{
|
|
@@ -2416,8 +2428,10 @@ function $9fcc7f0d70d084ee$export$2314ca2a3e892862(options) {
|
|
|
2416
2428
|
options.onPaste(items);
|
|
2417
2429
|
});
|
|
2418
2430
|
(0, $fP8tg$useEffect)(()=>{
|
|
2431
|
+
if (isDisabled) return;
|
|
2419
2432
|
return (0, $fP8tg$chain)($9fcc7f0d70d084ee$var$addGlobalEventListener("beforecopy", onBeforeCopy), $9fcc7f0d70d084ee$var$addGlobalEventListener("copy", onCopy), $9fcc7f0d70d084ee$var$addGlobalEventListener("beforecut", onBeforeCut), $9fcc7f0d70d084ee$var$addGlobalEventListener("cut", onCut), $9fcc7f0d70d084ee$var$addGlobalEventListener("beforepaste", onBeforePaste), $9fcc7f0d70d084ee$var$addGlobalEventListener("paste", onPaste));
|
|
2420
2433
|
}, [
|
|
2434
|
+
isDisabled,
|
|
2421
2435
|
onBeforeCopy,
|
|
2422
2436
|
onCopy,
|
|
2423
2437
|
onBeforeCut,
|