fluid-dnd 2.0.0 → 2.0.2

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.
Files changed (76) hide show
  1. package/README.md +1 -1
  2. package/dist/{HandlerPublisher-BbQeSll4.js → HandlerPublisher-BYI2bw4n.js} +1 -1
  3. package/dist/{HandlerPublisher-F9_9P96L.cjs → HandlerPublisher-C-jTncuG.cjs} +1 -1
  4. package/dist/core/HandlerPublisher.js +20 -0
  5. package/dist/core/configHandler.d.ts +2 -3
  6. package/dist/core/configHandler.js +33 -0
  7. package/dist/core/dragAndDrop.d.ts +3 -3
  8. package/dist/core/dragAndDrop.js +62 -0
  9. package/dist/core/index.js +2 -0
  10. package/dist/core/useDraggable.d.ts +2 -3
  11. package/dist/core/useDraggable.js +328 -0
  12. package/dist/core/useDroppable.d.ts +2 -3
  13. package/dist/core/useDroppable.js +55 -0
  14. package/dist/core/utils/GetStyles.d.ts +2 -3
  15. package/dist/core/utils/GetStyles.js +138 -0
  16. package/dist/core/utils/ParseStyles.d.ts +2 -3
  17. package/dist/core/utils/ParseStyles.js +40 -0
  18. package/dist/core/utils/SetStyles.d.ts +1 -2
  19. package/dist/core/utils/SetStyles.js +192 -0
  20. package/dist/core/utils/SetTransform.d.ts +2 -3
  21. package/dist/core/utils/SetTransform.js +148 -0
  22. package/dist/core/utils/classes.js +9 -0
  23. package/dist/core/utils/config.d.ts +3 -3
  24. package/dist/core/utils/config.js +55 -0
  25. package/dist/core/utils/dom/classList.js +35 -0
  26. package/dist/core/utils/droppableConfigurator.d.ts +3 -4
  27. package/dist/core/utils/droppableConfigurator.js +106 -0
  28. package/dist/core/utils/events/emitEvents.d.ts +5 -6
  29. package/dist/core/utils/events/emitEvents.js +333 -0
  30. package/dist/core/utils/index.js +9 -0
  31. package/dist/core/utils/observer.js +11 -0
  32. package/dist/core/utils/scroll.d.ts +2 -3
  33. package/dist/core/utils/scroll.js +17 -0
  34. package/dist/core/utils/tempChildren.d.ts +1 -2
  35. package/dist/core/utils/tempChildren.js +146 -0
  36. package/dist/core/utils/touchDevice.js +3 -0
  37. package/dist/core/utils/translate/GetTranslateBeforeDropping.d.ts +2 -3
  38. package/dist/core/utils/translate/GetTranslateBeforeDropping.js +129 -0
  39. package/dist/core/utils/translate/GetTranslationByDraggingAndEvent.d.ts +2 -3
  40. package/dist/core/utils/translate/GetTranslationByDraggingAndEvent.js +48 -0
  41. package/dist/{index-8zYdjZIf.js → index-BQUYvZRn.js} +214 -214
  42. package/dist/index-DNmnvxhi.cjs +1 -0
  43. package/dist/index.cjs +1 -0
  44. package/dist/index.d.ts +4 -0
  45. package/dist/index.js +2 -0
  46. package/dist/index.mjs +4 -0
  47. package/dist/react/index.cjs +1 -1
  48. package/dist/react/index.d.ts +1 -2
  49. package/dist/react/index.js +2 -0
  50. package/dist/react/index.mjs +2 -2
  51. package/dist/react/useDragAndDrop.d.ts +2 -3
  52. package/dist/react/useDragAndDrop.js +28 -0
  53. package/dist/react/utils/ReactLilstConfig.d.ts +3 -4
  54. package/dist/react/utils/ReactLilstConfig.js +64 -0
  55. package/dist/svelte/index.cjs +1 -1
  56. package/dist/svelte/index.d.ts +1 -2
  57. package/dist/svelte/index.js +2 -0
  58. package/dist/svelte/index.mjs +2 -2
  59. package/dist/svelte/useDragAndDrop.d.ts +1 -2
  60. package/dist/svelte/useDragAndDrop.js +25 -0
  61. package/dist/svelte/utils/SvelteListCondig.d.ts +2 -2
  62. package/dist/svelte/utils/SvelteListCondig.js +36 -0
  63. package/dist/vue/index.cjs +1 -1
  64. package/dist/vue/index.d.ts +1 -2
  65. package/dist/vue/index.js +2 -0
  66. package/dist/vue/index.mjs +2 -2
  67. package/dist/vue/useDragAndDrop.d.ts +2 -3
  68. package/dist/vue/useDragAndDrop.js +23 -0
  69. package/dist/vue/utils/DropMethods.d.ts +1 -2
  70. package/dist/vue/utils/DropMethods.js +19 -0
  71. package/dist/vue/utils/VueListCondig.d.ts +3 -3
  72. package/dist/vue/utils/VueListCondig.js +28 -0
  73. package/package.json +5 -8
  74. package/dist/index/index.cjs +0 -1
  75. package/dist/index/index.mjs +0 -4
  76. package/dist/index-C37ab-rG.cjs +0 -1
@@ -1,29 +1,63 @@
1
1
  var Te = Object.defineProperty;
2
2
  var Ee = (t, e, n) => e in t ? Te(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
3
  var j = (t, e, n) => Ee(t, typeof e != "symbol" ? e + "" : e, n);
4
- const U = "draggable", Xt = "droppable", Lt = "handler-class", Ft = "dragging", Wt = "dragging-handler-class", Vt = "dropping", oe = "grabbing", ye = "grab", Kt = "disable-transition", nt = (t, e) => t.classList.contains(e), bt = (t, e, n = !1) => {
4
+ const V = "horizontal", tt = "vertical", U = "draggable", Xt = "droppable", Lt = "handler-class", Ft = "dragging", Wt = "dragging-handler-class", Vt = "dropping", oe = "grabbing", ye = "grab", Kt = "disable-transition", Ce = (t, e) => {
5
+ const n = (l, f) => t.removeAtEvent(l, f), s = (l, f, g) => t.insertEvent(l, f, g), o = () => t.getLength(), r = (l) => t.getValue(l), c = (l) => l;
6
+ return {
7
+ direction: (e == null ? void 0 : e.direction) ?? tt,
8
+ handlerSelector: (e == null ? void 0 : e.handlerSelector) ?? U,
9
+ draggingClass: (e == null ? void 0 : e.draggingClass) ?? "dragging",
10
+ droppableClass: (e == null ? void 0 : e.droppableClass) ?? "droppable-hover",
11
+ isDraggable: (e == null ? void 0 : e.isDraggable) ?? (() => !0),
12
+ onDragStart: (e == null ? void 0 : e.onDragStart) ?? (() => {
13
+ }),
14
+ onDragEnd: (e == null ? void 0 : e.onDragEnd) ?? (() => {
15
+ }),
16
+ droppableGroup: e == null ? void 0 : e.droppableGroup,
17
+ onRemoveAtEvent: n,
18
+ onInsertEvent: s,
19
+ onGetLegth: o,
20
+ onGetValue: r,
21
+ animationDuration: (e == null ? void 0 : e.animationDuration) ?? 200,
22
+ removingClass: (e == null ? void 0 : e.removingClass) ?? "removing",
23
+ insertingFromClass: (e == null ? void 0 : e.insertingFromClass) ?? "from-inserting",
24
+ delayBeforeRemove: (e == null ? void 0 : e.delayBeforeRemove) ?? 200,
25
+ delayBeforeInsert: (e == null ? void 0 : e.delayBeforeInsert) ?? 200,
26
+ mapFrom: (e == null ? void 0 : e.mapFrom) ?? c
27
+ };
28
+ }, Ae = (t, e) => {
29
+ const { config: n, droppable: s } = t, { onInsertEvent: o, onDragEnd: r } = n;
30
+ return {
31
+ ...n,
32
+ onDragEnd: (f) => {
33
+ const { index: g, value: m } = f;
34
+ r({ index: g, value: e(m, s) });
35
+ },
36
+ onInsertEvent: (f, g) => o(f, e(g, s), !0)
37
+ };
38
+ }, nt = (t, e) => t.classList.contains(e), bt = (t, e, n = !1) => {
5
39
  t.classList.toggle(e, n);
6
40
  }, st = (t, e) => {
7
41
  t.classList.add(e);
8
42
  }, Ct = (t, e) => {
9
43
  t.classList.remove(e);
10
- }, Ce = (t, e) => At(e).every(
44
+ }, xe = (t, e) => At(e).every(
11
45
  (n) => nt(t, n)
12
- ), gt = (t) => t ? `.${At(t).join(".")}` : "", Ae = (t, e) => {
46
+ ), gt = (t) => t ? `.${At(t).join(".")}` : "", we = (t, e) => {
13
47
  if (!e)
14
48
  return;
15
49
  const n = At(e);
16
50
  t.classList.add(...n);
17
- }, At = (t) => t ? t.split(" ").filter((e) => e) : [], V = "horizontal", tt = "vertical", xe = () => {
51
+ }, At = (t) => t ? t.split(" ").filter((e) => e) : [], Be = () => {
18
52
  const { scrollX: t, scrollY: e } = window;
19
53
  return { scrollX: t, scrollY: e };
20
- }, zt = (t) => !t || t.trim().length == 0 || t == "normal" ? 0 : parseFloat(t), we = (t) => t ? parseInt(t) : -1, Be = (t) => {
54
+ }, zt = (t) => !t || t.trim().length == 0 || t == "normal" ? 0 : parseFloat(t), Me = (t) => t ? parseInt(t) : -1, Re = (t) => {
21
55
  const e = getComputedStyle(t), n = new DOMMatrixReadOnly(e.transform);
22
56
  return {
23
57
  x: n.m41,
24
58
  y: n.m42
25
59
  };
26
- }, re = (t, e) => t.x1 > e.x1 ? re(e, t) : t.x2 < e.x1 ? 0 : t.x2 >= e.x2 ? t.x2 - t.x1 : t.x2 - e.x1, pt = (t, e) => !Me(t, e), Me = (t, e) => {
60
+ }, re = (t, e) => t.x1 > e.x1 ? re(e, t) : t.x2 < e.x1 ? 0 : t.x2 >= e.x2 ? t.x2 - t.x1 : t.x2 - e.x1, pt = (t, e) => !Le(t, e), Le = (t, e) => {
27
61
  const n = Ot(t), s = Ot(e), o = Qt(n, s, tt), r = Qt(n, s, V);
28
62
  return o >= Math.min(n.height, s.height) / 2 && r >= Math.min(n.width, s.width) / 2;
29
63
  }, Qt = (t, e, n) => {
@@ -63,9 +97,9 @@ const U = "draggable", Xt = "droppable", Lt = "handler-class", Ft = "dragging",
63
97
  paddingBefore: e ? "paddingLeft" : "paddingTop",
64
98
  getRect: Ot
65
99
  };
66
- }, Mt = (t, e) => Re(t, e), ie = (t) => [...t.children].filter(
100
+ }, Mt = (t, e) => Oe(t, e), ie = (t) => [...t.children].filter(
67
101
  (n) => nt(n, U)
68
- ), Re = (t, e) => {
102
+ ), Oe = (t, e) => {
69
103
  const n = [...e.children].filter(
70
104
  (o) => nt(o, U) && !o.isEqualNode(t)
71
105
  ).toReversed(), s = [...e.children].findLastIndex(
@@ -76,7 +110,7 @@ const U = "draggable", Xt = "droppable", Lt = "handler-class", Ft = "dragging",
76
110
  s,
77
111
  e
78
112
  ];
79
- }, Le = (t) => {
113
+ }, Ne = (t) => {
80
114
  let e = t.parentElement;
81
115
  for (; e; ) {
82
116
  if (window.getComputedStyle(e).position === "fixed")
@@ -88,13 +122,13 @@ const U = "draggable", Xt = "droppable", Lt = "handler-class", Ft = "dragging",
88
122
  const {
89
123
  before: n,
90
124
  borderBeforeWidth: s
91
- } = B(e), o = Le(t);
125
+ } = B(e), o = Ne(t);
92
126
  return o ? Ot(o)[n] + L(o, s) : 0;
93
- }, Tt = (t) => window.TouchEvent && t instanceof TouchEvent, it = (t) => t instanceof HTMLElement, ae = (t) => t instanceof MouseEvent, Oe = ["onmouseup", "onmousedown", "onmousemove"], Ne = (t, e, n) => {
127
+ }, Tt = (t) => window.TouchEvent && t instanceof TouchEvent, it = (t) => t instanceof HTMLElement, ae = (t) => t instanceof MouseEvent, Fe = ["onmouseup", "onmousedown", "onmousemove"], Pe = (t, e, n) => {
94
128
  t && (t.style.height = `${e}px`, t.style.width = `${n}px`);
95
129
  }, Et = (t, e, n) => {
96
130
  !t || !it(t) || (n == 0 && e == 0 ? t.style.transform = "" : t.style.transform = `translate(${n}px,${e}px)`);
97
- }, Fe = (t, e, n, s) => {
131
+ }, $e = (t, e, n, s) => {
98
132
  t[e] = (o) => {
99
133
  if (o.defaultPrevented)
100
134
  return;
@@ -103,8 +137,8 @@ const U = "draggable", Xt = "droppable", Lt = "handler-class", Ft = "dragging",
103
137
  n(r);
104
138
  };
105
139
  }, It = (t, e, n, s) => {
106
- n && (Pe(e) ? t[e] = n : Fe(t, e, n, s));
107
- }, Pe = (t) => Oe.includes(t), $e = (t) => {
140
+ n && (Ge(e) ? t[e] = n : $e(t, e, n, s));
141
+ }, Ge = (t) => Fe.includes(t), Ie = (t) => {
108
142
  const { target: e } = t;
109
143
  return {
110
144
  clientX: 0,
@@ -117,8 +151,8 @@ const U = "draggable", Xt = "droppable", Lt = "handler-class", Ft = "dragging",
117
151
  offsetX: 0,
118
152
  offsetY: 0
119
153
  };
120
- }, Ge = (t, e) => {
121
- const n = (s, o) => Ye(e, window, o, s);
154
+ }, Ye = (t, e) => {
155
+ const n = (s, o) => We(e, window, o, s);
122
156
  if (ae(t)) {
123
157
  const { offsetX: s, offsetY: o } = t;
124
158
  return [s, o];
@@ -130,10 +164,10 @@ const U = "draggable", Xt = "droppable", Lt = "handler-class", Ft = "dragging",
130
164
  ];
131
165
  }
132
166
  }, _t = (t) => {
133
- const e = Ie(t);
167
+ const e = Xe(t);
134
168
  if (!e)
135
- return $e(t);
136
- const [n, s] = Ge(t, e), { clientX: o, clientY: r, pageX: c, pageY: l, screenX: f, screenY: g, target: m } = e;
169
+ return Ie(t);
170
+ const [n, s] = Ye(t, e), { clientX: o, clientY: r, pageX: c, pageY: l, screenX: f, screenY: g, target: m } = e;
137
171
  return {
138
172
  clientX: o,
139
173
  clientY: r,
@@ -145,12 +179,12 @@ const U = "draggable", Xt = "droppable", Lt = "handler-class", Ft = "dragging",
145
179
  offsetX: n,
146
180
  offsetY: s
147
181
  };
148
- }, Ie = (t) => {
182
+ }, Xe = (t) => {
149
183
  if (Tt(t))
150
184
  return t.touches[0] ?? t.changedTouches[0];
151
185
  if (ae(t))
152
186
  return t;
153
- }, Ye = (t, e, n, s) => {
187
+ }, We = (t, e, n, s) => {
154
188
  const { page: o, scroll: r, before: c, borderBeforeWidth: l, getRect: f } = B(n), g = f(s);
155
189
  return t[o] - e[r] - g[c] - L(s, l);
156
190
  }, Pt = (t, e, n = "ease-out", s = "transform") => {
@@ -159,14 +193,14 @@ const U = "draggable", Xt = "droppable", Lt = "handler-class", Ft = "dragging",
159
193
  !t || !it(t) || (t[e] = () => {
160
194
  n();
161
195
  });
162
- }, Xe = (t) => {
196
+ }, Ve = (t) => {
163
197
  var e = t.querySelector("style");
164
198
  if (!e) {
165
199
  var n = document.createElement("style");
166
200
  return t.appendChild(n), n;
167
201
  }
168
202
  return e;
169
- }, We = (t, e) => {
203
+ }, _e = (t, e) => {
170
204
  const n = /\.-?[_a-zA-Z0-9-*\s<>():]+/g, [s] = e.match(n) || [];
171
205
  for (const o of t.cssRules) {
172
206
  const [r] = o.cssText.match(n) || [];
@@ -174,20 +208,106 @@ const U = "draggable", Xt = "droppable", Lt = "handler-class", Ft = "dragging",
174
208
  return !0;
175
209
  }
176
210
  return !1;
177
- }, Ve = (t, e) => {
211
+ }, He = (t, e) => {
178
212
  e.forEach((n) => {
179
- _e(t, n);
213
+ qe(t, n);
180
214
  });
181
- }, _e = (t, e) => {
215
+ }, qe = (t, e) => {
182
216
  var s;
183
- var n = Xe(t);
184
- n.sheet && (We(n.sheet, e) || (s = n.sheet) == null || s.insertRule(e, n.sheet.cssRules.length));
217
+ var n = Ve(t);
218
+ n.sheet && (_e(n.sheet, e) || (s = n.sheet) == null || s.insertRule(e, n.sheet.cssRules.length));
185
219
  }, ue = (t, e = {}) => {
186
220
  for (const n of Object.keys(e)) {
187
221
  const s = e[n];
188
- s != null && He(t, `--${n}`, s);
222
+ s != null && ze(t, `--${n}`, s);
189
223
  }
190
- }, He = (t, e, n) => t && t.style.setProperty(e, n), fe = "startDrag", Nt = "drag", jt = "startDrop", qe = "drop", at = "temp-child", de = "cubic-bezier(0.2, 0, 0, 1)", ze = (t) => t === qe || t === jt, Ht = (t) => !t || t.length == 0 ? 0 : zt(t.replace("px", "")), je = (t, e) => {
224
+ }, ze = (t, e, n) => t && t.style.setProperty(e, n), je = (t, e, n) => {
225
+ n != 0 && (e === "vertical" ? t.scrollBy(0, n) : t.scrollBy(n, 0));
226
+ }, Ze = (t, e, n) => {
227
+ const { scrollDistance: s, clientDistance: o, scrollElement: r } = B(t);
228
+ return n[r] / (e[s] - e[o]);
229
+ }, ke = (t) => {
230
+ let e = { offsetX: 0, offsetY: 0 }, n = { top: 0, left: 0 }, s = { x: 0, y: 0 };
231
+ const o = (f) => {
232
+ t.style.transform = `translate( ${f.x}px, ${f.y}px)`;
233
+ }, r = (f) => {
234
+ t.style.top = `${f.top}px`, t.style.left = `${f.left}px`;
235
+ };
236
+ return [
237
+ (f, g, m, b) => {
238
+ const M = (y) => {
239
+ const {
240
+ beforeMargin: p,
241
+ borderBeforeWidth: E,
242
+ before: R,
243
+ offset: w,
244
+ scroll: P,
245
+ page: X,
246
+ inner: Z,
247
+ distance: _,
248
+ axis: H,
249
+ getRect: $
250
+ } = B(y), k = m[X], q = window[P], J = window[Z], I = $(f)[_], z = L(f, E), W = L(f, p), Y = k - e[w], et = ce(f, y);
251
+ if (Y >= q - I / 2 && Y <= q + J) {
252
+ const ot = Y - n[R] - z - W - q - et;
253
+ return O(y), ot;
254
+ }
255
+ return s[H];
256
+ }, O = (y) => {
257
+ if (f && nt(f, Ft) && y === b) {
258
+ const { before: p, distance: E, axis: R, getRect: w } = B(b), P = w(f)[E], X = w(g), Z = n[p] - X[p] + s[R], H = X[E] - P, $ = Z / H, k = P / H, q = 0.1, J = 0.2, I = 0.8;
259
+ let z = 0;
260
+ const W = pt(f, g);
261
+ !W && $ < J && $ > -k ? z = $ / J - 1 : !W && $ > I && $ < 1 + k && (z = 1 / (1 - I) * ($ - I));
262
+ const Y = q * P * z;
263
+ je(g, b, Y);
264
+ }
265
+ }, F = (y) => {
266
+ const { axis: p } = B(y);
267
+ s[p] = M(y), o(s);
268
+ };
269
+ F(V), F(tt);
270
+ },
271
+ (f, g) => {
272
+ const [m, b, M, O] = Qe(
273
+ f,
274
+ g,
275
+ t
276
+ );
277
+ n = {
278
+ top: m,
279
+ left: b
280
+ }, r(n), e = { offsetX: M, offsetY: O };
281
+ }
282
+ ];
283
+ }, Rt = (t, e, n) => {
284
+ const { borderBeforeWidth: s, before: o, getRect: r } = B(t);
285
+ return r(e)[o] - r(n)[o] - L(n, s);
286
+ }, Je = (t, e) => {
287
+ let { offsetX: n, offsetY: s, target: o } = t, r = Ke(o, e);
288
+ const c = o;
289
+ return c && r && !c.isSameNode(r) && (n += Rt(V, c, r), s += Rt(tt, c, r)), r && e != o && (n += Rt(V, r, e), s += Rt(tt, r, e)), [n, s];
290
+ }, Ke = (t, e) => {
291
+ const n = t == null ? void 0 : t.closest(`.${Lt}`);
292
+ return n && n.isSameNode(e) ? t : n;
293
+ }, te = (t, e, n, s) => {
294
+ const { offset: o, beforeMargin: r, page: c, borderBeforeWidth: l, scroll: f } = B(t), g = ce(n, t);
295
+ return e[c] - s[o] - L(n, r) - L(n, l) - window[f] - g;
296
+ }, Qe = (t, e, n) => {
297
+ const [s, o] = Je(t, n);
298
+ return [
299
+ te(tt, t, e, {
300
+ offsetX: s,
301
+ offsetY: o
302
+ }),
303
+ te(V, t, e, {
304
+ offsetX: s,
305
+ offsetY: o
306
+ }),
307
+ s,
308
+ o
309
+ ];
310
+ }, fe = "startDrag", Nt = "drag", jt = "startDrop", Ue = "drop", at = "temp-child", de = "cubic-bezier(0.2, 0, 0, 1)", tn = (t) => t === Ue || t === jt, Ht = (t) => !t || t.length == 0 ? 0 : zt(t.replace("px", "")), en = (t, e) => {
191
311
  const n = getComputedStyle(t)[e];
192
312
  if (n.match("%")) {
193
313
  const o = zt(n.replace("%", "")), { width: r } = t.getBoundingClientRect();
@@ -200,17 +320,17 @@ const U = "draggable", Xt = "droppable", Lt = "handler-class", Ft = "dragging",
200
320
  0,
201
321
  !1
202
322
  ];
203
- const n = je(t, e), s = getComputedStyle(t).display, o = n > 0 || s === "flex";
323
+ const n = en(t, e), s = getComputedStyle(t).display, o = n > 0 || s === "flex";
204
324
  return [n, o];
205
- }, Ze = (t) => {
325
+ }, nn = (t) => {
206
326
  const { top: e, left: n } = getComputedStyle(t);
207
327
  return [Ht(e), Ht(n)];
208
- }, ke = (t, e) => {
328
+ }, sn = (t, e) => {
209
329
  const { gap: n } = B(e), [s, o] = Zt(t, n);
210
330
  return o ? s : 0;
211
331
  };
212
332
  function yt(t, e, n, s, o = t.previousElementSibling, r = t.nextElementSibling) {
213
- let { height: c, width: l } = Je(
333
+ let { height: c, width: l } = on(
214
334
  n,
215
335
  t,
216
336
  o,
@@ -218,7 +338,7 @@ function yt(t, e, n, s, o = t.previousElementSibling, r = t.nextElementSibling)
218
338
  );
219
339
  return pt(t, s) && e == Nt && (c = 0, l = 0), { height: c, width: l };
220
340
  }
221
- const Je = (t, e, n, s) => {
341
+ const on = (t, e, n, s) => {
222
342
  const {
223
343
  afterMargin: o,
224
344
  beforeMargin: r,
@@ -230,16 +350,16 @@ const Je = (t, e, n, s) => {
230
350
  l
231
351
  ), F = f(e)[c];
232
352
  if (O)
233
- return te(F, m, g, M, 0, t);
234
- const [y, p, E] = Ke(
353
+ return ee(F, m, g, M, 0, t);
354
+ const [y, p, E] = rn(
235
355
  n,
236
356
  b,
237
357
  g,
238
358
  m,
239
359
  o
240
360
  );
241
- return te(F, p, y, 0, E, t);
242
- }, Ke = (t, e, n, s, o) => {
361
+ return ee(F, p, y, 0, E, t);
362
+ }, rn = (t, e, n, s, o) => {
243
363
  const r = Math.max(e, n);
244
364
  let c = s, l = e;
245
365
  if (t) {
@@ -250,7 +370,7 @@ const Je = (t, e, n, s) => {
250
370
  c = Math.max(f, s), l = Math.max(l, f);
251
371
  }
252
372
  return [r, c, l];
253
- }, te = (t, e, n, s, o, r) => Qe(r, t + e + n + s - o), Qe = (t, e) => t == V ? { width: e, height: 0 } : { width: 0, height: e }, ee = (t, e) => {
373
+ }, ee = (t, e, n, s, o, r) => cn(r, t + e + n + s - o), cn = (t, e) => t == V ? { width: e, height: 0 } : { width: 0, height: e }, ne = (t, e) => {
254
374
  const {
255
375
  borderBeforeWidth: n,
256
376
  paddingBefore: s,
@@ -258,27 +378,27 @@ const Je = (t, e, n, s) => {
258
378
  getRect: r
259
379
  } = B(t), c = L(e, n), l = L(e, s), f = r(e)[o];
260
380
  return c + l + f;
261
- }, Ue = (t, e) => {
262
- const [n, s] = Ze(e), o = ee(tt, t);
381
+ }, an = (t, e) => {
382
+ const [n, s] = nn(e), o = ne(tt, t);
263
383
  return [
264
- ee(V, t) - s,
384
+ ne(V, t) - s,
265
385
  o - n
266
386
  ];
267
387
  };
268
- function tn(t, e, n, s, o, r, c, l, f) {
388
+ function ln(t, e, n, s, o, r, c, l, f) {
269
389
  let g = 0, m = 0;
270
390
  const b = !!(n < 0 && f);
271
391
  if (n === s && !b)
272
- return ne(
392
+ return se(
273
393
  { height: g, width: m },
274
394
  t,
275
395
  o,
276
396
  c,
277
397
  b
278
398
  );
279
- const [M, O, F, y] = sn(e, n, s, f);
399
+ const [M, O, F, y] = dn(e, n, s, f);
280
400
  if (b) {
281
- const [et, ut] = Ue(l, f);
401
+ const [et, ut] = an(l, f);
282
402
  g += ut, m += et;
283
403
  }
284
404
  const {
@@ -291,7 +411,7 @@ function tn(t, e, n, s, o, r, c, l, f) {
291
411
  _,
292
412
  H,
293
413
  $
294
- ] = rn(
414
+ ] = pn(
295
415
  E,
296
416
  R,
297
417
  M,
@@ -299,22 +419,22 @@ function tn(t, e, n, s, o, r, c, l, f) {
299
419
  y,
300
420
  Z,
301
421
  b
302
- ), [k, q, J] = on(
422
+ ), [k, q, J] = gn(
303
423
  E,
304
424
  R,
305
425
  w,
306
426
  F,
307
427
  X,
308
428
  Z
309
- ), I = nn(
429
+ ), I = fn(
310
430
  q,
311
431
  k,
312
432
  J,
313
433
  H,
314
434
  _,
315
435
  X
316
- ), z = b ? l[p] : en(p, l, r), Y = (y ? I - $ : $ - I) - z;
317
- return t === tt ? g += Y : t === V && (m += Y), ne(
436
+ ), z = b ? l[p] : un(p, l, r), Y = (y ? I - $ : $ - I) - z;
437
+ return t === tt ? g += Y : t === V && (m += Y), se(
318
438
  { height: g, width: m },
319
439
  t,
320
440
  o,
@@ -322,13 +442,13 @@ function tn(t, e, n, s, o, r, c, l, f) {
322
442
  b
323
443
  );
324
444
  }
325
- const en = (t, e, n) => {
445
+ const un = (t, e, n) => {
326
446
  const s = e[t], o = n[t];
327
447
  return s - o;
328
- }, nn = (t, e, n, s, o, r) => {
448
+ }, fn = (t, e, n, s, o, r) => {
329
449
  const c = Math.max(e, o);
330
450
  return Math.max(n, s) + t + c + r;
331
- }, sn = (t, e, n, s) => {
451
+ }, dn = (t, e, n, s) => {
332
452
  const o = e < n, [r, c] = [e, n].toSorted(
333
453
  (m, b) => m - b
334
454
  ), l = t[e] ?? s, f = t[n];
@@ -339,7 +459,7 @@ const en = (t, e, n) => {
339
459
  g,
340
460
  o
341
461
  ];
342
- }, on = (t, e, n, s, o, r) => {
462
+ }, gn = (t, e, n, s, o, r) => {
343
463
  if (s.length == 0)
344
464
  return [0, 0, 0];
345
465
  const c = L(s[0], t);
@@ -349,12 +469,12 @@ const en = (t, e, n) => {
349
469
  r && (l += M), r && g > 0 ? l += o : l = Math.max(l, M), f += l + b, l = L(m, e);
350
470
  }
351
471
  return [c, f, l];
352
- }, ne = (t, e, n, s, o) => {
472
+ }, se = (t, e, n, s, o) => {
353
473
  const { scroll: r, distance: c } = B(e), l = window[r], f = n[r], g = o ? 0 : f - 2 * l + s[r];
354
474
  return t[c] += g, t;
355
- }, rn = (t, e, n, s, o, r, c) => {
475
+ }, pn = (t, e, n, s, o, r, c) => {
356
476
  const l = o ? n.previousElementSibling : s;
357
- return cn(
477
+ return hn(
358
478
  t,
359
479
  e,
360
480
  l,
@@ -362,7 +482,7 @@ const en = (t, e, n) => {
362
482
  r,
363
483
  c
364
484
  );
365
- }, cn = (t, e, n, s, o, r) => {
485
+ }, hn = (t, e, n, s, o, r) => {
366
486
  if (o)
367
487
  return [0, 0, 0];
368
488
  const c = L(
@@ -379,46 +499,41 @@ const en = (t, e, n) => {
379
499
  }
380
500
  });
381
501
  return o.observe(e, n), o;
382
- }, an = (t, e, n) => {
383
- n != 0 && (e === "vertical" ? t.scrollBy(0, n) : t.scrollBy(n, 0));
384
- }, ln = (t, e, n) => {
385
- const { scrollDistance: s, clientDistance: o, scrollElement: r } = B(t);
386
- return n[r] / (e[s] - e[o]);
387
- }, un = "startDrag", ge = "cubic-bezier(0.2, 0, 0, 1)", pe = 50, qt = (t) => it(t) ? t.classList.contains(at) : !1, fn = (t, e, n) => {
502
+ }, mn = "startDrag", ge = "cubic-bezier(0.2, 0, 0, 1)", pe = 50, qt = (t) => it(t) ? t.classList.contains(at) : !1, Sn = (t, e, n) => {
388
503
  let s = yt(
389
504
  e,
390
- un,
505
+ mn,
391
506
  n,
392
507
  t
393
508
  );
394
- const o = ke(t, n), { distance: r } = B(n);
509
+ const o = sn(t, n), { distance: r } = B(n);
395
510
  s[r] -= o;
396
- const [c, l] = dn(n, e);
511
+ const [c, l] = Dn(n, e);
397
512
  return s[l] = c, s;
398
- }, dn = (t, e) => {
513
+ }, Dn = (t, e) => {
399
514
  const n = t == V ? tt : V, { distance: s, getRect: o } = B(n);
400
515
  return [
401
516
  o(e)[s],
402
517
  s
403
518
  ];
404
519
  }, ht = (t, e, n) => {
405
- Ne(t, e, n), t.style.minWidth = `${n}px`;
406
- }, gn = (t, e, n) => (s) => {
520
+ Pe(t, e, n), t.style.minWidth = `${n}px`;
521
+ }, vn = (t, e, n) => (s) => {
407
522
  e.contains(t) && (ht(t, n.height, n.width), s.disconnect());
408
- }, pn = (t, e) => {
523
+ }, bn = (t, e) => {
409
524
  if (!e)
410
525
  return;
411
- const { droppable: n, config: s, scroll: o } = t, { direction: r } = s, c = ln(s.direction, n, o) > 0.99, { scrollDistance: l, clientDistance: f, scrollElement: g } = B(r);
526
+ const { droppable: n, config: s, scroll: o } = t, { direction: r } = s, c = Ze(s.direction, n, o) > 0.99, { scrollDistance: l, clientDistance: f, scrollElement: g } = B(r);
412
527
  c && (n[g] = n[l] - n[f]);
413
528
  }, he = (t, e, n, s) => {
414
529
  if (!n)
415
530
  return;
416
531
  const { droppable: o, config: r } = n, { direction: c, animationDuration: l } = r;
417
- if (pn(n, e), o.querySelector(`.${at}`) || !t)
532
+ if (bn(n, e), o.querySelector(`.${at}`) || !t)
418
533
  return;
419
534
  var f = t.tagName == "LI" ? "DIV" : t.tagName, g = document.createElement(f);
420
535
  st(g, at), ht(g, 0, 0);
421
- const m = fn(o, t, c);
536
+ const m = Sn(o, t, c);
422
537
  return Pt(
423
538
  g,
424
539
  l,
@@ -431,20 +546,20 @@ const en = (t, e, n) => {
431
546
  return;
432
547
  const [c, l, f] = r;
433
548
  e.isSameNode(f) && ht(c, l.height, l.width), kt(
434
- gn(c, f, l),
549
+ vn(c, f, l),
435
550
  f,
436
551
  {
437
552
  childList: !0,
438
553
  subtree: !0
439
554
  }
440
555
  ), f.appendChild(c);
441
- }, hn = (t, e, n) => {
556
+ }, Tn = (t, e, n) => {
442
557
  const s = he(t, e, n);
443
558
  if (!s)
444
559
  return;
445
560
  const [o, r, c] = s;
446
- c.appendChild(o), mn(o, r);
447
- }, mn = (t, e) => requestAnimationFrame(() => {
561
+ c.appendChild(o), En(o, r);
562
+ }, En = (t, e) => requestAnimationFrame(() => {
448
563
  ht(t, e.height, e.width), requestAnimationFrame(() => {
449
564
  Pt(
450
565
  t,
@@ -453,7 +568,7 @@ const en = (t, e, n) => {
453
568
  "width, min-width, height"
454
569
  );
455
570
  });
456
- }), Sn = (t, e, n, s, o = !0) => {
571
+ }), yn = (t, e, n, s, o = !0) => {
457
572
  if (n) {
458
573
  var r = document.querySelectorAll(
459
574
  `${gt(n)} > .${at}`
@@ -476,8 +591,8 @@ const en = (t, e, n) => {
476
591
  t.contains(r) && t.removeChild(r);
477
592
  }, e + pe)) : t.removeChild(o);
478
593
  });
479
- }, Dn = 50;
480
- function vn(t, e, n, s, o, r) {
594
+ }, Cn = 50;
595
+ function An(t, e, n, s, o, r) {
481
596
  let c = e;
482
597
  const {
483
598
  direction: l,
@@ -495,7 +610,7 @@ function vn(t, e, n, s, o, r) {
495
610
  v.direction,
496
611
  T
497
612
  );
498
- ze(a) ? Z(
613
+ tn(a) ? Z(
499
614
  u,
500
615
  a,
501
616
  A,
@@ -570,7 +685,7 @@ function vn(t, e, n, s, o, r) {
570
685
  ), a === fe ? P(x, h) : a === Nt && X(x, h);
571
686
  }
572
687
  }, R = (u, a, h, D) => {
573
- const { before: C, distance: T, axis: v, getRect: A } = B(u), N = A(a), x = A(h), G = N[C], K = x[C], mt = x[T], ft = K + mt / 2, St = Be(h)[v], rt = ft - St;
688
+ const { before: C, distance: T, axis: v, getRect: A } = B(u), N = A(a), x = A(h), G = N[C], K = x[C], mt = x[T], ft = K + mt / 2, St = Re(h)[v], rt = ft - St;
574
689
  return G > rt ? { height: 0, width: 0 } : D;
575
690
  }, w = (u, a, h, D) => {
576
691
  const C = D.filter(
@@ -603,7 +718,7 @@ function vn(t, e, n, s, o, r) {
603
718
  ft,
604
719
  St
605
720
  );
606
- const $t = xe(), xt = tn(
721
+ const $t = Be(), xt = ln(
607
722
  N.direction,
608
723
  K,
609
724
  G,
@@ -668,7 +783,7 @@ function vn(t, e, n, s, o, r) {
668
783
  }, q = (u) => {
669
784
  setTimeout(() => {
670
785
  Ct(u, M);
671
- }, Dn);
786
+ }, Cn);
672
787
  }, J = (u, a, h, D) => {
673
788
  setTimeout(() => {
674
789
  D && D(), I(a, h), z(h), et(u), W(u, a), W(u, h);
@@ -708,7 +823,7 @@ function vn(t, e, n, s, o, r) {
708
823
  ot
709
824
  ];
710
825
  }
711
- const bn = (t) => t.addedNodes.values().filter((n) => !qt(n)).toArray().length > 0, me = (t, e, n) => {
826
+ const xn = (t) => t.addedNodes.values().filter((n) => !qt(n)).toArray().length > 0, me = (t, e, n) => {
712
827
  const { insertingFromClass: s, animationDuration: o } = n, r = kt(() => {
713
828
  const l = ie(e)[t];
714
829
  st(l, s), st(l, Kt), setTimeout(() => {
@@ -716,7 +831,7 @@ const bn = (t) => t.addedNodes.values().filter((n) => !qt(n)).toArray().length >
716
831
  }, o);
717
832
  }, e, {
718
833
  childList: !0
719
- }, bn);
834
+ }, xn);
720
835
  }, Nn = (t, e, n, s) => {
721
836
  if (!e)
722
837
  return;
@@ -724,121 +839,6 @@ const bn = (t) => t.addedNodes.values().filter((n) => !qt(n)).toArray().length >
724
839
  setTimeout(() => {
725
840
  o(n, s), me(n, e, t);
726
841
  }, r);
727
- }, Tn = (t, e) => {
728
- const n = (l, f) => t.removeAtEvent(l, f), s = (l, f, g) => t.insertEvent(l, f, g), o = () => t.getLength(), r = (l) => t.getValue(l), c = (l) => l;
729
- return {
730
- direction: (e == null ? void 0 : e.direction) ?? tt,
731
- handlerSelector: (e == null ? void 0 : e.handlerSelector) ?? U,
732
- draggingClass: (e == null ? void 0 : e.draggingClass) ?? "dragging",
733
- droppableClass: (e == null ? void 0 : e.droppableClass) ?? "droppable-hover",
734
- isDraggable: (e == null ? void 0 : e.isDraggable) ?? (() => !0),
735
- onDragStart: (e == null ? void 0 : e.onDragStart) ?? (() => {
736
- }),
737
- onDragEnd: (e == null ? void 0 : e.onDragEnd) ?? (() => {
738
- }),
739
- droppableGroup: e == null ? void 0 : e.droppableGroup,
740
- onRemoveAtEvent: n,
741
- onInsertEvent: s,
742
- onGetLegth: o,
743
- onGetValue: r,
744
- animationDuration: (e == null ? void 0 : e.animationDuration) ?? 200,
745
- removingClass: (e == null ? void 0 : e.removingClass) ?? "removing",
746
- insertingFromClass: (e == null ? void 0 : e.insertingFromClass) ?? "from-inserting",
747
- delayBeforeRemove: (e == null ? void 0 : e.delayBeforeRemove) ?? 200,
748
- delayBeforeInsert: (e == null ? void 0 : e.delayBeforeInsert) ?? 200,
749
- mapFrom: (e == null ? void 0 : e.mapFrom) ?? c
750
- };
751
- }, En = (t, e) => {
752
- const { config: n, droppable: s } = t, { onInsertEvent: o, onDragEnd: r } = n;
753
- return {
754
- ...n,
755
- onDragEnd: (f) => {
756
- const { index: g, value: m } = f;
757
- r({ index: g, value: e(m, s) });
758
- },
759
- onInsertEvent: (f, g) => o(f, e(g, s), !0)
760
- };
761
- }, yn = (t) => {
762
- let e = { offsetX: 0, offsetY: 0 }, n = { top: 0, left: 0 }, s = { x: 0, y: 0 };
763
- const o = (f) => {
764
- t.style.transform = `translate( ${f.x}px, ${f.y}px)`;
765
- }, r = (f) => {
766
- t.style.top = `${f.top}px`, t.style.left = `${f.left}px`;
767
- };
768
- return [
769
- (f, g, m, b) => {
770
- const M = (y) => {
771
- const {
772
- beforeMargin: p,
773
- borderBeforeWidth: E,
774
- before: R,
775
- offset: w,
776
- scroll: P,
777
- page: X,
778
- inner: Z,
779
- distance: _,
780
- axis: H,
781
- getRect: $
782
- } = B(y), k = m[X], q = window[P], J = window[Z], I = $(f)[_], z = L(f, E), W = L(f, p), Y = k - e[w], et = ce(f, y);
783
- if (Y >= q - I / 2 && Y <= q + J) {
784
- const ot = Y - n[R] - z - W - q - et;
785
- return O(y), ot;
786
- }
787
- return s[H];
788
- }, O = (y) => {
789
- if (f && nt(f, Ft) && y === b) {
790
- const { before: p, distance: E, axis: R, getRect: w } = B(b), P = w(f)[E], X = w(g), Z = n[p] - X[p] + s[R], H = X[E] - P, $ = Z / H, k = P / H, q = 0.1, J = 0.2, I = 0.8;
791
- let z = 0;
792
- const W = pt(f, g);
793
- !W && $ < J && $ > -k ? z = $ / J - 1 : !W && $ > I && $ < 1 + k && (z = 1 / (1 - I) * ($ - I));
794
- const Y = q * P * z;
795
- an(g, b, Y);
796
- }
797
- }, F = (y) => {
798
- const { axis: p } = B(y);
799
- s[p] = M(y), o(s);
800
- };
801
- F(V), F(tt);
802
- },
803
- (f, g) => {
804
- const [m, b, M, O] = xn(
805
- f,
806
- g,
807
- t
808
- );
809
- n = {
810
- top: m,
811
- left: b
812
- }, r(n), e = { offsetX: M, offsetY: O };
813
- }
814
- ];
815
- }, Rt = (t, e, n) => {
816
- const { borderBeforeWidth: s, before: o, getRect: r } = B(t);
817
- return r(e)[o] - r(n)[o] - L(n, s);
818
- }, Cn = (t, e) => {
819
- let { offsetX: n, offsetY: s, target: o } = t, r = An(o, e);
820
- const c = o;
821
- return c && r && !c.isSameNode(r) && (n += Rt(V, c, r), s += Rt(tt, c, r)), r && e != o && (n += Rt(V, r, e), s += Rt(tt, r, e)), [n, s];
822
- }, An = (t, e) => {
823
- const n = t == null ? void 0 : t.closest(`.${Lt}`);
824
- return n && n.isSameNode(e) ? t : n;
825
- }, se = (t, e, n, s) => {
826
- const { offset: o, beforeMargin: r, page: c, borderBeforeWidth: l, scroll: f } = B(t), g = ce(n, t);
827
- return e[c] - s[o] - L(n, r) - L(n, l) - window[f] - g;
828
- }, xn = (t, e, n) => {
829
- const [s, o] = Cn(t, n);
830
- return [
831
- se(tt, t, e, {
832
- offsetX: s,
833
- offsetY: o
834
- }),
835
- se(V, t, e, {
836
- offsetX: s,
837
- offsetY: o
838
- }),
839
- s,
840
- o
841
- ];
842
842
  }, Q = class Q {
843
843
  static addConfig(e, n) {
844
844
  const s = Q.configs.filter(
@@ -853,7 +853,7 @@ const bn = (t) => t.addedNodes.values().filter((n) => !qt(n)).toArray().length >
853
853
  static updateScrolls(e, n) {
854
854
  for (const s of Q.configs) {
855
855
  const { droppable: o } = s;
856
- (n && Ce(o, n) || o.isSameNode(e)) && (s.scroll = Ut(o));
856
+ (n && xe(o, n) || o.isSameNode(e)) && (s.scroll = Ut(o));
857
857
  }
858
858
  }
859
859
  static getConfig(e) {
@@ -925,7 +925,7 @@ class wn {
925
925
  if (n)
926
926
  return e.isSameNode(this.parent) ? n : {
927
927
  ...n,
928
- config: En(n, this.mapFrom)
928
+ config: Ae(n, this.mapFrom)
929
929
  };
930
930
  }
931
931
  getCurrentConfig(e) {
@@ -965,7 +965,7 @@ function Bn(t, e, n, s, o) {
965
965
  scrollX: 0,
966
966
  scrollY: 0
967
967
  }, R = { pageX: 0, pageY: 0 }, w, P;
968
- const [X, Z] = yn(
968
+ const [X, Z] = ke(
969
969
  t
970
970
  ), [
971
971
  _,
@@ -973,7 +973,7 @@ function Bn(t, e, n, s, o) {
973
973
  $,
974
974
  k,
975
975
  q
976
- ] = vn(
976
+ ] = An(
977
977
  n,
978
978
  e,
979
979
  s,
@@ -1060,7 +1060,7 @@ function Bn(t, e, n, s, o) {
1060
1060
  if (!a.current)
1061
1061
  return;
1062
1062
  const { droppable: d } = a.current;
1063
- Sn(
1063
+ yn(
1064
1064
  d,
1065
1065
  s,
1066
1066
  y,
@@ -1198,7 +1198,7 @@ function Bn(t, e, n, s, o) {
1198
1198
  s,
1199
1199
  d,
1200
1200
  () => {
1201
- hn(
1201
+ Tn(
1202
1202
  t,
1203
1203
  p == 1,
1204
1204
  a.initial
@@ -1209,9 +1209,9 @@ function Bn(t, e, n, s, o) {
1209
1209
  return W(), et(t), [ve, be];
1210
1210
  }
1211
1211
  const Mn = (t, e) => {
1212
- t && Ae(e, t);
1212
+ t && we(e, t);
1213
1213
  }, Rn = () => {
1214
- Ve(document.body, [
1214
+ He(document.body, [
1215
1215
  `.${U}{touch-action:manipulation;user-select:none;box-sizing:border-box!important;-webkit-user-select:none;}`,
1216
1216
  `.${Lt}{pointer-events:auto!important;}`,
1217
1217
  `.${ye}{cursor:grab;}`,
@@ -1236,7 +1236,7 @@ function Ln(t, e, n, s = "index") {
1236
1236
  const f = At(l).map((g) => `droppable-group-${g}`).join(" ");
1237
1237
  Rn(), Mn(f, n);
1238
1238
  for (const g of n.children) {
1239
- const m = g.getAttribute(o), b = we(m), M = g;
1239
+ const m = g.getAttribute(o), b = Me(m), M = g;
1240
1240
  if (M && b >= 0) {
1241
1241
  const [O, F] = Bn(
1242
1242
  M,
@@ -1255,7 +1255,7 @@ function Ln(t, e, n, s = "index") {
1255
1255
  }
1256
1256
  function Fn(t, e, n, s = "index") {
1257
1257
  let o = [], r = [], c;
1258
- const l = Tn(t, n), f = (p) => {
1258
+ const l = Ce(t, n), f = (p) => {
1259
1259
  for (const E of o)
1260
1260
  E(p);
1261
1261
  }, g = (p, E) => {