@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 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)(()=>$67560de7c78cb232$export$c28d9fb4a54e471a({
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,
package/dist/main.js CHANGED
@@ -1187,7 +1187,7 @@ function $419982e205c8e8dc$export$62447ad3d2ec7da6() {
1187
1187
 
1188
1188
  const $1ca228bc9257ca16$var$DROP_ACTIVATE_TIMEOUT = 800;
1189
1189
  function $1ca228bc9257ca16$export$ccdee5eaf73cf661(options) {
1190
- let { hasDropButton: hasDropButton } = options;
1190
+ let { hasDropButton: hasDropButton, isDisabled: isDisabled } = options;
1191
1191
  let [isDropTarget, setDropTarget] = (0, $4vY0V$react.useState)(false);
1192
1192
  let state = (0, $4vY0V$react.useRef)({
1193
1193
  x: 0,
@@ -1360,7 +1360,9 @@ function $1ca228bc9257ca16$export$ccdee5eaf73cf661(options) {
1360
1360
  return allowedOperations[0];
1361
1361
  });
1362
1362
  let { ref: ref } = options;
1363
- (0, $4vY0V$reactariautils.useLayoutEffect)(()=>$28e10663603f5ea1$export$c28d9fb4a54e471a({
1363
+ (0, $4vY0V$reactariautils.useLayoutEffect)(()=>{
1364
+ if (isDisabled) return;
1365
+ return $28e10663603f5ea1$export$c28d9fb4a54e471a({
1364
1366
  element: ref.current,
1365
1367
  getDropOperation: getDropOperationKeyboard,
1366
1368
  onDropEnter (e) {
@@ -1373,7 +1375,9 @@ function $1ca228bc9257ca16$export$ccdee5eaf73cf661(options) {
1373
1375
  },
1374
1376
  onDrop: onKeyboardDrop,
1375
1377
  onDropActivate: onDropActivate
1376
- }), [
1378
+ });
1379
+ }, [
1380
+ isDisabled,
1377
1381
  ref,
1378
1382
  getDropOperationKeyboard,
1379
1383
  onDropEnter,
@@ -1382,6 +1386,13 @@ function $1ca228bc9257ca16$export$ccdee5eaf73cf661(options) {
1382
1386
  onDropActivate
1383
1387
  ]);
1384
1388
  let { dropProps: dropProps } = (0, $419982e205c8e8dc$export$62447ad3d2ec7da6)();
1389
+ if (isDisabled) return {
1390
+ dropProps: {},
1391
+ dropButtonProps: {
1392
+ isDisabled: true
1393
+ },
1394
+ isDropTarget: false
1395
+ };
1385
1396
  return {
1386
1397
  dropProps: {
1387
1398
  ...!hasDropButton && dropProps,
@@ -2398,6 +2409,7 @@ function $74f3dedaa4d234b4$var$addGlobalEventListener(event, fn) {
2398
2409
  };
2399
2410
  }
2400
2411
  function $74f3dedaa4d234b4$export$2314ca2a3e892862(options) {
2412
+ let { isDisabled: isDisabled } = options;
2401
2413
  let isFocusedRef = (0, $4vY0V$react.useRef)(false);
2402
2414
  let { focusProps: focusProps } = (0, $4vY0V$reactariainteractions.useFocus)({
2403
2415
  onFocusChange: (isFocused)=>{
@@ -2436,8 +2448,10 @@ function $74f3dedaa4d234b4$export$2314ca2a3e892862(options) {
2436
2448
  options.onPaste(items);
2437
2449
  });
2438
2450
  (0, $4vY0V$react.useEffect)(()=>{
2451
+ if (isDisabled) return;
2439
2452
  return (0, $4vY0V$reactariautils.chain)($74f3dedaa4d234b4$var$addGlobalEventListener("beforecopy", onBeforeCopy), $74f3dedaa4d234b4$var$addGlobalEventListener("copy", onCopy), $74f3dedaa4d234b4$var$addGlobalEventListener("beforecut", onBeforeCut), $74f3dedaa4d234b4$var$addGlobalEventListener("cut", onCut), $74f3dedaa4d234b4$var$addGlobalEventListener("beforepaste", onBeforePaste), $74f3dedaa4d234b4$var$addGlobalEventListener("paste", onPaste));
2440
2453
  }, [
2454
+ isDisabled,
2441
2455
  onBeforeCopy,
2442
2456
  onCopy,
2443
2457
  onBeforeCut,