@react-aria/dnd 3.6.1-nightly.4624 → 3.6.1

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.
Files changed (40) hide show
  1. package/dist/DragManager.main.js +68 -68
  2. package/dist/DragManager.mjs +68 -68
  3. package/dist/DragManager.module.js +68 -68
  4. package/dist/DragPreview.main.js +1 -1
  5. package/dist/DragPreview.mjs +1 -1
  6. package/dist/DragPreview.module.js +1 -1
  7. package/dist/ListDropTargetDelegate.main.js +31 -31
  8. package/dist/ListDropTargetDelegate.mjs +31 -31
  9. package/dist/ListDropTargetDelegate.module.js +31 -31
  10. package/dist/constants.main.js +10 -10
  11. package/dist/constants.mjs +10 -10
  12. package/dist/constants.module.js +10 -10
  13. package/dist/useClipboard.main.js +1 -1
  14. package/dist/useClipboard.mjs +1 -1
  15. package/dist/useClipboard.module.js +1 -1
  16. package/dist/useDrag.main.js +38 -38
  17. package/dist/useDrag.mjs +38 -38
  18. package/dist/useDrag.module.js +38 -38
  19. package/dist/useDraggableItem.main.js +17 -17
  20. package/dist/useDraggableItem.mjs +17 -17
  21. package/dist/useDraggableItem.module.js +17 -17
  22. package/dist/useDrop.main.js +30 -30
  23. package/dist/useDrop.mjs +30 -30
  24. package/dist/useDrop.module.js +30 -30
  25. package/dist/useDropIndicator.main.js +17 -17
  26. package/dist/useDropIndicator.mjs +17 -17
  27. package/dist/useDropIndicator.module.js +17 -17
  28. package/dist/useDroppableCollection.main.js +83 -83
  29. package/dist/useDroppableCollection.mjs +83 -83
  30. package/dist/useDroppableCollection.module.js +83 -83
  31. package/dist/useDroppableItem.main.js +2 -2
  32. package/dist/useDroppableItem.mjs +2 -2
  33. package/dist/useDroppableItem.module.js +2 -2
  34. package/dist/useVirtualDrop.main.js +5 -5
  35. package/dist/useVirtualDrop.mjs +5 -5
  36. package/dist/useVirtualDrop.module.js +5 -5
  37. package/dist/utils.main.js +20 -20
  38. package/dist/utils.mjs +20 -20
  39. package/dist/utils.module.js +20 -20
  40. package/package.json +11 -11
@@ -25,20 +25,20 @@ function $parcel$interopDefault(a) {
25
25
 
26
26
  const $fd98cf7cbf233429$var$MESSAGES = {
27
27
  keyboard: {
28
- selected: "dragSelectedKeyboard",
29
- notSelected: "dragDescriptionKeyboard"
28
+ selected: 'dragSelectedKeyboard',
29
+ notSelected: 'dragDescriptionKeyboard'
30
30
  },
31
31
  touch: {
32
- selected: "dragSelectedLongPress",
33
- notSelected: "dragDescriptionLongPress"
32
+ selected: 'dragSelectedLongPress',
33
+ notSelected: 'dragDescriptionLongPress'
34
34
  },
35
35
  virtual: {
36
- selected: "dragDescriptionVirtual",
37
- notSelected: "dragDescriptionVirtual"
36
+ selected: 'dragDescriptionVirtual',
37
+ notSelected: 'dragDescriptionVirtual'
38
38
  }
39
39
  };
40
40
  function $fd98cf7cbf233429$export$b35afafff42da2d9(props, state) {
41
- let stringFormatter = (0, $91Fvt$useLocalizedStringFormatter)((0, ($parcel$interopDefault($91Fvt$intlStringsmodulejs))), "@react-aria/dnd");
41
+ let stringFormatter = (0, $91Fvt$useLocalizedStringFormatter)((0, ($parcel$interopDefault($91Fvt$intlStringsmodulejs))), '@react-aria/dnd');
42
42
  let isDisabled = state.isDisabled || state.selectionManager.isDisabled(props.key);
43
43
  let { dragProps: dragProps, dragButtonProps: dragButtonProps } = (0, $8253ed7ece74b463$export$7941f8aafa4b6021)({
44
44
  getItems () {
@@ -57,7 +57,7 @@ function $fd98cf7cbf233429$export$b35afafff42da2d9(props, state) {
57
57
  },
58
58
  onDragEnd (e) {
59
59
  let { dropOperation: dropOperation } = e;
60
- let isInternal = dropOperation === "cancel" ? false : (0, $7252cd45fc48c07c$export$78bf638634500fa5)();
60
+ let isInternal = dropOperation === 'cancel' ? false : (0, $7252cd45fc48c07c$export$78bf638634500fa5)();
61
61
  state.endDrag({
62
62
  ...e,
63
63
  keys: state.draggingKeys,
@@ -73,9 +73,9 @@ function $fd98cf7cbf233429$export$b35afafff42da2d9(props, state) {
73
73
  let description;
74
74
  // Override description to include selected item count.
75
75
  let modality = (0, $7252cd45fc48c07c$export$49bac5d6d4b352ea)();
76
- if (!props.hasDragButton && state.selectionManager.selectionMode !== "none") {
77
- let msg = $fd98cf7cbf233429$var$MESSAGES[modality][isSelected ? "selected" : "notSelected"];
78
- if (props.hasAction && modality === "keyboard") msg += "Alt";
76
+ if (!props.hasDragButton && state.selectionManager.selectionMode !== 'none') {
77
+ let msg = $fd98cf7cbf233429$var$MESSAGES[modality][isSelected ? 'selected' : 'notSelected'];
78
+ if (props.hasAction && modality === 'keyboard') msg += 'Alt';
79
79
  if (isSelected) description = stringFormatter.format(msg, {
80
80
  count: numKeysForDrag
81
81
  });
@@ -83,14 +83,14 @@ function $fd98cf7cbf233429$export$b35afafff42da2d9(props, state) {
83
83
  // Remove the onClick handler from useDrag. Long pressing will be required on touch devices,
84
84
  // and NVDA/JAWS are always in forms mode within collection components.
85
85
  delete dragProps.onClick;
86
- } else if (isSelected) dragButtonLabel = stringFormatter.format("dragSelectedItems", {
86
+ } else if (isSelected) dragButtonLabel = stringFormatter.format('dragSelectedItems', {
87
87
  count: numKeysForDrag
88
88
  });
89
89
  else {
90
90
  var _state_collection_getTextValue, _state_collection;
91
91
  var _state_collection_getTextValue1, _ref;
92
- let itemText = (_ref = (_state_collection_getTextValue1 = (_state_collection_getTextValue = (_state_collection = state.collection).getTextValue) === null || _state_collection_getTextValue === void 0 ? void 0 : _state_collection_getTextValue.call(_state_collection, props.key)) !== null && _state_collection_getTextValue1 !== void 0 ? _state_collection_getTextValue1 : item === null || item === void 0 ? void 0 : item.textValue) !== null && _ref !== void 0 ? _ref : "";
93
- dragButtonLabel = stringFormatter.format("dragItem", {
92
+ let itemText = (_ref = (_state_collection_getTextValue1 = (_state_collection_getTextValue = (_state_collection = state.collection).getTextValue) === null || _state_collection_getTextValue === void 0 ? void 0 : _state_collection_getTextValue.call(_state_collection, props.key)) !== null && _state_collection_getTextValue1 !== void 0 ? _state_collection_getTextValue1 : item === null || item === void 0 ? void 0 : item.textValue) !== null && _ref !== void 0 ? _ref : '';
93
+ dragButtonLabel = stringFormatter.format('dragItem', {
94
94
  itemText: itemText
95
95
  });
96
96
  }
@@ -98,8 +98,8 @@ function $fd98cf7cbf233429$export$b35afafff42da2d9(props, state) {
98
98
  if (description) Object.assign(dragProps, descriptionProps);
99
99
  if (!props.hasDragButton && props.hasAction) {
100
100
  let { onKeyDownCapture: onKeyDownCapture, onKeyUpCapture: onKeyUpCapture } = dragProps;
101
- if (modality === "touch") // Remove long press description if an action is present, because in that case long pressing selects the item.
102
- delete dragProps["aria-describedby"];
101
+ if (modality === 'touch') // Remove long press description if an action is present, because in that case long pressing selects the item.
102
+ delete dragProps['aria-describedby'];
103
103
  // Require Alt key if there is a conflicting action.
104
104
  dragProps.onKeyDownCapture = (e)=>{
105
105
  if (e.altKey) onKeyDownCapture === null || onKeyDownCapture === void 0 ? void 0 : onKeyDownCapture(e);
@@ -113,7 +113,7 @@ function $fd98cf7cbf233429$export$b35afafff42da2d9(props, state) {
113
113
  dragButtonProps: {
114
114
  ...dragButtonProps,
115
115
  isDisabled: isDisabled,
116
- "aria-label": dragButtonLabel
116
+ 'aria-label': dragButtonLabel
117
117
  }
118
118
  };
119
119
  }
@@ -35,16 +35,16 @@ function $1ca228bc9257ca16$export$ccdee5eaf73cf661(options) {
35
35
  x: 0,
36
36
  y: 0,
37
37
  dragOverElements: new Set(),
38
- dropEffect: "none",
38
+ dropEffect: 'none',
39
39
  allowedOperations: (0, $76b1e110a27b1ccd$exports.DROP_OPERATION).all,
40
40
  dropActivateTimer: null
41
41
  }).current;
42
42
  let fireDropEnter = (e)=>{
43
43
  setDropTarget(true);
44
- if (typeof options.onDropEnter === "function") {
44
+ if (typeof options.onDropEnter === 'function') {
45
45
  let rect = e.currentTarget.getBoundingClientRect();
46
46
  options.onDropEnter({
47
- type: "dropenter",
47
+ type: 'dropenter',
48
48
  x: e.clientX - rect.x,
49
49
  y: e.clientY - rect.y
50
50
  });
@@ -52,10 +52,10 @@ function $1ca228bc9257ca16$export$ccdee5eaf73cf661(options) {
52
52
  };
53
53
  let fireDropExit = (e)=>{
54
54
  setDropTarget(false);
55
- if (typeof options.onDropExit === "function") {
55
+ if (typeof options.onDropExit === 'function') {
56
56
  let rect = e.currentTarget.getBoundingClientRect();
57
57
  options.onDropExit({
58
- type: "dropexit",
58
+ type: 'dropexit',
59
59
  x: e.clientX - rect.x,
60
60
  y: e.clientY - rect.y
61
61
  });
@@ -76,37 +76,37 @@ function $1ca228bc9257ca16$export$ccdee5eaf73cf661(options) {
76
76
  if (allowedOperations !== state.allowedOperations) {
77
77
  let allowedOps = $1ca228bc9257ca16$var$allowedOperationsToArray(allowedOperations);
78
78
  let dropOperation = allowedOps[0];
79
- if (typeof options.getDropOperation === "function") {
79
+ if (typeof options.getDropOperation === 'function') {
80
80
  let types = new (0, $4620ae0dc40f0031$exports.DragTypes)(e.dataTransfer);
81
81
  dropOperation = $1ca228bc9257ca16$var$getDropOperation(allowedOperations, options.getDropOperation(types, allowedOps));
82
82
  }
83
- state.dropEffect = (0, $76b1e110a27b1ccd$exports.DROP_OPERATION_TO_DROP_EFFECT)[dropOperation] || "none";
83
+ state.dropEffect = (0, $76b1e110a27b1ccd$exports.DROP_OPERATION_TO_DROP_EFFECT)[dropOperation] || 'none';
84
84
  }
85
- if (typeof options.getDropOperationForPoint === "function") {
85
+ if (typeof options.getDropOperationForPoint === 'function') {
86
86
  let types = new (0, $4620ae0dc40f0031$exports.DragTypes)(e.dataTransfer);
87
87
  let rect = e.currentTarget.getBoundingClientRect();
88
88
  let dropOperation = $1ca228bc9257ca16$var$getDropOperation(allowedOperations, options.getDropOperationForPoint(types, $1ca228bc9257ca16$var$allowedOperationsToArray(allowedOperations), state.x - rect.x, state.y - rect.y));
89
- state.dropEffect = (0, $76b1e110a27b1ccd$exports.DROP_OPERATION_TO_DROP_EFFECT)[dropOperation] || "none";
89
+ state.dropEffect = (0, $76b1e110a27b1ccd$exports.DROP_OPERATION_TO_DROP_EFFECT)[dropOperation] || 'none';
90
90
  }
91
91
  state.allowedOperations = allowedOperations;
92
92
  e.dataTransfer.dropEffect = state.dropEffect;
93
93
  // If the drop operation changes, update state and fire events appropriately.
94
- if (state.dropEffect === "none" && prevDropEffect !== "none") fireDropExit(e);
95
- else if (state.dropEffect !== "none" && prevDropEffect === "none") fireDropEnter(e);
96
- if (typeof options.onDropMove === "function" && state.dropEffect !== "none") {
94
+ if (state.dropEffect === 'none' && prevDropEffect !== 'none') fireDropExit(e);
95
+ else if (state.dropEffect !== 'none' && prevDropEffect === 'none') fireDropEnter(e);
96
+ if (typeof options.onDropMove === 'function' && state.dropEffect !== 'none') {
97
97
  let rect = e.currentTarget.getBoundingClientRect();
98
98
  options.onDropMove({
99
- type: "dropmove",
99
+ type: 'dropmove',
100
100
  x: state.x - rect.x,
101
101
  y: state.y - rect.y
102
102
  });
103
103
  }
104
104
  clearTimeout(state.dropActivateTimer);
105
- if (typeof options.onDropActivate === "function" && state.dropEffect !== "none") {
105
+ if (typeof options.onDropActivate === 'function' && state.dropEffect !== 'none') {
106
106
  let rect = e.currentTarget.getBoundingClientRect();
107
107
  state.dropActivateTimer = setTimeout(()=>{
108
108
  options.onDropActivate({
109
- type: "dropactivate",
109
+ type: 'dropactivate',
110
110
  x: state.x - rect.x,
111
111
  y: state.y - rect.y
112
112
  });
@@ -121,11 +121,11 @@ function $1ca228bc9257ca16$export$ccdee5eaf73cf661(options) {
121
121
  let allowedOperationsBits = $1ca228bc9257ca16$var$getAllowedOperations(e);
122
122
  let allowedOperations = $1ca228bc9257ca16$var$allowedOperationsToArray(allowedOperationsBits);
123
123
  let dropOperation = allowedOperations[0];
124
- if (typeof options.getDropOperation === "function") {
124
+ if (typeof options.getDropOperation === 'function') {
125
125
  let types = new (0, $4620ae0dc40f0031$exports.DragTypes)(e.dataTransfer);
126
126
  dropOperation = $1ca228bc9257ca16$var$getDropOperation(allowedOperationsBits, options.getDropOperation(types, allowedOperations));
127
127
  }
128
- if (typeof options.getDropOperationForPoint === "function") {
128
+ if (typeof options.getDropOperationForPoint === 'function') {
129
129
  let types = new (0, $4620ae0dc40f0031$exports.DragTypes)(e.dataTransfer);
130
130
  let rect = e.currentTarget.getBoundingClientRect();
131
131
  dropOperation = $1ca228bc9257ca16$var$getDropOperation(allowedOperationsBits, options.getDropOperationForPoint(types, allowedOperations, e.clientX - rect.x, e.clientY - rect.y));
@@ -133,9 +133,9 @@ function $1ca228bc9257ca16$export$ccdee5eaf73cf661(options) {
133
133
  state.x = e.clientX;
134
134
  state.y = e.clientY;
135
135
  state.allowedOperations = allowedOperationsBits;
136
- state.dropEffect = (0, $76b1e110a27b1ccd$exports.DROP_OPERATION_TO_DROP_EFFECT)[dropOperation] || "none";
136
+ state.dropEffect = (0, $76b1e110a27b1ccd$exports.DROP_OPERATION_TO_DROP_EFFECT)[dropOperation] || 'none';
137
137
  e.dataTransfer.dropEffect = state.dropEffect;
138
- if (dropOperation !== "cancel") fireDropEnter(e);
138
+ if (dropOperation !== 'cancel') fireDropEnter(e);
139
139
  };
140
140
  let onDragLeave = (e)=>{
141
141
  e.preventDefault();
@@ -150,7 +150,7 @@ function $1ca228bc9257ca16$export$ccdee5eaf73cf661(options) {
150
150
  state.dragOverElements.delete(e.target);
151
151
  for (let element of state.dragOverElements)if (!e.currentTarget.contains(element)) state.dragOverElements.delete(element);
152
152
  if (state.dragOverElements.size > 0) return;
153
- if (state.dropEffect !== "none") fireDropExit(e);
153
+ if (state.dropEffect !== 'none') fireDropExit(e);
154
154
  clearTimeout(state.dropActivateTimer);
155
155
  };
156
156
  let onDrop = (e)=>{
@@ -159,12 +159,12 @@ function $1ca228bc9257ca16$export$ccdee5eaf73cf661(options) {
159
159
  // Track drop effect in global state for Chrome Android. https://bugs.chromium.org/p/chromium/issues/detail?id=1353951
160
160
  // Android onDragEnd always returns "none" as its drop effect.
161
161
  (0, $4620ae0dc40f0031$exports.setGlobalDropEffect)(state.dropEffect);
162
- if (typeof options.onDrop === "function") {
162
+ if (typeof options.onDrop === 'function') {
163
163
  let dropOperation = (0, $76b1e110a27b1ccd$exports.DROP_EFFECT_TO_DROP_OPERATION)[state.dropEffect];
164
164
  let items = (0, $4620ae0dc40f0031$exports.readFromDataTransfer)(e.dataTransfer);
165
165
  let rect = e.currentTarget.getBoundingClientRect();
166
166
  let event = {
167
- type: "drop",
167
+ type: 'drop',
168
168
  x: e.clientX - rect.x,
169
169
  y: e.clientY - rect.y,
170
170
  items: items,
@@ -186,16 +186,16 @@ function $1ca228bc9257ca16$export$ccdee5eaf73cf661(options) {
186
186
  (0, $4620ae0dc40f0031$exports.setGlobalDnDState)(dndStateSnapshot);
187
187
  };
188
188
  let onDropEnter = (0, $AO99w$reactariautils.useEffectEvent)((e)=>{
189
- if (typeof options.onDropEnter === "function") options.onDropEnter(e);
189
+ if (typeof options.onDropEnter === 'function') options.onDropEnter(e);
190
190
  });
191
191
  let onDropExit = (0, $AO99w$reactariautils.useEffectEvent)((e)=>{
192
- if (typeof options.onDropExit === "function") options.onDropExit(e);
192
+ if (typeof options.onDropExit === 'function') options.onDropExit(e);
193
193
  });
194
194
  let onDropActivate = (0, $AO99w$reactariautils.useEffectEvent)((e)=>{
195
- if (typeof options.onDropActivate === "function") options.onDropActivate(e);
195
+ if (typeof options.onDropActivate === 'function') options.onDropActivate(e);
196
196
  });
197
197
  let onKeyboardDrop = (0, $AO99w$reactariautils.useEffectEvent)((e)=>{
198
- if (typeof options.onDrop === "function") options.onDrop(e);
198
+ if (typeof options.onDrop === 'function') options.onDrop(e);
199
199
  });
200
200
  let getDropOperationKeyboard = (0, $AO99w$reactariautils.useEffectEvent)((types, allowedOperations)=>{
201
201
  if (options.getDropOperation) return options.getDropOperation(types, allowedOperations);
@@ -285,14 +285,14 @@ function $1ca228bc9257ca16$var$getAllowedOperations(e) {
285
285
  }
286
286
  function $1ca228bc9257ca16$var$allowedOperationsToArray(allowedOperationsBits) {
287
287
  let allowedOperations = [];
288
- if (allowedOperationsBits & (0, $76b1e110a27b1ccd$exports.DROP_OPERATION).move) allowedOperations.push("move");
289
- if (allowedOperationsBits & (0, $76b1e110a27b1ccd$exports.DROP_OPERATION).copy) allowedOperations.push("copy");
290
- if (allowedOperationsBits & (0, $76b1e110a27b1ccd$exports.DROP_OPERATION).link) allowedOperations.push("link");
288
+ if (allowedOperationsBits & (0, $76b1e110a27b1ccd$exports.DROP_OPERATION).move) allowedOperations.push('move');
289
+ if (allowedOperationsBits & (0, $76b1e110a27b1ccd$exports.DROP_OPERATION).copy) allowedOperations.push('copy');
290
+ if (allowedOperationsBits & (0, $76b1e110a27b1ccd$exports.DROP_OPERATION).link) allowedOperations.push('link');
291
291
  return allowedOperations;
292
292
  }
293
293
  function $1ca228bc9257ca16$var$getDropOperation(allowedOperations, operation) {
294
294
  let op = (0, $76b1e110a27b1ccd$exports.DROP_OPERATION)[operation];
295
- return allowedOperations & op ? operation : "cancel";
295
+ return allowedOperations & op ? operation : 'cancel';
296
296
  }
297
297
 
298
298
 
package/dist/useDrop.mjs CHANGED
@@ -29,16 +29,16 @@ function $5c06e4929e123553$export$ccdee5eaf73cf661(options) {
29
29
  x: 0,
30
30
  y: 0,
31
31
  dragOverElements: new Set(),
32
- dropEffect: "none",
32
+ dropEffect: 'none',
33
33
  allowedOperations: (0, $103790afe9474d1c$export$60b7b4bcf3903d8e).all,
34
34
  dropActivateTimer: null
35
35
  }).current;
36
36
  let fireDropEnter = (e)=>{
37
37
  setDropTarget(true);
38
- if (typeof options.onDropEnter === "function") {
38
+ if (typeof options.onDropEnter === 'function') {
39
39
  let rect = e.currentTarget.getBoundingClientRect();
40
40
  options.onDropEnter({
41
- type: "dropenter",
41
+ type: 'dropenter',
42
42
  x: e.clientX - rect.x,
43
43
  y: e.clientY - rect.y
44
44
  });
@@ -46,10 +46,10 @@ function $5c06e4929e123553$export$ccdee5eaf73cf661(options) {
46
46
  };
47
47
  let fireDropExit = (e)=>{
48
48
  setDropTarget(false);
49
- if (typeof options.onDropExit === "function") {
49
+ if (typeof options.onDropExit === 'function') {
50
50
  let rect = e.currentTarget.getBoundingClientRect();
51
51
  options.onDropExit({
52
- type: "dropexit",
52
+ type: 'dropexit',
53
53
  x: e.clientX - rect.x,
54
54
  y: e.clientY - rect.y
55
55
  });
@@ -70,37 +70,37 @@ function $5c06e4929e123553$export$ccdee5eaf73cf661(options) {
70
70
  if (allowedOperations !== state.allowedOperations) {
71
71
  let allowedOps = $5c06e4929e123553$var$allowedOperationsToArray(allowedOperations);
72
72
  let dropOperation = allowedOps[0];
73
- if (typeof options.getDropOperation === "function") {
73
+ if (typeof options.getDropOperation === 'function') {
74
74
  let types = new (0, $7252cd45fc48c07c$export$7f04ce188c91447c)(e.dataTransfer);
75
75
  dropOperation = $5c06e4929e123553$var$getDropOperation(allowedOperations, options.getDropOperation(types, allowedOps));
76
76
  }
77
- state.dropEffect = (0, $103790afe9474d1c$export$5eacb0769d26d3b2)[dropOperation] || "none";
77
+ state.dropEffect = (0, $103790afe9474d1c$export$5eacb0769d26d3b2)[dropOperation] || 'none';
78
78
  }
79
- if (typeof options.getDropOperationForPoint === "function") {
79
+ if (typeof options.getDropOperationForPoint === 'function') {
80
80
  let types = new (0, $7252cd45fc48c07c$export$7f04ce188c91447c)(e.dataTransfer);
81
81
  let rect = e.currentTarget.getBoundingClientRect();
82
82
  let dropOperation = $5c06e4929e123553$var$getDropOperation(allowedOperations, options.getDropOperationForPoint(types, $5c06e4929e123553$var$allowedOperationsToArray(allowedOperations), state.x - rect.x, state.y - rect.y));
83
- state.dropEffect = (0, $103790afe9474d1c$export$5eacb0769d26d3b2)[dropOperation] || "none";
83
+ state.dropEffect = (0, $103790afe9474d1c$export$5eacb0769d26d3b2)[dropOperation] || 'none';
84
84
  }
85
85
  state.allowedOperations = allowedOperations;
86
86
  e.dataTransfer.dropEffect = state.dropEffect;
87
87
  // If the drop operation changes, update state and fire events appropriately.
88
- if (state.dropEffect === "none" && prevDropEffect !== "none") fireDropExit(e);
89
- else if (state.dropEffect !== "none" && prevDropEffect === "none") fireDropEnter(e);
90
- if (typeof options.onDropMove === "function" && state.dropEffect !== "none") {
88
+ if (state.dropEffect === 'none' && prevDropEffect !== 'none') fireDropExit(e);
89
+ else if (state.dropEffect !== 'none' && prevDropEffect === 'none') fireDropEnter(e);
90
+ if (typeof options.onDropMove === 'function' && state.dropEffect !== 'none') {
91
91
  let rect = e.currentTarget.getBoundingClientRect();
92
92
  options.onDropMove({
93
- type: "dropmove",
93
+ type: 'dropmove',
94
94
  x: state.x - rect.x,
95
95
  y: state.y - rect.y
96
96
  });
97
97
  }
98
98
  clearTimeout(state.dropActivateTimer);
99
- if (typeof options.onDropActivate === "function" && state.dropEffect !== "none") {
99
+ if (typeof options.onDropActivate === 'function' && state.dropEffect !== 'none') {
100
100
  let rect = e.currentTarget.getBoundingClientRect();
101
101
  state.dropActivateTimer = setTimeout(()=>{
102
102
  options.onDropActivate({
103
- type: "dropactivate",
103
+ type: 'dropactivate',
104
104
  x: state.x - rect.x,
105
105
  y: state.y - rect.y
106
106
  });
@@ -115,11 +115,11 @@ function $5c06e4929e123553$export$ccdee5eaf73cf661(options) {
115
115
  let allowedOperationsBits = $5c06e4929e123553$var$getAllowedOperations(e);
116
116
  let allowedOperations = $5c06e4929e123553$var$allowedOperationsToArray(allowedOperationsBits);
117
117
  let dropOperation = allowedOperations[0];
118
- if (typeof options.getDropOperation === "function") {
118
+ if (typeof options.getDropOperation === 'function') {
119
119
  let types = new (0, $7252cd45fc48c07c$export$7f04ce188c91447c)(e.dataTransfer);
120
120
  dropOperation = $5c06e4929e123553$var$getDropOperation(allowedOperationsBits, options.getDropOperation(types, allowedOperations));
121
121
  }
122
- if (typeof options.getDropOperationForPoint === "function") {
122
+ if (typeof options.getDropOperationForPoint === 'function') {
123
123
  let types = new (0, $7252cd45fc48c07c$export$7f04ce188c91447c)(e.dataTransfer);
124
124
  let rect = e.currentTarget.getBoundingClientRect();
125
125
  dropOperation = $5c06e4929e123553$var$getDropOperation(allowedOperationsBits, options.getDropOperationForPoint(types, allowedOperations, e.clientX - rect.x, e.clientY - rect.y));
@@ -127,9 +127,9 @@ function $5c06e4929e123553$export$ccdee5eaf73cf661(options) {
127
127
  state.x = e.clientX;
128
128
  state.y = e.clientY;
129
129
  state.allowedOperations = allowedOperationsBits;
130
- state.dropEffect = (0, $103790afe9474d1c$export$5eacb0769d26d3b2)[dropOperation] || "none";
130
+ state.dropEffect = (0, $103790afe9474d1c$export$5eacb0769d26d3b2)[dropOperation] || 'none';
131
131
  e.dataTransfer.dropEffect = state.dropEffect;
132
- if (dropOperation !== "cancel") fireDropEnter(e);
132
+ if (dropOperation !== 'cancel') fireDropEnter(e);
133
133
  };
134
134
  let onDragLeave = (e)=>{
135
135
  e.preventDefault();
@@ -144,7 +144,7 @@ function $5c06e4929e123553$export$ccdee5eaf73cf661(options) {
144
144
  state.dragOverElements.delete(e.target);
145
145
  for (let element of state.dragOverElements)if (!e.currentTarget.contains(element)) state.dragOverElements.delete(element);
146
146
  if (state.dragOverElements.size > 0) return;
147
- if (state.dropEffect !== "none") fireDropExit(e);
147
+ if (state.dropEffect !== 'none') fireDropExit(e);
148
148
  clearTimeout(state.dropActivateTimer);
149
149
  };
150
150
  let onDrop = (e)=>{
@@ -153,12 +153,12 @@ function $5c06e4929e123553$export$ccdee5eaf73cf661(options) {
153
153
  // Track drop effect in global state for Chrome Android. https://bugs.chromium.org/p/chromium/issues/detail?id=1353951
154
154
  // Android onDragEnd always returns "none" as its drop effect.
155
155
  (0, $7252cd45fc48c07c$export$64f52ed7349ddb84)(state.dropEffect);
156
- if (typeof options.onDrop === "function") {
156
+ if (typeof options.onDrop === 'function') {
157
157
  let dropOperation = (0, $103790afe9474d1c$export$608ecc6f1b23c35d)[state.dropEffect];
158
158
  let items = (0, $7252cd45fc48c07c$export$d9e760437831f8b3)(e.dataTransfer);
159
159
  let rect = e.currentTarget.getBoundingClientRect();
160
160
  let event = {
161
- type: "drop",
161
+ type: 'drop',
162
162
  x: e.clientX - rect.x,
163
163
  y: e.clientY - rect.y,
164
164
  items: items,
@@ -180,16 +180,16 @@ function $5c06e4929e123553$export$ccdee5eaf73cf661(options) {
180
180
  (0, $7252cd45fc48c07c$export$6c10d32b362bfa5f)(dndStateSnapshot);
181
181
  };
182
182
  let onDropEnter = (0, $j5n4S$useEffectEvent)((e)=>{
183
- if (typeof options.onDropEnter === "function") options.onDropEnter(e);
183
+ if (typeof options.onDropEnter === 'function') options.onDropEnter(e);
184
184
  });
185
185
  let onDropExit = (0, $j5n4S$useEffectEvent)((e)=>{
186
- if (typeof options.onDropExit === "function") options.onDropExit(e);
186
+ if (typeof options.onDropExit === 'function') options.onDropExit(e);
187
187
  });
188
188
  let onDropActivate = (0, $j5n4S$useEffectEvent)((e)=>{
189
- if (typeof options.onDropActivate === "function") options.onDropActivate(e);
189
+ if (typeof options.onDropActivate === 'function') options.onDropActivate(e);
190
190
  });
191
191
  let onKeyboardDrop = (0, $j5n4S$useEffectEvent)((e)=>{
192
- if (typeof options.onDrop === "function") options.onDrop(e);
192
+ if (typeof options.onDrop === 'function') options.onDrop(e);
193
193
  });
194
194
  let getDropOperationKeyboard = (0, $j5n4S$useEffectEvent)((types, allowedOperations)=>{
195
195
  if (options.getDropOperation) return options.getDropOperation(types, allowedOperations);
@@ -279,14 +279,14 @@ function $5c06e4929e123553$var$getAllowedOperations(e) {
279
279
  }
280
280
  function $5c06e4929e123553$var$allowedOperationsToArray(allowedOperationsBits) {
281
281
  let allowedOperations = [];
282
- if (allowedOperationsBits & (0, $103790afe9474d1c$export$60b7b4bcf3903d8e).move) allowedOperations.push("move");
283
- if (allowedOperationsBits & (0, $103790afe9474d1c$export$60b7b4bcf3903d8e).copy) allowedOperations.push("copy");
284
- if (allowedOperationsBits & (0, $103790afe9474d1c$export$60b7b4bcf3903d8e).link) allowedOperations.push("link");
282
+ if (allowedOperationsBits & (0, $103790afe9474d1c$export$60b7b4bcf3903d8e).move) allowedOperations.push('move');
283
+ if (allowedOperationsBits & (0, $103790afe9474d1c$export$60b7b4bcf3903d8e).copy) allowedOperations.push('copy');
284
+ if (allowedOperationsBits & (0, $103790afe9474d1c$export$60b7b4bcf3903d8e).link) allowedOperations.push('link');
285
285
  return allowedOperations;
286
286
  }
287
287
  function $5c06e4929e123553$var$getDropOperation(allowedOperations, operation) {
288
288
  let op = (0, $103790afe9474d1c$export$60b7b4bcf3903d8e)[operation];
289
- return allowedOperations & op ? operation : "cancel";
289
+ return allowedOperations & op ? operation : 'cancel';
290
290
  }
291
291
 
292
292
 
@@ -29,16 +29,16 @@ function $5c06e4929e123553$export$ccdee5eaf73cf661(options) {
29
29
  x: 0,
30
30
  y: 0,
31
31
  dragOverElements: new Set(),
32
- dropEffect: "none",
32
+ dropEffect: 'none',
33
33
  allowedOperations: (0, $103790afe9474d1c$export$60b7b4bcf3903d8e).all,
34
34
  dropActivateTimer: null
35
35
  }).current;
36
36
  let fireDropEnter = (e)=>{
37
37
  setDropTarget(true);
38
- if (typeof options.onDropEnter === "function") {
38
+ if (typeof options.onDropEnter === 'function') {
39
39
  let rect = e.currentTarget.getBoundingClientRect();
40
40
  options.onDropEnter({
41
- type: "dropenter",
41
+ type: 'dropenter',
42
42
  x: e.clientX - rect.x,
43
43
  y: e.clientY - rect.y
44
44
  });
@@ -46,10 +46,10 @@ function $5c06e4929e123553$export$ccdee5eaf73cf661(options) {
46
46
  };
47
47
  let fireDropExit = (e)=>{
48
48
  setDropTarget(false);
49
- if (typeof options.onDropExit === "function") {
49
+ if (typeof options.onDropExit === 'function') {
50
50
  let rect = e.currentTarget.getBoundingClientRect();
51
51
  options.onDropExit({
52
- type: "dropexit",
52
+ type: 'dropexit',
53
53
  x: e.clientX - rect.x,
54
54
  y: e.clientY - rect.y
55
55
  });
@@ -70,37 +70,37 @@ function $5c06e4929e123553$export$ccdee5eaf73cf661(options) {
70
70
  if (allowedOperations !== state.allowedOperations) {
71
71
  let allowedOps = $5c06e4929e123553$var$allowedOperationsToArray(allowedOperations);
72
72
  let dropOperation = allowedOps[0];
73
- if (typeof options.getDropOperation === "function") {
73
+ if (typeof options.getDropOperation === 'function') {
74
74
  let types = new (0, $7252cd45fc48c07c$export$7f04ce188c91447c)(e.dataTransfer);
75
75
  dropOperation = $5c06e4929e123553$var$getDropOperation(allowedOperations, options.getDropOperation(types, allowedOps));
76
76
  }
77
- state.dropEffect = (0, $103790afe9474d1c$export$5eacb0769d26d3b2)[dropOperation] || "none";
77
+ state.dropEffect = (0, $103790afe9474d1c$export$5eacb0769d26d3b2)[dropOperation] || 'none';
78
78
  }
79
- if (typeof options.getDropOperationForPoint === "function") {
79
+ if (typeof options.getDropOperationForPoint === 'function') {
80
80
  let types = new (0, $7252cd45fc48c07c$export$7f04ce188c91447c)(e.dataTransfer);
81
81
  let rect = e.currentTarget.getBoundingClientRect();
82
82
  let dropOperation = $5c06e4929e123553$var$getDropOperation(allowedOperations, options.getDropOperationForPoint(types, $5c06e4929e123553$var$allowedOperationsToArray(allowedOperations), state.x - rect.x, state.y - rect.y));
83
- state.dropEffect = (0, $103790afe9474d1c$export$5eacb0769d26d3b2)[dropOperation] || "none";
83
+ state.dropEffect = (0, $103790afe9474d1c$export$5eacb0769d26d3b2)[dropOperation] || 'none';
84
84
  }
85
85
  state.allowedOperations = allowedOperations;
86
86
  e.dataTransfer.dropEffect = state.dropEffect;
87
87
  // If the drop operation changes, update state and fire events appropriately.
88
- if (state.dropEffect === "none" && prevDropEffect !== "none") fireDropExit(e);
89
- else if (state.dropEffect !== "none" && prevDropEffect === "none") fireDropEnter(e);
90
- if (typeof options.onDropMove === "function" && state.dropEffect !== "none") {
88
+ if (state.dropEffect === 'none' && prevDropEffect !== 'none') fireDropExit(e);
89
+ else if (state.dropEffect !== 'none' && prevDropEffect === 'none') fireDropEnter(e);
90
+ if (typeof options.onDropMove === 'function' && state.dropEffect !== 'none') {
91
91
  let rect = e.currentTarget.getBoundingClientRect();
92
92
  options.onDropMove({
93
- type: "dropmove",
93
+ type: 'dropmove',
94
94
  x: state.x - rect.x,
95
95
  y: state.y - rect.y
96
96
  });
97
97
  }
98
98
  clearTimeout(state.dropActivateTimer);
99
- if (typeof options.onDropActivate === "function" && state.dropEffect !== "none") {
99
+ if (typeof options.onDropActivate === 'function' && state.dropEffect !== 'none') {
100
100
  let rect = e.currentTarget.getBoundingClientRect();
101
101
  state.dropActivateTimer = setTimeout(()=>{
102
102
  options.onDropActivate({
103
- type: "dropactivate",
103
+ type: 'dropactivate',
104
104
  x: state.x - rect.x,
105
105
  y: state.y - rect.y
106
106
  });
@@ -115,11 +115,11 @@ function $5c06e4929e123553$export$ccdee5eaf73cf661(options) {
115
115
  let allowedOperationsBits = $5c06e4929e123553$var$getAllowedOperations(e);
116
116
  let allowedOperations = $5c06e4929e123553$var$allowedOperationsToArray(allowedOperationsBits);
117
117
  let dropOperation = allowedOperations[0];
118
- if (typeof options.getDropOperation === "function") {
118
+ if (typeof options.getDropOperation === 'function') {
119
119
  let types = new (0, $7252cd45fc48c07c$export$7f04ce188c91447c)(e.dataTransfer);
120
120
  dropOperation = $5c06e4929e123553$var$getDropOperation(allowedOperationsBits, options.getDropOperation(types, allowedOperations));
121
121
  }
122
- if (typeof options.getDropOperationForPoint === "function") {
122
+ if (typeof options.getDropOperationForPoint === 'function') {
123
123
  let types = new (0, $7252cd45fc48c07c$export$7f04ce188c91447c)(e.dataTransfer);
124
124
  let rect = e.currentTarget.getBoundingClientRect();
125
125
  dropOperation = $5c06e4929e123553$var$getDropOperation(allowedOperationsBits, options.getDropOperationForPoint(types, allowedOperations, e.clientX - rect.x, e.clientY - rect.y));
@@ -127,9 +127,9 @@ function $5c06e4929e123553$export$ccdee5eaf73cf661(options) {
127
127
  state.x = e.clientX;
128
128
  state.y = e.clientY;
129
129
  state.allowedOperations = allowedOperationsBits;
130
- state.dropEffect = (0, $103790afe9474d1c$export$5eacb0769d26d3b2)[dropOperation] || "none";
130
+ state.dropEffect = (0, $103790afe9474d1c$export$5eacb0769d26d3b2)[dropOperation] || 'none';
131
131
  e.dataTransfer.dropEffect = state.dropEffect;
132
- if (dropOperation !== "cancel") fireDropEnter(e);
132
+ if (dropOperation !== 'cancel') fireDropEnter(e);
133
133
  };
134
134
  let onDragLeave = (e)=>{
135
135
  e.preventDefault();
@@ -144,7 +144,7 @@ function $5c06e4929e123553$export$ccdee5eaf73cf661(options) {
144
144
  state.dragOverElements.delete(e.target);
145
145
  for (let element of state.dragOverElements)if (!e.currentTarget.contains(element)) state.dragOverElements.delete(element);
146
146
  if (state.dragOverElements.size > 0) return;
147
- if (state.dropEffect !== "none") fireDropExit(e);
147
+ if (state.dropEffect !== 'none') fireDropExit(e);
148
148
  clearTimeout(state.dropActivateTimer);
149
149
  };
150
150
  let onDrop = (e)=>{
@@ -153,12 +153,12 @@ function $5c06e4929e123553$export$ccdee5eaf73cf661(options) {
153
153
  // Track drop effect in global state for Chrome Android. https://bugs.chromium.org/p/chromium/issues/detail?id=1353951
154
154
  // Android onDragEnd always returns "none" as its drop effect.
155
155
  (0, $7252cd45fc48c07c$export$64f52ed7349ddb84)(state.dropEffect);
156
- if (typeof options.onDrop === "function") {
156
+ if (typeof options.onDrop === 'function') {
157
157
  let dropOperation = (0, $103790afe9474d1c$export$608ecc6f1b23c35d)[state.dropEffect];
158
158
  let items = (0, $7252cd45fc48c07c$export$d9e760437831f8b3)(e.dataTransfer);
159
159
  let rect = e.currentTarget.getBoundingClientRect();
160
160
  let event = {
161
- type: "drop",
161
+ type: 'drop',
162
162
  x: e.clientX - rect.x,
163
163
  y: e.clientY - rect.y,
164
164
  items: items,
@@ -180,16 +180,16 @@ function $5c06e4929e123553$export$ccdee5eaf73cf661(options) {
180
180
  (0, $7252cd45fc48c07c$export$6c10d32b362bfa5f)(dndStateSnapshot);
181
181
  };
182
182
  let onDropEnter = (0, $j5n4S$useEffectEvent)((e)=>{
183
- if (typeof options.onDropEnter === "function") options.onDropEnter(e);
183
+ if (typeof options.onDropEnter === 'function') options.onDropEnter(e);
184
184
  });
185
185
  let onDropExit = (0, $j5n4S$useEffectEvent)((e)=>{
186
- if (typeof options.onDropExit === "function") options.onDropExit(e);
186
+ if (typeof options.onDropExit === 'function') options.onDropExit(e);
187
187
  });
188
188
  let onDropActivate = (0, $j5n4S$useEffectEvent)((e)=>{
189
- if (typeof options.onDropActivate === "function") options.onDropActivate(e);
189
+ if (typeof options.onDropActivate === 'function') options.onDropActivate(e);
190
190
  });
191
191
  let onKeyboardDrop = (0, $j5n4S$useEffectEvent)((e)=>{
192
- if (typeof options.onDrop === "function") options.onDrop(e);
192
+ if (typeof options.onDrop === 'function') options.onDrop(e);
193
193
  });
194
194
  let getDropOperationKeyboard = (0, $j5n4S$useEffectEvent)((types, allowedOperations)=>{
195
195
  if (options.getDropOperation) return options.getDropOperation(types, allowedOperations);
@@ -279,14 +279,14 @@ function $5c06e4929e123553$var$getAllowedOperations(e) {
279
279
  }
280
280
  function $5c06e4929e123553$var$allowedOperationsToArray(allowedOperationsBits) {
281
281
  let allowedOperations = [];
282
- if (allowedOperationsBits & (0, $103790afe9474d1c$export$60b7b4bcf3903d8e).move) allowedOperations.push("move");
283
- if (allowedOperationsBits & (0, $103790afe9474d1c$export$60b7b4bcf3903d8e).copy) allowedOperations.push("copy");
284
- if (allowedOperationsBits & (0, $103790afe9474d1c$export$60b7b4bcf3903d8e).link) allowedOperations.push("link");
282
+ if (allowedOperationsBits & (0, $103790afe9474d1c$export$60b7b4bcf3903d8e).move) allowedOperations.push('move');
283
+ if (allowedOperationsBits & (0, $103790afe9474d1c$export$60b7b4bcf3903d8e).copy) allowedOperations.push('copy');
284
+ if (allowedOperationsBits & (0, $103790afe9474d1c$export$60b7b4bcf3903d8e).link) allowedOperations.push('link');
285
285
  return allowedOperations;
286
286
  }
287
287
  function $5c06e4929e123553$var$getDropOperation(allowedOperations, operation) {
288
288
  let op = (0, $103790afe9474d1c$export$60b7b4bcf3903d8e)[operation];
289
- return allowedOperations & op ? operation : "cancel";
289
+ return allowedOperations & op ? operation : 'cancel';
290
290
  }
291
291
 
292
292