@react-aria/dnd 3.0.0-alpha.1 → 3.0.0-alpha.10

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,2196 +1,1899 @@
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
- setInteractionModality,
21
- useFocus
22
- } = require("@react-aria/interactions");
23
-
24
- var _babelRuntimeHelpersWrapAsyncGenerator = $parcel$interopDefault(require("@babel/runtime/helpers/wrapAsyncGenerator"));
25
-
26
- var _babelRuntimeHelpersAwaitAsyncGenerator = $parcel$interopDefault(require("@babel/runtime/helpers/awaitAsyncGenerator"));
27
-
28
- var {
29
- ariaHideOutside
30
- } = require("@react-aria/overlays");
31
-
32
- var {
33
- announce
34
- } = require("@react-aria/live-announcer");
35
-
36
- var {
37
- useRef,
38
- useState,
39
- useEffect,
40
- useLayoutEffect,
41
- useCallback
42
- } = require("react");
43
-
44
- var _babelRuntimeHelpersInteropRequireDefault = $parcel$interopDefault(require("@babel/runtime/helpers/interopRequireDefault"));
1
+ var $4vY0V$react = require("react");
2
+ var $4vY0V$reactariautils = require("@react-aria/utils");
3
+ var $4vY0V$reactariai18n = require("@react-aria/i18n");
4
+ var $4vY0V$reactarialiveannouncer = require("@react-aria/live-announcer");
5
+ var $4vY0V$reactariaoverlays = require("@react-aria/overlays");
6
+ var $4vY0V$reactariainteractions = require("@react-aria/interactions");
7
+ var $4vY0V$reactdom = require("react-dom");
8
+
9
+ function $parcel$export(e, n, v, s) {
10
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
11
+ }
12
+ function $parcel$exportWildcard(dest, source) {
13
+ Object.keys(source).forEach(function(key) {
14
+ if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
15
+ return;
16
+ }
45
17
 
46
- var _babelRuntimeHelpersExtends = $parcel$interopDefault(require("@babel/runtime/helpers/extends"));
18
+ Object.defineProperty(dest, key, {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return source[key];
22
+ }
23
+ });
24
+ });
47
25
 
26
+ return dest;
27
+ }
48
28
  function $parcel$interopDefault(a) {
49
29
  return a && a.__esModule ? a.default : a;
50
30
  }
51
31
 
52
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/dnd/src/constants.ts
53
- var $b29ea0269b2ea2bf4827b4fa19ddc83e$var$_temp;
54
-
55
- /*
56
- * Copyright 2020 Adobe. All rights reserved.
57
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
58
- * you may not use this file except in compliance with the License. You may obtain a copy
59
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
60
- *
61
- * Unless required by applicable law or agreed to in writing, software distributed under
62
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
63
- * OF ANY KIND, either express or implied. See the License for the specific language
64
- * governing permissions and limitations under the License.
65
- */
66
- let $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION; // See https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/effectAllowed
67
-
68
- (function (DROP_OPERATION) {
69
- DROP_OPERATION[DROP_OPERATION["none"] = 0] = "none";
70
- DROP_OPERATION[DROP_OPERATION["cancel"] = 0] = "cancel";
71
- DROP_OPERATION[DROP_OPERATION["move"] = 1] = "move";
72
- DROP_OPERATION[DROP_OPERATION["copy"] = 2] = "copy";
73
- DROP_OPERATION[DROP_OPERATION["link"] = 4] = "link";
74
- DROP_OPERATION[DROP_OPERATION["all"] = 7] = "all";
75
- })($b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION || ($b29ea0269b2ea2bf4827b4fa19ddc83e$var$_temp = $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION = {}, $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION, $b29ea0269b2ea2bf4827b4fa19ddc83e$var$_temp));
76
-
77
- const $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION_ALLOWED = _babelRuntimeHelpersExtends({}, $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION, {
78
- copyMove: $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.copy | $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.move,
79
- copyLink: $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.copy | $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.link,
80
- linkMove: $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.link | $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.move,
81
- all: $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.all,
82
- uninitialized: $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.all
83
- });
84
-
85
- const $b29ea0269b2ea2bf4827b4fa19ddc83e$export$EFFECT_ALLOWED = $b29ea0269b2ea2bf4827b4fa19ddc83e$var$invert($b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION_ALLOWED);
86
- const $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_EFFECT = $b29ea0269b2ea2bf4827b4fa19ddc83e$var$invert($b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION);
87
- const $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_EFFECT_TO_DROP_OPERATION = {
88
- none: 'cancel',
89
- link: 'link',
90
- copy: 'copy',
91
- move: 'move'
32
+ $parcel$export(module.exports, "DragPreview", () => $2dccaca1f4baa446$export$905ab40ac2179daa);
33
+ var $dc204e8ec58447a6$exports = {};
34
+
35
+ $parcel$export($dc204e8ec58447a6$exports, "useDrag", () => $dc204e8ec58447a6$export$7941f8aafa4b6021);
36
+
37
+
38
+
39
+ let $76b1e110a27b1ccd$export$60b7b4bcf3903d8e;
40
+ (function($76b1e110a27b1ccd$export$60b7b4bcf3903d8e) {
41
+ $76b1e110a27b1ccd$export$60b7b4bcf3903d8e[$76b1e110a27b1ccd$export$60b7b4bcf3903d8e["none"] = 0] = "none";
42
+ $76b1e110a27b1ccd$export$60b7b4bcf3903d8e[$76b1e110a27b1ccd$export$60b7b4bcf3903d8e["cancel"] = 0] = "cancel";
43
+ $76b1e110a27b1ccd$export$60b7b4bcf3903d8e[$76b1e110a27b1ccd$export$60b7b4bcf3903d8e["move"] = 1] = "move";
44
+ $76b1e110a27b1ccd$export$60b7b4bcf3903d8e[$76b1e110a27b1ccd$export$60b7b4bcf3903d8e["copy"] = 2] = "copy";
45
+ $76b1e110a27b1ccd$export$60b7b4bcf3903d8e[$76b1e110a27b1ccd$export$60b7b4bcf3903d8e["link"] = 4] = "link";
46
+ $76b1e110a27b1ccd$export$60b7b4bcf3903d8e[$76b1e110a27b1ccd$export$60b7b4bcf3903d8e["all"] = 7] = "all";
47
+ })($76b1e110a27b1ccd$export$60b7b4bcf3903d8e || ($76b1e110a27b1ccd$export$60b7b4bcf3903d8e = {
48
+ }));
49
+ const $76b1e110a27b1ccd$export$9bbdfc78cf083e16 = {
50
+ ...$76b1e110a27b1ccd$export$60b7b4bcf3903d8e,
51
+ copyMove: $76b1e110a27b1ccd$export$60b7b4bcf3903d8e.copy | $76b1e110a27b1ccd$export$60b7b4bcf3903d8e.move,
52
+ copyLink: $76b1e110a27b1ccd$export$60b7b4bcf3903d8e.copy | $76b1e110a27b1ccd$export$60b7b4bcf3903d8e.link,
53
+ linkMove: $76b1e110a27b1ccd$export$60b7b4bcf3903d8e.link | $76b1e110a27b1ccd$export$60b7b4bcf3903d8e.move,
54
+ all: $76b1e110a27b1ccd$export$60b7b4bcf3903d8e.all,
55
+ uninitialized: $76b1e110a27b1ccd$export$60b7b4bcf3903d8e.all
92
56
  };
93
- const $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION_TO_DROP_EFFECT = $b29ea0269b2ea2bf4827b4fa19ddc83e$var$invert($b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_EFFECT_TO_DROP_OPERATION);
94
-
95
- function $b29ea0269b2ea2bf4827b4fa19ddc83e$var$invert(object) {
96
- let res = {};
97
-
98
- for (let key in object) {
99
- res[object[key]] = key;
100
- }
101
-
102
- return res;
57
+ const $76b1e110a27b1ccd$export$dd0165308d8bff45 = $76b1e110a27b1ccd$var$invert($76b1e110a27b1ccd$export$9bbdfc78cf083e16);
58
+ const $76b1e110a27b1ccd$export$d7ebf00f36b7a95e = $76b1e110a27b1ccd$var$invert($76b1e110a27b1ccd$export$60b7b4bcf3903d8e);
59
+ const $76b1e110a27b1ccd$export$608ecc6f1b23c35d = {
60
+ none: 'cancel',
61
+ link: 'link',
62
+ copy: 'copy',
63
+ move: 'move'
64
+ };
65
+ const $76b1e110a27b1ccd$export$5eacb0769d26d3b2 = $76b1e110a27b1ccd$var$invert($76b1e110a27b1ccd$export$608ecc6f1b23c35d);
66
+ function $76b1e110a27b1ccd$var$invert(object) {
67
+ let res = {
68
+ };
69
+ for(let key in object)res[object[key]] = key;
70
+ return res;
103
71
  }
72
+ const $76b1e110a27b1ccd$export$4a7729b856e9a690 = new Set([
73
+ 'text/plain',
74
+ 'text/uri-list',
75
+ 'text/html'
76
+ ]);
77
+ const $76b1e110a27b1ccd$export$fd9f9fc120c5402d = 'application/vnd.react-aria.items+json';
78
+ const $76b1e110a27b1ccd$export$f8fc6581787339b3 = 'application/octet-stream';
104
79
 
105
- const $b29ea0269b2ea2bf4827b4fa19ddc83e$export$NATIVE_DRAG_TYPES = new Set(['text/plain', 'text/uri-list', 'text/html']);
106
- const $b29ea0269b2ea2bf4827b4fa19ddc83e$export$CUSTOM_DRAG_TYPE = 'application/vnd.react-aria.items+json';
107
- const $b29ea0269b2ea2bf4827b4fa19ddc83e$export$GENERIC_TYPE = 'application/octet-stream';
108
- const $bc29619458500c186021634c18dc$var$droppableCollectionIds = new WeakMap();
109
80
 
110
- function $bc29619458500c186021634c18dc$export$useDroppableCollectionId(state) {
111
- let id = useId();
112
- $bc29619458500c186021634c18dc$var$droppableCollectionIds.set(state, id);
113
- return id;
114
- }
115
-
116
- function $bc29619458500c186021634c18dc$export$getDroppableCollectionId(state) {
117
- let id = $bc29619458500c186021634c18dc$var$droppableCollectionIds.get(state);
118
81
 
119
- if (!id) {
120
- throw new Error('Droppable item outside a droppable collection');
121
- }
122
82
 
123
- return id;
83
+ const $4620ae0dc40f0031$var$droppableCollectionIds = new WeakMap();
84
+ function $4620ae0dc40f0031$export$b1601eb39394a581(state) {
85
+ let id = $4vY0V$reactariautils.useId();
86
+ $4620ae0dc40f0031$var$droppableCollectionIds.set(state, id);
87
+ return id;
124
88
  }
125
-
126
- function $bc29619458500c186021634c18dc$export$getTypes(items) {
127
- let types = new Set();
128
-
129
- for (let item of items) {
130
- for (let type of Object.keys(item)) {
131
- types.add(type);
132
- }
133
- }
134
-
135
- return types;
89
+ function $4620ae0dc40f0031$export$3093291712f09a77(state) {
90
+ let id = $4620ae0dc40f0031$var$droppableCollectionIds.get(state);
91
+ if (!id) throw new Error('Droppable item outside a droppable collection');
92
+ return id;
136
93
  }
137
-
138
- function $bc29619458500c186021634c18dc$var$mapModality(modality) {
139
- if (!modality) {
140
- modality = 'virtual';
141
- }
142
-
143
- if (modality === 'pointer') {
144
- modality = 'virtual';
145
- }
146
-
147
- if (modality === 'virtual' && 'ontouchstart' in window) {
148
- modality = 'touch';
149
- }
150
-
151
- return modality;
94
+ function $4620ae0dc40f0031$export$e1d41611756c6326(items) {
95
+ let types = new Set();
96
+ for (let item of items)for (let type of Object.keys(item))types.add(type);
97
+ return types;
152
98
  }
153
-
154
- function $bc29619458500c186021634c18dc$export$useDragModality() {
155
- return $bc29619458500c186021634c18dc$var$mapModality(useInteractionModality());
99
+ function $4620ae0dc40f0031$var$mapModality(modality) {
100
+ if (!modality) modality = 'virtual';
101
+ if (modality === 'pointer') modality = 'virtual';
102
+ if (modality === 'virtual' && 'ontouchstart' in window) modality = 'touch';
103
+ return modality;
156
104
  }
157
-
158
- function $bc29619458500c186021634c18dc$export$getDragModality() {
159
- return $bc29619458500c186021634c18dc$var$mapModality(getInteractionModality());
105
+ function $4620ae0dc40f0031$export$49bac5d6d4b352ea() {
106
+ return $4620ae0dc40f0031$var$mapModality($4vY0V$reactariainteractions.useInteractionModality());
160
107
  }
161
-
162
- function $bc29619458500c186021634c18dc$export$writeToDataTransfer(dataTransfer, items) {
163
- // The data transfer API doesn't support more than one item of a given type at once.
164
- // In addition, only a small set of types are supported natively for transfer between applications.
165
- // We allow for both multiple items, as well as multiple representations of a single item.
166
- // In order to make our API work with the native API, we serialize all items to JSON and
167
- // store as a single native item. We only need to do this if there is more than one item
168
- // of the same type, or if an item has more than one representation. Otherwise the native
169
- // API is sufficient.
170
- //
171
- // The DataTransferItemList API also theoretically supports adding files, which would enable
172
- // dragging binary data out of the browser onto the user's desktop for example. Unfortunately,
173
- // this does not currently work in any browser, so it is not currently supported by our API.
174
- // See e.g. https://bugs.chromium.org/p/chromium/issues/detail?id=438479.
175
- let groupedByType = new Map();
176
- let needsCustomData = false;
177
- let customData = [];
178
-
179
- for (let item of items) {
180
- let types = Object.keys(item);
181
-
182
- if (types.length > 1) {
183
- needsCustomData = true;
184
- }
185
-
186
- let dataByType = {};
187
-
188
- for (let type of types) {
189
- let typeItems = groupedByType.get(type);
190
-
191
- if (!typeItems) {
192
- typeItems = [];
193
- groupedByType.set(type, typeItems);
194
- } else {
195
- needsCustomData = true;
196
- }
197
-
198
- let data = item[type];
199
- dataByType[type] = data;
200
- typeItems.push(data);
201
- }
202
-
203
- customData.push(dataByType);
204
- }
205
-
206
- for (let [type, items] of groupedByType) {
207
- if ($b29ea0269b2ea2bf4827b4fa19ddc83e$export$NATIVE_DRAG_TYPES.has(type)) {
208
- // Only one item of a given type can be set on a data transfer.
209
- // Join all of the items together separated by newlines.
210
- let data = items.join('\n');
211
- dataTransfer.items.add(data, type);
212
- } else {
213
- // Set data to the first item so we have access to the list of types.
214
- dataTransfer.items.add(items[0], type);
215
- }
216
- }
217
-
218
- if (needsCustomData) {
219
- let data = JSON.stringify(customData);
220
- dataTransfer.items.add(data, $b29ea0269b2ea2bf4827b4fa19ddc83e$export$CUSTOM_DRAG_TYPE);
221
- }
108
+ function $4620ae0dc40f0031$export$1fb2158d224b542c() {
109
+ return $4620ae0dc40f0031$var$mapModality($4vY0V$reactariainteractions.getInteractionModality());
222
110
  }
223
-
224
- class $bc29619458500c186021634c18dc$export$DragTypes {
225
- constructor(dataTransfer) {
226
- this.types = void 0;
227
- this.includesUnknownTypes = void 0;
228
- this.types = new Set();
229
- let hasFiles = false;
230
-
231
- for (let item of dataTransfer.items) {
232
- if (item.type !== $b29ea0269b2ea2bf4827b4fa19ddc83e$export$CUSTOM_DRAG_TYPE) {
233
- if (item.kind === 'file') {
234
- hasFiles = true;
111
+ function $4620ae0dc40f0031$export$f9c1490890ddd063(dataTransfer, items) {
112
+ // The data transfer API doesn't support more than one item of a given type at once.
113
+ // In addition, only a small set of types are supported natively for transfer between applications.
114
+ // We allow for both multiple items, as well as multiple representations of a single item.
115
+ // In order to make our API work with the native API, we serialize all items to JSON and
116
+ // store as a single native item. We only need to do this if there is more than one item
117
+ // of the same type, or if an item has more than one representation. Otherwise the native
118
+ // API is sufficient.
119
+ //
120
+ // The DataTransferItemList API also theoretically supports adding files, which would enable
121
+ // dragging binary data out of the browser onto the user's desktop for example. Unfortunately,
122
+ // this does not currently work in any browser, so it is not currently supported by our API.
123
+ // See e.g. https://bugs.chromium.org/p/chromium/issues/detail?id=438479.
124
+ let groupedByType = new Map();
125
+ let needsCustomData = false;
126
+ let customData = [];
127
+ for (let item of items){
128
+ let types = Object.keys(item);
129
+ if (types.length > 1) needsCustomData = true;
130
+ let dataByType = {
131
+ };
132
+ for (let type of types){
133
+ let typeItems = groupedByType.get(type);
134
+ if (!typeItems) {
135
+ typeItems = [];
136
+ groupedByType.set(type, typeItems);
137
+ } else needsCustomData = true;
138
+ let data = item[type];
139
+ dataByType[type] = data;
140
+ typeItems.push(data);
235
141
  }
236
-
237
- if (item.type) {
238
- this.types.add(item.type);
239
- } else {
240
- // Files with unknown types or extensions that don't map to a known mime type
241
- // are sometimes exposed as an empty string by the browser. Map to a generic
242
- // mime type instead. Note that this could also be a directory as there's no
243
- // way to determine if something is a file or directory until drop.
244
- this.types.add($b29ea0269b2ea2bf4827b4fa19ddc83e$export$GENERIC_TYPE);
142
+ customData.push(dataByType);
143
+ }
144
+ for (let [type, items1] of groupedByType)if ($76b1e110a27b1ccd$export$4a7729b856e9a690.has(type)) {
145
+ // Only one item of a given type can be set on a data transfer.
146
+ // Join all of the items together separated by newlines.
147
+ let data = items1.join('\n');
148
+ dataTransfer.items.add(data, type);
149
+ } else // Set data to the first item so we have access to the list of types.
150
+ dataTransfer.items.add(items1[0], type);
151
+ if (needsCustomData) {
152
+ let data = JSON.stringify(customData);
153
+ dataTransfer.items.add(data, $76b1e110a27b1ccd$export$fd9f9fc120c5402d);
154
+ }
155
+ }
156
+ class $4620ae0dc40f0031$export$7f04ce188c91447c {
157
+ has(type) {
158
+ if (this.includesUnknownTypes) return true;
159
+ return this.types.has(type);
160
+ }
161
+ constructor(dataTransfer){
162
+ this.types = new Set();
163
+ let hasFiles = false;
164
+ for (let item of dataTransfer.items)if (item.type !== $76b1e110a27b1ccd$export$fd9f9fc120c5402d) {
165
+ if (item.kind === 'file') hasFiles = true;
166
+ if (item.type) this.types.add(item.type);
167
+ else // Files with unknown types or extensions that don't map to a known mime type
168
+ // are sometimes exposed as an empty string by the browser. Map to a generic
169
+ // mime type instead. Note that this could also be a directory as there's no
170
+ // way to determine if something is a file or directory until drop.
171
+ this.types.add($76b1e110a27b1ccd$export$f8fc6581787339b3);
245
172
  }
246
- }
247
- } // In Safari, when dragging files, the dataTransfer.items list is empty, but dataTransfer.types contains "Files".
248
- // Unfortunately, this doesn't tell us what types of files the user is dragging, so we need to assume that any
249
- // type the user checks for is included. See https://bugs.webkit.org/show_bug.cgi?id=223517.
250
-
251
-
252
- this.includesUnknownTypes = !hasFiles && dataTransfer.types.includes('Files');
253
- }
254
-
255
- has(type) {
256
- if (this.includesUnknownTypes) {
257
- return true;
173
+ // In Safari, when dragging files, the dataTransfer.items list is empty, but dataTransfer.types contains "Files".
174
+ // Unfortunately, this doesn't tell us what types of files the user is dragging, so we need to assume that any
175
+ // type the user checks for is included. See https://bugs.webkit.org/show_bug.cgi?id=223517.
176
+ this.includesUnknownTypes = !hasFiles && dataTransfer.types.includes('Files');
258
177
  }
259
-
260
- return this.types.has(type);
261
- }
262
-
263
178
  }
264
-
265
- function $bc29619458500c186021634c18dc$export$readFromDataTransfer(dataTransfer) {
266
- let items = []; // If our custom drag type is available, use that. This is a JSON serialized
267
- // representation of all items in the drag, set when there are multiple items
268
- // of the same type, or an individual item has multiple representations.
269
-
270
- let hasCustomType = false;
271
-
272
- if (dataTransfer.types.includes($b29ea0269b2ea2bf4827b4fa19ddc83e$export$CUSTOM_DRAG_TYPE)) {
273
- try {
274
- let data = dataTransfer.getData($b29ea0269b2ea2bf4827b4fa19ddc83e$export$CUSTOM_DRAG_TYPE);
275
- let parsed = JSON.parse(data);
276
-
277
- for (let item of parsed) {
278
- items.push({
279
- kind: 'text',
280
- types: new Set(Object.keys(item)),
281
- getText: type => Promise.resolve(item[type])
179
+ function $4620ae0dc40f0031$export$d9e760437831f8b3(dataTransfer) {
180
+ let items = [];
181
+ // If our custom drag type is available, use that. This is a JSON serialized
182
+ // representation of all items in the drag, set when there are multiple items
183
+ // of the same type, or an individual item has multiple representations.
184
+ let hasCustomType = false;
185
+ if (dataTransfer.types.includes($76b1e110a27b1ccd$export$fd9f9fc120c5402d)) try {
186
+ let data = dataTransfer.getData($76b1e110a27b1ccd$export$fd9f9fc120c5402d);
187
+ let parsed = JSON.parse(data);
188
+ for (let item of parsed)items.push({
189
+ kind: 'text',
190
+ types: new Set(Object.keys(item)),
191
+ getText: (type)=>Promise.resolve(item[type])
282
192
  });
283
- }
284
-
285
- hasCustomType = true;
286
- } catch (e) {// ignore
287
- }
288
- } // Otherwise, map native drag items to items of a single representation.
289
-
290
-
291
- if (!hasCustomType) {
292
- let stringItems = new Map();
293
-
294
- for (let item of dataTransfer.items) {
295
- if (item.kind === 'string') {
296
- // The data for all formats must be read here because the data transfer gets
297
- // cleared out after the event handler finishes. If the item has an empty string
298
- // as a type, the mime type is unknown. Map to a generic mime type instead.
299
- stringItems.set(item.type || $b29ea0269b2ea2bf4827b4fa19ddc83e$export$GENERIC_TYPE, dataTransfer.getData(item.type));
300
- } else if (item.kind === 'file') {
301
- // Despite the name, webkitGetAsEntry is also implemented in Firefox and Edge.
302
- // In the future, we may use getAsFileSystemHandle instead, but that's currently
303
- // only implemented in Chrome.
304
- if (typeof item.webkitGetAsEntry === 'function') {
305
- let entry = item.webkitGetAsEntry();
306
-
307
- if (!entry) {
308
- // For some reason, Firefox includes an item with type image/png when copy
309
- // and pasting any file or directory (no matter the type), but returns `null` for both
310
- // item.getAsFile() and item.webkitGetAsEntry(). Safari works as expected. Ignore this
311
- // item if this happens. See https://bugzilla.mozilla.org/show_bug.cgi?id=1699743.
312
- // This was recently fixed in Chrome Canary: https://bugs.chromium.org/p/chromium/issues/detail?id=1175483.
313
- continue;
314
- }
315
-
316
- if (entry.isFile) {
317
- items.push($bc29619458500c186021634c18dc$var$createFileItem(item.getAsFile()));
318
- } else if (entry.isDirectory) {
319
- items.push($bc29619458500c186021634c18dc$var$createDirectoryItem(entry));
320
- }
321
- } else {
322
- // Assume it's a file.
323
- items.push($bc29619458500c186021634c18dc$var$createFileItem(item.getAsFile()));
193
+ hasCustomType = true;
194
+ } catch (e) {
195
+ // ignore
196
+ }
197
+ // Otherwise, map native drag items to items of a single representation.
198
+ if (!hasCustomType) {
199
+ let stringItems = new Map();
200
+ for (let item of dataTransfer.items){
201
+ if (item.kind === 'string') // The data for all formats must be read here because the data transfer gets
202
+ // cleared out after the event handler finishes. If the item has an empty string
203
+ // as a type, the mime type is unknown. Map to a generic mime type instead.
204
+ stringItems.set(item.type || $76b1e110a27b1ccd$export$f8fc6581787339b3, dataTransfer.getData(item.type));
205
+ else if (item.kind === 'file') {
206
+ // Despite the name, webkitGetAsEntry is also implemented in Firefox and Edge.
207
+ // In the future, we may use getAsFileSystemHandle instead, but that's currently
208
+ // only implemented in Chrome.
209
+ if (typeof item.webkitGetAsEntry === 'function') {
210
+ let entry = item.webkitGetAsEntry();
211
+ if (!entry) continue;
212
+ if (entry.isFile) items.push($4620ae0dc40f0031$var$createFileItem(item.getAsFile()));
213
+ else if (entry.isDirectory) items.push($4620ae0dc40f0031$var$createDirectoryItem(entry));
214
+ } else // Assume it's a file.
215
+ items.push($4620ae0dc40f0031$var$createFileItem(item.getAsFile()));
216
+ }
324
217
  }
325
- }
326
- } // All string items are different representations of the same item. There's no way to have
327
- // multiple string items at once in the current DataTransfer API.
328
-
329
-
330
- if (stringItems.size > 0) {
331
- items.push({
332
- kind: 'text',
333
- types: new Set(stringItems.keys()),
334
- getText: type => Promise.resolve(stringItems.get(type))
335
- });
218
+ // All string items are different representations of the same item. There's no way to have
219
+ // multiple string items at once in the current DataTransfer API.
220
+ if (stringItems.size > 0) items.push({
221
+ kind: 'text',
222
+ types: new Set(stringItems.keys()),
223
+ getText: (type)=>Promise.resolve(stringItems.get(type))
224
+ });
336
225
  }
337
- }
338
-
339
- return items;
340
- }
341
-
342
- function $bc29619458500c186021634c18dc$var$blobToString(blob) {
343
- if (typeof blob.text === 'function') {
344
- return blob.text();
345
- } // Safari doesn't have the Blob#text() method yet...
346
-
347
-
348
- return new Promise((resolve, reject) => {
349
- let reader = new FileReader();
350
-
351
- reader.onload = () => {
352
- resolve(reader.result);
353
- };
354
-
355
- reader.onerror = reject;
356
- reader.readAsText(blob);
357
- });
226
+ return items;
358
227
  }
359
-
360
- function $bc29619458500c186021634c18dc$var$createFileItem(file) {
361
- return {
362
- kind: 'file',
363
- type: file.type || $b29ea0269b2ea2bf4827b4fa19ddc83e$export$GENERIC_TYPE,
364
- name: file.name,
365
- getText: () => $bc29619458500c186021634c18dc$var$blobToString(file),
366
- getFile: () => Promise.resolve(file)
367
- };
228
+ function $4620ae0dc40f0031$var$blobToString(blob) {
229
+ if (typeof blob.text === 'function') return blob.text();
230
+ // Safari doesn't have the Blob#text() method yet...
231
+ return new Promise((resolve, reject)=>{
232
+ let reader = new FileReader;
233
+ reader.onload = ()=>{
234
+ resolve(reader.result);
235
+ };
236
+ reader.onerror = reject;
237
+ reader.readAsText(blob);
238
+ });
368
239
  }
369
-
370
- function $bc29619458500c186021634c18dc$var$createDirectoryItem(entry) {
371
- return {
372
- kind: 'directory',
373
- name: entry.name,
374
- getEntries: () => $bc29619458500c186021634c18dc$var$_getEntries2(entry)
375
- };
240
+ function $4620ae0dc40f0031$var$createFileItem(file) {
241
+ return {
242
+ kind: 'file',
243
+ type: file.type || $76b1e110a27b1ccd$export$f8fc6581787339b3,
244
+ name: file.name,
245
+ getText: ()=>$4620ae0dc40f0031$var$blobToString(file)
246
+ ,
247
+ getFile: ()=>Promise.resolve(file)
248
+ };
376
249
  }
377
-
378
- function $bc29619458500c186021634c18dc$var$_getEntries2(_x) {
379
- return $bc29619458500c186021634c18dc$var$_getEntries.apply(this, arguments);
250
+ function $4620ae0dc40f0031$var$createDirectoryItem(entry) {
251
+ return {
252
+ kind: 'directory',
253
+ name: entry.name,
254
+ getEntries: ()=>$4620ae0dc40f0031$var$getEntries(entry)
255
+ };
380
256
  }
381
-
382
- function $bc29619458500c186021634c18dc$var$_getEntries() {
383
- $bc29619458500c186021634c18dc$var$_getEntries = _babelRuntimeHelpersWrapAsyncGenerator(function* (item) {
384
- let reader = item.createReader(); // We must call readEntries repeatedly because there may be a limit to the
257
+ async function* $4620ae0dc40f0031$var$getEntries(item) {
258
+ let reader = item.createReader();
259
+ // We must call readEntries repeatedly because there may be a limit to the
385
260
  // number of entries that are returned at once.
386
-
387
261
  let entries;
388
-
389
262
  do {
390
- entries = yield _babelRuntimeHelpersAwaitAsyncGenerator(new Promise((resolve, reject) => {
391
- reader.readEntries(resolve, reject);
392
- }));
393
-
394
- for (let entry of entries) {
395
- if (entry.isFile) {
396
- let file = yield _babelRuntimeHelpersAwaitAsyncGenerator($bc29619458500c186021634c18dc$var$getEntryFile(entry));
397
- yield $bc29619458500c186021634c18dc$var$createFileItem(file);
398
- } else if (entry.isDirectory) {
399
- yield $bc29619458500c186021634c18dc$var$createDirectoryItem(entry);
263
+ entries = await new Promise((resolve, reject)=>{
264
+ reader.readEntries(resolve, reject);
265
+ });
266
+ for (let entry of entries){
267
+ if (entry.isFile) {
268
+ let file = await $4620ae0dc40f0031$var$getEntryFile(entry);
269
+ yield $4620ae0dc40f0031$var$createFileItem(file);
270
+ } else if (entry.isDirectory) yield $4620ae0dc40f0031$var$createDirectoryItem(entry);
400
271
  }
401
- }
402
- } while (entries.length > 0);
403
- });
404
- return $bc29619458500c186021634c18dc$var$_getEntries.apply(this, arguments);
272
+ }while (entries.length > 0)
405
273
  }
406
-
407
- function $bc29619458500c186021634c18dc$var$getEntryFile(entry) {
408
- return new Promise((resolve, reject) => entry.file(resolve, reject));
274
+ function $4620ae0dc40f0031$var$getEntryFile(entry) {
275
+ return new Promise((resolve, reject)=>entry.file(resolve, reject)
276
+ );
409
277
  }
410
278
 
411
- let $a75d092e5c30878812fba78e$var$dropTargets = new Map();
412
- let $a75d092e5c30878812fba78e$var$dropItems = new Map();
413
- let $a75d092e5c30878812fba78e$var$dragSession = null;
414
- let $a75d092e5c30878812fba78e$var$subscriptions = new Set();
415
-
416
- function $a75d092e5c30878812fba78e$export$registerDropTarget(target) {
417
- var _dragSession;
418
279
 
419
- $a75d092e5c30878812fba78e$var$dropTargets.set(target.element, target);
420
- (_dragSession = $a75d092e5c30878812fba78e$var$dragSession) == null ? void 0 : _dragSession.updateValidDropTargets();
421
- return () => {
422
- var _dragSession2;
423
280
 
424
- $a75d092e5c30878812fba78e$var$dropTargets.delete(target.element);
425
- (_dragSession2 = $a75d092e5c30878812fba78e$var$dragSession) == null ? void 0 : _dragSession2.updateValidDropTargets();
426
- };
281
+ let $28e10663603f5ea1$var$dropTargets = new Map();
282
+ let $28e10663603f5ea1$var$dropItems = new Map();
283
+ let $28e10663603f5ea1$var$dragSession = null;
284
+ let $28e10663603f5ea1$var$subscriptions = new Set();
285
+ function $28e10663603f5ea1$export$c28d9fb4a54e471a(target) {
286
+ $28e10663603f5ea1$var$dropTargets.set(target.element, target);
287
+ $28e10663603f5ea1$var$dragSession === null || $28e10663603f5ea1$var$dragSession === void 0 ? void 0 : $28e10663603f5ea1$var$dragSession.updateValidDropTargets();
288
+ return ()=>{
289
+ $28e10663603f5ea1$var$dropTargets.delete(target.element);
290
+ $28e10663603f5ea1$var$dragSession === null || $28e10663603f5ea1$var$dragSession === void 0 ? void 0 : $28e10663603f5ea1$var$dragSession.updateValidDropTargets();
291
+ };
427
292
  }
428
-
429
- function $a75d092e5c30878812fba78e$export$registerDropItem(item) {
430
- $a75d092e5c30878812fba78e$var$dropItems.set(item.element, item);
431
- return () => {
432
- $a75d092e5c30878812fba78e$var$dropItems.delete(item.element);
433
- };
293
+ function $28e10663603f5ea1$export$aef80212ac99c003(item) {
294
+ $28e10663603f5ea1$var$dropItems.set(item.element, item);
295
+ return ()=>{
296
+ $28e10663603f5ea1$var$dropItems.delete(item.element);
297
+ };
434
298
  }
435
-
436
- function $a75d092e5c30878812fba78e$export$beginDragging(target, formatMessage) {
437
- if ($a75d092e5c30878812fba78e$var$dragSession) {
438
- throw new Error('Cannot begin dragging while already dragging');
439
- }
440
-
441
- $a75d092e5c30878812fba78e$var$dragSession = new $a75d092e5c30878812fba78e$var$DragSession(target, formatMessage);
442
- requestAnimationFrame(() => {
443
- $a75d092e5c30878812fba78e$var$dragSession.setup();
444
-
445
- if ($bc29619458500c186021634c18dc$export$getDragModality() === 'keyboard') {
446
- $a75d092e5c30878812fba78e$var$dragSession.next();
447
- }
448
- });
449
-
450
- for (let cb of $a75d092e5c30878812fba78e$var$subscriptions) {
451
- cb();
452
- }
299
+ function $28e10663603f5ea1$export$549dbcf8649bf3b2(target, formatMessage) {
300
+ if ($28e10663603f5ea1$var$dragSession) throw new Error('Cannot begin dragging while already dragging');
301
+ $28e10663603f5ea1$var$dragSession = new $28e10663603f5ea1$var$DragSession(target, formatMessage);
302
+ requestAnimationFrame(()=>{
303
+ $28e10663603f5ea1$var$dragSession.setup();
304
+ if ($4620ae0dc40f0031$export$1fb2158d224b542c() === 'keyboard') $28e10663603f5ea1$var$dragSession.next();
305
+ });
306
+ for (let cb of $28e10663603f5ea1$var$subscriptions)cb();
453
307
  }
454
-
455
- function $a75d092e5c30878812fba78e$export$useDragSession() {
456
- let [session, setSession] = useState($a75d092e5c30878812fba78e$var$dragSession);
457
- useEffect(() => {
458
- let cb = () => setSession($a75d092e5c30878812fba78e$var$dragSession);
459
-
460
- $a75d092e5c30878812fba78e$var$subscriptions.add(cb);
461
- return () => {
462
- $a75d092e5c30878812fba78e$var$subscriptions.delete(cb);
463
- };
464
- }, []);
465
- return session;
308
+ function $28e10663603f5ea1$export$418e185dd3f1b968() {
309
+ let [session, setSession] = $4vY0V$react.useState($28e10663603f5ea1$var$dragSession);
310
+ $4vY0V$react.useEffect(()=>{
311
+ let cb = ()=>setSession($28e10663603f5ea1$var$dragSession)
312
+ ;
313
+ $28e10663603f5ea1$var$subscriptions.add(cb);
314
+ return ()=>{
315
+ $28e10663603f5ea1$var$subscriptions.delete(cb);
316
+ };
317
+ }, []);
318
+ return session;
466
319
  }
467
-
468
- function $a75d092e5c30878812fba78e$var$endDragging() {
469
- $a75d092e5c30878812fba78e$var$dragSession = null;
470
-
471
- for (let cb of $a75d092e5c30878812fba78e$var$subscriptions) {
472
- cb();
473
- }
320
+ function $28e10663603f5ea1$var$endDragging() {
321
+ $28e10663603f5ea1$var$dragSession = null;
322
+ for (let cb of $28e10663603f5ea1$var$subscriptions)cb();
474
323
  }
475
-
476
- const $a75d092e5c30878812fba78e$var$CANCELED_EVENTS = ['pointerdown', 'pointermove', 'pointerenter', 'pointerleave', 'pointerover', 'pointerout', 'pointerup', 'mousedown', 'mousemove', 'mouseenter', 'mouseleave', 'mouseover', 'mouseout', 'mouseup', 'touchstart', 'touchmove', 'touchend', 'keyup', 'focusin', 'focusout'];
477
- const $a75d092e5c30878812fba78e$var$CLICK_EVENTS = ['pointerup', 'mouseup', 'touchend'];
478
- const $a75d092e5c30878812fba78e$var$MESSAGES = {
479
- keyboard: 'dragStartedKeyboard',
480
- touch: 'dragStartedTouch',
481
- virtual: 'dragStartedVirtual'
482
- };
483
-
484
- class $a75d092e5c30878812fba78e$var$DragSession {
485
- constructor(target, formatMessage) {
486
- this.dragTarget = void 0;
487
- this.validDropTargets = void 0;
488
- this.currentDropTarget = void 0;
489
- this.currentDropItem = void 0;
490
- this.dropOperation = void 0;
491
- this.mutationObserver = void 0;
492
- this.mutationImmediate = void 0;
493
- this.restoreAriaHidden = void 0;
494
- this.formatMessage = void 0;
495
- this.dragTarget = target;
496
- this.formatMessage = formatMessage;
497
- this.onKeyDown = this.onKeyDown.bind(this);
498
- this.onFocus = this.onFocus.bind(this);
499
- this.onBlur = this.onBlur.bind(this);
500
- this.onClick = this.onClick.bind(this);
501
- this.cancelEvent = this.cancelEvent.bind(this);
502
- }
503
-
504
- setup() {
505
- document.addEventListener('keydown', this.onKeyDown, true);
506
- window.addEventListener('focus', this.onFocus, true);
507
- window.addEventListener('blur', this.onBlur, true);
508
- document.addEventListener('click', this.onClick, true);
509
-
510
- for (let event of $a75d092e5c30878812fba78e$var$CANCELED_EVENTS) {
511
- document.addEventListener(event, this.cancelEvent, true);
324
+ function $28e10663603f5ea1$export$7454aff2e161f241(element) {
325
+ for (let target of $28e10663603f5ea1$var$dropTargets.keys()){
326
+ if (target.contains(element)) return true;
512
327
  }
513
-
514
- this.mutationObserver = new MutationObserver(() => {
515
- // JSDOM has a bug where MutationObserver enters an infinite loop if mutations
516
- // occur inside a MutationObserver callback. If running in Node, wait until
517
- // the next tick to update valid drop targets.
518
- // See https://github.com/jsdom/jsdom/issues/3096
519
- if (typeof setImmediate === 'function') {
520
- this.mutationImmediate = setImmediate(() => this.updateValidDropTargets());
521
- } else {
328
+ return false;
329
+ }
330
+ const $28e10663603f5ea1$var$CANCELED_EVENTS = [
331
+ 'pointerdown',
332
+ 'pointermove',
333
+ 'pointerenter',
334
+ 'pointerleave',
335
+ 'pointerover',
336
+ 'pointerout',
337
+ 'pointerup',
338
+ 'mousedown',
339
+ 'mousemove',
340
+ 'mouseenter',
341
+ 'mouseleave',
342
+ 'mouseover',
343
+ 'mouseout',
344
+ 'mouseup',
345
+ 'touchstart',
346
+ 'touchmove',
347
+ 'touchend',
348
+ 'keyup',
349
+ 'focusin',
350
+ 'focusout'
351
+ ];
352
+ const $28e10663603f5ea1$var$CLICK_EVENTS = [
353
+ 'pointerup',
354
+ 'mouseup',
355
+ 'touchend'
356
+ ];
357
+ const $28e10663603f5ea1$var$MESSAGES = {
358
+ keyboard: 'dragStartedKeyboard',
359
+ touch: 'dragStartedTouch',
360
+ virtual: 'dragStartedVirtual'
361
+ };
362
+ class $28e10663603f5ea1$var$DragSession {
363
+ setup() {
364
+ document.addEventListener('keydown', this.onKeyDown, true);
365
+ window.addEventListener('focus', this.onFocus, true);
366
+ window.addEventListener('blur', this.onBlur, true);
367
+ document.addEventListener('click', this.onClick, true);
368
+ document.addEventListener('pointerdown', this.onPointerDown, true);
369
+ for (let event of $28e10663603f5ea1$var$CANCELED_EVENTS)document.addEventListener(event, this.cancelEvent, true);
370
+ this.mutationObserver = new MutationObserver(()=>this.updateValidDropTargets()
371
+ );
522
372
  this.updateValidDropTargets();
523
- }
524
- });
525
- this.updateValidDropTargets();
526
- announce(this.formatMessage($a75d092e5c30878812fba78e$var$MESSAGES[$bc29619458500c186021634c18dc$export$getDragModality()]));
527
- }
528
-
529
- teardown() {
530
- document.removeEventListener('keydown', this.onKeyDown, true);
531
- window.removeEventListener('focus', this.onFocus, true);
532
- window.removeEventListener('blur', this.onBlur, true);
533
- document.removeEventListener('click', this.onClick, true);
534
-
535
- for (let event of $a75d092e5c30878812fba78e$var$CANCELED_EVENTS) {
536
- document.removeEventListener(event, this.cancelEvent, true);
537
- }
538
-
539
- this.mutationObserver.disconnect();
540
- this.restoreAriaHidden();
541
-
542
- if (this.mutationImmediate) {
543
- clearImmediate(this.mutationImmediate);
544
- }
545
- }
546
-
547
- onKeyDown(e) {
548
- var _this$currentDropTarg;
549
-
550
- this.cancelEvent(e);
551
-
552
- if (e.key === 'Escape') {
553
- this.cancel();
554
- return;
555
- }
556
-
557
- if (e.key === 'Enter') {
558
- if (e.altKey) {
559
- this.activate();
560
- } else {
561
- this.drop();
562
- }
563
-
564
- return;
565
- }
566
-
567
- if (e.key === 'Tab' && !(e.metaKey || e.altKey || e.ctrlKey)) {
568
- if (e.shiftKey) {
569
- this.previous();
570
- } else {
571
- this.next();
572
- }
573
- }
574
-
575
- if (typeof ((_this$currentDropTarg = this.currentDropTarget) == null ? void 0 : _this$currentDropTarg.onKeyDown) === 'function') {
576
- this.currentDropTarget.onKeyDown(e, this.dragTarget);
577
- }
578
- }
579
-
580
- onFocus(e) {
581
- // Prevent focus events, except to the original drag target.
582
- if (e.target !== this.dragTarget.element) {
583
- this.cancelEvent(e);
584
- } // Ignore focus events on the window/document (JSDOM). Will be handled in onBlur, below.
585
-
586
-
587
- if (!(e.target instanceof HTMLElement) || e.target === this.dragTarget.element) {
588
- return;
589
- }
590
-
591
- let dropTarget = this.validDropTargets.find(target => target.element.contains(e.target));
592
-
593
- if (!dropTarget) {
594
- if (this.currentDropTarget) {
595
- this.currentDropTarget.element.focus();
596
- } else {
597
- this.dragTarget.element.focus();
598
- }
599
-
600
- return;
601
- }
602
-
603
- let item = $a75d092e5c30878812fba78e$var$dropItems.get(e.target);
604
- this.setCurrentDropTarget(dropTarget, item);
605
- }
606
-
607
- onBlur(e) {
608
- if (e.target !== this.dragTarget.element) {
609
- this.cancelEvent(e);
610
- } // If nothing is gaining focus, or e.relatedTarget is the window/document (JSDOM),
611
- // restore focus back to the current drop target if any, or the original drag target.
612
-
613
-
614
- if (!e.relatedTarget || !(e.relatedTarget instanceof HTMLElement)) {
615
- if (this.currentDropTarget) {
616
- this.currentDropTarget.element.focus();
617
- } else {
618
- this.dragTarget.element.focus();
619
- }
620
- }
621
- }
622
-
623
- onClick(e) {
624
- this.cancelEvent(e);
625
-
626
- if (e.detail !== 0) {
627
- return;
628
- }
629
-
630
- if (e.target === this.dragTarget.element) {
631
- this.cancel();
632
- return;
633
- }
634
-
635
- let dropTarget = this.validDropTargets.find(target => target.element.contains(e.target));
636
-
637
- if (dropTarget) {
638
- let item = $a75d092e5c30878812fba78e$var$dropItems.get(e.target);
639
- this.setCurrentDropTarget(dropTarget, item);
640
- this.drop(item);
641
- }
642
- }
643
-
644
- cancelEvent(e) {
645
- // Allow default for events that might cancel a click event
646
- if (!$a75d092e5c30878812fba78e$var$CLICK_EVENTS.includes(e.type)) {
647
- e.preventDefault();
648
- }
649
-
650
- e.stopPropagation();
651
- e.stopImmediatePropagation();
652
- }
653
-
654
- updateValidDropTargets() {
655
- if (!this.mutationObserver) {
656
- return;
657
- }
658
-
659
- this.mutationObserver.disconnect();
660
-
661
- if (this.restoreAriaHidden) {
662
- this.restoreAriaHidden();
663
- }
664
-
665
- this.validDropTargets = $a75d092e5c30878812fba78e$var$findValidDropTargets(this.dragTarget);
666
-
667
- if (this.currentDropTarget && !this.validDropTargets.includes(this.currentDropTarget)) {
668
- this.setCurrentDropTarget(this.validDropTargets[0]);
669
- } // Find valid drop items within collections
670
-
671
-
672
- let types = $bc29619458500c186021634c18dc$export$getTypes(this.dragTarget.items);
673
- let validDropItems = [...$a75d092e5c30878812fba78e$var$dropItems.values()].filter(item => {
674
- if (typeof item.getDropOperation === 'function') {
675
- return item.getDropOperation(types, this.dragTarget.allowedDropOperations) !== 'cancel';
676
- }
677
-
678
- return true;
679
- }); // Filter out drop targets that contain valid items. We don't want to stop hiding elements
680
- // other than the drop items that exist inside the collection.
681
-
682
- let visibleDropTargets = this.validDropTargets.filter(target => !validDropItems.some(item => target.element.contains(item.element)));
683
- this.restoreAriaHidden = ariaHideOutside([this.dragTarget.element, ...validDropItems.map(item => item.element), ...visibleDropTargets.map(target => target.element)]);
684
- this.mutationObserver.observe(document.body, {
685
- subtree: true,
686
- attributes: true,
687
- attributeFilter: ['aria-hidden']
688
- });
689
- }
690
-
691
- next() {
692
- if (!this.currentDropTarget) {
693
- this.setCurrentDropTarget(this.validDropTargets[0]);
694
- return;
695
- }
696
-
697
- let index = this.validDropTargets.indexOf(this.currentDropTarget);
698
-
699
- if (index < 0) {
700
- this.setCurrentDropTarget(this.validDropTargets[0]);
701
- return;
702
- } // If we've reached the end of the valid drop targets, cycle back to the original drag target.
703
- // This lets the user cancel the drag in case they don't have an Escape key (e.g. iPad keyboard case).
704
-
705
-
706
- if (index === this.validDropTargets.length - 1) {
707
- if (!this.dragTarget.element.closest('[aria-hidden="true"]')) {
708
- this.setCurrentDropTarget(null);
709
- this.dragTarget.element.focus();
710
- } else {
711
- this.setCurrentDropTarget(this.validDropTargets[0]);
712
- }
713
- } else {
714
- this.setCurrentDropTarget(this.validDropTargets[index + 1]);
715
- }
716
- }
717
-
718
- previous() {
719
- if (!this.currentDropTarget) {
720
- this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);
721
- return;
722
- }
723
-
724
- let index = this.validDropTargets.indexOf(this.currentDropTarget);
725
-
726
- if (index < 0) {
727
- this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);
728
- return;
729
- } // If we've reached the start of the valid drop targets, cycle back to the original drag target.
730
- // This lets the user cancel the drag in case they don't have an Escape key (e.g. iPad keyboard case).
731
-
732
-
733
- if (index === 0) {
734
- if (!this.dragTarget.element.closest('[aria-hidden="true"]')) {
735
- this.setCurrentDropTarget(null);
736
- this.dragTarget.element.focus();
737
- } else {
738
- this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);
739
- }
740
- } else {
741
- this.setCurrentDropTarget(this.validDropTargets[index - 1]);
742
- }
743
- }
744
-
745
- setCurrentDropTarget(dropTarget, item) {
746
- if (dropTarget !== this.currentDropTarget) {
747
- if (this.currentDropTarget && typeof this.currentDropTarget.onDropExit === 'function') {
748
- let rect = this.currentDropTarget.element.getBoundingClientRect();
749
- this.currentDropTarget.onDropExit({
750
- type: 'dropexit',
751
- x: rect.left + rect.width / 2,
752
- y: rect.top + rect.height / 2
753
- });
754
- }
755
-
756
- this.currentDropTarget = dropTarget;
757
-
758
- if (dropTarget) {
759
- if (typeof dropTarget.onDropEnter === 'function') {
760
- let rect = dropTarget.element.getBoundingClientRect();
761
- dropTarget.onDropEnter({
762
- type: 'dropenter',
763
- x: rect.left + rect.width / 2,
764
- y: rect.top + rect.height / 2
765
- }, this.dragTarget);
373
+ $4vY0V$reactarialiveannouncer.announce(this.formatMessage($28e10663603f5ea1$var$MESSAGES[$4620ae0dc40f0031$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
+ document.removeEventListener('pointerdown', this.onPointerDown, true);
381
+ for (let event of $28e10663603f5ea1$var$CANCELED_EVENTS)document.removeEventListener(event, this.cancelEvent, true);
382
+ this.mutationObserver.disconnect();
383
+ this.restoreAriaHidden();
384
+ if (this.mutationImmediate) clearImmediate(this.mutationImmediate);
385
+ }
386
+ onKeyDown(e) {
387
+ var ref;
388
+ this.cancelEvent(e);
389
+ if (e.key === 'Escape') {
390
+ this.cancel();
391
+ return;
766
392
  }
767
-
768
- if (!item) {
769
- dropTarget == null ? void 0 : dropTarget.element.focus();
393
+ if (e.key === 'Enter') {
394
+ if (e.altKey) this.activate();
395
+ else this.drop();
396
+ return;
770
397
  }
771
- }
772
- }
773
-
774
- if (item !== this.currentDropItem) {
775
- if (item && typeof this.currentDropTarget.onDropTargetEnter === 'function') {
776
- this.currentDropTarget.onDropTargetEnter(item == null ? void 0 : item.target);
777
- }
778
-
779
- item == null ? void 0 : item.element.focus();
780
- this.currentDropItem = item;
781
- }
782
- }
783
-
784
- end() {
785
- this.teardown();
786
-
787
- if (typeof this.dragTarget.onDragEnd === 'function') {
788
- let target = this.currentDropTarget && this.dropOperation !== 'cancel' ? this.currentDropTarget : this.dragTarget;
789
- let rect = target.element.getBoundingClientRect();
790
- this.dragTarget.onDragEnd({
791
- type: 'dragend',
792
- x: rect.x + rect.width / 2,
793
- y: rect.y + rect.height / 2,
794
- dropOperation: this.dropOperation
795
- });
796
- }
797
-
798
- this.setCurrentDropTarget(null);
799
- $a75d092e5c30878812fba78e$var$endDragging();
800
- }
801
-
802
- cancel() {
803
- this.end();
804
-
805
- if (!this.dragTarget.element.closest('[aria-hidden="true"]')) {
806
- this.dragTarget.element.focus();
807
- }
808
-
809
- announce(this.formatMessage('dropCanceled'));
810
- }
811
-
812
- drop(item) {
813
- if (!this.currentDropTarget) {
814
- this.cancel();
815
- return;
816
- }
817
-
818
- if (typeof (item == null ? void 0 : item.getDropOperation) === 'function') {
819
- let types = $bc29619458500c186021634c18dc$export$getTypes(this.dragTarget.items);
820
- this.dropOperation = item.getDropOperation(types, this.dragTarget.allowedDropOperations);
821
- } else if (typeof this.currentDropTarget.getDropOperation === 'function') {
822
- let types = $bc29619458500c186021634c18dc$export$getTypes(this.dragTarget.items);
823
- this.dropOperation = this.currentDropTarget.getDropOperation(types, this.dragTarget.allowedDropOperations);
824
- } else {
825
- // TODO: show menu ??
826
- this.dropOperation = this.dragTarget.allowedDropOperations[0];
827
- }
828
-
829
- if (typeof this.currentDropTarget.onDrop === 'function') {
830
- let items = this.dragTarget.items.map(item => ({
831
- kind: 'text',
832
- types: new Set(Object.keys(item)),
833
- getText: type => Promise.resolve(item[type])
834
- }));
835
- let rect = this.currentDropTarget.element.getBoundingClientRect();
836
- this.currentDropTarget.onDrop({
837
- type: 'drop',
838
- x: rect.left + rect.width / 2,
839
- y: rect.top + rect.height / 2,
840
- items,
841
- dropOperation: this.dropOperation
842
- }, item == null ? void 0 : item.target);
843
- }
844
-
845
- this.end();
846
- announce(this.formatMessage('dropComplete'));
847
- }
848
-
849
- activate() {
850
- if (this.currentDropTarget && typeof this.currentDropTarget.onDropActivate === 'function') {
851
- let rect = this.currentDropTarget.element.getBoundingClientRect();
852
- this.currentDropTarget.onDropActivate({
853
- type: 'dropactivate',
854
- x: rect.left + rect.width / 2,
855
- y: rect.top + rect.height / 2
856
- });
857
- }
858
- }
859
-
860
- }
861
-
862
- function $a75d092e5c30878812fba78e$var$findValidDropTargets(options) {
863
- let types = $bc29619458500c186021634c18dc$export$getTypes(options.items);
864
- return [...$a75d092e5c30878812fba78e$var$dropTargets.values()].filter(target => {
865
- if (target.element.closest('[aria-hidden="true"]')) {
866
- return false;
867
- }
868
-
869
- if (typeof target.getDropOperation === 'function') {
870
- return target.getDropOperation(types, options.allowedDropOperations) !== 'cancel';
871
- }
872
-
873
- return true;
874
- });
875
- }
876
-
877
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/dnd/intl/en-US.json
878
- var $ece80d58838919a4624d1c28b393f77$exports = {};
879
- $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}\"}");
880
- // @ts-ignore
881
- const $faa3fd9c929dcb7fde0b75ef821032d3$var$intlMessages = {
882
- "en-US": _babelRuntimeHelpersInteropRequireDefault($ece80d58838919a4624d1c28b393f77$exports).default
883
- };
884
- const $faa3fd9c929dcb7fde0b75ef821032d3$var$MESSAGES = {
885
- keyboard: {
886
- start: 'dragDescriptionKeyboard',
887
- end: 'endDragKeyboard'
888
- },
889
- touch: {
890
- start: 'dragDescriptionTouch',
891
- end: 'endDragTouch'
892
- },
893
- virtual: {
894
- start: 'dragDescriptionVirtual',
895
- end: 'endDragVirtual'
896
- }
897
- };
898
-
899
- function useDrag(options) {
900
- let formatMessage = useMessageFormatter($faa3fd9c929dcb7fde0b75ef821032d3$var$intlMessages);
901
- let state = useRef({
902
- options,
903
- x: 0,
904
- y: 0
905
- }).current;
906
- state.options = options;
907
- let [isDragging, setDragging] = useState(false);
908
-
909
- let onDragStart = e => {
910
- let items = options.getItems();
911
- $bc29619458500c186021634c18dc$export$writeToDataTransfer(e.dataTransfer, items);
912
-
913
- if (typeof options.getAllowedDropOperations === 'function') {
914
- let allowedOperations = options.getAllowedDropOperations();
915
- let allowed = $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.none;
916
-
917
- for (let operation of allowedOperations) {
918
- allowed |= $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION[operation] || $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.none;
919
- }
920
-
921
- e.dataTransfer.effectAllowed = $b29ea0269b2ea2bf4827b4fa19ddc83e$export$EFFECT_ALLOWED[allowed] || 'none';
922
- } // If there is a renderPreview function, use it to render a custom preview image that will
923
- // appear under the pointer while dragging. If not, the element itself is dragged by the browser.
924
-
925
-
926
- if (typeof options.renderPreview === 'function') {
927
- let preview = options.renderPreview(items);
928
-
929
- if (preview) {
930
- // Create an off-screen div to render the preview into.
931
- let node = document.createElement('div');
932
- node.style.zIndex = '-100';
933
- node.style.position = 'absolute';
934
- node.style.top = '0';
935
- node.style.left = '-100000px';
936
- document.body.appendChild(node); // Call renderPreview to get a JSX element, and render it into the div with React DOM.
937
-
938
- _reactDom.render(preview, node); // Compute the offset that the preview will appear under the mouse.
939
- // If possible, this is based on the point the user clicked on the target.
940
- // If the preview is much smaller, then just use the center point of the preview.
941
-
942
-
943
- let size = node.getBoundingClientRect();
944
- let rect = e.currentTarget.getBoundingClientRect();
945
- let x = e.clientX - rect.x;
946
- let y = e.clientY - rect.y;
947
-
948
- if (x > size.width || y > size.height) {
949
- x = size.width / 2;
950
- y = size.height / 2;
398
+ if (e.key === 'Tab' && !(e.metaKey || e.altKey || e.ctrlKey)) {
399
+ if (e.shiftKey) this.previous();
400
+ else this.next();
951
401
  }
952
-
953
- e.dataTransfer.setDragImage(node, x, y); // Remove the preview from the DOM after a frame so the browser has time to paint.
954
-
955
- requestAnimationFrame(() => {
956
- document.body.removeChild(node);
957
- });
958
- }
959
- }
960
-
961
- if (typeof options.onDragStart === 'function') {
962
- options.onDragStart({
963
- type: 'dragstart',
964
- x: e.clientX,
965
- y: e.clientY
966
- });
967
- }
968
-
969
- state.x = e.clientX;
970
- state.y = e.clientY; // Wait a frame before we set dragging to true so that the browser has time to
971
- // render the preview image before we update the element that has been dragged.
972
-
973
- requestAnimationFrame(() => {
974
- setDragging(true);
975
- });
976
- };
977
-
978
- let onDrag = e => {
979
- if (e.clientX === state.x && e.clientY === state.y) {
980
- return;
981
- }
982
-
983
- if (typeof options.onDragMove === 'function') {
984
- options.onDragMove({
985
- type: 'dragmove',
986
- x: e.clientX,
987
- y: e.clientY
988
- });
989
- }
990
-
991
- state.x = e.clientX;
992
- state.y = e.clientY;
993
- };
994
-
995
- let onDragEnd = e => {
996
- if (typeof options.onDragEnd === 'function') {
997
- options.onDragEnd({
998
- type: 'dragend',
999
- x: e.clientX,
1000
- y: e.clientY,
1001
- dropOperation: $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_EFFECT_TO_DROP_OPERATION[e.dataTransfer.dropEffect]
1002
- });
1003
- }
1004
-
1005
- setDragging(false);
1006
- };
1007
-
1008
- let onPress = e => {
1009
- if (e.pointerType !== 'keyboard' && e.pointerType !== 'virtual') {
1010
- return;
1011
- }
1012
-
1013
- if (typeof state.options.onDragStart === 'function') {
1014
- let rect = e.target.getBoundingClientRect();
1015
- state.options.onDragStart({
1016
- type: 'dragstart',
1017
- x: rect.x + rect.width / 2,
1018
- y: rect.y + rect.height / 2
1019
- });
1020
- }
1021
-
1022
- $a75d092e5c30878812fba78e$export$beginDragging({
1023
- element: e.target,
1024
- items: state.options.getItems(),
1025
- allowedDropOperations: typeof state.options.getAllowedDropOperations === 'function' ? state.options.getAllowedDropOperations() : ['move', 'copy', 'link'],
1026
-
1027
- onDragEnd(e) {
1028
- setDragging(false);
1029
-
1030
- if (typeof state.options.onDragEnd === 'function') {
1031
- state.options.onDragEnd(e);
402
+ if (typeof ((ref = this.currentDropTarget) === null || ref === void 0 ? void 0 : ref.onKeyDown) === 'function') this.currentDropTarget.onKeyDown(e, this.dragTarget);
403
+ }
404
+ onFocus(e) {
405
+ // Prevent focus events, except to the original drag target.
406
+ if (e.target !== this.dragTarget.element) this.cancelEvent(e);
407
+ // Ignore focus events on the window/document (JSDOM). Will be handled in onBlur, below.
408
+ if (!(e.target instanceof HTMLElement) || e.target === this.dragTarget.element) return;
409
+ let dropTarget = this.validDropTargets.find((target)=>target.element.contains(e.target)
410
+ );
411
+ if (!dropTarget) {
412
+ if (this.currentDropTarget) this.currentDropTarget.element.focus();
413
+ else this.dragTarget.element.focus();
414
+ return;
415
+ }
416
+ let item = $28e10663603f5ea1$var$dropItems.get(e.target);
417
+ this.setCurrentDropTarget(dropTarget, item);
418
+ }
419
+ onBlur(e) {
420
+ if (e.target !== this.dragTarget.element) this.cancelEvent(e);
421
+ // If nothing is gaining focus, or e.relatedTarget is the window/document (JSDOM),
422
+ // restore focus back to the current drop target if any, or the original drag target.
423
+ if (!e.relatedTarget || !(e.relatedTarget instanceof HTMLElement)) {
424
+ if (this.currentDropTarget) this.currentDropTarget.element.focus();
425
+ else this.dragTarget.element.focus();
1032
426
  }
1033
- }
1034
-
1035
- }, formatMessage);
1036
- setDragging(true);
1037
- };
1038
-
1039
- let modality = $bc29619458500c186021634c18dc$export$useDragModality();
1040
- let descriptionProps = useDescription(formatMessage(!isDragging ? $faa3fd9c929dcb7fde0b75ef821032d3$var$MESSAGES[modality].start : $faa3fd9c929dcb7fde0b75ef821032d3$var$MESSAGES[modality].end));
1041
- return {
1042
- dragProps: {
1043
- draggable: 'true',
1044
- onDragStart,
1045
- onDrag,
1046
- onDragEnd
1047
- },
1048
- dragButtonProps: _babelRuntimeHelpersExtends({}, descriptionProps, {
1049
- onPress
1050
- }),
1051
- isDragging
1052
- };
1053
- }
1054
-
1055
- exports.useDrag = useDrag;
1056
- // @ts-ignore
1057
- const $ca75888e192994dbb11ae05e54$var$intlMessages = {
1058
- "en-US": _babelRuntimeHelpersInteropRequireDefault($ece80d58838919a4624d1c28b393f77$exports).default
1059
- };
1060
- const $ca75888e192994dbb11ae05e54$var$MESSAGES = {
1061
- keyboard: 'dropDescriptionKeyboard',
1062
- touch: 'dropDescriptionTouch',
1063
- virtual: 'dropDescriptionVirtual'
1064
- };
1065
-
1066
- function $ca75888e192994dbb11ae05e54$export$useVirtualDrop() {
1067
- let formatMessage = useMessageFormatter($ca75888e192994dbb11ae05e54$var$intlMessages);
1068
- let modality = $bc29619458500c186021634c18dc$export$useDragModality();
1069
- let dragSession = $a75d092e5c30878812fba78e$export$useDragSession();
1070
- let descriptionProps = useDescription(dragSession ? formatMessage($ca75888e192994dbb11ae05e54$var$MESSAGES[modality]) : '');
1071
- return {
1072
- dropProps: _babelRuntimeHelpersExtends({}, descriptionProps, {
1073
- // Mobile Safari does not properly bubble click events on elements except links or inputs
1074
- // unless there is an onclick handler bound directly to the element itself. By adding this
1075
- // handler, React will take care of adding that for us, and we are able to handle document
1076
- // level click events in the DragManager.
1077
- // See https://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
1078
- onClick: () => {}
1079
- })
1080
- };
1081
- }
1082
-
1083
- const $db0591c71140b157a950096251935c$var$DROP_ACTIVATE_TIMEOUT = 800;
1084
-
1085
- function useDrop(options) {
1086
- let [isDropTarget, setDropTarget] = useState(false);
1087
- let state = useRef({
1088
- x: 0,
1089
- y: 0,
1090
- dragEnterCount: 0,
1091
- dropEffect: 'none',
1092
- dropActivateTimer: null
1093
- }).current;
1094
-
1095
- let onDragOver = e => {
1096
- e.preventDefault();
1097
-
1098
- if (e.clientX === state.x && e.clientY === state.y) {
1099
- e.dataTransfer.dropEffect = state.dropEffect;
1100
- return;
1101
- }
1102
-
1103
- state.x = e.clientX;
1104
- state.y = e.clientY;
1105
-
1106
- if (typeof options.getDropOperationForPoint === 'function') {
1107
- let allowedOperations = $db0591c71140b157a950096251935c$var$effectAllowedToOperations(e.dataTransfer.effectAllowed);
1108
- let types = new $bc29619458500c186021634c18dc$export$DragTypes(e.dataTransfer);
1109
- let rect = e.currentTarget.getBoundingClientRect();
1110
- let dropOperation = options.getDropOperationForPoint(types, allowedOperations, state.x - rect.x, state.y - rect.y);
1111
- state.dropEffect = $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION_TO_DROP_EFFECT[dropOperation] || 'none';
1112
427
  }
1113
-
1114
- e.dataTransfer.dropEffect = state.dropEffect;
1115
-
1116
- if (typeof options.onDropMove === 'function') {
1117
- let rect = e.currentTarget.getBoundingClientRect();
1118
- options.onDropMove({
1119
- type: 'dropmove',
1120
- x: state.x - rect.x,
1121
- y: state.y - rect.y
1122
- });
428
+ onClick(e) {
429
+ this.cancelEvent(e);
430
+ if (e.detail === 0 || this.isVirtualClick) {
431
+ if (e.target === this.dragTarget.element) {
432
+ this.cancel();
433
+ return;
434
+ }
435
+ let dropTarget = this.validDropTargets.find((target)=>target.element.contains(e.target)
436
+ );
437
+ if (dropTarget) {
438
+ let item = $28e10663603f5ea1$var$dropItems.get(e.target);
439
+ this.setCurrentDropTarget(dropTarget, item);
440
+ this.drop(item);
441
+ }
442
+ }
1123
443
  }
1124
-
1125
- clearTimeout(state.dropActivateTimer);
1126
-
1127
- if (typeof options.onDropActivate === 'function' && state.dropEffect !== 'none') {
1128
- let rect = e.currentTarget.getBoundingClientRect();
1129
- state.dropActivateTimer = setTimeout(() => {
1130
- options.onDropActivate({
1131
- type: 'dropactivate',
1132
- x: state.x - rect.x,
1133
- y: state.y - rect.y
444
+ onPointerDown(e) {
445
+ // Android Talkback double tap has e.detail = 1 for onClick. Detect the virtual click in onPointerDown before onClick fires
446
+ // so we can properly perform cancel and drop operations.
447
+ this.cancelEvent(e);
448
+ this.isVirtualClick = $28e10663603f5ea1$var$isVirtualPointerEvent(e);
449
+ }
450
+ cancelEvent(e) {
451
+ var ref;
452
+ // Allow focusin and focusout on the drag target so focus ring works properly.
453
+ if ((e.type === 'focusin' || e.type === 'focusout') && e.target === ((ref = this.dragTarget) === null || ref === void 0 ? void 0 : ref.element)) return;
454
+ // Allow default for events that might cancel a click event
455
+ if (!$28e10663603f5ea1$var$CLICK_EVENTS.includes(e.type)) e.preventDefault();
456
+ e.stopPropagation();
457
+ e.stopImmediatePropagation();
458
+ }
459
+ updateValidDropTargets() {
460
+ if (!this.mutationObserver) return;
461
+ this.mutationObserver.disconnect();
462
+ if (this.restoreAriaHidden) this.restoreAriaHidden();
463
+ this.validDropTargets = $28e10663603f5ea1$var$findValidDropTargets(this.dragTarget);
464
+ if (this.currentDropTarget && !this.validDropTargets.includes(this.currentDropTarget)) this.setCurrentDropTarget(this.validDropTargets[0]);
465
+ // Find valid drop items within collections
466
+ let types = $4620ae0dc40f0031$export$e1d41611756c6326(this.dragTarget.items);
467
+ let validDropItems = [
468
+ ...$28e10663603f5ea1$var$dropItems.values()
469
+ ].filter((item)=>{
470
+ if (typeof item.getDropOperation === 'function') return item.getDropOperation(types, this.dragTarget.allowedDropOperations) !== 'cancel';
471
+ return true;
472
+ });
473
+ // Filter out drop targets that contain valid items. We don't want to stop hiding elements
474
+ // other than the drop items that exist inside the collection.
475
+ let visibleDropTargets = this.validDropTargets.filter((target)=>!validDropItems.some((item)=>target.element.contains(item.element)
476
+ )
477
+ );
478
+ this.restoreAriaHidden = $4vY0V$reactariaoverlays.ariaHideOutside([
479
+ this.dragTarget.element,
480
+ ...validDropItems.map((item)=>item.element
481
+ ),
482
+ ...visibleDropTargets.map((target)=>target.element
483
+ )
484
+ ]);
485
+ this.mutationObserver.observe(document.body, {
486
+ subtree: true,
487
+ attributes: true,
488
+ attributeFilter: [
489
+ 'aria-hidden'
490
+ ]
1134
491
  });
1135
- }, $db0591c71140b157a950096251935c$var$DROP_ACTIVATE_TIMEOUT);
1136
- }
1137
- };
1138
-
1139
- let onDragEnter = e => {
1140
- state.dragEnterCount++;
1141
-
1142
- if (state.dragEnterCount > 1) {
1143
- return;
1144
- }
1145
-
1146
- let allowedOperations = $db0591c71140b157a950096251935c$var$effectAllowedToOperations(e.dataTransfer.effectAllowed);
1147
- let dropOperation = allowedOperations[0];
1148
-
1149
- if (typeof options.getDropOperation === 'function') {
1150
- let types = new $bc29619458500c186021634c18dc$export$DragTypes(e.dataTransfer);
1151
- dropOperation = options.getDropOperation(types, allowedOperations);
1152
- }
1153
-
1154
- if (dropOperation !== 'cancel') {
1155
- setDropTarget(true);
1156
- }
1157
-
1158
- if (typeof options.getDropOperationForPoint === 'function') {
1159
- let types = new $bc29619458500c186021634c18dc$export$DragTypes(e.dataTransfer);
1160
- let rect = e.currentTarget.getBoundingClientRect();
1161
- dropOperation = options.getDropOperationForPoint(types, allowedOperations, e.clientX - rect.x, e.clientY - rect.y);
1162
492
  }
1163
-
1164
- state.dropEffect = $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION_TO_DROP_EFFECT[dropOperation] || 'none';
1165
- e.dataTransfer.dropEffect = state.dropEffect;
1166
-
1167
- if (typeof options.onDropEnter === 'function' && dropOperation !== 'cancel') {
1168
- let rect = e.currentTarget.getBoundingClientRect();
1169
- options.onDropEnter({
1170
- type: 'dropenter',
1171
- x: e.clientX - rect.x,
1172
- y: e.clientY - rect.y
1173
- });
493
+ next() {
494
+ if (!this.currentDropTarget) {
495
+ this.setCurrentDropTarget(this.validDropTargets[0]);
496
+ return;
497
+ }
498
+ let index = this.validDropTargets.indexOf(this.currentDropTarget);
499
+ if (index < 0) {
500
+ this.setCurrentDropTarget(this.validDropTargets[0]);
501
+ return;
502
+ }
503
+ // If we've reached the end of the valid drop targets, cycle back to the original drag target.
504
+ // This lets the user cancel the drag in case they don't have an Escape key (e.g. iPad keyboard case).
505
+ if (index === this.validDropTargets.length - 1) {
506
+ if (!this.dragTarget.element.closest('[aria-hidden="true"]')) {
507
+ this.setCurrentDropTarget(null);
508
+ this.dragTarget.element.focus();
509
+ } else this.setCurrentDropTarget(this.validDropTargets[0]);
510
+ } else this.setCurrentDropTarget(this.validDropTargets[index + 1]);
511
+ }
512
+ previous() {
513
+ if (!this.currentDropTarget) {
514
+ this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);
515
+ return;
516
+ }
517
+ let index = this.validDropTargets.indexOf(this.currentDropTarget);
518
+ if (index < 0) {
519
+ this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);
520
+ return;
521
+ }
522
+ // If we've reached the start of the valid drop targets, cycle back to the original drag target.
523
+ // This lets the user cancel the drag in case they don't have an Escape key (e.g. iPad keyboard case).
524
+ if (index === 0) {
525
+ if (!this.dragTarget.element.closest('[aria-hidden="true"]')) {
526
+ this.setCurrentDropTarget(null);
527
+ this.dragTarget.element.focus();
528
+ } else this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);
529
+ } else this.setCurrentDropTarget(this.validDropTargets[index - 1]);
530
+ }
531
+ setCurrentDropTarget(dropTarget, item) {
532
+ if (dropTarget !== this.currentDropTarget) {
533
+ if (this.currentDropTarget && typeof this.currentDropTarget.onDropExit === 'function') {
534
+ let rect = this.currentDropTarget.element.getBoundingClientRect();
535
+ this.currentDropTarget.onDropExit({
536
+ type: 'dropexit',
537
+ x: rect.left + rect.width / 2,
538
+ y: rect.top + rect.height / 2
539
+ });
540
+ }
541
+ this.currentDropTarget = dropTarget;
542
+ if (dropTarget) {
543
+ if (typeof dropTarget.onDropEnter === 'function') {
544
+ let rect = dropTarget.element.getBoundingClientRect();
545
+ dropTarget.onDropEnter({
546
+ type: 'dropenter',
547
+ x: rect.left + rect.width / 2,
548
+ y: rect.top + rect.height / 2
549
+ }, this.dragTarget);
550
+ }
551
+ if (!item) dropTarget === null || dropTarget === void 0 ? void 0 : dropTarget.element.focus();
552
+ }
553
+ }
554
+ if (item !== this.currentDropItem) {
555
+ if (item && typeof this.currentDropTarget.onDropTargetEnter === 'function') this.currentDropTarget.onDropTargetEnter(item === null || item === void 0 ? void 0 : item.target);
556
+ item === null || item === void 0 ? void 0 : item.element.focus();
557
+ this.currentDropItem = item;
558
+ // Annouce first drop target after drag start announcement finishes.
559
+ // Otherwise, it will never get announced because drag start announcement is assertive.
560
+ if (!this.initialFocused) {
561
+ $4vY0V$reactarialiveannouncer.announce(item === null || item === void 0 ? void 0 : item.element.getAttribute('aria-label'), 'polite');
562
+ this.initialFocused = true;
563
+ }
564
+ }
1174
565
  }
1175
-
1176
- state.x = e.clientX;
1177
- state.y = e.clientY;
1178
- };
1179
-
1180
- let onDragLeave = e => {
1181
- state.dragEnterCount--;
1182
-
1183
- if (state.dragEnterCount > 0) {
1184
- return;
566
+ end() {
567
+ this.teardown();
568
+ if (typeof this.dragTarget.onDragEnd === 'function') {
569
+ let target = this.currentDropTarget && this.dropOperation !== 'cancel' ? this.currentDropTarget : this.dragTarget;
570
+ let rect = target.element.getBoundingClientRect();
571
+ this.dragTarget.onDragEnd({
572
+ type: 'dragend',
573
+ x: rect.x + rect.width / 2,
574
+ y: rect.y + rect.height / 2,
575
+ dropOperation: this.dropOperation
576
+ });
577
+ }
578
+ // Blur and re-focus the drop target so that the focus ring appears.
579
+ if (this.currentDropTarget) {
580
+ this.currentDropTarget.element.blur();
581
+ this.currentDropTarget.element.focus();
582
+ }
583
+ this.setCurrentDropTarget(null);
584
+ $28e10663603f5ea1$var$endDragging();
1185
585
  }
1186
-
1187
- if (typeof options.onDropExit === 'function' && state.dropEffect !== 'none') {
1188
- let rect = e.currentTarget.getBoundingClientRect();
1189
- options.onDropExit({
1190
- type: 'dropexit',
1191
- x: e.clientX - rect.x,
1192
- y: e.clientY - rect.y
1193
- });
586
+ cancel() {
587
+ this.end();
588
+ if (!this.dragTarget.element.closest('[aria-hidden="true"]')) this.dragTarget.element.focus();
589
+ $4vY0V$reactarialiveannouncer.announce(this.formatMessage('dropCanceled'));
1194
590
  }
1195
-
1196
- setDropTarget(false);
1197
- clearTimeout(state.dropActivateTimer);
1198
- };
1199
-
1200
- let onDrop = e => {
1201
- e.preventDefault();
1202
-
1203
- if (typeof options.onDrop === 'function') {
1204
- let dropOperation = $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_EFFECT_TO_DROP_OPERATION[state.dropEffect];
1205
- let items = $bc29619458500c186021634c18dc$export$readFromDataTransfer(e.dataTransfer);
1206
- let rect = e.currentTarget.getBoundingClientRect();
1207
- let event = {
1208
- type: 'drop',
1209
- x: e.clientX - rect.x,
1210
- y: e.clientY - rect.y,
1211
- items,
1212
- dropOperation
1213
- }; // Wait a frame to dispatch the drop event so that we ensure the dragend event fires first.
1214
- // Otherwise, if onDrop removes the original dragged element from the DOM, dragend will never be fired.
1215
- // This behavior is consistent across browsers, but see this issue for details:
1216
- // https://bugzilla.mozilla.org/show_bug.cgi?id=460801
1217
-
1218
- setTimeout(() => {
1219
- options.onDrop(event);
1220
- }, 0);
591
+ drop(item1) {
592
+ if (!this.currentDropTarget) {
593
+ this.cancel();
594
+ return;
595
+ }
596
+ if (typeof (item1 === null || item1 === void 0 ? void 0 : item1.getDropOperation) === 'function') {
597
+ let types = $4620ae0dc40f0031$export$e1d41611756c6326(this.dragTarget.items);
598
+ this.dropOperation = item1.getDropOperation(types, this.dragTarget.allowedDropOperations);
599
+ } else if (typeof this.currentDropTarget.getDropOperation === 'function') {
600
+ let types = $4620ae0dc40f0031$export$e1d41611756c6326(this.dragTarget.items);
601
+ this.dropOperation = this.currentDropTarget.getDropOperation(types, this.dragTarget.allowedDropOperations);
602
+ } else // TODO: show menu ??
603
+ this.dropOperation = this.dragTarget.allowedDropOperations[0];
604
+ if (typeof this.currentDropTarget.onDrop === 'function') {
605
+ let items = this.dragTarget.items.map((item)=>({
606
+ kind: 'text',
607
+ types: new Set(Object.keys(item)),
608
+ getText: (type)=>Promise.resolve(item[type])
609
+ })
610
+ );
611
+ let rect = this.currentDropTarget.element.getBoundingClientRect();
612
+ this.currentDropTarget.onDrop({
613
+ type: 'drop',
614
+ x: rect.left + rect.width / 2,
615
+ y: rect.top + rect.height / 2,
616
+ items: items,
617
+ dropOperation: this.dropOperation
618
+ }, item1 === null || item1 === void 0 ? void 0 : item1.target);
619
+ }
620
+ this.end();
621
+ $4vY0V$reactarialiveannouncer.announce(this.formatMessage('dropComplete'));
622
+ }
623
+ activate() {
624
+ if (this.currentDropTarget && typeof this.currentDropTarget.onDropActivate === 'function') {
625
+ let rect = this.currentDropTarget.element.getBoundingClientRect();
626
+ this.currentDropTarget.onDropActivate({
627
+ type: 'dropactivate',
628
+ x: rect.left + rect.width / 2,
629
+ y: rect.top + rect.height / 2
630
+ });
631
+ }
1221
632
  }
1222
-
1223
- if (typeof options.onDropExit === 'function') {
1224
- let rect = e.currentTarget.getBoundingClientRect();
1225
- options.onDropExit({
1226
- type: 'dropexit',
1227
- x: e.clientX - rect.x,
1228
- y: e.clientY - rect.y
1229
- });
633
+ constructor(target, formatMessage){
634
+ this.dragTarget = target;
635
+ this.formatMessage = formatMessage;
636
+ this.onKeyDown = this.onKeyDown.bind(this);
637
+ this.onFocus = this.onFocus.bind(this);
638
+ this.onBlur = this.onBlur.bind(this);
639
+ this.onClick = this.onClick.bind(this);
640
+ this.onPointerDown = this.onPointerDown.bind(this);
641
+ this.cancelEvent = this.cancelEvent.bind(this);
642
+ this.initialFocused = false;
1230
643
  }
644
+ }
645
+ function $28e10663603f5ea1$var$findValidDropTargets(options) {
646
+ let types = $4620ae0dc40f0031$export$e1d41611756c6326(options.items);
647
+ return [
648
+ ...$28e10663603f5ea1$var$dropTargets.values()
649
+ ].filter((target)=>{
650
+ if (target.element.closest('[aria-hidden="true"]')) return false;
651
+ if (typeof target.getDropOperation === 'function') return target.getDropOperation(types, options.allowedDropOperations) !== 'cancel';
652
+ return true;
653
+ });
654
+ }
655
+ function $28e10663603f5ea1$var$isVirtualPointerEvent(event) {
656
+ // If the pointer size is zero, then we assume it's from a screen reader.
657
+ // Android TalkBack double tap will sometimes return a event with width and height of 1
658
+ // and pointerType === 'mouse' so we need to check for a specific combination of event attributes.
659
+ // Cannot use "event.pressure === 0" as the sole check due to Safari pointer events always returning pressure === 0
660
+ // instead of .5, see https://bugs.webkit.org/show_bug.cgi?id=206216
661
+ return event.width === 0 && event.height === 0 || event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0;
662
+ }
1231
663
 
1232
- state.dragEnterCount = 0;
1233
- setDropTarget(false);
1234
- clearTimeout(state.dropActivateTimer);
1235
- };
1236
-
1237
- let optionsRef = useRef(options);
1238
- optionsRef.current = options;
1239
- useLayoutEffect(() => $a75d092e5c30878812fba78e$export$registerDropTarget({
1240
- element: optionsRef.current.ref.current,
1241
- getDropOperation: optionsRef.current.getDropOperation,
1242
664
 
1243
- onDropEnter(e) {
1244
- setDropTarget(true);
1245
665
 
1246
- if (typeof optionsRef.current.onDropEnter === 'function') {
1247
- optionsRef.current.onDropEnter(e);
1248
- }
1249
- },
666
+ var $d624b4da796f302a$exports = {};
667
+ var $12ee6b0bfb4232ad$exports = {};
668
+ $12ee6b0bfb4232ad$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}\"}");
1250
669
 
1251
- onDropExit(e) {
1252
- setDropTarget(false);
1253
670
 
1254
- if (typeof optionsRef.current.onDropExit === 'function') {
1255
- optionsRef.current.onDropExit(e);
1256
- }
1257
- },
671
+ var $e21ef7c55796c5e1$exports = {};
672
+ $e21ef7c55796c5e1$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}\"}");
1258
673
 
1259
- onDrop(e) {
1260
- if (typeof optionsRef.current.onDrop === 'function') {
1261
- optionsRef.current.onDrop(e);
1262
- }
1263
- },
1264
674
 
1265
- onDropActivate(e) {
1266
- if (typeof optionsRef.current.onDropActivate === 'function') {
1267
- optionsRef.current.onDropActivate(e);
1268
- }
1269
- }
675
+ var $dfa9cd1c2317d9aa$exports = {};
676
+ $dfa9cd1c2317d9aa$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}\"}");
1270
677
 
1271
- }), [optionsRef]);
1272
- let {
1273
- dropProps
1274
- } = $ca75888e192994dbb11ae05e54$export$useVirtualDrop();
1275
- return {
1276
- dropProps: _babelRuntimeHelpersExtends({}, dropProps, {
1277
- onDragEnter,
1278
- onDragOver,
1279
- onDragLeave,
1280
- onDrop
1281
- }),
1282
- isDropTarget
1283
- };
1284
- }
1285
678
 
1286
- exports.useDrop = useDrop;
679
+ var $65fff3bbacfa8956$exports = {};
680
+ $65fff3bbacfa8956$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}\"}");
1287
681
 
1288
- function $db0591c71140b157a950096251935c$var$effectAllowedToOperations(effectAllowed) {
1289
- let allowedOperationsBits = $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION_ALLOWED[effectAllowed];
1290
- let allowedOperations = [];
1291
682
 
1292
- if (allowedOperationsBits & $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.move) {
1293
- allowedOperations.push('move');
1294
- }
683
+ var $10b7dfe45cd41c2d$exports = {};
684
+ $10b7dfe45cd41c2d$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\"}");
1295
685
 
1296
- if (allowedOperationsBits & $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.copy) {
1297
- allowedOperations.push('copy');
1298
- }
1299
686
 
1300
- if (allowedOperationsBits & $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.link) {
1301
- allowedOperations.push('link');
1302
- }
687
+ var $0cadcffb7abc96b8$exports = {};
688
+ $0cadcffb7abc96b8$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}\"}");
1303
689
 
1304
- return allowedOperations;
1305
- }
1306
690
 
1307
- const $cf2100581419e36b2fe8caccc6dbd4b$var$AUTOSCROLL_AREA_SIZE = 20;
691
+ var $7e3982b34ddf1bdf$exports = {};
692
+ $7e3982b34ddf1bdf$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}\"}");
1308
693
 
1309
- function $cf2100581419e36b2fe8caccc6dbd4b$export$useAutoScroll(ref) {
1310
- let scrollableRef = useRef(null);
1311
- useEffect(() => {
1312
- if (ref.current) {
1313
- scrollableRef.current = getScrollParent(ref.current);
1314
- }
1315
- }, [ref]);
1316
- let state = useRef({
1317
- timer: null,
1318
- dx: 0,
1319
- dy: 0
1320
- }).current;
1321
- let scroll = useCallback(() => {
1322
- scrollableRef.current.scrollLeft += state.dx;
1323
- scrollableRef.current.scrollTop += state.dy;
1324
-
1325
- if (state.timer) {
1326
- state.timer = requestAnimationFrame(scroll);
1327
- }
1328
- }, [scrollableRef, state]);
1329
- return {
1330
- move(x, y) {
1331
- // Most browsers auto scroll natively, but WebKit on macOS does not (iOS does 🤷‍♂️).
1332
- // https://bugs.webkit.org/show_bug.cgi?id=222636
1333
- if (!isWebKit() || isIOS() || !scrollableRef.current) {
1334
- return;
1335
- }
1336
694
 
1337
- let box = scrollableRef.current.getBoundingClientRect();
1338
- let left = $cf2100581419e36b2fe8caccc6dbd4b$var$AUTOSCROLL_AREA_SIZE;
1339
- let top = $cf2100581419e36b2fe8caccc6dbd4b$var$AUTOSCROLL_AREA_SIZE;
1340
- let bottom = box.height - $cf2100581419e36b2fe8caccc6dbd4b$var$AUTOSCROLL_AREA_SIZE;
1341
- let right = box.width - $cf2100581419e36b2fe8caccc6dbd4b$var$AUTOSCROLL_AREA_SIZE;
1342
-
1343
- if (x < left || x > right || y < top || y > bottom) {
1344
- if (x < left) {
1345
- state.dx = x - left;
1346
- } else if (x > right) {
1347
- state.dx = x - right;
1348
- }
695
+ var $cb29ce0b655c4023$exports = {};
696
+ $cb29ce0b655c4023$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}\"}");
1349
697
 
1350
- if (y < top) {
1351
- state.dy = y - top;
1352
- } else if (y > bottom) {
1353
- state.dy = y - bottom;
1354
- }
1355
698
 
1356
- if (!state.timer) {
1357
- state.timer = requestAnimationFrame(scroll);
1358
- }
1359
- } else {
1360
- this.stop();
1361
- }
1362
- },
699
+ var $067d46bab80bcf4b$exports = {};
700
+ $067d46bab80bcf4b$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\"}");
1363
701
 
1364
- stop() {
1365
- if (state.timer) {
1366
- cancelAnimationFrame(state.timer);
1367
- state.timer = null;
1368
- }
1369
- }
1370
702
 
1371
- };
1372
- }
703
+ var $8aa1b9a1f9d783d3$exports = {};
704
+ $8aa1b9a1f9d783d3$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\"}");
1373
705
 
1374
- const $ab6d833b5804400cb02efc69c9302a$var$DROP_POSITIONS = ['before', 'on', 'after'];
1375
-
1376
- function useDroppableCollection(props, state, ref) {
1377
- let localState = useRef({
1378
- props,
1379
- state,
1380
- nextTarget: null,
1381
- dropOperation: null
1382
- }).current;
1383
- localState.props = props;
1384
- localState.state = state;
1385
- let autoScroll = $cf2100581419e36b2fe8caccc6dbd4b$export$useAutoScroll(ref);
1386
- let {
1387
- dropProps
1388
- } = useDrop({
1389
- ref,
1390
-
1391
- onDropEnter(e) {
1392
- let target = props.getDropTargetFromPoint(e.x, e.y);
1393
- state.setTarget(target);
1394
- },
1395
706
 
1396
- onDropMove(e) {
1397
- state.setTarget(localState.nextTarget);
1398
- autoScroll.move(e.x, e.y);
1399
- },
707
+ var $9e248ec27f7dc55f$exports = {};
708
+ $9e248ec27f7dc55f$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}\"}");
1400
709
 
1401
- getDropOperationForPoint(types, allowedOperations, x, y) {
1402
- let target = props.getDropTargetFromPoint(x, y);
1403
710
 
1404
- if (!target) {
1405
- localState.dropOperation = 'cancel';
1406
- localState.nextTarget = null;
1407
- return 'cancel';
1408
- }
711
+ var $6387f7228f0de45e$exports = {};
712
+ $6387f7228f0de45e$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}\"}");
1409
713
 
1410
- if (state.isDropTarget(target)) {
1411
- localState.nextTarget = target;
1412
- return localState.dropOperation;
1413
- }
1414
714
 
1415
- localState.dropOperation = state.getDropOperation(target, types, allowedOperations); // If the target doesn't accept the drop, see if the root accepts it instead.
715
+ var $34a283567735f754$exports = {};
716
+ $34a283567735f754$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}\"}");
1416
717
 
1417
- if (localState.dropOperation === 'cancel') {
1418
- let rootTarget = {
1419
- type: 'root'
1420
- };
1421
- let dropOperation = state.getDropOperation(rootTarget, types, allowedOperations);
1422
718
 
1423
- if (dropOperation !== 'cancel') {
1424
- target = rootTarget;
1425
- localState.dropOperation = dropOperation;
1426
- }
1427
- }
719
+ var $466590c56bee4342$exports = {};
720
+ $466590c56bee4342$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é\"}");
1428
721
 
1429
- localState.nextTarget = localState.dropOperation === 'cancel' ? null : target;
1430
- return localState.dropOperation;
1431
- },
1432
722
 
1433
- onDropExit() {
1434
- state.setTarget(null);
1435
- autoScroll.stop();
1436
- },
723
+ var $e013896dcb6a6884$exports = {};
724
+ $e013896dcb6a6884$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}\"}");
1437
725
 
1438
- onDropActivate(e) {
1439
- var _state$target, _state$target2;
1440
726
 
1441
- 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') {
1442
- props.onDropActivate({
1443
- type: 'dropactivate',
1444
- x: e.x,
1445
- // todo
1446
- y: e.y,
1447
- target: state.target
1448
- });
1449
- }
1450
- },
727
+ var $d6121e4246c6e502$exports = {};
728
+ $d6121e4246c6e502$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} の間に挿入\"}");
1451
729
 
1452
- onDrop(e) {
1453
- if (state.target && typeof props.onDrop === 'function') {
1454
- onDrop(e, state.target);
1455
- }
1456
- }
1457
730
 
1458
- });
1459
- let droppingState = useRef(null);
1460
- let onDrop = useCallback((e, target) => {
1461
- let {
1462
- state
1463
- } = localState; // Focus the collection.
1464
-
1465
- state.selectionManager.setFocused(true); // Save some state of the collection/selection before the drop occurs so we can compare later.
1466
-
1467
- let focusedKey = state.selectionManager.focusedKey;
1468
- droppingState.current = {
1469
- timeout: null,
1470
- focusedKey,
1471
- collection: state.collection,
1472
- selectedKeys: state.selectionManager.selectedKeys
1473
- };
1474
- localState.props.onDrop({
1475
- type: 'drop',
1476
- x: e.x,
1477
- // todo
1478
- y: e.y,
1479
- target,
1480
- items: e.items,
1481
- dropOperation: e.dropOperation
1482
- }); // Wait for a short time period after the onDrop is called to allow the data to be read asynchronously
1483
- // and for React to re-render. If an insert occurs during this time, it will be selected/focused below.
1484
- // If items are not "immediately" inserted by the onDrop handler, the application will need to handle
1485
- // selecting and focusing those items themselves.
1486
-
1487
- droppingState.current.timeout = setTimeout(() => {
1488
- // If focus didn't move already (e.g. due to an insert), and the user dropped on an item,
1489
- // focus that item and show the focus ring to give the user feedback that the drop occurred.
1490
- // Also show the focus ring if the focused key is not selected, e.g. in case of a reorder.
1491
- let {
1492
- state
1493
- } = localState;
1494
-
1495
- if (state.selectionManager.focusedKey === focusedKey) {
1496
- if (target.type === 'item' && target.dropPosition === 'on' && state.collection.getItem(target.key) != null) {
1497
- state.selectionManager.setFocusedKey(target.key);
1498
- state.selectionManager.setFocused(true);
1499
- setInteractionModality('keyboard');
1500
- } else if (!state.selectionManager.isSelected(focusedKey)) {
1501
- setInteractionModality('keyboard');
1502
- }
1503
- }
731
+ var $cf48a963c482dcba$exports = {};
732
+ $cf48a963c482dcba$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} 사이에 삽입\"}");
1504
733
 
1505
- droppingState.current = null;
1506
- }, 50);
1507
- }, [localState]); // eslint-disable-next-line arrow-body-style
1508
734
 
1509
- useEffect(() => {
1510
- return () => {
1511
- if (droppingState.current) {
1512
- clearTimeout(droppingState.current.timeout);
1513
- }
1514
- };
1515
- }, []);
1516
- useLayoutEffect(() => {
1517
- // If an insert occurs during a drop, we want to immediately select these items to give
1518
- // feedback to the user that a drop occurred. Only do this if the selection didn't change
1519
- // since the drop started so we don't override if the user or application did something.
1520
- if (droppingState.current && state.selectionManager.isFocused && state.collection.size > droppingState.current.collection.size && state.selectionManager.isSelectionEqual(droppingState.current.selectedKeys)) {
1521
- let newKeys = new Set();
1522
-
1523
- for (let key of state.collection.getKeys()) {
1524
- if (!droppingState.current.collection.getItem(key)) {
1525
- newKeys.add(key);
1526
- }
1527
- }
735
+ var $b156071f04f1c899$exports = {};
736
+ $b156071f04f1c899$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}\"}");
1528
737
 
1529
- state.selectionManager.setSelectedKeys(newKeys); // If the focused item didn't change since the drop occurred, also focus the first
1530
- // inserted item. If selection is disabled, then also show the focus ring so there
1531
- // is some indication that items were added.
1532
738
 
1533
- if (state.selectionManager.focusedKey === droppingState.current.focusedKey) {
1534
- let first = newKeys.keys().next().value;
1535
- state.selectionManager.setFocusedKey(first);
739
+ var $5300be8ef98d39fa$exports = {};
740
+ $5300be8ef98d39fa$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}\"}");
1536
741
 
1537
- if (state.selectionManager.selectionMode === 'none') {
1538
- setInteractionModality('keyboard');
1539
- }
1540
- }
1541
742
 
1542
- droppingState.current = null;
1543
- }
1544
- });
1545
- useEffect(() => {
1546
- let getNextTarget = function getNextTarget(target, wrap) {
1547
- if (wrap === void 0) {
1548
- wrap = true;
1549
- }
743
+ var $7484477aad199932$exports = {};
744
+ $7484477aad199932$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}\"}");
1550
745
 
1551
- if (!target) {
1552
- return {
1553
- type: 'root'
1554
- };
1555
- }
1556
746
 
1557
- let {
1558
- keyboardDelegate
1559
- } = localState.props;
1560
- let nextKey = target.type === 'item' ? keyboardDelegate.getKeyBelow(target.key) : keyboardDelegate.getFirstKey();
1561
- let dropPosition = 'before';
747
+ var $968e09cb41d6cd76$exports = {};
748
+ $968e09cb41d6cd76$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}\"}");
1562
749
 
1563
- if (target.type === 'item') {
1564
- let positionIndex = $ab6d833b5804400cb02efc69c9302a$var$DROP_POSITIONS.indexOf(target.dropPosition);
1565
- let nextDropPosition = $ab6d833b5804400cb02efc69c9302a$var$DROP_POSITIONS[positionIndex + 1];
1566
750
 
1567
- if (positionIndex < $ab6d833b5804400cb02efc69c9302a$var$DROP_POSITIONS.length - 1 && !(nextDropPosition === 'after' && nextKey != null)) {
1568
- return {
1569
- type: 'item',
1570
- key: target.key,
1571
- dropPosition: nextDropPosition
1572
- };
1573
- } // If the last drop position was 'after', then 'before' on the next key is equivalent.
1574
- // Switch to 'on' instead.
751
+ var $0c2c6c954dd638d7$exports = {};
752
+ $0c2c6c954dd638d7$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}\"}");
1575
753
 
1576
754
 
1577
- if (target.dropPosition === 'after') {
1578
- dropPosition = 'on';
1579
- }
1580
- }
755
+ var $db510f249c1f2e00$exports = {};
756
+ $db510f249c1f2e00$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}\"}");
1581
757
 
1582
- if (nextKey == null) {
1583
- if (wrap) {
1584
- return {
1585
- type: 'root'
1586
- };
1587
- }
1588
758
 
1589
- return null;
1590
- }
759
+ var $d734686296d37387$exports = {};
760
+ $d734686296d37387$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}\"}");
1591
761
 
1592
- return {
1593
- type: 'item',
1594
- key: nextKey,
1595
- dropPosition
1596
- };
1597
- };
1598
762
 
1599
- let getPreviousTarget = function getPreviousTarget(target, wrap) {
1600
- if (wrap === void 0) {
1601
- wrap = true;
1602
- }
763
+ var $d239d4998a584a23$exports = {};
764
+ $d239d4998a584a23$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}\"}");
1603
765
 
1604
- let {
1605
- keyboardDelegate
1606
- } = localState.props;
1607
- let nextKey = (target == null ? void 0 : target.type) === 'item' ? keyboardDelegate.getKeyAbove(target.key) : keyboardDelegate.getLastKey();
1608
- let dropPosition = !target || target.type === 'root' ? 'after' : 'on';
1609
766
 
1610
- if ((target == null ? void 0 : target.type) === 'item') {
1611
- let positionIndex = $ab6d833b5804400cb02efc69c9302a$var$DROP_POSITIONS.indexOf(target.dropPosition);
1612
- let nextDropPosition = $ab6d833b5804400cb02efc69c9302a$var$DROP_POSITIONS[positionIndex - 1];
767
+ var $a06126b47eabe64f$exports = {};
768
+ $a06126b47eabe64f$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}\"}");
1613
769
 
1614
- if (positionIndex > 0 && nextDropPosition !== 'after') {
1615
- return {
1616
- type: 'item',
1617
- key: target.key,
1618
- dropPosition: nextDropPosition
1619
- };
1620
- } // If the last drop position was 'before', then 'after' on the previous key is equivalent.
1621
- // Switch to 'on' instead.
1622
770
 
771
+ var $0983413fc05d96fb$exports = {};
772
+ $0983413fc05d96fb$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}\"}");
1623
773
 
1624
- if (target.dropPosition === 'before') {
1625
- dropPosition = 'on';
1626
- }
1627
- }
1628
774
 
1629
- if (nextKey == null) {
1630
- if (wrap) {
1631
- return {
1632
- type: 'root'
1633
- };
1634
- }
775
+ var $c66896a0464692f1$exports = {};
776
+ $c66896a0464692f1$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}\"}");
1635
777
 
1636
- return null;
1637
- }
1638
778
 
1639
- return {
1640
- type: 'item',
1641
- key: nextKey,
1642
- dropPosition
1643
- };
1644
- };
779
+ var $f0d9abe43a1bcdf6$exports = {};
780
+ $f0d9abe43a1bcdf6$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}\"}");
1645
781
 
1646
- let nextValidTarget = function nextValidTarget(target, types, allowedDropOperations, getNextTarget, wrap) {
1647
- if (wrap === void 0) {
1648
- wrap = true;
1649
- }
1650
782
 
1651
- let seenRoot = 0;
1652
- let operation;
783
+ var $f3e2ce4b6d6cc4ac$exports = {};
784
+ $f3e2ce4b6d6cc4ac$exports = JSON.parse("{\"dragDescriptionKeyboard\":\"Tryck på 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}\"}");
1653
785
 
1654
- do {
1655
- let nextTarget = getNextTarget(target, wrap);
1656
786
 
1657
- if (!nextTarget) {
1658
- return null;
1659
- }
787
+ var $da91b0d12d273475$exports = {};
788
+ $da91b0d12d273475$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\"}");
1660
789
 
1661
- target = nextTarget;
1662
- operation = localState.state.getDropOperation(nextTarget, types, allowedDropOperations);
1663
790
 
1664
- if (target.type === 'root') {
1665
- seenRoot++;
1666
- }
1667
- } while (operation === 'cancel' && !localState.state.isDropTarget(target) && seenRoot < 2);
791
+ var $d6f72e28f0f4871c$exports = {};
792
+ $d6f72e28f0f4871c$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}\"}");
1668
793
 
1669
- if (operation === 'cancel') {
1670
- return null;
1671
- }
1672
794
 
1673
- return target;
1674
- };
795
+ var $187738fbdc896f75$exports = {};
796
+ $187738fbdc896f75$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} 之间\"}");
1675
797
 
1676
- return $a75d092e5c30878812fba78e$export$registerDropTarget({
1677
- element: ref.current,
1678
798
 
1679
- getDropOperation(types, allowedOperations) {
1680
- if (localState.state.target) {
1681
- return localState.state.getDropOperation(localState.state.target, types, allowedOperations);
1682
- } // Check if any of the targets accept the drop.
1683
- // TODO: should we have a faster way of doing this or e.g. for pagination?
799
+ var $80cfc1f1f7d356d3$exports = {};
800
+ $80cfc1f1f7d356d3$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}」之間\"}");
1684
801
 
1685
802
 
1686
- let target = nextValidTarget(null, types, allowedOperations, getNextTarget);
1687
- return target ? 'move' : 'cancel';
1688
- },
803
+ $d624b4da796f302a$exports = {
804
+ "ar-AE": $12ee6b0bfb4232ad$exports,
805
+ "bg-BG": $e21ef7c55796c5e1$exports,
806
+ "cs-CZ": $dfa9cd1c2317d9aa$exports,
807
+ "da-DK": $65fff3bbacfa8956$exports,
808
+ "de-DE": $10b7dfe45cd41c2d$exports,
809
+ "el-GR": $0cadcffb7abc96b8$exports,
810
+ "en-US": $7e3982b34ddf1bdf$exports,
811
+ "es-ES": $cb29ce0b655c4023$exports,
812
+ "et-EE": $067d46bab80bcf4b$exports,
813
+ "fi-FI": $8aa1b9a1f9d783d3$exports,
814
+ "fr-FR": $9e248ec27f7dc55f$exports,
815
+ "he-IL": $6387f7228f0de45e$exports,
816
+ "hr-HR": $34a283567735f754$exports,
817
+ "hu-HU": $466590c56bee4342$exports,
818
+ "it-IT": $e013896dcb6a6884$exports,
819
+ "ja-JP": $d6121e4246c6e502$exports,
820
+ "ko-KR": $cf48a963c482dcba$exports,
821
+ "lt-LT": $b156071f04f1c899$exports,
822
+ "lv-LV": $5300be8ef98d39fa$exports,
823
+ "nb-NO": $7484477aad199932$exports,
824
+ "nl-NL": $968e09cb41d6cd76$exports,
825
+ "pl-PL": $0c2c6c954dd638d7$exports,
826
+ "pt-BR": $db510f249c1f2e00$exports,
827
+ "pt-PT": $d734686296d37387$exports,
828
+ "ro-RO": $d239d4998a584a23$exports,
829
+ "ru-RU": $a06126b47eabe64f$exports,
830
+ "sk-SK": $0983413fc05d96fb$exports,
831
+ "sl-SI": $c66896a0464692f1$exports,
832
+ "sr-SP": $f0d9abe43a1bcdf6$exports,
833
+ "sv-SE": $f3e2ce4b6d6cc4ac$exports,
834
+ "tr-TR": $da91b0d12d273475$exports,
835
+ "uk-UA": $d6f72e28f0f4871c$exports,
836
+ "zh-CN": $187738fbdc896f75$exports,
837
+ "zh-TW": $80cfc1f1f7d356d3$exports
838
+ };
1689
839
 
1690
- onDropEnter(e, drag) {
1691
- let types = $bc29619458500c186021634c18dc$export$getTypes(drag.items);
1692
- let selectionManager = localState.state.selectionManager;
1693
- let target; // When entering the droppable collection for the first time, the default drop target
1694
- // is after the focused key.
1695
840
 
1696
- let key = selectionManager.focusedKey;
1697
- let dropPosition = 'after'; // If the focused key is a cell, get the parent item instead.
1698
- // For now, we assume that individual cells cannot be dropped on.
1699
841
 
1700
- let item = localState.state.collection.getItem(key);
1701
842
 
1702
- if ((item == null ? void 0 : item.type) === 'cell') {
1703
- key = item.parentKey;
1704
- } // If the focused item is also selected, the default drop target is after the last selected item.
1705
- // But if the focused key is the first selected item, then default to before the first selected item.
1706
- // This is to make reordering lists slightly easier. If you select top down, we assume you want to
1707
- // move the items down. If you select bottom up, we assume you want to move the items up.
1708
843
 
1709
844
 
1710
- if (selectionManager.isSelected(key)) {
1711
- if (selectionManager.selectedKeys.size > 1 && selectionManager.firstSelectedKey === key) {
1712
- dropPosition = 'before';
1713
- } else {
1714
- key = selectionManager.lastSelectedKey;
1715
- }
845
+ const $dc204e8ec58447a6$var$MESSAGES = {
846
+ keyboard: {
847
+ start: 'dragDescriptionKeyboard',
848
+ end: 'endDragKeyboard'
849
+ },
850
+ touch: {
851
+ start: 'dragDescriptionTouch',
852
+ end: 'endDragTouch'
853
+ },
854
+ virtual: {
855
+ start: 'dragDescriptionVirtual',
856
+ end: 'endDragVirtual'
857
+ }
858
+ };
859
+ function $dc204e8ec58447a6$export$7941f8aafa4b6021(options) {
860
+ let formatMessage = $4vY0V$reactariai18n.useMessageFormatter((/*@__PURE__*/$parcel$interopDefault($d624b4da796f302a$exports)));
861
+ let state = $4vY0V$react.useRef({
862
+ options: options,
863
+ x: 0,
864
+ y: 0
865
+ }).current;
866
+ state.options = options;
867
+ let [isDragging, setDragging] = $4vY0V$react.useState(false);
868
+ let { addGlobalListener: addGlobalListener , removeAllGlobalListeners: removeAllGlobalListeners } = $4vY0V$reactariautils.useGlobalListeners();
869
+ let onDragStart = (e1)=>{
870
+ var ref;
871
+ if (e1.defaultPrevented) return;
872
+ if (typeof options.onDragStart === 'function') options.onDragStart({
873
+ type: 'dragstart',
874
+ x: e1.clientX,
875
+ y: e1.clientY
876
+ });
877
+ let items = options.getItems();
878
+ $4620ae0dc40f0031$export$f9c1490890ddd063(e1.dataTransfer, items);
879
+ if (typeof options.getAllowedDropOperations === 'function') {
880
+ let allowedOperations = options.getAllowedDropOperations();
881
+ let allowed = $76b1e110a27b1ccd$export$60b7b4bcf3903d8e.none;
882
+ for (let operation of allowedOperations)allowed |= $76b1e110a27b1ccd$export$60b7b4bcf3903d8e[operation] || $76b1e110a27b1ccd$export$60b7b4bcf3903d8e.none;
883
+ e1.dataTransfer.effectAllowed = $76b1e110a27b1ccd$export$dd0165308d8bff45[allowed] || 'none';
1716
884
  }
1717
-
1718
- if (key != null) {
1719
- target = {
1720
- type: 'item',
1721
- key,
1722
- dropPosition
1723
- }; // If the default target is not valid, find the next one that is.
1724
-
1725
- if (localState.state.getDropOperation(target, types, drag.allowedDropOperations) === 'cancel') {
1726
- var _nextValidTarget;
1727
-
1728
- target = (_nextValidTarget = nextValidTarget(target, types, drag.allowedDropOperations, getNextTarget, false)) != null ? _nextValidTarget : nextValidTarget(target, types, drag.allowedDropOperations, getPreviousTarget, false);
1729
- }
1730
- } // If no focused key, then start from the root.
885
+ // If there is a preview option, use it to render a custom preview image that will
886
+ // appear under the pointer while dragging. If not, the element itself is dragged by the browser.
887
+ if (typeof ((ref = options.preview) === null || ref === void 0 ? void 0 : ref.current) === 'function') options.preview.current(items, (node)=>{
888
+ // Compute the offset that the preview will appear under the mouse.
889
+ // If possible, this is based on the point the user clicked on the target.
890
+ // If the preview is much smaller, then just use the center point of the preview.
891
+ let size = node.getBoundingClientRect();
892
+ let rect = e1.currentTarget.getBoundingClientRect();
893
+ let x = e1.clientX - rect.x;
894
+ let y = e1.clientY - rect.y;
895
+ if (x > size.width || y > size.height) {
896
+ x = size.width / 2;
897
+ y = size.height / 2;
898
+ }
899
+ // Rounding height to an even number prevents blurry preview seen on some screens
900
+ let height = 2 * Math.round(rect.height / 2);
901
+ node.style.height = `${height}px`;
902
+ e1.dataTransfer.setDragImage(node, x, y);
903
+ });
904
+ // Enforce that drops are handled by useDrop.
905
+ addGlobalListener(window, 'drop', (e)=>{
906
+ if (!$28e10663603f5ea1$export$7454aff2e161f241(e.target)) {
907
+ e.preventDefault();
908
+ e.stopPropagation();
909
+ throw new Error('Drags initiated from the React Aria useDrag hook may only be dropped on a target created with useDrop. This ensures that a keyboard and screen reader accessible alternative is available.');
910
+ }
911
+ }, {
912
+ capture: true,
913
+ once: true
914
+ });
915
+ state.x = e1.clientX;
916
+ state.y = e1.clientY;
917
+ // Wait a frame before we set dragging to true so that the browser has time to
918
+ // render the preview image before we update the element that has been dragged.
919
+ requestAnimationFrame(()=>{
920
+ setDragging(true);
921
+ });
922
+ };
923
+ let onDrag = (e)=>{
924
+ if (e.clientX === state.x && e.clientY === state.y) return;
925
+ if (typeof options.onDragMove === 'function') options.onDragMove({
926
+ type: 'dragmove',
927
+ x: e.clientX,
928
+ y: e.clientY
929
+ });
930
+ state.x = e.clientX;
931
+ state.y = e.clientY;
932
+ };
933
+ let onDragEnd = (e)=>{
934
+ if (typeof options.onDragEnd === 'function') options.onDragEnd({
935
+ type: 'dragend',
936
+ x: e.clientX,
937
+ y: e.clientY,
938
+ dropOperation: $76b1e110a27b1ccd$export$608ecc6f1b23c35d[e.dataTransfer.dropEffect]
939
+ });
940
+ setDragging(false);
941
+ removeAllGlobalListeners();
942
+ };
943
+ let onPress = (e2)=>{
944
+ if (e2.pointerType !== 'keyboard' && e2.pointerType !== 'virtual') return;
945
+ if (typeof state.options.onDragStart === 'function') {
946
+ let rect = e2.target.getBoundingClientRect();
947
+ state.options.onDragStart({
948
+ type: 'dragstart',
949
+ x: rect.x + rect.width / 2,
950
+ y: rect.y + rect.height / 2
951
+ });
952
+ }
953
+ $28e10663603f5ea1$export$549dbcf8649bf3b2({
954
+ element: e2.target,
955
+ items: state.options.getItems(),
956
+ allowedDropOperations: typeof state.options.getAllowedDropOperations === 'function' ? state.options.getAllowedDropOperations() : [
957
+ 'move',
958
+ 'copy',
959
+ 'link'
960
+ ],
961
+ onDragEnd (e) {
962
+ setDragging(false);
963
+ if (typeof state.options.onDragEnd === 'function') state.options.onDragEnd(e);
964
+ }
965
+ }, formatMessage);
966
+ setDragging(true);
967
+ };
968
+ let modality = $4620ae0dc40f0031$export$49bac5d6d4b352ea();
969
+ let descriptionProps = $4vY0V$reactariautils.useDescription(formatMessage(!isDragging ? $dc204e8ec58447a6$var$MESSAGES[modality].start : $dc204e8ec58447a6$var$MESSAGES[modality].end));
970
+ return {
971
+ dragProps: {
972
+ draggable: 'true',
973
+ onDragStart: onDragStart,
974
+ onDrag: onDrag,
975
+ onDragEnd: onDragEnd
976
+ },
977
+ dragButtonProps: {
978
+ ...descriptionProps,
979
+ onPress: onPress
980
+ },
981
+ isDragging: isDragging
982
+ };
983
+ }
1731
984
 
1732
985
 
1733
- if (!target) {
1734
- target = nextValidTarget(null, types, drag.allowedDropOperations, getNextTarget);
1735
- }
986
+ var $1ca228bc9257ca16$exports = {};
1736
987
 
1737
- localState.state.setTarget(target);
1738
- },
988
+ $parcel$export($1ca228bc9257ca16$exports, "useDrop", () => $1ca228bc9257ca16$export$ccdee5eaf73cf661);
1739
989
 
1740
- onDropExit() {
1741
- localState.state.setTarget(null);
1742
- },
1743
990
 
1744
- onDropTargetEnter(target) {
1745
- localState.state.setTarget(target);
1746
- },
1747
991
 
1748
- onDropActivate(e) {
1749
- var _localState$state$tar, _localState$state$tar2;
1750
992
 
1751
- 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') {
1752
- localState.props.onDropActivate({
1753
- type: 'dropactivate',
1754
- x: e.x,
1755
- // todo
1756
- y: e.y,
1757
- target: localState.state.target
1758
- });
1759
- }
1760
- },
1761
993
 
1762
- onDrop(e, target) {
1763
- if (localState.state.target && typeof localState.props.onDrop === 'function') {
1764
- onDrop(e, target || localState.state.target);
1765
- }
1766
- },
1767
-
1768
- onKeyDown(e, drag) {
1769
- let {
1770
- keyboardDelegate
1771
- } = localState.props;
1772
- let types = $bc29619458500c186021634c18dc$export$getTypes(drag.items);
1773
-
1774
- switch (e.key) {
1775
- case 'ArrowDown':
1776
- {
1777
- if (keyboardDelegate.getKeyBelow) {
1778
- let target = nextValidTarget(localState.state.target, types, drag.allowedDropOperations, getNextTarget);
1779
- localState.state.setTarget(target);
1780
- }
1781
994
 
1782
- break;
1783
- }
1784
995
 
1785
- case 'ArrowUp':
1786
- {
1787
- if (keyboardDelegate.getKeyAbove) {
1788
- let target = nextValidTarget(localState.state.target, types, drag.allowedDropOperations, getPreviousTarget);
1789
- localState.state.setTarget(target);
1790
- }
1791
996
 
1792
- break;
1793
- }
1794
997
 
1795
- case 'Home':
1796
- {
1797
- if (keyboardDelegate.getFirstKey) {
1798
- let target = nextValidTarget(null, types, drag.allowedDropOperations, getNextTarget);
1799
- localState.state.setTarget(target);
1800
- }
1801
998
 
1802
- break;
999
+ const $419982e205c8e8dc$var$MESSAGES = {
1000
+ keyboard: 'dropDescriptionKeyboard',
1001
+ touch: 'dropDescriptionTouch',
1002
+ virtual: 'dropDescriptionVirtual'
1003
+ };
1004
+ function $419982e205c8e8dc$export$62447ad3d2ec7da6() {
1005
+ let formatMessage = $4vY0V$reactariai18n.useMessageFormatter((/*@__PURE__*/$parcel$interopDefault($d624b4da796f302a$exports)));
1006
+ let modality = $4620ae0dc40f0031$export$49bac5d6d4b352ea();
1007
+ let dragSession = $28e10663603f5ea1$export$418e185dd3f1b968();
1008
+ let descriptionProps = $4vY0V$reactariautils.useDescription(dragSession ? formatMessage($419982e205c8e8dc$var$MESSAGES[modality]) : '');
1009
+ return {
1010
+ dropProps: {
1011
+ ...descriptionProps,
1012
+ // Mobile Safari does not properly bubble click events on elements except links or inputs
1013
+ // unless there is an onclick handler bound directly to the element itself. By adding this
1014
+ // handler, React will take care of adding that for us, and we are able to handle document
1015
+ // level click events in the DragManager.
1016
+ // See https://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
1017
+ onClick: ()=>{
1803
1018
  }
1019
+ }
1020
+ };
1021
+ }
1804
1022
 
1805
- case 'End':
1806
- {
1807
- if (keyboardDelegate.getLastKey) {
1808
- let target = nextValidTarget(null, types, drag.allowedDropOperations, getPreviousTarget);
1809
- localState.state.setTarget(target);
1810
- }
1811
1023
 
1812
- break;
1024
+ const $1ca228bc9257ca16$var$DROP_ACTIVATE_TIMEOUT = 800;
1025
+ function $1ca228bc9257ca16$export$ccdee5eaf73cf661(options) {
1026
+ let [isDropTarget, setDropTarget] = $4vY0V$react.useState(false);
1027
+ let state = $4vY0V$react.useRef({
1028
+ x: 0,
1029
+ y: 0,
1030
+ dragEnterCount: 0,
1031
+ dropEffect: 'none',
1032
+ dropActivateTimer: null
1033
+ }).current;
1034
+ let onDragOver = (e)=>{
1035
+ e.preventDefault();
1036
+ e.stopPropagation();
1037
+ if (e.clientX === state.x && e.clientY === state.y) {
1038
+ e.dataTransfer.dropEffect = state.dropEffect;
1039
+ return;
1040
+ }
1041
+ state.x = e.clientX;
1042
+ state.y = e.clientY;
1043
+ if (typeof options.getDropOperationForPoint === 'function') {
1044
+ let allowedOperations = $1ca228bc9257ca16$var$effectAllowedToOperations(e.dataTransfer.effectAllowed);
1045
+ let types = new $4620ae0dc40f0031$export$7f04ce188c91447c(e.dataTransfer);
1046
+ let rect = e.currentTarget.getBoundingClientRect();
1047
+ let dropOperation = options.getDropOperationForPoint(types, allowedOperations, state.x - rect.x, state.y - rect.y);
1048
+ state.dropEffect = $76b1e110a27b1ccd$export$5eacb0769d26d3b2[dropOperation] || 'none';
1049
+ }
1050
+ e.dataTransfer.dropEffect = state.dropEffect;
1051
+ if (typeof options.onDropMove === 'function') {
1052
+ let rect = e.currentTarget.getBoundingClientRect();
1053
+ options.onDropMove({
1054
+ type: 'dropmove',
1055
+ x: state.x - rect.x,
1056
+ y: state.y - rect.y
1057
+ });
1058
+ }
1059
+ clearTimeout(state.dropActivateTimer);
1060
+ if (typeof options.onDropActivate === 'function' && state.dropEffect !== 'none') {
1061
+ let rect = e.currentTarget.getBoundingClientRect();
1062
+ state.dropActivateTimer = setTimeout(()=>{
1063
+ options.onDropActivate({
1064
+ type: 'dropactivate',
1065
+ x: state.x - rect.x,
1066
+ y: state.y - rect.y
1067
+ });
1068
+ }, $1ca228bc9257ca16$var$DROP_ACTIVATE_TIMEOUT);
1069
+ }
1070
+ };
1071
+ let onDragEnter = (e)=>{
1072
+ e.stopPropagation();
1073
+ state.dragEnterCount++;
1074
+ if (state.dragEnterCount > 1) return;
1075
+ let allowedOperations = $1ca228bc9257ca16$var$effectAllowedToOperations(e.dataTransfer.effectAllowed);
1076
+ let dropOperation = allowedOperations[0];
1077
+ if (typeof options.getDropOperation === 'function') {
1078
+ let types = new $4620ae0dc40f0031$export$7f04ce188c91447c(e.dataTransfer);
1079
+ dropOperation = options.getDropOperation(types, allowedOperations);
1080
+ }
1081
+ if (dropOperation !== 'cancel') setDropTarget(true);
1082
+ if (typeof options.getDropOperationForPoint === 'function') {
1083
+ let types = new $4620ae0dc40f0031$export$7f04ce188c91447c(e.dataTransfer);
1084
+ let rect = e.currentTarget.getBoundingClientRect();
1085
+ dropOperation = options.getDropOperationForPoint(types, allowedOperations, e.clientX - rect.x, e.clientY - rect.y);
1086
+ }
1087
+ state.dropEffect = $76b1e110a27b1ccd$export$5eacb0769d26d3b2[dropOperation] || 'none';
1088
+ e.dataTransfer.dropEffect = state.dropEffect;
1089
+ if (typeof options.onDropEnter === 'function' && dropOperation !== 'cancel') {
1090
+ let rect = e.currentTarget.getBoundingClientRect();
1091
+ options.onDropEnter({
1092
+ type: 'dropenter',
1093
+ x: e.clientX - rect.x,
1094
+ y: e.clientY - rect.y
1095
+ });
1096
+ }
1097
+ state.x = e.clientX;
1098
+ state.y = e.clientY;
1099
+ };
1100
+ let onDragLeave = (e)=>{
1101
+ e.stopPropagation();
1102
+ state.dragEnterCount--;
1103
+ if (state.dragEnterCount > 0) return;
1104
+ if (typeof options.onDropExit === 'function' && state.dropEffect !== 'none') {
1105
+ let rect = e.currentTarget.getBoundingClientRect();
1106
+ options.onDropExit({
1107
+ type: 'dropexit',
1108
+ x: e.clientX - rect.x,
1109
+ y: e.clientY - rect.y
1110
+ });
1111
+ }
1112
+ setDropTarget(false);
1113
+ clearTimeout(state.dropActivateTimer);
1114
+ };
1115
+ let onDrop = (e)=>{
1116
+ e.preventDefault();
1117
+ e.stopPropagation();
1118
+ if (typeof options.onDrop === 'function') {
1119
+ let dropOperation = $76b1e110a27b1ccd$export$608ecc6f1b23c35d[state.dropEffect];
1120
+ let items = $4620ae0dc40f0031$export$d9e760437831f8b3(e.dataTransfer);
1121
+ let rect = e.currentTarget.getBoundingClientRect();
1122
+ let event = {
1123
+ type: 'drop',
1124
+ x: e.clientX - rect.x,
1125
+ y: e.clientY - rect.y,
1126
+ items: items,
1127
+ dropOperation: dropOperation
1128
+ };
1129
+ // Wait a frame to dispatch the drop event so that we ensure the dragend event fires first.
1130
+ // Otherwise, if onDrop removes the original dragged element from the DOM, dragend will never be fired.
1131
+ // This behavior is consistent across browsers, but see this issue for details:
1132
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=460801
1133
+ setTimeout(()=>{
1134
+ options.onDrop(event);
1135
+ }, 0);
1136
+ }
1137
+ if (typeof options.onDropExit === 'function') {
1138
+ let rect = e.currentTarget.getBoundingClientRect();
1139
+ options.onDropExit({
1140
+ type: 'dropexit',
1141
+ x: e.clientX - rect.x,
1142
+ y: e.clientY - rect.y
1143
+ });
1144
+ }
1145
+ state.dragEnterCount = 0;
1146
+ setDropTarget(false);
1147
+ clearTimeout(state.dropActivateTimer);
1148
+ };
1149
+ let optionsRef = $4vY0V$react.useRef(options);
1150
+ optionsRef.current = options;
1151
+ $4vY0V$reactariautils.useLayoutEffect(()=>$28e10663603f5ea1$export$c28d9fb4a54e471a({
1152
+ element: optionsRef.current.ref.current,
1153
+ getDropOperation: optionsRef.current.getDropOperation,
1154
+ onDropEnter (e) {
1155
+ setDropTarget(true);
1156
+ if (typeof optionsRef.current.onDropEnter === 'function') optionsRef.current.onDropEnter(e);
1157
+ },
1158
+ onDropExit (e) {
1159
+ setDropTarget(false);
1160
+ if (typeof optionsRef.current.onDropExit === 'function') optionsRef.current.onDropExit(e);
1161
+ },
1162
+ onDrop (e) {
1163
+ if (typeof optionsRef.current.onDrop === 'function') optionsRef.current.onDrop(e);
1164
+ },
1165
+ onDropActivate (e) {
1166
+ if (typeof optionsRef.current.onDropActivate === 'function') optionsRef.current.onDropActivate(e);
1813
1167
  }
1168
+ })
1169
+ , [
1170
+ optionsRef
1171
+ ]);
1172
+ let { dropProps: dropProps } = $419982e205c8e8dc$export$62447ad3d2ec7da6();
1173
+ return {
1174
+ dropProps: {
1175
+ ...dropProps,
1176
+ onDragEnter: onDragEnter,
1177
+ onDragOver: onDragOver,
1178
+ onDragLeave: onDragLeave,
1179
+ onDrop: onDrop
1180
+ },
1181
+ isDropTarget: isDropTarget
1182
+ };
1183
+ }
1184
+ function $1ca228bc9257ca16$var$effectAllowedToOperations(effectAllowed) {
1185
+ let allowedOperationsBits = $76b1e110a27b1ccd$export$9bbdfc78cf083e16[effectAllowed];
1186
+ let allowedOperations = [];
1187
+ if (allowedOperationsBits & $76b1e110a27b1ccd$export$60b7b4bcf3903d8e.move) allowedOperations.push('move');
1188
+ if (allowedOperationsBits & $76b1e110a27b1ccd$export$60b7b4bcf3903d8e.copy) allowedOperations.push('copy');
1189
+ if (allowedOperationsBits & $76b1e110a27b1ccd$export$60b7b4bcf3903d8e.link) allowedOperations.push('link');
1190
+ return allowedOperations;
1191
+ }
1814
1192
 
1815
- case 'PageDown':
1816
- {
1817
- if (keyboardDelegate.getKeyPageBelow) {
1818
- var _target;
1819
1193
 
1820
- let target = localState.state.target;
1194
+ var $7f93a158ac20b90a$exports = {};
1821
1195
 
1822
- if (!target) {
1823
- target = nextValidTarget(null, types, drag.allowedDropOperations, getNextTarget);
1824
- } else {
1825
- // If on the root, go to the item a page below the top. Otherwise a page below the current item.
1826
- let nextKey = keyboardDelegate.getKeyPageBelow(target.type === 'item' ? target.key : keyboardDelegate.getFirstKey());
1827
- 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.
1196
+ $parcel$export($7f93a158ac20b90a$exports, "useDroppableCollection", () => $7f93a158ac20b90a$export$f4e2f423c21f7b04);
1828
1197
 
1829
- if (nextKey == null || target.type === 'item' && target.key === keyboardDelegate.getLastKey()) {
1830
- nextKey = keyboardDelegate.getLastKey();
1831
- dropPosition = 'after';
1832
- }
1833
1198
 
1834
- target = {
1835
- type: 'item',
1836
- key: nextKey,
1837
- dropPosition
1838
- }; // If the target does not accept the drop, find the next valid target.
1839
- // If no next valid target, find the previous valid target.
1840
1199
 
1841
- let operation = localState.state.getDropOperation(target, types, drag.allowedDropOperations);
1842
1200
 
1843
- if (operation === 'cancel') {
1844
- var _nextValidTarget2;
1845
1201
 
1846
- target = (_nextValidTarget2 = nextValidTarget(target, types, drag.allowedDropOperations, getNextTarget, false)) != null ? _nextValidTarget2 : nextValidTarget(target, types, drag.allowedDropOperations, getPreviousTarget, false);
1847
- }
1848
- }
1849
1202
 
1850
- localState.state.setTarget((_target = target) != null ? _target : localState.state.target);
1851
- }
1852
1203
 
1853
- break;
1204
+ const $12cc069a1c69155b$var$AUTOSCROLL_AREA_SIZE = 20;
1205
+ function $12cc069a1c69155b$export$6323452ca4533ed8(ref) {
1206
+ let scrollableRef = $4vY0V$react.useRef(null);
1207
+ $4vY0V$react.useEffect(()=>{
1208
+ if (ref.current) scrollableRef.current = $4vY0V$reactariautils.getScrollParent(ref.current);
1209
+ }, [
1210
+ ref
1211
+ ]);
1212
+ let state = $4vY0V$react.useRef({
1213
+ timer: null,
1214
+ dx: 0,
1215
+ dy: 0
1216
+ }).current;
1217
+ let scroll = $4vY0V$react.useCallback(()=>{
1218
+ scrollableRef.current.scrollLeft += state.dx;
1219
+ scrollableRef.current.scrollTop += state.dy;
1220
+ if (state.timer) state.timer = requestAnimationFrame(scroll);
1221
+ }, [
1222
+ scrollableRef,
1223
+ state
1224
+ ]);
1225
+ return {
1226
+ move (x, y) {
1227
+ // Most browsers auto scroll natively, but WebKit on macOS does not (iOS does 🤷‍♂️).
1228
+ // https://bugs.webkit.org/show_bug.cgi?id=222636
1229
+ if (!$4vY0V$reactariautils.isWebKit() || $4vY0V$reactariautils.isIOS() || !scrollableRef.current) return;
1230
+ let box = scrollableRef.current.getBoundingClientRect();
1231
+ let left = $12cc069a1c69155b$var$AUTOSCROLL_AREA_SIZE;
1232
+ let top = $12cc069a1c69155b$var$AUTOSCROLL_AREA_SIZE;
1233
+ let bottom = box.height - $12cc069a1c69155b$var$AUTOSCROLL_AREA_SIZE;
1234
+ let right = box.width - $12cc069a1c69155b$var$AUTOSCROLL_AREA_SIZE;
1235
+ if (x < left || x > right || y < top || y > bottom) {
1236
+ if (x < left) state.dx = x - left;
1237
+ else if (x > right) state.dx = x - right;
1238
+ if (y < top) state.dy = y - top;
1239
+ else if (y > bottom) state.dy = y - bottom;
1240
+ if (!state.timer) state.timer = requestAnimationFrame(scroll);
1241
+ } else this.stop();
1242
+ },
1243
+ stop () {
1244
+ if (state.timer) {
1245
+ cancelAnimationFrame(state.timer);
1246
+ state.timer = null;
1854
1247
  }
1248
+ }
1249
+ };
1250
+ }
1855
1251
 
1856
- case 'PageUp':
1857
- {
1858
- var _target2;
1859
1252
 
1860
- if (!keyboardDelegate.getKeyPageAbove) {
1861
- break;
1862
- }
1863
1253
 
1864
- let target = localState.state.target;
1865
1254
 
1866
- if (!target) {
1867
- target = nextValidTarget(null, types, drag.allowedDropOperations, getPreviousTarget);
1868
- } else if (target.type === 'item') {
1869
- // If at the top already, switch to the root. Otherwise navigate a page up.
1870
- if (target.key === keyboardDelegate.getFirstKey()) {
1871
- target = {
1255
+ const $7f93a158ac20b90a$var$DROP_POSITIONS = [
1256
+ 'before',
1257
+ 'on',
1258
+ 'after'
1259
+ ];
1260
+ function $7f93a158ac20b90a$export$f4e2f423c21f7b04(props, state1, ref2) {
1261
+ let localState = $4vY0V$react.useRef({
1262
+ props: props,
1263
+ state: state1,
1264
+ nextTarget: null,
1265
+ dropOperation: null
1266
+ }).current;
1267
+ localState.props = props;
1268
+ localState.state = state1;
1269
+ let autoScroll = $12cc069a1c69155b$export$6323452ca4533ed8(ref2);
1270
+ let { dropProps: dropProps } = $1ca228bc9257ca16$export$ccdee5eaf73cf661({
1271
+ ref: ref2,
1272
+ onDropEnter (e) {
1273
+ let target = props.getDropTargetFromPoint(e.x, e.y);
1274
+ state1.setTarget(target);
1275
+ },
1276
+ onDropMove (e) {
1277
+ state1.setTarget(localState.nextTarget);
1278
+ autoScroll.move(e.x, e.y);
1279
+ },
1280
+ getDropOperationForPoint (types, allowedOperations, x, y) {
1281
+ let target = props.getDropTargetFromPoint(x, y);
1282
+ if (!target) {
1283
+ localState.dropOperation = 'cancel';
1284
+ localState.nextTarget = null;
1285
+ return 'cancel';
1286
+ }
1287
+ localState.dropOperation = state1.getDropOperation(target, types, allowedOperations);
1288
+ // If the target doesn't accept the drop, see if the root accepts it instead.
1289
+ if (localState.dropOperation === 'cancel') {
1290
+ let rootTarget = {
1872
1291
  type: 'root'
1873
- };
1874
- } else {
1875
- let nextKey = keyboardDelegate.getKeyPageAbove(target.key);
1876
- let dropPosition = target.dropPosition;
1877
-
1878
- if (nextKey == null) {
1879
- nextKey = keyboardDelegate.getFirstKey();
1880
- dropPosition = 'before';
1881
- }
1882
-
1883
- target = {
1884
- type: 'item',
1885
- key: nextKey,
1886
- dropPosition
1887
- };
1888
- } // If the target does not accept the drop, find the previous valid target.
1889
- // If no next valid target, find the next valid target.
1890
-
1891
-
1892
- let operation = localState.state.getDropOperation(target, types, drag.allowedDropOperations);
1893
-
1894
- if (operation === 'cancel') {
1895
- var _nextValidTarget3;
1896
-
1897
- target = (_nextValidTarget3 = nextValidTarget(target, types, drag.allowedDropOperations, getPreviousTarget, false)) != null ? _nextValidTarget3 : nextValidTarget(target, types, drag.allowedDropOperations, getNextTarget, false);
1292
+ };
1293
+ let dropOperation = state1.getDropOperation(rootTarget, types, allowedOperations);
1294
+ if (dropOperation !== 'cancel') {
1295
+ target = rootTarget;
1296
+ localState.dropOperation = dropOperation;
1898
1297
  }
1899
- }
1900
-
1901
- localState.state.setTarget((_target2 = target) != null ? _target2 : localState.state.target);
1902
- break;
1903
1298
  }
1299
+ localState.nextTarget = localState.dropOperation === 'cancel' ? null : target;
1300
+ return localState.dropOperation;
1301
+ },
1302
+ onDropExit () {
1303
+ state1.setTarget(null);
1304
+ autoScroll.stop();
1305
+ },
1306
+ onDropActivate (e) {
1307
+ var ref, ref1;
1308
+ if (((ref = state1.target) === null || ref === void 0 ? void 0 : ref.type) === 'item' && ((ref1 = state1.target) === null || ref1 === void 0 ? void 0 : ref1.dropPosition) === 'on' && typeof props.onDropActivate === 'function') props.onDropActivate({
1309
+ type: 'dropactivate',
1310
+ x: e.x,
1311
+ y: e.y,
1312
+ target: state1.target
1313
+ });
1314
+ },
1315
+ onDrop (e) {
1316
+ if (state1.target && typeof props.onDrop === 'function') onDrop(e, state1.target);
1317
+ }
1318
+ });
1319
+ let droppingState = $4vY0V$react.useRef(null);
1320
+ let onDrop = $4vY0V$react.useCallback((e, target)=>{
1321
+ let { state: state2 } = localState;
1322
+ // Focus the collection.
1323
+ state2.selectionManager.setFocused(true);
1324
+ // Save some state of the collection/selection before the drop occurs so we can compare later.
1325
+ let focusedKey = state2.selectionManager.focusedKey;
1326
+ droppingState.current = {
1327
+ timeout: null,
1328
+ focusedKey: focusedKey,
1329
+ collection: state2.collection,
1330
+ selectedKeys: state2.selectionManager.selectedKeys
1331
+ };
1332
+ localState.props.onDrop({
1333
+ type: 'drop',
1334
+ x: e.x,
1335
+ y: e.y,
1336
+ target: target,
1337
+ items: e.items,
1338
+ dropOperation: e.dropOperation
1339
+ });
1340
+ // Wait for a short time period after the onDrop is called to allow the data to be read asynchronously
1341
+ // and for React to re-render. If an insert occurs during this time, it will be selected/focused below.
1342
+ // If items are not "immediately" inserted by the onDrop handler, the application will need to handle
1343
+ // selecting and focusing those items themselves.
1344
+ droppingState.current.timeout = setTimeout(()=>{
1345
+ // If focus didn't move already (e.g. due to an insert), and the user dropped on an item,
1346
+ // focus that item and show the focus ring to give the user feedback that the drop occurred.
1347
+ // Also show the focus ring if the focused key is not selected, e.g. in case of a reorder.
1348
+ let { state: state } = localState;
1349
+ if (state.selectionManager.focusedKey === focusedKey) {
1350
+ if (target.type === 'item' && target.dropPosition === 'on' && state.collection.getItem(target.key) != null) {
1351
+ state.selectionManager.setFocusedKey(target.key);
1352
+ state.selectionManager.setFocused(true);
1353
+ $4vY0V$reactariainteractions.setInteractionModality('keyboard');
1354
+ } else if (!state.selectionManager.isSelected(focusedKey)) $4vY0V$reactariainteractions.setInteractionModality('keyboard');
1355
+ }
1356
+ droppingState.current = null;
1357
+ }, 50);
1358
+ }, [
1359
+ localState
1360
+ ]);
1361
+ // eslint-disable-next-line arrow-body-style
1362
+ $4vY0V$react.useEffect(()=>{
1363
+ return ()=>{
1364
+ if (droppingState.current) clearTimeout(droppingState.current.timeout);
1365
+ };
1366
+ }, []);
1367
+ $4vY0V$reactariautils.useLayoutEffect(()=>{
1368
+ // If an insert occurs during a drop, we want to immediately select these items to give
1369
+ // feedback to the user that a drop occurred. Only do this if the selection didn't change
1370
+ // since the drop started so we don't override if the user or application did something.
1371
+ if (droppingState.current && state1.selectionManager.isFocused && state1.collection.size > droppingState.current.collection.size && state1.selectionManager.isSelectionEqual(droppingState.current.selectedKeys)) {
1372
+ let newKeys = new Set();
1373
+ for (let key of state1.collection.getKeys())if (!droppingState.current.collection.getItem(key)) newKeys.add(key);
1374
+ state1.selectionManager.setSelectedKeys(newKeys);
1375
+ // If the focused item didn't change since the drop occurred, also focus the first
1376
+ // inserted item. If selection is disabled, then also show the focus ring so there
1377
+ // is some indication that items were added.
1378
+ if (state1.selectionManager.focusedKey === droppingState.current.focusedKey) {
1379
+ let first = newKeys.keys().next().value;
1380
+ state1.selectionManager.setFocusedKey(first);
1381
+ if (state1.selectionManager.selectionMode === 'none') $4vY0V$reactariainteractions.setInteractionModality('keyboard');
1382
+ }
1383
+ droppingState.current = null;
1904
1384
  }
1905
- }
1906
-
1907
1385
  });
1908
- }, [localState, ref, onDrop]);
1909
- let id = $bc29619458500c186021634c18dc$export$useDroppableCollectionId(state);
1910
- return {
1911
- collectionProps: mergeProps(dropProps, {
1912
- id,
1913
- // Remove description from collection element. If dropping on the entire collection,
1914
- // there should be a drop indicator that has this description, so no need to double announce.
1915
- 'aria-describedby': null
1916
- })
1917
- };
1386
+ $4vY0V$react.useEffect(()=>{
1387
+ let getNextTarget1 = (target, wrap = true)=>{
1388
+ if (!target) return {
1389
+ type: 'root'
1390
+ };
1391
+ let { keyboardDelegate: keyboardDelegate } = localState.props;
1392
+ let nextKey = target.type === 'item' ? keyboardDelegate.getKeyBelow(target.key) : keyboardDelegate.getFirstKey();
1393
+ let dropPosition = 'before';
1394
+ if (target.type === 'item') {
1395
+ let positionIndex = $7f93a158ac20b90a$var$DROP_POSITIONS.indexOf(target.dropPosition);
1396
+ let nextDropPosition = $7f93a158ac20b90a$var$DROP_POSITIONS[positionIndex + 1];
1397
+ if (positionIndex < $7f93a158ac20b90a$var$DROP_POSITIONS.length - 1 && !(nextDropPosition === 'after' && nextKey != null)) return {
1398
+ type: 'item',
1399
+ key: target.key,
1400
+ dropPosition: nextDropPosition
1401
+ };
1402
+ // If the last drop position was 'after', then 'before' on the next key is equivalent.
1403
+ // Switch to 'on' instead.
1404
+ if (target.dropPosition === 'after') dropPosition = 'on';
1405
+ }
1406
+ if (nextKey == null) {
1407
+ if (wrap) return {
1408
+ type: 'root'
1409
+ };
1410
+ return null;
1411
+ }
1412
+ return {
1413
+ type: 'item',
1414
+ key: nextKey,
1415
+ dropPosition: dropPosition
1416
+ };
1417
+ };
1418
+ let getPreviousTarget = (target, wrap = true)=>{
1419
+ let { keyboardDelegate: keyboardDelegate } = localState.props;
1420
+ let nextKey = (target === null || target === void 0 ? void 0 : target.type) === 'item' ? keyboardDelegate.getKeyAbove(target.key) : keyboardDelegate.getLastKey();
1421
+ let dropPosition = !target || target.type === 'root' ? 'after' : 'on';
1422
+ if ((target === null || target === void 0 ? void 0 : target.type) === 'item') {
1423
+ let positionIndex = $7f93a158ac20b90a$var$DROP_POSITIONS.indexOf(target.dropPosition);
1424
+ let nextDropPosition = $7f93a158ac20b90a$var$DROP_POSITIONS[positionIndex - 1];
1425
+ if (positionIndex > 0 && nextDropPosition !== 'after') return {
1426
+ type: 'item',
1427
+ key: target.key,
1428
+ dropPosition: nextDropPosition
1429
+ };
1430
+ // If the last drop position was 'before', then 'after' on the previous key is equivalent.
1431
+ // Switch to 'on' instead.
1432
+ if (target.dropPosition === 'before') dropPosition = 'on';
1433
+ }
1434
+ if (nextKey == null) {
1435
+ if (wrap) return {
1436
+ type: 'root'
1437
+ };
1438
+ return null;
1439
+ }
1440
+ return {
1441
+ type: 'item',
1442
+ key: nextKey,
1443
+ dropPosition: dropPosition
1444
+ };
1445
+ };
1446
+ let nextValidTarget = (target, types, allowedDropOperations, getNextTarget, wrap = true)=>{
1447
+ let seenRoot = 0;
1448
+ let operation;
1449
+ do {
1450
+ let nextTarget = getNextTarget(target, wrap);
1451
+ if (!nextTarget) return null;
1452
+ target = nextTarget;
1453
+ operation = localState.state.getDropOperation(nextTarget, types, allowedDropOperations);
1454
+ if (target.type === 'root') seenRoot++;
1455
+ }while (operation === 'cancel' && !localState.state.isDropTarget(target) && seenRoot < 2)
1456
+ if (operation === 'cancel') return null;
1457
+ return target;
1458
+ };
1459
+ return $28e10663603f5ea1$export$c28d9fb4a54e471a({
1460
+ element: ref2.current,
1461
+ getDropOperation (types, allowedOperations) {
1462
+ if (localState.state.target) return localState.state.getDropOperation(localState.state.target, types, allowedOperations);
1463
+ // Check if any of the targets accept the drop.
1464
+ // TODO: should we have a faster way of doing this or e.g. for pagination?
1465
+ let target = nextValidTarget(null, types, allowedOperations, getNextTarget1);
1466
+ return target ? 'move' : 'cancel';
1467
+ },
1468
+ onDropEnter (e, drag) {
1469
+ let types = $4620ae0dc40f0031$export$e1d41611756c6326(drag.items);
1470
+ let selectionManager = localState.state.selectionManager;
1471
+ let target;
1472
+ // When entering the droppable collection for the first time, the default drop target
1473
+ // is after the focused key.
1474
+ let key = selectionManager.focusedKey;
1475
+ let dropPosition = 'after';
1476
+ // If the focused key is a cell, get the parent item instead.
1477
+ // For now, we assume that individual cells cannot be dropped on.
1478
+ let item = localState.state.collection.getItem(key);
1479
+ if ((item === null || item === void 0 ? void 0 : item.type) === 'cell') key = item.parentKey;
1480
+ // If the focused item is also selected, the default drop target is after the last selected item.
1481
+ // But if the focused key is the first selected item, then default to before the first selected item.
1482
+ // This is to make reordering lists slightly easier. If you select top down, we assume you want to
1483
+ // move the items down. If you select bottom up, we assume you want to move the items up.
1484
+ if (selectionManager.isSelected(key)) {
1485
+ if (selectionManager.selectedKeys.size > 1 && selectionManager.firstSelectedKey === key) dropPosition = 'before';
1486
+ else key = selectionManager.lastSelectedKey;
1487
+ }
1488
+ if (key != null) {
1489
+ target = {
1490
+ type: 'item',
1491
+ key: key,
1492
+ dropPosition: dropPosition
1493
+ };
1494
+ var ref;
1495
+ // If the default target is not valid, find the next one that is.
1496
+ if (localState.state.getDropOperation(target, types, drag.allowedDropOperations) === 'cancel') target = (ref = nextValidTarget(target, types, drag.allowedDropOperations, getNextTarget1, false)) !== null && ref !== void 0 ? ref : nextValidTarget(target, types, drag.allowedDropOperations, getPreviousTarget, false);
1497
+ }
1498
+ // If no focused key, then start from the root.
1499
+ if (!target) target = nextValidTarget(null, types, drag.allowedDropOperations, getNextTarget1);
1500
+ localState.state.setTarget(target);
1501
+ },
1502
+ onDropExit () {
1503
+ localState.state.setTarget(null);
1504
+ },
1505
+ onDropTargetEnter (target) {
1506
+ localState.state.setTarget(target);
1507
+ },
1508
+ onDropActivate (e) {
1509
+ var ref, ref3;
1510
+ if (((ref = localState.state.target) === null || ref === void 0 ? void 0 : ref.type) === 'item' && ((ref3 = localState.state.target) === null || ref3 === void 0 ? void 0 : ref3.dropPosition) === 'on' && typeof localState.props.onDropActivate === 'function') localState.props.onDropActivate({
1511
+ type: 'dropactivate',
1512
+ x: e.x,
1513
+ y: e.y,
1514
+ target: localState.state.target
1515
+ });
1516
+ },
1517
+ onDrop (e, target) {
1518
+ if (localState.state.target && typeof localState.props.onDrop === 'function') onDrop(e, target || localState.state.target);
1519
+ },
1520
+ onKeyDown (e, drag) {
1521
+ let { keyboardDelegate: keyboardDelegate } = localState.props;
1522
+ let types = $4620ae0dc40f0031$export$e1d41611756c6326(drag.items);
1523
+ switch(e.key){
1524
+ case 'ArrowDown':
1525
+ if (keyboardDelegate.getKeyBelow) {
1526
+ let target = nextValidTarget(localState.state.target, types, drag.allowedDropOperations, getNextTarget1);
1527
+ localState.state.setTarget(target);
1528
+ }
1529
+ break;
1530
+ case 'ArrowUp':
1531
+ if (keyboardDelegate.getKeyAbove) {
1532
+ let target = nextValidTarget(localState.state.target, types, drag.allowedDropOperations, getPreviousTarget);
1533
+ localState.state.setTarget(target);
1534
+ }
1535
+ break;
1536
+ case 'Home':
1537
+ if (keyboardDelegate.getFirstKey) {
1538
+ let target = nextValidTarget(null, types, drag.allowedDropOperations, getNextTarget1);
1539
+ localState.state.setTarget(target);
1540
+ }
1541
+ break;
1542
+ case 'End':
1543
+ if (keyboardDelegate.getLastKey) {
1544
+ let target = nextValidTarget(null, types, drag.allowedDropOperations, getPreviousTarget);
1545
+ localState.state.setTarget(target);
1546
+ }
1547
+ break;
1548
+ case 'PageDown':
1549
+ if (keyboardDelegate.getKeyPageBelow) {
1550
+ let target = localState.state.target;
1551
+ if (!target) target = nextValidTarget(null, types, drag.allowedDropOperations, getNextTarget1);
1552
+ else {
1553
+ // If on the root, go to the item a page below the top. Otherwise a page below the current item.
1554
+ let nextKey = keyboardDelegate.getKeyPageBelow(target.type === 'item' ? target.key : keyboardDelegate.getFirstKey());
1555
+ let dropPosition = target.type === 'item' ? target.dropPosition : 'after';
1556
+ // If there is no next key, or we are starting on the last key, jump to the last possible position.
1557
+ if (nextKey == null || target.type === 'item' && target.key === keyboardDelegate.getLastKey()) {
1558
+ nextKey = keyboardDelegate.getLastKey();
1559
+ dropPosition = 'after';
1560
+ }
1561
+ target = {
1562
+ type: 'item',
1563
+ key: nextKey,
1564
+ dropPosition: dropPosition
1565
+ };
1566
+ // If the target does not accept the drop, find the next valid target.
1567
+ // If no next valid target, find the previous valid target.
1568
+ let operation = localState.state.getDropOperation(target, types, drag.allowedDropOperations);
1569
+ var ref;
1570
+ if (operation === 'cancel') target = (ref = nextValidTarget(target, types, drag.allowedDropOperations, getNextTarget1, false)) !== null && ref !== void 0 ? ref : nextValidTarget(target, types, drag.allowedDropOperations, getPreviousTarget, false);
1571
+ }
1572
+ localState.state.setTarget(target !== null && target !== void 0 ? target : localState.state.target);
1573
+ }
1574
+ break;
1575
+ case 'PageUp':
1576
+ {
1577
+ if (!keyboardDelegate.getKeyPageAbove) break;
1578
+ let target = localState.state.target;
1579
+ if (!target) target = nextValidTarget(null, types, drag.allowedDropOperations, getPreviousTarget);
1580
+ else if (target.type === 'item') {
1581
+ // If at the top already, switch to the root. Otherwise navigate a page up.
1582
+ if (target.key === keyboardDelegate.getFirstKey()) target = {
1583
+ type: 'root'
1584
+ };
1585
+ else {
1586
+ let nextKey = keyboardDelegate.getKeyPageAbove(target.key);
1587
+ let dropPosition = target.dropPosition;
1588
+ if (nextKey == null) {
1589
+ nextKey = keyboardDelegate.getFirstKey();
1590
+ dropPosition = 'before';
1591
+ }
1592
+ target = {
1593
+ type: 'item',
1594
+ key: nextKey,
1595
+ dropPosition: dropPosition
1596
+ };
1597
+ }
1598
+ // If the target does not accept the drop, find the previous valid target.
1599
+ // If no next valid target, find the next valid target.
1600
+ let operation = localState.state.getDropOperation(target, types, drag.allowedDropOperations);
1601
+ var ref4;
1602
+ if (operation === 'cancel') target = (ref4 = nextValidTarget(target, types, drag.allowedDropOperations, getPreviousTarget, false)) !== null && ref4 !== void 0 ? ref4 : nextValidTarget(target, types, drag.allowedDropOperations, getNextTarget1, false);
1603
+ }
1604
+ localState.state.setTarget(target !== null && target !== void 0 ? target : localState.state.target);
1605
+ break;
1606
+ }
1607
+ }
1608
+ }
1609
+ });
1610
+ }, [
1611
+ localState,
1612
+ ref2,
1613
+ onDrop
1614
+ ]);
1615
+ let id = $4620ae0dc40f0031$export$b1601eb39394a581(state1);
1616
+ return {
1617
+ collectionProps: $4vY0V$reactariautils.mergeProps(dropProps, {
1618
+ id: id,
1619
+ // Remove description from collection element. If dropping on the entire collection,
1620
+ // there should be a drop indicator that has this description, so no need to double announce.
1621
+ 'aria-describedby': null
1622
+ })
1623
+ };
1918
1624
  }
1919
1625
 
1920
- exports.useDroppableCollection = useDroppableCollection;
1921
1626
 
1922
- function useDroppableItem(options, state, ref) {
1923
- let {
1924
- dropProps
1925
- } = $ca75888e192994dbb11ae05e54$export$useVirtualDrop();
1926
- useEffect(() => {
1927
- if (ref.current) {
1928
- return $a75d092e5c30878812fba78e$export$registerDropItem({
1929
- element: ref.current,
1930
- target: options.target,
1627
+ var $fc1876157e07bcec$exports = {};
1931
1628
 
1932
- getDropOperation(types, allowedOperations) {
1933
- return state.getDropOperation(options.target, types, allowedOperations);
1934
- }
1629
+ $parcel$export($fc1876157e07bcec$exports, "useDroppableItem", () => $fc1876157e07bcec$export$f7b0c5d28b66b6a5);
1935
1630
 
1936
- });
1937
- }
1938
- }, [ref, options.target, state]);
1939
- let dragSession = $a75d092e5c30878812fba78e$export$useDragSession();
1940
- let isValidDropTarget = dragSession && state.getDropOperation(options.target, $bc29619458500c186021634c18dc$export$getTypes(dragSession.dragTarget.items), dragSession.dragTarget.allowedDropOperations) !== 'cancel';
1941
- let isDropTarget = state.isDropTarget(options.target);
1942
- useEffect(() => {
1943
- if (dragSession && isDropTarget && ref.current) {
1944
- ref.current.focus();
1945
- }
1946
- }, [isDropTarget, dragSession, ref]);
1947
- return {
1948
- dropProps: _babelRuntimeHelpersExtends({}, dropProps, {
1949
- 'aria-hidden': !dragSession || isValidDropTarget ? undefined : 'true'
1950
- })
1951
- };
1952
- }
1953
1631
 
1954
- exports.useDroppableItem = useDroppableItem;
1955
- // @ts-ignore
1956
- const $e2ffcaef12f0c83baf595a484787300$var$intlMessages = {
1957
- "en-US": _babelRuntimeHelpersInteropRequireDefault($ece80d58838919a4624d1c28b393f77$exports).default
1958
- };
1959
1632
 
1960
- function useDropIndicator(props, state, ref) {
1961
- let {
1962
- target
1963
- } = props;
1964
- let {
1965
- collection
1966
- } = state;
1967
- let formatMessage = useMessageFormatter($e2ffcaef12f0c83baf595a484787300$var$intlMessages);
1968
- let dragSession = $a75d092e5c30878812fba78e$export$useDragSession();
1969
- let {
1970
- dropProps
1971
- } = useDroppableItem(props, state, ref);
1972
- let id = useId();
1973
-
1974
- let getText = key => {
1975
- var _collection$getItem;
1976
-
1977
- return (_collection$getItem = collection.getItem(key)) == null ? void 0 : _collection$getItem.textValue;
1978
- };
1979
-
1980
- let label = '';
1981
- let labelledBy;
1982
-
1983
- if (target.type === 'root') {
1984
- label = formatMessage('dropOnRoot');
1985
- labelledBy = id + " " + $bc29619458500c186021634c18dc$export$getDroppableCollectionId(state);
1986
- } else if (target.dropPosition === 'on') {
1987
- label = formatMessage('dropOnItem', {
1988
- itemText: getText(target.key)
1989
- });
1990
- } else {
1991
- let before = target.dropPosition === 'before' ? collection.getKeyBefore(target.key) : target.key;
1992
- let after = target.dropPosition === 'after' ? collection.getKeyAfter(target.key) : target.key;
1993
-
1994
- if (before && after) {
1995
- label = formatMessage('insertBetween', {
1996
- beforeItemText: getText(before),
1997
- afterItemText: getText(after)
1998
- });
1999
- } else if (before) {
2000
- label = formatMessage('insertAfter', {
2001
- itemText: getText(before)
2002
- });
2003
- } else if (after) {
2004
- label = formatMessage('insertBefore', {
2005
- itemText: getText(after)
2006
- });
2007
- }
2008
- }
2009
-
2010
- return {
2011
- dropIndicatorProps: _babelRuntimeHelpersExtends({}, dropProps, {
2012
- id,
2013
- 'aria-roledescription': formatMessage('dropIndicator'),
2014
- 'aria-label': label,
2015
- 'aria-labelledby': labelledBy,
2016
- 'aria-hidden': !dragSession ? 'true' : dropProps['aria-hidden'],
2017
- tabIndex: -1
2018
- })
2019
- };
1633
+
1634
+ function $fc1876157e07bcec$export$f7b0c5d28b66b6a5(options, state, ref) {
1635
+ let { dropProps: dropProps } = $419982e205c8e8dc$export$62447ad3d2ec7da6();
1636
+ $4vY0V$react.useEffect(()=>{
1637
+ if (ref.current) return $28e10663603f5ea1$export$aef80212ac99c003({
1638
+ element: ref.current,
1639
+ target: options.target,
1640
+ getDropOperation (types, allowedOperations) {
1641
+ return state.getDropOperation(options.target, types, allowedOperations);
1642
+ }
1643
+ });
1644
+ }, [
1645
+ ref,
1646
+ options.target,
1647
+ state
1648
+ ]);
1649
+ let dragSession = $28e10663603f5ea1$export$418e185dd3f1b968();
1650
+ let isValidDropTarget = dragSession && state.getDropOperation(options.target, $4620ae0dc40f0031$export$e1d41611756c6326(dragSession.dragTarget.items), dragSession.dragTarget.allowedDropOperations) !== 'cancel';
1651
+ let isDropTarget = state.isDropTarget(options.target);
1652
+ $4vY0V$react.useEffect(()=>{
1653
+ if (dragSession && isDropTarget && ref.current) ref.current.focus();
1654
+ }, [
1655
+ isDropTarget,
1656
+ dragSession,
1657
+ ref
1658
+ ]);
1659
+ return {
1660
+ dropProps: {
1661
+ ...dropProps,
1662
+ 'aria-hidden': !dragSession || isValidDropTarget ? undefined : 'true'
1663
+ }
1664
+ };
2020
1665
  }
2021
1666
 
2022
- exports.useDropIndicator = useDropIndicator;
2023
- // @ts-ignore
2024
- const $a1d519dfa8f428d414c97a867b60c6f$var$intlMessages = {
2025
- "en-US": _babelRuntimeHelpersInteropRequireDefault($ece80d58838919a4624d1c28b393f77$exports).default
2026
- };
2027
1667
 
2028
- function useDraggableItem(props, state) {
2029
- let formatMessage = useMessageFormatter($a1d519dfa8f428d414c97a867b60c6f$var$intlMessages);
2030
- let {
2031
- dragProps,
2032
- dragButtonProps
2033
- } = useDrag({
2034
- getItems() {
2035
- return state.getItems(props.key);
2036
- },
1668
+ var $c5557edbed563ebf$exports = {};
2037
1669
 
2038
- renderPreview() {
2039
- return state.renderPreview(props.key);
2040
- },
1670
+ $parcel$export($c5557edbed563ebf$exports, "useDropIndicator", () => $c5557edbed563ebf$export$8d0e41d2815afac5);
2041
1671
 
2042
- onDragStart(e) {
2043
- state.startDrag(props.key, e);
2044
- },
2045
1672
 
2046
- onDragMove(e) {
2047
- state.moveDrag(e);
2048
- },
2049
1673
 
2050
- onDragEnd(e) {
2051
- state.endDrag(e);
2052
- }
2053
1674
 
2054
- });
2055
- let item = state.collection.getItem(props.key);
2056
- let numSelectedKeys = state.selectionManager.selectedKeys.size;
2057
- let isSelected = state.selectionManager.isSelected(props.key);
2058
- let message;
2059
-
2060
- if (isSelected && numSelectedKeys > 1) {
2061
- message = formatMessage('dragSelectedItems', {
2062
- count: numSelectedKeys
2063
- });
2064
- } else {
2065
- var _item$textValue;
2066
1675
 
2067
- message = formatMessage('dragItem', {
2068
- itemText: (_item$textValue = item == null ? void 0 : item.textValue) != null ? _item$textValue : ''
1676
+
1677
+ function $c5557edbed563ebf$export$8d0e41d2815afac5(props, state, ref1) {
1678
+ let { target: target } = props;
1679
+ let { collection: collection } = state;
1680
+ let formatMessage = $4vY0V$reactariai18n.useMessageFormatter((/*@__PURE__*/$parcel$interopDefault($d624b4da796f302a$exports)));
1681
+ let dragSession = $28e10663603f5ea1$export$418e185dd3f1b968();
1682
+ let { dropProps: dropProps } = $fc1876157e07bcec$export$f7b0c5d28b66b6a5(props, state, ref1);
1683
+ let id = $4vY0V$reactariautils.useId();
1684
+ let getText = (key)=>{
1685
+ var ref;
1686
+ return (ref = collection.getItem(key)) === null || ref === void 0 ? void 0 : ref.textValue;
1687
+ };
1688
+ let label = '';
1689
+ let labelledBy;
1690
+ if (target.type === 'root') {
1691
+ label = formatMessage('dropOnRoot');
1692
+ labelledBy = `${id} ${$4620ae0dc40f0031$export$3093291712f09a77(state)}`;
1693
+ } else if (target.dropPosition === 'on') label = formatMessage('dropOnItem', {
1694
+ itemText: getText(target.key)
2069
1695
  });
2070
- }
2071
-
2072
- return {
2073
- dragProps,
2074
- dragButtonProps: _babelRuntimeHelpersExtends({}, dragButtonProps, {
2075
- 'aria-label': message
2076
- })
2077
- };
1696
+ else {
1697
+ let before = target.dropPosition === 'before' ? collection.getKeyBefore(target.key) : target.key;
1698
+ let after = target.dropPosition === 'after' ? collection.getKeyAfter(target.key) : target.key;
1699
+ if (before && after) label = formatMessage('insertBetween', {
1700
+ beforeItemText: getText(before),
1701
+ afterItemText: getText(after)
1702
+ });
1703
+ else if (before) label = formatMessage('insertAfter', {
1704
+ itemText: getText(before)
1705
+ });
1706
+ else if (after) label = formatMessage('insertBefore', {
1707
+ itemText: getText(after)
1708
+ });
1709
+ }
1710
+ return {
1711
+ dropIndicatorProps: {
1712
+ ...dropProps,
1713
+ id: id,
1714
+ 'aria-roledescription': formatMessage('dropIndicator'),
1715
+ 'aria-label': label,
1716
+ 'aria-labelledby': labelledBy,
1717
+ 'aria-hidden': !dragSession ? 'true' : dropProps['aria-hidden'],
1718
+ tabIndex: -1
1719
+ }
1720
+ };
2078
1721
  }
2079
1722
 
2080
- exports.useDraggableItem = useDraggableItem;
2081
- const $c1be8e43b63c7fad889cec0e3e2f47d5$var$globalEvents = new Map();
2082
1723
 
2083
- function $c1be8e43b63c7fad889cec0e3e2f47d5$var$addGlobalEventListener(event, fn) {
2084
- let eventData = $c1be8e43b63c7fad889cec0e3e2f47d5$var$globalEvents.get(event);
1724
+ var $0cbbd00cda972c67$exports = {};
2085
1725
 
2086
- if (!eventData) {
2087
- let handlers = new Set();
2088
-
2089
- let listener = e => {
2090
- for (let handler of handlers) {
2091
- handler(e);
2092
- }
2093
- };
1726
+ $parcel$export($0cbbd00cda972c67$exports, "useDraggableItem", () => $0cbbd00cda972c67$export$b35afafff42da2d9);
2094
1727
 
2095
- eventData = {
2096
- listener,
2097
- handlers
2098
- };
2099
- $c1be8e43b63c7fad889cec0e3e2f47d5$var$globalEvents.set(event, eventData);
2100
- document.addEventListener(event, listener);
2101
- }
2102
1728
 
2103
- eventData.handlers.add(fn);
2104
- return () => {
2105
- eventData.handlers.delete(fn);
2106
1729
 
2107
- if (eventData.handlers.size === 0) {
2108
- document.removeEventListener(event, eventData.listener);
2109
- $c1be8e43b63c7fad889cec0e3e2f47d5$var$globalEvents.delete(event);
2110
- }
2111
- };
1730
+ function $0cbbd00cda972c67$export$b35afafff42da2d9(props, state) {
1731
+ let formatMessage = $4vY0V$reactariai18n.useMessageFormatter((/*@__PURE__*/$parcel$interopDefault($d624b4da796f302a$exports)));
1732
+ let { dragProps: dragProps , dragButtonProps: dragButtonProps } = $dc204e8ec58447a6$export$7941f8aafa4b6021({
1733
+ getItems () {
1734
+ return state.getItems(props.key);
1735
+ },
1736
+ preview: state.preview,
1737
+ onDragStart (e) {
1738
+ state.startDrag(props.key, e);
1739
+ },
1740
+ onDragMove (e) {
1741
+ state.moveDrag(e);
1742
+ },
1743
+ onDragEnd (e) {
1744
+ state.endDrag(e);
1745
+ }
1746
+ });
1747
+ let item = state.collection.getItem(props.key);
1748
+ let numKeysForDrag = state.getKeysForDrag(props.key).size;
1749
+ let isSelected = state.selectionManager.isSelected(props.key);
1750
+ let message;
1751
+ var ref;
1752
+ if (isSelected && numKeysForDrag > 1) message = formatMessage('dragSelectedItems', {
1753
+ count: numKeysForDrag
1754
+ });
1755
+ else message = formatMessage('dragItem', {
1756
+ itemText: (ref = item === null || item === void 0 ? void 0 : item.textValue) !== null && ref !== void 0 ? ref : ''
1757
+ });
1758
+ return {
1759
+ dragProps: dragProps,
1760
+ dragButtonProps: {
1761
+ ...dragButtonProps,
1762
+ 'aria-label': message
1763
+ }
1764
+ };
2112
1765
  }
2113
1766
 
2114
- function useClipboard(options) {
2115
- let ref = useRef(options);
2116
- ref.current = options;
2117
- let isFocusedRef = useRef(false);
2118
- let {
2119
- focusProps
2120
- } = useFocus({
2121
- onFocusChange: isFocused => {
2122
- isFocusedRef.current = isFocused;
2123
- }
2124
- });
2125
- useEffect(() => {
2126
- let onBeforeCopy = e => {
2127
- // Enable the "Copy" menu item in Safari if this element is focused and copying is supported.
2128
- let options = ref.current;
2129
1767
 
2130
- if (isFocusedRef.current && options.getItems) {
2131
- e.preventDefault();
2132
- }
2133
- };
1768
+ var $74f3dedaa4d234b4$exports = {};
2134
1769
 
2135
- let onCopy = e => {
2136
- let options = ref.current;
1770
+ $parcel$export($74f3dedaa4d234b4$exports, "useClipboard", () => $74f3dedaa4d234b4$export$2314ca2a3e892862);
2137
1771
 
2138
- if (!isFocusedRef.current || !options.getItems) {
2139
- return;
2140
- }
2141
1772
 
2142
- e.preventDefault();
2143
- $bc29619458500c186021634c18dc$export$writeToDataTransfer(e.clipboardData, options.getItems());
2144
- options.onCopy == null ? void 0 : options.onCopy();
2145
- };
2146
1773
 
2147
- let onBeforeCut = e => {
2148
- let options = ref.current;
2149
1774
 
2150
- if (isFocusedRef.current && options.onCut && options.getItems) {
2151
- e.preventDefault();
2152
- }
1775
+ const $74f3dedaa4d234b4$var$globalEvents = new Map();
1776
+ function $74f3dedaa4d234b4$var$addGlobalEventListener(event, fn) {
1777
+ let eventData = $74f3dedaa4d234b4$var$globalEvents.get(event);
1778
+ if (!eventData) {
1779
+ let handlers = new Set();
1780
+ let listener = (e)=>{
1781
+ for (let handler of handlers)handler(e);
1782
+ };
1783
+ eventData = {
1784
+ listener: listener,
1785
+ handlers: handlers
1786
+ };
1787
+ $74f3dedaa4d234b4$var$globalEvents.set(event, eventData);
1788
+ document.addEventListener(event, listener);
1789
+ }
1790
+ eventData.handlers.add(fn);
1791
+ return ()=>{
1792
+ eventData.handlers.delete(fn);
1793
+ if (eventData.handlers.size === 0) {
1794
+ document.removeEventListener(event, eventData.listener);
1795
+ $74f3dedaa4d234b4$var$globalEvents.delete(event);
1796
+ }
2153
1797
  };
2154
-
2155
- let onCut = e => {
2156
- let options = ref.current;
2157
-
2158
- if (!isFocusedRef.current || !options.onCut || !options.getItems) {
2159
- return;
2160
- }
2161
-
2162
- e.preventDefault();
2163
- $bc29619458500c186021634c18dc$export$writeToDataTransfer(e.clipboardData, options.getItems());
2164
- options.onCut();
1798
+ }
1799
+ function $74f3dedaa4d234b4$export$2314ca2a3e892862(options1) {
1800
+ let ref = $4vY0V$react.useRef(options1);
1801
+ ref.current = options1;
1802
+ let isFocusedRef = $4vY0V$react.useRef(false);
1803
+ let { focusProps: focusProps } = $4vY0V$reactariainteractions.useFocus({
1804
+ onFocusChange: (isFocused)=>{
1805
+ isFocusedRef.current = isFocused;
1806
+ }
1807
+ });
1808
+ $4vY0V$react.useEffect(()=>{
1809
+ let onBeforeCopy = (e)=>{
1810
+ // Enable the "Copy" menu item in Safari if this element is focused and copying is supported.
1811
+ let options = ref.current;
1812
+ if (isFocusedRef.current && options.getItems) e.preventDefault();
1813
+ };
1814
+ let onCopy = (e)=>{
1815
+ var ref1;
1816
+ let options = ref.current;
1817
+ if (!isFocusedRef.current || !options.getItems) return;
1818
+ e.preventDefault();
1819
+ $4620ae0dc40f0031$export$f9c1490890ddd063(e.clipboardData, options.getItems());
1820
+ (ref1 = options.onCopy) === null || ref1 === void 0 ? void 0 : ref1.call(options);
1821
+ };
1822
+ let onBeforeCut = (e)=>{
1823
+ let options = ref.current;
1824
+ if (isFocusedRef.current && options.onCut && options.getItems) e.preventDefault();
1825
+ };
1826
+ let onCut = (e)=>{
1827
+ let options = ref.current;
1828
+ if (!isFocusedRef.current || !options.onCut || !options.getItems) return;
1829
+ e.preventDefault();
1830
+ $4620ae0dc40f0031$export$f9c1490890ddd063(e.clipboardData, options.getItems());
1831
+ options.onCut();
1832
+ };
1833
+ let onBeforePaste = (e)=>{
1834
+ let options = ref.current;
1835
+ // Unfortunately, e.clipboardData.types is not available in this event so we always
1836
+ // have to enable the Paste menu item even if the type of data is unsupported.
1837
+ if (isFocusedRef.current && options.onPaste) e.preventDefault();
1838
+ };
1839
+ let onPaste = (e)=>{
1840
+ let options = ref.current;
1841
+ if (!isFocusedRef.current || !options.onPaste) return;
1842
+ e.preventDefault();
1843
+ let items = $4620ae0dc40f0031$export$d9e760437831f8b3(e.clipboardData);
1844
+ options.onPaste(items);
1845
+ };
1846
+ return $4vY0V$reactariautils.chain($74f3dedaa4d234b4$var$addGlobalEventListener('beforecopy', onBeforeCopy), $74f3dedaa4d234b4$var$addGlobalEventListener('copy', onCopy), $74f3dedaa4d234b4$var$addGlobalEventListener('beforecut', onBeforeCut), $74f3dedaa4d234b4$var$addGlobalEventListener('cut', onCut), $74f3dedaa4d234b4$var$addGlobalEventListener('beforepaste', onBeforePaste), $74f3dedaa4d234b4$var$addGlobalEventListener('paste', onPaste));
1847
+ }, []);
1848
+ return {
1849
+ clipboardProps: focusProps
2165
1850
  };
1851
+ }
2166
1852
 
2167
- let onBeforePaste = e => {
2168
- let options = ref.current; // Unfortunately, e.clipboardData.types is not available in this event so we always
2169
- // have to enable the Paste menu item even if the type of data is unsupported.
2170
1853
 
2171
- if (isFocusedRef.current && options.onPaste) {
2172
- e.preventDefault();
2173
- }
2174
- };
2175
1854
 
2176
- let onPaste = e => {
2177
- let options = ref.current;
2178
1855
 
2179
- if (!isFocusedRef.current || !options.onPaste) {
2180
- return;
2181
- }
1856
+ function $2dccaca1f4baa446$var$DragPreview(props, ref) {
1857
+ let render = props.children;
1858
+ let [children, setChildren] = $4vY0V$react.useState(null);
1859
+ let domRef = $4vY0V$react.useRef(null);
1860
+ $4vY0V$react.useImperativeHandle(ref, ()=>(items, callback)=>{
1861
+ // This will be called during the onDragStart event by useDrag. We need to render the
1862
+ // preview synchronously before this event returns so we can call event.dataTransfer.setDragImage.
1863
+ $4vY0V$reactdom.flushSync(()=>{
1864
+ setChildren(render(items));
1865
+ });
1866
+ // Yield back to useDrag to set the drag image.
1867
+ callback(domRef.current);
1868
+ // Remove the preview from the DOM after a frame so the browser has time to paint.
1869
+ requestAnimationFrame(()=>{
1870
+ setChildren(null);
1871
+ });
1872
+ }
1873
+ , [
1874
+ render
1875
+ ]);
1876
+ if (!children) return null;
1877
+ return(/*#__PURE__*/ ($parcel$interopDefault($4vY0V$react)).createElement("div", {
1878
+ style: {
1879
+ zIndex: -100,
1880
+ position: 'absolute',
1881
+ top: 0,
1882
+ left: -100000
1883
+ },
1884
+ ref: domRef
1885
+ }, children));
1886
+ }
1887
+ let $2dccaca1f4baa446$export$905ab40ac2179daa = /*#__PURE__*/ ($parcel$interopDefault($4vY0V$react)).forwardRef($2dccaca1f4baa446$var$DragPreview);
2182
1888
 
2183
- e.preventDefault();
2184
- let items = $bc29619458500c186021634c18dc$export$readFromDataTransfer(e.clipboardData);
2185
- options.onPaste(items);
2186
- };
2187
1889
 
2188
- 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));
2189
- }, []);
2190
- return {
2191
- clipboardProps: focusProps
2192
- };
2193
- }
1890
+ $parcel$exportWildcard(module.exports, $dc204e8ec58447a6$exports);
1891
+ $parcel$exportWildcard(module.exports, $1ca228bc9257ca16$exports);
1892
+ $parcel$exportWildcard(module.exports, $7f93a158ac20b90a$exports);
1893
+ $parcel$exportWildcard(module.exports, $fc1876157e07bcec$exports);
1894
+ $parcel$exportWildcard(module.exports, $c5557edbed563ebf$exports);
1895
+ $parcel$exportWildcard(module.exports, $0cbbd00cda972c67$exports);
1896
+ $parcel$exportWildcard(module.exports, $74f3dedaa4d234b4$exports);
1897
+
2194
1898
 
2195
- exports.useClipboard = useClipboard;
2196
1899
  //# sourceMappingURL=main.js.map