@react-aria/dnd 3.0.0-alpha.0 → 3.0.0-alpha.4

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/main.js CHANGED
@@ -1,2066 +1,1817 @@
1
- var {
2
- useMessageFormatter
3
- } = require("@react-aria/i18n");
4
-
5
- var _reactDom = $parcel$interopDefault(require("react-dom"));
6
-
7
- var {
8
- useId,
9
- useDescription,
10
- mergeProps,
11
- getScrollParent,
12
- isIOS,
13
- isWebKit,
14
- chain
15
- } = require("@react-aria/utils");
16
-
17
- var {
18
- getInteractionModality,
19
- useInteractionModality,
20
- useFocus
21
- } = require("@react-aria/interactions");
22
-
23
- var _babelRuntimeHelpersWrapAsyncGenerator = $parcel$interopDefault(require("@babel/runtime/helpers/wrapAsyncGenerator"));
24
-
25
- var _babelRuntimeHelpersAwaitAsyncGenerator = $parcel$interopDefault(require("@babel/runtime/helpers/awaitAsyncGenerator"));
26
-
27
- var {
28
- ariaHideOutside
29
- } = require("@react-aria/overlays");
30
-
31
- var {
32
- announce
33
- } = require("@react-aria/live-announcer");
34
-
35
- var {
36
- useRef,
37
- useState,
38
- useEffect,
39
- useLayoutEffect,
40
- useCallback
41
- } = require("react");
42
-
43
- var _babelRuntimeHelpersInteropRequireDefault = $parcel$interopDefault(require("@babel/runtime/helpers/interopRequireDefault"));
1
+ var $4on3C$react = require("react");
2
+ var $4on3C$reactdom = require("react-dom");
3
+ var $4on3C$reactariautils = require("@react-aria/utils");
4
+ var $4on3C$reactariai18n = require("@react-aria/i18n");
5
+ var $4on3C$reactarialiveannouncer = require("@react-aria/live-announcer");
6
+ var $4on3C$reactariaoverlays = require("@react-aria/overlays");
7
+ var $4on3C$reactariainteractions = require("@react-aria/interactions");
8
+
9
+ function $parcel$exportWildcard(dest, source) {
10
+ Object.keys(source).forEach(function(key) {
11
+ if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
12
+ return;
13
+ }
44
14
 
45
- var _babelRuntimeHelpersExtends = $parcel$interopDefault(require("@babel/runtime/helpers/extends"));
15
+ Object.defineProperty(dest, key, {
16
+ enumerable: true,
17
+ get: function get() {
18
+ return source[key];
19
+ }
20
+ });
21
+ });
46
22
 
23
+ return dest;
24
+ }
47
25
  function $parcel$interopDefault(a) {
48
26
  return a && a.__esModule ? a.default : a;
49
27
  }
50
-
51
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/dnd/src/constants.ts
52
- var $b29ea0269b2ea2bf4827b4fa19ddc83e$var$_temp;
53
-
54
- /*
55
- * Copyright 2020 Adobe. All rights reserved.
56
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
57
- * you may not use this file except in compliance with the License. You may obtain a copy
58
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
59
- *
60
- * Unless required by applicable law or agreed to in writing, software distributed under
61
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
62
- * OF ANY KIND, either express or implied. See the License for the specific language
63
- * governing permissions and limitations under the License.
64
- */
65
- let $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION; // See https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/effectAllowed
66
-
67
- (function (DROP_OPERATION) {
68
- DROP_OPERATION[DROP_OPERATION["none"] = 0] = "none";
69
- DROP_OPERATION[DROP_OPERATION["cancel"] = 0] = "cancel";
70
- DROP_OPERATION[DROP_OPERATION["move"] = 1] = "move";
71
- DROP_OPERATION[DROP_OPERATION["copy"] = 2] = "copy";
72
- DROP_OPERATION[DROP_OPERATION["link"] = 4] = "link";
73
- DROP_OPERATION[DROP_OPERATION["all"] = 7] = "all";
74
- })($b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION || ($b29ea0269b2ea2bf4827b4fa19ddc83e$var$_temp = $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION = {}, $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION, $b29ea0269b2ea2bf4827b4fa19ddc83e$var$_temp));
75
-
76
- const $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION_ALLOWED = _babelRuntimeHelpersExtends({}, $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION, {
77
- copyMove: $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.copy | $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.move,
78
- copyLink: $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.copy | $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.link,
79
- linkMove: $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.link | $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.move,
80
- all: $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.all,
81
- uninitialized: $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.all
82
- });
83
-
84
- const $b29ea0269b2ea2bf4827b4fa19ddc83e$export$EFFECT_ALLOWED = $b29ea0269b2ea2bf4827b4fa19ddc83e$var$invert($b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION_ALLOWED);
85
- const $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_EFFECT = $b29ea0269b2ea2bf4827b4fa19ddc83e$var$invert($b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION);
86
- const $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_EFFECT_TO_DROP_OPERATION = {
87
- none: 'cancel',
88
- link: 'link',
89
- copy: 'copy',
90
- move: 'move'
28
+ function $parcel$export(e, n, v, s) {
29
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
30
+ }
31
+ var $d067e40b40cb0a24$exports = {};
32
+
33
+ $parcel$export($d067e40b40cb0a24$exports, "useDrag", () => $d067e40b40cb0a24$export$7941f8aafa4b6021);
34
+
35
+
36
+
37
+ let $8e4046ff5ec007bd$export$60b7b4bcf3903d8e;
38
+ (function($8e4046ff5ec007bd$export$60b7b4bcf3903d8e) {
39
+ $8e4046ff5ec007bd$export$60b7b4bcf3903d8e[$8e4046ff5ec007bd$export$60b7b4bcf3903d8e["none"] = 0] = "none";
40
+ $8e4046ff5ec007bd$export$60b7b4bcf3903d8e[$8e4046ff5ec007bd$export$60b7b4bcf3903d8e["cancel"] = 0] = "cancel";
41
+ $8e4046ff5ec007bd$export$60b7b4bcf3903d8e[$8e4046ff5ec007bd$export$60b7b4bcf3903d8e["move"] = 1] = "move";
42
+ $8e4046ff5ec007bd$export$60b7b4bcf3903d8e[$8e4046ff5ec007bd$export$60b7b4bcf3903d8e["copy"] = 2] = "copy";
43
+ $8e4046ff5ec007bd$export$60b7b4bcf3903d8e[$8e4046ff5ec007bd$export$60b7b4bcf3903d8e["link"] = 4] = "link";
44
+ $8e4046ff5ec007bd$export$60b7b4bcf3903d8e[$8e4046ff5ec007bd$export$60b7b4bcf3903d8e["all"] = 7] = "all";
45
+ })($8e4046ff5ec007bd$export$60b7b4bcf3903d8e || ($8e4046ff5ec007bd$export$60b7b4bcf3903d8e = {
46
+ }));
47
+ const $8e4046ff5ec007bd$export$9bbdfc78cf083e16 = {
48
+ ...$8e4046ff5ec007bd$export$60b7b4bcf3903d8e,
49
+ copyMove: $8e4046ff5ec007bd$export$60b7b4bcf3903d8e.copy | $8e4046ff5ec007bd$export$60b7b4bcf3903d8e.move,
50
+ copyLink: $8e4046ff5ec007bd$export$60b7b4bcf3903d8e.copy | $8e4046ff5ec007bd$export$60b7b4bcf3903d8e.link,
51
+ linkMove: $8e4046ff5ec007bd$export$60b7b4bcf3903d8e.link | $8e4046ff5ec007bd$export$60b7b4bcf3903d8e.move,
52
+ all: $8e4046ff5ec007bd$export$60b7b4bcf3903d8e.all,
53
+ uninitialized: $8e4046ff5ec007bd$export$60b7b4bcf3903d8e.all
91
54
  };
92
- const $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION_TO_DROP_EFFECT = $b29ea0269b2ea2bf4827b4fa19ddc83e$var$invert($b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_EFFECT_TO_DROP_OPERATION);
93
-
94
- function $b29ea0269b2ea2bf4827b4fa19ddc83e$var$invert(object) {
95
- let res = {};
96
-
97
- for (let key in object) {
98
- res[object[key]] = key;
99
- }
100
-
101
- return res;
55
+ const $8e4046ff5ec007bd$export$dd0165308d8bff45 = $8e4046ff5ec007bd$var$invert($8e4046ff5ec007bd$export$9bbdfc78cf083e16);
56
+ const $8e4046ff5ec007bd$export$d7ebf00f36b7a95e = $8e4046ff5ec007bd$var$invert($8e4046ff5ec007bd$export$60b7b4bcf3903d8e);
57
+ const $8e4046ff5ec007bd$export$608ecc6f1b23c35d = {
58
+ none: 'cancel',
59
+ link: 'link',
60
+ copy: 'copy',
61
+ move: 'move'
62
+ };
63
+ const $8e4046ff5ec007bd$export$5eacb0769d26d3b2 = $8e4046ff5ec007bd$var$invert($8e4046ff5ec007bd$export$608ecc6f1b23c35d);
64
+ function $8e4046ff5ec007bd$var$invert(object) {
65
+ let res = {
66
+ };
67
+ for(let key in object)res[object[key]] = key;
68
+ return res;
102
69
  }
70
+ const $8e4046ff5ec007bd$export$4a7729b856e9a690 = new Set([
71
+ 'text/plain',
72
+ 'text/uri-list',
73
+ 'text/html'
74
+ ]);
75
+ const $8e4046ff5ec007bd$export$fd9f9fc120c5402d = 'application/vnd.react-aria.items+json';
76
+ const $8e4046ff5ec007bd$export$f8fc6581787339b3 = 'application/octet-stream';
103
77
 
104
- const $b29ea0269b2ea2bf4827b4fa19ddc83e$export$NATIVE_DRAG_TYPES = new Set(['text/plain', 'text/uri-list', 'text/html']);
105
- const $b29ea0269b2ea2bf4827b4fa19ddc83e$export$CUSTOM_DRAG_TYPE = 'application/vnd.react-aria.items+json';
106
- const $b29ea0269b2ea2bf4827b4fa19ddc83e$export$GENERIC_TYPE = 'application/octet-stream';
107
- const $bc29619458500c186021634c18dc$var$droppableCollectionIds = new WeakMap();
108
78
 
109
- function $bc29619458500c186021634c18dc$export$useDroppableCollectionId(state) {
110
- let id = useId();
111
- $bc29619458500c186021634c18dc$var$droppableCollectionIds.set(state, id);
112
- return id;
113
- }
114
79
 
115
- function $bc29619458500c186021634c18dc$export$getDroppableCollectionId(state) {
116
- let id = $bc29619458500c186021634c18dc$var$droppableCollectionIds.get(state);
117
80
 
118
- if (!id) {
119
- throw new Error('Droppable item outside a droppable collection');
120
- }
121
-
122
- return id;
81
+ const $c1cba3854dc3a167$var$droppableCollectionIds = new WeakMap();
82
+ function $c1cba3854dc3a167$export$b1601eb39394a581(state) {
83
+ let id = $4on3C$reactariautils.useId();
84
+ $c1cba3854dc3a167$var$droppableCollectionIds.set(state, id);
85
+ return id;
123
86
  }
124
-
125
- function $bc29619458500c186021634c18dc$export$getTypes(items) {
126
- let types = new Set();
127
-
128
- for (let item of items) {
129
- for (let type of Object.keys(item)) {
130
- types.add(type);
131
- }
132
- }
133
-
134
- return types;
87
+ function $c1cba3854dc3a167$export$3093291712f09a77(state) {
88
+ let id = $c1cba3854dc3a167$var$droppableCollectionIds.get(state);
89
+ if (!id) throw new Error('Droppable item outside a droppable collection');
90
+ return id;
135
91
  }
136
-
137
- function $bc29619458500c186021634c18dc$var$mapModality(modality) {
138
- if (!modality) {
139
- modality = 'virtual';
140
- }
141
-
142
- if (modality === 'pointer') {
143
- modality = 'virtual';
144
- }
145
-
146
- if (modality === 'virtual' && 'ontouchstart' in window) {
147
- modality = 'touch';
148
- }
149
-
150
- return modality;
92
+ function $c1cba3854dc3a167$export$e1d41611756c6326(items) {
93
+ let types = new Set();
94
+ for (let item of items)for (let type of Object.keys(item))types.add(type);
95
+ return types;
151
96
  }
152
-
153
- function $bc29619458500c186021634c18dc$export$useDragModality() {
154
- return $bc29619458500c186021634c18dc$var$mapModality(useInteractionModality());
97
+ function $c1cba3854dc3a167$var$mapModality(modality) {
98
+ if (!modality) modality = 'virtual';
99
+ if (modality === 'pointer') modality = 'virtual';
100
+ if (modality === 'virtual' && 'ontouchstart' in window) modality = 'touch';
101
+ return modality;
155
102
  }
156
-
157
- function $bc29619458500c186021634c18dc$export$getDragModality() {
158
- return $bc29619458500c186021634c18dc$var$mapModality(getInteractionModality());
103
+ function $c1cba3854dc3a167$export$49bac5d6d4b352ea() {
104
+ return $c1cba3854dc3a167$var$mapModality($4on3C$reactariainteractions.useInteractionModality());
159
105
  }
160
-
161
- function $bc29619458500c186021634c18dc$export$writeToDataTransfer(dataTransfer, items) {
162
- // The data transfer API doesn't support more than one item of a given type at once.
163
- // In addition, only a small set of types are supported natively for transfer between applications.
164
- // We allow for both multiple items, as well as multiple representations of a single item.
165
- // In order to make our API work with the native API, we serialize all items to JSON and
166
- // store as a single native item. We only need to do this if there is more than one item
167
- // of the same type, or if an item has more than one representation. Otherwise the native
168
- // API is sufficient.
169
- //
170
- // The DataTransferItemList API also theoretically supports adding files, which would enable
171
- // dragging binary data out of the browser onto the user's desktop for example. Unfortunately,
172
- // this does not currently work in any browser, so it is not currently supported by our API.
173
- // See e.g. https://bugs.chromium.org/p/chromium/issues/detail?id=438479.
174
- let groupedByType = new Map();
175
- let needsCustomData = false;
176
- let customData = [];
177
-
178
- for (let item of items) {
179
- let types = Object.keys(item);
180
-
181
- if (types.length > 1) {
182
- needsCustomData = true;
183
- }
184
-
185
- let dataByType = {};
186
-
187
- for (let type of types) {
188
- let typeItems = groupedByType.get(type);
189
-
190
- if (!typeItems) {
191
- typeItems = [];
192
- groupedByType.set(type, typeItems);
193
- } else {
194
- needsCustomData = true;
195
- }
196
-
197
- let data = item[type];
198
- dataByType[type] = data;
199
- typeItems.push(data);
200
- }
201
-
202
- customData.push(dataByType);
203
- }
204
-
205
- for (let [type, items] of groupedByType) {
206
- if ($b29ea0269b2ea2bf4827b4fa19ddc83e$export$NATIVE_DRAG_TYPES.has(type)) {
207
- // Only one item of a given type can be set on a data transfer.
208
- // Join all of the items together separated by newlines.
209
- let data = items.join('\n');
210
- dataTransfer.items.add(data, type);
211
- } else {
212
- // Set data to the first item so we have access to the list of types.
213
- dataTransfer.items.add(items[0], type);
214
- }
215
- }
216
-
217
- if (needsCustomData) {
218
- let data = JSON.stringify(customData);
219
- dataTransfer.items.add(data, $b29ea0269b2ea2bf4827b4fa19ddc83e$export$CUSTOM_DRAG_TYPE);
220
- }
106
+ function $c1cba3854dc3a167$export$1fb2158d224b542c() {
107
+ return $c1cba3854dc3a167$var$mapModality($4on3C$reactariainteractions.getInteractionModality());
221
108
  }
222
-
223
- class $bc29619458500c186021634c18dc$export$DragTypes {
224
- constructor(dataTransfer) {
225
- this.types = void 0;
226
- this.includesUnknownTypes = void 0;
227
- this.types = new Set();
228
- let hasFiles = false;
229
-
230
- for (let item of dataTransfer.items) {
231
- if (item.type !== $b29ea0269b2ea2bf4827b4fa19ddc83e$export$CUSTOM_DRAG_TYPE) {
232
- if (item.kind === 'file') {
233
- hasFiles = true;
109
+ function $c1cba3854dc3a167$export$f9c1490890ddd063(dataTransfer, items) {
110
+ // The data transfer API doesn't support more than one item of a given type at once.
111
+ // In addition, only a small set of types are supported natively for transfer between applications.
112
+ // We allow for both multiple items, as well as multiple representations of a single item.
113
+ // In order to make our API work with the native API, we serialize all items to JSON and
114
+ // store as a single native item. We only need to do this if there is more than one item
115
+ // of the same type, or if an item has more than one representation. Otherwise the native
116
+ // API is sufficient.
117
+ //
118
+ // The DataTransferItemList API also theoretically supports adding files, which would enable
119
+ // dragging binary data out of the browser onto the user's desktop for example. Unfortunately,
120
+ // this does not currently work in any browser, so it is not currently supported by our API.
121
+ // See e.g. https://bugs.chromium.org/p/chromium/issues/detail?id=438479.
122
+ let groupedByType = new Map();
123
+ let needsCustomData = false;
124
+ let customData = [];
125
+ for (let item of items){
126
+ let types = Object.keys(item);
127
+ if (types.length > 1) needsCustomData = true;
128
+ let dataByType = {
129
+ };
130
+ for (let type of types){
131
+ let typeItems = groupedByType.get(type);
132
+ if (!typeItems) {
133
+ typeItems = [];
134
+ groupedByType.set(type, typeItems);
135
+ } else needsCustomData = true;
136
+ let data = item[type];
137
+ dataByType[type] = data;
138
+ typeItems.push(data);
234
139
  }
235
-
236
- if (item.type) {
237
- this.types.add(item.type);
238
- } else {
239
- // Files with unknown types or extensions that don't map to a known mime type
240
- // are sometimes exposed as an empty string by the browser. Map to a generic
241
- // mime type instead. Note that this could also be a directory as there's no
242
- // way to determine if something is a file or directory until drop.
243
- this.types.add($b29ea0269b2ea2bf4827b4fa19ddc83e$export$GENERIC_TYPE);
140
+ customData.push(dataByType);
141
+ }
142
+ for (let [type, items1] of groupedByType)if ($8e4046ff5ec007bd$export$4a7729b856e9a690.has(type)) {
143
+ // Only one item of a given type can be set on a data transfer.
144
+ // Join all of the items together separated by newlines.
145
+ let data = items1.join('\n');
146
+ dataTransfer.items.add(data, type);
147
+ } else // Set data to the first item so we have access to the list of types.
148
+ dataTransfer.items.add(items1[0], type);
149
+ if (needsCustomData) {
150
+ let data = JSON.stringify(customData);
151
+ dataTransfer.items.add(data, $8e4046ff5ec007bd$export$fd9f9fc120c5402d);
152
+ }
153
+ }
154
+ class $c1cba3854dc3a167$export$7f04ce188c91447c {
155
+ constructor(dataTransfer){
156
+ this.types = new Set();
157
+ let hasFiles = false;
158
+ for (let item of dataTransfer.items)if (item.type !== $8e4046ff5ec007bd$export$fd9f9fc120c5402d) {
159
+ if (item.kind === 'file') hasFiles = true;
160
+ if (item.type) this.types.add(item.type);
161
+ else // Files with unknown types or extensions that don't map to a known mime type
162
+ // are sometimes exposed as an empty string by the browser. Map to a generic
163
+ // mime type instead. Note that this could also be a directory as there's no
164
+ // way to determine if something is a file or directory until drop.
165
+ this.types.add($8e4046ff5ec007bd$export$f8fc6581787339b3);
244
166
  }
245
- }
246
- } // In Safari, when dragging files, the dataTransfer.items list is empty, but dataTransfer.types contains "Files".
247
- // Unfortunately, this doesn't tell us what types of files the user is dragging, so we need to assume that any
248
- // type the user checks for is included.
249
-
250
-
251
- this.includesUnknownTypes = !hasFiles && dataTransfer.types.includes('Files');
252
- }
253
-
254
- has(type) {
255
- if (this.includesUnknownTypes) {
256
- return true;
167
+ // In Safari, when dragging files, the dataTransfer.items list is empty, but dataTransfer.types contains "Files".
168
+ // Unfortunately, this doesn't tell us what types of files the user is dragging, so we need to assume that any
169
+ // type the user checks for is included. See https://bugs.webkit.org/show_bug.cgi?id=223517.
170
+ this.includesUnknownTypes = !hasFiles && dataTransfer.types.includes('Files');
171
+ }
172
+ has(type) {
173
+ if (this.includesUnknownTypes) return true;
174
+ return this.types.has(type);
257
175
  }
258
-
259
- return this.types.has(type);
260
- }
261
-
262
176
  }
263
-
264
- function $bc29619458500c186021634c18dc$export$readFromDataTransfer(dataTransfer) {
265
- let items = []; // If our custom drag type is available, use that. This is a JSON serialized
266
- // representation of all items in the drag, set when there are multiple items
267
- // of the same type, or an individual item has multiple representations.
268
-
269
- let hasCustomType = false;
270
-
271
- if (dataTransfer.types.includes($b29ea0269b2ea2bf4827b4fa19ddc83e$export$CUSTOM_DRAG_TYPE)) {
272
- try {
273
- let data = dataTransfer.getData($b29ea0269b2ea2bf4827b4fa19ddc83e$export$CUSTOM_DRAG_TYPE);
274
- let parsed = JSON.parse(data);
275
-
276
- for (let item of parsed) {
277
- items.push({
278
- kind: 'text',
279
- types: new Set(Object.keys(item)),
280
- getText: type => Promise.resolve(item[type])
177
+ function $c1cba3854dc3a167$export$d9e760437831f8b3(dataTransfer) {
178
+ let items = [];
179
+ // If our custom drag type is available, use that. This is a JSON serialized
180
+ // representation of all items in the drag, set when there are multiple items
181
+ // of the same type, or an individual item has multiple representations.
182
+ let hasCustomType = false;
183
+ if (dataTransfer.types.includes($8e4046ff5ec007bd$export$fd9f9fc120c5402d)) try {
184
+ let data = dataTransfer.getData($8e4046ff5ec007bd$export$fd9f9fc120c5402d);
185
+ let parsed = JSON.parse(data);
186
+ for (let item of parsed)items.push({
187
+ kind: 'text',
188
+ types: new Set(Object.keys(item)),
189
+ getText: (type)=>Promise.resolve(item[type])
281
190
  });
282
- }
283
-
284
- hasCustomType = true;
285
- } catch (e) {// ignore
286
- }
287
- } // Otherwise, map native drag items to items of a single representation.
288
-
289
-
290
- if (!hasCustomType) {
291
- let stringItems = new Map();
292
-
293
- for (let item of dataTransfer.items) {
294
- if (item.kind === 'string') {
295
- // The data for all formats must be read here because the data transfer gets
296
- // cleared out after the event handler finishes. If the item has an empty string
297
- // as a type, the mime type is unknown. Map to a generic mime type instead.
298
- stringItems.set(item.type || $b29ea0269b2ea2bf4827b4fa19ddc83e$export$GENERIC_TYPE, dataTransfer.getData(item.type));
299
- } else if (item.kind === 'file') {
300
- // Despite the name, webkitGetAsEntry is also implemented in Firefox and Edge.
301
- // In the future, we may use getAsFileSystemHandle instead, but that's currently
302
- // only implemented in Chrome.
303
- if (typeof item.webkitGetAsEntry === 'function') {
304
- let entry = item.webkitGetAsEntry();
305
-
306
- if (!entry) {
307
- // For some reason, Chrome and Firefox include an item with type image/png when copy
308
- // and pasting any file or directory (no matter the type), but return `null` for both
309
- // item.getAsFile() and item.webkitGetAsEntry(). Safari works as expected. Ignore this
310
- // item if this happens.
311
- continue;
312
- }
313
-
314
- if (entry.isFile) {
315
- items.push($bc29619458500c186021634c18dc$var$createFileItem(item.getAsFile()));
316
- } else if (entry.isDirectory) {
317
- items.push($bc29619458500c186021634c18dc$var$createDirectoryItem(entry));
318
- }
319
- } else {
320
- // Assume it's a file.
321
- items.push($bc29619458500c186021634c18dc$var$createFileItem(item.getAsFile()));
191
+ hasCustomType = true;
192
+ } catch (e) {
193
+ // ignore
194
+ }
195
+ // Otherwise, map native drag items to items of a single representation.
196
+ if (!hasCustomType) {
197
+ let stringItems = new Map();
198
+ for (let item of dataTransfer.items){
199
+ if (item.kind === 'string') // The data for all formats must be read here because the data transfer gets
200
+ // cleared out after the event handler finishes. If the item has an empty string
201
+ // as a type, the mime type is unknown. Map to a generic mime type instead.
202
+ stringItems.set(item.type || $8e4046ff5ec007bd$export$f8fc6581787339b3, dataTransfer.getData(item.type));
203
+ else if (item.kind === 'file') {
204
+ // Despite the name, webkitGetAsEntry is also implemented in Firefox and Edge.
205
+ // In the future, we may use getAsFileSystemHandle instead, but that's currently
206
+ // only implemented in Chrome.
207
+ if (typeof item.webkitGetAsEntry === 'function') {
208
+ let entry = item.webkitGetAsEntry();
209
+ if (!entry) continue;
210
+ if (entry.isFile) items.push($c1cba3854dc3a167$var$createFileItem(item.getAsFile()));
211
+ else if (entry.isDirectory) items.push($c1cba3854dc3a167$var$createDirectoryItem(entry));
212
+ } else // Assume it's a file.
213
+ items.push($c1cba3854dc3a167$var$createFileItem(item.getAsFile()));
214
+ }
322
215
  }
323
- }
324
- } // All string items are different representations of the same item. There's no way to have
325
- // multiple string items at once in the current DataTransfer API.
326
-
327
-
328
- if (stringItems.size > 0) {
329
- items.push({
330
- kind: 'text',
331
- types: new Set(stringItems.keys()),
332
- getText: type => Promise.resolve(stringItems.get(type))
333
- });
216
+ // All string items are different representations of the same item. There's no way to have
217
+ // multiple string items at once in the current DataTransfer API.
218
+ if (stringItems.size > 0) items.push({
219
+ kind: 'text',
220
+ types: new Set(stringItems.keys()),
221
+ getText: (type)=>Promise.resolve(stringItems.get(type))
222
+ });
334
223
  }
335
- }
336
-
337
- return items;
338
- }
339
-
340
- function $bc29619458500c186021634c18dc$var$blobToString(blob) {
341
- if (typeof blob.text === 'function') {
342
- return blob.text();
343
- } // Safari doesn't have the Blob#text() method yet...
344
-
345
-
346
- return new Promise((resolve, reject) => {
347
- let reader = new FileReader();
348
-
349
- reader.onload = () => {
350
- resolve(reader.result);
351
- };
352
-
353
- reader.onerror = reject;
354
- reader.readAsText(blob);
355
- });
224
+ return items;
356
225
  }
357
-
358
- function $bc29619458500c186021634c18dc$var$createFileItem(file) {
359
- return {
360
- kind: 'file',
361
- type: file.type || $b29ea0269b2ea2bf4827b4fa19ddc83e$export$GENERIC_TYPE,
362
- name: file.name,
363
- getText: () => $bc29619458500c186021634c18dc$var$blobToString(file),
364
- getFile: () => Promise.resolve(file)
365
- };
226
+ function $c1cba3854dc3a167$var$blobToString(blob) {
227
+ if (typeof blob.text === 'function') return blob.text();
228
+ // Safari doesn't have the Blob#text() method yet...
229
+ return new Promise((resolve, reject)=>{
230
+ let reader = new FileReader;
231
+ reader.onload = ()=>{
232
+ resolve(reader.result);
233
+ };
234
+ reader.onerror = reject;
235
+ reader.readAsText(blob);
236
+ });
366
237
  }
367
-
368
- function $bc29619458500c186021634c18dc$var$createDirectoryItem(entry) {
369
- return {
370
- kind: 'directory',
371
- name: entry.name,
372
- getEntries: () => $bc29619458500c186021634c18dc$var$_getEntries2(entry)
373
- };
238
+ function $c1cba3854dc3a167$var$createFileItem(file) {
239
+ return {
240
+ kind: 'file',
241
+ type: file.type || $8e4046ff5ec007bd$export$f8fc6581787339b3,
242
+ name: file.name,
243
+ getText: ()=>$c1cba3854dc3a167$var$blobToString(file)
244
+ ,
245
+ getFile: ()=>Promise.resolve(file)
246
+ };
374
247
  }
375
-
376
- function $bc29619458500c186021634c18dc$var$_getEntries2(_x) {
377
- return $bc29619458500c186021634c18dc$var$_getEntries.apply(this, arguments);
248
+ function $c1cba3854dc3a167$var$createDirectoryItem(entry) {
249
+ return {
250
+ kind: 'directory',
251
+ name: entry.name,
252
+ getEntries: ()=>$c1cba3854dc3a167$var$getEntries(entry)
253
+ };
378
254
  }
379
-
380
- function $bc29619458500c186021634c18dc$var$_getEntries() {
381
- $bc29619458500c186021634c18dc$var$_getEntries = _babelRuntimeHelpersWrapAsyncGenerator(function* (item) {
382
- let reader = item.createReader(); // We must call readEntries repeatedly because there may be a limit to the
255
+ async function* $c1cba3854dc3a167$var$getEntries(item) {
256
+ let reader = item.createReader();
257
+ // We must call readEntries repeatedly because there may be a limit to the
383
258
  // number of entries that are returned at once.
384
-
385
259
  let entries;
386
-
387
260
  do {
388
- entries = yield _babelRuntimeHelpersAwaitAsyncGenerator(new Promise((resolve, reject) => {
389
- reader.readEntries(resolve, reject);
390
- }));
391
-
392
- for (let entry of entries) {
393
- if (entry.isFile) {
394
- let file = yield _babelRuntimeHelpersAwaitAsyncGenerator($bc29619458500c186021634c18dc$var$getEntryFile(entry));
395
- yield $bc29619458500c186021634c18dc$var$createFileItem(file);
396
- } else if (entry.isDirectory) {
397
- yield $bc29619458500c186021634c18dc$var$createDirectoryItem(entry);
261
+ entries = await new Promise((resolve, reject)=>{
262
+ reader.readEntries(resolve, reject);
263
+ });
264
+ for (let entry of entries){
265
+ if (entry.isFile) {
266
+ let file = await $c1cba3854dc3a167$var$getEntryFile(entry);
267
+ yield $c1cba3854dc3a167$var$createFileItem(file);
268
+ } else if (entry.isDirectory) yield $c1cba3854dc3a167$var$createDirectoryItem(entry);
398
269
  }
399
- }
400
- } while (entries.length > 0);
401
- });
402
- return $bc29619458500c186021634c18dc$var$_getEntries.apply(this, arguments);
270
+ }while (entries.length > 0)
403
271
  }
404
-
405
- function $bc29619458500c186021634c18dc$var$getEntryFile(entry) {
406
- return new Promise((resolve, reject) => entry.file(resolve, reject));
272
+ function $c1cba3854dc3a167$var$getEntryFile(entry) {
273
+ return new Promise((resolve, reject)=>entry.file(resolve, reject)
274
+ );
407
275
  }
408
276
 
409
- let $a75d092e5c30878812fba78e$var$dropTargets = new Map();
410
- let $a75d092e5c30878812fba78e$var$dropItems = new Map();
411
- let $a75d092e5c30878812fba78e$var$dragSession = null;
412
- let $a75d092e5c30878812fba78e$var$subscriptions = new Set();
413
-
414
- function $a75d092e5c30878812fba78e$export$registerDropTarget(target) {
415
- var _dragSession;
416
277
 
417
- $a75d092e5c30878812fba78e$var$dropTargets.set(target.element, target);
418
- (_dragSession = $a75d092e5c30878812fba78e$var$dragSession) == null ? void 0 : _dragSession.updateValidDropTargets();
419
- return () => {
420
- var _dragSession2;
421
278
 
422
- $a75d092e5c30878812fba78e$var$dropTargets.delete(target.element);
423
- (_dragSession2 = $a75d092e5c30878812fba78e$var$dragSession) == null ? void 0 : _dragSession2.updateValidDropTargets();
424
- };
279
+ let $d69e2bc1de15721f$var$dropTargets = new Map();
280
+ let $d69e2bc1de15721f$var$dropItems = new Map();
281
+ let $d69e2bc1de15721f$var$dragSession = null;
282
+ let $d69e2bc1de15721f$var$subscriptions = new Set();
283
+ function $d69e2bc1de15721f$export$c28d9fb4a54e471a(target) {
284
+ $d69e2bc1de15721f$var$dropTargets.set(target.element, target);
285
+ $d69e2bc1de15721f$var$dragSession?.updateValidDropTargets();
286
+ return ()=>{
287
+ $d69e2bc1de15721f$var$dropTargets.delete(target.element);
288
+ $d69e2bc1de15721f$var$dragSession?.updateValidDropTargets();
289
+ };
425
290
  }
426
-
427
- function $a75d092e5c30878812fba78e$export$registerDropItem(item) {
428
- $a75d092e5c30878812fba78e$var$dropItems.set(item.element, item);
429
- return () => {
430
- $a75d092e5c30878812fba78e$var$dropItems.delete(item.element);
431
- };
291
+ function $d69e2bc1de15721f$export$aef80212ac99c003(item) {
292
+ $d69e2bc1de15721f$var$dropItems.set(item.element, item);
293
+ return ()=>{
294
+ $d69e2bc1de15721f$var$dropItems.delete(item.element);
295
+ };
432
296
  }
433
-
434
- function $a75d092e5c30878812fba78e$export$beginDragging(target, formatMessage) {
435
- if ($a75d092e5c30878812fba78e$var$dragSession) {
436
- throw new Error('Cannot begin dragging while already dragging');
437
- }
438
-
439
- $a75d092e5c30878812fba78e$var$dragSession = new $a75d092e5c30878812fba78e$var$DragSession(target, formatMessage);
440
- requestAnimationFrame(() => {
441
- $a75d092e5c30878812fba78e$var$dragSession.setup();
442
-
443
- if ($bc29619458500c186021634c18dc$export$getDragModality() === 'keyboard') {
444
- $a75d092e5c30878812fba78e$var$dragSession.next();
445
- }
446
- });
447
-
448
- for (let cb of $a75d092e5c30878812fba78e$var$subscriptions) {
449
- cb();
450
- }
297
+ function $d69e2bc1de15721f$export$549dbcf8649bf3b2(target, formatMessage) {
298
+ if ($d69e2bc1de15721f$var$dragSession) throw new Error('Cannot begin dragging while already dragging');
299
+ $d69e2bc1de15721f$var$dragSession = new $d69e2bc1de15721f$var$DragSession(target, formatMessage);
300
+ requestAnimationFrame(()=>{
301
+ $d69e2bc1de15721f$var$dragSession.setup();
302
+ if ($c1cba3854dc3a167$export$1fb2158d224b542c() === 'keyboard') $d69e2bc1de15721f$var$dragSession.next();
303
+ });
304
+ for (let cb of $d69e2bc1de15721f$var$subscriptions)cb();
451
305
  }
452
-
453
- function $a75d092e5c30878812fba78e$export$useDragSession() {
454
- let [session, setSession] = useState($a75d092e5c30878812fba78e$var$dragSession);
455
- useEffect(() => {
456
- let cb = () => setSession($a75d092e5c30878812fba78e$var$dragSession);
457
-
458
- $a75d092e5c30878812fba78e$var$subscriptions.add(cb);
459
- return () => {
460
- $a75d092e5c30878812fba78e$var$subscriptions.delete(cb);
461
- };
462
- }, []);
463
- return session;
306
+ function $d69e2bc1de15721f$export$418e185dd3f1b968() {
307
+ let [session, setSession] = $4on3C$react.useState($d69e2bc1de15721f$var$dragSession);
308
+ $4on3C$react.useEffect(()=>{
309
+ let cb = ()=>setSession($d69e2bc1de15721f$var$dragSession)
310
+ ;
311
+ $d69e2bc1de15721f$var$subscriptions.add(cb);
312
+ return ()=>{
313
+ $d69e2bc1de15721f$var$subscriptions.delete(cb);
314
+ };
315
+ }, []);
316
+ return session;
464
317
  }
465
-
466
- function $a75d092e5c30878812fba78e$var$endDragging() {
467
- $a75d092e5c30878812fba78e$var$dragSession = null;
468
-
469
- for (let cb of $a75d092e5c30878812fba78e$var$subscriptions) {
470
- cb();
471
- }
318
+ function $d69e2bc1de15721f$var$endDragging() {
319
+ $d69e2bc1de15721f$var$dragSession = null;
320
+ for (let cb of $d69e2bc1de15721f$var$subscriptions)cb();
472
321
  }
473
-
474
- const $a75d092e5c30878812fba78e$var$CANCELED_EVENTS = ['pointerdown', 'pointermove', 'pointerenter', 'pointerleave', 'pointerover', 'pointerout', 'pointerup', 'mousedown', 'mousemove', 'mouseenter', 'mouseleave', 'mouseover', 'mouseout', 'mouseup', 'touchstart', 'touchmove', 'touchend', 'keyup'];
475
- const $a75d092e5c30878812fba78e$var$CLICK_EVENTS = ['pointerup', 'mouseup', 'touchend'];
476
- const $a75d092e5c30878812fba78e$var$MESSAGES = {
477
- keyboard: 'dragStartedKeyboard',
478
- touch: 'dragStartedTouch',
479
- virtual: 'dragStartedVirtual'
322
+ const $d69e2bc1de15721f$var$CANCELED_EVENTS = [
323
+ 'pointerdown',
324
+ 'pointermove',
325
+ 'pointerenter',
326
+ 'pointerleave',
327
+ 'pointerover',
328
+ 'pointerout',
329
+ 'pointerup',
330
+ 'mousedown',
331
+ 'mousemove',
332
+ 'mouseenter',
333
+ 'mouseleave',
334
+ 'mouseover',
335
+ 'mouseout',
336
+ 'mouseup',
337
+ 'touchstart',
338
+ 'touchmove',
339
+ 'touchend',
340
+ 'keyup',
341
+ 'focusin',
342
+ 'focusout'
343
+ ];
344
+ const $d69e2bc1de15721f$var$CLICK_EVENTS = [
345
+ 'pointerup',
346
+ 'mouseup',
347
+ 'touchend'
348
+ ];
349
+ const $d69e2bc1de15721f$var$MESSAGES = {
350
+ keyboard: 'dragStartedKeyboard',
351
+ touch: 'dragStartedTouch',
352
+ virtual: 'dragStartedVirtual'
480
353
  };
481
-
482
- class $a75d092e5c30878812fba78e$var$DragSession {
483
- constructor(target, formatMessage) {
484
- this.dragTarget = void 0;
485
- this.validDropTargets = void 0;
486
- this.currentDropTarget = void 0;
487
- this.currentDropItem = void 0;
488
- this.dropOperation = void 0;
489
- this.mutationObserver = void 0;
490
- this.mutationImmediate = void 0;
491
- this.restoreAriaHidden = void 0;
492
- this.formatMessage = void 0;
493
- this.dragTarget = target;
494
- this.formatMessage = formatMessage;
495
- this.onKeyDown = this.onKeyDown.bind(this);
496
- this.onFocus = this.onFocus.bind(this);
497
- this.onBlur = this.onBlur.bind(this);
498
- this.onClick = this.onClick.bind(this);
499
- this.cancelEvent = this.cancelEvent.bind(this);
500
- }
501
-
502
- setup() {
503
- document.addEventListener('keydown', this.onKeyDown, true);
504
- window.addEventListener('focus', this.onFocus, true);
505
- window.addEventListener('blur', this.onBlur, true);
506
- document.addEventListener('click', this.onClick, true);
507
-
508
- for (let event of $a75d092e5c30878812fba78e$var$CANCELED_EVENTS) {
509
- document.addEventListener(event, this.cancelEvent, true);
510
- }
511
-
512
- this.mutationObserver = new MutationObserver(() => {
513
- // JSDOM has a bug where MutationObserver enters an infinite loop if mutations
514
- // occur inside a MutationObserver callback. If running in Node, wait until
515
- // the next tick to update valid drop targets.
516
- // See https://github.com/jsdom/jsdom/issues/3096
517
- if (typeof setImmediate === 'function') {
518
- this.mutationImmediate = setImmediate(() => this.updateValidDropTargets());
519
- } else {
354
+ class $d69e2bc1de15721f$var$DragSession {
355
+ constructor(target, formatMessage){
356
+ this.dragTarget = target;
357
+ this.formatMessage = formatMessage;
358
+ this.onKeyDown = this.onKeyDown.bind(this);
359
+ this.onFocus = this.onFocus.bind(this);
360
+ this.onBlur = this.onBlur.bind(this);
361
+ this.onClick = this.onClick.bind(this);
362
+ this.cancelEvent = this.cancelEvent.bind(this);
363
+ }
364
+ setup() {
365
+ document.addEventListener('keydown', this.onKeyDown, true);
366
+ window.addEventListener('focus', this.onFocus, true);
367
+ window.addEventListener('blur', this.onBlur, true);
368
+ document.addEventListener('click', this.onClick, true);
369
+ for (let event of $d69e2bc1de15721f$var$CANCELED_EVENTS)document.addEventListener(event, this.cancelEvent, true);
370
+ this.mutationObserver = new MutationObserver(()=>this.updateValidDropTargets()
371
+ );
520
372
  this.updateValidDropTargets();
521
- }
522
- });
523
- this.updateValidDropTargets();
524
- announce(this.formatMessage($a75d092e5c30878812fba78e$var$MESSAGES[$bc29619458500c186021634c18dc$export$getDragModality()]));
525
- }
526
-
527
- teardown() {
528
- document.removeEventListener('keydown', this.onKeyDown, true);
529
- window.removeEventListener('focus', this.onFocus, true);
530
- window.removeEventListener('blur', this.onBlur, true);
531
- document.removeEventListener('click', this.onClick, true);
532
-
533
- for (let event of $a75d092e5c30878812fba78e$var$CANCELED_EVENTS) {
534
- document.removeEventListener(event, this.cancelEvent, true);
535
- }
536
-
537
- this.mutationObserver.disconnect();
538
- this.restoreAriaHidden();
539
-
540
- if (this.mutationImmediate) {
541
- clearImmediate(this.mutationImmediate);
542
- }
543
- }
544
-
545
- onKeyDown(e) {
546
- var _this$currentDropTarg;
547
-
548
- this.cancelEvent(e);
549
-
550
- if (e.key === 'Escape') {
551
- this.cancel();
552
- return;
553
- }
554
-
555
- if (e.key === 'Enter') {
556
- if (e.altKey) {
557
- this.activate();
558
- } else {
559
- this.drop();
560
- }
561
-
562
- return;
563
- }
564
-
565
- if (e.key === 'Tab' && !(e.metaKey || e.altKey || e.ctrlKey)) {
566
- if (e.shiftKey) {
567
- this.previous();
568
- } else {
569
- this.next();
570
- }
571
- }
572
-
573
- if (typeof ((_this$currentDropTarg = this.currentDropTarget) == null ? void 0 : _this$currentDropTarg.onKeyDown) === 'function') {
574
- this.currentDropTarget.onKeyDown(e, this.dragTarget);
575
- }
576
- }
577
-
578
- onFocus(e) {
579
- // Prevent focus events, except to the original drag target.
580
- if (e.target !== this.dragTarget.element) {
581
- this.cancelEvent(e);
582
- } // Ignore focus events on the window/document (JSDOM). Will be handled in onBlur, below.
583
-
584
-
585
- if (!(e.target instanceof HTMLElement) || e.target === this.dragTarget.element) {
586
- return;
587
- }
588
-
589
- let dropTarget = this.validDropTargets.find(target => target.element.contains(e.target));
590
-
591
- if (!dropTarget) {
592
- if (this.currentDropTarget) {
593
- this.currentDropTarget.element.focus();
594
- } else {
595
- this.dragTarget.element.focus();
596
- }
597
-
598
- return;
599
- }
600
-
601
- let item = $a75d092e5c30878812fba78e$var$dropItems.get(e.target);
602
- this.setCurrentDropTarget(dropTarget, item);
603
- }
604
-
605
- onBlur(e) {
606
- if (e.target !== this.dragTarget.element) {
607
- this.cancelEvent(e);
608
- } // If nothing is gaining focus, or e.relatedTarget is the window/document (JSDOM),
609
- // restore focus back to the current drop target if any, or the original drag target.
610
-
611
-
612
- if (!e.relatedTarget || !(e.relatedTarget instanceof HTMLElement)) {
613
- if (this.currentDropTarget) {
614
- this.currentDropTarget.element.focus();
615
- } else {
616
- this.dragTarget.element.focus();
617
- }
618
- }
619
- }
620
-
621
- onClick(e) {
622
- this.cancelEvent(e);
623
-
624
- if (e.detail !== 0) {
625
- return;
626
- }
627
-
628
- if (e.target === this.dragTarget.element) {
629
- this.cancel();
630
- return;
631
- }
632
-
633
- let dropTarget = this.validDropTargets.find(target => target.element.contains(e.target));
634
-
635
- if (dropTarget) {
636
- let item = $a75d092e5c30878812fba78e$var$dropItems.get(e.target);
637
- this.setCurrentDropTarget(dropTarget, item);
638
- this.drop(item);
639
- }
640
- }
641
-
642
- cancelEvent(e) {
643
- // Allow default for events that might cancel a click event
644
- if (!$a75d092e5c30878812fba78e$var$CLICK_EVENTS.includes(e.type)) {
645
- e.preventDefault();
646
- }
647
-
648
- e.stopPropagation();
649
- e.stopImmediatePropagation();
650
- }
651
-
652
- updateValidDropTargets() {
653
- if (!this.mutationObserver) {
654
- return;
655
- }
656
-
657
- this.mutationObserver.disconnect();
658
-
659
- if (this.restoreAriaHidden) {
660
- this.restoreAriaHidden();
661
- }
662
-
663
- this.validDropTargets = $a75d092e5c30878812fba78e$var$findValidDropTargets(this.dragTarget);
664
-
665
- if (this.currentDropTarget && !this.validDropTargets.includes(this.currentDropTarget)) {
666
- this.setCurrentDropTarget(this.validDropTargets[0]);
667
- } // Find valid drop items within collections
668
-
669
-
670
- let types = $bc29619458500c186021634c18dc$export$getTypes(this.dragTarget.items);
671
- let validDropItems = [...$a75d092e5c30878812fba78e$var$dropItems.values()].filter(item => {
672
- if (typeof item.getDropOperation === 'function') {
673
- return item.getDropOperation(types, this.dragTarget.allowedDropOperations) !== 'cancel';
674
- }
675
-
676
- return true;
677
- }); // Filter out drop targets that contain valid items. We don't want to stop hiding elements
678
- // other than the drop items that exist inside the collection.
679
-
680
- let visibleDropTargets = this.validDropTargets.filter(target => !validDropItems.some(item => target.element.contains(item.element)));
681
- this.restoreAriaHidden = ariaHideOutside([this.dragTarget.element, ...validDropItems.map(item => item.element), ...visibleDropTargets.map(target => target.element)]);
682
- this.mutationObserver.observe(document.body, {
683
- subtree: true,
684
- attributes: true,
685
- attributeFilter: ['aria-hidden']
686
- });
687
- }
688
-
689
- next() {
690
- if (!this.currentDropTarget) {
691
- this.setCurrentDropTarget(this.validDropTargets[0]);
692
- return;
693
- }
694
-
695
- let index = this.validDropTargets.indexOf(this.currentDropTarget);
696
-
697
- if (index < 0) {
698
- this.setCurrentDropTarget(this.validDropTargets[0]);
699
- return;
700
- } // If we've reached the end of the valid drop targets, cycle back to the original drag target.
701
- // This lets the user cancel the drag in case they don't have an Escape key (e.g. iPad keyboard case).
702
-
703
-
704
- if (index === this.validDropTargets.length - 1) {
705
- if (!this.dragTarget.element.closest('[aria-hidden="true"]')) {
706
- this.setCurrentDropTarget(null);
707
- this.dragTarget.element.focus();
708
- } else {
709
- this.setCurrentDropTarget(this.validDropTargets[0]);
710
- }
711
- } else {
712
- this.setCurrentDropTarget(this.validDropTargets[index + 1]);
713
- }
714
- }
715
-
716
- previous() {
717
- if (!this.currentDropTarget) {
718
- this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);
719
- return;
720
- }
721
-
722
- let index = this.validDropTargets.indexOf(this.currentDropTarget);
723
-
724
- if (index < 0) {
725
- this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);
726
- return;
727
- } // If we've reached the start of the valid drop targets, cycle back to the original drag target.
728
- // This lets the user cancel the drag in case they don't have an Escape key (e.g. iPad keyboard case).
729
-
730
-
731
- if (index === 0) {
732
- if (!this.dragTarget.element.closest('[aria-hidden="true"]')) {
733
- this.setCurrentDropTarget(null);
734
- this.dragTarget.element.focus();
735
- } else {
736
- this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);
737
- }
738
- } else {
739
- this.setCurrentDropTarget(this.validDropTargets[index - 1]);
740
- }
741
- }
742
-
743
- setCurrentDropTarget(dropTarget, item) {
744
- if (dropTarget !== this.currentDropTarget) {
745
- if (this.currentDropTarget && typeof this.currentDropTarget.onDropExit === 'function') {
746
- let rect = this.currentDropTarget.element.getBoundingClientRect();
747
- this.currentDropTarget.onDropExit({
748
- type: 'dropexit',
749
- x: rect.left + rect.width / 2,
750
- y: rect.top + rect.height / 2
751
- });
752
- }
753
-
754
- this.currentDropTarget = dropTarget;
755
-
756
- if (dropTarget) {
757
- if (typeof dropTarget.onDropEnter === 'function') {
758
- let rect = dropTarget.element.getBoundingClientRect();
759
- dropTarget.onDropEnter({
760
- type: 'dropenter',
761
- x: rect.left + rect.width / 2,
762
- y: rect.top + rect.height / 2
763
- }, this.dragTarget);
373
+ $4on3C$reactarialiveannouncer.announce(this.formatMessage($d69e2bc1de15721f$var$MESSAGES[$c1cba3854dc3a167$export$1fb2158d224b542c()]));
374
+ }
375
+ teardown() {
376
+ document.removeEventListener('keydown', this.onKeyDown, true);
377
+ window.removeEventListener('focus', this.onFocus, true);
378
+ window.removeEventListener('blur', this.onBlur, true);
379
+ document.removeEventListener('click', this.onClick, true);
380
+ for (let event of $d69e2bc1de15721f$var$CANCELED_EVENTS)document.removeEventListener(event, this.cancelEvent, true);
381
+ this.mutationObserver.disconnect();
382
+ this.restoreAriaHidden();
383
+ if (this.mutationImmediate) clearImmediate(this.mutationImmediate);
384
+ }
385
+ onKeyDown(e) {
386
+ this.cancelEvent(e);
387
+ if (e.key === 'Escape') {
388
+ this.cancel();
389
+ return;
764
390
  }
765
-
766
- if (!item) {
767
- dropTarget == null ? void 0 : dropTarget.element.focus();
391
+ if (e.key === 'Enter') {
392
+ if (e.altKey) this.activate();
393
+ else this.drop();
394
+ return;
768
395
  }
769
- }
770
- }
771
-
772
- if (item !== this.currentDropItem) {
773
- if (item && typeof this.currentDropTarget.onDropTargetEnter === 'function') {
774
- this.currentDropTarget.onDropTargetEnter(item == null ? void 0 : item.target);
775
- }
776
-
777
- item == null ? void 0 : item.element.focus();
778
- this.currentDropItem = item;
779
- }
780
- }
781
-
782
- end() {
783
- this.teardown();
784
-
785
- if (typeof this.dragTarget.onDragEnd === 'function') {
786
- let target = this.currentDropTarget && this.dropOperation !== 'cancel' ? this.currentDropTarget : this.dragTarget;
787
- let rect = target.element.getBoundingClientRect();
788
- this.dragTarget.onDragEnd({
789
- type: 'dragend',
790
- x: rect.x + rect.width / 2,
791
- y: rect.y + rect.height / 2,
792
- dropOperation: this.dropOperation
793
- });
794
- }
795
-
796
- this.setCurrentDropTarget(null);
797
- $a75d092e5c30878812fba78e$var$endDragging();
798
- }
799
-
800
- cancel() {
801
- this.end();
802
-
803
- if (!this.dragTarget.element.closest('[aria-hidden="true"]')) {
804
- this.dragTarget.element.focus();
805
- }
806
-
807
- announce(this.formatMessage('dropCanceled'));
808
- }
809
-
810
- drop(item) {
811
- if (!this.currentDropTarget) {
812
- this.cancel();
813
- return;
814
- }
815
-
816
- if (typeof (item == null ? void 0 : item.getDropOperation) === 'function') {
817
- let types = $bc29619458500c186021634c18dc$export$getTypes(this.dragTarget.items);
818
- this.dropOperation = item.getDropOperation(types, this.dragTarget.allowedDropOperations);
819
- } else if (typeof this.currentDropTarget.getDropOperation === 'function') {
820
- let types = $bc29619458500c186021634c18dc$export$getTypes(this.dragTarget.items);
821
- this.dropOperation = this.currentDropTarget.getDropOperation(types, this.dragTarget.allowedDropOperations);
822
- } else {
823
- // TODO: show menu ??
824
- this.dropOperation = this.dragTarget.allowedDropOperations[0];
825
- }
826
-
827
- if (typeof this.currentDropTarget.onDrop === 'function') {
828
- let items = this.dragTarget.items.map(item => ({
829
- kind: 'text',
830
- types: new Set(Object.keys(item)),
831
- getText: type => Promise.resolve(item[type])
832
- }));
833
- let rect = this.currentDropTarget.element.getBoundingClientRect();
834
- this.currentDropTarget.onDrop({
835
- type: 'drop',
836
- x: rect.left + rect.width / 2,
837
- y: rect.top + rect.height / 2,
838
- items,
839
- dropOperation: this.dropOperation
840
- }, item == null ? void 0 : item.target);
841
- }
842
-
843
- this.end();
844
- announce(this.formatMessage('dropComplete'));
845
- }
846
-
847
- activate() {
848
- if (this.currentDropTarget && typeof this.currentDropTarget.onDropActivate === 'function') {
849
- let rect = this.currentDropTarget.element.getBoundingClientRect();
850
- this.currentDropTarget.onDropActivate({
851
- type: 'dropactivate',
852
- x: rect.left + rect.width / 2,
853
- y: rect.top + rect.height / 2
854
- });
855
- }
856
- }
857
-
858
- }
859
-
860
- function $a75d092e5c30878812fba78e$var$findValidDropTargets(options) {
861
- let types = $bc29619458500c186021634c18dc$export$getTypes(options.items);
862
- return [...$a75d092e5c30878812fba78e$var$dropTargets.values()].filter(target => {
863
- if (target.element.closest('[aria-hidden="true"]')) {
864
- return false;
865
- }
866
-
867
- if (typeof target.getDropOperation === 'function') {
868
- return target.getDropOperation(types, options.allowedDropOperations) !== 'cancel';
869
- }
870
-
871
- return true;
872
- });
873
- }
874
-
875
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/dnd/intl/en-US.json
876
- var $ece80d58838919a4624d1c28b393f77$exports = {};
877
- $ece80d58838919a4624d1c28b393f77$exports = JSON.parse("{\"dragItem\":\"Drag {itemText}\",\"dragSelectedItems\":\"Drag {count, plural, one {# selected item} other {# selected items}}\",\"dragDescriptionKeyboard\":\"Press Enter to start dragging.\",\"dragDescriptionTouch\":\"Double tap to start dragging.\",\"dragDescriptionVirtual\":\"Click to start dragging.\",\"dragStartedKeyboard\":\"Started dragging. Press Tab to navigate to a drop target, then press Enter to drop, or press Escape to cancel.\",\"dragStartedTouch\":\"Started dragging. Navigate to a drop target, then double tap to drop.\",\"dragStartedVirtual\":\"Started dragging. Navigate to a drop target, then click or press Enter to drop.\",\"endDragKeyboard\":\"Dragging. Press Enter to cancel drag.\",\"endDragTouch\":\"Dragging. Double tap to cancel drag.\",\"endDragVirtual\":\"Dragging. Click to cancel drag.\",\"dropDescriptionKeyboard\":\"Press Enter to drop. Press Escape to cancel drag.\",\"dropDescriptionTouch\":\"Double tap to drop.\",\"dropDescriptionVirtual\":\"Click to drop.\",\"dropCanceled\":\"Drop canceled.\",\"dropComplete\":\"Drop complete.\",\"dropIndicator\":\"drop indicator\",\"dropOnRoot\":\"Drop on\",\"dropOnItem\":\"Drop on {itemText}\",\"insertBefore\":\"Insert before {itemText}\",\"insertBetween\":\"Insert between {beforeItemText} and {afterItemText}\",\"insertAfter\":\"Insert after {itemText}\"}");
878
- // @ts-ignore
879
- const $faa3fd9c929dcb7fde0b75ef821032d3$var$intlMessages = {
880
- "en-US": _babelRuntimeHelpersInteropRequireDefault($ece80d58838919a4624d1c28b393f77$exports).default
881
- };
882
- const $faa3fd9c929dcb7fde0b75ef821032d3$var$MESSAGES = {
883
- keyboard: {
884
- start: 'dragDescriptionKeyboard',
885
- end: 'endDragKeyboard'
886
- },
887
- touch: {
888
- start: 'dragDescriptionTouch',
889
- end: 'endDragTouch'
890
- },
891
- virtual: {
892
- start: 'dragDescriptionVirtual',
893
- end: 'endDragVirtual'
894
- }
895
- };
896
-
897
- function useDrag(options) {
898
- let formatMessage = useMessageFormatter($faa3fd9c929dcb7fde0b75ef821032d3$var$intlMessages);
899
- let state = useRef({
900
- options,
901
- x: 0,
902
- y: 0
903
- }).current;
904
- state.options = options;
905
- let [isDragging, setDragging] = useState(false);
906
-
907
- let onDragStart = e => {
908
- let items = options.getItems();
909
- $bc29619458500c186021634c18dc$export$writeToDataTransfer(e.dataTransfer, items);
910
-
911
- if (typeof options.getAllowedDropOperations === 'function') {
912
- let allowedOperations = options.getAllowedDropOperations();
913
- let allowed = $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.none;
914
-
915
- for (let operation of allowedOperations) {
916
- allowed |= $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION[operation] || $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.none;
917
- }
918
-
919
- e.dataTransfer.effectAllowed = $b29ea0269b2ea2bf4827b4fa19ddc83e$export$EFFECT_ALLOWED[allowed] || 'none';
920
- } // If there is a renderPreview function, use it to render a custom preview image that will
921
- // appear under the pointer while dragging. If not, the element itself is dragged by the browser.
922
-
923
-
924
- if (typeof options.renderPreview === 'function') {
925
- let preview = options.renderPreview(items);
926
-
927
- if (preview) {
928
- // Create an off-screen div to render the preview into.
929
- let node = document.createElement('div');
930
- node.style.zIndex = '-100';
931
- node.style.position = 'absolute';
932
- node.style.top = '0';
933
- node.style.left = '-100000px';
934
- document.body.appendChild(node); // Call renderPreview to get a JSX element, and render it into the div with React DOM.
935
-
936
- _reactDom.render(preview, node); // Compute the offset that the preview will appear under the mouse.
937
- // If possible, this is based on the point the user clicked on the target.
938
- // If the preview is much smaller, then just use the center point of the preview.
939
-
940
-
941
- let size = node.getBoundingClientRect();
942
- let rect = e.currentTarget.getBoundingClientRect();
943
- let x = e.clientX - rect.x;
944
- let y = e.clientY - rect.y;
945
-
946
- if (x > size.width || y > size.height) {
947
- x = size.width / 2;
948
- y = size.height / 2;
396
+ if (e.key === 'Tab' && !(e.metaKey || e.altKey || e.ctrlKey)) {
397
+ if (e.shiftKey) this.previous();
398
+ else this.next();
399
+ }
400
+ if (typeof this.currentDropTarget?.onKeyDown === 'function') this.currentDropTarget.onKeyDown(e, this.dragTarget);
401
+ }
402
+ onFocus(e) {
403
+ // Prevent focus events, except to the original drag target.
404
+ if (e.target !== this.dragTarget.element) this.cancelEvent(e);
405
+ // Ignore focus events on the window/document (JSDOM). Will be handled in onBlur, below.
406
+ if (!(e.target instanceof HTMLElement) || e.target === this.dragTarget.element) return;
407
+ let dropTarget = this.validDropTargets.find((target)=>target.element.contains(e.target)
408
+ );
409
+ if (!dropTarget) {
410
+ if (this.currentDropTarget) this.currentDropTarget.element.focus();
411
+ else this.dragTarget.element.focus();
412
+ return;
413
+ }
414
+ let item = $d69e2bc1de15721f$var$dropItems.get(e.target);
415
+ this.setCurrentDropTarget(dropTarget, item);
416
+ }
417
+ onBlur(e) {
418
+ if (e.target !== this.dragTarget.element) this.cancelEvent(e);
419
+ // If nothing is gaining focus, or e.relatedTarget is the window/document (JSDOM),
420
+ // restore focus back to the current drop target if any, or the original drag target.
421
+ if (!e.relatedTarget || !(e.relatedTarget instanceof HTMLElement)) {
422
+ if (this.currentDropTarget) this.currentDropTarget.element.focus();
423
+ else this.dragTarget.element.focus();
949
424
  }
950
-
951
- e.dataTransfer.setDragImage(node, x, y); // Remove the preview from the DOM after a frame so the browser has time to paint.
952
-
953
- requestAnimationFrame(() => {
954
- document.body.removeChild(node);
955
- });
956
- }
957
- }
958
-
959
- if (typeof options.onDragStart === 'function') {
960
- options.onDragStart({
961
- type: 'dragstart',
962
- x: e.clientX,
963
- y: e.clientY
964
- });
965
- }
966
-
967
- state.x = e.clientX;
968
- state.y = e.clientY; // Wait a frame before we set dragging to true so that the browser has time to
969
- // render the preview image before we update the element that has been dragged.
970
-
971
- requestAnimationFrame(() => {
972
- setDragging(true);
973
- });
974
- };
975
-
976
- let onDrag = e => {
977
- if (e.clientX === state.x && e.clientY === state.y) {
978
- return;
979
- }
980
-
981
- if (typeof options.onDragMove === 'function') {
982
- options.onDragMove({
983
- type: 'dragmove',
984
- x: e.clientX,
985
- y: e.clientY
986
- });
987
- }
988
-
989
- state.x = e.clientX;
990
- state.y = e.clientY;
991
- };
992
-
993
- let onDragEnd = e => {
994
- if (typeof options.onDragEnd === 'function') {
995
- options.onDragEnd({
996
- type: 'dragend',
997
- x: e.clientX,
998
- y: e.clientY,
999
- dropOperation: $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_EFFECT_TO_DROP_OPERATION[e.dataTransfer.dropEffect]
1000
- });
1001
- }
1002
-
1003
- setDragging(false);
1004
- };
1005
-
1006
- let onPress = e => {
1007
- if (e.pointerType !== 'keyboard' && e.pointerType !== 'virtual') {
1008
- return;
1009
- }
1010
-
1011
- if (typeof state.options.onDragStart === 'function') {
1012
- let rect = e.target.getBoundingClientRect();
1013
- state.options.onDragStart({
1014
- type: 'dragstart',
1015
- x: rect.x + rect.width / 2,
1016
- y: rect.y + rect.height / 2
1017
- });
1018
425
  }
1019
-
1020
- $a75d092e5c30878812fba78e$export$beginDragging({
1021
- element: e.target,
1022
- items: state.options.getItems(),
1023
- allowedDropOperations: typeof state.options.getAllowedDropOperations === 'function' ? state.options.getAllowedDropOperations() : ['move', 'copy', 'link'],
1024
-
1025
- onDragEnd(e) {
1026
- setDragging(false);
1027
-
1028
- if (typeof state.options.onDragEnd === 'function') {
1029
- state.options.onDragEnd(e);
426
+ onClick(e) {
427
+ this.cancelEvent(e);
428
+ if (e.detail !== 0) return;
429
+ if (e.target === this.dragTarget.element) {
430
+ this.cancel();
431
+ return;
432
+ }
433
+ let dropTarget = this.validDropTargets.find((target)=>target.element.contains(e.target)
434
+ );
435
+ if (dropTarget) {
436
+ let item = $d69e2bc1de15721f$var$dropItems.get(e.target);
437
+ this.setCurrentDropTarget(dropTarget, item);
438
+ this.drop(item);
1030
439
  }
1031
- }
1032
-
1033
- }, formatMessage);
1034
- setDragging(true);
1035
- };
1036
-
1037
- let modality = $bc29619458500c186021634c18dc$export$useDragModality();
1038
- let descriptionProps = useDescription(formatMessage(!isDragging ? $faa3fd9c929dcb7fde0b75ef821032d3$var$MESSAGES[modality].start : $faa3fd9c929dcb7fde0b75ef821032d3$var$MESSAGES[modality].end));
1039
- return {
1040
- dragProps: {
1041
- draggable: 'true',
1042
- onDragStart,
1043
- onDrag,
1044
- onDragEnd
1045
- },
1046
- dragButtonProps: _babelRuntimeHelpersExtends({}, descriptionProps, {
1047
- onPress
1048
- }),
1049
- isDragging
1050
- };
1051
- }
1052
-
1053
- exports.useDrag = useDrag;
1054
- // @ts-ignore
1055
- const $ca75888e192994dbb11ae05e54$var$intlMessages = {
1056
- "en-US": _babelRuntimeHelpersInteropRequireDefault($ece80d58838919a4624d1c28b393f77$exports).default
1057
- };
1058
- const $ca75888e192994dbb11ae05e54$var$MESSAGES = {
1059
- keyboard: 'dropDescriptionKeyboard',
1060
- touch: 'dropDescriptionTouch',
1061
- virtual: 'dropDescriptionVirtual'
1062
- };
1063
-
1064
- function $ca75888e192994dbb11ae05e54$export$useVirtualDrop() {
1065
- let formatMessage = useMessageFormatter($ca75888e192994dbb11ae05e54$var$intlMessages);
1066
- let modality = $bc29619458500c186021634c18dc$export$useDragModality();
1067
- let dragSession = $a75d092e5c30878812fba78e$export$useDragSession();
1068
- let descriptionProps = useDescription(dragSession ? formatMessage($ca75888e192994dbb11ae05e54$var$MESSAGES[modality]) : '');
1069
- return {
1070
- dropProps: _babelRuntimeHelpersExtends({}, descriptionProps, {
1071
- // Mobile Safari does not properly bubble click events on elements except links or inputs
1072
- // unless there is an onclick handler bound directly to the element itself. By adding this
1073
- // handler, React will take care of adding that for us, and we are able to handle document
1074
- // level click events in the DragManager.
1075
- // See https://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
1076
- onClick: () => {}
1077
- })
1078
- };
1079
- }
1080
-
1081
- const $db0591c71140b157a950096251935c$var$DROP_ACTIVATE_TIMEOUT = 800;
1082
-
1083
- function useDrop(options) {
1084
- let [isDropTarget, setDropTarget] = useState(false);
1085
- let state = useRef({
1086
- x: 0,
1087
- y: 0,
1088
- dragEnterCount: 0,
1089
- dropEffect: 'none',
1090
- dropActivateTimer: null
1091
- }).current;
1092
-
1093
- let onDragOver = e => {
1094
- e.preventDefault();
1095
-
1096
- if (e.clientX === state.x && e.clientY === state.y) {
1097
- e.dataTransfer.dropEffect = state.dropEffect;
1098
- return;
1099
440
  }
1100
-
1101
- state.x = e.clientX;
1102
- state.y = e.clientY;
1103
-
1104
- if (typeof options.getDropOperationForPoint === 'function') {
1105
- let allowedOperations = $db0591c71140b157a950096251935c$var$effectAllowedToOperations(e.dataTransfer.effectAllowed);
1106
- let types = new $bc29619458500c186021634c18dc$export$DragTypes(e.dataTransfer);
1107
- let rect = e.currentTarget.getBoundingClientRect();
1108
- let dropOperation = options.getDropOperationForPoint(types, allowedOperations, state.x - rect.x, state.y - rect.y);
1109
- state.dropEffect = $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION_TO_DROP_EFFECT[dropOperation] || 'none';
441
+ cancelEvent(e) {
442
+ // Allow default for events that might cancel a click event
443
+ if (!$d69e2bc1de15721f$var$CLICK_EVENTS.includes(e.type)) e.preventDefault();
444
+ e.stopPropagation();
445
+ e.stopImmediatePropagation();
446
+ }
447
+ updateValidDropTargets() {
448
+ if (!this.mutationObserver) return;
449
+ this.mutationObserver.disconnect();
450
+ if (this.restoreAriaHidden) this.restoreAriaHidden();
451
+ this.validDropTargets = $d69e2bc1de15721f$var$findValidDropTargets(this.dragTarget);
452
+ if (this.currentDropTarget && !this.validDropTargets.includes(this.currentDropTarget)) this.setCurrentDropTarget(this.validDropTargets[0]);
453
+ // Find valid drop items within collections
454
+ let types = $c1cba3854dc3a167$export$e1d41611756c6326(this.dragTarget.items);
455
+ let validDropItems = [
456
+ ...$d69e2bc1de15721f$var$dropItems.values()
457
+ ].filter((item)=>{
458
+ if (typeof item.getDropOperation === 'function') return item.getDropOperation(types, this.dragTarget.allowedDropOperations) !== 'cancel';
459
+ return true;
460
+ });
461
+ // Filter out drop targets that contain valid items. We don't want to stop hiding elements
462
+ // other than the drop items that exist inside the collection.
463
+ let visibleDropTargets = this.validDropTargets.filter((target)=>!validDropItems.some((item)=>target.element.contains(item.element)
464
+ )
465
+ );
466
+ this.restoreAriaHidden = $4on3C$reactariaoverlays.ariaHideOutside([
467
+ this.dragTarget.element,
468
+ ...validDropItems.map((item)=>item.element
469
+ ),
470
+ ...visibleDropTargets.map((target)=>target.element
471
+ )
472
+ ]);
473
+ this.mutationObserver.observe(document.body, {
474
+ subtree: true,
475
+ attributes: true,
476
+ attributeFilter: [
477
+ 'aria-hidden'
478
+ ]
479
+ });
1110
480
  }
1111
-
1112
- e.dataTransfer.dropEffect = state.dropEffect;
1113
-
1114
- if (typeof options.onDropMove === 'function') {
1115
- let rect = e.currentTarget.getBoundingClientRect();
1116
- options.onDropMove({
1117
- type: 'dropmove',
1118
- x: state.x - rect.x,
1119
- y: state.y - rect.y
1120
- });
481
+ next() {
482
+ if (!this.currentDropTarget) {
483
+ this.setCurrentDropTarget(this.validDropTargets[0]);
484
+ return;
485
+ }
486
+ let index = this.validDropTargets.indexOf(this.currentDropTarget);
487
+ if (index < 0) {
488
+ this.setCurrentDropTarget(this.validDropTargets[0]);
489
+ return;
490
+ }
491
+ // If we've reached the end of the valid drop targets, cycle back to the original drag target.
492
+ // This lets the user cancel the drag in case they don't have an Escape key (e.g. iPad keyboard case).
493
+ if (index === this.validDropTargets.length - 1) {
494
+ if (!this.dragTarget.element.closest('[aria-hidden="true"]')) {
495
+ this.setCurrentDropTarget(null);
496
+ this.dragTarget.element.focus();
497
+ } else this.setCurrentDropTarget(this.validDropTargets[0]);
498
+ } else this.setCurrentDropTarget(this.validDropTargets[index + 1]);
499
+ }
500
+ previous() {
501
+ if (!this.currentDropTarget) {
502
+ this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);
503
+ return;
504
+ }
505
+ let index = this.validDropTargets.indexOf(this.currentDropTarget);
506
+ if (index < 0) {
507
+ this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);
508
+ return;
509
+ }
510
+ // If we've reached the start of the valid drop targets, cycle back to the original drag target.
511
+ // This lets the user cancel the drag in case they don't have an Escape key (e.g. iPad keyboard case).
512
+ if (index === 0) {
513
+ if (!this.dragTarget.element.closest('[aria-hidden="true"]')) {
514
+ this.setCurrentDropTarget(null);
515
+ this.dragTarget.element.focus();
516
+ } else this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);
517
+ } else this.setCurrentDropTarget(this.validDropTargets[index - 1]);
518
+ }
519
+ setCurrentDropTarget(dropTarget, item) {
520
+ if (dropTarget !== this.currentDropTarget) {
521
+ if (this.currentDropTarget && typeof this.currentDropTarget.onDropExit === 'function') {
522
+ let rect = this.currentDropTarget.element.getBoundingClientRect();
523
+ this.currentDropTarget.onDropExit({
524
+ type: 'dropexit',
525
+ x: rect.left + rect.width / 2,
526
+ y: rect.top + rect.height / 2
527
+ });
528
+ }
529
+ this.currentDropTarget = dropTarget;
530
+ if (dropTarget) {
531
+ if (typeof dropTarget.onDropEnter === 'function') {
532
+ let rect = dropTarget.element.getBoundingClientRect();
533
+ dropTarget.onDropEnter({
534
+ type: 'dropenter',
535
+ x: rect.left + rect.width / 2,
536
+ y: rect.top + rect.height / 2
537
+ }, this.dragTarget);
538
+ }
539
+ if (!item) dropTarget?.element.focus();
540
+ }
541
+ }
542
+ if (item !== this.currentDropItem) {
543
+ if (item && typeof this.currentDropTarget.onDropTargetEnter === 'function') this.currentDropTarget.onDropTargetEnter(item?.target);
544
+ item?.element.focus();
545
+ this.currentDropItem = item;
546
+ }
1121
547
  }
1122
-
1123
- clearTimeout(state.dropActivateTimer);
1124
-
1125
- if (typeof options.onDropActivate === 'function' && state.dropEffect !== 'none') {
1126
- let rect = e.currentTarget.getBoundingClientRect();
1127
- state.dropActivateTimer = setTimeout(() => {
1128
- options.onDropActivate({
1129
- type: 'dropactivate',
1130
- x: state.x - rect.x,
1131
- y: state.y - rect.y
1132
- });
1133
- }, $db0591c71140b157a950096251935c$var$DROP_ACTIVATE_TIMEOUT);
548
+ end() {
549
+ this.teardown();
550
+ if (typeof this.dragTarget.onDragEnd === 'function') {
551
+ let target = this.currentDropTarget && this.dropOperation !== 'cancel' ? this.currentDropTarget : this.dragTarget;
552
+ let rect = target.element.getBoundingClientRect();
553
+ this.dragTarget.onDragEnd({
554
+ type: 'dragend',
555
+ x: rect.x + rect.width / 2,
556
+ y: rect.y + rect.height / 2,
557
+ dropOperation: this.dropOperation
558
+ });
559
+ }
560
+ this.setCurrentDropTarget(null);
561
+ $d69e2bc1de15721f$var$endDragging();
1134
562
  }
1135
- };
563
+ cancel() {
564
+ this.end();
565
+ if (!this.dragTarget.element.closest('[aria-hidden="true"]')) this.dragTarget.element.focus();
566
+ $4on3C$reactarialiveannouncer.announce(this.formatMessage('dropCanceled'));
567
+ }
568
+ drop(item1) {
569
+ if (!this.currentDropTarget) {
570
+ this.cancel();
571
+ return;
572
+ }
573
+ if (typeof item1?.getDropOperation === 'function') {
574
+ let types = $c1cba3854dc3a167$export$e1d41611756c6326(this.dragTarget.items);
575
+ this.dropOperation = item1.getDropOperation(types, this.dragTarget.allowedDropOperations);
576
+ } else if (typeof this.currentDropTarget.getDropOperation === 'function') {
577
+ let types = $c1cba3854dc3a167$export$e1d41611756c6326(this.dragTarget.items);
578
+ this.dropOperation = this.currentDropTarget.getDropOperation(types, this.dragTarget.allowedDropOperations);
579
+ } else // TODO: show menu ??
580
+ this.dropOperation = this.dragTarget.allowedDropOperations[0];
581
+ if (typeof this.currentDropTarget.onDrop === 'function') {
582
+ let items = this.dragTarget.items.map((item)=>({
583
+ kind: 'text',
584
+ types: new Set(Object.keys(item)),
585
+ getText: (type)=>Promise.resolve(item[type])
586
+ })
587
+ );
588
+ let rect = this.currentDropTarget.element.getBoundingClientRect();
589
+ this.currentDropTarget.onDrop({
590
+ type: 'drop',
591
+ x: rect.left + rect.width / 2,
592
+ y: rect.top + rect.height / 2,
593
+ items: items,
594
+ dropOperation: this.dropOperation
595
+ }, item1?.target);
596
+ }
597
+ this.end();
598
+ $4on3C$reactarialiveannouncer.announce(this.formatMessage('dropComplete'));
599
+ }
600
+ activate() {
601
+ if (this.currentDropTarget && typeof this.currentDropTarget.onDropActivate === 'function') {
602
+ let rect = this.currentDropTarget.element.getBoundingClientRect();
603
+ this.currentDropTarget.onDropActivate({
604
+ type: 'dropactivate',
605
+ x: rect.left + rect.width / 2,
606
+ y: rect.top + rect.height / 2
607
+ });
608
+ }
609
+ }
610
+ }
611
+ function $d69e2bc1de15721f$var$findValidDropTargets(options) {
612
+ let types = $c1cba3854dc3a167$export$e1d41611756c6326(options.items);
613
+ return [
614
+ ...$d69e2bc1de15721f$var$dropTargets.values()
615
+ ].filter((target)=>{
616
+ if (target.element.closest('[aria-hidden="true"]')) return false;
617
+ if (typeof target.getDropOperation === 'function') return target.getDropOperation(types, options.allowedDropOperations) !== 'cancel';
618
+ return true;
619
+ });
620
+ }
1136
621
 
1137
- let onDragEnter = e => {
1138
- state.dragEnterCount++;
1139
622
 
1140
- if (state.dragEnterCount > 1) {
1141
- return;
1142
- }
1143
623
 
1144
- let allowedOperations = $db0591c71140b157a950096251935c$var$effectAllowedToOperations(e.dataTransfer.effectAllowed);
1145
- let dropOperation = allowedOperations[0];
624
+ var $a0e2171154b8c4fe$exports = {};
625
+ var $e1076e638f72e513$exports = {};
626
+ $e1076e638f72e513$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"اضغط Enter لبدء السحب.\",\"dragDescriptionTouch\":\"اضغط مرتين لبدء السحب.\",\"dragDescriptionVirtual\":\"انقر لبدء السحب.\",\"dragItem\":\"اسحب {itemText}\",\"dragSelectedItems\":\"اسحب {count, plural, one {# عنصر محدد} other {# عناصر محددة}}\",\"dragStartedKeyboard\":\"بدأ السحب. اضغط Tab للانتقال إلى موضع الإفلات، ثم اضغط Enter للإفلات، أو اضغط Escape للإلغاء.\",\"dragStartedTouch\":\"بدأ السحب. انتقل إلى موضع الإفلات، ثم اضغط مرتين للإفلات.\",\"dragStartedVirtual\":\"بدأ السحب. انتقل إلى مكان الإفلات، ثم انقر أو اضغط Enter للإفلات.\",\"dropCanceled\":\"تم إلغاء الإفلات.\",\"dropComplete\":\"اكتمل الإفلات.\",\"dropDescriptionKeyboard\":\"اضغط Enter للإفلات. اضغط Escape لإلغاء السحب.\",\"dropDescriptionTouch\":\"اضغط مرتين للإفلات.\",\"dropDescriptionVirtual\":\"انقر للإفلات.\",\"dropIndicator\":\"مؤشر الإفلات\",\"dropOnItem\":\"إفلات {itemText}\",\"dropOnRoot\":\"الإفلات\",\"endDragKeyboard\":\"السحب. اضغط Enter لإلغاء السحب.\",\"endDragTouch\":\"السحب. اضغط مرتين لإلغاء السحب.\",\"endDragVirtual\":\"السحب. انقر لإلغاء السحب.\",\"insertAfter\":\"أدخل بعد {itemText}\",\"insertBefore\":\"أدخل قبل {itemText}\",\"insertBetween\":\"أدخل بين {beforeItemText} و {afterItemText}\"}");
1146
627
 
1147
- if (typeof options.getDropOperation === 'function') {
1148
- let types = new $bc29619458500c186021634c18dc$export$DragTypes(e.dataTransfer);
1149
- dropOperation = options.getDropOperation(types, allowedOperations);
1150
- }
1151
628
 
1152
- if (dropOperation !== 'cancel') {
1153
- setDropTarget(true);
1154
- }
629
+ var $5247825c4c521ecd$exports = {};
630
+ $5247825c4c521ecd$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"Натиснете „Enter“, за да започнете да плъзгате.\",\"dragDescriptionTouch\":\"Натиснете двукратно, за да започнете да плъзгате.\",\"dragDescriptionVirtual\":\"Щракнете, за да започнете да плъзгате.\",\"dragItem\":\"Плъзни {itemText}\",\"dragSelectedItems\":\"Плъзни {count, plural, one {# избран елемент} other {# избрани елемента}}\",\"dragStartedKeyboard\":\"Започна плъзгане. Натиснете „Tab“, за да се придвижите до целта, след което натиснете „Enter“ за пускане или натиснете „Escape“ за отмяна.\",\"dragStartedTouch\":\"Започна плъзгане. Придвижете се до целта, след което натиснете двукратно, за да пуснете.\",\"dragStartedVirtual\":\"Започна плъзгане. Придвижете се до целта, след което щракнете или натиснете „Enter“ за пускане.\",\"dropCanceled\":\"Пускането е отменено.\",\"dropComplete\":\"Пускането е завършено.\",\"dropDescriptionKeyboard\":\"Натиснете „Enter“ за пускане. Натиснете „Escape“ за отмяна на плъзгането.\",\"dropDescriptionTouch\":\"Натиснете двукратно за пускане.\",\"dropDescriptionVirtual\":\"Щракнете за пускане.\",\"dropIndicator\":\"индикатор за пускане\",\"dropOnItem\":\"Пусни върху {itemText}\",\"dropOnRoot\":\"Пусни върху\",\"endDragKeyboard\":\"Плъзгане. Натиснете „Enter“ за отмяна на плъзгането.\",\"endDragTouch\":\"Плъзгане. Натиснете двукратно за отмяна на плъзгането.\",\"endDragVirtual\":\"Плъзгане. Щракнете за отмяна.\",\"insertAfter\":\"Вмъкни след {itemText}\",\"insertBefore\":\"Вмъкни преди {itemText}\",\"insertBetween\":\"Вмъкни между {beforeItemText} и {afterItemText}\"}");
1155
631
 
1156
- if (typeof options.getDropOperationForPoint === 'function') {
1157
- let types = new $bc29619458500c186021634c18dc$export$DragTypes(e.dataTransfer);
1158
- let rect = e.currentTarget.getBoundingClientRect();
1159
- dropOperation = options.getDropOperationForPoint(types, allowedOperations, e.clientX - rect.x, e.clientY - rect.y);
1160
- }
1161
632
 
1162
- state.dropEffect = $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION_TO_DROP_EFFECT[dropOperation] || 'none';
1163
- e.dataTransfer.dropEffect = state.dropEffect;
633
+ var $679c7987be73b33a$exports = {};
634
+ $679c7987be73b33a$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"Stisknutím klávesy Enter začnete s přetahováním.\",\"dragDescriptionTouch\":\"Poklepáním začnete s přetahováním.\",\"dragDescriptionVirtual\":\"Kliknutím začnete s přetahováním.\",\"dragItem\":\"Přetáhnout {itemText}\",\"dragSelectedItems\":\"Přetáhnout {count, plural, one {# vybranou položku} few {# vybrané položky} other {# vybraných položek}}\",\"dragStartedKeyboard\":\"Začněte s přetahováním. Po stisknutí klávesy Tab najděte požadovaný cíl a stisknutím klávesy Enter přetažení dokončete nebo stisknutím klávesy Esc akci zrušte.\",\"dragStartedTouch\":\"Začněte s přetahováním. Najděte požadovaný cíl a poklepáním přetažení dokončete.\",\"dragStartedVirtual\":\"Začněte s přetahováním. Najděte požadovaný cíl a kliknutím nebo stisknutím klávesy Enter přetažení dokončete.\",\"dropCanceled\":\"Přetažení bylo zrušeno.\",\"dropComplete\":\"Přetažení bylo dokončeno.\",\"dropDescriptionKeyboard\":\"Stisknutím klávesy Enter přetažení dokončete nebo stisknutím klávesy Esc akci zrušte.\",\"dropDescriptionTouch\":\"Poklepáním přetažení dokončete.\",\"dropDescriptionVirtual\":\"Kliknutím objekt přetáhněte.\",\"dropIndicator\":\"indikátor přetažení\",\"dropOnItem\":\"Přetáhnout na {itemText}\",\"dropOnRoot\":\"Přetáhnout na\",\"endDragKeyboard\":\"Probíhá přetahování. Stisknutím klávesy Enter přetažení zrušíte.\",\"endDragTouch\":\"Probíhá přetahování. Poklepáním přetažení zrušíte.\",\"endDragVirtual\":\"Probíhá přetahování. Kliknutím přetažení zrušíte.\",\"insertAfter\":\"Vložit za {itemText}\",\"insertBefore\":\"Vložit před {itemText}\",\"insertBetween\":\"Vložit mezi {beforeItemText} a {afterItemText}\"}");
1164
635
 
1165
- if (typeof options.onDropEnter === 'function' && dropOperation !== 'cancel') {
1166
- let rect = e.currentTarget.getBoundingClientRect();
1167
- options.onDropEnter({
1168
- type: 'dropenter',
1169
- x: e.clientX - rect.x,
1170
- y: e.clientY - rect.y
1171
- });
1172
- }
1173
636
 
1174
- state.x = e.clientX;
1175
- state.y = e.clientY;
1176
- };
637
+ var $1c6be209d930911d$exports = {};
638
+ $1c6be209d930911d$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"Tryk på Enter for at starte med at trække.\",\"dragDescriptionTouch\":\"Dobbelttryk for at starte med at trække.\",\"dragDescriptionVirtual\":\"Klik for at starte med at trække.\",\"dragItem\":\"Træk {itemText}\",\"dragSelectedItems\":\"Træk {count, plural, one {# valgt element} other {# valgte elementer}}\",\"dragStartedKeyboard\":\"Startet med at trække. Tryk på Tab for at gå til et slip-mål, tryk derefter på Enter for at slippe, eller tryk på Escape for at annullere.\",\"dragStartedTouch\":\"Startet med at trække. Gå til et slip-mål, og dobbelttryk derefter for at slippe.\",\"dragStartedVirtual\":\"Startet med at trække. Gå til et slip-mål, og klik eller tryk derefter på enter for at slippe.\",\"dropCanceled\":\"Slip annulleret.\",\"dropComplete\":\"Slip fuldført.\",\"dropDescriptionKeyboard\":\"Tryk på Enter for at slippe. Tryk på Escape for at annullere trækning.\",\"dropDescriptionTouch\":\"Dobbelttryk for at slippe.\",\"dropDescriptionVirtual\":\"Klik for at slippe.\",\"dropIndicator\":\"slip-indikator\",\"dropOnItem\":\"Slip på {itemText}\",\"dropOnRoot\":\"Slip på\",\"endDragKeyboard\":\"Trækning. Tryk på enter for at annullere træk.\",\"endDragTouch\":\"Trækning. Dobbelttryk for at annullere træk.\",\"endDragVirtual\":\"Trækning. Klik for at annullere trækning.\",\"insertAfter\":\"Indsæt efter {itemText}\",\"insertBefore\":\"Indsæt før {itemText}\",\"insertBetween\":\"Indsæt mellem {beforeItemText} og {afterItemText}\"}");
1177
639
 
1178
- let onDragLeave = e => {
1179
- state.dragEnterCount--;
1180
640
 
1181
- if (state.dragEnterCount > 0) {
1182
- return;
1183
- }
641
+ var $0c5c28ae829fbcc5$exports = {};
642
+ $0c5c28ae829fbcc5$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"Drücken Sie die Eingabetaste, um den Ziehvorgang zu starten.\",\"dragDescriptionTouch\":\"Tippen Sie doppelt, um den Ziehvorgang zu starten.\",\"dragDescriptionVirtual\":\"Zum Starten des Ziehvorgangs klicken.\",\"dragItem\":\"{itemText} ziehen\",\"dragSelectedItems\":\"{count, plural, one {# ausgewähltes Objekt} other {# ausgewählte Objekte}} ziehen\",\"dragStartedKeyboard\":\"Ziehvorgang gestartet. Drücken Sie die Tabulatortaste, um zu einem Ablegeziel zu navigieren und drücken Sie dann die Eingabetaste, um das Objekt abzulegen, oder Escape, um den Vorgang abzubrechen.\",\"dragStartedTouch\":\"Ziehvorgang gestartet. Navigieren Sie zu einem Ablegeziel und tippen Sie doppelt, um das Objekt abzulegen.\",\"dragStartedVirtual\":\"Ziehvorgang gestartet. Navigieren Sie zu einem Ablegeziel und klicken Sie oder drücken Sie die Eingabetaste, um das Objekt abzulegen.\",\"dropCanceled\":\"Ablegen abgebrochen.\",\"dropComplete\":\"Ablegen abgeschlossen.\",\"dropDescriptionKeyboard\":\"Drücken Sie die Eingabetaste, um das Objekt abzulegen. Drücken Sie Escape, um den Vorgang abzubrechen.\",\"dropDescriptionTouch\":\"Tippen Sie doppelt, um das Objekt abzulegen.\",\"dropDescriptionVirtual\":\"Zum Ablegen klicken.\",\"dropIndicator\":\"Ablegeanzeiger\",\"dropOnItem\":\"Auf {itemText} ablegen\",\"dropOnRoot\":\"Ablegen auf\",\"endDragKeyboard\":\"Ziehvorgang läuft. Drücken Sie die Eingabetaste, um den Vorgang abzubrechen.\",\"endDragTouch\":\"Ziehvorgang läuft. Tippen Sie doppelt, um den Vorgang abzubrechen.\",\"endDragVirtual\":\"Ziehvorgang läuft. Klicken Sie, um den Vorgang abzubrechen.\",\"insertAfter\":\"Nach {itemText} einfügen\",\"insertBefore\":\"Vor {itemText} einfügen\",\"insertBetween\":\"Zwischen {beforeItemText} und {afterItemText} einfügen\"}");
1184
643
 
1185
- if (typeof options.onDropExit === 'function' && state.dropEffect !== 'none') {
1186
- let rect = e.currentTarget.getBoundingClientRect();
1187
- options.onDropExit({
1188
- type: 'dropexit',
1189
- x: e.clientX - rect.x,
1190
- y: e.clientY - rect.y
1191
- });
1192
- }
1193
644
 
1194
- setDropTarget(false);
1195
- clearTimeout(state.dropActivateTimer);
1196
- };
1197
-
1198
- let onDrop = e => {
1199
- e.preventDefault();
1200
-
1201
- if (typeof options.onDrop === 'function') {
1202
- let dropOperation = $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_EFFECT_TO_DROP_OPERATION[state.dropEffect];
1203
- let items = $bc29619458500c186021634c18dc$export$readFromDataTransfer(e.dataTransfer);
1204
- let rect = e.currentTarget.getBoundingClientRect();
1205
- let event = {
1206
- type: 'drop',
1207
- x: e.clientX - rect.x,
1208
- y: e.clientY - rect.y,
1209
- items,
1210
- dropOperation
1211
- }; // Wait a frame to dispatch the drop event so that we ensure the dragend event fires first.
1212
- // Otherwise, if onDrop removes the original dragged element from the DOM, dragend will never be fired.
1213
- // This behavior is consistent across browsers, but see this issue for details:
1214
- // https://bugzilla.mozilla.org/show_bug.cgi?id=460801
1215
-
1216
- setTimeout(() => {
1217
- options.onDrop(event);
1218
- }, 0);
1219
- }
645
+ var $362719e545ebbe59$exports = {};
646
+ $362719e545ebbe59$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"Πατήστε Enter για έναρξη της μεταφοράς.\",\"dragDescriptionTouch\":\"Πατήστε δύο φορές για έναρξη της μεταφοράς.\",\"dragDescriptionVirtual\":\"Κάντε κλικ για να ξεκινήσετε τη μεταφορά.\",\"dragItem\":\"Μεταφορά {itemText}\",\"dragSelectedItems\":\"Μεταφορά σε {count, plural, one {# επιλεγμένο στοιχείο} other {# επιλεγμένα στοιχεία}}\",\"dragStartedKeyboard\":\"Η μεταφορά ξεκίνησε. Πατήστε το πλήκτρο Tab για να μεταβείτε σε έναν προορισμό απόθεσης και, στη συνέχεια, πατήστε Enter για απόθεση ή πατήστε Escape για ακύρωση.\",\"dragStartedTouch\":\"Η μεταφορά ξεκίνησε. Μεταβείτε σε έναν προορισμό απόθεσης και, στη συνέχεια, πατήστε δύο φορές για απόθεση.\",\"dragStartedVirtual\":\"Η μεταφορά ξεκίνησε. Μεταβείτε σε έναν προορισμό απόθεσης και, στη συνέχεια, κάντε κλικ ή πατήστε Enter για απόθεση.\",\"dropCanceled\":\"Η απόθεση ακυρώθηκε.\",\"dropComplete\":\"Η απόθεση ολοκληρώθηκε.\",\"dropDescriptionKeyboard\":\"Πατήστε Enter για απόθεση. Πατήστε Escape για ακύρωση της μεταφοράς.\",\"dropDescriptionTouch\":\"Πατήστε δύο φορές για απόθεση.\",\"dropDescriptionVirtual\":\"Κάντε κλικ για απόθεση.\",\"dropIndicator\":\"δείκτης απόθεσης\",\"dropOnItem\":\"Απόθεση σε {itemText}\",\"dropOnRoot\":\"Απόθεση σε\",\"endDragKeyboard\":\"Μεταφορά σε εξέλιξη. Πατήστε Enter για ακύρωση της μεταφοράς.\",\"endDragTouch\":\"Μεταφορά σε εξέλιξη. Πατήστε δύο φορές για ακύρωση της μεταφοράς.\",\"endDragVirtual\":\"Μεταφορά σε εξέλιξη. Κάντε κλικ για ακύρωση της μεταφοράς.\",\"insertAfter\":\"Εισαγωγή μετά από {itemText}\",\"insertBefore\":\"Εισαγωγή πριν από {itemText}\",\"insertBetween\":\"Εισαγωγή μεταξύ {beforeItemText} και {afterItemText}\"}");
1220
647
 
1221
- if (typeof options.onDropExit === 'function') {
1222
- let rect = e.currentTarget.getBoundingClientRect();
1223
- options.onDropExit({
1224
- type: 'dropexit',
1225
- x: e.clientX - rect.x,
1226
- y: e.clientY - rect.y
1227
- });
1228
- }
1229
648
 
1230
- state.dragEnterCount = 0;
1231
- setDropTarget(false);
1232
- clearTimeout(state.dropActivateTimer);
1233
- };
649
+ var $bf5ca542ddbd7e1e$exports = {};
650
+ $bf5ca542ddbd7e1e$exports = JSON.parse("{\"dragItem\":\"Drag {itemText}\",\"dragSelectedItems\":\"Drag {count, plural, one {# selected item} other {# selected items}}\",\"dragDescriptionKeyboard\":\"Press Enter to start dragging.\",\"dragDescriptionTouch\":\"Double tap to start dragging.\",\"dragDescriptionVirtual\":\"Click to start dragging.\",\"dragStartedKeyboard\":\"Started dragging. Press Tab to navigate to a drop target, then press Enter to drop, or press Escape to cancel.\",\"dragStartedTouch\":\"Started dragging. Navigate to a drop target, then double tap to drop.\",\"dragStartedVirtual\":\"Started dragging. Navigate to a drop target, then click or press Enter to drop.\",\"endDragKeyboard\":\"Dragging. Press Enter to cancel drag.\",\"endDragTouch\":\"Dragging. Double tap to cancel drag.\",\"endDragVirtual\":\"Dragging. Click to cancel drag.\",\"dropDescriptionKeyboard\":\"Press Enter to drop. Press Escape to cancel drag.\",\"dropDescriptionTouch\":\"Double tap to drop.\",\"dropDescriptionVirtual\":\"Click to drop.\",\"dropCanceled\":\"Drop canceled.\",\"dropComplete\":\"Drop complete.\",\"dropIndicator\":\"drop indicator\",\"dropOnRoot\":\"Drop on\",\"dropOnItem\":\"Drop on {itemText}\",\"insertBefore\":\"Insert before {itemText}\",\"insertBetween\":\"Insert between {beforeItemText} and {afterItemText}\",\"insertAfter\":\"Insert after {itemText}\"}");
1234
651
 
1235
- let optionsRef = useRef(options);
1236
- optionsRef.current = options;
1237
- useLayoutEffect(() => $a75d092e5c30878812fba78e$export$registerDropTarget({
1238
- element: optionsRef.current.ref.current,
1239
- getDropOperation: optionsRef.current.getDropOperation,
1240
652
 
1241
- onDropEnter(e) {
1242
- setDropTarget(true);
653
+ var $249f7c6f2b021a36$exports = {};
654
+ $249f7c6f2b021a36$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"Pulse Intro para empezar a arrastrar.\",\"dragDescriptionTouch\":\"Pulse dos veces para iniciar el arrastre.\",\"dragDescriptionVirtual\":\"Haga clic para iniciar el arrastre.\",\"dragItem\":\"Arrastrar {itemText}\",\"dragSelectedItems\":\"Arrastrar {count, plural, one {# elemento seleccionado} other {# elementos seleccionados}}\",\"dragStartedKeyboard\":\"Se ha empezado a arrastrar. Pulse el tabulador para ir al destino de colocación y, a continuación, pulse Intro para soltar, o pulse Escape para cancelar.\",\"dragStartedTouch\":\"Se ha empezado a arrastrar. Vaya al destino de colocación y, a continuación, pulse dos veces para soltar.\",\"dragStartedVirtual\":\"Se ha empezado a arrastrar. Vaya al destino de colocación y, a continuación, haga clic o pulse Intro para soltar.\",\"dropCanceled\":\"Se ha cancelado la colocación.\",\"dropComplete\":\"Colocación finalizada.\",\"dropDescriptionKeyboard\":\"Pulse Intro para soltar. Pulse Escape para cancelar el arrastre.\",\"dropDescriptionTouch\":\"Pulse dos veces para soltar.\",\"dropDescriptionVirtual\":\"Haga clic para soltar.\",\"dropIndicator\":\"indicador de colocación\",\"dropOnItem\":\"Soltar en {itemText}\",\"dropOnRoot\":\"Soltar en\",\"endDragKeyboard\":\"Arrastrando. Pulse Intro para cancelar el arrastre.\",\"endDragTouch\":\"Arrastrando. Pulse dos veces para cancelar el arrastre.\",\"endDragVirtual\":\"Arrastrando. Haga clic para cancelar el arrastre.\",\"insertAfter\":\"Insertar después de {itemText}\",\"insertBefore\":\"Insertar antes de {itemText}\",\"insertBetween\":\"Insertar entre {beforeItemText} y {afterItemText}\"}");
1243
655
 
1244
- if (typeof optionsRef.current.onDropEnter === 'function') {
1245
- optionsRef.current.onDropEnter(e);
1246
- }
1247
- },
1248
656
 
1249
- onDropExit(e) {
1250
- setDropTarget(false);
657
+ var $a306aec76fcd0c95$exports = {};
658
+ $a306aec76fcd0c95$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"Lohistamise alustamiseks vajutage klahvi Enter.\",\"dragDescriptionTouch\":\"Topeltpuudutage lohistamise alustamiseks.\",\"dragDescriptionVirtual\":\"Klõpsake lohistamise alustamiseks.\",\"dragItem\":\"Lohista {itemText}\",\"dragSelectedItems\":\"Lohista {count, plural, one {# valitud üksust} other {# valitud üksust}}\",\"dragStartedKeyboard\":\"Alustati lohistamist. Kukutamise sihtmärgi juurde navigeerimiseks vajutage klahvi Tab, seejärel vajutage kukutamiseks klahvi Enter või loobumiseks klahvi Escape.\",\"dragStartedTouch\":\"Alustati lohistamist. Navigeerige kukutamise sihtmärgi juurde ja topeltpuudutage kukutamiseks.\",\"dragStartedVirtual\":\"Alustati lohistamist. Navigeerige kukutamise sihtmärgi juurde ja kukutamiseks klõpsake või vajutage klahvi Enter.\",\"dropCanceled\":\"Lohistamisest loobuti.\",\"dropComplete\":\"Lohistamine on tehtud.\",\"dropDescriptionKeyboard\":\"Kukutamiseks vajutage klahvi Enter. Lohistamisest loobumiseks vajutage klahvi Escape.\",\"dropDescriptionTouch\":\"Kukutamiseks topeltpuudutage.\",\"dropDescriptionVirtual\":\"Kukutamiseks klõpsake.\",\"dropIndicator\":\"lohistamise indikaator\",\"dropOnItem\":\"Kukuta asukohta {itemText}\",\"dropOnRoot\":\"Kukuta asukohta\",\"endDragKeyboard\":\"Lohistamine. Lohistamisest loobumiseks vajutage klahvi Enter.\",\"endDragTouch\":\"Lohistamine. Lohistamisest loobumiseks topeltpuudutage.\",\"endDragVirtual\":\"Lohistamine. Lohistamisest loobumiseks klõpsake.\",\"insertAfter\":\"Sisesta {itemText} järele\",\"insertBefore\":\"Sisesta {itemText} ette\",\"insertBetween\":\"Sisesta {beforeItemText} ja {afterItemText} vahele\"}");
1251
659
 
1252
- if (typeof optionsRef.current.onDropExit === 'function') {
1253
- optionsRef.current.onDropExit(e);
1254
- }
1255
- },
1256
660
 
1257
- onDrop(e) {
1258
- if (typeof optionsRef.current.onDrop === 'function') {
1259
- optionsRef.current.onDrop(e);
1260
- }
1261
- },
661
+ var $6eb0560f4ff183ff$exports = {};
662
+ $6eb0560f4ff183ff$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"Aloita vetäminen painamalla Enter-näppäintä.\",\"dragDescriptionTouch\":\"Aloita vetäminen kaksoisnapauttamalla.\",\"dragDescriptionVirtual\":\"Aloita vetäminen napsauttamalla.\",\"dragItem\":\"Vedä kohdetta {itemText}\",\"dragSelectedItems\":\"Vedä {count, plural, one {# valittua kohdetta} other {# valittua kohdetta}}\",\"dragStartedKeyboard\":\"Vetäminen aloitettu. Siirry pudotuskohteeseen painamalla sarkainnäppäintä ja sitten pudota painamalla Enter-näppäintä tai peruuta painamalla Escape-näppäintä.\",\"dragStartedTouch\":\"Vetäminen aloitettu. Siirry pudotuskohteeseen ja pudota kaksoisnapauttamalla.\",\"dragStartedVirtual\":\"Vetäminen aloitettu. Siirry pudotuskohteeseen ja pudota napsauttamalla tai painamalla Enter-näppäintä.\",\"dropCanceled\":\"Pudotus peruutettu.\",\"dropComplete\":\"Pudotus suoritettu.\",\"dropDescriptionKeyboard\":\"Pudota painamalla Enter-näppäintä. Peruuta vetäminen painamalla Escape-näppäintä.\",\"dropDescriptionTouch\":\"Pudota kaksoisnapauttamalla.\",\"dropDescriptionVirtual\":\"Pudota napsauttamalla.\",\"dropIndicator\":\"pudotuksen ilmaisin\",\"dropOnItem\":\"Pudota kohteeseen {itemText}\",\"dropOnRoot\":\"Pudota kohteeseen\",\"endDragKeyboard\":\"Vedetään. Peruuta vetäminen painamalla Enter-näppäintä.\",\"endDragTouch\":\"Vedetään. Peruuta vetäminen kaksoisnapauttamalla.\",\"endDragVirtual\":\"Vedetään. Peruuta vetäminen napsauttamalla.\",\"insertAfter\":\"Lisää kohteen {itemText} jälkeen\",\"insertBefore\":\"Lisää ennen kohdetta {itemText}\",\"insertBetween\":\"Lisää kohteiden {beforeItemText} ja {afterItemText} väliin\"}");
1262
663
 
1263
- onDropActivate(e) {
1264
- if (typeof optionsRef.current.onDropActivate === 'function') {
1265
- optionsRef.current.onDropActivate(e);
1266
- }
1267
- }
1268
664
 
1269
- }), [optionsRef]);
1270
- let {
1271
- dropProps
1272
- } = $ca75888e192994dbb11ae05e54$export$useVirtualDrop();
1273
- return {
1274
- dropProps: _babelRuntimeHelpersExtends({}, dropProps, {
1275
- onDragEnter,
1276
- onDragOver,
1277
- onDragLeave,
1278
- onDrop
1279
- }),
1280
- isDropTarget
1281
- };
1282
- }
665
+ var $a9309d69baecc54a$exports = {};
666
+ $a9309d69baecc54a$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"Appuyez sur Entrée pour commencer le déplacement.\",\"dragDescriptionTouch\":\"Touchez deux fois pour commencer le déplacement.\",\"dragDescriptionVirtual\":\"Cliquez pour commencer le déplacement.\",\"dragItem\":\"Déplacer {itemText}\",\"dragSelectedItems\":\"Déplacer {count, plural, one {# élément sélectionné} other {# éléments sélectionnés}}\",\"dragStartedKeyboard\":\"Déplacement commencé. Appuyez sur Tabulation pour accéder à une cible de dépôt, puis appuyez sur Entrée pour déposer, ou appuyez sur Échap pour annuler.\",\"dragStartedTouch\":\"Déplacement commencé. Accédez à une cible de dépôt, puis touchez deux fois pour déposer.\",\"dragStartedVirtual\":\"Déplacement commencé. Accédez à une cible de dépôt, puis cliquez ou appuyez sur Entrée pour déposer.\",\"dropCanceled\":\"Dépôt annulé.\",\"dropComplete\":\"Dépôt terminé.\",\"dropDescriptionKeyboard\":\"Appuyez sur Entrée pour déposer. Appuyez sur Échap pour annuler le déplacement.\",\"dropDescriptionTouch\":\"Touchez deux fois pour déposer.\",\"dropDescriptionVirtual\":\"Cliquez pour déposer.\",\"dropIndicator\":\"indicateur de dépôt\",\"dropOnItem\":\"Déposer sur {itemText}\",\"dropOnRoot\":\"Déposer sur\",\"endDragKeyboard\":\"Déplacement. Appuyez sur Entrée pour annuler le déplacement.\",\"endDragTouch\":\"Déplacement. Touchez deux fois pour annuler le déplacement.\",\"endDragVirtual\":\"Déplacement. Cliquez pour annuler le déplacement.\",\"insertAfter\":\"Insérer après {itemText}\",\"insertBefore\":\"Insérer avant {itemText}\",\"insertBetween\":\"Insérer entre {beforeItemText} et {afterItemText}\"}");
1283
667
 
1284
- exports.useDrop = useDrop;
1285
668
 
1286
- function $db0591c71140b157a950096251935c$var$effectAllowedToOperations(effectAllowed) {
1287
- let allowedOperationsBits = $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION_ALLOWED[effectAllowed];
1288
- let allowedOperations = [];
669
+ var $c306e39910a4b3d3$exports = {};
670
+ $c306e39910a4b3d3$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"הקש על Enter כדי להתחיל לגרור.\",\"dragDescriptionTouch\":\"הקש פעמיים כדי להתחיל בגרירה.\",\"dragDescriptionVirtual\":\"לחץ כדי להתחיל לגרור.\",\"dragItem\":\"גרור את {itemText}\",\"dragSelectedItems\":\"גרור {count, plural, one {פריט נבחר #} other {# פריטים שנבחרו}}\",\"dragStartedKeyboard\":\"התחלת לגרור. הקש על Tab כדי לנווט לנקודת הגרירה ולאחר מכן הקש על Enter כדי לשחרר או על Escape כדי לבטל.\",\"dragStartedTouch\":\"התחלת לגרור. נווט לנקודת השחרור ולאחר מכן הקש פעמיים כדי לשחרר.\",\"dragStartedVirtual\":\"התחלת לגרור. נווט לנקודת השחרור ולאחר מכן לחץ או הקש על Enter כדי לשחרר.\",\"dropCanceled\":\"השחרור בוטל.\",\"dropComplete\":\"השחרור הושלם.\",\"dropDescriptionKeyboard\":\"הקש על Enter כדי לשחרר. הקש על Escape כדי לבטל את הגרירה.\",\"dropDescriptionTouch\":\"הקש פעמיים כדי לשחרר.\",\"dropDescriptionVirtual\":\"לחץ כדי לשחרר.\",\"dropIndicator\":\"מחוון שחרור\",\"dropOnItem\":\"שחרר על {itemText}\",\"dropOnRoot\":\"שחרר על\",\"endDragKeyboard\":\"גורר. הקש על Enter כדי לבטל את הגרירה.\",\"endDragTouch\":\"גורר. הקש פעמיים כדי לבטל את הגרירה.\",\"endDragVirtual\":\"גורר. לחץ כדי לבטל את הגרירה.\",\"insertAfter\":\"הוסף אחרי {itemText}\",\"insertBefore\":\"הוסף לפני {itemText}\",\"insertBetween\":\"הוסף בין {beforeItemText} לבין {afterItemText}\"}");
1289
671
 
1290
- if (allowedOperationsBits & $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.move) {
1291
- allowedOperations.push('move');
1292
- }
1293
672
 
1294
- if (allowedOperationsBits & $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.copy) {
1295
- allowedOperations.push('copy');
1296
- }
673
+ var $383c29c6b563fed3$exports = {};
674
+ $383c29c6b563fed3$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"Pritisnite Enter da biste počeli povlačiti.\",\"dragDescriptionTouch\":\"Dvaput dodirnite da biste počeli povlačiti.\",\"dragDescriptionVirtual\":\"Kliknite da biste počeli povlačiti.\",\"dragItem\":\"Povucite stavku {itemText}\",\"dragSelectedItems\":\"Povucite {count, plural, one {# odabranu stavku} other {ovoliko odabranih stavki: #}}\",\"dragStartedKeyboard\":\"Počeli ste povlačiti. Pritisnite tipku tabulatora da biste došli do cilja ispuštanja, a zatim Enter da biste ispustili stavku ili Escape da biste prekinuli povlačenje.\",\"dragStartedTouch\":\"Počeli ste povlačiti. Dođite do cilja ispuštanja, a zatim dvaput dodirnite da biste ispustili stavku.\",\"dragStartedVirtual\":\"Počeli ste povlačiti. Dođite do cilja ispuštanja, a zatim kliknite ili pritisnite Enter da biste ispustili stavku.\",\"dropCanceled\":\"Povlačenje je prekinuto.\",\"dropComplete\":\"Ispuštanje je dovršeno.\",\"dropDescriptionKeyboard\":\"Pritisnite Enter da biste ispustili stavku. Pritisnite Escape da biste prekinuli povlačenje.\",\"dropDescriptionTouch\":\"Dvaput dodirnite da biste ispustili stavku.\",\"dropDescriptionVirtual\":\"Kliknite da biste ispustili stavku.\",\"dropIndicator\":\"pokazatelj ispuštanja\",\"dropOnItem\":\"Ispustite na stavku {itemText}\",\"dropOnRoot\":\"Ispustite na\",\"endDragKeyboard\":\"Povlačenje. Pritisnite Enter da biste prekinuli povlačenje.\",\"endDragTouch\":\"Povlačenje. Dvaput dodirnite da biste prekinuli povlačenje.\",\"endDragVirtual\":\"Povlačenje. Kliknite da biste prekinuli povlačenje.\",\"insertAfter\":\"Umetnite iza stavke {itemText}\",\"insertBefore\":\"Ispustite ispred stavke {itemText}\",\"insertBetween\":\"Umetnite između stavki {beforeItemText} i {afterItemText}\"}");
1297
675
 
1298
- if (allowedOperationsBits & $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.link) {
1299
- allowedOperations.push('link');
1300
- }
1301
676
 
1302
- return allowedOperations;
1303
- }
677
+ var $f37e1d1f1c577681$exports = {};
678
+ $f37e1d1f1c577681$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"Nyomja le az Enter billentyűt a húzás megkezdéséhez.\",\"dragDescriptionTouch\":\"Koppintson duplán a húzás megkezdéséhez.\",\"dragDescriptionVirtual\":\"Kattintson a húzás megkezdéséhez.\",\"dragItem\":\"{itemText} húzása\",\"dragSelectedItems\":\"{count, plural, one {# kijelölt elem} other {# kijelölt elem}} húzása\",\"dragStartedKeyboard\":\"Húzás megkezdve. Nyomja le a Tab billentyűt az elengedési célhoz navigálásához, majd nyomja le az Enter billentyűt az elengedéshez, vagy nyomja le az Escape billentyűt a megszakításhoz.\",\"dragStartedTouch\":\"Húzás megkezdve. Navigáljon egy elengedési célhoz, majd koppintson duplán az elengedéshez.\",\"dragStartedVirtual\":\"Húzás megkezdve. Navigáljon egy elengedési célhoz, majd kattintson vagy nyomja le az Enter billentyűt az elengedéshez.\",\"dropCanceled\":\"Elengedés megszakítva.\",\"dropComplete\":\"Elengedés teljesítve.\",\"dropDescriptionKeyboard\":\"Nyomja le az Enter billentyűt az elengedéshez. Nyomja le az Escape billentyűt a húzás megszakításához.\",\"dropDescriptionTouch\":\"Koppintson duplán az elengedéshez.\",\"dropDescriptionVirtual\":\"Kattintson az elengedéshez.\",\"dropIndicator\":\"elengedésjelző\",\"dropOnItem\":\"Elengedés erre: {itemText}\",\"dropOnRoot\":\"Elengedés erre:\",\"endDragKeyboard\":\"Húzás folyamatban. Nyomja le az Enter billentyűt a húzás megszakításához.\",\"endDragTouch\":\"Húzás folyamatban. Koppintson duplán a húzás megszakításához.\",\"endDragVirtual\":\"Húzás folyamatban. Kattintson a húzás megszakításához.\",\"insertAfter\":\"Beszúrás {itemText} után\",\"insertBefore\":\"Beszúrás {itemText} elé\",\"insertBetween\":\"Beszúrás {beforeItemText} és {afterItemText} közé\"}");
1304
679
 
1305
- const $cf2100581419e36b2fe8caccc6dbd4b$var$AUTOSCROLL_AREA_SIZE = 20;
1306
680
 
1307
- function $cf2100581419e36b2fe8caccc6dbd4b$export$useAutoScroll(ref) {
1308
- let scrollableRef = useRef(null);
1309
- useEffect(() => {
1310
- if (ref.current) {
1311
- scrollableRef.current = getScrollParent(ref.current);
1312
- }
1313
- }, [ref]);
1314
- let state = useRef({
1315
- timer: null,
1316
- dx: 0,
1317
- dy: 0
1318
- }).current;
1319
- let scroll = useCallback(() => {
1320
- scrollableRef.current.scrollLeft += state.dx;
1321
- scrollableRef.current.scrollTop += state.dy;
1322
-
1323
- if (state.timer) {
1324
- state.timer = requestAnimationFrame(scroll);
1325
- }
1326
- }, [scrollableRef, state]);
1327
- return {
1328
- move(x, y) {
1329
- // Most browsers auto scroll natively, but WebKit on macOS does not (iOS does 🤷‍♂️).
1330
- // https://bugs.webkit.org/show_bug.cgi?id=222636
1331
- if (!isWebKit() || isIOS() || !scrollableRef.current) {
1332
- return;
1333
- }
681
+ var $57684896b9b64945$exports = {};
682
+ $57684896b9b64945$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"Premi Invio per iniziare a trascinare.\",\"dragDescriptionTouch\":\"Tocca due volte per iniziare a trascinare.\",\"dragDescriptionVirtual\":\"Fai clic per iniziare a trascinare.\",\"dragItem\":\"Trascina {itemText}\",\"dragSelectedItems\":\"Trascina {count, plural, one {# altro elemento selezionato} other {# altri elementi selezionati}}\",\"dragStartedKeyboard\":\"Hai iniziato a trascinare. Premi Tab per arrivare sull’area di destinazione, quindi premi Invio per rilasciare o Esc per annullare.\",\"dragStartedTouch\":\"Hai iniziato a trascinare. Arriva sull’area di destinazione, quindi tocca due volte per rilasciare.\",\"dragStartedVirtual\":\"Hai iniziato a trascinare. Arriva sull’area di destinazione, quindi fai clic o premi Invio per rilasciare.\",\"dropCanceled\":\"Rilascio annullato.\",\"dropComplete\":\"Rilascio completato.\",\"dropDescriptionKeyboard\":\"Premi Invio per rilasciare. Premi Esc per annullare.\",\"dropDescriptionTouch\":\"Tocca due volte per rilasciare.\",\"dropDescriptionVirtual\":\"Fai clic per rilasciare.\",\"dropIndicator\":\"indicatore di rilascio\",\"dropOnItem\":\"Rilascia su {itemText}\",\"dropOnRoot\":\"Rilascia su\",\"endDragKeyboard\":\"Trascinamento. Premi Invio per annullare.\",\"endDragTouch\":\"Trascinamento. Tocca due volte per annullare.\",\"endDragVirtual\":\"Trascinamento. Fai clic per annullare.\",\"insertAfter\":\"Inserisci dopo {itemText}\",\"insertBefore\":\"Inserisci prima di {itemText}\",\"insertBetween\":\"Inserisci tra {beforeItemText} e {afterItemText}\"}");
1334
683
 
1335
- let box = scrollableRef.current.getBoundingClientRect();
1336
- let left = $cf2100581419e36b2fe8caccc6dbd4b$var$AUTOSCROLL_AREA_SIZE;
1337
- let top = $cf2100581419e36b2fe8caccc6dbd4b$var$AUTOSCROLL_AREA_SIZE;
1338
- let bottom = box.height - $cf2100581419e36b2fe8caccc6dbd4b$var$AUTOSCROLL_AREA_SIZE;
1339
- let right = box.width - $cf2100581419e36b2fe8caccc6dbd4b$var$AUTOSCROLL_AREA_SIZE;
1340
-
1341
- if (x < left || x > right || y < top || y > bottom) {
1342
- if (x < left) {
1343
- state.dx = x - left;
1344
- } else if (x > right) {
1345
- state.dx = x - right;
1346
- }
1347
684
 
1348
- if (y < top) {
1349
- state.dy = y - top;
1350
- } else if (y > bottom) {
1351
- state.dy = y - bottom;
1352
- }
685
+ var $124f9b9a50d68f08$exports = {};
686
+ $124f9b9a50d68f08$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"Enter キーを押してドラッグを開始してください。\",\"dragDescriptionTouch\":\"ダブルタップしてドラッグを開始します。\",\"dragDescriptionVirtual\":\"クリックしてドラッグを開始します。\",\"dragItem\":\"{itemText} をドラッグ\",\"dragSelectedItems\":\"{count, plural, one {# 個の選択項目} other {# 個の選択項目}} をドラッグ\",\"dragStartedKeyboard\":\"ドラッグを開始します。Tab キーを押してドロップターゲットにいどうし、Enter キーを押してドロップするか、Esc キーを押してキャンセルします。\",\"dragStartedTouch\":\"ドラッグを開始しました。ドロップのターゲットに移動し、ダブルタップしてドロップします。\",\"dragStartedVirtual\":\"ドラッグを開始しました。ドロップのターゲットに移動し、クリックまたは Enter キーを押してドロップします。\",\"dropCanceled\":\"ドロップがキャンセルされました。\",\"dropComplete\":\"ドロップが完了しました。\",\"dropDescriptionKeyboard\":\"Enter キーを押してドロップします。Esc キーを押してドラッグをキャンセルします。\",\"dropDescriptionTouch\":\"ダブルタップしてドロップします。\",\"dropDescriptionVirtual\":\"クリックしてドロップします。\",\"dropIndicator\":\"ドロップインジケーター\",\"dropOnItem\":\"{itemText} にドロップ\",\"dropOnRoot\":\"ドロップ場所\",\"endDragKeyboard\":\"ドラッグしています。Enter キーを押してドラッグをキャンセルします。\",\"endDragTouch\":\"ドラッグしています。ダブルタップしてドラッグをキャンセルします。\",\"endDragVirtual\":\"ドラッグしています。クリックしてドラッグをキャンセルします。\",\"insertAfter\":\"{itemText} の後に挿入\",\"insertBefore\":\"{itemText} の前に挿入\",\"insertBetween\":\"{beforeItemText} と {afterItemText} の間に挿入\"}");
1353
687
 
1354
- if (!state.timer) {
1355
- state.timer = requestAnimationFrame(scroll);
1356
- }
1357
- } else {
1358
- this.stop();
1359
- }
1360
- },
1361
688
 
1362
- stop() {
1363
- if (state.timer) {
1364
- cancelAnimationFrame(state.timer);
1365
- state.timer = null;
1366
- }
1367
- }
689
+ var $4e7a70c1eb8efae2$exports = {};
690
+ $4e7a70c1eb8efae2$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"드래그를 시작하려면 Enter를 누르세요.\",\"dragDescriptionTouch\":\"드래그를 시작하려면 더블 탭하세요.\",\"dragDescriptionVirtual\":\"드래그를 시작하려면 클릭하세요.\",\"dragItem\":\"{itemText} 드래그\",\"dragSelectedItems\":\"{count, plural, one {#개 선택 항목} other {#개 선택 항목}} 드래그\",\"dragStartedKeyboard\":\"드래그가 시작되었습니다. Tab을 눌러 드롭 대상으로 이동한 다음 Enter를 눌러 드롭하거나 Esc를 눌러 취소하세요.\",\"dragStartedTouch\":\"드래그가 시작되었습니다. 드롭 대상으로 이동한 다음 더블 탭하여 드롭하세요.\",\"dragStartedVirtual\":\"드래그가 시작되었습니다. 드롭 대상으로 이동한 다음 클릭하거나 Enter를 눌러 드롭하세요.\",\"dropCanceled\":\"드롭이 취소되었습니다.\",\"dropComplete\":\"드롭이 완료되었습니다.\",\"dropDescriptionKeyboard\":\"드롭하려면 Enter를 누르세요. 드래그를 취소하려면 Esc를 누르세요.\",\"dropDescriptionTouch\":\"더블 탭하여 드롭하세요.\",\"dropDescriptionVirtual\":\"드롭하려면 클릭하세요.\",\"dropIndicator\":\"드롭 표시기\",\"dropOnItem\":\"{itemText}에 드롭\",\"dropOnRoot\":\"드롭 대상\",\"endDragKeyboard\":\"드래그 중입니다. 드래그를 취소하려면 Enter를 누르세요.\",\"endDragTouch\":\"드래그 중입니다. 드래그를 취소하려면 더블 탭하세요.\",\"endDragVirtual\":\"드래그 중입니다. 드래그를 취소하려면 클릭하세요.\",\"insertAfter\":\"{itemText} 이후에 삽입\",\"insertBefore\":\"{itemText} 이전에 삽입\",\"insertBetween\":\"{beforeItemText} 및 {afterItemText} 사이에 삽입\"}");
1368
691
 
1369
- };
1370
- }
1371
692
 
1372
- const $ab6d833b5804400cb02efc69c9302a$var$DROP_POSITIONS = ['before', 'on', 'after'];
1373
-
1374
- function useDroppableCollection(props, state, ref) {
1375
- let localState = useRef({
1376
- props,
1377
- state,
1378
- nextTarget: null,
1379
- dropOperation: null
1380
- }).current;
1381
- localState.props = props;
1382
- localState.state = state;
1383
- let autoScroll = $cf2100581419e36b2fe8caccc6dbd4b$export$useAutoScroll(ref);
1384
- let {
1385
- dropProps
1386
- } = useDrop({
1387
- ref,
1388
-
1389
- onDropEnter(e) {
1390
- let target = props.getDropTargetFromPoint(e.x, e.y);
1391
- state.setTarget(target);
1392
- },
693
+ var $18a908ad59f24b71$exports = {};
694
+ $18a908ad59f24b71$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"Paspauskite „Enter“, kad pradėtumėte vilkti.\",\"dragDescriptionTouch\":\"Palieskite dukart, kad pradėtumėte vilkti.\",\"dragDescriptionVirtual\":\"Spustelėkite, kad pradėtumėte vilkti.\",\"dragItem\":\"Vilkti {itemText}\",\"dragSelectedItems\":\"Vilkti {count, plural, one {# pasirinktą elementą} other {# pasirinktus elementus}}\",\"dragStartedKeyboard\":\"Pradėta vilkti. Paspauskite „Tab“, kad pereitumėte į tiesioginę paskirties vietą, tada paspauskite „Enter“, kad numestumėte, arba „Escape“, kad atšauktumėte.\",\"dragStartedTouch\":\"Pradėta vilkti. Eikite į tiesioginę paskirties vietą, tada palieskite dukart, kad numestumėte.\",\"dragStartedVirtual\":\"Pradėta vilkti. Eikite į tiesioginę paskirties vietą ir spustelėkite arba paspauskite „Enter“, kad numestumėte.\",\"dropCanceled\":\"Numetimas atšauktas.\",\"dropComplete\":\"Numesta.\",\"dropDescriptionKeyboard\":\"Paspauskite „Enter“, kad numestumėte. Paspauskite „Escape“, kad atšauktumėte vilkimą.\",\"dropDescriptionTouch\":\"Palieskite dukart, kad numestumėte.\",\"dropDescriptionVirtual\":\"Spustelėkite, kad numestumėte.\",\"dropIndicator\":\"numetimo indikatorius\",\"dropOnItem\":\"Numesti ant {itemText}\",\"dropOnRoot\":\"Numesti ant\",\"endDragKeyboard\":\"Velkama. Paspauskite „Enter“, kad atšauktumėte vilkimą.\",\"endDragTouch\":\"Velkama. Spustelėkite dukart, kad atšauktumėte vilkimą.\",\"endDragVirtual\":\"Velkama. Spustelėkite, kad atšauktumėte vilkimą.\",\"insertAfter\":\"Įterpti po {itemText}\",\"insertBefore\":\"Įterpti prieš {itemText}\",\"insertBetween\":\"Įterpti tarp {beforeItemText} ir {afterItemText}\"}");
1393
695
 
1394
- onDropMove(e) {
1395
- state.setTarget(localState.nextTarget);
1396
- autoScroll.move(e.x, e.y);
1397
- },
1398
696
 
1399
- getDropOperationForPoint(types, allowedOperations, x, y) {
1400
- let target = props.getDropTargetFromPoint(x, y);
697
+ var $e9b69ae5de94453e$exports = {};
698
+ $e9b69ae5de94453e$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"Nospiediet Enter, lai sāktu vilkšanu.\",\"dragDescriptionTouch\":\"Veiciet dubultskārienu, lai sāktu vilkšanu.\",\"dragDescriptionVirtual\":\"Noklikšķiniet, lai sāktu vilkšanu.\",\"dragItem\":\"Velciet {itemText}\",\"dragSelectedItems\":\"Velciet {count, plural, one {# atlasīto vienumu} other {# atlasītos vienumus}}\",\"dragStartedKeyboard\":\"Uzsākta vilkšana. Nospiediet taustiņu Tab, lai pārietu uz nomešanas mērķi, pēc tam nospiediet Enter, lai nomestu, vai nospiediet Escape, lai atceltu.\",\"dragStartedTouch\":\"Uzsākta vilkšana. Pārejiet uz nomešanas mērķi, pēc tam veiciet dubultskārienu, lai nomestu.\",\"dragStartedVirtual\":\"Uzsākta vilkšana. Pārejiet uz nomešanas mērķi, pēc tam nospiediet Enter, lai nomestu.\",\"dropCanceled\":\"Nomešana atcelta.\",\"dropComplete\":\"Nomešana pabeigta.\",\"dropDescriptionKeyboard\":\"Nospiediet Enter, lai nomestu. Nospiediet Escape, lai atceltu vilkšanu.\",\"dropDescriptionTouch\":\"Veiciet dubultskārienu, lai nomestu.\",\"dropDescriptionVirtual\":\"Noklikšķiniet, lai nomestu.\",\"dropIndicator\":\"nomešanas indikators\",\"dropOnItem\":\"Nometiet uz {itemText}\",\"dropOnRoot\":\"Nometiet uz\",\"endDragKeyboard\":\"Notiek vilkšana. Nospiediet Enter, lai atceltu vilkšanu.\",\"endDragTouch\":\"Notiek vilkšana. Veiciet dubultskārienu, lai atceltu vilkšanu.\",\"endDragVirtual\":\"Notiek vilkšana. Noklikšķiniet, lai atceltu vilkšanu.\",\"insertAfter\":\"Ievietojiet pēc {itemText}\",\"insertBefore\":\"Ievietojiet pirms {itemText}\",\"insertBetween\":\"Ievietojiet starp {beforeItemText} un {afterItemText}\"}");
1401
699
 
1402
- if (!target) {
1403
- localState.dropOperation = 'cancel';
1404
- localState.nextTarget = null;
1405
- return 'cancel';
1406
- }
1407
700
 
1408
- if (state.isDropTarget(target)) {
1409
- localState.nextTarget = target;
1410
- return localState.dropOperation;
1411
- }
701
+ var $28e302ddfe8a4bf5$exports = {};
702
+ $28e302ddfe8a4bf5$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"Trykk på Enter for å begynne å dra.\",\"dragDescriptionTouch\":\"Dobbelttrykk for å begynne å dra.\",\"dragDescriptionVirtual\":\"Klikk for å begynne å dra.\",\"dragItem\":\"Dra {itemText}\",\"dragSelectedItems\":\"Dra {count, plural, one {# merket element} other {# merkede elementer}}\",\"dragStartedKeyboard\":\"Begynte å dra. Trykk på Tab for å navigere til et mål, og trykk deretter på Enter for å slippe eller på Esc for å avbryte.\",\"dragStartedTouch\":\"Begynte å dra. Naviger til et mål, og dobbelttrykk for å slippe.\",\"dragStartedVirtual\":\"Begynte å dra. Naviger til et mål, og klikk eller trykk på Enter for å slippe.\",\"dropCanceled\":\"Avbrøt slipping.\",\"dropComplete\":\"Slippingen er fullført.\",\"dropDescriptionKeyboard\":\"Trykk på Enter for å slippe. Trykk på Esc hvis du vil avbryte draingen.\",\"dropDescriptionTouch\":\"Dobbelttrykk for å slippe.\",\"dropDescriptionVirtual\":\"Klikk for å slippe.\",\"dropIndicator\":\"slippeindikator\",\"dropOnItem\":\"Slipp på {itemText}\",\"dropOnRoot\":\"Slipp på\",\"endDragKeyboard\":\"Drar. Trykk på Enter hvis du vil avbryte.\",\"endDragTouch\":\"Drar. Dobbelttrykk hvis du vil avbryte.\",\"endDragVirtual\":\"Drar. Klikk hvis du vil avbryte.\",\"insertAfter\":\"Sett inn etter {itemText}\",\"insertBefore\":\"Sett inn før {itemText}\",\"insertBetween\":\"Sett inn mellom {beforeItemText} og {afterItemText}\"}");
1412
703
 
1413
- localState.dropOperation = state.getDropOperation(target, types, allowedOperations); // If the target doesn't accept the drop, see if the root accepts it instead.
1414
704
 
1415
- if (localState.dropOperation === 'cancel') {
1416
- let rootTarget = {
1417
- type: 'root'
1418
- };
1419
- let dropOperation = state.getDropOperation(rootTarget, types, allowedOperations);
705
+ var $8b329d015984c2b2$exports = {};
706
+ $8b329d015984c2b2$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"Druk op Enter om te slepen.\",\"dragDescriptionTouch\":\"Dubbeltik om te slepen.\",\"dragDescriptionVirtual\":\"Klik om met slepen te starten.\",\"dragItem\":\"{itemText} slepen\",\"dragSelectedItems\":\"{count, plural, one {# geselecteerd item} other {# geselecteerde items}} slepen\",\"dragStartedKeyboard\":\"Begonnen met slepen. Druk op Tab om naar een locatie te gaan. Druk dan op Enter om neer te zetten, of op Esc om te annuleren.\",\"dragStartedTouch\":\"Begonnen met slepen. Ga naar de gewenste locatie en dubbeltik om neer te zetten.\",\"dragStartedVirtual\":\"Begonnen met slepen. Ga naar de gewenste locatie en klik of druk op Enter om neer te zetten.\",\"dropCanceled\":\"Neerzetten geannuleerd.\",\"dropComplete\":\"Neerzetten voltooid.\",\"dropDescriptionKeyboard\":\"Druk op Enter om neer te zetten. Druk op Esc om het slepen te annuleren.\",\"dropDescriptionTouch\":\"Dubbeltik om neer te zetten.\",\"dropDescriptionVirtual\":\"Klik om neer te zetten.\",\"dropIndicator\":\"aanwijzer voor neerzetten\",\"dropOnItem\":\"Neerzetten op {itemText}\",\"dropOnRoot\":\"Neerzetten op\",\"endDragKeyboard\":\"Bezig met slepen. Druk op Enter om te annuleren.\",\"endDragTouch\":\"Bezig met slepen. Dubbeltik om te annuleren.\",\"endDragVirtual\":\"Bezig met slepen. Klik om te annuleren.\",\"insertAfter\":\"Plaatsen na {itemText}\",\"insertBefore\":\"Plaatsen vóór {itemText}\",\"insertBetween\":\"Plaatsen tussen {beforeItemText} en {afterItemText}\"}");
1420
707
 
1421
- if (dropOperation !== 'cancel') {
1422
- target = rootTarget;
1423
- localState.dropOperation = dropOperation;
1424
- }
1425
- }
1426
708
 
1427
- localState.nextTarget = localState.dropOperation === 'cancel' ? null : target;
1428
- return localState.dropOperation;
1429
- },
709
+ var $32ac997d901e8006$exports = {};
710
+ $32ac997d901e8006$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"Naciśnij Enter, aby rozpocząć przeciąganie.\",\"dragDescriptionTouch\":\"Dotknij dwukrotnie, aby rozpocząć przeciąganie.\",\"dragDescriptionVirtual\":\"Kliknij, aby rozpocząć przeciąganie.\",\"dragItem\":\"Przeciągnij {itemText}\",\"dragSelectedItems\":\"Przeciągnij {count, plural, one {# wybrany element} other {# wybranych elementów}}\",\"dragStartedKeyboard\":\"Rozpoczęto przeciąganie. Naciśnij Tab, aby wybrać miejsce docelowe, a następnie naciśnij Enter, aby upuścić, lub Escape, aby anulować.\",\"dragStartedTouch\":\"Rozpoczęto przeciąganie. Wybierz miejsce, w którym chcesz upuścić element, a następnie dotknij dwukrotnie, aby upuścić.F\",\"dragStartedVirtual\":\"Rozpoczęto przeciąganie. Wybierz miejsce, w którym chcesz upuścić element, a następnie kliknij lub naciśnij Enter, aby upuścić.\",\"dropCanceled\":\"Anulowano upuszczenie.\",\"dropComplete\":\"Zakończono upuszczanie.\",\"dropDescriptionKeyboard\":\"Naciśnij Enter, aby upuścić. Naciśnij Escape, aby anulować przeciągnięcie.\",\"dropDescriptionTouch\":\"Dotknij dwukrotnie, aby upuścić.\",\"dropDescriptionVirtual\":\"Kliknij, aby upuścić.\",\"dropIndicator\":\"wskaźnik upuszczenia\",\"dropOnItem\":\"Upuść na {itemText}\",\"dropOnRoot\":\"Upuść\",\"endDragKeyboard\":\"Przeciąganie. Naciśnij Enter, aby anulować przeciągnięcie.\",\"endDragTouch\":\"Przeciąganie. Kliknij dwukrotnie, aby anulować przeciągnięcie.\",\"endDragVirtual\":\"Przeciąganie. Kliknij, aby anulować przeciąganie.\",\"insertAfter\":\"Umieść za {itemText}\",\"insertBefore\":\"Umieść przed {itemText}\",\"insertBetween\":\"Umieść między {beforeItemText} i {afterItemText}\"}");
1430
711
 
1431
- onDropExit() {
1432
- state.setTarget(null);
1433
- autoScroll.stop();
1434
- },
1435
712
 
1436
- onDropActivate(e) {
1437
- var _state$target, _state$target2;
713
+ var $980d9cf229cf60df$exports = {};
714
+ $980d9cf229cf60df$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"Pressione Enter para começar a arrastar.\",\"dragDescriptionTouch\":\"Toque duas vezes para começar a arrastar.\",\"dragDescriptionVirtual\":\"Clique para começar a arrastar.\",\"dragItem\":\"Arrastar {itemText}\",\"dragSelectedItems\":\"Arrastar {count, plural, one {# item selecionado} other {# itens selecionados}}\",\"dragStartedKeyboard\":\"Comece a arrastar. Pressione Tab para navegar até um alvo e, em seguida, pressione Enter para soltar ou pressione Escape para cancelar.\",\"dragStartedTouch\":\"Comece a arrastar. Navegue até um alvo e toque duas vezes para soltar.\",\"dragStartedVirtual\":\"Comece a arrastar. Navegue até um alvo e clique ou pressione Enter para soltar.\",\"dropCanceled\":\"Liberação cancelada.\",\"dropComplete\":\"Liberação concluída.\",\"dropDescriptionKeyboard\":\"Pressione Enter para soltar. Pressione Escape para cancelar.\",\"dropDescriptionTouch\":\"Toque duas vezes para soltar.\",\"dropDescriptionVirtual\":\"Clique para soltar.\",\"dropIndicator\":\"indicador de liberação\",\"dropOnItem\":\"Soltar em {itemText}\",\"dropOnRoot\":\"Soltar\",\"endDragKeyboard\":\"Arrastando. Pressione Enter para cancelar.\",\"endDragTouch\":\"Arrastando. Toque duas vezes para cancelar.\",\"endDragVirtual\":\"Arrastando. Clique para cancelar.\",\"insertAfter\":\"Inserir após {itemText}\",\"insertBefore\":\"Inserir antes de {itemText}\",\"insertBetween\":\"Inserir entre {beforeItemText} e {afterItemText}\"}");
1438
715
 
1439
- if (((_state$target = state.target) == null ? void 0 : _state$target.type) === 'item' && ((_state$target2 = state.target) == null ? void 0 : _state$target2.dropPosition) === 'on' && typeof props.onDropActivate === 'function') {
1440
- props.onDropActivate({
1441
- type: 'dropactivate',
1442
- x: e.x,
1443
- // todo
1444
- y: e.y,
1445
- target: state.target
1446
- });
1447
- }
1448
- },
1449
716
 
1450
- onDrop(e) {
1451
- if (state.target && typeof props.onDrop === 'function') {
1452
- props.onDrop({
1453
- type: 'drop',
1454
- x: e.x,
1455
- // todo
1456
- y: e.y,
1457
- target: state.target,
1458
- items: e.items,
1459
- dropOperation: e.dropOperation
1460
- });
1461
- }
1462
- }
717
+ var $429c069033ac65fb$exports = {};
718
+ $429c069033ac65fb$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"Prima Enter para iniciar o arrasto.\",\"dragDescriptionTouch\":\"Faça duplo toque para começar a arrastar.\",\"dragDescriptionVirtual\":\"Clique para iniciar o arrasto.\",\"dragItem\":\"Arrastar {itemText}\",\"dragSelectedItems\":\"Arrastar {count, plural, one {# item selecionado} outro {# itens selecionados}}\",\"dragStartedKeyboard\":\"Arrasto iniciado. Prima a tecla de tabulação para navegar para um destino para largar, e em seguida prima Enter para largar ou prima Escape para cancelar.\",\"dragStartedTouch\":\"Arrasto iniciado. Navegue para um destino para largar, e em seguida faça duplo toque para largar.\",\"dragStartedVirtual\":\"Arrasto iniciado. Navegue para um destino para largar, e em seguida clique ou prima Enter para largar.\",\"dropCanceled\":\"Largar cancelado.\",\"dropComplete\":\"Largar completo.\",\"dropDescriptionKeyboard\":\"Prima Enter para largar. Prima Escape para cancelar o arrasto.\",\"dropDescriptionTouch\":\"Faça duplo toque para largar.\",\"dropDescriptionVirtual\":\"Clique para largar.\",\"dropIndicator\":\"Indicador de largar\",\"dropOnItem\":\"Largar em {itemText}\",\"dropOnRoot\":\"Largar em\",\"endDragKeyboard\":\"A arrastar. Prima Enter para cancelar o arrasto.\",\"endDragTouch\":\"A arrastar. Faça duplo toque para cancelar o arrasto.\",\"endDragVirtual\":\"A arrastar. Clique para cancelar o arrasto.\",\"insertAfter\":\"Inserir depois de {itemText}\",\"insertBefore\":\"Inserir antes de {itemText}\",\"insertBetween\":\"Inserir entre {beforeItemText} e {afterItemText}\"}");
1463
719
 
1464
- });
1465
- useEffect(() => {
1466
- let getNextTarget = function getNextTarget(target, wrap) {
1467
- if (wrap === void 0) {
1468
- wrap = true;
1469
- }
1470
720
 
1471
- if (!target) {
1472
- return {
1473
- type: 'root'
1474
- };
1475
- }
721
+ var $5944d5a872573520$exports = {};
722
+ $5944d5a872573520$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"Apăsați pe Enter pentru a începe glisarea.\",\"dragDescriptionTouch\":\"Atingeți de două ori pentru a începe să glisați.\",\"dragDescriptionVirtual\":\"Faceți clic pentru a începe glisarea.\",\"dragItem\":\"Glisați {itemText}\",\"dragSelectedItems\":\"Glisați {count, plural, one {# element selectat} other {# elemente selectate}}\",\"dragStartedKeyboard\":\"A început glisarea. Apăsați pe Tab pentru a naviga la o țintă de fixare, apoi apăsați pe Enter pentru a fixa sau apăsați pe Escape pentru a anula glisarea.\",\"dragStartedTouch\":\"A început glisarea. Navigați la o țintă de fixare, apoi atingeți de două ori pentru a fixa.\",\"dragStartedVirtual\":\"A început glisarea. Navigați la o țintă de fixare, apoi faceți clic sau apăsați pe Enter pentru a fixa.\",\"dropCanceled\":\"Fixare anulată.\",\"dropComplete\":\"Fixare finalizată.\",\"dropDescriptionKeyboard\":\"Apăsați pe Enter pentru a fixa. Apăsați pe Escape pentru a anula glisarea.\",\"dropDescriptionTouch\":\"Atingeți de două ori pentru a fixa.\",\"dropDescriptionVirtual\":\"Faceți clic pentru a fixa.\",\"dropIndicator\":\"indicator de fixare\",\"dropOnItem\":\"Fixați pe {itemText}\",\"dropOnRoot\":\"Fixare pe\",\"endDragKeyboard\":\"Se glisează. Apăsați pe Enter pentru a anula glisarea.\",\"endDragTouch\":\"Se glisează. Atingeți de două ori pentru a anula glisarea.\",\"endDragVirtual\":\"Se glisează. Faceți clic pentru a anula glisarea.\",\"insertAfter\":\"Inserați după {itemText}\",\"insertBefore\":\"Inserați înainte de {itemText}\",\"insertBetween\":\"Inserați între {beforeItemText} și {afterItemText}\"}");
1476
723
 
1477
- let {
1478
- keyboardDelegate
1479
- } = localState.props;
1480
- let nextKey = target.type === 'item' ? keyboardDelegate.getKeyBelow(target.key) : keyboardDelegate.getFirstKey();
1481
-
1482
- if (target.type === 'item') {
1483
- let positionIndex = $ab6d833b5804400cb02efc69c9302a$var$DROP_POSITIONS.indexOf(target.dropPosition);
1484
- let nextDropPosition = $ab6d833b5804400cb02efc69c9302a$var$DROP_POSITIONS[positionIndex + 1];
1485
-
1486
- if (positionIndex < $ab6d833b5804400cb02efc69c9302a$var$DROP_POSITIONS.length - 1 && !(nextDropPosition === 'after' && nextKey != null)) {
1487
- return {
1488
- type: 'item',
1489
- key: target.key,
1490
- dropPosition: nextDropPosition
1491
- };
1492
- }
1493
- }
1494
724
 
1495
- if (nextKey == null) {
1496
- if (wrap) {
1497
- return {
1498
- type: 'root'
1499
- };
1500
- }
725
+ var $5bd34815177e0598$exports = {};
726
+ $5bd34815177e0598$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"Нажмите клавишу Enter для начала перетаскивания.\",\"dragDescriptionTouch\":\"Дважды нажмите для начала перетаскивания.\",\"dragDescriptionVirtual\":\"Щелкните для начала перетаскивания.\",\"dragItem\":\"Перетащить {itemText}\",\"dragSelectedItems\":\"Перетащить {count, plural, one {# выбранный элемент} other {# выбранных элем}}\",\"dragStartedKeyboard\":\"Начато перетаскивание. Нажмите клавишу Tab для выбора цели, затем нажмите клавишу Enter, чтобы применить перетаскивание, или клавишу Escape для отмены действия.\",\"dragStartedTouch\":\"Начато перетаскивание. Выберите цель, затем дважды нажмите, чтобы применить перетаскивание.\",\"dragStartedVirtual\":\"Начато перетаскивание. Нажмите клавишу Tab для выбора цели, затем нажмите клавишу Enter, чтобы применить перетаскивание.\",\"dropCanceled\":\"Перетаскивание отменено.\",\"dropComplete\":\"Перетаскивание завершено.\",\"dropDescriptionKeyboard\":\"Нажмите клавишу Enter, чтобы применить перетаскивание. Нажмите клавишу Escape для отмены.\",\"dropDescriptionTouch\":\"Дважды нажмите, чтобы применить перетаскивание.\",\"dropDescriptionVirtual\":\"Щелкните, чтобы применить перетаскивание.\",\"dropIndicator\":\"индикатор перетаскивания\",\"dropOnItem\":\"Перетащить на {itemText}\",\"dropOnRoot\":\"Перетащить на\",\"endDragKeyboard\":\"Перетаскивание. Нажмите клавишу Enter для отмены.\",\"endDragTouch\":\"Перетаскивание. Дважды нажмите для отмены.\",\"endDragVirtual\":\"Перетаскивание. Щелкните для отмены.\",\"insertAfter\":\"Вставить после {itemText}\",\"insertBefore\":\"Вставить перед {itemText}\",\"insertBetween\":\"Вставить между {beforeItemText} и {afterItemText}\"}");
1501
727
 
1502
- return null;
1503
- }
1504
728
 
1505
- return {
1506
- type: 'item',
1507
- key: nextKey,
1508
- dropPosition: $ab6d833b5804400cb02efc69c9302a$var$DROP_POSITIONS[0]
1509
- };
1510
- };
729
+ var $fd4fe85d82ae4b8e$exports = {};
730
+ $fd4fe85d82ae4b8e$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"Stlačením klávesu Enter začnete presúvanie.\",\"dragDescriptionTouch\":\"Dvojitým kliknutím začnete presúvanie.\",\"dragDescriptionVirtual\":\"Kliknutím začnete presúvanie.\",\"dragItem\":\"Presunúť položku {itemText}\",\"dragSelectedItems\":\"Presunúť {count, plural, one {# vybratú položku} other {# vybraté položky}}\",\"dragStartedKeyboard\":\"Presúvanie sa začalo. Do cieľového umiestnenia prejdete stlačením klávesu Tab. Ak chcete položku umiestniť, stlačte kláves Enter alebo stlačte kláves Esc, ak chcete presúvanie zrušiť.\",\"dragStartedTouch\":\"Presúvanie sa začalo. Prejdite na cieľové umiestnenie a dvojitým kliknutím umiestnite položku.\",\"dragStartedVirtual\":\"Presúvanie sa začalo. Prejdite na cieľové umiestnenie a kliknutím alebo stlačením klávesu Enter umiestnite položku.\",\"dropCanceled\":\"Umiestnenie zrušené.\",\"dropComplete\":\"Umiestnenie dokončené.\",\"dropDescriptionKeyboard\":\"Stlačením klávesu Enter umiestnite položku. Stlačením klávesu Esc zrušíte presúvanie.\",\"dropDescriptionTouch\":\"Dvojitým kliknutím umiestnite položku.\",\"dropDescriptionVirtual\":\"Kliknutím umiestnite položku.\",\"dropIndicator\":\"indikátor umiestnenia\",\"dropOnItem\":\"Umiestniť na položku {itemText}\",\"dropOnRoot\":\"Umiestniť na\",\"endDragKeyboard\":\"Prebieha presúvanie. Ak ho chcete zrušiť, stlačte kláves Enter.\",\"endDragTouch\":\"Prebieha presúvanie. Dvojitým kliknutím ho môžete zrušiť.\",\"endDragVirtual\":\"Prebieha presúvanie.\",\"insertAfter\":\"Vložiť za položku {itemText}\",\"insertBefore\":\"Vložiť pred položku {itemText}\",\"insertBetween\":\"Vložiť medzi položky {beforeItemText} a {afterItemText}\"}");
1511
731
 
1512
- let getPreviousTarget = function getPreviousTarget(target, wrap) {
1513
- if (wrap === void 0) {
1514
- wrap = true;
1515
- }
1516
732
 
1517
- let {
1518
- keyboardDelegate
1519
- } = localState.props;
1520
- let nextKey = (target == null ? void 0 : target.type) === 'item' ? keyboardDelegate.getKeyAbove(target.key) : keyboardDelegate.getLastKey();
1521
-
1522
- if ((target == null ? void 0 : target.type) === 'item') {
1523
- let positionIndex = $ab6d833b5804400cb02efc69c9302a$var$DROP_POSITIONS.indexOf(target.dropPosition);
1524
- let nextDropPosition = $ab6d833b5804400cb02efc69c9302a$var$DROP_POSITIONS[positionIndex - 1];
1525
-
1526
- if (positionIndex > 0 && nextDropPosition !== 'after') {
1527
- return {
1528
- type: 'item',
1529
- key: target.key,
1530
- dropPosition: nextDropPosition
1531
- };
1532
- }
1533
- }
733
+ var $165d6bd72ce97cf9$exports = {};
734
+ $165d6bd72ce97cf9$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"Pritisnite tipko Enter za začetek vlečenja.\",\"dragDescriptionTouch\":\"Dvotapnite za začetek vlečenja.\",\"dragDescriptionVirtual\":\"Kliknite za začetek vlečenja.\",\"dragItem\":\"Povleci {itemText}\",\"dragSelectedItems\":\"Povlecite {count, plural, one {# izbran element} other {izbrane elemente (#)}}\",\"dragStartedKeyboard\":\"Vlečenje se je začelo. Pritisnite tipko Tab za pomik na mesto, kamor želite spustiti elemente, in pritisnite tipko Enter, da jih spustite, ali tipko Escape, da prekličete postopek.\",\"dragStartedTouch\":\"Vlečenje se je začelo. Pomaknite se na mesto, kamor želite spustiti elemente, in dvotapnite, da jih spustite.\",\"dragStartedVirtual\":\"Vlečenje se je začelo. Pomaknite se na mesto, kamor želite spustiti elemente, in kliknite ali pritisnite tipko Enter, da jih spustite.\",\"dropCanceled\":\"Spust je preklican.\",\"dropComplete\":\"Spust je končan.\",\"dropDescriptionKeyboard\":\"Pritisnite tipko Enter, da spustite. Pritisnite tipko Escape, da prekličete vlečenje.\",\"dropDescriptionTouch\":\"Dvotapnite, da spustite.\",\"dropDescriptionVirtual\":\"Kliknite, da spustite.\",\"dropIndicator\":\"indikator spusta\",\"dropOnItem\":\"Spusti na mesto {itemText}\",\"dropOnRoot\":\"Spusti na mesto\",\"endDragKeyboard\":\"Vlečenje. Pritisnite tipko Enter za preklic vlečenja.\",\"endDragTouch\":\"Vlečenje. Dvotapnite za preklic vlečenja.\",\"endDragVirtual\":\"Vlečenje. Kliknite, da prekličete vlečenje.\",\"insertAfter\":\"Vstavi za {itemText}\",\"insertBefore\":\"Vstavi pred {itemText}\",\"insertBetween\":\"Vstavi med {beforeItemText} in {afterItemText}\"}");
1534
735
 
1535
- if (nextKey == null) {
1536
- if (wrap) {
1537
- return {
1538
- type: 'root'
1539
- };
1540
- }
1541
736
 
1542
- return null;
1543
- }
737
+ var $dc9b5237d38f3817$exports = {};
738
+ $dc9b5237d38f3817$exports = JSON.parse("{\"dragItem\":\"Prevucite {itemText}\",\"dragSelectedItems\":\"Prevucite {count, plural, one {# izabranu stavku} other {# izabrane stavke}}\",\"dragDescriptionKeyboard\":\"Pritisnite Enter da biste započeli prevlačenje..\",\"dragDescriptionTouch\":\"Dvaput dodirnite za otpuštanje.\",\"dragDescriptionVirtual\":\"Kliknite da biste započeli prevlačenje.\",\"dragStartedKeyboard\":\"Prevlačenje je započeto. Pritisnite Tab da biste otišli do cilja za otpuštanje, zatim pritisnite Enter za ispuštanje ili pritisnite Escape za otkazivanje.\",\"dragStartedTouch\":\"Prevlačenje je započeto. Idite do cilja za otpuštanje, a zatim dvaput dodirnite za otpuštanje.\",\"dragStartedVirtual\":\"Prevlačenje je započeto. Idite do cilja za otpuštanje, a zatim kliknite ili pritinite Enter za otpuštanje.\",\"endDragKeyboard\":\"Prevlačenje u toku. Pritisnite Enter da biste otkazali prevlačenje.\",\"endDragTouch\":\"Prevlačenje u toku. Dvaput dodirnite da biste otkazali prevlačenje.\",\"endDragVirtual\":\"Prevlačenje u toku. Kliknite da biste otkazali prevlačenje.\",\"dropDescriptionKeyboard\":\"Pritisnite Enter da biste otpustili. Pritisnite Escape da biste otkazali prevlačenje.\",\"dropDescriptionTouch\":\"Dvaput dodirnite za otpuštanje.\",\"dropDescriptionVirtual\":\"Kliknite za otpuštanje.\",\"dropCanceled\":\"Otpuštanje je otkazano.\",\"dropComplete\":\"Prevlačenje je završeno.\",\"dropIndicator\":\"Indikator otpuštanja\",\"dropOnRoot\":\"Otpusti na\",\"dropOnItem\":\"Otpusti na {itemText}\",\"insertBefore\":\"Umetnite ispred {itemText}\",\"insertBetween\":\"Umetnite između {beforeItemText} i {afterItemText}\",\"insertAfter\":\"Umetnite posle {itemText}\"}");
1544
739
 
1545
- return {
1546
- type: 'item',
1547
- key: nextKey,
1548
- dropPosition: !target || target.type === 'root' ? 'after' : 'on'
1549
- };
1550
- };
1551
740
 
1552
- let nextValidTarget = function nextValidTarget(target, types, allowedDropOperations, getNextTarget, wrap) {
1553
- if (wrap === void 0) {
1554
- wrap = true;
1555
- }
741
+ var $fc3016bdba8283ce$exports = {};
742
+ $fc3016bdba8283ce$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"Tryck enter för att börja dra.\",\"dragDescriptionTouch\":\"Dubbeltryck för att börja dra.\",\"dragDescriptionVirtual\":\"Klicka för att börja dra.\",\"dragItem\":\"Dra {itemText}\",\"dragSelectedItems\":\"Dra {count, plural, one {# valt objekt} other {# valda objekt}}\",\"dragStartedKeyboard\":\"Börja dra. Tryck på tabb för att navigera till målet, tryck på enter för att släppa eller på escape för att avbryta.\",\"dragStartedTouch\":\"Börja dra. Navigera till ett mål och dubbeltryck för att släppa.\",\"dragStartedVirtual\":\"Börja dra. Navigera till ett mål och klicka eller tryck på enter för att släppa.\",\"dropCanceled\":\"Släppåtgärd avbröts.\",\"dropComplete\":\"Släppåtgärd klar.\",\"dropDescriptionKeyboard\":\"Tryck på enter för att släppa. Tryck på escape för att avbryta dragåtgärd.\",\"dropDescriptionTouch\":\"Dubbeltryck för att släppa.\",\"dropDescriptionVirtual\":\"Klicka för att släppa.\",\"dropIndicator\":\"släppindikator\",\"dropOnItem\":\"Släpp på {itemText}\",\"dropOnRoot\":\"Släpp på\",\"endDragKeyboard\":\"Drar. Tryck på enter för att avbryta dragåtgärd.\",\"endDragTouch\":\"Drar. Dubbeltryck för att avbryta dragåtgärd.\",\"endDragVirtual\":\"Drar. Klicka för att avbryta dragåtgärd.\",\"insertAfter\":\"Infoga efter {itemText}\",\"insertBefore\":\"Infoga före {itemText}\",\"insertBetween\":\"Infoga mellan {beforeItemText} och {afterItemText}\"}");
1556
743
 
1557
- let seenRoot = 0;
1558
- let operation;
1559
744
 
1560
- do {
1561
- let nextTarget = getNextTarget(target, wrap);
745
+ var $359db1fb988d3e0a$exports = {};
746
+ $359db1fb988d3e0a$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"Sürüklemeyi başlatmak için Enter'a basın.\",\"dragDescriptionTouch\":\"Sürüklemeyi başlatmak için çift tıklayın.\",\"dragDescriptionVirtual\":\"Sürüklemeyi başlatmak için tıklayın.\",\"dragItem\":\"{itemText}’i sürükle\",\"dragSelectedItems\":\"Sürükle {count, plural, one {# seçili öge} other {# seçili öge}}\",\"dragStartedKeyboard\":\"Sürükleme başlatıldı. Bir bırakma hedefine gitmek için Tab’a basın, ardından bırakmak için Enter’a basın veya iptal etmek için Escape’e basın.\",\"dragStartedTouch\":\"Sürükleme başlatıldı. Bir bırakma hedefine gidin, ardından bırakmak için çift tıklayın.\",\"dragStartedVirtual\":\"Sürükleme başlatıldı. Bir bırakma hedefine gidin, ardından bırakmak için Enter’a tıklayın veya basın.\",\"dropCanceled\":\"Bırakma iptal edildi.\",\"dropComplete\":\"Bırakma tamamlandı.\",\"dropDescriptionKeyboard\":\"Bırakmak için Enter'a basın. Sürüklemeyi iptal etmek için Escape'e basın.\",\"dropDescriptionTouch\":\"Bırakmak için çift tıklayın.\",\"dropDescriptionVirtual\":\"Bırakmak için tıklayın.\",\"dropIndicator\":\"bırakma göstergesi\",\"dropOnItem\":\"{itemText} üzerine bırak\",\"dropOnRoot\":\"Bırakın\",\"endDragKeyboard\":\"Sürükleme. Sürüklemeyi iptal etmek için Enter'a basın.\",\"endDragTouch\":\"Sürükleme. Sürüklemeyi iptal etmek için çift tıklayın.\",\"endDragVirtual\":\"Sürükleme. Sürüklemeyi iptal etmek için tıklayın.\",\"insertAfter\":\"{itemText}’den sonra gir\",\"insertBefore\":\"{itemText}’den önce gir\",\"insertBetween\":\"{beforeItemText} ve {afterItemText} arasına gir\"}");
1562
747
 
1563
- if (!nextTarget) {
1564
- return null;
1565
- }
1566
748
 
1567
- target = nextTarget;
1568
- operation = localState.state.getDropOperation(nextTarget, types, allowedDropOperations);
749
+ var $231565b2fb81d522$exports = {};
750
+ $231565b2fb81d522$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"Натисніть Enter, щоб почати перетягування.\",\"dragDescriptionTouch\":\"Натисніть двічі, щоб почати перетягування.\",\"dragDescriptionVirtual\":\"Натисніть, щоб почати перетягування.\",\"dragItem\":\"Перетягнути {itemText}\",\"dragSelectedItems\":\"Перетягніть {count, plural, one {# вибраний елемент} other {# вибраних елем}}\",\"dragStartedKeyboard\":\"Перетягування почалося. Натисніть Tab, щоб перейти до цілі перетягування, потім натисніть Enter, щоб перетягнути, або Escape, щоб скасувати.\",\"dragStartedTouch\":\"Перетягування почалося. Перейдіть до цілі перетягування, потім натисніть двічі, щоб перетягнути.\",\"dragStartedVirtual\":\"Перетягування почалося. Перейдіть до цілі перетягування, потім натисніть Enter, щоб перетягнути.\",\"dropCanceled\":\"Перетягування скасовано.\",\"dropComplete\":\"Перетягування завершено.\",\"dropDescriptionKeyboard\":\"Натисніть Enter, щоб перетягнути. Натисніть Escape, щоб скасувати перетягування.\",\"dropDescriptionTouch\":\"Натисніть двічі, щоб перетягнути.\",\"dropDescriptionVirtual\":\"Натисніть, щоб перетягнути.\",\"dropIndicator\":\"індикатор перетягування\",\"dropOnItem\":\"Перетягнути на {itemText}\",\"dropOnRoot\":\"Перетягнути на\",\"endDragKeyboard\":\"Триває перетягування. Натисніть Enter, щоб скасувати перетягування.\",\"endDragTouch\":\"Триває перетягування. Натисніть двічі, щоб скасувати перетягування.\",\"endDragVirtual\":\"Триває перетягування. Натисніть, щоб скасувати перетягування.\",\"insertAfter\":\"Вставити після {itemText}\",\"insertBefore\":\"Вставити перед {itemText}\",\"insertBetween\":\"Вставити між {beforeItemText} і {afterItemText}\"}");
1569
751
 
1570
- if (target.type === 'root') {
1571
- seenRoot++;
1572
- }
1573
- } while (target && operation === 'cancel' && !localState.state.isDropTarget(target) && seenRoot < 2);
1574
752
 
1575
- if (operation === 'cancel') {
1576
- return null;
1577
- }
753
+ var $9b078ce55391bbf3$exports = {};
754
+ $9b078ce55391bbf3$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"按 Enter 开始拖动。\",\"dragDescriptionTouch\":\"双击开始拖动。\",\"dragDescriptionVirtual\":\"单击开始拖动。\",\"dragItem\":\"拖动 {itemText}\",\"dragSelectedItems\":\"拖动 {count, plural, one {# 选中项目} other {# 选中项目}}\",\"dragStartedKeyboard\":\"已开始拖动。按 Tab 导航到放置目标,然后按 Enter 放置或按 Escape 取消。\",\"dragStartedTouch\":\"已开始拖动。导航到放置目标,然后双击放置。\",\"dragStartedVirtual\":\"已开始拖动。导航到放置目标,然后单击或按 Enter 放置。\",\"dropCanceled\":\"放置已取消。\",\"dropComplete\":\"放置已完成。\",\"dropDescriptionKeyboard\":\"按 Enter 放置。按 Escape 取消拖动。\",\"dropDescriptionTouch\":\"双击放置。\",\"dropDescriptionVirtual\":\"单击放置。\",\"dropIndicator\":\"放置标记\",\"dropOnItem\":\"放置于 {itemText}\",\"dropOnRoot\":\"放置于\",\"endDragKeyboard\":\"正在拖动。按 Enter 取消拖动。\",\"endDragTouch\":\"正在拖动。双击取消拖动。\",\"endDragVirtual\":\"正在拖动。单击取消拖动。\",\"insertAfter\":\"插入到 {itemText} 之后\",\"insertBefore\":\"插入到 {itemText} 之前\",\"insertBetween\":\"插入到 {beforeItemText} 和 {afterItemText} 之间\"}");
1578
755
 
1579
- return target;
1580
- };
1581
756
 
1582
- return $a75d092e5c30878812fba78e$export$registerDropTarget({
1583
- element: ref.current,
757
+ var $94eee9f9dd033f7e$exports = {};
758
+ $94eee9f9dd033f7e$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"按 Enter 鍵以開始拖曳。\",\"dragDescriptionTouch\":\"輕點兩下以開始拖曳。\",\"dragDescriptionVirtual\":\"按一下滑鼠以開始拖曳。\",\"dragItem\":\"拖曳「{itemText}」\",\"dragSelectedItems\":\"拖曳 {count, plural, one {# 個選定項目} other {# 個選定項目}}\",\"dragStartedKeyboard\":\"已開始拖曳。按 Tab 鍵以瀏覽至放置目標,然後按 Enter 鍵以放置,或按 Escape 鍵以取消。\",\"dragStartedTouch\":\"已開始拖曳。瀏覽至放置目標,然後輕點兩下以放置。\",\"dragStartedVirtual\":\"已開始拖曳。瀏覽至放置目標,然後按一下滑鼠或按 Enter 鍵以放置。\",\"dropCanceled\":\"放置已取消。\",\"dropComplete\":\"放置已完成。\",\"dropDescriptionKeyboard\":\"按 Enter 鍵以放置。按 Escape 鍵以取消拖曳。\",\"dropDescriptionTouch\":\"輕點兩下以放置。\",\"dropDescriptionVirtual\":\"按一下滑鼠以放置。\",\"dropIndicator\":\"放置指示器\",\"dropOnItem\":\"放置在「{itemText}」上\",\"dropOnRoot\":\"放置在\",\"endDragKeyboard\":\"拖曳中。按 Enter 鍵以取消拖曳。\",\"endDragTouch\":\"拖曳中。輕點兩下以取消拖曳。\",\"endDragVirtual\":\"拖曳中。按一下滑鼠以取消拖曳。\",\"insertAfter\":\"插入至「{itemText}」之後\",\"insertBefore\":\"插入至「{itemText}」之前\",\"insertBetween\":\"插入至「{beforeItemText}」和「{afterItemText}」之間\"}");
1584
759
 
1585
- getDropOperation(types, allowedOperations) {
1586
- if (localState.state.target) {
1587
- return localState.state.getDropOperation(localState.state.target, types, allowedOperations);
1588
- } // Check if any of the targets accept the drop.
1589
- // TODO: should we have a faster way of doing this or e.g. for pagination?
1590
760
 
761
+ $a0e2171154b8c4fe$exports = {
762
+ "ar-AE": $e1076e638f72e513$exports,
763
+ "bg-BG": $5247825c4c521ecd$exports,
764
+ "cs-CZ": $679c7987be73b33a$exports,
765
+ "da-DK": $1c6be209d930911d$exports,
766
+ "de-DE": $0c5c28ae829fbcc5$exports,
767
+ "el-GR": $362719e545ebbe59$exports,
768
+ "en-US": $bf5ca542ddbd7e1e$exports,
769
+ "es-ES": $249f7c6f2b021a36$exports,
770
+ "et-EE": $a306aec76fcd0c95$exports,
771
+ "fi-FI": $6eb0560f4ff183ff$exports,
772
+ "fr-FR": $a9309d69baecc54a$exports,
773
+ "he-IL": $c306e39910a4b3d3$exports,
774
+ "hr-HR": $383c29c6b563fed3$exports,
775
+ "hu-HU": $f37e1d1f1c577681$exports,
776
+ "it-IT": $57684896b9b64945$exports,
777
+ "ja-JP": $124f9b9a50d68f08$exports,
778
+ "ko-KR": $4e7a70c1eb8efae2$exports,
779
+ "lt-LT": $18a908ad59f24b71$exports,
780
+ "lv-LV": $e9b69ae5de94453e$exports,
781
+ "nb-NO": $28e302ddfe8a4bf5$exports,
782
+ "nl-NL": $8b329d015984c2b2$exports,
783
+ "pl-PL": $32ac997d901e8006$exports,
784
+ "pt-BR": $980d9cf229cf60df$exports,
785
+ "pt-PT": $429c069033ac65fb$exports,
786
+ "ro-RO": $5944d5a872573520$exports,
787
+ "ru-RU": $5bd34815177e0598$exports,
788
+ "sk-SK": $fd4fe85d82ae4b8e$exports,
789
+ "sl-SI": $165d6bd72ce97cf9$exports,
790
+ "sr-SP": $dc9b5237d38f3817$exports,
791
+ "sv-SE": $fc3016bdba8283ce$exports,
792
+ "tr-TR": $359db1fb988d3e0a$exports,
793
+ "uk-UA": $231565b2fb81d522$exports,
794
+ "zh-CN": $9b078ce55391bbf3$exports,
795
+ "zh-TW": $94eee9f9dd033f7e$exports
796
+ };
1591
797
 
1592
- let target = nextValidTarget(null, types, allowedOperations, getNextTarget);
1593
- return target ? 'move' : 'cancel';
1594
- },
1595
798
 
1596
- onDropEnter(e, drag) {
1597
- let types = $bc29619458500c186021634c18dc$export$getTypes(drag.items);
1598
- let target = nextValidTarget(null, types, drag.allowedDropOperations, getNextTarget);
1599
- localState.state.setTarget(target);
1600
- },
1601
799
 
1602
- onDropExit() {
1603
- localState.state.setTarget(null);
1604
- },
1605
800
 
1606
- onDropTargetEnter(target) {
1607
- localState.state.setTarget(target);
1608
- },
1609
801
 
1610
- onDropActivate(e) {
1611
- var _localState$state$tar, _localState$state$tar2;
1612
802
 
1613
- if (((_localState$state$tar = localState.state.target) == null ? void 0 : _localState$state$tar.type) === 'item' && ((_localState$state$tar2 = localState.state.target) == null ? void 0 : _localState$state$tar2.dropPosition) === 'on' && typeof localState.props.onDropActivate === 'function') {
1614
- localState.props.onDropActivate({
1615
- type: 'dropactivate',
1616
- x: e.x,
1617
- // todo
1618
- y: e.y,
1619
- target: localState.state.target
1620
- });
1621
- }
1622
- },
1623
803
 
1624
- onDrop(e, target) {
1625
- if (localState.state.target && typeof localState.props.onDrop === 'function') {
1626
- localState.props.onDrop({
1627
- type: 'drop',
1628
- x: e.x,
1629
- // todo
1630
- y: e.y,
1631
- target: target || localState.state.target,
1632
- items: e.items,
1633
- dropOperation: e.dropOperation
1634
- });
804
+ const $d067e40b40cb0a24$var$MESSAGES = {
805
+ keyboard: {
806
+ start: 'dragDescriptionKeyboard',
807
+ end: 'endDragKeyboard'
808
+ },
809
+ touch: {
810
+ start: 'dragDescriptionTouch',
811
+ end: 'endDragTouch'
812
+ },
813
+ virtual: {
814
+ start: 'dragDescriptionVirtual',
815
+ end: 'endDragVirtual'
816
+ }
817
+ };
818
+ function $d067e40b40cb0a24$export$7941f8aafa4b6021(options) {
819
+ let formatMessage = $4on3C$reactariai18n.useMessageFormatter((/*@__PURE__*/$parcel$interopDefault($a0e2171154b8c4fe$exports)));
820
+ let state = $4on3C$react.useRef({
821
+ options: options,
822
+ x: 0,
823
+ y: 0
824
+ }).current;
825
+ state.options = options;
826
+ let [isDragging, setDragging] = $4on3C$react.useState(false);
827
+ let onDragStart = (e)=>{
828
+ let items = options.getItems();
829
+ $c1cba3854dc3a167$export$f9c1490890ddd063(e.dataTransfer, items);
830
+ if (typeof options.getAllowedDropOperations === 'function') {
831
+ let allowedOperations = options.getAllowedDropOperations();
832
+ let allowed = $8e4046ff5ec007bd$export$60b7b4bcf3903d8e.none;
833
+ for (let operation of allowedOperations)allowed |= $8e4046ff5ec007bd$export$60b7b4bcf3903d8e[operation] || $8e4046ff5ec007bd$export$60b7b4bcf3903d8e.none;
834
+ e.dataTransfer.effectAllowed = $8e4046ff5ec007bd$export$dd0165308d8bff45[allowed] || 'none';
1635
835
  }
1636
- },
1637
-
1638
- onKeyDown(e, drag) {
1639
- let {
1640
- keyboardDelegate
1641
- } = localState.props;
1642
- let types = $bc29619458500c186021634c18dc$export$getTypes(drag.items);
1643
-
1644
- switch (e.key) {
1645
- case 'ArrowDown':
1646
- {
1647
- if (keyboardDelegate.getKeyBelow) {
1648
- let target = nextValidTarget(localState.state.target, types, drag.allowedDropOperations, getNextTarget);
1649
- localState.state.setTarget(target);
1650
- }
1651
-
1652
- break;
836
+ // If there is a renderPreview function, use it to render a custom preview image that will
837
+ // appear under the pointer while dragging. If not, the element itself is dragged by the browser.
838
+ if (typeof options.renderPreview === 'function') {
839
+ let preview = options.renderPreview(items);
840
+ if (preview) {
841
+ // Create an off-screen div to render the preview into.
842
+ let node = document.createElement('div');
843
+ node.style.zIndex = '-100';
844
+ node.style.position = 'absolute';
845
+ node.style.top = '0';
846
+ node.style.left = '-100000px';
847
+ document.body.appendChild(node);
848
+ // Call renderPreview to get a JSX element, and render it into the div with React DOM.
849
+ ($parcel$interopDefault($4on3C$reactdom)).render(preview, node);
850
+ // Compute the offset that the preview will appear under the mouse.
851
+ // If possible, this is based on the point the user clicked on the target.
852
+ // If the preview is much smaller, then just use the center point of the preview.
853
+ let size = node.getBoundingClientRect();
854
+ let rect = e.currentTarget.getBoundingClientRect();
855
+ let x = e.clientX - rect.x;
856
+ let y = e.clientY - rect.y;
857
+ if (x > size.width || y > size.height) {
858
+ x = size.width / 2;
859
+ y = size.height / 2;
860
+ }
861
+ e.dataTransfer.setDragImage(node, x, y);
862
+ // Remove the preview from the DOM after a frame so the browser has time to paint.
863
+ requestAnimationFrame(()=>{
864
+ document.body.removeChild(node);
865
+ });
1653
866
  }
1654
-
1655
- case 'ArrowUp':
1656
- {
1657
- if (keyboardDelegate.getKeyAbove) {
1658
- let target = nextValidTarget(localState.state.target, types, drag.allowedDropOperations, getPreviousTarget);
1659
- localState.state.setTarget(target);
1660
- }
1661
-
1662
- break;
867
+ }
868
+ if (typeof options.onDragStart === 'function') options.onDragStart({
869
+ type: 'dragstart',
870
+ x: e.clientX,
871
+ y: e.clientY
872
+ });
873
+ state.x = e.clientX;
874
+ state.y = e.clientY;
875
+ // Wait a frame before we set dragging to true so that the browser has time to
876
+ // render the preview image before we update the element that has been dragged.
877
+ requestAnimationFrame(()=>{
878
+ setDragging(true);
879
+ });
880
+ };
881
+ let onDrag = (e)=>{
882
+ if (e.clientX === state.x && e.clientY === state.y) return;
883
+ if (typeof options.onDragMove === 'function') options.onDragMove({
884
+ type: 'dragmove',
885
+ x: e.clientX,
886
+ y: e.clientY
887
+ });
888
+ state.x = e.clientX;
889
+ state.y = e.clientY;
890
+ };
891
+ let onDragEnd = (e)=>{
892
+ if (typeof options.onDragEnd === 'function') options.onDragEnd({
893
+ type: 'dragend',
894
+ x: e.clientX,
895
+ y: e.clientY,
896
+ dropOperation: $8e4046ff5ec007bd$export$608ecc6f1b23c35d[e.dataTransfer.dropEffect]
897
+ });
898
+ setDragging(false);
899
+ };
900
+ let onPress = (e1)=>{
901
+ if (e1.pointerType !== 'keyboard' && e1.pointerType !== 'virtual') return;
902
+ if (typeof state.options.onDragStart === 'function') {
903
+ let rect = e1.target.getBoundingClientRect();
904
+ state.options.onDragStart({
905
+ type: 'dragstart',
906
+ x: rect.x + rect.width / 2,
907
+ y: rect.y + rect.height / 2
908
+ });
909
+ }
910
+ $d69e2bc1de15721f$export$549dbcf8649bf3b2({
911
+ element: e1.target,
912
+ items: state.options.getItems(),
913
+ allowedDropOperations: typeof state.options.getAllowedDropOperations === 'function' ? state.options.getAllowedDropOperations() : [
914
+ 'move',
915
+ 'copy',
916
+ 'link'
917
+ ],
918
+ onDragEnd (e) {
919
+ setDragging(false);
920
+ if (typeof state.options.onDragEnd === 'function') state.options.onDragEnd(e);
1663
921
  }
922
+ }, formatMessage);
923
+ setDragging(true);
924
+ };
925
+ let modality = $c1cba3854dc3a167$export$49bac5d6d4b352ea();
926
+ let descriptionProps = $4on3C$reactariautils.useDescription(formatMessage(!isDragging ? $d067e40b40cb0a24$var$MESSAGES[modality].start : $d067e40b40cb0a24$var$MESSAGES[modality].end));
927
+ return {
928
+ dragProps: {
929
+ draggable: 'true',
930
+ onDragStart: onDragStart,
931
+ onDrag: onDrag,
932
+ onDragEnd: onDragEnd
933
+ },
934
+ dragButtonProps: {
935
+ ...descriptionProps,
936
+ onPress: onPress
937
+ },
938
+ isDragging: isDragging
939
+ };
940
+ }
1664
941
 
1665
- case 'Home':
1666
- {
1667
- if (keyboardDelegate.getFirstKey) {
1668
- let target = nextValidTarget(null, types, drag.allowedDropOperations, getNextTarget);
1669
- localState.state.setTarget(target);
1670
- }
1671
-
1672
- break;
1673
- }
1674
942
 
1675
- case 'End':
1676
- {
1677
- if (keyboardDelegate.getLastKey) {
1678
- let target = nextValidTarget(null, types, drag.allowedDropOperations, getPreviousTarget);
1679
- localState.state.setTarget(target);
1680
- }
943
+ var $444fab3ca6c3b038$exports = {};
1681
944
 
1682
- break;
1683
- }
945
+ $parcel$export($444fab3ca6c3b038$exports, "useDrop", () => $444fab3ca6c3b038$export$ccdee5eaf73cf661);
1684
946
 
1685
- case 'PageDown':
1686
- {
1687
- if (keyboardDelegate.getKeyPageBelow) {
1688
- var _target;
1689
947
 
1690
- let target = localState.state.target;
1691
948
 
1692
- if (!target) {
1693
- target = nextValidTarget(null, types, drag.allowedDropOperations, getNextTarget);
1694
- } else {
1695
- // If on the root, go to the item a page below the top. Otherwise a page below the current item.
1696
- let nextKey = keyboardDelegate.getKeyPageBelow(target.type === 'item' ? target.key : keyboardDelegate.getFirstKey());
1697
- let dropPosition = target.type === 'item' ? target.dropPosition : 'after'; // If there is no next key, or we are starting on the last key, jump to the last possible position.
1698
949
 
1699
- if (nextKey == null || target.type === 'item' && target.key === keyboardDelegate.getLastKey()) {
1700
- nextKey = keyboardDelegate.getLastKey();
1701
- dropPosition = 'after';
1702
- }
1703
950
 
1704
- target = {
1705
- type: 'item',
1706
- key: nextKey,
1707
- dropPosition
1708
- }; // If the target does not accept the drop, find the next valid target.
1709
- // If no next valid target, find the previous valid target.
1710
951
 
1711
- let operation = localState.state.getDropOperation(target, types, drag.allowedDropOperations);
1712
952
 
1713
- if (operation === 'cancel') {
1714
- var _nextValidTarget;
1715
953
 
1716
- target = (_nextValidTarget = nextValidTarget(target, types, drag.allowedDropOperations, getNextTarget, false)) != null ? _nextValidTarget : nextValidTarget(target, types, drag.allowedDropOperations, getPreviousTarget, false);
1717
- }
1718
- }
1719
954
 
1720
- localState.state.setTarget((_target = target) != null ? _target : localState.state.target);
1721
- }
1722
955
 
1723
- break;
956
+ const $116cc020faed051c$var$MESSAGES = {
957
+ keyboard: 'dropDescriptionKeyboard',
958
+ touch: 'dropDescriptionTouch',
959
+ virtual: 'dropDescriptionVirtual'
960
+ };
961
+ function $116cc020faed051c$export$62447ad3d2ec7da6() {
962
+ let formatMessage = $4on3C$reactariai18n.useMessageFormatter((/*@__PURE__*/$parcel$interopDefault($a0e2171154b8c4fe$exports)));
963
+ let modality = $c1cba3854dc3a167$export$49bac5d6d4b352ea();
964
+ let dragSession = $d69e2bc1de15721f$export$418e185dd3f1b968();
965
+ let descriptionProps = $4on3C$reactariautils.useDescription(dragSession ? formatMessage($116cc020faed051c$var$MESSAGES[modality]) : '');
966
+ return {
967
+ dropProps: {
968
+ ...descriptionProps,
969
+ // Mobile Safari does not properly bubble click events on elements except links or inputs
970
+ // unless there is an onclick handler bound directly to the element itself. By adding this
971
+ // handler, React will take care of adding that for us, and we are able to handle document
972
+ // level click events in the DragManager.
973
+ // See https://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
974
+ onClick: ()=>{
1724
975
  }
976
+ }
977
+ };
978
+ }
1725
979
 
1726
- case 'PageUp':
1727
- {
1728
- var _target2;
1729
-
1730
- if (!keyboardDelegate.getKeyPageAbove) {
1731
- break;
1732
- }
1733
-
1734
- let target = localState.state.target;
1735
980
 
1736
- if (!target) {
1737
- target = nextValidTarget(null, types, drag.allowedDropOperations, getPreviousTarget);
1738
- } else if (target.type === 'item') {
1739
- // If at the top already, switch to the root. Otherwise navigate a page up.
1740
- if (target.key === keyboardDelegate.getFirstKey()) {
1741
- target = {
1742
- type: 'root'
1743
- };
1744
- } else {
1745
- let nextKey = keyboardDelegate.getKeyPageAbove(target.key);
1746
- let dropPosition = target.dropPosition;
981
+ const $444fab3ca6c3b038$var$DROP_ACTIVATE_TIMEOUT = 800;
982
+ function $444fab3ca6c3b038$export$ccdee5eaf73cf661(options) {
983
+ let [isDropTarget, setDropTarget] = $4on3C$react.useState(false);
984
+ let state = $4on3C$react.useRef({
985
+ x: 0,
986
+ y: 0,
987
+ dragEnterCount: 0,
988
+ dropEffect: 'none',
989
+ dropActivateTimer: null
990
+ }).current;
991
+ let onDragOver = (e)=>{
992
+ e.preventDefault();
993
+ e.stopPropagation();
994
+ if (e.clientX === state.x && e.clientY === state.y) {
995
+ e.dataTransfer.dropEffect = state.dropEffect;
996
+ return;
997
+ }
998
+ state.x = e.clientX;
999
+ state.y = e.clientY;
1000
+ if (typeof options.getDropOperationForPoint === 'function') {
1001
+ let allowedOperations = $444fab3ca6c3b038$var$effectAllowedToOperations(e.dataTransfer.effectAllowed);
1002
+ let types = new $c1cba3854dc3a167$export$7f04ce188c91447c(e.dataTransfer);
1003
+ let rect = e.currentTarget.getBoundingClientRect();
1004
+ let dropOperation = options.getDropOperationForPoint(types, allowedOperations, state.x - rect.x, state.y - rect.y);
1005
+ state.dropEffect = $8e4046ff5ec007bd$export$5eacb0769d26d3b2[dropOperation] || 'none';
1006
+ }
1007
+ e.dataTransfer.dropEffect = state.dropEffect;
1008
+ if (typeof options.onDropMove === 'function') {
1009
+ let rect = e.currentTarget.getBoundingClientRect();
1010
+ options.onDropMove({
1011
+ type: 'dropmove',
1012
+ x: state.x - rect.x,
1013
+ y: state.y - rect.y
1014
+ });
1015
+ }
1016
+ clearTimeout(state.dropActivateTimer);
1017
+ if (typeof options.onDropActivate === 'function' && state.dropEffect !== 'none') {
1018
+ let rect = e.currentTarget.getBoundingClientRect();
1019
+ state.dropActivateTimer = setTimeout(()=>{
1020
+ options.onDropActivate({
1021
+ type: 'dropactivate',
1022
+ x: state.x - rect.x,
1023
+ y: state.y - rect.y
1024
+ });
1025
+ }, $444fab3ca6c3b038$var$DROP_ACTIVATE_TIMEOUT);
1026
+ }
1027
+ };
1028
+ let onDragEnter = (e)=>{
1029
+ e.stopPropagation();
1030
+ state.dragEnterCount++;
1031
+ if (state.dragEnterCount > 1) return;
1032
+ let allowedOperations = $444fab3ca6c3b038$var$effectAllowedToOperations(e.dataTransfer.effectAllowed);
1033
+ let dropOperation = allowedOperations[0];
1034
+ if (typeof options.getDropOperation === 'function') {
1035
+ let types = new $c1cba3854dc3a167$export$7f04ce188c91447c(e.dataTransfer);
1036
+ dropOperation = options.getDropOperation(types, allowedOperations);
1037
+ }
1038
+ if (dropOperation !== 'cancel') setDropTarget(true);
1039
+ if (typeof options.getDropOperationForPoint === 'function') {
1040
+ let types = new $c1cba3854dc3a167$export$7f04ce188c91447c(e.dataTransfer);
1041
+ let rect = e.currentTarget.getBoundingClientRect();
1042
+ dropOperation = options.getDropOperationForPoint(types, allowedOperations, e.clientX - rect.x, e.clientY - rect.y);
1043
+ }
1044
+ state.dropEffect = $8e4046ff5ec007bd$export$5eacb0769d26d3b2[dropOperation] || 'none';
1045
+ e.dataTransfer.dropEffect = state.dropEffect;
1046
+ if (typeof options.onDropEnter === 'function' && dropOperation !== 'cancel') {
1047
+ let rect = e.currentTarget.getBoundingClientRect();
1048
+ options.onDropEnter({
1049
+ type: 'dropenter',
1050
+ x: e.clientX - rect.x,
1051
+ y: e.clientY - rect.y
1052
+ });
1053
+ }
1054
+ state.x = e.clientX;
1055
+ state.y = e.clientY;
1056
+ };
1057
+ let onDragLeave = (e)=>{
1058
+ e.stopPropagation();
1059
+ state.dragEnterCount--;
1060
+ if (state.dragEnterCount > 0) return;
1061
+ if (typeof options.onDropExit === 'function' && state.dropEffect !== 'none') {
1062
+ let rect = e.currentTarget.getBoundingClientRect();
1063
+ options.onDropExit({
1064
+ type: 'dropexit',
1065
+ x: e.clientX - rect.x,
1066
+ y: e.clientY - rect.y
1067
+ });
1068
+ }
1069
+ setDropTarget(false);
1070
+ clearTimeout(state.dropActivateTimer);
1071
+ };
1072
+ let onDrop = (e)=>{
1073
+ e.preventDefault();
1074
+ e.stopPropagation();
1075
+ if (typeof options.onDrop === 'function') {
1076
+ let dropOperation = $8e4046ff5ec007bd$export$608ecc6f1b23c35d[state.dropEffect];
1077
+ let items = $c1cba3854dc3a167$export$d9e760437831f8b3(e.dataTransfer);
1078
+ let rect = e.currentTarget.getBoundingClientRect();
1079
+ let event = {
1080
+ type: 'drop',
1081
+ x: e.clientX - rect.x,
1082
+ y: e.clientY - rect.y,
1083
+ items: items,
1084
+ dropOperation: dropOperation
1085
+ };
1086
+ // Wait a frame to dispatch the drop event so that we ensure the dragend event fires first.
1087
+ // Otherwise, if onDrop removes the original dragged element from the DOM, dragend will never be fired.
1088
+ // This behavior is consistent across browsers, but see this issue for details:
1089
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=460801
1090
+ setTimeout(()=>{
1091
+ options.onDrop(event);
1092
+ }, 0);
1093
+ }
1094
+ if (typeof options.onDropExit === 'function') {
1095
+ let rect = e.currentTarget.getBoundingClientRect();
1096
+ options.onDropExit({
1097
+ type: 'dropexit',
1098
+ x: e.clientX - rect.x,
1099
+ y: e.clientY - rect.y
1100
+ });
1101
+ }
1102
+ state.dragEnterCount = 0;
1103
+ setDropTarget(false);
1104
+ clearTimeout(state.dropActivateTimer);
1105
+ };
1106
+ let optionsRef = $4on3C$react.useRef(options);
1107
+ optionsRef.current = options;
1108
+ $4on3C$reactariautils.useLayoutEffect(()=>$d69e2bc1de15721f$export$c28d9fb4a54e471a({
1109
+ element: optionsRef.current.ref.current,
1110
+ getDropOperation: optionsRef.current.getDropOperation,
1111
+ onDropEnter (e) {
1112
+ setDropTarget(true);
1113
+ if (typeof optionsRef.current.onDropEnter === 'function') optionsRef.current.onDropEnter(e);
1114
+ },
1115
+ onDropExit (e) {
1116
+ setDropTarget(false);
1117
+ if (typeof optionsRef.current.onDropExit === 'function') optionsRef.current.onDropExit(e);
1118
+ },
1119
+ onDrop (e) {
1120
+ if (typeof optionsRef.current.onDrop === 'function') optionsRef.current.onDrop(e);
1121
+ },
1122
+ onDropActivate (e) {
1123
+ if (typeof optionsRef.current.onDropActivate === 'function') optionsRef.current.onDropActivate(e);
1124
+ }
1125
+ })
1126
+ , [
1127
+ optionsRef
1128
+ ]);
1129
+ let { dropProps: dropProps } = $116cc020faed051c$export$62447ad3d2ec7da6();
1130
+ return {
1131
+ dropProps: {
1132
+ ...dropProps,
1133
+ onDragEnter: onDragEnter,
1134
+ onDragOver: onDragOver,
1135
+ onDragLeave: onDragLeave,
1136
+ onDrop: onDrop
1137
+ },
1138
+ isDropTarget: isDropTarget
1139
+ };
1140
+ }
1141
+ function $444fab3ca6c3b038$var$effectAllowedToOperations(effectAllowed) {
1142
+ let allowedOperationsBits = $8e4046ff5ec007bd$export$9bbdfc78cf083e16[effectAllowed];
1143
+ let allowedOperations = [];
1144
+ if (allowedOperationsBits & $8e4046ff5ec007bd$export$60b7b4bcf3903d8e.move) allowedOperations.push('move');
1145
+ if (allowedOperationsBits & $8e4046ff5ec007bd$export$60b7b4bcf3903d8e.copy) allowedOperations.push('copy');
1146
+ if (allowedOperationsBits & $8e4046ff5ec007bd$export$60b7b4bcf3903d8e.link) allowedOperations.push('link');
1147
+ return allowedOperations;
1148
+ }
1747
1149
 
1748
- if (nextKey == null) {
1749
- nextKey = keyboardDelegate.getFirstKey();
1750
- dropPosition = 'before';
1751
- }
1752
1150
 
1753
- target = {
1754
- type: 'item',
1755
- key: nextKey,
1756
- dropPosition
1757
- };
1758
- } // If the target does not accept the drop, find the previous valid target.
1759
- // If no next valid target, find the next valid target.
1151
+ var $f56fb52b53faaf3d$exports = {};
1152
+
1153
+ $parcel$export($f56fb52b53faaf3d$exports, "useDroppableCollection", () => $f56fb52b53faaf3d$export$f4e2f423c21f7b04);
1154
+
1155
+
1156
+
1157
+
1158
+
1159
+
1160
+
1161
+ const $0337847923f488b7$var$AUTOSCROLL_AREA_SIZE = 20;
1162
+ function $0337847923f488b7$export$6323452ca4533ed8(ref) {
1163
+ let scrollableRef = $4on3C$react.useRef(null);
1164
+ $4on3C$react.useEffect(()=>{
1165
+ if (ref.current) scrollableRef.current = $4on3C$reactariautils.getScrollParent(ref.current);
1166
+ }, [
1167
+ ref
1168
+ ]);
1169
+ let state = $4on3C$react.useRef({
1170
+ timer: null,
1171
+ dx: 0,
1172
+ dy: 0
1173
+ }).current;
1174
+ let scroll = $4on3C$react.useCallback(()=>{
1175
+ scrollableRef.current.scrollLeft += state.dx;
1176
+ scrollableRef.current.scrollTop += state.dy;
1177
+ if (state.timer) state.timer = requestAnimationFrame(scroll);
1178
+ }, [
1179
+ scrollableRef,
1180
+ state
1181
+ ]);
1182
+ return {
1183
+ move (x, y) {
1184
+ // Most browsers auto scroll natively, but WebKit on macOS does not (iOS does 🤷‍♂️).
1185
+ // https://bugs.webkit.org/show_bug.cgi?id=222636
1186
+ if (!$4on3C$reactariautils.isWebKit() || $4on3C$reactariautils.isIOS() || !scrollableRef.current) return;
1187
+ let box = scrollableRef.current.getBoundingClientRect();
1188
+ let left = $0337847923f488b7$var$AUTOSCROLL_AREA_SIZE;
1189
+ let top = $0337847923f488b7$var$AUTOSCROLL_AREA_SIZE;
1190
+ let bottom = box.height - $0337847923f488b7$var$AUTOSCROLL_AREA_SIZE;
1191
+ let right = box.width - $0337847923f488b7$var$AUTOSCROLL_AREA_SIZE;
1192
+ if (x < left || x > right || y < top || y > bottom) {
1193
+ if (x < left) state.dx = x - left;
1194
+ else if (x > right) state.dx = x - right;
1195
+ if (y < top) state.dy = y - top;
1196
+ else if (y > bottom) state.dy = y - bottom;
1197
+ if (!state.timer) state.timer = requestAnimationFrame(scroll);
1198
+ } else this.stop();
1199
+ },
1200
+ stop () {
1201
+ if (state.timer) {
1202
+ cancelAnimationFrame(state.timer);
1203
+ state.timer = null;
1204
+ }
1205
+ }
1206
+ };
1207
+ }
1760
1208
 
1761
1209
 
1762
- let operation = localState.state.getDropOperation(target, types, drag.allowedDropOperations);
1763
1210
 
1764
- if (operation === 'cancel') {
1765
- var _nextValidTarget2;
1766
1211
 
1767
- target = (_nextValidTarget2 = nextValidTarget(target, types, drag.allowedDropOperations, getPreviousTarget, false)) != null ? _nextValidTarget2 : nextValidTarget(target, types, drag.allowedDropOperations, getNextTarget, false);
1212
+ const $f56fb52b53faaf3d$var$DROP_POSITIONS = [
1213
+ 'before',
1214
+ 'on',
1215
+ 'after'
1216
+ ];
1217
+ function $f56fb52b53faaf3d$export$f4e2f423c21f7b04(props, state1, ref) {
1218
+ let localState = $4on3C$react.useRef({
1219
+ props: props,
1220
+ state: state1,
1221
+ nextTarget: null,
1222
+ dropOperation: null
1223
+ }).current;
1224
+ localState.props = props;
1225
+ localState.state = state1;
1226
+ let autoScroll = $0337847923f488b7$export$6323452ca4533ed8(ref);
1227
+ let { dropProps: dropProps } = $444fab3ca6c3b038$export$ccdee5eaf73cf661({
1228
+ ref: ref,
1229
+ onDropEnter (e) {
1230
+ let target = props.getDropTargetFromPoint(e.x, e.y);
1231
+ state1.setTarget(target);
1232
+ },
1233
+ onDropMove (e) {
1234
+ state1.setTarget(localState.nextTarget);
1235
+ autoScroll.move(e.x, e.y);
1236
+ },
1237
+ getDropOperationForPoint (types, allowedOperations, x, y) {
1238
+ let target = props.getDropTargetFromPoint(x, y);
1239
+ if (!target) {
1240
+ localState.dropOperation = 'cancel';
1241
+ localState.nextTarget = null;
1242
+ return 'cancel';
1243
+ }
1244
+ if (state1.isDropTarget(target)) {
1245
+ localState.nextTarget = target;
1246
+ return localState.dropOperation;
1247
+ }
1248
+ localState.dropOperation = state1.getDropOperation(target, types, allowedOperations);
1249
+ // If the target doesn't accept the drop, see if the root accepts it instead.
1250
+ if (localState.dropOperation === 'cancel') {
1251
+ let rootTarget = {
1252
+ type: 'root'
1253
+ };
1254
+ let dropOperation = state1.getDropOperation(rootTarget, types, allowedOperations);
1255
+ if (dropOperation !== 'cancel') {
1256
+ target = rootTarget;
1257
+ localState.dropOperation = dropOperation;
1768
1258
  }
1769
- }
1770
-
1771
- localState.state.setTarget((_target2 = target) != null ? _target2 : localState.state.target);
1772
- break;
1773
1259
  }
1260
+ localState.nextTarget = localState.dropOperation === 'cancel' ? null : target;
1261
+ return localState.dropOperation;
1262
+ },
1263
+ onDropExit () {
1264
+ state1.setTarget(null);
1265
+ autoScroll.stop();
1266
+ },
1267
+ onDropActivate (e) {
1268
+ if (state1.target?.type === 'item' && state1.target?.dropPosition === 'on' && typeof props.onDropActivate === 'function') props.onDropActivate({
1269
+ type: 'dropactivate',
1270
+ x: e.x,
1271
+ y: e.y,
1272
+ target: state1.target
1273
+ });
1274
+ },
1275
+ onDrop (e) {
1276
+ if (state1.target && typeof props.onDrop === 'function') onDrop(e, state1.target);
1774
1277
  }
1775
- }
1776
-
1777
1278
  });
1778
- }, [localState, ref]);
1779
- let id = $bc29619458500c186021634c18dc$export$useDroppableCollectionId(state);
1780
- return {
1781
- collectionProps: mergeProps(dropProps, {
1782
- id,
1783
- // Remove description from collection element. If dropping on the entire collection,
1784
- // there should be a drop indicator that has this description, so no need to double announce.
1785
- 'aria-describedby': null
1786
- })
1787
- };
1788
- }
1789
-
1790
- exports.useDroppableCollection = useDroppableCollection;
1791
-
1792
- function useDroppableItem(options, state, ref) {
1793
- let {
1794
- dropProps
1795
- } = $ca75888e192994dbb11ae05e54$export$useVirtualDrop();
1796
- useEffect(() => {
1797
- if (ref.current) {
1798
- return $a75d092e5c30878812fba78e$export$registerDropItem({
1799
- element: ref.current,
1800
- target: options.target,
1801
-
1802
- getDropOperation(types, allowedOperations) {
1803
- return state.getDropOperation(options.target, types, allowedOperations);
1279
+ let droppingState = $4on3C$react.useRef(null);
1280
+ let onDrop = $4on3C$react.useCallback((e, target)=>{
1281
+ let { state: state2 } = localState;
1282
+ // Focus the collection.
1283
+ state2.selectionManager.setFocused(true);
1284
+ // Save some state of the collection/selection before the drop occurs so we can compare later.
1285
+ let focusedKey = state2.selectionManager.focusedKey;
1286
+ droppingState.current = {
1287
+ timeout: null,
1288
+ focusedKey: focusedKey,
1289
+ collection: state2.collection,
1290
+ selectedKeys: state2.selectionManager.selectedKeys
1291
+ };
1292
+ localState.props.onDrop({
1293
+ type: 'drop',
1294
+ x: e.x,
1295
+ y: e.y,
1296
+ target: target,
1297
+ items: e.items,
1298
+ dropOperation: e.dropOperation
1299
+ });
1300
+ // Wait for a short time period after the onDrop is called to allow the data to be read asynchronously
1301
+ // and for React to re-render. If an insert occurs during this time, it will be selected/focused below.
1302
+ // If items are not "immediately" inserted by the onDrop handler, the application will need to handle
1303
+ // selecting and focusing those items themselves.
1304
+ droppingState.current.timeout = setTimeout(()=>{
1305
+ // If focus didn't move already (e.g. due to an insert), and the user dropped on an item,
1306
+ // focus that item and show the focus ring to give the user feedback that the drop occurred.
1307
+ // Also show the focus ring if the focused key is not selected, e.g. in case of a reorder.
1308
+ let { state: state } = localState;
1309
+ if (state.selectionManager.focusedKey === focusedKey) {
1310
+ if (target.type === 'item' && target.dropPosition === 'on' && state.collection.getItem(target.key) != null) {
1311
+ state.selectionManager.setFocusedKey(target.key);
1312
+ state.selectionManager.setFocused(true);
1313
+ $4on3C$reactariainteractions.setInteractionModality('keyboard');
1314
+ } else if (!state.selectionManager.isSelected(focusedKey)) $4on3C$reactariainteractions.setInteractionModality('keyboard');
1315
+ }
1316
+ droppingState.current = null;
1317
+ }, 50);
1318
+ }, [
1319
+ localState
1320
+ ]);
1321
+ // eslint-disable-next-line arrow-body-style
1322
+ $4on3C$react.useEffect(()=>{
1323
+ return ()=>{
1324
+ if (droppingState.current) clearTimeout(droppingState.current.timeout);
1325
+ };
1326
+ }, []);
1327
+ $4on3C$reactariautils.useLayoutEffect(()=>{
1328
+ // If an insert occurs during a drop, we want to immediately select these items to give
1329
+ // feedback to the user that a drop occurred. Only do this if the selection didn't change
1330
+ // since the drop started so we don't override if the user or application did something.
1331
+ if (droppingState.current && state1.selectionManager.isFocused && state1.collection.size > droppingState.current.collection.size && state1.selectionManager.isSelectionEqual(droppingState.current.selectedKeys)) {
1332
+ let newKeys = new Set();
1333
+ for (let key of state1.collection.getKeys())if (!droppingState.current.collection.getItem(key)) newKeys.add(key);
1334
+ state1.selectionManager.setSelectedKeys(newKeys);
1335
+ // If the focused item didn't change since the drop occurred, also focus the first
1336
+ // inserted item. If selection is disabled, then also show the focus ring so there
1337
+ // is some indication that items were added.
1338
+ if (state1.selectionManager.focusedKey === droppingState.current.focusedKey) {
1339
+ let first = newKeys.keys().next().value;
1340
+ state1.selectionManager.setFocusedKey(first);
1341
+ if (state1.selectionManager.selectionMode === 'none') $4on3C$reactariainteractions.setInteractionModality('keyboard');
1342
+ }
1343
+ droppingState.current = null;
1804
1344
  }
1805
-
1806
- });
1807
- }
1808
- }, [ref, options.target, state]);
1809
- let dragSession = $a75d092e5c30878812fba78e$export$useDragSession();
1810
- let isValidDropTarget = dragSession && state.getDropOperation(options.target, $bc29619458500c186021634c18dc$export$getTypes(dragSession.dragTarget.items), dragSession.dragTarget.allowedDropOperations) !== 'cancel';
1811
- let isDropTarget = state.isDropTarget(options.target);
1812
- useEffect(() => {
1813
- if (dragSession && isDropTarget && ref.current) {
1814
- ref.current.focus();
1815
- }
1816
- }, [isDropTarget, dragSession, ref]);
1817
- return {
1818
- dropProps: _babelRuntimeHelpersExtends({}, dropProps, {
1819
- 'aria-hidden': !dragSession || isValidDropTarget ? undefined : 'true'
1820
- })
1821
- };
1822
- }
1823
-
1824
- exports.useDroppableItem = useDroppableItem;
1825
- // @ts-ignore
1826
- const $e2ffcaef12f0c83baf595a484787300$var$intlMessages = {
1827
- "en-US": _babelRuntimeHelpersInteropRequireDefault($ece80d58838919a4624d1c28b393f77$exports).default
1828
- };
1829
-
1830
- function useDropIndicator(props, state, ref) {
1831
- let {
1832
- target
1833
- } = props;
1834
- let {
1835
- collection
1836
- } = state;
1837
- let formatMessage = useMessageFormatter($e2ffcaef12f0c83baf595a484787300$var$intlMessages);
1838
- let dragSession = $a75d092e5c30878812fba78e$export$useDragSession();
1839
- let {
1840
- dropProps
1841
- } = useDroppableItem(props, state, ref);
1842
- let id = useId();
1843
-
1844
- let getText = key => {
1845
- var _collection$getItem;
1846
-
1847
- return (_collection$getItem = collection.getItem(key)) == null ? void 0 : _collection$getItem.textValue;
1848
- };
1849
-
1850
- let label = '';
1851
- let labelledBy;
1852
-
1853
- if (target.type === 'root') {
1854
- label = formatMessage('dropOnRoot');
1855
- labelledBy = id + " " + $bc29619458500c186021634c18dc$export$getDroppableCollectionId(state);
1856
- } else if (target.dropPosition === 'on') {
1857
- label = formatMessage('dropOnItem', {
1858
- itemText: getText(target.key)
1859
1345
  });
1860
- } else {
1861
- let before = target.dropPosition === 'before' ? collection.getKeyBefore(target.key) : target.key;
1862
- let after = target.dropPosition === 'after' ? collection.getKeyAfter(target.key) : target.key;
1863
-
1864
- if (before && after) {
1865
- label = formatMessage('insertBetween', {
1866
- beforeItemText: getText(before),
1867
- afterItemText: getText(after)
1868
- });
1869
- } else if (before) {
1870
- label = formatMessage('insertAfter', {
1871
- itemText: getText(before)
1872
- });
1873
- } else if (after) {
1874
- label = formatMessage('insertBefore', {
1875
- itemText: getText(after)
1876
- });
1877
- }
1878
- }
1879
-
1880
- return {
1881
- dropIndicatorProps: _babelRuntimeHelpersExtends({}, dropProps, {
1882
- id,
1883
- 'aria-roledescription': formatMessage('dropIndicator'),
1884
- 'aria-label': label,
1885
- 'aria-labelledby': labelledBy,
1886
- 'aria-hidden': !dragSession ? 'true' : dropProps['aria-hidden'],
1887
- tabIndex: -1
1888
- })
1889
- };
1346
+ $4on3C$react.useEffect(()=>{
1347
+ let getNextTarget1 = (target, wrap = true)=>{
1348
+ if (!target) return {
1349
+ type: 'root'
1350
+ };
1351
+ let { keyboardDelegate: keyboardDelegate } = localState.props;
1352
+ let nextKey = target.type === 'item' ? keyboardDelegate.getKeyBelow(target.key) : keyboardDelegate.getFirstKey();
1353
+ let dropPosition = 'before';
1354
+ if (target.type === 'item') {
1355
+ let positionIndex = $f56fb52b53faaf3d$var$DROP_POSITIONS.indexOf(target.dropPosition);
1356
+ let nextDropPosition = $f56fb52b53faaf3d$var$DROP_POSITIONS[positionIndex + 1];
1357
+ if (positionIndex < $f56fb52b53faaf3d$var$DROP_POSITIONS.length - 1 && !(nextDropPosition === 'after' && nextKey != null)) return {
1358
+ type: 'item',
1359
+ key: target.key,
1360
+ dropPosition: nextDropPosition
1361
+ };
1362
+ // If the last drop position was 'after', then 'before' on the next key is equivalent.
1363
+ // Switch to 'on' instead.
1364
+ if (target.dropPosition === 'after') dropPosition = 'on';
1365
+ }
1366
+ if (nextKey == null) {
1367
+ if (wrap) return {
1368
+ type: 'root'
1369
+ };
1370
+ return null;
1371
+ }
1372
+ return {
1373
+ type: 'item',
1374
+ key: nextKey,
1375
+ dropPosition: dropPosition
1376
+ };
1377
+ };
1378
+ let getPreviousTarget = (target, wrap = true)=>{
1379
+ let { keyboardDelegate: keyboardDelegate } = localState.props;
1380
+ let nextKey = target?.type === 'item' ? keyboardDelegate.getKeyAbove(target.key) : keyboardDelegate.getLastKey();
1381
+ let dropPosition = !target || target.type === 'root' ? 'after' : 'on';
1382
+ if (target?.type === 'item') {
1383
+ let positionIndex = $f56fb52b53faaf3d$var$DROP_POSITIONS.indexOf(target.dropPosition);
1384
+ let nextDropPosition = $f56fb52b53faaf3d$var$DROP_POSITIONS[positionIndex - 1];
1385
+ if (positionIndex > 0 && nextDropPosition !== 'after') return {
1386
+ type: 'item',
1387
+ key: target.key,
1388
+ dropPosition: nextDropPosition
1389
+ };
1390
+ // If the last drop position was 'before', then 'after' on the previous key is equivalent.
1391
+ // Switch to 'on' instead.
1392
+ if (target.dropPosition === 'before') dropPosition = 'on';
1393
+ }
1394
+ if (nextKey == null) {
1395
+ if (wrap) return {
1396
+ type: 'root'
1397
+ };
1398
+ return null;
1399
+ }
1400
+ return {
1401
+ type: 'item',
1402
+ key: nextKey,
1403
+ dropPosition: dropPosition
1404
+ };
1405
+ };
1406
+ let nextValidTarget = (target, types, allowedDropOperations, getNextTarget, wrap = true)=>{
1407
+ let seenRoot = 0;
1408
+ let operation;
1409
+ do {
1410
+ let nextTarget = getNextTarget(target, wrap);
1411
+ if (!nextTarget) return null;
1412
+ target = nextTarget;
1413
+ operation = localState.state.getDropOperation(nextTarget, types, allowedDropOperations);
1414
+ if (target.type === 'root') seenRoot++;
1415
+ }while (operation === 'cancel' && !localState.state.isDropTarget(target) && seenRoot < 2)
1416
+ if (operation === 'cancel') return null;
1417
+ return target;
1418
+ };
1419
+ return $d69e2bc1de15721f$export$c28d9fb4a54e471a({
1420
+ element: ref.current,
1421
+ getDropOperation (types, allowedOperations) {
1422
+ if (localState.state.target) return localState.state.getDropOperation(localState.state.target, types, allowedOperations);
1423
+ // Check if any of the targets accept the drop.
1424
+ // TODO: should we have a faster way of doing this or e.g. for pagination?
1425
+ let target = nextValidTarget(null, types, allowedOperations, getNextTarget1);
1426
+ return target ? 'move' : 'cancel';
1427
+ },
1428
+ onDropEnter (e, drag) {
1429
+ let types = $c1cba3854dc3a167$export$e1d41611756c6326(drag.items);
1430
+ let selectionManager = localState.state.selectionManager;
1431
+ let target;
1432
+ // When entering the droppable collection for the first time, the default drop target
1433
+ // is after the focused key.
1434
+ let key = selectionManager.focusedKey;
1435
+ let dropPosition = 'after';
1436
+ // If the focused key is a cell, get the parent item instead.
1437
+ // For now, we assume that individual cells cannot be dropped on.
1438
+ let item = localState.state.collection.getItem(key);
1439
+ if (item?.type === 'cell') key = item.parentKey;
1440
+ // If the focused item is also selected, the default drop target is after the last selected item.
1441
+ // But if the focused key is the first selected item, then default to before the first selected item.
1442
+ // This is to make reordering lists slightly easier. If you select top down, we assume you want to
1443
+ // move the items down. If you select bottom up, we assume you want to move the items up.
1444
+ if (selectionManager.isSelected(key)) {
1445
+ if (selectionManager.selectedKeys.size > 1 && selectionManager.firstSelectedKey === key) dropPosition = 'before';
1446
+ else key = selectionManager.lastSelectedKey;
1447
+ }
1448
+ if (key != null) {
1449
+ target = {
1450
+ type: 'item',
1451
+ key: key,
1452
+ dropPosition: dropPosition
1453
+ };
1454
+ // If the default target is not valid, find the next one that is.
1455
+ if (localState.state.getDropOperation(target, types, drag.allowedDropOperations) === 'cancel') target = nextValidTarget(target, types, drag.allowedDropOperations, getNextTarget1, false) ?? nextValidTarget(target, types, drag.allowedDropOperations, getPreviousTarget, false);
1456
+ }
1457
+ // If no focused key, then start from the root.
1458
+ if (!target) target = nextValidTarget(null, types, drag.allowedDropOperations, getNextTarget1);
1459
+ localState.state.setTarget(target);
1460
+ },
1461
+ onDropExit () {
1462
+ localState.state.setTarget(null);
1463
+ },
1464
+ onDropTargetEnter (target) {
1465
+ localState.state.setTarget(target);
1466
+ },
1467
+ onDropActivate (e) {
1468
+ if (localState.state.target?.type === 'item' && localState.state.target?.dropPosition === 'on' && typeof localState.props.onDropActivate === 'function') localState.props.onDropActivate({
1469
+ type: 'dropactivate',
1470
+ x: e.x,
1471
+ y: e.y,
1472
+ target: localState.state.target
1473
+ });
1474
+ },
1475
+ onDrop (e, target) {
1476
+ if (localState.state.target && typeof localState.props.onDrop === 'function') onDrop(e, target || localState.state.target);
1477
+ },
1478
+ onKeyDown (e, drag) {
1479
+ let { keyboardDelegate: keyboardDelegate } = localState.props;
1480
+ let types = $c1cba3854dc3a167$export$e1d41611756c6326(drag.items);
1481
+ switch(e.key){
1482
+ case 'ArrowDown':
1483
+ if (keyboardDelegate.getKeyBelow) {
1484
+ let target = nextValidTarget(localState.state.target, types, drag.allowedDropOperations, getNextTarget1);
1485
+ localState.state.setTarget(target);
1486
+ }
1487
+ break;
1488
+ case 'ArrowUp':
1489
+ if (keyboardDelegate.getKeyAbove) {
1490
+ let target = nextValidTarget(localState.state.target, types, drag.allowedDropOperations, getPreviousTarget);
1491
+ localState.state.setTarget(target);
1492
+ }
1493
+ break;
1494
+ case 'Home':
1495
+ if (keyboardDelegate.getFirstKey) {
1496
+ let target = nextValidTarget(null, types, drag.allowedDropOperations, getNextTarget1);
1497
+ localState.state.setTarget(target);
1498
+ }
1499
+ break;
1500
+ case 'End':
1501
+ if (keyboardDelegate.getLastKey) {
1502
+ let target = nextValidTarget(null, types, drag.allowedDropOperations, getPreviousTarget);
1503
+ localState.state.setTarget(target);
1504
+ }
1505
+ break;
1506
+ case 'PageDown':
1507
+ if (keyboardDelegate.getKeyPageBelow) {
1508
+ let target = localState.state.target;
1509
+ if (!target) target = nextValidTarget(null, types, drag.allowedDropOperations, getNextTarget1);
1510
+ else {
1511
+ // If on the root, go to the item a page below the top. Otherwise a page below the current item.
1512
+ let nextKey = keyboardDelegate.getKeyPageBelow(target.type === 'item' ? target.key : keyboardDelegate.getFirstKey());
1513
+ let dropPosition = target.type === 'item' ? target.dropPosition : 'after';
1514
+ // If there is no next key, or we are starting on the last key, jump to the last possible position.
1515
+ if (nextKey == null || target.type === 'item' && target.key === keyboardDelegate.getLastKey()) {
1516
+ nextKey = keyboardDelegate.getLastKey();
1517
+ dropPosition = 'after';
1518
+ }
1519
+ target = {
1520
+ type: 'item',
1521
+ key: nextKey,
1522
+ dropPosition: dropPosition
1523
+ };
1524
+ // If the target does not accept the drop, find the next valid target.
1525
+ // If no next valid target, find the previous valid target.
1526
+ let operation = localState.state.getDropOperation(target, types, drag.allowedDropOperations);
1527
+ if (operation === 'cancel') target = nextValidTarget(target, types, drag.allowedDropOperations, getNextTarget1, false) ?? nextValidTarget(target, types, drag.allowedDropOperations, getPreviousTarget, false);
1528
+ }
1529
+ localState.state.setTarget(target ?? localState.state.target);
1530
+ }
1531
+ break;
1532
+ case 'PageUp':
1533
+ {
1534
+ if (!keyboardDelegate.getKeyPageAbove) break;
1535
+ let target = localState.state.target;
1536
+ if (!target) target = nextValidTarget(null, types, drag.allowedDropOperations, getPreviousTarget);
1537
+ else if (target.type === 'item') {
1538
+ // If at the top already, switch to the root. Otherwise navigate a page up.
1539
+ if (target.key === keyboardDelegate.getFirstKey()) target = {
1540
+ type: 'root'
1541
+ };
1542
+ else {
1543
+ let nextKey = keyboardDelegate.getKeyPageAbove(target.key);
1544
+ let dropPosition = target.dropPosition;
1545
+ if (nextKey == null) {
1546
+ nextKey = keyboardDelegate.getFirstKey();
1547
+ dropPosition = 'before';
1548
+ }
1549
+ target = {
1550
+ type: 'item',
1551
+ key: nextKey,
1552
+ dropPosition: dropPosition
1553
+ };
1554
+ }
1555
+ // If the target does not accept the drop, find the previous valid target.
1556
+ // If no next valid target, find the next valid target.
1557
+ let operation = localState.state.getDropOperation(target, types, drag.allowedDropOperations);
1558
+ if (operation === 'cancel') target = nextValidTarget(target, types, drag.allowedDropOperations, getPreviousTarget, false) ?? nextValidTarget(target, types, drag.allowedDropOperations, getNextTarget1, false);
1559
+ }
1560
+ localState.state.setTarget(target ?? localState.state.target);
1561
+ break;
1562
+ }
1563
+ }
1564
+ }
1565
+ });
1566
+ }, [
1567
+ localState,
1568
+ ref,
1569
+ onDrop
1570
+ ]);
1571
+ let id = $c1cba3854dc3a167$export$b1601eb39394a581(state1);
1572
+ return {
1573
+ collectionProps: $4on3C$reactariautils.mergeProps(dropProps, {
1574
+ id: id,
1575
+ // Remove description from collection element. If dropping on the entire collection,
1576
+ // there should be a drop indicator that has this description, so no need to double announce.
1577
+ 'aria-describedby': null
1578
+ })
1579
+ };
1890
1580
  }
1891
1581
 
1892
- exports.useDropIndicator = useDropIndicator;
1893
- // @ts-ignore
1894
- const $a1d519dfa8f428d414c97a867b60c6f$var$intlMessages = {
1895
- "en-US": _babelRuntimeHelpersInteropRequireDefault($ece80d58838919a4624d1c28b393f77$exports).default
1896
- };
1897
-
1898
- function useDraggableItem(props, state) {
1899
- let formatMessage = useMessageFormatter($a1d519dfa8f428d414c97a867b60c6f$var$intlMessages);
1900
- let {
1901
- dragProps,
1902
- dragButtonProps
1903
- } = useDrag({
1904
- getItems() {
1905
- return state.getItems(props.key);
1906
- },
1907
1582
 
1908
- renderPreview() {
1909
- return state.renderPreview(props.key);
1910
- },
1583
+ var $bfcc97d22144d9f4$exports = {};
1911
1584
 
1912
- onDragStart(e) {
1913
- state.startDrag(props.key, e);
1914
- },
1585
+ $parcel$export($bfcc97d22144d9f4$exports, "useDroppableItem", () => $bfcc97d22144d9f4$export$f7b0c5d28b66b6a5);
1915
1586
 
1916
- onDragMove(e) {
1917
- state.moveDrag(e);
1918
- },
1919
1587
 
1920
- onDragEnd(e) {
1921
- state.endDrag(e);
1922
- }
1923
1588
 
1924
- });
1925
- let item = state.collection.getItem(props.key);
1926
- let numSelectedKeys = state.selectionManager.selectedKeys.size;
1927
- let isSelected = state.selectionManager.isSelected(props.key);
1928
- let message;
1929
-
1930
- if (isSelected && numSelectedKeys > 1) {
1931
- message = formatMessage('dragSelectedItems', {
1932
- count: numSelectedKeys
1933
- });
1934
- } else {
1935
- var _item$textValue;
1936
1589
 
1937
- message = formatMessage('dragItem', {
1938
- itemText: (_item$textValue = item == null ? void 0 : item.textValue) != null ? _item$textValue : ''
1939
- });
1940
- }
1941
-
1942
- return {
1943
- dragProps,
1944
- dragButtonProps: _babelRuntimeHelpersExtends({}, dragButtonProps, {
1945
- 'aria-label': message
1946
- })
1947
- };
1590
+ function $bfcc97d22144d9f4$export$f7b0c5d28b66b6a5(options, state, ref) {
1591
+ let { dropProps: dropProps } = $116cc020faed051c$export$62447ad3d2ec7da6();
1592
+ $4on3C$react.useEffect(()=>{
1593
+ if (ref.current) return $d69e2bc1de15721f$export$aef80212ac99c003({
1594
+ element: ref.current,
1595
+ target: options.target,
1596
+ getDropOperation (types, allowedOperations) {
1597
+ return state.getDropOperation(options.target, types, allowedOperations);
1598
+ }
1599
+ });
1600
+ }, [
1601
+ ref,
1602
+ options.target,
1603
+ state
1604
+ ]);
1605
+ let dragSession = $d69e2bc1de15721f$export$418e185dd3f1b968();
1606
+ let isValidDropTarget = dragSession && state.getDropOperation(options.target, $c1cba3854dc3a167$export$e1d41611756c6326(dragSession.dragTarget.items), dragSession.dragTarget.allowedDropOperations) !== 'cancel';
1607
+ let isDropTarget = state.isDropTarget(options.target);
1608
+ $4on3C$react.useEffect(()=>{
1609
+ if (dragSession && isDropTarget && ref.current) ref.current.focus();
1610
+ }, [
1611
+ isDropTarget,
1612
+ dragSession,
1613
+ ref
1614
+ ]);
1615
+ return {
1616
+ dropProps: {
1617
+ ...dropProps,
1618
+ 'aria-hidden': !dragSession || isValidDropTarget ? undefined : 'true'
1619
+ }
1620
+ };
1948
1621
  }
1949
1622
 
1950
- exports.useDraggableItem = useDraggableItem;
1951
- const $c1be8e43b63c7fad889cec0e3e2f47d5$var$globalEvents = new Map();
1952
1623
 
1953
- function $c1be8e43b63c7fad889cec0e3e2f47d5$var$addGlobalEventListener(event, fn) {
1954
- let eventData = $c1be8e43b63c7fad889cec0e3e2f47d5$var$globalEvents.get(event);
1624
+ var $dd3402c2521ab910$exports = {};
1625
+
1626
+ $parcel$export($dd3402c2521ab910$exports, "useDropIndicator", () => $dd3402c2521ab910$export$8d0e41d2815afac5);
1627
+
1955
1628
 
1956
- if (!eventData) {
1957
- let handlers = new Set();
1958
1629
 
1959
- let listener = e => {
1960
- for (let handler of handlers) {
1961
- handler(e);
1962
- }
1963
- };
1964
1630
 
1965
- eventData = {
1966
- listener,
1967
- handlers
1968
- };
1969
- $c1be8e43b63c7fad889cec0e3e2f47d5$var$globalEvents.set(event, eventData);
1970
- document.addEventListener(event, listener);
1971
- }
1972
1631
 
1973
- eventData.handlers.add(fn);
1974
- return () => {
1975
- eventData.handlers.delete(fn);
1976
1632
 
1977
- if (eventData.handlers.size === 0) {
1978
- document.removeEventListener(event, eventData.listener);
1979
- $c1be8e43b63c7fad889cec0e3e2f47d5$var$globalEvents.delete(event);
1633
+ function $dd3402c2521ab910$export$8d0e41d2815afac5(props, state, ref) {
1634
+ let { target: target } = props;
1635
+ let { collection: collection } = state;
1636
+ let formatMessage = $4on3C$reactariai18n.useMessageFormatter((/*@__PURE__*/$parcel$interopDefault($a0e2171154b8c4fe$exports)));
1637
+ let dragSession = $d69e2bc1de15721f$export$418e185dd3f1b968();
1638
+ let { dropProps: dropProps } = $bfcc97d22144d9f4$export$f7b0c5d28b66b6a5(props, state, ref);
1639
+ let id = $4on3C$reactariautils.useId();
1640
+ let getText = (key)=>collection.getItem(key)?.textValue
1641
+ ;
1642
+ let label = '';
1643
+ let labelledBy;
1644
+ if (target.type === 'root') {
1645
+ label = formatMessage('dropOnRoot');
1646
+ labelledBy = `${id} ${$c1cba3854dc3a167$export$3093291712f09a77(state)}`;
1647
+ } else if (target.dropPosition === 'on') label = formatMessage('dropOnItem', {
1648
+ itemText: getText(target.key)
1649
+ });
1650
+ else {
1651
+ let before = target.dropPosition === 'before' ? collection.getKeyBefore(target.key) : target.key;
1652
+ let after = target.dropPosition === 'after' ? collection.getKeyAfter(target.key) : target.key;
1653
+ if (before && after) label = formatMessage('insertBetween', {
1654
+ beforeItemText: getText(before),
1655
+ afterItemText: getText(after)
1656
+ });
1657
+ else if (before) label = formatMessage('insertAfter', {
1658
+ itemText: getText(before)
1659
+ });
1660
+ else if (after) label = formatMessage('insertBefore', {
1661
+ itemText: getText(after)
1662
+ });
1980
1663
  }
1981
- };
1664
+ return {
1665
+ dropIndicatorProps: {
1666
+ ...dropProps,
1667
+ id: id,
1668
+ 'aria-roledescription': formatMessage('dropIndicator'),
1669
+ 'aria-label': label,
1670
+ 'aria-labelledby': labelledBy,
1671
+ 'aria-hidden': !dragSession ? 'true' : dropProps['aria-hidden'],
1672
+ tabIndex: -1
1673
+ }
1674
+ };
1982
1675
  }
1983
1676
 
1984
- function useClipboard(options) {
1985
- let ref = useRef(options);
1986
- ref.current = options;
1987
- let isFocusedRef = useRef(false);
1988
- let {
1989
- focusProps
1990
- } = useFocus({
1991
- onFocusChange: isFocused => {
1992
- isFocusedRef.current = isFocused;
1993
- }
1994
- });
1995
- useEffect(() => {
1996
- let onBeforeCopy = e => {
1997
- // Enable the "Copy" menu item in Safari if this element is focused and copying is supported.
1998
- let options = ref.current;
1999
1677
 
2000
- if (isFocusedRef.current && options.getItems) {
2001
- e.preventDefault();
2002
- }
2003
- };
1678
+ var $ef813332c2b7144e$exports = {};
2004
1679
 
2005
- let onCopy = e => {
2006
- let options = ref.current;
1680
+ $parcel$export($ef813332c2b7144e$exports, "useDraggableItem", () => $ef813332c2b7144e$export$b35afafff42da2d9);
2007
1681
 
2008
- if (!isFocusedRef.current || !options.getItems) {
2009
- return;
2010
- }
2011
1682
 
2012
- e.preventDefault();
2013
- $bc29619458500c186021634c18dc$export$writeToDataTransfer(e.clipboardData, options.getItems());
2014
- options.onCopy == null ? void 0 : options.onCopy();
1683
+
1684
+ function $ef813332c2b7144e$export$b35afafff42da2d9(props, state) {
1685
+ let formatMessage = $4on3C$reactariai18n.useMessageFormatter((/*@__PURE__*/$parcel$interopDefault($a0e2171154b8c4fe$exports)));
1686
+ let { dragProps: dragProps , dragButtonProps: dragButtonProps } = $d067e40b40cb0a24$export$7941f8aafa4b6021({
1687
+ getItems () {
1688
+ return state.getItems(props.key);
1689
+ },
1690
+ renderPreview () {
1691
+ return state.renderPreview(props.key);
1692
+ },
1693
+ onDragStart (e) {
1694
+ state.startDrag(props.key, e);
1695
+ },
1696
+ onDragMove (e) {
1697
+ state.moveDrag(e);
1698
+ },
1699
+ onDragEnd (e) {
1700
+ state.endDrag(e);
1701
+ }
1702
+ });
1703
+ let item = state.collection.getItem(props.key);
1704
+ let numSelectedKeys = state.selectionManager.selectedKeys.size;
1705
+ let isSelected = state.selectionManager.isSelected(props.key);
1706
+ let message;
1707
+ if (isSelected && numSelectedKeys > 1) message = formatMessage('dragSelectedItems', {
1708
+ count: numSelectedKeys
1709
+ });
1710
+ else message = formatMessage('dragItem', {
1711
+ itemText: item?.textValue ?? ''
1712
+ });
1713
+ return {
1714
+ dragProps: dragProps,
1715
+ dragButtonProps: {
1716
+ ...dragButtonProps,
1717
+ 'aria-label': message
1718
+ }
2015
1719
  };
1720
+ }
2016
1721
 
2017
- let onBeforeCut = e => {
2018
- let options = ref.current;
2019
1722
 
2020
- if (isFocusedRef.current && options.onCut && options.getItems) {
2021
- e.preventDefault();
2022
- }
2023
- };
1723
+ var $0e4f47463d859da8$exports = {};
2024
1724
 
2025
- let onCut = e => {
2026
- let options = ref.current;
1725
+ $parcel$export($0e4f47463d859da8$exports, "useClipboard", () => $0e4f47463d859da8$export$2314ca2a3e892862);
2027
1726
 
2028
- if (!isFocusedRef.current || !options.onCut || !options.getItems) {
2029
- return;
2030
- }
2031
1727
 
2032
- e.preventDefault();
2033
- $bc29619458500c186021634c18dc$export$writeToDataTransfer(e.clipboardData, options.getItems());
2034
- options.onCut();
2035
- };
2036
1728
 
2037
- let onBeforePaste = e => {
2038
- let options = ref.current; // Unfortunately, e.clipboardData.types is not available in this event so we always
2039
- // have to enable the Paste menu item even if the type of data is unsupported.
2040
1729
 
2041
- if (isFocusedRef.current && options.onPaste) {
2042
- e.preventDefault();
2043
- }
1730
+ const $0e4f47463d859da8$var$globalEvents = new Map();
1731
+ function $0e4f47463d859da8$var$addGlobalEventListener(event, fn) {
1732
+ let eventData = $0e4f47463d859da8$var$globalEvents.get(event);
1733
+ if (!eventData) {
1734
+ let handlers = new Set();
1735
+ let listener = (e)=>{
1736
+ for (let handler of handlers)handler(e);
1737
+ };
1738
+ eventData = {
1739
+ listener: listener,
1740
+ handlers: handlers
1741
+ };
1742
+ $0e4f47463d859da8$var$globalEvents.set(event, eventData);
1743
+ document.addEventListener(event, listener);
1744
+ }
1745
+ eventData.handlers.add(fn);
1746
+ return ()=>{
1747
+ eventData.handlers.delete(fn);
1748
+ if (eventData.handlers.size === 0) {
1749
+ document.removeEventListener(event, eventData.listener);
1750
+ $0e4f47463d859da8$var$globalEvents.delete(event);
1751
+ }
2044
1752
  };
1753
+ }
1754
+ function $0e4f47463d859da8$export$2314ca2a3e892862(options1) {
1755
+ let ref = $4on3C$react.useRef(options1);
1756
+ ref.current = options1;
1757
+ let isFocusedRef = $4on3C$react.useRef(false);
1758
+ let { focusProps: focusProps } = $4on3C$reactariainteractions.useFocus({
1759
+ onFocusChange: (isFocused)=>{
1760
+ isFocusedRef.current = isFocused;
1761
+ }
1762
+ });
1763
+ $4on3C$react.useEffect(()=>{
1764
+ let onBeforeCopy = (e)=>{
1765
+ // Enable the "Copy" menu item in Safari if this element is focused and copying is supported.
1766
+ let options = ref.current;
1767
+ if (isFocusedRef.current && options.getItems) e.preventDefault();
1768
+ };
1769
+ let onCopy = (e)=>{
1770
+ let options = ref.current;
1771
+ if (!isFocusedRef.current || !options.getItems) return;
1772
+ e.preventDefault();
1773
+ $c1cba3854dc3a167$export$f9c1490890ddd063(e.clipboardData, options.getItems());
1774
+ options.onCopy?.();
1775
+ };
1776
+ let onBeforeCut = (e)=>{
1777
+ let options = ref.current;
1778
+ if (isFocusedRef.current && options.onCut && options.getItems) e.preventDefault();
1779
+ };
1780
+ let onCut = (e)=>{
1781
+ let options = ref.current;
1782
+ if (!isFocusedRef.current || !options.onCut || !options.getItems) return;
1783
+ e.preventDefault();
1784
+ $c1cba3854dc3a167$export$f9c1490890ddd063(e.clipboardData, options.getItems());
1785
+ options.onCut();
1786
+ };
1787
+ let onBeforePaste = (e)=>{
1788
+ let options = ref.current;
1789
+ // Unfortunately, e.clipboardData.types is not available in this event so we always
1790
+ // have to enable the Paste menu item even if the type of data is unsupported.
1791
+ if (isFocusedRef.current && options.onPaste) e.preventDefault();
1792
+ };
1793
+ let onPaste = (e)=>{
1794
+ let options = ref.current;
1795
+ if (!isFocusedRef.current || !options.onPaste) return;
1796
+ e.preventDefault();
1797
+ let items = $c1cba3854dc3a167$export$d9e760437831f8b3(e.clipboardData);
1798
+ options.onPaste(items);
1799
+ };
1800
+ return $4on3C$reactariautils.chain($0e4f47463d859da8$var$addGlobalEventListener('beforecopy', onBeforeCopy), $0e4f47463d859da8$var$addGlobalEventListener('copy', onCopy), $0e4f47463d859da8$var$addGlobalEventListener('beforecut', onBeforeCut), $0e4f47463d859da8$var$addGlobalEventListener('cut', onCut), $0e4f47463d859da8$var$addGlobalEventListener('beforepaste', onBeforePaste), $0e4f47463d859da8$var$addGlobalEventListener('paste', onPaste));
1801
+ }, []);
1802
+ return {
1803
+ clipboardProps: focusProps
1804
+ };
1805
+ }
2045
1806
 
2046
- let onPaste = e => {
2047
- let options = ref.current;
2048
-
2049
- if (!isFocusedRef.current || !options.onPaste) {
2050
- return;
2051
- }
2052
1807
 
2053
- e.preventDefault();
2054
- let items = $bc29619458500c186021634c18dc$export$readFromDataTransfer(e.clipboardData);
2055
- options.onPaste(items);
2056
- };
1808
+ $parcel$exportWildcard(module.exports, $d067e40b40cb0a24$exports);
1809
+ $parcel$exportWildcard(module.exports, $444fab3ca6c3b038$exports);
1810
+ $parcel$exportWildcard(module.exports, $f56fb52b53faaf3d$exports);
1811
+ $parcel$exportWildcard(module.exports, $bfcc97d22144d9f4$exports);
1812
+ $parcel$exportWildcard(module.exports, $dd3402c2521ab910$exports);
1813
+ $parcel$exportWildcard(module.exports, $ef813332c2b7144e$exports);
1814
+ $parcel$exportWildcard(module.exports, $0e4f47463d859da8$exports);
2057
1815
 
2058
- return chain($c1be8e43b63c7fad889cec0e3e2f47d5$var$addGlobalEventListener('beforecopy', onBeforeCopy), $c1be8e43b63c7fad889cec0e3e2f47d5$var$addGlobalEventListener('copy', onCopy), $c1be8e43b63c7fad889cec0e3e2f47d5$var$addGlobalEventListener('beforecut', onBeforeCut), $c1be8e43b63c7fad889cec0e3e2f47d5$var$addGlobalEventListener('cut', onCut), $c1be8e43b63c7fad889cec0e3e2f47d5$var$addGlobalEventListener('beforepaste', onBeforePaste), $c1be8e43b63c7fad889cec0e3e2f47d5$var$addGlobalEventListener('paste', onPaste));
2059
- }, []);
2060
- return {
2061
- clipboardProps: focusProps
2062
- };
2063
- }
2064
1816
 
2065
- exports.useClipboard = useClipboard;
2066
1817
  //# sourceMappingURL=main.js.map