@react-aria/dnd 3.0.0-rc.0 → 3.0.0

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/module.js CHANGED
@@ -73,7 +73,7 @@ function $7252cd45fc48c07c$export$e1d41611756c6326(items) {
73
73
  function $7252cd45fc48c07c$var$mapModality(modality) {
74
74
  if (!modality) modality = 'virtual';
75
75
  if (modality === 'pointer') modality = 'virtual';
76
- if (modality === 'virtual' && 'ontouchstart' in window) modality = 'touch';
76
+ if (modality === 'virtual' && typeof window !== 'undefined' && 'ontouchstart' in window) modality = 'touch';
77
77
  return modality;
78
78
  }
79
79
  function $7252cd45fc48c07c$export$49bac5d6d4b352ea() {
@@ -182,7 +182,9 @@ function $7252cd45fc48c07c$export$d9e760437831f8b3(dataTransfer) {
182
182
  // only implemented in Chrome.
183
183
  if (typeof item.webkitGetAsEntry === 'function') {
184
184
  let entry = item.webkitGetAsEntry();
185
+ // eslint-disable-next-line max-depth
185
186
  if (!entry) continue;
187
+ // eslint-disable-next-line max-depth
186
188
  if (entry.isFile) items.push($7252cd45fc48c07c$var$createFileItem(item.getAsFile()));
187
189
  else if (entry.isDirectory) items.push($7252cd45fc48c07c$var$createDirectoryItem(entry));
188
190
  } else // Assume it's a file.
@@ -3015,6 +3017,7 @@ function $5c06e4929e123553$export$ccdee5eaf73cf661(options) {
3015
3017
  }
3016
3018
  };
3017
3019
  let onDragEnter = (e)=>{
3020
+ e.preventDefault();
3018
3021
  e.stopPropagation();
3019
3022
  state.dragOverElements.add(e.target);
3020
3023
  if (state.dragOverElements.size > 1) return;
@@ -3038,6 +3041,7 @@ function $5c06e4929e123553$export$ccdee5eaf73cf661(options) {
3038
3041
  if (dropOperation !== 'cancel') fireDropEnter(e);
3039
3042
  };
3040
3043
  let onDragLeave = (e)=>{
3044
+ e.preventDefault();
3041
3045
  e.stopPropagation();
3042
3046
  // We would use e.relatedTarget to detect if the drag is still inside the drop target,
3043
3047
  // but it is always null in WebKit. https://bugs.webkit.org/show_bug.cgi?id=66547