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

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