laif-ds 0.1.6 → 0.1.8
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/_virtual/_cloneBuffer.js +5 -0
- package/dist/_virtual/dayjs.min.js +8 -0
- package/dist/_virtual/dayjs.min2.js +5 -0
- package/dist/_virtual/debounce.js +8 -0
- package/dist/_virtual/index5.js +5 -2
- package/dist/_virtual/index6.js +5 -0
- package/dist/_virtual/index7.js +5 -0
- package/dist/_virtual/localizedFormat.js +8 -0
- package/dist/_virtual/localizedFormat2.js +5 -0
- package/dist/_virtual/omit.js +8 -0
- package/dist/components/ui/gantt/assets/icons/MinusSquareOutlined.js +36 -0
- package/dist/components/ui/gantt/assets/icons/PlusSquareOutlined.js +45 -0
- package/dist/components/ui/gantt/components/Chart/Bars/Bars.js +115 -0
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarItem/BarItem.js +158 -0
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsItems/BarItems.js +36 -0
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsRow.js +26 -0
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsRowContext.js +14 -0
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/RepeteadBars/RepeteadBars.js +75 -0
- package/dist/components/ui/gantt/components/Chart/Chart.js +66 -0
- package/dist/components/ui/gantt/components/Chart/Scale/Scale.js +88 -0
- package/dist/components/ui/gantt/components/Chart/Tree/Tree.js +72 -0
- package/dist/components/ui/gantt/components/Controls/Controls.js +82 -0
- package/dist/components/ui/gantt/components/Gantt/Gantt.js +58 -0
- package/dist/components/ui/gantt/components/Gantt/GanttContext.js +35 -0
- package/dist/components/ui/gantt/constants/DimensionsSettings.js +89 -0
- package/dist/components/ui/gantt/constants/DragStepOptions.js +43 -0
- package/dist/components/ui/gantt/constants/GanttConsts.js +17 -0
- package/dist/components/ui/gantt/constants/colors.json.js +106 -0
- package/dist/components/ui/gantt/enums/DataRepeatTimes.js +5 -0
- package/dist/components/ui/gantt/enums/DragStepSizes.js +5 -0
- package/dist/components/ui/gantt/enums/DragTypes.js +5 -0
- package/dist/components/ui/gantt/enums/GanttDimensions.js +5 -0
- package/dist/components/ui/gantt/enums/GanttUnitOfTimes.js +5 -0
- package/dist/components/ui/gantt/hooks/useForwardRef.js +11 -0
- package/dist/components/ui/gantt/hooks/useGanttCalculate.js +30 -0
- package/dist/components/ui/gantt/utils/getInitialScrollOffset.js +11 -0
- package/dist/components/ui/gantt/utils/getScaleDates.js +14 -0
- package/dist/components/ui/gantt/utils/getScaleItems.js +33 -0
- package/dist/components/ui/gantt/utils/getWholeWidth.js +7 -0
- package/dist/components/ui/gantt/utils/transformData.js +36 -0
- package/dist/index.d.ts +168 -0
- package/dist/index.js +300 -294
- package/dist/laif-ds.css +1 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +8 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/extends.js +13 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +8 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +9 -0
- package/dist/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +57 -0
- package/dist/node_modules/@dnd-kit/core/dist/core.esm.js +2150 -0
- package/dist/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js +27 -0
- package/dist/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +184 -0
- package/dist/node_modules/classnames/index.js +43 -0
- package/dist/node_modules/dayjs/dayjs.min.js +283 -0
- package/dist/node_modules/dayjs/plugin/localizedFormat.js +30 -0
- package/dist/node_modules/lodash/_arrayEach.js +15 -0
- package/dist/node_modules/lodash/_assignValue.js +17 -0
- package/dist/node_modules/lodash/_baseAssign.js +16 -0
- package/dist/node_modules/lodash/_baseAssignIn.js +16 -0
- package/dist/node_modules/lodash/_baseAssignValue.js +20 -0
- package/dist/node_modules/lodash/_baseClone.js +71 -0
- package/dist/node_modules/lodash/_baseCreate.js +24 -0
- package/dist/node_modules/lodash/_baseIsMap.js +16 -0
- package/dist/node_modules/lodash/_baseIsSet.js +16 -0
- package/dist/node_modules/lodash/_baseKeysIn.js +22 -0
- package/dist/node_modules/lodash/_baseUnset.js +18 -0
- package/dist/node_modules/lodash/_cloneArrayBuffer.js +16 -0
- package/dist/node_modules/lodash/_cloneBuffer.js +20 -0
- package/dist/node_modules/lodash/_cloneDataView.js +16 -0
- package/dist/node_modules/lodash/_cloneRegExp.js +15 -0
- package/dist/node_modules/lodash/_cloneSymbol.js +15 -0
- package/dist/node_modules/lodash/_cloneTypedArray.js +16 -0
- package/dist/node_modules/lodash/_copyArray.js +16 -0
- package/dist/node_modules/lodash/_copyObject.js +22 -0
- package/dist/node_modules/lodash/_copySymbols.js +16 -0
- package/dist/node_modules/lodash/_copySymbolsIn.js +16 -0
- package/dist/node_modules/lodash/_customOmitClone.js +15 -0
- package/dist/node_modules/lodash/_flatRest.js +17 -0
- package/dist/node_modules/lodash/_getAllKeysIn.js +17 -0
- package/dist/node_modules/lodash/_getPrototype.js +12 -0
- package/dist/node_modules/lodash/_getSymbolsIn.js +19 -0
- package/dist/node_modules/lodash/_initCloneArray.js +15 -0
- package/dist/node_modules/lodash/_initCloneByTag.js +49 -0
- package/dist/node_modules/lodash/_initCloneObject.js +17 -0
- package/dist/node_modules/lodash/_nativeKeysIn.js +17 -0
- package/dist/node_modules/lodash/_parent.js +16 -0
- package/dist/node_modules/lodash/flatten.js +16 -0
- package/dist/node_modules/lodash/isMap.js +14 -0
- package/dist/node_modules/lodash/isPlainObject.js +23 -0
- package/dist/node_modules/lodash/isSet.js +14 -0
- package/dist/node_modules/lodash/keysIn.js +17 -0
- package/dist/node_modules/lodash/last.js +14 -0
- package/dist/node_modules/lodash/omit.js +30 -0
- package/dist/node_modules/memoize-one/dist/memoize-one.esm.js +28 -0
- package/dist/node_modules/react-window/dist/index.esm.js +375 -0
- package/dist/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +8 -1
|
@@ -0,0 +1,2150 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import H, { memo as cn, useReducer as un, useState as _, useRef as F, useMemo as M, useCallback as Q, useEffect as N, createContext as Ae, useContext as Pe } from "react";
|
|
3
|
+
import { unstable_batchedUpdates as ke, createPortal as dn } from "react-dom";
|
|
4
|
+
import { useLatestValue as tt, useUniqueId as nt, getEventCoordinates as Je, getWindow as Z, add as pe, useIsomorphicLayoutEffect as be, getOwnerDocument as we, isKeyboardEvent as zt, subtract as ze, useLazyMemo as Me, isHTMLElement as We, useNodeRef as Ve, canUseDOM as rt, useInterval as fn, usePrevious as Ge, findFirstFocusableNode as hn, useEvent as Ft, isWindow as ot, isNode as gn, isDocument as $t, isSVGElement as vn } from "../../utilities/dist/utilities.esm.js";
|
|
5
|
+
import { useAnnouncement as pn, HiddenText as bn, LiveRegion as wn } from "../../accessibility/dist/accessibility.esm.js";
|
|
6
|
+
const Wt = /* @__PURE__ */ Ae(null);
|
|
7
|
+
function yn(e) {
|
|
8
|
+
const t = Pe(Wt);
|
|
9
|
+
N(() => {
|
|
10
|
+
if (!t)
|
|
11
|
+
throw new Error("useDndMonitor must be used within a children of <DndContext>");
|
|
12
|
+
return t(e);
|
|
13
|
+
}, [e, t]);
|
|
14
|
+
}
|
|
15
|
+
function mn() {
|
|
16
|
+
const [e] = _(() => /* @__PURE__ */ new Set()), t = Q((r) => (e.add(r), () => e.delete(r)), [e]);
|
|
17
|
+
return [Q((r) => {
|
|
18
|
+
let {
|
|
19
|
+
type: o,
|
|
20
|
+
event: i
|
|
21
|
+
} = r;
|
|
22
|
+
e.forEach((s) => {
|
|
23
|
+
var l;
|
|
24
|
+
return (l = s[o]) == null ? void 0 : l.call(s, i);
|
|
25
|
+
});
|
|
26
|
+
}, [e]), t];
|
|
27
|
+
}
|
|
28
|
+
const Dn = {
|
|
29
|
+
draggable: `
|
|
30
|
+
To pick up a draggable item, press the space bar.
|
|
31
|
+
While dragging, use the arrow keys to move the item.
|
|
32
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
33
|
+
`
|
|
34
|
+
}, xn = {
|
|
35
|
+
onDragStart(e) {
|
|
36
|
+
let {
|
|
37
|
+
active: t
|
|
38
|
+
} = e;
|
|
39
|
+
return "Picked up draggable item " + t.id + ".";
|
|
40
|
+
},
|
|
41
|
+
onDragOver(e) {
|
|
42
|
+
let {
|
|
43
|
+
active: t,
|
|
44
|
+
over: n
|
|
45
|
+
} = e;
|
|
46
|
+
return n ? "Draggable item " + t.id + " was moved over droppable area " + n.id + "." : "Draggable item " + t.id + " is no longer over a droppable area.";
|
|
47
|
+
},
|
|
48
|
+
onDragEnd(e) {
|
|
49
|
+
let {
|
|
50
|
+
active: t,
|
|
51
|
+
over: n
|
|
52
|
+
} = e;
|
|
53
|
+
return n ? "Draggable item " + t.id + " was dropped over droppable area " + n.id : "Draggable item " + t.id + " was dropped.";
|
|
54
|
+
},
|
|
55
|
+
onDragCancel(e) {
|
|
56
|
+
let {
|
|
57
|
+
active: t
|
|
58
|
+
} = e;
|
|
59
|
+
return "Dragging was cancelled. Draggable item " + t.id + " was dropped.";
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
function Cn(e) {
|
|
63
|
+
let {
|
|
64
|
+
announcements: t = xn,
|
|
65
|
+
container: n,
|
|
66
|
+
hiddenTextDescribedById: r,
|
|
67
|
+
screenReaderInstructions: o = Dn
|
|
68
|
+
} = e;
|
|
69
|
+
const {
|
|
70
|
+
announce: i,
|
|
71
|
+
announcement: s
|
|
72
|
+
} = pn(), l = nt("DndLiveRegion"), [a, c] = _(!1);
|
|
73
|
+
if (N(() => {
|
|
74
|
+
c(!0);
|
|
75
|
+
}, []), yn(M(() => ({
|
|
76
|
+
onDragStart(u) {
|
|
77
|
+
let {
|
|
78
|
+
active: g
|
|
79
|
+
} = u;
|
|
80
|
+
i(t.onDragStart({
|
|
81
|
+
active: g
|
|
82
|
+
}));
|
|
83
|
+
},
|
|
84
|
+
onDragMove(u) {
|
|
85
|
+
let {
|
|
86
|
+
active: g,
|
|
87
|
+
over: h
|
|
88
|
+
} = u;
|
|
89
|
+
t.onDragMove && i(t.onDragMove({
|
|
90
|
+
active: g,
|
|
91
|
+
over: h
|
|
92
|
+
}));
|
|
93
|
+
},
|
|
94
|
+
onDragOver(u) {
|
|
95
|
+
let {
|
|
96
|
+
active: g,
|
|
97
|
+
over: h
|
|
98
|
+
} = u;
|
|
99
|
+
i(t.onDragOver({
|
|
100
|
+
active: g,
|
|
101
|
+
over: h
|
|
102
|
+
}));
|
|
103
|
+
},
|
|
104
|
+
onDragEnd(u) {
|
|
105
|
+
let {
|
|
106
|
+
active: g,
|
|
107
|
+
over: h
|
|
108
|
+
} = u;
|
|
109
|
+
i(t.onDragEnd({
|
|
110
|
+
active: g,
|
|
111
|
+
over: h
|
|
112
|
+
}));
|
|
113
|
+
},
|
|
114
|
+
onDragCancel(u) {
|
|
115
|
+
let {
|
|
116
|
+
active: g,
|
|
117
|
+
over: h
|
|
118
|
+
} = u;
|
|
119
|
+
i(t.onDragCancel({
|
|
120
|
+
active: g,
|
|
121
|
+
over: h
|
|
122
|
+
}));
|
|
123
|
+
}
|
|
124
|
+
}), [i, t])), !a)
|
|
125
|
+
return null;
|
|
126
|
+
const d = H.createElement(H.Fragment, null, H.createElement(bn, {
|
|
127
|
+
id: r,
|
|
128
|
+
value: o.draggable
|
|
129
|
+
}), H.createElement(wn, {
|
|
130
|
+
id: l,
|
|
131
|
+
announcement: s
|
|
132
|
+
}));
|
|
133
|
+
return n ? dn(d, n) : d;
|
|
134
|
+
}
|
|
135
|
+
var L;
|
|
136
|
+
(function(e) {
|
|
137
|
+
e.DragStart = "dragStart", e.DragMove = "dragMove", e.DragEnd = "dragEnd", e.DragCancel = "dragCancel", e.DragOver = "dragOver", e.RegisterDroppable = "registerDroppable", e.SetDroppableDisabled = "setDroppableDisabled", e.UnregisterDroppable = "unregisterDroppable";
|
|
138
|
+
})(L || (L = {}));
|
|
139
|
+
function Fe() {
|
|
140
|
+
}
|
|
141
|
+
const K = /* @__PURE__ */ Object.freeze({
|
|
142
|
+
x: 0,
|
|
143
|
+
y: 0
|
|
144
|
+
});
|
|
145
|
+
function Sn(e, t) {
|
|
146
|
+
let {
|
|
147
|
+
data: {
|
|
148
|
+
value: n
|
|
149
|
+
}
|
|
150
|
+
} = e, {
|
|
151
|
+
data: {
|
|
152
|
+
value: r
|
|
153
|
+
}
|
|
154
|
+
} = t;
|
|
155
|
+
return r - n;
|
|
156
|
+
}
|
|
157
|
+
function Rn(e, t) {
|
|
158
|
+
if (!e || e.length === 0)
|
|
159
|
+
return null;
|
|
160
|
+
const [n] = e;
|
|
161
|
+
return n[t];
|
|
162
|
+
}
|
|
163
|
+
function En(e, t) {
|
|
164
|
+
const n = Math.max(t.top, e.top), r = Math.max(t.left, e.left), o = Math.min(t.left + t.width, e.left + e.width), i = Math.min(t.top + t.height, e.top + e.height), s = o - r, l = i - n;
|
|
165
|
+
if (r < o && n < i) {
|
|
166
|
+
const a = t.width * t.height, c = e.width * e.height, d = s * l, u = d / (a + c - d);
|
|
167
|
+
return Number(u.toFixed(4));
|
|
168
|
+
}
|
|
169
|
+
return 0;
|
|
170
|
+
}
|
|
171
|
+
const An = (e) => {
|
|
172
|
+
let {
|
|
173
|
+
collisionRect: t,
|
|
174
|
+
droppableRects: n,
|
|
175
|
+
droppableContainers: r
|
|
176
|
+
} = e;
|
|
177
|
+
const o = [];
|
|
178
|
+
for (const i of r) {
|
|
179
|
+
const {
|
|
180
|
+
id: s
|
|
181
|
+
} = i, l = n.get(s);
|
|
182
|
+
if (l) {
|
|
183
|
+
const a = En(l, t);
|
|
184
|
+
a > 0 && o.push({
|
|
185
|
+
id: s,
|
|
186
|
+
data: {
|
|
187
|
+
droppableContainer: i,
|
|
188
|
+
value: a
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return o.sort(Sn);
|
|
194
|
+
};
|
|
195
|
+
function Mn(e, t, n) {
|
|
196
|
+
return {
|
|
197
|
+
...e,
|
|
198
|
+
scaleX: t && n ? t.width / n.width : 1,
|
|
199
|
+
scaleY: t && n ? t.height / n.height : 1
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
function Ut(e, t) {
|
|
203
|
+
return e && t ? {
|
|
204
|
+
x: e.left - t.left,
|
|
205
|
+
y: e.top - t.top
|
|
206
|
+
} : K;
|
|
207
|
+
}
|
|
208
|
+
function Nn(e) {
|
|
209
|
+
return function(n) {
|
|
210
|
+
for (var r = arguments.length, o = new Array(r > 1 ? r - 1 : 0), i = 1; i < r; i++)
|
|
211
|
+
o[i - 1] = arguments[i];
|
|
212
|
+
return o.reduce((s, l) => ({
|
|
213
|
+
...s,
|
|
214
|
+
top: s.top + e * l.y,
|
|
215
|
+
bottom: s.bottom + e * l.y,
|
|
216
|
+
left: s.left + e * l.x,
|
|
217
|
+
right: s.right + e * l.x
|
|
218
|
+
}), {
|
|
219
|
+
...n
|
|
220
|
+
});
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
const On = /* @__PURE__ */ Nn(1);
|
|
224
|
+
function Ln(e) {
|
|
225
|
+
if (e.startsWith("matrix3d(")) {
|
|
226
|
+
const t = e.slice(9, -1).split(/, /);
|
|
227
|
+
return {
|
|
228
|
+
x: +t[12],
|
|
229
|
+
y: +t[13],
|
|
230
|
+
scaleX: +t[0],
|
|
231
|
+
scaleY: +t[5]
|
|
232
|
+
};
|
|
233
|
+
} else if (e.startsWith("matrix(")) {
|
|
234
|
+
const t = e.slice(7, -1).split(/, /);
|
|
235
|
+
return {
|
|
236
|
+
x: +t[4],
|
|
237
|
+
y: +t[5],
|
|
238
|
+
scaleX: +t[0],
|
|
239
|
+
scaleY: +t[3]
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
return null;
|
|
243
|
+
}
|
|
244
|
+
function Tn(e, t, n) {
|
|
245
|
+
const r = Ln(t);
|
|
246
|
+
if (!r)
|
|
247
|
+
return e;
|
|
248
|
+
const {
|
|
249
|
+
scaleX: o,
|
|
250
|
+
scaleY: i,
|
|
251
|
+
x: s,
|
|
252
|
+
y: l
|
|
253
|
+
} = r, a = e.left - s - (1 - o) * parseFloat(n), c = e.top - l - (1 - i) * parseFloat(n.slice(n.indexOf(" ") + 1)), d = o ? e.width / o : e.width, u = i ? e.height / i : e.height;
|
|
254
|
+
return {
|
|
255
|
+
width: d,
|
|
256
|
+
height: u,
|
|
257
|
+
top: c,
|
|
258
|
+
right: a + d,
|
|
259
|
+
bottom: c + u,
|
|
260
|
+
left: a
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
const In = {
|
|
264
|
+
ignoreTransform: !1
|
|
265
|
+
};
|
|
266
|
+
function Ne(e, t) {
|
|
267
|
+
t === void 0 && (t = In);
|
|
268
|
+
let n = e.getBoundingClientRect();
|
|
269
|
+
if (t.ignoreTransform) {
|
|
270
|
+
const {
|
|
271
|
+
transform: c,
|
|
272
|
+
transformOrigin: d
|
|
273
|
+
} = Z(e).getComputedStyle(e);
|
|
274
|
+
c && (n = Tn(n, c, d));
|
|
275
|
+
}
|
|
276
|
+
const {
|
|
277
|
+
top: r,
|
|
278
|
+
left: o,
|
|
279
|
+
width: i,
|
|
280
|
+
height: s,
|
|
281
|
+
bottom: l,
|
|
282
|
+
right: a
|
|
283
|
+
} = n;
|
|
284
|
+
return {
|
|
285
|
+
top: r,
|
|
286
|
+
left: o,
|
|
287
|
+
width: i,
|
|
288
|
+
height: s,
|
|
289
|
+
bottom: l,
|
|
290
|
+
right: a
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
function At(e) {
|
|
294
|
+
return Ne(e, {
|
|
295
|
+
ignoreTransform: !0
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
function kn(e) {
|
|
299
|
+
const t = e.innerWidth, n = e.innerHeight;
|
|
300
|
+
return {
|
|
301
|
+
top: 0,
|
|
302
|
+
left: 0,
|
|
303
|
+
right: t,
|
|
304
|
+
bottom: n,
|
|
305
|
+
width: t,
|
|
306
|
+
height: n
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
function Bn(e, t) {
|
|
310
|
+
return t === void 0 && (t = Z(e).getComputedStyle(e)), t.position === "fixed";
|
|
311
|
+
}
|
|
312
|
+
function Pn(e, t) {
|
|
313
|
+
t === void 0 && (t = Z(e).getComputedStyle(e));
|
|
314
|
+
const n = /(auto|scroll|overlay)/;
|
|
315
|
+
return ["overflow", "overflowX", "overflowY"].some((o) => {
|
|
316
|
+
const i = t[o];
|
|
317
|
+
return typeof i == "string" ? n.test(i) : !1;
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
function it(e, t) {
|
|
321
|
+
const n = [];
|
|
322
|
+
function r(o) {
|
|
323
|
+
if (t != null && n.length >= t || !o)
|
|
324
|
+
return n;
|
|
325
|
+
if ($t(o) && o.scrollingElement != null && !n.includes(o.scrollingElement))
|
|
326
|
+
return n.push(o.scrollingElement), n;
|
|
327
|
+
if (!We(o) || vn(o) || n.includes(o))
|
|
328
|
+
return n;
|
|
329
|
+
const i = Z(e).getComputedStyle(o);
|
|
330
|
+
return o !== e && Pn(o, i) && n.push(o), Bn(o, i) ? n : r(o.parentNode);
|
|
331
|
+
}
|
|
332
|
+
return e ? r(e) : n;
|
|
333
|
+
}
|
|
334
|
+
function Xt(e) {
|
|
335
|
+
const [t] = it(e, 1);
|
|
336
|
+
return t ?? null;
|
|
337
|
+
}
|
|
338
|
+
function je(e) {
|
|
339
|
+
return !rt || !e ? null : ot(e) ? e : gn(e) ? $t(e) || e === we(e).scrollingElement ? window : We(e) ? e : null : null;
|
|
340
|
+
}
|
|
341
|
+
function _t(e) {
|
|
342
|
+
return ot(e) ? e.scrollX : e.scrollLeft;
|
|
343
|
+
}
|
|
344
|
+
function Kt(e) {
|
|
345
|
+
return ot(e) ? e.scrollY : e.scrollTop;
|
|
346
|
+
}
|
|
347
|
+
function Qe(e) {
|
|
348
|
+
return {
|
|
349
|
+
x: _t(e),
|
|
350
|
+
y: Kt(e)
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
var R;
|
|
354
|
+
(function(e) {
|
|
355
|
+
e[e.Forward = 1] = "Forward", e[e.Backward = -1] = "Backward";
|
|
356
|
+
})(R || (R = {}));
|
|
357
|
+
function Yt(e) {
|
|
358
|
+
return !rt || !e ? !1 : e === document.scrollingElement;
|
|
359
|
+
}
|
|
360
|
+
function jt(e) {
|
|
361
|
+
const t = {
|
|
362
|
+
x: 0,
|
|
363
|
+
y: 0
|
|
364
|
+
}, n = Yt(e) ? {
|
|
365
|
+
height: window.innerHeight,
|
|
366
|
+
width: window.innerWidth
|
|
367
|
+
} : {
|
|
368
|
+
height: e.clientHeight,
|
|
369
|
+
width: e.clientWidth
|
|
370
|
+
}, r = {
|
|
371
|
+
x: e.scrollWidth - n.width,
|
|
372
|
+
y: e.scrollHeight - n.height
|
|
373
|
+
}, o = e.scrollTop <= t.y, i = e.scrollLeft <= t.x, s = e.scrollTop >= r.y, l = e.scrollLeft >= r.x;
|
|
374
|
+
return {
|
|
375
|
+
isTop: o,
|
|
376
|
+
isLeft: i,
|
|
377
|
+
isBottom: s,
|
|
378
|
+
isRight: l,
|
|
379
|
+
maxScroll: r,
|
|
380
|
+
minScroll: t
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
const zn = {
|
|
384
|
+
x: 0.2,
|
|
385
|
+
y: 0.2
|
|
386
|
+
};
|
|
387
|
+
function Fn(e, t, n, r, o) {
|
|
388
|
+
let {
|
|
389
|
+
top: i,
|
|
390
|
+
left: s,
|
|
391
|
+
right: l,
|
|
392
|
+
bottom: a
|
|
393
|
+
} = n;
|
|
394
|
+
r === void 0 && (r = 10), o === void 0 && (o = zn);
|
|
395
|
+
const {
|
|
396
|
+
isTop: c,
|
|
397
|
+
isBottom: d,
|
|
398
|
+
isLeft: u,
|
|
399
|
+
isRight: g
|
|
400
|
+
} = jt(e), h = {
|
|
401
|
+
x: 0,
|
|
402
|
+
y: 0
|
|
403
|
+
}, D = {
|
|
404
|
+
x: 0,
|
|
405
|
+
y: 0
|
|
406
|
+
}, f = {
|
|
407
|
+
height: t.height * o.y,
|
|
408
|
+
width: t.width * o.x
|
|
409
|
+
};
|
|
410
|
+
return !c && i <= t.top + f.height ? (h.y = R.Backward, D.y = r * Math.abs((t.top + f.height - i) / f.height)) : !d && a >= t.bottom - f.height && (h.y = R.Forward, D.y = r * Math.abs((t.bottom - f.height - a) / f.height)), !g && l >= t.right - f.width ? (h.x = R.Forward, D.x = r * Math.abs((t.right - f.width - l) / f.width)) : !u && s <= t.left + f.width && (h.x = R.Backward, D.x = r * Math.abs((t.left + f.width - s) / f.width)), {
|
|
411
|
+
direction: h,
|
|
412
|
+
speed: D
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
function $n(e) {
|
|
416
|
+
if (e === document.scrollingElement) {
|
|
417
|
+
const {
|
|
418
|
+
innerWidth: i,
|
|
419
|
+
innerHeight: s
|
|
420
|
+
} = window;
|
|
421
|
+
return {
|
|
422
|
+
top: 0,
|
|
423
|
+
left: 0,
|
|
424
|
+
right: i,
|
|
425
|
+
bottom: s,
|
|
426
|
+
width: i,
|
|
427
|
+
height: s
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
const {
|
|
431
|
+
top: t,
|
|
432
|
+
left: n,
|
|
433
|
+
right: r,
|
|
434
|
+
bottom: o
|
|
435
|
+
} = e.getBoundingClientRect();
|
|
436
|
+
return {
|
|
437
|
+
top: t,
|
|
438
|
+
left: n,
|
|
439
|
+
right: r,
|
|
440
|
+
bottom: o,
|
|
441
|
+
width: e.clientWidth,
|
|
442
|
+
height: e.clientHeight
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
function Ht(e) {
|
|
446
|
+
return e.reduce((t, n) => pe(t, Qe(n)), K);
|
|
447
|
+
}
|
|
448
|
+
function Wn(e) {
|
|
449
|
+
return e.reduce((t, n) => t + _t(n), 0);
|
|
450
|
+
}
|
|
451
|
+
function Un(e) {
|
|
452
|
+
return e.reduce((t, n) => t + Kt(n), 0);
|
|
453
|
+
}
|
|
454
|
+
function Xn(e, t) {
|
|
455
|
+
if (t === void 0 && (t = Ne), !e)
|
|
456
|
+
return;
|
|
457
|
+
const {
|
|
458
|
+
top: n,
|
|
459
|
+
left: r,
|
|
460
|
+
bottom: o,
|
|
461
|
+
right: i
|
|
462
|
+
} = t(e);
|
|
463
|
+
Xt(e) && (o <= 0 || i <= 0 || n >= window.innerHeight || r >= window.innerWidth) && e.scrollIntoView({
|
|
464
|
+
block: "center",
|
|
465
|
+
inline: "center"
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
const _n = [["x", ["left", "right"], Wn], ["y", ["top", "bottom"], Un]];
|
|
469
|
+
class st {
|
|
470
|
+
constructor(t, n) {
|
|
471
|
+
this.rect = void 0, this.width = void 0, this.height = void 0, this.top = void 0, this.bottom = void 0, this.right = void 0, this.left = void 0;
|
|
472
|
+
const r = it(n), o = Ht(r);
|
|
473
|
+
this.rect = {
|
|
474
|
+
...t
|
|
475
|
+
}, this.width = t.width, this.height = t.height;
|
|
476
|
+
for (const [i, s, l] of _n)
|
|
477
|
+
for (const a of s)
|
|
478
|
+
Object.defineProperty(this, a, {
|
|
479
|
+
get: () => {
|
|
480
|
+
const c = l(r), d = o[i] - c;
|
|
481
|
+
return this.rect[a] + d;
|
|
482
|
+
},
|
|
483
|
+
enumerable: !0
|
|
484
|
+
});
|
|
485
|
+
Object.defineProperty(this, "rect", {
|
|
486
|
+
enumerable: !1
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
class Ce {
|
|
491
|
+
constructor(t) {
|
|
492
|
+
this.target = void 0, this.listeners = [], this.removeAll = () => {
|
|
493
|
+
this.listeners.forEach((n) => {
|
|
494
|
+
var r;
|
|
495
|
+
return (r = this.target) == null ? void 0 : r.removeEventListener(...n);
|
|
496
|
+
});
|
|
497
|
+
}, this.target = t;
|
|
498
|
+
}
|
|
499
|
+
add(t, n, r) {
|
|
500
|
+
var o;
|
|
501
|
+
(o = this.target) == null || o.addEventListener(t, n, r), this.listeners.push([t, n, r]);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
function Kn(e) {
|
|
505
|
+
const {
|
|
506
|
+
EventTarget: t
|
|
507
|
+
} = Z(e);
|
|
508
|
+
return e instanceof t ? e : we(e);
|
|
509
|
+
}
|
|
510
|
+
function He(e, t) {
|
|
511
|
+
const n = Math.abs(e.x), r = Math.abs(e.y);
|
|
512
|
+
return typeof t == "number" ? Math.sqrt(n ** 2 + r ** 2) > t : "x" in t && "y" in t ? n > t.x && r > t.y : "x" in t ? n > t.x : "y" in t ? r > t.y : !1;
|
|
513
|
+
}
|
|
514
|
+
var W;
|
|
515
|
+
(function(e) {
|
|
516
|
+
e.Click = "click", e.DragStart = "dragstart", e.Keydown = "keydown", e.ContextMenu = "contextmenu", e.Resize = "resize", e.SelectionChange = "selectionchange", e.VisibilityChange = "visibilitychange";
|
|
517
|
+
})(W || (W = {}));
|
|
518
|
+
function Mt(e) {
|
|
519
|
+
e.preventDefault();
|
|
520
|
+
}
|
|
521
|
+
function Yn(e) {
|
|
522
|
+
e.stopPropagation();
|
|
523
|
+
}
|
|
524
|
+
var w;
|
|
525
|
+
(function(e) {
|
|
526
|
+
e.Space = "Space", e.Down = "ArrowDown", e.Right = "ArrowRight", e.Left = "ArrowLeft", e.Up = "ArrowUp", e.Esc = "Escape", e.Enter = "Enter", e.Tab = "Tab";
|
|
527
|
+
})(w || (w = {}));
|
|
528
|
+
const qt = {
|
|
529
|
+
start: [w.Space, w.Enter],
|
|
530
|
+
cancel: [w.Esc],
|
|
531
|
+
end: [w.Space, w.Enter, w.Tab]
|
|
532
|
+
}, jn = (e, t) => {
|
|
533
|
+
let {
|
|
534
|
+
currentCoordinates: n
|
|
535
|
+
} = t;
|
|
536
|
+
switch (e.code) {
|
|
537
|
+
case w.Right:
|
|
538
|
+
return {
|
|
539
|
+
...n,
|
|
540
|
+
x: n.x + 25
|
|
541
|
+
};
|
|
542
|
+
case w.Left:
|
|
543
|
+
return {
|
|
544
|
+
...n,
|
|
545
|
+
x: n.x - 25
|
|
546
|
+
};
|
|
547
|
+
case w.Down:
|
|
548
|
+
return {
|
|
549
|
+
...n,
|
|
550
|
+
y: n.y + 25
|
|
551
|
+
};
|
|
552
|
+
case w.Up:
|
|
553
|
+
return {
|
|
554
|
+
...n,
|
|
555
|
+
y: n.y - 25
|
|
556
|
+
};
|
|
557
|
+
}
|
|
558
|
+
};
|
|
559
|
+
class Jt {
|
|
560
|
+
constructor(t) {
|
|
561
|
+
this.props = void 0, this.autoScrollEnabled = !1, this.referenceCoordinates = void 0, this.listeners = void 0, this.windowListeners = void 0, this.props = t;
|
|
562
|
+
const {
|
|
563
|
+
event: {
|
|
564
|
+
target: n
|
|
565
|
+
}
|
|
566
|
+
} = t;
|
|
567
|
+
this.props = t, this.listeners = new Ce(we(n)), this.windowListeners = new Ce(Z(n)), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleCancel = this.handleCancel.bind(this), this.attach();
|
|
568
|
+
}
|
|
569
|
+
attach() {
|
|
570
|
+
this.handleStart(), this.windowListeners.add(W.Resize, this.handleCancel), this.windowListeners.add(W.VisibilityChange, this.handleCancel), setTimeout(() => this.listeners.add(W.Keydown, this.handleKeyDown));
|
|
571
|
+
}
|
|
572
|
+
handleStart() {
|
|
573
|
+
const {
|
|
574
|
+
activeNode: t,
|
|
575
|
+
onStart: n
|
|
576
|
+
} = this.props, r = t.node.current;
|
|
577
|
+
r && Xn(r), n(K);
|
|
578
|
+
}
|
|
579
|
+
handleKeyDown(t) {
|
|
580
|
+
if (zt(t)) {
|
|
581
|
+
const {
|
|
582
|
+
active: n,
|
|
583
|
+
context: r,
|
|
584
|
+
options: o
|
|
585
|
+
} = this.props, {
|
|
586
|
+
keyboardCodes: i = qt,
|
|
587
|
+
coordinateGetter: s = jn,
|
|
588
|
+
scrollBehavior: l = "smooth"
|
|
589
|
+
} = o, {
|
|
590
|
+
code: a
|
|
591
|
+
} = t;
|
|
592
|
+
if (i.end.includes(a)) {
|
|
593
|
+
this.handleEnd(t);
|
|
594
|
+
return;
|
|
595
|
+
}
|
|
596
|
+
if (i.cancel.includes(a)) {
|
|
597
|
+
this.handleCancel(t);
|
|
598
|
+
return;
|
|
599
|
+
}
|
|
600
|
+
const {
|
|
601
|
+
collisionRect: c
|
|
602
|
+
} = r.current, d = c ? {
|
|
603
|
+
x: c.left,
|
|
604
|
+
y: c.top
|
|
605
|
+
} : K;
|
|
606
|
+
this.referenceCoordinates || (this.referenceCoordinates = d);
|
|
607
|
+
const u = s(t, {
|
|
608
|
+
active: n,
|
|
609
|
+
context: r.current,
|
|
610
|
+
currentCoordinates: d
|
|
611
|
+
});
|
|
612
|
+
if (u) {
|
|
613
|
+
const g = ze(u, d), h = {
|
|
614
|
+
x: 0,
|
|
615
|
+
y: 0
|
|
616
|
+
}, {
|
|
617
|
+
scrollableAncestors: D
|
|
618
|
+
} = r.current;
|
|
619
|
+
for (const f of D) {
|
|
620
|
+
const v = t.code, {
|
|
621
|
+
isTop: y,
|
|
622
|
+
isRight: m,
|
|
623
|
+
isLeft: x,
|
|
624
|
+
isBottom: k,
|
|
625
|
+
maxScroll: E,
|
|
626
|
+
minScroll: C
|
|
627
|
+
} = jt(f), p = $n(f), b = {
|
|
628
|
+
x: Math.min(v === w.Right ? p.right - p.width / 2 : p.right, Math.max(v === w.Right ? p.left : p.left + p.width / 2, u.x)),
|
|
629
|
+
y: Math.min(v === w.Down ? p.bottom - p.height / 2 : p.bottom, Math.max(v === w.Down ? p.top : p.top + p.height / 2, u.y))
|
|
630
|
+
}, T = v === w.Right && !m || v === w.Left && !x, I = v === w.Down && !k || v === w.Up && !y;
|
|
631
|
+
if (T && b.x !== u.x) {
|
|
632
|
+
const S = f.scrollLeft + g.x, q = v === w.Right && S <= E.x || v === w.Left && S >= C.x;
|
|
633
|
+
if (q && !g.y) {
|
|
634
|
+
f.scrollTo({
|
|
635
|
+
left: S,
|
|
636
|
+
behavior: l
|
|
637
|
+
});
|
|
638
|
+
return;
|
|
639
|
+
}
|
|
640
|
+
q ? h.x = f.scrollLeft - S : h.x = v === w.Right ? f.scrollLeft - E.x : f.scrollLeft - C.x, h.x && f.scrollBy({
|
|
641
|
+
left: -h.x,
|
|
642
|
+
behavior: l
|
|
643
|
+
});
|
|
644
|
+
break;
|
|
645
|
+
} else if (I && b.y !== u.y) {
|
|
646
|
+
const S = f.scrollTop + g.y, q = v === w.Down && S <= E.y || v === w.Up && S >= C.y;
|
|
647
|
+
if (q && !g.x) {
|
|
648
|
+
f.scrollTo({
|
|
649
|
+
top: S,
|
|
650
|
+
behavior: l
|
|
651
|
+
});
|
|
652
|
+
return;
|
|
653
|
+
}
|
|
654
|
+
q ? h.y = f.scrollTop - S : h.y = v === w.Down ? f.scrollTop - E.y : f.scrollTop - C.y, h.y && f.scrollBy({
|
|
655
|
+
top: -h.y,
|
|
656
|
+
behavior: l
|
|
657
|
+
});
|
|
658
|
+
break;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
this.handleMove(t, pe(ze(u, this.referenceCoordinates), h));
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
handleMove(t, n) {
|
|
666
|
+
const {
|
|
667
|
+
onMove: r
|
|
668
|
+
} = this.props;
|
|
669
|
+
t.preventDefault(), r(n);
|
|
670
|
+
}
|
|
671
|
+
handleEnd(t) {
|
|
672
|
+
const {
|
|
673
|
+
onEnd: n
|
|
674
|
+
} = this.props;
|
|
675
|
+
t.preventDefault(), this.detach(), n();
|
|
676
|
+
}
|
|
677
|
+
handleCancel(t) {
|
|
678
|
+
const {
|
|
679
|
+
onCancel: n
|
|
680
|
+
} = this.props;
|
|
681
|
+
t.preventDefault(), this.detach(), n();
|
|
682
|
+
}
|
|
683
|
+
detach() {
|
|
684
|
+
this.listeners.removeAll(), this.windowListeners.removeAll();
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
Jt.activators = [{
|
|
688
|
+
eventName: "onKeyDown",
|
|
689
|
+
handler: (e, t, n) => {
|
|
690
|
+
let {
|
|
691
|
+
keyboardCodes: r = qt,
|
|
692
|
+
onActivation: o
|
|
693
|
+
} = t, {
|
|
694
|
+
active: i
|
|
695
|
+
} = n;
|
|
696
|
+
const {
|
|
697
|
+
code: s
|
|
698
|
+
} = e.nativeEvent;
|
|
699
|
+
if (r.start.includes(s)) {
|
|
700
|
+
const l = i.activatorNode.current;
|
|
701
|
+
return l && e.target !== l ? !1 : (e.preventDefault(), o == null || o({
|
|
702
|
+
event: e.nativeEvent
|
|
703
|
+
}), !0);
|
|
704
|
+
}
|
|
705
|
+
return !1;
|
|
706
|
+
}
|
|
707
|
+
}];
|
|
708
|
+
function Nt(e) {
|
|
709
|
+
return !!(e && "distance" in e);
|
|
710
|
+
}
|
|
711
|
+
function Ot(e) {
|
|
712
|
+
return !!(e && "delay" in e);
|
|
713
|
+
}
|
|
714
|
+
class lt {
|
|
715
|
+
constructor(t, n, r) {
|
|
716
|
+
var o;
|
|
717
|
+
r === void 0 && (r = Kn(t.event.target)), this.props = void 0, this.events = void 0, this.autoScrollEnabled = !0, this.document = void 0, this.activated = !1, this.initialCoordinates = void 0, this.timeoutId = null, this.listeners = void 0, this.documentListeners = void 0, this.windowListeners = void 0, this.props = t, this.events = n;
|
|
718
|
+
const {
|
|
719
|
+
event: i
|
|
720
|
+
} = t, {
|
|
721
|
+
target: s
|
|
722
|
+
} = i;
|
|
723
|
+
this.props = t, this.events = n, this.document = we(s), this.documentListeners = new Ce(this.document), this.listeners = new Ce(r), this.windowListeners = new Ce(Z(s)), this.initialCoordinates = (o = Je(i)) != null ? o : K, this.handleStart = this.handleStart.bind(this), this.handleMove = this.handleMove.bind(this), this.handleEnd = this.handleEnd.bind(this), this.handleCancel = this.handleCancel.bind(this), this.handleKeydown = this.handleKeydown.bind(this), this.removeTextSelection = this.removeTextSelection.bind(this), this.attach();
|
|
724
|
+
}
|
|
725
|
+
attach() {
|
|
726
|
+
const {
|
|
727
|
+
events: t,
|
|
728
|
+
props: {
|
|
729
|
+
options: {
|
|
730
|
+
activationConstraint: n,
|
|
731
|
+
bypassActivationConstraint: r
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
} = this;
|
|
735
|
+
if (this.listeners.add(t.move.name, this.handleMove, {
|
|
736
|
+
passive: !1
|
|
737
|
+
}), this.listeners.add(t.end.name, this.handleEnd), t.cancel && this.listeners.add(t.cancel.name, this.handleCancel), this.windowListeners.add(W.Resize, this.handleCancel), this.windowListeners.add(W.DragStart, Mt), this.windowListeners.add(W.VisibilityChange, this.handleCancel), this.windowListeners.add(W.ContextMenu, Mt), this.documentListeners.add(W.Keydown, this.handleKeydown), n) {
|
|
738
|
+
if (r != null && r({
|
|
739
|
+
event: this.props.event,
|
|
740
|
+
activeNode: this.props.activeNode,
|
|
741
|
+
options: this.props.options
|
|
742
|
+
}))
|
|
743
|
+
return this.handleStart();
|
|
744
|
+
if (Ot(n)) {
|
|
745
|
+
this.timeoutId = setTimeout(this.handleStart, n.delay), this.handlePending(n);
|
|
746
|
+
return;
|
|
747
|
+
}
|
|
748
|
+
if (Nt(n)) {
|
|
749
|
+
this.handlePending(n);
|
|
750
|
+
return;
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
this.handleStart();
|
|
754
|
+
}
|
|
755
|
+
detach() {
|
|
756
|
+
this.listeners.removeAll(), this.windowListeners.removeAll(), setTimeout(this.documentListeners.removeAll, 50), this.timeoutId !== null && (clearTimeout(this.timeoutId), this.timeoutId = null);
|
|
757
|
+
}
|
|
758
|
+
handlePending(t, n) {
|
|
759
|
+
const {
|
|
760
|
+
active: r,
|
|
761
|
+
onPending: o
|
|
762
|
+
} = this.props;
|
|
763
|
+
o(r, t, this.initialCoordinates, n);
|
|
764
|
+
}
|
|
765
|
+
handleStart() {
|
|
766
|
+
const {
|
|
767
|
+
initialCoordinates: t
|
|
768
|
+
} = this, {
|
|
769
|
+
onStart: n
|
|
770
|
+
} = this.props;
|
|
771
|
+
t && (this.activated = !0, this.documentListeners.add(W.Click, Yn, {
|
|
772
|
+
capture: !0
|
|
773
|
+
}), this.removeTextSelection(), this.documentListeners.add(W.SelectionChange, this.removeTextSelection), n(t));
|
|
774
|
+
}
|
|
775
|
+
handleMove(t) {
|
|
776
|
+
var n;
|
|
777
|
+
const {
|
|
778
|
+
activated: r,
|
|
779
|
+
initialCoordinates: o,
|
|
780
|
+
props: i
|
|
781
|
+
} = this, {
|
|
782
|
+
onMove: s,
|
|
783
|
+
options: {
|
|
784
|
+
activationConstraint: l
|
|
785
|
+
}
|
|
786
|
+
} = i;
|
|
787
|
+
if (!o)
|
|
788
|
+
return;
|
|
789
|
+
const a = (n = Je(t)) != null ? n : K, c = ze(o, a);
|
|
790
|
+
if (!r && l) {
|
|
791
|
+
if (Nt(l)) {
|
|
792
|
+
if (l.tolerance != null && He(c, l.tolerance))
|
|
793
|
+
return this.handleCancel();
|
|
794
|
+
if (He(c, l.distance))
|
|
795
|
+
return this.handleStart();
|
|
796
|
+
}
|
|
797
|
+
if (Ot(l) && He(c, l.tolerance))
|
|
798
|
+
return this.handleCancel();
|
|
799
|
+
this.handlePending(l, c);
|
|
800
|
+
return;
|
|
801
|
+
}
|
|
802
|
+
t.cancelable && t.preventDefault(), s(a);
|
|
803
|
+
}
|
|
804
|
+
handleEnd() {
|
|
805
|
+
const {
|
|
806
|
+
onAbort: t,
|
|
807
|
+
onEnd: n
|
|
808
|
+
} = this.props;
|
|
809
|
+
this.detach(), this.activated || t(this.props.active), n();
|
|
810
|
+
}
|
|
811
|
+
handleCancel() {
|
|
812
|
+
const {
|
|
813
|
+
onAbort: t,
|
|
814
|
+
onCancel: n
|
|
815
|
+
} = this.props;
|
|
816
|
+
this.detach(), this.activated || t(this.props.active), n();
|
|
817
|
+
}
|
|
818
|
+
handleKeydown(t) {
|
|
819
|
+
t.code === w.Esc && this.handleCancel();
|
|
820
|
+
}
|
|
821
|
+
removeTextSelection() {
|
|
822
|
+
var t;
|
|
823
|
+
(t = this.document.getSelection()) == null || t.removeAllRanges();
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
const Hn = {
|
|
827
|
+
cancel: {
|
|
828
|
+
name: "pointercancel"
|
|
829
|
+
},
|
|
830
|
+
move: {
|
|
831
|
+
name: "pointermove"
|
|
832
|
+
},
|
|
833
|
+
end: {
|
|
834
|
+
name: "pointerup"
|
|
835
|
+
}
|
|
836
|
+
};
|
|
837
|
+
class Vt extends lt {
|
|
838
|
+
constructor(t) {
|
|
839
|
+
const {
|
|
840
|
+
event: n
|
|
841
|
+
} = t, r = we(n.target);
|
|
842
|
+
super(t, Hn, r);
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
Vt.activators = [{
|
|
846
|
+
eventName: "onPointerDown",
|
|
847
|
+
handler: (e, t) => {
|
|
848
|
+
let {
|
|
849
|
+
nativeEvent: n
|
|
850
|
+
} = e, {
|
|
851
|
+
onActivation: r
|
|
852
|
+
} = t;
|
|
853
|
+
return !n.isPrimary || n.button !== 0 ? !1 : (r == null || r({
|
|
854
|
+
event: n
|
|
855
|
+
}), !0);
|
|
856
|
+
}
|
|
857
|
+
}];
|
|
858
|
+
const qn = {
|
|
859
|
+
move: {
|
|
860
|
+
name: "mousemove"
|
|
861
|
+
},
|
|
862
|
+
end: {
|
|
863
|
+
name: "mouseup"
|
|
864
|
+
}
|
|
865
|
+
};
|
|
866
|
+
var Ze;
|
|
867
|
+
(function(e) {
|
|
868
|
+
e[e.RightClick = 2] = "RightClick";
|
|
869
|
+
})(Ze || (Ze = {}));
|
|
870
|
+
class Jn extends lt {
|
|
871
|
+
constructor(t) {
|
|
872
|
+
super(t, qn, we(t.event.target));
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
Jn.activators = [{
|
|
876
|
+
eventName: "onMouseDown",
|
|
877
|
+
handler: (e, t) => {
|
|
878
|
+
let {
|
|
879
|
+
nativeEvent: n
|
|
880
|
+
} = e, {
|
|
881
|
+
onActivation: r
|
|
882
|
+
} = t;
|
|
883
|
+
return n.button === Ze.RightClick ? !1 : (r == null || r({
|
|
884
|
+
event: n
|
|
885
|
+
}), !0);
|
|
886
|
+
}
|
|
887
|
+
}];
|
|
888
|
+
const qe = {
|
|
889
|
+
cancel: {
|
|
890
|
+
name: "touchcancel"
|
|
891
|
+
},
|
|
892
|
+
move: {
|
|
893
|
+
name: "touchmove"
|
|
894
|
+
},
|
|
895
|
+
end: {
|
|
896
|
+
name: "touchend"
|
|
897
|
+
}
|
|
898
|
+
};
|
|
899
|
+
class Vn extends lt {
|
|
900
|
+
constructor(t) {
|
|
901
|
+
super(t, qe);
|
|
902
|
+
}
|
|
903
|
+
static setup() {
|
|
904
|
+
return window.addEventListener(qe.move.name, t, {
|
|
905
|
+
capture: !1,
|
|
906
|
+
passive: !1
|
|
907
|
+
}), function() {
|
|
908
|
+
window.removeEventListener(qe.move.name, t);
|
|
909
|
+
};
|
|
910
|
+
function t() {
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
Vn.activators = [{
|
|
915
|
+
eventName: "onTouchStart",
|
|
916
|
+
handler: (e, t) => {
|
|
917
|
+
let {
|
|
918
|
+
nativeEvent: n
|
|
919
|
+
} = e, {
|
|
920
|
+
onActivation: r
|
|
921
|
+
} = t;
|
|
922
|
+
const {
|
|
923
|
+
touches: o
|
|
924
|
+
} = n;
|
|
925
|
+
return o.length > 1 ? !1 : (r == null || r({
|
|
926
|
+
event: n
|
|
927
|
+
}), !0);
|
|
928
|
+
}
|
|
929
|
+
}];
|
|
930
|
+
var Se;
|
|
931
|
+
(function(e) {
|
|
932
|
+
e[e.Pointer = 0] = "Pointer", e[e.DraggableRect = 1] = "DraggableRect";
|
|
933
|
+
})(Se || (Se = {}));
|
|
934
|
+
var $e;
|
|
935
|
+
(function(e) {
|
|
936
|
+
e[e.TreeOrder = 0] = "TreeOrder", e[e.ReversedTreeOrder = 1] = "ReversedTreeOrder";
|
|
937
|
+
})($e || ($e = {}));
|
|
938
|
+
function Gn(e) {
|
|
939
|
+
let {
|
|
940
|
+
acceleration: t,
|
|
941
|
+
activator: n = Se.Pointer,
|
|
942
|
+
canScroll: r,
|
|
943
|
+
draggingRect: o,
|
|
944
|
+
enabled: i,
|
|
945
|
+
interval: s = 5,
|
|
946
|
+
order: l = $e.TreeOrder,
|
|
947
|
+
pointerCoordinates: a,
|
|
948
|
+
scrollableAncestors: c,
|
|
949
|
+
scrollableAncestorRects: d,
|
|
950
|
+
delta: u,
|
|
951
|
+
threshold: g
|
|
952
|
+
} = e;
|
|
953
|
+
const h = Zn({
|
|
954
|
+
delta: u,
|
|
955
|
+
disabled: !i
|
|
956
|
+
}), [D, f] = fn(), v = F({
|
|
957
|
+
x: 0,
|
|
958
|
+
y: 0
|
|
959
|
+
}), y = F({
|
|
960
|
+
x: 0,
|
|
961
|
+
y: 0
|
|
962
|
+
}), m = M(() => {
|
|
963
|
+
switch (n) {
|
|
964
|
+
case Se.Pointer:
|
|
965
|
+
return a ? {
|
|
966
|
+
top: a.y,
|
|
967
|
+
bottom: a.y,
|
|
968
|
+
left: a.x,
|
|
969
|
+
right: a.x
|
|
970
|
+
} : null;
|
|
971
|
+
case Se.DraggableRect:
|
|
972
|
+
return o;
|
|
973
|
+
}
|
|
974
|
+
}, [n, o, a]), x = F(null), k = Q(() => {
|
|
975
|
+
const C = x.current;
|
|
976
|
+
if (!C)
|
|
977
|
+
return;
|
|
978
|
+
const p = v.current.x * y.current.x, b = v.current.y * y.current.y;
|
|
979
|
+
C.scrollBy(p, b);
|
|
980
|
+
}, []), E = M(() => l === $e.TreeOrder ? [...c].reverse() : c, [l, c]);
|
|
981
|
+
N(
|
|
982
|
+
() => {
|
|
983
|
+
if (!i || !c.length || !m) {
|
|
984
|
+
f();
|
|
985
|
+
return;
|
|
986
|
+
}
|
|
987
|
+
for (const C of E) {
|
|
988
|
+
if ((r == null ? void 0 : r(C)) === !1)
|
|
989
|
+
continue;
|
|
990
|
+
const p = c.indexOf(C), b = d[p];
|
|
991
|
+
if (!b)
|
|
992
|
+
continue;
|
|
993
|
+
const {
|
|
994
|
+
direction: T,
|
|
995
|
+
speed: I
|
|
996
|
+
} = Fn(C, b, m, t, g);
|
|
997
|
+
for (const S of ["x", "y"])
|
|
998
|
+
h[S][T[S]] || (I[S] = 0, T[S] = 0);
|
|
999
|
+
if (I.x > 0 || I.y > 0) {
|
|
1000
|
+
f(), x.current = C, D(k, s), v.current = I, y.current = T;
|
|
1001
|
+
return;
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
v.current = {
|
|
1005
|
+
x: 0,
|
|
1006
|
+
y: 0
|
|
1007
|
+
}, y.current = {
|
|
1008
|
+
x: 0,
|
|
1009
|
+
y: 0
|
|
1010
|
+
}, f();
|
|
1011
|
+
},
|
|
1012
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1013
|
+
[
|
|
1014
|
+
t,
|
|
1015
|
+
k,
|
|
1016
|
+
r,
|
|
1017
|
+
f,
|
|
1018
|
+
i,
|
|
1019
|
+
s,
|
|
1020
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1021
|
+
JSON.stringify(m),
|
|
1022
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1023
|
+
JSON.stringify(h),
|
|
1024
|
+
D,
|
|
1025
|
+
c,
|
|
1026
|
+
E,
|
|
1027
|
+
d,
|
|
1028
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1029
|
+
JSON.stringify(g)
|
|
1030
|
+
]
|
|
1031
|
+
);
|
|
1032
|
+
}
|
|
1033
|
+
const Qn = {
|
|
1034
|
+
x: {
|
|
1035
|
+
[R.Backward]: !1,
|
|
1036
|
+
[R.Forward]: !1
|
|
1037
|
+
},
|
|
1038
|
+
y: {
|
|
1039
|
+
[R.Backward]: !1,
|
|
1040
|
+
[R.Forward]: !1
|
|
1041
|
+
}
|
|
1042
|
+
};
|
|
1043
|
+
function Zn(e) {
|
|
1044
|
+
let {
|
|
1045
|
+
delta: t,
|
|
1046
|
+
disabled: n
|
|
1047
|
+
} = e;
|
|
1048
|
+
const r = Ge(t);
|
|
1049
|
+
return Me((o) => {
|
|
1050
|
+
if (n || !r || !o)
|
|
1051
|
+
return Qn;
|
|
1052
|
+
const i = {
|
|
1053
|
+
x: Math.sign(t.x - r.x),
|
|
1054
|
+
y: Math.sign(t.y - r.y)
|
|
1055
|
+
};
|
|
1056
|
+
return {
|
|
1057
|
+
x: {
|
|
1058
|
+
[R.Backward]: o.x[R.Backward] || i.x === -1,
|
|
1059
|
+
[R.Forward]: o.x[R.Forward] || i.x === 1
|
|
1060
|
+
},
|
|
1061
|
+
y: {
|
|
1062
|
+
[R.Backward]: o.y[R.Backward] || i.y === -1,
|
|
1063
|
+
[R.Forward]: o.y[R.Forward] || i.y === 1
|
|
1064
|
+
}
|
|
1065
|
+
};
|
|
1066
|
+
}, [n, t, r]);
|
|
1067
|
+
}
|
|
1068
|
+
function er(e, t) {
|
|
1069
|
+
const n = t != null ? e.get(t) : void 0, r = n ? n.node.current : null;
|
|
1070
|
+
return Me((o) => {
|
|
1071
|
+
var i;
|
|
1072
|
+
return t == null ? null : (i = r ?? o) != null ? i : null;
|
|
1073
|
+
}, [r, t]);
|
|
1074
|
+
}
|
|
1075
|
+
function tr(e, t) {
|
|
1076
|
+
return M(() => e.reduce((n, r) => {
|
|
1077
|
+
const {
|
|
1078
|
+
sensor: o
|
|
1079
|
+
} = r, i = o.activators.map((s) => ({
|
|
1080
|
+
eventName: s.eventName,
|
|
1081
|
+
handler: t(s.handler, r)
|
|
1082
|
+
}));
|
|
1083
|
+
return [...n, ...i];
|
|
1084
|
+
}, []), [e, t]);
|
|
1085
|
+
}
|
|
1086
|
+
var Ee;
|
|
1087
|
+
(function(e) {
|
|
1088
|
+
e[e.Always = 0] = "Always", e[e.BeforeDragging = 1] = "BeforeDragging", e[e.WhileDragging = 2] = "WhileDragging";
|
|
1089
|
+
})(Ee || (Ee = {}));
|
|
1090
|
+
var et;
|
|
1091
|
+
(function(e) {
|
|
1092
|
+
e.Optimized = "optimized";
|
|
1093
|
+
})(et || (et = {}));
|
|
1094
|
+
const Lt = /* @__PURE__ */ new Map();
|
|
1095
|
+
function nr(e, t) {
|
|
1096
|
+
let {
|
|
1097
|
+
dragging: n,
|
|
1098
|
+
dependencies: r,
|
|
1099
|
+
config: o
|
|
1100
|
+
} = t;
|
|
1101
|
+
const [i, s] = _(null), {
|
|
1102
|
+
frequency: l,
|
|
1103
|
+
measure: a,
|
|
1104
|
+
strategy: c
|
|
1105
|
+
} = o, d = F(e), u = v(), g = tt(u), h = Q(function(y) {
|
|
1106
|
+
y === void 0 && (y = []), !g.current && s((m) => m === null ? y : m.concat(y.filter((x) => !m.includes(x))));
|
|
1107
|
+
}, [g]), D = F(null), f = Me((y) => {
|
|
1108
|
+
if (u && !n)
|
|
1109
|
+
return Lt;
|
|
1110
|
+
if (!y || y === Lt || d.current !== e || i != null) {
|
|
1111
|
+
const m = /* @__PURE__ */ new Map();
|
|
1112
|
+
for (let x of e) {
|
|
1113
|
+
if (!x)
|
|
1114
|
+
continue;
|
|
1115
|
+
if (i && i.length > 0 && !i.includes(x.id) && x.rect.current) {
|
|
1116
|
+
m.set(x.id, x.rect.current);
|
|
1117
|
+
continue;
|
|
1118
|
+
}
|
|
1119
|
+
const k = x.node.current, E = k ? new st(a(k), k) : null;
|
|
1120
|
+
x.rect.current = E, E && m.set(x.id, E);
|
|
1121
|
+
}
|
|
1122
|
+
return m;
|
|
1123
|
+
}
|
|
1124
|
+
return y;
|
|
1125
|
+
}, [e, i, n, u, a]);
|
|
1126
|
+
return N(() => {
|
|
1127
|
+
d.current = e;
|
|
1128
|
+
}, [e]), N(
|
|
1129
|
+
() => {
|
|
1130
|
+
u || h();
|
|
1131
|
+
},
|
|
1132
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1133
|
+
[n, u]
|
|
1134
|
+
), N(
|
|
1135
|
+
() => {
|
|
1136
|
+
i && i.length > 0 && s(null);
|
|
1137
|
+
},
|
|
1138
|
+
//eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1139
|
+
[JSON.stringify(i)]
|
|
1140
|
+
), N(
|
|
1141
|
+
() => {
|
|
1142
|
+
u || typeof l != "number" || D.current !== null || (D.current = setTimeout(() => {
|
|
1143
|
+
h(), D.current = null;
|
|
1144
|
+
}, l));
|
|
1145
|
+
},
|
|
1146
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1147
|
+
[l, u, h, ...r]
|
|
1148
|
+
), {
|
|
1149
|
+
droppableRects: f,
|
|
1150
|
+
measureDroppableContainers: h,
|
|
1151
|
+
measuringScheduled: i != null
|
|
1152
|
+
};
|
|
1153
|
+
function v() {
|
|
1154
|
+
switch (c) {
|
|
1155
|
+
case Ee.Always:
|
|
1156
|
+
return !1;
|
|
1157
|
+
case Ee.BeforeDragging:
|
|
1158
|
+
return n;
|
|
1159
|
+
default:
|
|
1160
|
+
return !n;
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
function Gt(e, t) {
|
|
1165
|
+
return Me((n) => e ? n || (typeof t == "function" ? t(e) : e) : null, [t, e]);
|
|
1166
|
+
}
|
|
1167
|
+
function rr(e, t) {
|
|
1168
|
+
return Gt(e, t);
|
|
1169
|
+
}
|
|
1170
|
+
function or(e) {
|
|
1171
|
+
let {
|
|
1172
|
+
callback: t,
|
|
1173
|
+
disabled: n
|
|
1174
|
+
} = e;
|
|
1175
|
+
const r = Ft(t), o = M(() => {
|
|
1176
|
+
if (n || typeof window > "u" || typeof window.MutationObserver > "u")
|
|
1177
|
+
return;
|
|
1178
|
+
const {
|
|
1179
|
+
MutationObserver: i
|
|
1180
|
+
} = window;
|
|
1181
|
+
return new i(r);
|
|
1182
|
+
}, [r, n]);
|
|
1183
|
+
return N(() => () => o == null ? void 0 : o.disconnect(), [o]), o;
|
|
1184
|
+
}
|
|
1185
|
+
function at(e) {
|
|
1186
|
+
let {
|
|
1187
|
+
callback: t,
|
|
1188
|
+
disabled: n
|
|
1189
|
+
} = e;
|
|
1190
|
+
const r = Ft(t), o = M(
|
|
1191
|
+
() => {
|
|
1192
|
+
if (n || typeof window > "u" || typeof window.ResizeObserver > "u")
|
|
1193
|
+
return;
|
|
1194
|
+
const {
|
|
1195
|
+
ResizeObserver: i
|
|
1196
|
+
} = window;
|
|
1197
|
+
return new i(r);
|
|
1198
|
+
},
|
|
1199
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1200
|
+
[n]
|
|
1201
|
+
);
|
|
1202
|
+
return N(() => () => o == null ? void 0 : o.disconnect(), [o]), o;
|
|
1203
|
+
}
|
|
1204
|
+
function ir(e) {
|
|
1205
|
+
return new st(Ne(e), e);
|
|
1206
|
+
}
|
|
1207
|
+
function Tt(e, t, n) {
|
|
1208
|
+
t === void 0 && (t = ir);
|
|
1209
|
+
const [r, o] = _(null);
|
|
1210
|
+
function i() {
|
|
1211
|
+
o((a) => {
|
|
1212
|
+
if (!e)
|
|
1213
|
+
return null;
|
|
1214
|
+
if (e.isConnected === !1) {
|
|
1215
|
+
var c;
|
|
1216
|
+
return (c = a ?? n) != null ? c : null;
|
|
1217
|
+
}
|
|
1218
|
+
const d = t(e);
|
|
1219
|
+
return JSON.stringify(a) === JSON.stringify(d) ? a : d;
|
|
1220
|
+
});
|
|
1221
|
+
}
|
|
1222
|
+
const s = or({
|
|
1223
|
+
callback(a) {
|
|
1224
|
+
if (e)
|
|
1225
|
+
for (const c of a) {
|
|
1226
|
+
const {
|
|
1227
|
+
type: d,
|
|
1228
|
+
target: u
|
|
1229
|
+
} = c;
|
|
1230
|
+
if (d === "childList" && u instanceof HTMLElement && u.contains(e)) {
|
|
1231
|
+
i();
|
|
1232
|
+
break;
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
}), l = at({
|
|
1237
|
+
callback: i
|
|
1238
|
+
});
|
|
1239
|
+
return be(() => {
|
|
1240
|
+
i(), e ? (l == null || l.observe(e), s == null || s.observe(document.body, {
|
|
1241
|
+
childList: !0,
|
|
1242
|
+
subtree: !0
|
|
1243
|
+
})) : (l == null || l.disconnect(), s == null || s.disconnect());
|
|
1244
|
+
}, [e]), r;
|
|
1245
|
+
}
|
|
1246
|
+
function sr(e) {
|
|
1247
|
+
const t = Gt(e);
|
|
1248
|
+
return Ut(e, t);
|
|
1249
|
+
}
|
|
1250
|
+
const It = [];
|
|
1251
|
+
function lr(e) {
|
|
1252
|
+
const t = F(e), n = Me((r) => e ? r && r !== It && e && t.current && e.parentNode === t.current.parentNode ? r : it(e) : It, [e]);
|
|
1253
|
+
return N(() => {
|
|
1254
|
+
t.current = e;
|
|
1255
|
+
}, [e]), n;
|
|
1256
|
+
}
|
|
1257
|
+
function ar(e) {
|
|
1258
|
+
const [t, n] = _(null), r = F(e), o = Q((i) => {
|
|
1259
|
+
const s = je(i.target);
|
|
1260
|
+
s && n((l) => l ? (l.set(s, Qe(s)), new Map(l)) : null);
|
|
1261
|
+
}, []);
|
|
1262
|
+
return N(() => {
|
|
1263
|
+
const i = r.current;
|
|
1264
|
+
if (e !== i) {
|
|
1265
|
+
s(i);
|
|
1266
|
+
const l = e.map((a) => {
|
|
1267
|
+
const c = je(a);
|
|
1268
|
+
return c ? (c.addEventListener("scroll", o, {
|
|
1269
|
+
passive: !0
|
|
1270
|
+
}), [c, Qe(c)]) : null;
|
|
1271
|
+
}).filter((a) => a != null);
|
|
1272
|
+
n(l.length ? new Map(l) : null), r.current = e;
|
|
1273
|
+
}
|
|
1274
|
+
return () => {
|
|
1275
|
+
s(e), s(i);
|
|
1276
|
+
};
|
|
1277
|
+
function s(l) {
|
|
1278
|
+
l.forEach((a) => {
|
|
1279
|
+
const c = je(a);
|
|
1280
|
+
c == null || c.removeEventListener("scroll", o);
|
|
1281
|
+
});
|
|
1282
|
+
}
|
|
1283
|
+
}, [o, e]), M(() => e.length ? t ? Array.from(t.values()).reduce((i, s) => pe(i, s), K) : Ht(e) : K, [e, t]);
|
|
1284
|
+
}
|
|
1285
|
+
function kt(e, t) {
|
|
1286
|
+
t === void 0 && (t = []);
|
|
1287
|
+
const n = F(null);
|
|
1288
|
+
return N(
|
|
1289
|
+
() => {
|
|
1290
|
+
n.current = null;
|
|
1291
|
+
},
|
|
1292
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1293
|
+
t
|
|
1294
|
+
), N(() => {
|
|
1295
|
+
const r = e !== K;
|
|
1296
|
+
r && !n.current && (n.current = e), !r && n.current && (n.current = null);
|
|
1297
|
+
}, [e]), n.current ? ze(e, n.current) : K;
|
|
1298
|
+
}
|
|
1299
|
+
function cr(e) {
|
|
1300
|
+
N(
|
|
1301
|
+
() => {
|
|
1302
|
+
if (!rt)
|
|
1303
|
+
return;
|
|
1304
|
+
const t = e.map((n) => {
|
|
1305
|
+
let {
|
|
1306
|
+
sensor: r
|
|
1307
|
+
} = n;
|
|
1308
|
+
return r.setup == null ? void 0 : r.setup();
|
|
1309
|
+
});
|
|
1310
|
+
return () => {
|
|
1311
|
+
for (const n of t)
|
|
1312
|
+
n == null || n();
|
|
1313
|
+
};
|
|
1314
|
+
},
|
|
1315
|
+
// TO-DO: Sensors length could theoretically change which would not be a valid dependency
|
|
1316
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1317
|
+
e.map((t) => {
|
|
1318
|
+
let {
|
|
1319
|
+
sensor: n
|
|
1320
|
+
} = t;
|
|
1321
|
+
return n;
|
|
1322
|
+
})
|
|
1323
|
+
);
|
|
1324
|
+
}
|
|
1325
|
+
function ur(e, t) {
|
|
1326
|
+
return M(() => e.reduce((n, r) => {
|
|
1327
|
+
let {
|
|
1328
|
+
eventName: o,
|
|
1329
|
+
handler: i
|
|
1330
|
+
} = r;
|
|
1331
|
+
return n[o] = (s) => {
|
|
1332
|
+
i(s, t);
|
|
1333
|
+
}, n;
|
|
1334
|
+
}, {}), [e, t]);
|
|
1335
|
+
}
|
|
1336
|
+
function Qt(e) {
|
|
1337
|
+
return M(() => e ? kn(e) : null, [e]);
|
|
1338
|
+
}
|
|
1339
|
+
const Bt = [];
|
|
1340
|
+
function dr(e, t) {
|
|
1341
|
+
t === void 0 && (t = Ne);
|
|
1342
|
+
const [n] = e, r = Qt(n ? Z(n) : null), [o, i] = _(Bt);
|
|
1343
|
+
function s() {
|
|
1344
|
+
i(() => e.length ? e.map((a) => Yt(a) ? r : new st(t(a), a)) : Bt);
|
|
1345
|
+
}
|
|
1346
|
+
const l = at({
|
|
1347
|
+
callback: s
|
|
1348
|
+
});
|
|
1349
|
+
return be(() => {
|
|
1350
|
+
l == null || l.disconnect(), s(), e.forEach((a) => l == null ? void 0 : l.observe(a));
|
|
1351
|
+
}, [e]), o;
|
|
1352
|
+
}
|
|
1353
|
+
function fr(e) {
|
|
1354
|
+
if (!e)
|
|
1355
|
+
return null;
|
|
1356
|
+
if (e.children.length > 1)
|
|
1357
|
+
return e;
|
|
1358
|
+
const t = e.children[0];
|
|
1359
|
+
return We(t) ? t : e;
|
|
1360
|
+
}
|
|
1361
|
+
function hr(e) {
|
|
1362
|
+
let {
|
|
1363
|
+
measure: t
|
|
1364
|
+
} = e;
|
|
1365
|
+
const [n, r] = _(null), o = Q((c) => {
|
|
1366
|
+
for (const {
|
|
1367
|
+
target: d
|
|
1368
|
+
} of c)
|
|
1369
|
+
if (We(d)) {
|
|
1370
|
+
r((u) => {
|
|
1371
|
+
const g = t(d);
|
|
1372
|
+
return u ? {
|
|
1373
|
+
...u,
|
|
1374
|
+
width: g.width,
|
|
1375
|
+
height: g.height
|
|
1376
|
+
} : g;
|
|
1377
|
+
});
|
|
1378
|
+
break;
|
|
1379
|
+
}
|
|
1380
|
+
}, [t]), i = at({
|
|
1381
|
+
callback: o
|
|
1382
|
+
}), s = Q((c) => {
|
|
1383
|
+
const d = fr(c);
|
|
1384
|
+
i == null || i.disconnect(), d && (i == null || i.observe(d)), r(d ? t(d) : null);
|
|
1385
|
+
}, [t, i]), [l, a] = Ve(s);
|
|
1386
|
+
return M(() => ({
|
|
1387
|
+
nodeRef: l,
|
|
1388
|
+
rect: n,
|
|
1389
|
+
setRef: a
|
|
1390
|
+
}), [n, l, a]);
|
|
1391
|
+
}
|
|
1392
|
+
const gr = [{
|
|
1393
|
+
sensor: Vt,
|
|
1394
|
+
options: {}
|
|
1395
|
+
}, {
|
|
1396
|
+
sensor: Jt,
|
|
1397
|
+
options: {}
|
|
1398
|
+
}], vr = {
|
|
1399
|
+
current: {}
|
|
1400
|
+
}, Be = {
|
|
1401
|
+
draggable: {
|
|
1402
|
+
measure: At
|
|
1403
|
+
},
|
|
1404
|
+
droppable: {
|
|
1405
|
+
measure: At,
|
|
1406
|
+
strategy: Ee.WhileDragging,
|
|
1407
|
+
frequency: et.Optimized
|
|
1408
|
+
},
|
|
1409
|
+
dragOverlay: {
|
|
1410
|
+
measure: Ne
|
|
1411
|
+
}
|
|
1412
|
+
};
|
|
1413
|
+
class Re extends Map {
|
|
1414
|
+
get(t) {
|
|
1415
|
+
var n;
|
|
1416
|
+
return t != null && (n = super.get(t)) != null ? n : void 0;
|
|
1417
|
+
}
|
|
1418
|
+
toArray() {
|
|
1419
|
+
return Array.from(this.values());
|
|
1420
|
+
}
|
|
1421
|
+
getEnabled() {
|
|
1422
|
+
return this.toArray().filter((t) => {
|
|
1423
|
+
let {
|
|
1424
|
+
disabled: n
|
|
1425
|
+
} = t;
|
|
1426
|
+
return !n;
|
|
1427
|
+
});
|
|
1428
|
+
}
|
|
1429
|
+
getNodeFor(t) {
|
|
1430
|
+
var n, r;
|
|
1431
|
+
return (n = (r = this.get(t)) == null ? void 0 : r.node.current) != null ? n : void 0;
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
const pr = {
|
|
1435
|
+
activatorEvent: null,
|
|
1436
|
+
active: null,
|
|
1437
|
+
activeNode: null,
|
|
1438
|
+
activeNodeRect: null,
|
|
1439
|
+
collisions: null,
|
|
1440
|
+
containerNodeRect: null,
|
|
1441
|
+
draggableNodes: /* @__PURE__ */ new Map(),
|
|
1442
|
+
droppableRects: /* @__PURE__ */ new Map(),
|
|
1443
|
+
droppableContainers: /* @__PURE__ */ new Re(),
|
|
1444
|
+
over: null,
|
|
1445
|
+
dragOverlay: {
|
|
1446
|
+
nodeRef: {
|
|
1447
|
+
current: null
|
|
1448
|
+
},
|
|
1449
|
+
rect: null,
|
|
1450
|
+
setRef: Fe
|
|
1451
|
+
},
|
|
1452
|
+
scrollableAncestors: [],
|
|
1453
|
+
scrollableAncestorRects: [],
|
|
1454
|
+
measuringConfiguration: Be,
|
|
1455
|
+
measureDroppableContainers: Fe,
|
|
1456
|
+
windowRect: null,
|
|
1457
|
+
measuringScheduled: !1
|
|
1458
|
+
}, br = {
|
|
1459
|
+
activatorEvent: null,
|
|
1460
|
+
activators: [],
|
|
1461
|
+
active: null,
|
|
1462
|
+
activeNodeRect: null,
|
|
1463
|
+
ariaDescribedById: {
|
|
1464
|
+
draggable: ""
|
|
1465
|
+
},
|
|
1466
|
+
dispatch: Fe,
|
|
1467
|
+
draggableNodes: /* @__PURE__ */ new Map(),
|
|
1468
|
+
over: null,
|
|
1469
|
+
measureDroppableContainers: Fe
|
|
1470
|
+
}, ct = /* @__PURE__ */ Ae(br), wr = /* @__PURE__ */ Ae(pr);
|
|
1471
|
+
function yr() {
|
|
1472
|
+
return {
|
|
1473
|
+
draggable: {
|
|
1474
|
+
active: null,
|
|
1475
|
+
initialCoordinates: {
|
|
1476
|
+
x: 0,
|
|
1477
|
+
y: 0
|
|
1478
|
+
},
|
|
1479
|
+
nodes: /* @__PURE__ */ new Map(),
|
|
1480
|
+
translate: {
|
|
1481
|
+
x: 0,
|
|
1482
|
+
y: 0
|
|
1483
|
+
}
|
|
1484
|
+
},
|
|
1485
|
+
droppable: {
|
|
1486
|
+
containers: new Re()
|
|
1487
|
+
}
|
|
1488
|
+
};
|
|
1489
|
+
}
|
|
1490
|
+
function mr(e, t) {
|
|
1491
|
+
switch (t.type) {
|
|
1492
|
+
case L.DragStart:
|
|
1493
|
+
return {
|
|
1494
|
+
...e,
|
|
1495
|
+
draggable: {
|
|
1496
|
+
...e.draggable,
|
|
1497
|
+
initialCoordinates: t.initialCoordinates,
|
|
1498
|
+
active: t.active
|
|
1499
|
+
}
|
|
1500
|
+
};
|
|
1501
|
+
case L.DragMove:
|
|
1502
|
+
return e.draggable.active == null ? e : {
|
|
1503
|
+
...e,
|
|
1504
|
+
draggable: {
|
|
1505
|
+
...e.draggable,
|
|
1506
|
+
translate: {
|
|
1507
|
+
x: t.coordinates.x - e.draggable.initialCoordinates.x,
|
|
1508
|
+
y: t.coordinates.y - e.draggable.initialCoordinates.y
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
};
|
|
1512
|
+
case L.DragEnd:
|
|
1513
|
+
case L.DragCancel:
|
|
1514
|
+
return {
|
|
1515
|
+
...e,
|
|
1516
|
+
draggable: {
|
|
1517
|
+
...e.draggable,
|
|
1518
|
+
active: null,
|
|
1519
|
+
initialCoordinates: {
|
|
1520
|
+
x: 0,
|
|
1521
|
+
y: 0
|
|
1522
|
+
},
|
|
1523
|
+
translate: {
|
|
1524
|
+
x: 0,
|
|
1525
|
+
y: 0
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
};
|
|
1529
|
+
case L.RegisterDroppable: {
|
|
1530
|
+
const {
|
|
1531
|
+
element: n
|
|
1532
|
+
} = t, {
|
|
1533
|
+
id: r
|
|
1534
|
+
} = n, o = new Re(e.droppable.containers);
|
|
1535
|
+
return o.set(r, n), {
|
|
1536
|
+
...e,
|
|
1537
|
+
droppable: {
|
|
1538
|
+
...e.droppable,
|
|
1539
|
+
containers: o
|
|
1540
|
+
}
|
|
1541
|
+
};
|
|
1542
|
+
}
|
|
1543
|
+
case L.SetDroppableDisabled: {
|
|
1544
|
+
const {
|
|
1545
|
+
id: n,
|
|
1546
|
+
key: r,
|
|
1547
|
+
disabled: o
|
|
1548
|
+
} = t, i = e.droppable.containers.get(n);
|
|
1549
|
+
if (!i || r !== i.key)
|
|
1550
|
+
return e;
|
|
1551
|
+
const s = new Re(e.droppable.containers);
|
|
1552
|
+
return s.set(n, {
|
|
1553
|
+
...i,
|
|
1554
|
+
disabled: o
|
|
1555
|
+
}), {
|
|
1556
|
+
...e,
|
|
1557
|
+
droppable: {
|
|
1558
|
+
...e.droppable,
|
|
1559
|
+
containers: s
|
|
1560
|
+
}
|
|
1561
|
+
};
|
|
1562
|
+
}
|
|
1563
|
+
case L.UnregisterDroppable: {
|
|
1564
|
+
const {
|
|
1565
|
+
id: n,
|
|
1566
|
+
key: r
|
|
1567
|
+
} = t, o = e.droppable.containers.get(n);
|
|
1568
|
+
if (!o || r !== o.key)
|
|
1569
|
+
return e;
|
|
1570
|
+
const i = new Re(e.droppable.containers);
|
|
1571
|
+
return i.delete(n), {
|
|
1572
|
+
...e,
|
|
1573
|
+
droppable: {
|
|
1574
|
+
...e.droppable,
|
|
1575
|
+
containers: i
|
|
1576
|
+
}
|
|
1577
|
+
};
|
|
1578
|
+
}
|
|
1579
|
+
default:
|
|
1580
|
+
return e;
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
function Dr(e) {
|
|
1584
|
+
let {
|
|
1585
|
+
disabled: t
|
|
1586
|
+
} = e;
|
|
1587
|
+
const {
|
|
1588
|
+
active: n,
|
|
1589
|
+
activatorEvent: r,
|
|
1590
|
+
draggableNodes: o
|
|
1591
|
+
} = Pe(ct), i = Ge(r), s = Ge(n == null ? void 0 : n.id);
|
|
1592
|
+
return N(() => {
|
|
1593
|
+
if (!t && !r && i && s != null) {
|
|
1594
|
+
if (!zt(i) || document.activeElement === i.target)
|
|
1595
|
+
return;
|
|
1596
|
+
const l = o.get(s);
|
|
1597
|
+
if (!l)
|
|
1598
|
+
return;
|
|
1599
|
+
const {
|
|
1600
|
+
activatorNode: a,
|
|
1601
|
+
node: c
|
|
1602
|
+
} = l;
|
|
1603
|
+
if (!a.current && !c.current)
|
|
1604
|
+
return;
|
|
1605
|
+
requestAnimationFrame(() => {
|
|
1606
|
+
for (const d of [a.current, c.current]) {
|
|
1607
|
+
if (!d)
|
|
1608
|
+
continue;
|
|
1609
|
+
const u = hn(d);
|
|
1610
|
+
if (u) {
|
|
1611
|
+
u.focus();
|
|
1612
|
+
break;
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
});
|
|
1616
|
+
}
|
|
1617
|
+
}, [r, t, o, s, i]), null;
|
|
1618
|
+
}
|
|
1619
|
+
function xr(e, t) {
|
|
1620
|
+
let {
|
|
1621
|
+
transform: n,
|
|
1622
|
+
...r
|
|
1623
|
+
} = t;
|
|
1624
|
+
return e != null && e.length ? e.reduce((o, i) => i({
|
|
1625
|
+
transform: o,
|
|
1626
|
+
...r
|
|
1627
|
+
}), n) : n;
|
|
1628
|
+
}
|
|
1629
|
+
function Cr(e) {
|
|
1630
|
+
return M(
|
|
1631
|
+
() => ({
|
|
1632
|
+
draggable: {
|
|
1633
|
+
...Be.draggable,
|
|
1634
|
+
...e == null ? void 0 : e.draggable
|
|
1635
|
+
},
|
|
1636
|
+
droppable: {
|
|
1637
|
+
...Be.droppable,
|
|
1638
|
+
...e == null ? void 0 : e.droppable
|
|
1639
|
+
},
|
|
1640
|
+
dragOverlay: {
|
|
1641
|
+
...Be.dragOverlay,
|
|
1642
|
+
...e == null ? void 0 : e.dragOverlay
|
|
1643
|
+
}
|
|
1644
|
+
}),
|
|
1645
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1646
|
+
[e == null ? void 0 : e.draggable, e == null ? void 0 : e.droppable, e == null ? void 0 : e.dragOverlay]
|
|
1647
|
+
);
|
|
1648
|
+
}
|
|
1649
|
+
function Sr(e) {
|
|
1650
|
+
let {
|
|
1651
|
+
activeNode: t,
|
|
1652
|
+
measure: n,
|
|
1653
|
+
initialRect: r,
|
|
1654
|
+
config: o = !0
|
|
1655
|
+
} = e;
|
|
1656
|
+
const i = F(!1), {
|
|
1657
|
+
x: s,
|
|
1658
|
+
y: l
|
|
1659
|
+
} = typeof o == "boolean" ? {
|
|
1660
|
+
x: o,
|
|
1661
|
+
y: o
|
|
1662
|
+
} : o;
|
|
1663
|
+
be(() => {
|
|
1664
|
+
if (!s && !l || !t) {
|
|
1665
|
+
i.current = !1;
|
|
1666
|
+
return;
|
|
1667
|
+
}
|
|
1668
|
+
if (i.current || !r)
|
|
1669
|
+
return;
|
|
1670
|
+
const c = t == null ? void 0 : t.node.current;
|
|
1671
|
+
if (!c || c.isConnected === !1)
|
|
1672
|
+
return;
|
|
1673
|
+
const d = n(c), u = Ut(d, r);
|
|
1674
|
+
if (s || (u.x = 0), l || (u.y = 0), i.current = !0, Math.abs(u.x) > 0 || Math.abs(u.y) > 0) {
|
|
1675
|
+
const g = Xt(c);
|
|
1676
|
+
g && g.scrollBy({
|
|
1677
|
+
top: u.y,
|
|
1678
|
+
left: u.x
|
|
1679
|
+
});
|
|
1680
|
+
}
|
|
1681
|
+
}, [t, s, l, r, n]);
|
|
1682
|
+
}
|
|
1683
|
+
const Zt = /* @__PURE__ */ Ae({
|
|
1684
|
+
...K,
|
|
1685
|
+
scaleX: 1,
|
|
1686
|
+
scaleY: 1
|
|
1687
|
+
});
|
|
1688
|
+
var se;
|
|
1689
|
+
(function(e) {
|
|
1690
|
+
e[e.Uninitialized = 0] = "Uninitialized", e[e.Initializing = 1] = "Initializing", e[e.Initialized = 2] = "Initialized";
|
|
1691
|
+
})(se || (se = {}));
|
|
1692
|
+
const Lr = /* @__PURE__ */ cn(function(t) {
|
|
1693
|
+
var n, r, o, i;
|
|
1694
|
+
let {
|
|
1695
|
+
id: s,
|
|
1696
|
+
accessibility: l,
|
|
1697
|
+
autoScroll: a = !0,
|
|
1698
|
+
children: c,
|
|
1699
|
+
sensors: d = gr,
|
|
1700
|
+
collisionDetection: u = An,
|
|
1701
|
+
measuring: g,
|
|
1702
|
+
modifiers: h,
|
|
1703
|
+
...D
|
|
1704
|
+
} = t;
|
|
1705
|
+
const f = un(mr, void 0, yr), [v, y] = f, [m, x] = mn(), [k, E] = _(se.Uninitialized), C = k === se.Initialized, {
|
|
1706
|
+
draggable: {
|
|
1707
|
+
active: p,
|
|
1708
|
+
nodes: b,
|
|
1709
|
+
translate: T
|
|
1710
|
+
},
|
|
1711
|
+
droppable: {
|
|
1712
|
+
containers: I
|
|
1713
|
+
}
|
|
1714
|
+
} = v, S = p != null ? b.get(p) : null, q = F({
|
|
1715
|
+
initial: null,
|
|
1716
|
+
translated: null
|
|
1717
|
+
}), J = M(() => {
|
|
1718
|
+
var O;
|
|
1719
|
+
return p != null ? {
|
|
1720
|
+
id: p,
|
|
1721
|
+
// It's possible for the active node to unmount while dragging
|
|
1722
|
+
data: (O = S == null ? void 0 : S.data) != null ? O : vr,
|
|
1723
|
+
rect: q
|
|
1724
|
+
} : null;
|
|
1725
|
+
}, [p, S]), ee = F(null), [ut, dt] = _(null), [V, ft] = _(null), le = tt(D, Object.values(D)), Ue = nt("DndDescribedBy", s), ht = M(() => I.getEnabled(), [I]), ae = Cr(g), {
|
|
1726
|
+
droppableRects: de,
|
|
1727
|
+
measureDroppableContainers: Oe,
|
|
1728
|
+
measuringScheduled: gt
|
|
1729
|
+
} = nr(ht, {
|
|
1730
|
+
dragging: C,
|
|
1731
|
+
dependencies: [T.x, T.y],
|
|
1732
|
+
config: ae.droppable
|
|
1733
|
+
}), U = er(b, p), vt = M(() => V ? Je(V) : null, [V]), pt = an(), bt = rr(U, ae.draggable.measure);
|
|
1734
|
+
Sr({
|
|
1735
|
+
activeNode: p != null ? b.get(p) : null,
|
|
1736
|
+
config: pt.layoutShiftCompensation,
|
|
1737
|
+
initialRect: bt,
|
|
1738
|
+
measure: ae.draggable.measure
|
|
1739
|
+
});
|
|
1740
|
+
const X = Tt(U, ae.draggable.measure, bt), Xe = Tt(U ? U.parentElement : null), ce = F({
|
|
1741
|
+
activatorEvent: null,
|
|
1742
|
+
active: null,
|
|
1743
|
+
activeNode: U,
|
|
1744
|
+
collisionRect: null,
|
|
1745
|
+
collisions: null,
|
|
1746
|
+
droppableRects: de,
|
|
1747
|
+
draggableNodes: b,
|
|
1748
|
+
draggingNode: null,
|
|
1749
|
+
draggingNodeRect: null,
|
|
1750
|
+
droppableContainers: I,
|
|
1751
|
+
over: null,
|
|
1752
|
+
scrollableAncestors: [],
|
|
1753
|
+
scrollAdjustedTranslate: null
|
|
1754
|
+
}), wt = I.getNodeFor((n = ce.current.over) == null ? void 0 : n.id), ue = hr({
|
|
1755
|
+
measure: ae.dragOverlay.measure
|
|
1756
|
+
}), Le = (r = ue.nodeRef.current) != null ? r : U, fe = C ? (o = ue.rect) != null ? o : X : null, yt = !!(ue.nodeRef.current && ue.rect), mt = sr(yt ? null : X), _e = Qt(Le ? Z(Le) : null), te = lr(C ? wt ?? U : null), Te = dr(te), Ie = xr(h, {
|
|
1757
|
+
transform: {
|
|
1758
|
+
x: T.x - mt.x,
|
|
1759
|
+
y: T.y - mt.y,
|
|
1760
|
+
scaleX: 1,
|
|
1761
|
+
scaleY: 1
|
|
1762
|
+
},
|
|
1763
|
+
activatorEvent: V,
|
|
1764
|
+
active: J,
|
|
1765
|
+
activeNodeRect: X,
|
|
1766
|
+
containerNodeRect: Xe,
|
|
1767
|
+
draggingNodeRect: fe,
|
|
1768
|
+
over: ce.current.over,
|
|
1769
|
+
overlayNodeRect: ue.rect,
|
|
1770
|
+
scrollableAncestors: te,
|
|
1771
|
+
scrollableAncestorRects: Te,
|
|
1772
|
+
windowRect: _e
|
|
1773
|
+
}), Dt = vt ? pe(vt, T) : null, xt = ar(te), en = kt(xt), tn = kt(xt, [X]), he = pe(Ie, en), ge = fe ? On(fe, Ie) : null, ye = J && ge ? u({
|
|
1774
|
+
active: J,
|
|
1775
|
+
collisionRect: ge,
|
|
1776
|
+
droppableRects: de,
|
|
1777
|
+
droppableContainers: ht,
|
|
1778
|
+
pointerCoordinates: Dt
|
|
1779
|
+
}) : null, Ct = Rn(ye, "id"), [ne, St] = _(null), nn = yt ? Ie : pe(Ie, tn), rn = Mn(nn, (i = ne == null ? void 0 : ne.rect) != null ? i : null, X), Ke = F(null), Rt = Q(
|
|
1780
|
+
(O, B) => {
|
|
1781
|
+
let {
|
|
1782
|
+
sensor: P,
|
|
1783
|
+
options: re
|
|
1784
|
+
} = B;
|
|
1785
|
+
if (ee.current == null)
|
|
1786
|
+
return;
|
|
1787
|
+
const $ = b.get(ee.current);
|
|
1788
|
+
if (!$)
|
|
1789
|
+
return;
|
|
1790
|
+
const z = O.nativeEvent, Y = new P({
|
|
1791
|
+
active: ee.current,
|
|
1792
|
+
activeNode: $,
|
|
1793
|
+
event: z,
|
|
1794
|
+
options: re,
|
|
1795
|
+
// Sensors need to be instantiated with refs for arguments that change over time
|
|
1796
|
+
// otherwise they are frozen in time with the stale arguments
|
|
1797
|
+
context: ce,
|
|
1798
|
+
onAbort(A) {
|
|
1799
|
+
if (!b.get(A))
|
|
1800
|
+
return;
|
|
1801
|
+
const {
|
|
1802
|
+
onDragAbort: j
|
|
1803
|
+
} = le.current, G = {
|
|
1804
|
+
id: A
|
|
1805
|
+
};
|
|
1806
|
+
j == null || j(G), m({
|
|
1807
|
+
type: "onDragAbort",
|
|
1808
|
+
event: G
|
|
1809
|
+
});
|
|
1810
|
+
},
|
|
1811
|
+
onPending(A, oe, j, G) {
|
|
1812
|
+
if (!b.get(A))
|
|
1813
|
+
return;
|
|
1814
|
+
const {
|
|
1815
|
+
onDragPending: De
|
|
1816
|
+
} = le.current, ie = {
|
|
1817
|
+
id: A,
|
|
1818
|
+
constraint: oe,
|
|
1819
|
+
initialCoordinates: j,
|
|
1820
|
+
offset: G
|
|
1821
|
+
};
|
|
1822
|
+
De == null || De(ie), m({
|
|
1823
|
+
type: "onDragPending",
|
|
1824
|
+
event: ie
|
|
1825
|
+
});
|
|
1826
|
+
},
|
|
1827
|
+
onStart(A) {
|
|
1828
|
+
const oe = ee.current;
|
|
1829
|
+
if (oe == null)
|
|
1830
|
+
return;
|
|
1831
|
+
const j = b.get(oe);
|
|
1832
|
+
if (!j)
|
|
1833
|
+
return;
|
|
1834
|
+
const {
|
|
1835
|
+
onDragStart: G
|
|
1836
|
+
} = le.current, me = {
|
|
1837
|
+
activatorEvent: z,
|
|
1838
|
+
active: {
|
|
1839
|
+
id: oe,
|
|
1840
|
+
data: j.data,
|
|
1841
|
+
rect: q
|
|
1842
|
+
}
|
|
1843
|
+
};
|
|
1844
|
+
ke(() => {
|
|
1845
|
+
G == null || G(me), E(se.Initializing), y({
|
|
1846
|
+
type: L.DragStart,
|
|
1847
|
+
initialCoordinates: A,
|
|
1848
|
+
active: oe
|
|
1849
|
+
}), m({
|
|
1850
|
+
type: "onDragStart",
|
|
1851
|
+
event: me
|
|
1852
|
+
}), dt(Ke.current), ft(z);
|
|
1853
|
+
});
|
|
1854
|
+
},
|
|
1855
|
+
onMove(A) {
|
|
1856
|
+
y({
|
|
1857
|
+
type: L.DragMove,
|
|
1858
|
+
coordinates: A
|
|
1859
|
+
});
|
|
1860
|
+
},
|
|
1861
|
+
onEnd: ve(L.DragEnd),
|
|
1862
|
+
onCancel: ve(L.DragCancel)
|
|
1863
|
+
});
|
|
1864
|
+
Ke.current = Y;
|
|
1865
|
+
function ve(A) {
|
|
1866
|
+
return async function() {
|
|
1867
|
+
const {
|
|
1868
|
+
active: j,
|
|
1869
|
+
collisions: G,
|
|
1870
|
+
over: me,
|
|
1871
|
+
scrollAdjustedTranslate: De
|
|
1872
|
+
} = ce.current;
|
|
1873
|
+
let ie = null;
|
|
1874
|
+
if (j && De) {
|
|
1875
|
+
const {
|
|
1876
|
+
cancelDrop: xe
|
|
1877
|
+
} = le.current;
|
|
1878
|
+
ie = {
|
|
1879
|
+
activatorEvent: z,
|
|
1880
|
+
active: j,
|
|
1881
|
+
collisions: G,
|
|
1882
|
+
delta: De,
|
|
1883
|
+
over: me
|
|
1884
|
+
}, A === L.DragEnd && typeof xe == "function" && await Promise.resolve(xe(ie)) && (A = L.DragCancel);
|
|
1885
|
+
}
|
|
1886
|
+
ee.current = null, ke(() => {
|
|
1887
|
+
y({
|
|
1888
|
+
type: A
|
|
1889
|
+
}), E(se.Uninitialized), St(null), dt(null), ft(null), Ke.current = null;
|
|
1890
|
+
const xe = A === L.DragEnd ? "onDragEnd" : "onDragCancel";
|
|
1891
|
+
if (ie) {
|
|
1892
|
+
const Ye = le.current[xe];
|
|
1893
|
+
Ye == null || Ye(ie), m({
|
|
1894
|
+
type: xe,
|
|
1895
|
+
event: ie
|
|
1896
|
+
});
|
|
1897
|
+
}
|
|
1898
|
+
});
|
|
1899
|
+
};
|
|
1900
|
+
}
|
|
1901
|
+
},
|
|
1902
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1903
|
+
[b]
|
|
1904
|
+
), on = Q((O, B) => (P, re) => {
|
|
1905
|
+
const $ = P.nativeEvent, z = b.get(re);
|
|
1906
|
+
if (
|
|
1907
|
+
// Another sensor is already instantiating
|
|
1908
|
+
ee.current !== null || // No active draggable
|
|
1909
|
+
!z || // Event has already been captured
|
|
1910
|
+
$.dndKit || $.defaultPrevented
|
|
1911
|
+
)
|
|
1912
|
+
return;
|
|
1913
|
+
const Y = {
|
|
1914
|
+
active: z
|
|
1915
|
+
};
|
|
1916
|
+
O(P, B.options, Y) === !0 && ($.dndKit = {
|
|
1917
|
+
capturedBy: B.sensor
|
|
1918
|
+
}, ee.current = re, Rt(P, B));
|
|
1919
|
+
}, [b, Rt]), Et = tr(d, on);
|
|
1920
|
+
cr(d), be(() => {
|
|
1921
|
+
X && k === se.Initializing && E(se.Initialized);
|
|
1922
|
+
}, [X, k]), N(
|
|
1923
|
+
() => {
|
|
1924
|
+
const {
|
|
1925
|
+
onDragMove: O
|
|
1926
|
+
} = le.current, {
|
|
1927
|
+
active: B,
|
|
1928
|
+
activatorEvent: P,
|
|
1929
|
+
collisions: re,
|
|
1930
|
+
over: $
|
|
1931
|
+
} = ce.current;
|
|
1932
|
+
if (!B || !P)
|
|
1933
|
+
return;
|
|
1934
|
+
const z = {
|
|
1935
|
+
active: B,
|
|
1936
|
+
activatorEvent: P,
|
|
1937
|
+
collisions: re,
|
|
1938
|
+
delta: {
|
|
1939
|
+
x: he.x,
|
|
1940
|
+
y: he.y
|
|
1941
|
+
},
|
|
1942
|
+
over: $
|
|
1943
|
+
};
|
|
1944
|
+
ke(() => {
|
|
1945
|
+
O == null || O(z), m({
|
|
1946
|
+
type: "onDragMove",
|
|
1947
|
+
event: z
|
|
1948
|
+
});
|
|
1949
|
+
});
|
|
1950
|
+
},
|
|
1951
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1952
|
+
[he.x, he.y]
|
|
1953
|
+
), N(
|
|
1954
|
+
() => {
|
|
1955
|
+
const {
|
|
1956
|
+
active: O,
|
|
1957
|
+
activatorEvent: B,
|
|
1958
|
+
collisions: P,
|
|
1959
|
+
droppableContainers: re,
|
|
1960
|
+
scrollAdjustedTranslate: $
|
|
1961
|
+
} = ce.current;
|
|
1962
|
+
if (!O || ee.current == null || !B || !$)
|
|
1963
|
+
return;
|
|
1964
|
+
const {
|
|
1965
|
+
onDragOver: z
|
|
1966
|
+
} = le.current, Y = re.get(Ct), ve = Y && Y.rect.current ? {
|
|
1967
|
+
id: Y.id,
|
|
1968
|
+
rect: Y.rect.current,
|
|
1969
|
+
data: Y.data,
|
|
1970
|
+
disabled: Y.disabled
|
|
1971
|
+
} : null, A = {
|
|
1972
|
+
active: O,
|
|
1973
|
+
activatorEvent: B,
|
|
1974
|
+
collisions: P,
|
|
1975
|
+
delta: {
|
|
1976
|
+
x: $.x,
|
|
1977
|
+
y: $.y
|
|
1978
|
+
},
|
|
1979
|
+
over: ve
|
|
1980
|
+
};
|
|
1981
|
+
ke(() => {
|
|
1982
|
+
St(ve), z == null || z(A), m({
|
|
1983
|
+
type: "onDragOver",
|
|
1984
|
+
event: A
|
|
1985
|
+
});
|
|
1986
|
+
});
|
|
1987
|
+
},
|
|
1988
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1989
|
+
[Ct]
|
|
1990
|
+
), be(() => {
|
|
1991
|
+
ce.current = {
|
|
1992
|
+
activatorEvent: V,
|
|
1993
|
+
active: J,
|
|
1994
|
+
activeNode: U,
|
|
1995
|
+
collisionRect: ge,
|
|
1996
|
+
collisions: ye,
|
|
1997
|
+
droppableRects: de,
|
|
1998
|
+
draggableNodes: b,
|
|
1999
|
+
draggingNode: Le,
|
|
2000
|
+
draggingNodeRect: fe,
|
|
2001
|
+
droppableContainers: I,
|
|
2002
|
+
over: ne,
|
|
2003
|
+
scrollableAncestors: te,
|
|
2004
|
+
scrollAdjustedTranslate: he
|
|
2005
|
+
}, q.current = {
|
|
2006
|
+
initial: fe,
|
|
2007
|
+
translated: ge
|
|
2008
|
+
};
|
|
2009
|
+
}, [J, U, ye, ge, b, Le, fe, de, I, ne, te, he]), Gn({
|
|
2010
|
+
...pt,
|
|
2011
|
+
delta: T,
|
|
2012
|
+
draggingRect: ge,
|
|
2013
|
+
pointerCoordinates: Dt,
|
|
2014
|
+
scrollableAncestors: te,
|
|
2015
|
+
scrollableAncestorRects: Te
|
|
2016
|
+
});
|
|
2017
|
+
const sn = M(() => ({
|
|
2018
|
+
active: J,
|
|
2019
|
+
activeNode: U,
|
|
2020
|
+
activeNodeRect: X,
|
|
2021
|
+
activatorEvent: V,
|
|
2022
|
+
collisions: ye,
|
|
2023
|
+
containerNodeRect: Xe,
|
|
2024
|
+
dragOverlay: ue,
|
|
2025
|
+
draggableNodes: b,
|
|
2026
|
+
droppableContainers: I,
|
|
2027
|
+
droppableRects: de,
|
|
2028
|
+
over: ne,
|
|
2029
|
+
measureDroppableContainers: Oe,
|
|
2030
|
+
scrollableAncestors: te,
|
|
2031
|
+
scrollableAncestorRects: Te,
|
|
2032
|
+
measuringConfiguration: ae,
|
|
2033
|
+
measuringScheduled: gt,
|
|
2034
|
+
windowRect: _e
|
|
2035
|
+
}), [J, U, X, V, ye, Xe, ue, b, I, de, ne, Oe, te, Te, ae, gt, _e]), ln = M(() => ({
|
|
2036
|
+
activatorEvent: V,
|
|
2037
|
+
activators: Et,
|
|
2038
|
+
active: J,
|
|
2039
|
+
activeNodeRect: X,
|
|
2040
|
+
ariaDescribedById: {
|
|
2041
|
+
draggable: Ue
|
|
2042
|
+
},
|
|
2043
|
+
dispatch: y,
|
|
2044
|
+
draggableNodes: b,
|
|
2045
|
+
over: ne,
|
|
2046
|
+
measureDroppableContainers: Oe
|
|
2047
|
+
}), [V, Et, J, X, y, Ue, b, ne, Oe]);
|
|
2048
|
+
return H.createElement(Wt.Provider, {
|
|
2049
|
+
value: x
|
|
2050
|
+
}, H.createElement(ct.Provider, {
|
|
2051
|
+
value: ln
|
|
2052
|
+
}, H.createElement(wr.Provider, {
|
|
2053
|
+
value: sn
|
|
2054
|
+
}, H.createElement(Zt.Provider, {
|
|
2055
|
+
value: rn
|
|
2056
|
+
}, c)), H.createElement(Dr, {
|
|
2057
|
+
disabled: (l == null ? void 0 : l.restoreFocus) === !1
|
|
2058
|
+
})), H.createElement(Cn, {
|
|
2059
|
+
...l,
|
|
2060
|
+
hiddenTextDescribedById: Ue
|
|
2061
|
+
}));
|
|
2062
|
+
function an() {
|
|
2063
|
+
const O = (ut == null ? void 0 : ut.autoScrollEnabled) === !1, B = typeof a == "object" ? a.enabled === !1 : a === !1, P = C && !O && !B;
|
|
2064
|
+
return typeof a == "object" ? {
|
|
2065
|
+
...a,
|
|
2066
|
+
enabled: P
|
|
2067
|
+
} : {
|
|
2068
|
+
enabled: P
|
|
2069
|
+
};
|
|
2070
|
+
}
|
|
2071
|
+
}), Rr = /* @__PURE__ */ Ae(null), Pt = "button", Er = "Draggable";
|
|
2072
|
+
function Tr(e) {
|
|
2073
|
+
let {
|
|
2074
|
+
id: t,
|
|
2075
|
+
data: n,
|
|
2076
|
+
disabled: r = !1,
|
|
2077
|
+
attributes: o
|
|
2078
|
+
} = e;
|
|
2079
|
+
const i = nt(Er), {
|
|
2080
|
+
activators: s,
|
|
2081
|
+
activatorEvent: l,
|
|
2082
|
+
active: a,
|
|
2083
|
+
activeNodeRect: c,
|
|
2084
|
+
ariaDescribedById: d,
|
|
2085
|
+
draggableNodes: u,
|
|
2086
|
+
over: g
|
|
2087
|
+
} = Pe(ct), {
|
|
2088
|
+
role: h = Pt,
|
|
2089
|
+
roleDescription: D = "draggable",
|
|
2090
|
+
tabIndex: f = 0
|
|
2091
|
+
} = o ?? {}, v = (a == null ? void 0 : a.id) === t, y = Pe(v ? Zt : Rr), [m, x] = Ve(), [k, E] = Ve(), C = ur(s, t), p = tt(n);
|
|
2092
|
+
be(
|
|
2093
|
+
() => (u.set(t, {
|
|
2094
|
+
id: t,
|
|
2095
|
+
key: i,
|
|
2096
|
+
node: m,
|
|
2097
|
+
activatorNode: k,
|
|
2098
|
+
data: p
|
|
2099
|
+
}), () => {
|
|
2100
|
+
const T = u.get(t);
|
|
2101
|
+
T && T.key === i && u.delete(t);
|
|
2102
|
+
}),
|
|
2103
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2104
|
+
[u, t]
|
|
2105
|
+
);
|
|
2106
|
+
const b = M(() => ({
|
|
2107
|
+
role: h,
|
|
2108
|
+
tabIndex: f,
|
|
2109
|
+
"aria-disabled": r,
|
|
2110
|
+
"aria-pressed": v && h === Pt ? !0 : void 0,
|
|
2111
|
+
"aria-roledescription": D,
|
|
2112
|
+
"aria-describedby": d.draggable
|
|
2113
|
+
}), [r, h, f, v, D, d.draggable]);
|
|
2114
|
+
return {
|
|
2115
|
+
active: a,
|
|
2116
|
+
activatorEvent: l,
|
|
2117
|
+
activeNodeRect: c,
|
|
2118
|
+
attributes: b,
|
|
2119
|
+
isDragging: v,
|
|
2120
|
+
listeners: r ? void 0 : C,
|
|
2121
|
+
node: m,
|
|
2122
|
+
over: g,
|
|
2123
|
+
setNodeRef: x,
|
|
2124
|
+
setActivatorNodeRef: E,
|
|
2125
|
+
transform: y
|
|
2126
|
+
};
|
|
2127
|
+
}
|
|
2128
|
+
export {
|
|
2129
|
+
Se as AutoScrollActivator,
|
|
2130
|
+
Lr as DndContext,
|
|
2131
|
+
w as KeyboardCode,
|
|
2132
|
+
Jt as KeyboardSensor,
|
|
2133
|
+
et as MeasuringFrequency,
|
|
2134
|
+
Ee as MeasuringStrategy,
|
|
2135
|
+
Jn as MouseSensor,
|
|
2136
|
+
Vt as PointerSensor,
|
|
2137
|
+
Vn as TouchSensor,
|
|
2138
|
+
$e as TraversalOrder,
|
|
2139
|
+
xr as applyModifiers,
|
|
2140
|
+
xn as defaultAnnouncements,
|
|
2141
|
+
K as defaultCoordinates,
|
|
2142
|
+
jn as defaultKeyboardCoordinateGetter,
|
|
2143
|
+
Dn as defaultScreenReaderInstructions,
|
|
2144
|
+
Ne as getClientRect,
|
|
2145
|
+
Rn as getFirstCollision,
|
|
2146
|
+
it as getScrollableAncestors,
|
|
2147
|
+
An as rectIntersection,
|
|
2148
|
+
yn as useDndMonitor,
|
|
2149
|
+
Tr as useDraggable
|
|
2150
|
+
};
|