@react-aria/dnd 3.5.4-nightly.4555 → 3.5.4-nightly.4558
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/DragManager.main.js +444 -0
- package/dist/DragManager.main.js.map +1 -0
- package/dist/DragManager.mjs +435 -0
- package/dist/DragManager.module.js +435 -0
- package/dist/DragManager.module.js.map +1 -0
- package/dist/DragPreview.main.js +59 -0
- package/dist/DragPreview.main.js.map +1 -0
- package/dist/DragPreview.mjs +50 -0
- package/dist/DragPreview.module.js +50 -0
- package/dist/DragPreview.module.js.map +1 -0
- package/dist/ListDropTargetDelegate.main.js +119 -0
- package/dist/ListDropTargetDelegate.main.js.map +1 -0
- package/dist/ListDropTargetDelegate.mjs +114 -0
- package/dist/ListDropTargetDelegate.module.js +114 -0
- package/dist/ListDropTargetDelegate.module.js.map +1 -0
- package/dist/ar-AE.mjs +1 -1
- package/dist/bg-BG.mjs +1 -1
- package/dist/constants.main.js +65 -0
- package/dist/constants.main.js.map +1 -0
- package/dist/constants.mjs +53 -0
- package/dist/constants.module.js +53 -0
- package/dist/constants.module.js.map +1 -0
- package/dist/cs-CZ.mjs +1 -1
- package/dist/da-DK.mjs +1 -1
- package/dist/de-DE.mjs +1 -1
- package/dist/el-GR.mjs +1 -1
- package/dist/en-US.mjs +1 -1
- package/dist/es-ES.mjs +1 -1
- package/dist/et-EE.mjs +1 -1
- package/dist/fi-FI.mjs +1 -1
- package/dist/fr-FR.mjs +1 -1
- package/dist/he-IL.mjs +1 -1
- package/dist/hr-HR.mjs +1 -1
- package/dist/hu-HU.mjs +1 -1
- package/dist/import.mjs +12 -2582
- package/dist/intlStrings.main.js +108 -0
- package/dist/intlStrings.main.js.map +1 -0
- package/dist/intlStrings.mjs +110 -0
- package/dist/intlStrings.module.js +110 -0
- package/dist/intlStrings.module.js.map +1 -0
- package/dist/it-IT.mjs +1 -1
- package/dist/ja-JP.mjs +1 -1
- package/dist/ko-KR.mjs +1 -1
- package/dist/lt-LT.mjs +1 -1
- package/dist/lv-LV.mjs +1 -1
- package/dist/main.js +27 -2597
- package/dist/main.js.map +1 -1
- package/dist/module.js +12 -2582
- package/dist/module.js.map +1 -1
- package/dist/nb-NO.mjs +1 -1
- package/dist/nl-NL.mjs +1 -1
- package/dist/pl-PL.mjs +1 -1
- package/dist/pt-BR.mjs +1 -1
- package/dist/pt-PT.mjs +1 -1
- package/dist/ro-RO.mjs +1 -1
- package/dist/ru-RU.mjs +1 -1
- package/dist/sk-SK.mjs +1 -1
- package/dist/sl-SI.mjs +1 -1
- package/dist/sr-SP.mjs +1 -1
- package/dist/sv-SE.mjs +1 -1
- package/dist/tr-TR.mjs +1 -1
- package/dist/uk-UA.mjs +1 -1
- package/dist/useAutoScroll.main.js +89 -0
- package/dist/useAutoScroll.main.js.map +1 -0
- package/dist/useAutoScroll.mjs +84 -0
- package/dist/useAutoScroll.module.js +84 -0
- package/dist/useAutoScroll.module.js.map +1 -0
- package/dist/useClipboard.main.js +107 -0
- package/dist/useClipboard.main.js.map +1 -0
- package/dist/useClipboard.mjs +102 -0
- package/dist/useClipboard.module.js +102 -0
- package/dist/useClipboard.module.js.map +1 -0
- package/dist/useDrag.main.js +279 -0
- package/dist/useDrag.main.js.map +1 -0
- package/dist/useDrag.mjs +274 -0
- package/dist/useDrag.module.js +274 -0
- package/dist/useDrag.module.js.map +1 -0
- package/dist/useDraggableCollection.main.js +27 -0
- package/dist/useDraggableCollection.main.js.map +1 -0
- package/dist/useDraggableCollection.mjs +22 -0
- package/dist/useDraggableCollection.module.js +22 -0
- package/dist/useDraggableCollection.module.js.map +1 -0
- package/dist/useDraggableItem.main.js +128 -0
- package/dist/useDraggableItem.main.js.map +1 -0
- package/dist/useDraggableItem.mjs +123 -0
- package/dist/useDraggableItem.module.js +123 -0
- package/dist/useDraggableItem.module.js.map +1 -0
- package/dist/useDrop.main.js +299 -0
- package/dist/useDrop.main.js.map +1 -0
- package/dist/useDrop.mjs +294 -0
- package/dist/useDrop.module.js +294 -0
- package/dist/useDrop.module.js.map +1 -0
- package/dist/useDropIndicator.main.js +93 -0
- package/dist/useDropIndicator.main.js.map +1 -0
- package/dist/useDropIndicator.mjs +88 -0
- package/dist/useDropIndicator.module.js +88 -0
- package/dist/useDropIndicator.module.js.map +1 -0
- package/dist/useDroppableCollection.main.js +583 -0
- package/dist/useDroppableCollection.main.js.map +1 -0
- package/dist/useDroppableCollection.mjs +578 -0
- package/dist/useDroppableCollection.module.js +578 -0
- package/dist/useDroppableCollection.module.js.map +1 -0
- package/dist/useDroppableItem.main.js +79 -0
- package/dist/useDroppableItem.main.js.map +1 -0
- package/dist/useDroppableItem.mjs +74 -0
- package/dist/useDroppableItem.module.js +74 -0
- package/dist/useDroppableItem.module.js.map +1 -0
- package/dist/useVirtualDrop.main.js +56 -0
- package/dist/useVirtualDrop.main.js.map +1 -0
- package/dist/useVirtualDrop.mjs +51 -0
- package/dist/useVirtualDrop.module.js +51 -0
- package/dist/useVirtualDrop.module.js.map +1 -0
- package/dist/utils.main.js +283 -0
- package/dist/utils.main.js.map +1 -0
- package/dist/utils.mjs +255 -0
- package/dist/utils.module.js +255 -0
- package/dist/utils.module.js.map +1 -0
- package/dist/zh-CN.mjs +1 -1
- package/dist/zh-TW.mjs +1 -1
- package/package.json +11 -11
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
var $76b1e110a27b1ccd$exports = require("./constants.main.js");
|
|
2
|
+
var $1Le3E$reactariainteractions = require("@react-aria/interactions");
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
function $parcel$export(e, n, v, s) {
|
|
6
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
$parcel$export(module.exports, "droppableCollectionMap", () => $4620ae0dc40f0031$export$dfdf5deeaf27473f);
|
|
10
|
+
$parcel$export(module.exports, "DIRECTORY_DRAG_TYPE", () => $4620ae0dc40f0031$export$990fced5dfac2637);
|
|
11
|
+
$parcel$export(module.exports, "getDroppableCollectionId", () => $4620ae0dc40f0031$export$3093291712f09a77);
|
|
12
|
+
$parcel$export(module.exports, "getDroppableCollectionRef", () => $4620ae0dc40f0031$export$7e397efd01d3db27);
|
|
13
|
+
$parcel$export(module.exports, "getTypes", () => $4620ae0dc40f0031$export$e1d41611756c6326);
|
|
14
|
+
$parcel$export(module.exports, "useDragModality", () => $4620ae0dc40f0031$export$49bac5d6d4b352ea);
|
|
15
|
+
$parcel$export(module.exports, "getDragModality", () => $4620ae0dc40f0031$export$1fb2158d224b542c);
|
|
16
|
+
$parcel$export(module.exports, "writeToDataTransfer", () => $4620ae0dc40f0031$export$f9c1490890ddd063);
|
|
17
|
+
$parcel$export(module.exports, "DragTypes", () => $4620ae0dc40f0031$export$7f04ce188c91447c);
|
|
18
|
+
$parcel$export(module.exports, "readFromDataTransfer", () => $4620ae0dc40f0031$export$d9e760437831f8b3);
|
|
19
|
+
$parcel$export(module.exports, "isTextDropItem", () => $4620ae0dc40f0031$export$97fd558bdc44bea1);
|
|
20
|
+
$parcel$export(module.exports, "isFileDropItem", () => $4620ae0dc40f0031$export$a144e1752ebe0aa);
|
|
21
|
+
$parcel$export(module.exports, "isDirectoryDropItem", () => $4620ae0dc40f0031$export$2b40a62bdbe6b2b0);
|
|
22
|
+
$parcel$export(module.exports, "globalDndState", () => $4620ae0dc40f0031$export$6ca6700462636d0b);
|
|
23
|
+
$parcel$export(module.exports, "setDraggingCollectionRef", () => $4620ae0dc40f0031$export$f2be18a910c0caa6);
|
|
24
|
+
$parcel$export(module.exports, "setDraggingKeys", () => $4620ae0dc40f0031$export$72cb63bdda528276);
|
|
25
|
+
$parcel$export(module.exports, "setDropCollectionRef", () => $4620ae0dc40f0031$export$dac8db29d42db9a1);
|
|
26
|
+
$parcel$export(module.exports, "clearGlobalDnDState", () => $4620ae0dc40f0031$export$70936501603e6c57);
|
|
27
|
+
$parcel$export(module.exports, "setGlobalDnDState", () => $4620ae0dc40f0031$export$6c10d32b362bfa5f);
|
|
28
|
+
$parcel$export(module.exports, "isInternalDropOperation", () => $4620ae0dc40f0031$export$78bf638634500fa5);
|
|
29
|
+
$parcel$export(module.exports, "globalDropEffect", () => $4620ae0dc40f0031$export$8e6636520ac15722);
|
|
30
|
+
$parcel$export(module.exports, "setGlobalDropEffect", () => $4620ae0dc40f0031$export$64f52ed7349ddb84);
|
|
31
|
+
$parcel$export(module.exports, "globalAllowedDropOperations", () => $4620ae0dc40f0031$export$f0130eb70b6347b8);
|
|
32
|
+
$parcel$export(module.exports, "setGlobalAllowedDropOperations", () => $4620ae0dc40f0031$export$6539bc8c3a0a2d67);
|
|
33
|
+
/*
|
|
34
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
35
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
36
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
37
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
38
|
+
*
|
|
39
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
40
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
41
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
42
|
+
* governing permissions and limitations under the License.
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
const $4620ae0dc40f0031$export$dfdf5deeaf27473f = new WeakMap();
|
|
46
|
+
const $4620ae0dc40f0031$export$990fced5dfac2637 = Symbol();
|
|
47
|
+
function $4620ae0dc40f0031$export$3093291712f09a77(state) {
|
|
48
|
+
let { id: id } = $4620ae0dc40f0031$export$dfdf5deeaf27473f.get(state);
|
|
49
|
+
if (!id) throw new Error("Droppable item outside a droppable collection");
|
|
50
|
+
return id;
|
|
51
|
+
}
|
|
52
|
+
function $4620ae0dc40f0031$export$7e397efd01d3db27(state) {
|
|
53
|
+
let { ref: ref } = $4620ae0dc40f0031$export$dfdf5deeaf27473f.get(state);
|
|
54
|
+
if (!ref) throw new Error("Droppable item outside a droppable collection");
|
|
55
|
+
return ref;
|
|
56
|
+
}
|
|
57
|
+
function $4620ae0dc40f0031$export$e1d41611756c6326(items) {
|
|
58
|
+
let types = new Set();
|
|
59
|
+
for (let item of items)for (let type of Object.keys(item))types.add(type);
|
|
60
|
+
return types;
|
|
61
|
+
}
|
|
62
|
+
function $4620ae0dc40f0031$var$mapModality(modality) {
|
|
63
|
+
if (!modality) modality = "virtual";
|
|
64
|
+
if (modality === "pointer") modality = "virtual";
|
|
65
|
+
if (modality === "virtual" && typeof window !== "undefined" && "ontouchstart" in window) modality = "touch";
|
|
66
|
+
return modality;
|
|
67
|
+
}
|
|
68
|
+
function $4620ae0dc40f0031$export$49bac5d6d4b352ea() {
|
|
69
|
+
return $4620ae0dc40f0031$var$mapModality((0, $1Le3E$reactariainteractions.useInteractionModality)());
|
|
70
|
+
}
|
|
71
|
+
function $4620ae0dc40f0031$export$1fb2158d224b542c() {
|
|
72
|
+
return $4620ae0dc40f0031$var$mapModality((0, $1Le3E$reactariainteractions.getInteractionModality)());
|
|
73
|
+
}
|
|
74
|
+
function $4620ae0dc40f0031$export$f9c1490890ddd063(dataTransfer, items) {
|
|
75
|
+
// The data transfer API doesn't support more than one item of a given type at once.
|
|
76
|
+
// In addition, only a small set of types are supported natively for transfer between applications.
|
|
77
|
+
// We allow for both multiple items, as well as multiple representations of a single item.
|
|
78
|
+
// In order to make our API work with the native API, we serialize all items to JSON and
|
|
79
|
+
// store as a single native item. We only need to do this if there is more than one item
|
|
80
|
+
// of the same type, or if an item has more than one representation. Otherwise the native
|
|
81
|
+
// API is sufficient.
|
|
82
|
+
//
|
|
83
|
+
// The DataTransferItemList API also theoretically supports adding files, which would enable
|
|
84
|
+
// dragging binary data out of the browser onto the user's desktop for example. Unfortunately,
|
|
85
|
+
// this does not currently work in any browser, so it is not currently supported by our API.
|
|
86
|
+
// See e.g. https://bugs.chromium.org/p/chromium/issues/detail?id=438479.
|
|
87
|
+
let groupedByType = new Map();
|
|
88
|
+
let needsCustomData = false;
|
|
89
|
+
let customData = [];
|
|
90
|
+
for (let item of items){
|
|
91
|
+
let types = Object.keys(item);
|
|
92
|
+
if (types.length > 1) needsCustomData = true;
|
|
93
|
+
let dataByType = {};
|
|
94
|
+
for (let type of types){
|
|
95
|
+
let typeItems = groupedByType.get(type);
|
|
96
|
+
if (!typeItems) {
|
|
97
|
+
typeItems = [];
|
|
98
|
+
groupedByType.set(type, typeItems);
|
|
99
|
+
} else needsCustomData = true;
|
|
100
|
+
let data = item[type];
|
|
101
|
+
dataByType[type] = data;
|
|
102
|
+
typeItems.push(data);
|
|
103
|
+
}
|
|
104
|
+
customData.push(dataByType);
|
|
105
|
+
}
|
|
106
|
+
for (let [type, items] of groupedByType)if ((0, $76b1e110a27b1ccd$exports.NATIVE_DRAG_TYPES).has(type)) {
|
|
107
|
+
// Only one item of a given type can be set on a data transfer.
|
|
108
|
+
// Join all of the items together separated by newlines.
|
|
109
|
+
let data = items.join("\n");
|
|
110
|
+
dataTransfer.items.add(data, type);
|
|
111
|
+
} else // Set data to the first item so we have access to the list of types.
|
|
112
|
+
dataTransfer.items.add(items[0], type);
|
|
113
|
+
if (needsCustomData) {
|
|
114
|
+
let data = JSON.stringify(customData);
|
|
115
|
+
dataTransfer.items.add(data, (0, $76b1e110a27b1ccd$exports.CUSTOM_DRAG_TYPE));
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
class $4620ae0dc40f0031$export$7f04ce188c91447c {
|
|
119
|
+
has(type) {
|
|
120
|
+
if (this.includesUnknownTypes || type === $4620ae0dc40f0031$export$990fced5dfac2637 && this.types.has((0, $76b1e110a27b1ccd$exports.GENERIC_TYPE))) return true;
|
|
121
|
+
return typeof type === "string" && this.types.has(type);
|
|
122
|
+
}
|
|
123
|
+
constructor(dataTransfer){
|
|
124
|
+
this.types = new Set();
|
|
125
|
+
let hasFiles = false;
|
|
126
|
+
for (let item of dataTransfer.items)if (item.type !== (0, $76b1e110a27b1ccd$exports.CUSTOM_DRAG_TYPE)) {
|
|
127
|
+
if (item.kind === "file") hasFiles = true;
|
|
128
|
+
if (item.type) this.types.add(item.type);
|
|
129
|
+
else // Files with unknown types or extensions that don't map to a known mime type
|
|
130
|
+
// are sometimes exposed as an empty string by the browser. Map to a generic
|
|
131
|
+
// mime type instead. Note that this could also be a directory as there's no
|
|
132
|
+
// way to determine if something is a file or directory until drop.
|
|
133
|
+
this.types.add((0, $76b1e110a27b1ccd$exports.GENERIC_TYPE));
|
|
134
|
+
}
|
|
135
|
+
// In Safari, when dragging files, the dataTransfer.items list is empty, but dataTransfer.types contains "Files".
|
|
136
|
+
// Unfortunately, this doesn't tell us what types of files the user is dragging, so we need to assume that any
|
|
137
|
+
// type the user checks for is included. See https://bugs.webkit.org/show_bug.cgi?id=223517.
|
|
138
|
+
this.includesUnknownTypes = !hasFiles && dataTransfer.types.includes("Files");
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
function $4620ae0dc40f0031$export$d9e760437831f8b3(dataTransfer) {
|
|
142
|
+
let items = [];
|
|
143
|
+
// If our custom drag type is available, use that. This is a JSON serialized
|
|
144
|
+
// representation of all items in the drag, set when there are multiple items
|
|
145
|
+
// of the same type, or an individual item has multiple representations.
|
|
146
|
+
let hasCustomType = false;
|
|
147
|
+
if (dataTransfer.types.includes((0, $76b1e110a27b1ccd$exports.CUSTOM_DRAG_TYPE))) try {
|
|
148
|
+
let data = dataTransfer.getData((0, $76b1e110a27b1ccd$exports.CUSTOM_DRAG_TYPE));
|
|
149
|
+
let parsed = JSON.parse(data);
|
|
150
|
+
for (let item of parsed)items.push({
|
|
151
|
+
kind: "text",
|
|
152
|
+
types: new Set(Object.keys(item)),
|
|
153
|
+
getText: (type)=>Promise.resolve(item[type])
|
|
154
|
+
});
|
|
155
|
+
hasCustomType = true;
|
|
156
|
+
} catch (e) {
|
|
157
|
+
// ignore
|
|
158
|
+
}
|
|
159
|
+
// Otherwise, map native drag items to items of a single representation.
|
|
160
|
+
if (!hasCustomType) {
|
|
161
|
+
let stringItems = new Map();
|
|
162
|
+
for (let item of dataTransfer.items){
|
|
163
|
+
if (item.kind === "string") // The data for all formats must be read here because the data transfer gets
|
|
164
|
+
// cleared out after the event handler finishes. If the item has an empty string
|
|
165
|
+
// as a type, the mime type is unknown. Map to a generic mime type instead.
|
|
166
|
+
stringItems.set(item.type || (0, $76b1e110a27b1ccd$exports.GENERIC_TYPE), dataTransfer.getData(item.type));
|
|
167
|
+
else if (item.kind === "file") {
|
|
168
|
+
// Despite the name, webkitGetAsEntry is also implemented in Firefox and Edge.
|
|
169
|
+
// In the future, we may use getAsFileSystemHandle instead, but that's currently
|
|
170
|
+
// only implemented in Chrome.
|
|
171
|
+
if (typeof item.webkitGetAsEntry === "function") {
|
|
172
|
+
let entry = item.webkitGetAsEntry();
|
|
173
|
+
// eslint-disable-next-line max-depth
|
|
174
|
+
if (!entry) continue;
|
|
175
|
+
// eslint-disable-next-line max-depth
|
|
176
|
+
if (entry.isFile) items.push($4620ae0dc40f0031$var$createFileItem(item.getAsFile()));
|
|
177
|
+
else if (entry.isDirectory) items.push($4620ae0dc40f0031$var$createDirectoryItem(entry));
|
|
178
|
+
} else // Assume it's a file.
|
|
179
|
+
items.push($4620ae0dc40f0031$var$createFileItem(item.getAsFile()));
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
// All string items are different representations of the same item. There's no way to have
|
|
183
|
+
// multiple string items at once in the current DataTransfer API.
|
|
184
|
+
if (stringItems.size > 0) items.push({
|
|
185
|
+
kind: "text",
|
|
186
|
+
types: new Set(stringItems.keys()),
|
|
187
|
+
getText: (type)=>Promise.resolve(stringItems.get(type))
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
return items;
|
|
191
|
+
}
|
|
192
|
+
function $4620ae0dc40f0031$var$blobToString(blob) {
|
|
193
|
+
if (typeof blob.text === "function") return blob.text();
|
|
194
|
+
// Safari doesn't have the Blob#text() method yet...
|
|
195
|
+
return new Promise((resolve, reject)=>{
|
|
196
|
+
let reader = new FileReader;
|
|
197
|
+
reader.onload = ()=>{
|
|
198
|
+
resolve(reader.result);
|
|
199
|
+
};
|
|
200
|
+
reader.onerror = reject;
|
|
201
|
+
reader.readAsText(blob);
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
function $4620ae0dc40f0031$var$createFileItem(file) {
|
|
205
|
+
return {
|
|
206
|
+
kind: "file",
|
|
207
|
+
type: file.type || (0, $76b1e110a27b1ccd$exports.GENERIC_TYPE),
|
|
208
|
+
name: file.name,
|
|
209
|
+
getText: ()=>$4620ae0dc40f0031$var$blobToString(file),
|
|
210
|
+
getFile: ()=>Promise.resolve(file)
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
function $4620ae0dc40f0031$var$createDirectoryItem(entry) {
|
|
214
|
+
return {
|
|
215
|
+
kind: "directory",
|
|
216
|
+
name: entry.name,
|
|
217
|
+
getEntries: ()=>$4620ae0dc40f0031$var$getEntries(entry)
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
async function* $4620ae0dc40f0031$var$getEntries(item) {
|
|
221
|
+
let reader = item.createReader();
|
|
222
|
+
// We must call readEntries repeatedly because there may be a limit to the
|
|
223
|
+
// number of entries that are returned at once.
|
|
224
|
+
let entries;
|
|
225
|
+
do {
|
|
226
|
+
entries = await new Promise((resolve, reject)=>{
|
|
227
|
+
reader.readEntries(resolve, reject);
|
|
228
|
+
});
|
|
229
|
+
for (let entry of entries){
|
|
230
|
+
if (entry.isFile) {
|
|
231
|
+
let file = await $4620ae0dc40f0031$var$getEntryFile(entry);
|
|
232
|
+
yield $4620ae0dc40f0031$var$createFileItem(file);
|
|
233
|
+
} else if (entry.isDirectory) yield $4620ae0dc40f0031$var$createDirectoryItem(entry);
|
|
234
|
+
}
|
|
235
|
+
}while (entries.length > 0);
|
|
236
|
+
}
|
|
237
|
+
function $4620ae0dc40f0031$var$getEntryFile(entry) {
|
|
238
|
+
return new Promise((resolve, reject)=>entry.file(resolve, reject));
|
|
239
|
+
}
|
|
240
|
+
function $4620ae0dc40f0031$export$97fd558bdc44bea1(dropItem) {
|
|
241
|
+
return dropItem.kind === "text";
|
|
242
|
+
}
|
|
243
|
+
function $4620ae0dc40f0031$export$a144e1752ebe0aa(dropItem) {
|
|
244
|
+
return dropItem.kind === "file";
|
|
245
|
+
}
|
|
246
|
+
function $4620ae0dc40f0031$export$2b40a62bdbe6b2b0(dropItem) {
|
|
247
|
+
return dropItem.kind === "directory";
|
|
248
|
+
}
|
|
249
|
+
let $4620ae0dc40f0031$export$6ca6700462636d0b = {
|
|
250
|
+
draggingKeys: new Set()
|
|
251
|
+
};
|
|
252
|
+
function $4620ae0dc40f0031$export$f2be18a910c0caa6(ref) {
|
|
253
|
+
$4620ae0dc40f0031$export$6ca6700462636d0b.draggingCollectionRef = ref;
|
|
254
|
+
}
|
|
255
|
+
function $4620ae0dc40f0031$export$72cb63bdda528276(keys) {
|
|
256
|
+
$4620ae0dc40f0031$export$6ca6700462636d0b.draggingKeys = keys;
|
|
257
|
+
}
|
|
258
|
+
function $4620ae0dc40f0031$export$dac8db29d42db9a1(ref) {
|
|
259
|
+
$4620ae0dc40f0031$export$6ca6700462636d0b.dropCollectionRef = ref;
|
|
260
|
+
}
|
|
261
|
+
function $4620ae0dc40f0031$export$70936501603e6c57() {
|
|
262
|
+
$4620ae0dc40f0031$export$6ca6700462636d0b = {
|
|
263
|
+
draggingKeys: new Set()
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
function $4620ae0dc40f0031$export$6c10d32b362bfa5f(state) {
|
|
267
|
+
$4620ae0dc40f0031$export$6ca6700462636d0b = state;
|
|
268
|
+
}
|
|
269
|
+
function $4620ae0dc40f0031$export$78bf638634500fa5(ref) {
|
|
270
|
+
let { draggingCollectionRef: draggingCollectionRef, dropCollectionRef: dropCollectionRef } = $4620ae0dc40f0031$export$6ca6700462636d0b;
|
|
271
|
+
return (draggingCollectionRef === null || draggingCollectionRef === void 0 ? void 0 : draggingCollectionRef.current) != null && draggingCollectionRef.current === ((ref === null || ref === void 0 ? void 0 : ref.current) || (dropCollectionRef === null || dropCollectionRef === void 0 ? void 0 : dropCollectionRef.current));
|
|
272
|
+
}
|
|
273
|
+
let $4620ae0dc40f0031$export$8e6636520ac15722;
|
|
274
|
+
function $4620ae0dc40f0031$export$64f52ed7349ddb84(dropEffect) {
|
|
275
|
+
$4620ae0dc40f0031$export$8e6636520ac15722 = dropEffect;
|
|
276
|
+
}
|
|
277
|
+
let $4620ae0dc40f0031$export$f0130eb70b6347b8 = (0, $76b1e110a27b1ccd$exports.DROP_OPERATION).none;
|
|
278
|
+
function $4620ae0dc40f0031$export$6539bc8c3a0a2d67(o) {
|
|
279
|
+
$4620ae0dc40f0031$export$f0130eb70b6347b8 = o;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
//# sourceMappingURL=utils.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAaM,MAAM,4CAAyB,IAAI;AACnC,MAAM,4CAAsB;AAE5B,SAAS,0CAAyB,KAA+B;IACtE,IAAI,MAAC,EAAE,EAAC,GAAG,0CAAuB,GAAG,CAAC;IACtC,IAAI,CAAC,IACH,MAAM,IAAI,MAAM;IAGlB,OAAO;AACT;AAEO,SAAS,0CAA0B,KAA+B;IACvE,IAAI,OAAC,GAAG,EAAC,GAAG,0CAAuB,GAAG,CAAC;IACvC,IAAI,CAAC,KACH,MAAM,IAAI,MAAM;IAGlB,OAAO;AACT;AAEO,SAAS,0CAAS,KAAiB;IACxC,IAAI,QAAQ,IAAI;IAChB,KAAK,IAAI,QAAQ,MACf,KAAK,IAAI,QAAQ,OAAO,IAAI,CAAC,MAC3B,MAAM,GAAG,CAAC;IAId,OAAO;AACT;AAEA,SAAS,kCAAY,QAAgB;IACnC,IAAI,CAAC,UACH,WAAW;IAGb,IAAI,aAA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;IAClE,0CAAe,qBAAqB,GAAG;AACzC;AAEO,SAAS,0CAAgB,IAAc;IAC5C,0CAAe,YAAY,GAAG;AAChC;AAEO,SAAS,0CAAqB,GAA2B;IAC9D,0CAAe,iBAAiB,GAAG;AACrC;AAEO,SAAS;IACd,4CAAiB;QAAC,cAAc,IAAI;IAAK;AAC3C;AAEO,SAAS,0CAAkB,KAAe;IAC/C,4CAAiB;AACnB;AAIO,SAAS,0CAAwB,GAA4B;IAClE,IAAI,yBAAC,qBAAqB,qBAAE,iBAAiB,EAAC,GAAG;IACjD,OAAO,CAAA,kCAAA,4CAAA,sBAAuB,OAAO,KAAI,QAAQ,sBAAsB,OAAO,KAAM,CAAA,CAAA,gBAAA,0BAAA,IAAK,OAAO,MAAI,8BAAA,wCAAA,kBAAmB,OAAO,CAAD;AAC/H;AAGO,IAAI;AACJ,SAAS,0CAAoB,UAAsB;IACxD,4CAAmB;AACrB;AAEO,IAAI,4CAA8B,CAAA,GAAA,wCAAa,EAAE,IAAI;AACrD,SAAS,0CAA+B,CAAiB;IAC9D,4CAA8B;AAChC","sources":["packages/@react-aria/dnd/src/utils.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {CUSTOM_DRAG_TYPE, DROP_OPERATION, GENERIC_TYPE, NATIVE_DRAG_TYPES} from './constants';\nimport {DirectoryDropItem, DragItem, DropItem, FileDropItem, DragTypes as IDragTypes, Key, TextDropItem} from '@react-types/shared';\nimport {DroppableCollectionState} from '@react-stately/dnd';\nimport {getInteractionModality, useInteractionModality} from '@react-aria/interactions';\nimport {RefObject} from 'react';\n\ninterface DroppableCollectionMap {\n id: string,\n ref: RefObject<HTMLElement>\n}\n\nexport const droppableCollectionMap = new WeakMap<DroppableCollectionState, DroppableCollectionMap>();\nexport const DIRECTORY_DRAG_TYPE = Symbol();\n\nexport function getDroppableCollectionId(state: DroppableCollectionState) {\n let {id} = droppableCollectionMap.get(state);\n if (!id) {\n throw new Error('Droppable item outside a droppable collection');\n }\n\n return id;\n}\n\nexport function getDroppableCollectionRef(state: DroppableCollectionState) {\n let {ref} = droppableCollectionMap.get(state);\n if (!ref) {\n throw new Error('Droppable item outside a droppable collection');\n }\n\n return ref;\n}\n\nexport function getTypes(items: DragItem[]): Set<string> {\n let types = new Set<string>();\n for (let item of items) {\n for (let type of Object.keys(item)) {\n types.add(type);\n }\n }\n\n return types;\n}\n\nfunction mapModality(modality: string) {\n if (!modality) {\n modality = 'virtual';\n }\n\n if (modality === 'pointer') {\n modality = 'virtual';\n }\n\n if (modality === 'virtual' && (typeof window !== 'undefined' && 'ontouchstart' in window)) {\n modality = 'touch';\n }\n\n return modality;\n}\n\nexport function useDragModality() {\n return mapModality(useInteractionModality());\n}\n\nexport function getDragModality() {\n return mapModality(getInteractionModality());\n}\n\nexport function writeToDataTransfer(dataTransfer: DataTransfer, items: DragItem[]) {\n // The data transfer API doesn't support more than one item of a given type at once.\n // In addition, only a small set of types are supported natively for transfer between applications.\n // We allow for both multiple items, as well as multiple representations of a single item.\n // In order to make our API work with the native API, we serialize all items to JSON and\n // store as a single native item. We only need to do this if there is more than one item\n // of the same type, or if an item has more than one representation. Otherwise the native\n // API is sufficient.\n //\n // The DataTransferItemList API also theoretically supports adding files, which would enable\n // dragging binary data out of the browser onto the user's desktop for example. Unfortunately,\n // this does not currently work in any browser, so it is not currently supported by our API.\n // See e.g. https://bugs.chromium.org/p/chromium/issues/detail?id=438479.\n let groupedByType = new Map<string, string[]>();\n let needsCustomData = false;\n let customData = [];\n for (let item of items) {\n let types = Object.keys(item);\n if (types.length > 1) {\n needsCustomData = true;\n }\n\n let dataByType = {};\n for (let type of types) {\n let typeItems = groupedByType.get(type);\n if (!typeItems) {\n typeItems = [];\n groupedByType.set(type, typeItems);\n } else {\n needsCustomData = true;\n }\n\n let data = item[type];\n dataByType[type] = data;\n typeItems.push(data);\n }\n\n customData.push(dataByType);\n }\n\n for (let [type, items] of groupedByType) {\n if (NATIVE_DRAG_TYPES.has(type)) {\n // Only one item of a given type can be set on a data transfer.\n // Join all of the items together separated by newlines.\n let data = items.join('\\n');\n dataTransfer.items.add(data, type);\n } else {\n // Set data to the first item so we have access to the list of types.\n dataTransfer.items.add(items[0], type);\n }\n }\n\n if (needsCustomData) {\n let data = JSON.stringify(customData);\n dataTransfer.items.add(data, CUSTOM_DRAG_TYPE);\n }\n}\n\nexport class DragTypes implements IDragTypes {\n private types: Set<string>;\n private includesUnknownTypes: boolean;\n\n constructor(dataTransfer: DataTransfer) {\n this.types = new Set<string>();\n\n let hasFiles = false;\n for (let item of dataTransfer.items) {\n if (item.type !== CUSTOM_DRAG_TYPE) {\n if (item.kind === 'file') {\n hasFiles = true;\n }\n\n if (item.type) {\n this.types.add(item.type);\n } else {\n // Files with unknown types or extensions that don't map to a known mime type\n // are sometimes exposed as an empty string by the browser. Map to a generic\n // mime type instead. Note that this could also be a directory as there's no\n // way to determine if something is a file or directory until drop.\n this.types.add(GENERIC_TYPE);\n }\n }\n }\n\n // In Safari, when dragging files, the dataTransfer.items list is empty, but dataTransfer.types contains \"Files\".\n // Unfortunately, this doesn't tell us what types of files the user is dragging, so we need to assume that any\n // type the user checks for is included. See https://bugs.webkit.org/show_bug.cgi?id=223517.\n this.includesUnknownTypes = !hasFiles && dataTransfer.types.includes('Files');\n }\n\n has(type: string | symbol) {\n if (this.includesUnknownTypes || (type === DIRECTORY_DRAG_TYPE && this.types.has(GENERIC_TYPE))) {\n return true;\n }\n\n return typeof type === 'string' && this.types.has(type);\n }\n}\n\nexport function readFromDataTransfer(dataTransfer: DataTransfer) {\n let items: DropItem[] = [];\n\n // If our custom drag type is available, use that. This is a JSON serialized\n // representation of all items in the drag, set when there are multiple items\n // of the same type, or an individual item has multiple representations.\n let hasCustomType = false;\n if (dataTransfer.types.includes(CUSTOM_DRAG_TYPE)) {\n try {\n let data = dataTransfer.getData(CUSTOM_DRAG_TYPE);\n let parsed = JSON.parse(data);\n for (let item of parsed) {\n items.push({\n kind: 'text',\n types: new Set(Object.keys(item)),\n getText: (type) => Promise.resolve(item[type])\n });\n }\n\n hasCustomType = true;\n } catch (e) {\n // ignore\n }\n }\n\n // Otherwise, map native drag items to items of a single representation.\n if (!hasCustomType) {\n let stringItems = new Map();\n for (let item of dataTransfer.items) {\n if (item.kind === 'string') {\n // The data for all formats must be read here because the data transfer gets\n // cleared out after the event handler finishes. If the item has an empty string\n // as a type, the mime type is unknown. Map to a generic mime type instead.\n stringItems.set(item.type || GENERIC_TYPE, dataTransfer.getData(item.type));\n } else if (item.kind === 'file') {\n // Despite the name, webkitGetAsEntry is also implemented in Firefox and Edge.\n // In the future, we may use getAsFileSystemHandle instead, but that's currently\n // only implemented in Chrome.\n if (typeof item.webkitGetAsEntry === 'function') {\n let entry: FileSystemEntry = item.webkitGetAsEntry();\n // eslint-disable-next-line max-depth\n if (!entry) {\n // For some reason, Firefox includes an item with type image/png when copy\n // and pasting any file or directory (no matter the type), but returns `null` for both\n // item.getAsFile() and item.webkitGetAsEntry(). Safari works as expected. Ignore this\n // item if this happens. See https://bugzilla.mozilla.org/show_bug.cgi?id=1699743.\n // This was recently fixed in Chrome Canary: https://bugs.chromium.org/p/chromium/issues/detail?id=1175483.\n continue;\n }\n\n // eslint-disable-next-line max-depth\n if (entry.isFile) {\n items.push(createFileItem(item.getAsFile()));\n } else if (entry.isDirectory) {\n items.push(createDirectoryItem(entry));\n }\n } else {\n // Assume it's a file.\n items.push(createFileItem(item.getAsFile()));\n }\n }\n }\n\n // All string items are different representations of the same item. There's no way to have\n // multiple string items at once in the current DataTransfer API.\n if (stringItems.size > 0) {\n items.push({\n kind: 'text',\n types: new Set(stringItems.keys()),\n getText: (type) => Promise.resolve(stringItems.get(type))\n });\n }\n }\n\n return items;\n}\n\nfunction blobToString(blob: Blob): Promise<string> {\n if (typeof blob.text === 'function') {\n return blob.text();\n }\n\n // Safari doesn't have the Blob#text() method yet...\n return new Promise((resolve, reject) => {\n let reader = new FileReader;\n reader.onload = () => {\n resolve(reader.result as string);\n };\n\n reader.onerror = reject;\n reader.readAsText(blob);\n });\n}\n\nfunction createFileItem(file: File): FileDropItem {\n return {\n kind: 'file',\n type: file.type || GENERIC_TYPE,\n name: file.name,\n getText: () => blobToString(file),\n getFile: () => Promise.resolve(file)\n };\n}\n\nfunction createDirectoryItem(entry: any): DirectoryDropItem {\n return {\n kind: 'directory',\n name: entry.name,\n getEntries: () => getEntries(entry)\n };\n}\n\nasync function *getEntries(item: FileSystemDirectoryEntry): AsyncIterable<FileDropItem | DirectoryDropItem> {\n let reader = item.createReader();\n\n // We must call readEntries repeatedly because there may be a limit to the\n // number of entries that are returned at once.\n let entries: FileSystemEntry[];\n do {\n entries = await new Promise((resolve, reject) => {\n reader.readEntries(resolve, reject);\n });\n\n for (let entry of entries) {\n if (entry.isFile) {\n let file = await getEntryFile(entry as FileSystemFileEntry);\n yield createFileItem(file);\n } else if (entry.isDirectory) {\n yield createDirectoryItem(entry);\n }\n }\n } while (entries.length > 0);\n}\n\nfunction getEntryFile(entry: FileSystemFileEntry): Promise<File> {\n return new Promise((resolve, reject) => entry.file(resolve, reject));\n}\n\n/** Returns whether a drop item contains text data. */\nexport function isTextDropItem(dropItem: DropItem): dropItem is TextDropItem {\n return dropItem.kind === 'text';\n}\n\n/** Returns whether a drop item is a file. */\nexport function isFileDropItem(dropItem: DropItem): dropItem is FileDropItem {\n return dropItem.kind === 'file';\n}\n\n/** Returns whether a drop item is a directory. */\nexport function isDirectoryDropItem(dropItem: DropItem): dropItem is DirectoryDropItem {\n return dropItem.kind === 'directory';\n}\n\n// Global DnD collection state tracker.\nexport interface DnDState {\n /** A ref for the of the drag items in the current drag session if any. */\n draggingCollectionRef?: RefObject<HTMLElement>,\n /** The set of currently dragged keys. */\n draggingKeys: Set<Key>,\n /** A ref for the collection that is targeted for a drop operation, if any. */\n dropCollectionRef?: RefObject<HTMLElement>\n}\n\nexport let globalDndState: DnDState = {draggingKeys: new Set()};\n\nexport function setDraggingCollectionRef(ref: RefObject<HTMLElement>) {\n globalDndState.draggingCollectionRef = ref;\n}\n\nexport function setDraggingKeys(keys: Set<Key>) {\n globalDndState.draggingKeys = keys;\n}\n\nexport function setDropCollectionRef(ref: RefObject<HTMLElement>) {\n globalDndState.dropCollectionRef = ref;\n}\n\nexport function clearGlobalDnDState() {\n globalDndState = {draggingKeys: new Set()};\n}\n\nexport function setGlobalDnDState(state: DnDState) {\n globalDndState = state;\n}\n\n// Util function to check if the current dragging collection ref is the same as the current targeted droppable collection ref.\n// Allows a droppable ref arg in case the global drop collection ref hasn't been set\nexport function isInternalDropOperation(ref?: RefObject<HTMLElement>) {\n let {draggingCollectionRef, dropCollectionRef} = globalDndState;\n return draggingCollectionRef?.current != null && draggingCollectionRef.current === (ref?.current || dropCollectionRef?.current);\n}\n\ntype DropEffect = 'none' | 'copy' | 'link' | 'move';\nexport let globalDropEffect: DropEffect;\nexport function setGlobalDropEffect(dropEffect: DropEffect) {\n globalDropEffect = dropEffect;\n}\n\nexport let globalAllowedDropOperations = DROP_OPERATION.none;\nexport function setGlobalAllowedDropOperations(o: DROP_OPERATION) {\n globalAllowedDropOperations = o;\n}\n"],"names":[],"version":3,"file":"utils.main.js.map"}
|
package/dist/utils.mjs
ADDED
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import {CUSTOM_DRAG_TYPE as $103790afe9474d1c$export$fd9f9fc120c5402d, DROP_OPERATION as $103790afe9474d1c$export$60b7b4bcf3903d8e, GENERIC_TYPE as $103790afe9474d1c$export$f8fc6581787339b3, NATIVE_DRAG_TYPES as $103790afe9474d1c$export$4a7729b856e9a690} from "./constants.mjs";
|
|
2
|
+
import {useInteractionModality as $j62BV$useInteractionModality, getInteractionModality as $j62BV$getInteractionModality} from "@react-aria/interactions";
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
6
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
8
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
11
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
|
+
* governing permissions and limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const $7252cd45fc48c07c$export$dfdf5deeaf27473f = new WeakMap();
|
|
17
|
+
const $7252cd45fc48c07c$export$990fced5dfac2637 = Symbol();
|
|
18
|
+
function $7252cd45fc48c07c$export$3093291712f09a77(state) {
|
|
19
|
+
let { id: id } = $7252cd45fc48c07c$export$dfdf5deeaf27473f.get(state);
|
|
20
|
+
if (!id) throw new Error("Droppable item outside a droppable collection");
|
|
21
|
+
return id;
|
|
22
|
+
}
|
|
23
|
+
function $7252cd45fc48c07c$export$7e397efd01d3db27(state) {
|
|
24
|
+
let { ref: ref } = $7252cd45fc48c07c$export$dfdf5deeaf27473f.get(state);
|
|
25
|
+
if (!ref) throw new Error("Droppable item outside a droppable collection");
|
|
26
|
+
return ref;
|
|
27
|
+
}
|
|
28
|
+
function $7252cd45fc48c07c$export$e1d41611756c6326(items) {
|
|
29
|
+
let types = new Set();
|
|
30
|
+
for (let item of items)for (let type of Object.keys(item))types.add(type);
|
|
31
|
+
return types;
|
|
32
|
+
}
|
|
33
|
+
function $7252cd45fc48c07c$var$mapModality(modality) {
|
|
34
|
+
if (!modality) modality = "virtual";
|
|
35
|
+
if (modality === "pointer") modality = "virtual";
|
|
36
|
+
if (modality === "virtual" && typeof window !== "undefined" && "ontouchstart" in window) modality = "touch";
|
|
37
|
+
return modality;
|
|
38
|
+
}
|
|
39
|
+
function $7252cd45fc48c07c$export$49bac5d6d4b352ea() {
|
|
40
|
+
return $7252cd45fc48c07c$var$mapModality((0, $j62BV$useInteractionModality)());
|
|
41
|
+
}
|
|
42
|
+
function $7252cd45fc48c07c$export$1fb2158d224b542c() {
|
|
43
|
+
return $7252cd45fc48c07c$var$mapModality((0, $j62BV$getInteractionModality)());
|
|
44
|
+
}
|
|
45
|
+
function $7252cd45fc48c07c$export$f9c1490890ddd063(dataTransfer, items) {
|
|
46
|
+
// The data transfer API doesn't support more than one item of a given type at once.
|
|
47
|
+
// In addition, only a small set of types are supported natively for transfer between applications.
|
|
48
|
+
// We allow for both multiple items, as well as multiple representations of a single item.
|
|
49
|
+
// In order to make our API work with the native API, we serialize all items to JSON and
|
|
50
|
+
// store as a single native item. We only need to do this if there is more than one item
|
|
51
|
+
// of the same type, or if an item has more than one representation. Otherwise the native
|
|
52
|
+
// API is sufficient.
|
|
53
|
+
//
|
|
54
|
+
// The DataTransferItemList API also theoretically supports adding files, which would enable
|
|
55
|
+
// dragging binary data out of the browser onto the user's desktop for example. Unfortunately,
|
|
56
|
+
// this does not currently work in any browser, so it is not currently supported by our API.
|
|
57
|
+
// See e.g. https://bugs.chromium.org/p/chromium/issues/detail?id=438479.
|
|
58
|
+
let groupedByType = new Map();
|
|
59
|
+
let needsCustomData = false;
|
|
60
|
+
let customData = [];
|
|
61
|
+
for (let item of items){
|
|
62
|
+
let types = Object.keys(item);
|
|
63
|
+
if (types.length > 1) needsCustomData = true;
|
|
64
|
+
let dataByType = {};
|
|
65
|
+
for (let type of types){
|
|
66
|
+
let typeItems = groupedByType.get(type);
|
|
67
|
+
if (!typeItems) {
|
|
68
|
+
typeItems = [];
|
|
69
|
+
groupedByType.set(type, typeItems);
|
|
70
|
+
} else needsCustomData = true;
|
|
71
|
+
let data = item[type];
|
|
72
|
+
dataByType[type] = data;
|
|
73
|
+
typeItems.push(data);
|
|
74
|
+
}
|
|
75
|
+
customData.push(dataByType);
|
|
76
|
+
}
|
|
77
|
+
for (let [type, items] of groupedByType)if ((0, $103790afe9474d1c$export$4a7729b856e9a690).has(type)) {
|
|
78
|
+
// Only one item of a given type can be set on a data transfer.
|
|
79
|
+
// Join all of the items together separated by newlines.
|
|
80
|
+
let data = items.join("\n");
|
|
81
|
+
dataTransfer.items.add(data, type);
|
|
82
|
+
} else // Set data to the first item so we have access to the list of types.
|
|
83
|
+
dataTransfer.items.add(items[0], type);
|
|
84
|
+
if (needsCustomData) {
|
|
85
|
+
let data = JSON.stringify(customData);
|
|
86
|
+
dataTransfer.items.add(data, (0, $103790afe9474d1c$export$fd9f9fc120c5402d));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
class $7252cd45fc48c07c$export$7f04ce188c91447c {
|
|
90
|
+
has(type) {
|
|
91
|
+
if (this.includesUnknownTypes || type === $7252cd45fc48c07c$export$990fced5dfac2637 && this.types.has((0, $103790afe9474d1c$export$f8fc6581787339b3))) return true;
|
|
92
|
+
return typeof type === "string" && this.types.has(type);
|
|
93
|
+
}
|
|
94
|
+
constructor(dataTransfer){
|
|
95
|
+
this.types = new Set();
|
|
96
|
+
let hasFiles = false;
|
|
97
|
+
for (let item of dataTransfer.items)if (item.type !== (0, $103790afe9474d1c$export$fd9f9fc120c5402d)) {
|
|
98
|
+
if (item.kind === "file") hasFiles = true;
|
|
99
|
+
if (item.type) this.types.add(item.type);
|
|
100
|
+
else // Files with unknown types or extensions that don't map to a known mime type
|
|
101
|
+
// are sometimes exposed as an empty string by the browser. Map to a generic
|
|
102
|
+
// mime type instead. Note that this could also be a directory as there's no
|
|
103
|
+
// way to determine if something is a file or directory until drop.
|
|
104
|
+
this.types.add((0, $103790afe9474d1c$export$f8fc6581787339b3));
|
|
105
|
+
}
|
|
106
|
+
// In Safari, when dragging files, the dataTransfer.items list is empty, but dataTransfer.types contains "Files".
|
|
107
|
+
// Unfortunately, this doesn't tell us what types of files the user is dragging, so we need to assume that any
|
|
108
|
+
// type the user checks for is included. See https://bugs.webkit.org/show_bug.cgi?id=223517.
|
|
109
|
+
this.includesUnknownTypes = !hasFiles && dataTransfer.types.includes("Files");
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function $7252cd45fc48c07c$export$d9e760437831f8b3(dataTransfer) {
|
|
113
|
+
let items = [];
|
|
114
|
+
// If our custom drag type is available, use that. This is a JSON serialized
|
|
115
|
+
// representation of all items in the drag, set when there are multiple items
|
|
116
|
+
// of the same type, or an individual item has multiple representations.
|
|
117
|
+
let hasCustomType = false;
|
|
118
|
+
if (dataTransfer.types.includes((0, $103790afe9474d1c$export$fd9f9fc120c5402d))) try {
|
|
119
|
+
let data = dataTransfer.getData((0, $103790afe9474d1c$export$fd9f9fc120c5402d));
|
|
120
|
+
let parsed = JSON.parse(data);
|
|
121
|
+
for (let item of parsed)items.push({
|
|
122
|
+
kind: "text",
|
|
123
|
+
types: new Set(Object.keys(item)),
|
|
124
|
+
getText: (type)=>Promise.resolve(item[type])
|
|
125
|
+
});
|
|
126
|
+
hasCustomType = true;
|
|
127
|
+
} catch (e) {
|
|
128
|
+
// ignore
|
|
129
|
+
}
|
|
130
|
+
// Otherwise, map native drag items to items of a single representation.
|
|
131
|
+
if (!hasCustomType) {
|
|
132
|
+
let stringItems = new Map();
|
|
133
|
+
for (let item of dataTransfer.items){
|
|
134
|
+
if (item.kind === "string") // The data for all formats must be read here because the data transfer gets
|
|
135
|
+
// cleared out after the event handler finishes. If the item has an empty string
|
|
136
|
+
// as a type, the mime type is unknown. Map to a generic mime type instead.
|
|
137
|
+
stringItems.set(item.type || (0, $103790afe9474d1c$export$f8fc6581787339b3), dataTransfer.getData(item.type));
|
|
138
|
+
else if (item.kind === "file") {
|
|
139
|
+
// Despite the name, webkitGetAsEntry is also implemented in Firefox and Edge.
|
|
140
|
+
// In the future, we may use getAsFileSystemHandle instead, but that's currently
|
|
141
|
+
// only implemented in Chrome.
|
|
142
|
+
if (typeof item.webkitGetAsEntry === "function") {
|
|
143
|
+
let entry = item.webkitGetAsEntry();
|
|
144
|
+
// eslint-disable-next-line max-depth
|
|
145
|
+
if (!entry) continue;
|
|
146
|
+
// eslint-disable-next-line max-depth
|
|
147
|
+
if (entry.isFile) items.push($7252cd45fc48c07c$var$createFileItem(item.getAsFile()));
|
|
148
|
+
else if (entry.isDirectory) items.push($7252cd45fc48c07c$var$createDirectoryItem(entry));
|
|
149
|
+
} else // Assume it's a file.
|
|
150
|
+
items.push($7252cd45fc48c07c$var$createFileItem(item.getAsFile()));
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
// All string items are different representations of the same item. There's no way to have
|
|
154
|
+
// multiple string items at once in the current DataTransfer API.
|
|
155
|
+
if (stringItems.size > 0) items.push({
|
|
156
|
+
kind: "text",
|
|
157
|
+
types: new Set(stringItems.keys()),
|
|
158
|
+
getText: (type)=>Promise.resolve(stringItems.get(type))
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
return items;
|
|
162
|
+
}
|
|
163
|
+
function $7252cd45fc48c07c$var$blobToString(blob) {
|
|
164
|
+
if (typeof blob.text === "function") return blob.text();
|
|
165
|
+
// Safari doesn't have the Blob#text() method yet...
|
|
166
|
+
return new Promise((resolve, reject)=>{
|
|
167
|
+
let reader = new FileReader;
|
|
168
|
+
reader.onload = ()=>{
|
|
169
|
+
resolve(reader.result);
|
|
170
|
+
};
|
|
171
|
+
reader.onerror = reject;
|
|
172
|
+
reader.readAsText(blob);
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
function $7252cd45fc48c07c$var$createFileItem(file) {
|
|
176
|
+
return {
|
|
177
|
+
kind: "file",
|
|
178
|
+
type: file.type || (0, $103790afe9474d1c$export$f8fc6581787339b3),
|
|
179
|
+
name: file.name,
|
|
180
|
+
getText: ()=>$7252cd45fc48c07c$var$blobToString(file),
|
|
181
|
+
getFile: ()=>Promise.resolve(file)
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
function $7252cd45fc48c07c$var$createDirectoryItem(entry) {
|
|
185
|
+
return {
|
|
186
|
+
kind: "directory",
|
|
187
|
+
name: entry.name,
|
|
188
|
+
getEntries: ()=>$7252cd45fc48c07c$var$getEntries(entry)
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
async function* $7252cd45fc48c07c$var$getEntries(item) {
|
|
192
|
+
let reader = item.createReader();
|
|
193
|
+
// We must call readEntries repeatedly because there may be a limit to the
|
|
194
|
+
// number of entries that are returned at once.
|
|
195
|
+
let entries;
|
|
196
|
+
do {
|
|
197
|
+
entries = await new Promise((resolve, reject)=>{
|
|
198
|
+
reader.readEntries(resolve, reject);
|
|
199
|
+
});
|
|
200
|
+
for (let entry of entries){
|
|
201
|
+
if (entry.isFile) {
|
|
202
|
+
let file = await $7252cd45fc48c07c$var$getEntryFile(entry);
|
|
203
|
+
yield $7252cd45fc48c07c$var$createFileItem(file);
|
|
204
|
+
} else if (entry.isDirectory) yield $7252cd45fc48c07c$var$createDirectoryItem(entry);
|
|
205
|
+
}
|
|
206
|
+
}while (entries.length > 0);
|
|
207
|
+
}
|
|
208
|
+
function $7252cd45fc48c07c$var$getEntryFile(entry) {
|
|
209
|
+
return new Promise((resolve, reject)=>entry.file(resolve, reject));
|
|
210
|
+
}
|
|
211
|
+
function $7252cd45fc48c07c$export$97fd558bdc44bea1(dropItem) {
|
|
212
|
+
return dropItem.kind === "text";
|
|
213
|
+
}
|
|
214
|
+
function $7252cd45fc48c07c$export$a144e1752ebe0aa(dropItem) {
|
|
215
|
+
return dropItem.kind === "file";
|
|
216
|
+
}
|
|
217
|
+
function $7252cd45fc48c07c$export$2b40a62bdbe6b2b0(dropItem) {
|
|
218
|
+
return dropItem.kind === "directory";
|
|
219
|
+
}
|
|
220
|
+
let $7252cd45fc48c07c$export$6ca6700462636d0b = {
|
|
221
|
+
draggingKeys: new Set()
|
|
222
|
+
};
|
|
223
|
+
function $7252cd45fc48c07c$export$f2be18a910c0caa6(ref) {
|
|
224
|
+
$7252cd45fc48c07c$export$6ca6700462636d0b.draggingCollectionRef = ref;
|
|
225
|
+
}
|
|
226
|
+
function $7252cd45fc48c07c$export$72cb63bdda528276(keys) {
|
|
227
|
+
$7252cd45fc48c07c$export$6ca6700462636d0b.draggingKeys = keys;
|
|
228
|
+
}
|
|
229
|
+
function $7252cd45fc48c07c$export$dac8db29d42db9a1(ref) {
|
|
230
|
+
$7252cd45fc48c07c$export$6ca6700462636d0b.dropCollectionRef = ref;
|
|
231
|
+
}
|
|
232
|
+
function $7252cd45fc48c07c$export$70936501603e6c57() {
|
|
233
|
+
$7252cd45fc48c07c$export$6ca6700462636d0b = {
|
|
234
|
+
draggingKeys: new Set()
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
function $7252cd45fc48c07c$export$6c10d32b362bfa5f(state) {
|
|
238
|
+
$7252cd45fc48c07c$export$6ca6700462636d0b = state;
|
|
239
|
+
}
|
|
240
|
+
function $7252cd45fc48c07c$export$78bf638634500fa5(ref) {
|
|
241
|
+
let { draggingCollectionRef: draggingCollectionRef, dropCollectionRef: dropCollectionRef } = $7252cd45fc48c07c$export$6ca6700462636d0b;
|
|
242
|
+
return (draggingCollectionRef === null || draggingCollectionRef === void 0 ? void 0 : draggingCollectionRef.current) != null && draggingCollectionRef.current === ((ref === null || ref === void 0 ? void 0 : ref.current) || (dropCollectionRef === null || dropCollectionRef === void 0 ? void 0 : dropCollectionRef.current));
|
|
243
|
+
}
|
|
244
|
+
let $7252cd45fc48c07c$export$8e6636520ac15722;
|
|
245
|
+
function $7252cd45fc48c07c$export$64f52ed7349ddb84(dropEffect) {
|
|
246
|
+
$7252cd45fc48c07c$export$8e6636520ac15722 = dropEffect;
|
|
247
|
+
}
|
|
248
|
+
let $7252cd45fc48c07c$export$f0130eb70b6347b8 = (0, $103790afe9474d1c$export$60b7b4bcf3903d8e).none;
|
|
249
|
+
function $7252cd45fc48c07c$export$6539bc8c3a0a2d67(o) {
|
|
250
|
+
$7252cd45fc48c07c$export$f0130eb70b6347b8 = o;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
export {$7252cd45fc48c07c$export$dfdf5deeaf27473f as droppableCollectionMap, $7252cd45fc48c07c$export$990fced5dfac2637 as DIRECTORY_DRAG_TYPE, $7252cd45fc48c07c$export$3093291712f09a77 as getDroppableCollectionId, $7252cd45fc48c07c$export$7e397efd01d3db27 as getDroppableCollectionRef, $7252cd45fc48c07c$export$e1d41611756c6326 as getTypes, $7252cd45fc48c07c$export$49bac5d6d4b352ea as useDragModality, $7252cd45fc48c07c$export$1fb2158d224b542c as getDragModality, $7252cd45fc48c07c$export$f9c1490890ddd063 as writeToDataTransfer, $7252cd45fc48c07c$export$7f04ce188c91447c as DragTypes, $7252cd45fc48c07c$export$d9e760437831f8b3 as readFromDataTransfer, $7252cd45fc48c07c$export$97fd558bdc44bea1 as isTextDropItem, $7252cd45fc48c07c$export$a144e1752ebe0aa as isFileDropItem, $7252cd45fc48c07c$export$2b40a62bdbe6b2b0 as isDirectoryDropItem, $7252cd45fc48c07c$export$6ca6700462636d0b as globalDndState, $7252cd45fc48c07c$export$f2be18a910c0caa6 as setDraggingCollectionRef, $7252cd45fc48c07c$export$72cb63bdda528276 as setDraggingKeys, $7252cd45fc48c07c$export$dac8db29d42db9a1 as setDropCollectionRef, $7252cd45fc48c07c$export$70936501603e6c57 as clearGlobalDnDState, $7252cd45fc48c07c$export$6c10d32b362bfa5f as setGlobalDnDState, $7252cd45fc48c07c$export$78bf638634500fa5 as isInternalDropOperation, $7252cd45fc48c07c$export$8e6636520ac15722 as globalDropEffect, $7252cd45fc48c07c$export$64f52ed7349ddb84 as setGlobalDropEffect, $7252cd45fc48c07c$export$f0130eb70b6347b8 as globalAllowedDropOperations, $7252cd45fc48c07c$export$6539bc8c3a0a2d67 as setGlobalAllowedDropOperations};
|
|
255
|
+
//# sourceMappingURL=utils.mjs.map
|