@vue-dnd-kit/core 1.5.2 → 1.6.0

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.
@@ -1,256 +1,256 @@
1
1
  var pe = Object.defineProperty;
2
2
  var he = (n, t, e) => t in n ? pe(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
- var Z = (n, t, e) => he(n, typeof t != "symbol" ? t + "" : t, e);
4
- import { shallowRef as S, ref as U, computed as k, onMounted as J, onUnmounted as ye, defineComponent as fe, createElementBlock as q, createCommentVNode as Ee, unref as w, openBlock as H, normalizeStyle as re, Fragment as ae, renderList as we, createBlock as G, resolveDynamicComponent as j, Transition as xe, withCtx as Pe, normalizeProps as le, guardReactiveProps as Me, mergeProps as Ae, createVNode as Le, render as se, useId as ze, onBeforeUnmount as ge } from "vue";
5
- import { createGlobalState as me, useMagicKeys as Ce, useThrottleFn as Ie } from "@vueuse/core";
6
- const L = class L {
3
+ var Y = (n, t, e) => he(n, typeof t != "symbol" ? t + "" : t, e);
4
+ import { shallowRef as D, ref as X, computed as O, onMounted as te, onUnmounted as ye, defineComponent as fe, createElementBlock as j, createCommentVNode as Ee, unref as M, openBlock as N, normalizeStyle as re, Fragment as ae, renderList as we, createBlock as J, resolveDynamicComponent as ee, Transition as Me, withCtx as xe, normalizeProps as le, guardReactiveProps as Pe, mergeProps as Ae, createVNode as Le, render as se, useId as be, onBeforeUnmount as ge } from "vue";
5
+ import { createGlobalState as me, useMagicKeys as Ie, useThrottleFn as ze } from "@vueuse/core";
6
+ const P = class P {
7
7
  };
8
- Z(L, "remove", (t, e) => {
8
+ Y(P, "remove", (t, e) => {
9
9
  if (!t || e === void 0) return;
10
- const [a] = t.splice(e, 1);
11
- return a;
12
- }), Z(L, "insert", (t, e, a) => {
13
- !t || e === void 0 || t.splice(e, 0, a);
14
- }), Z(L, "move", (t, e, a, l) => {
15
- if (!t || !a || e === void 0 || l === void 0)
10
+ const [r] = t.splice(e, 1);
11
+ return r;
12
+ }), Y(P, "insert", (t, e, r) => {
13
+ !t || e === void 0 || t.splice(e, 0, r);
14
+ }), Y(P, "move", (t, e, r, l) => {
15
+ if (!t || !r || e === void 0 || l === void 0)
16
16
  return;
17
- const s = L.remove(t, e);
18
- L.insert(a, l, s);
19
- }), Z(L, "swap", (t, e, a, l) => {
20
- if (!t || !a || e === void 0 || l === void 0)
17
+ const s = P.remove(t, e);
18
+ P.insert(r, l, s);
19
+ }), Y(P, "swap", (t, e, r, l) => {
20
+ if (!t || !r || e === void 0 || l === void 0)
21
21
  return;
22
- const s = t[e], i = a[l];
23
- t[e] = i, a[l] = s;
24
- }), Z(L, "copy", (t, e, a, l) => {
25
- if (!t || e === void 0 || !a || l === void 0)
22
+ const s = t[e], i = r[l];
23
+ t[e] = i, r[l] = s;
24
+ }), Y(P, "copy", (t, e, r, l) => {
25
+ if (!t || e === void 0 || !r || l === void 0)
26
26
  return;
27
27
  const s = t[e];
28
- L.insert(a, l, s);
29
- }), Z(L, "applyTransfer", (t) => {
30
- var l, s, i, f, o, u, v;
31
- const e = t.hovered.element.value, a = t.hovered.zone.value;
28
+ P.insert(r, l, s);
29
+ }), Y(P, "applyTransfer", (t) => {
30
+ var l, s, i, g, o, u, d;
31
+ const e = t.hovered.element.value, r = t.hovered.zone.value;
32
32
  if (e) {
33
- const g = (s = (l = t.elementsMap.value.get(e)) == null ? void 0 : l.data) == null ? void 0 : s.source, r = (f = (i = t.elementsMap.value.get(e)) == null ? void 0 : i.data) == null ? void 0 : f.index, d = t.draggingElements.value.values().next().value, c = (o = d == null ? void 0 : d.data) == null ? void 0 : o.index, p = c !== void 0 && r !== void 0 && c > r ? 1 : -1;
33
+ const f = (s = (l = t.elementsMap.value.get(e)) == null ? void 0 : l.data) == null ? void 0 : s.source, a = (g = (i = t.elementsMap.value.get(e)) == null ? void 0 : i.data) == null ? void 0 : g.index, c = t.draggingElements.value.values().next().value, v = (o = c == null ? void 0 : c.data) == null ? void 0 : o.index, m = v !== void 0 && a !== void 0 && v > a ? 1 : -1;
34
34
  Array.from(
35
35
  t.draggingElements.value.values()
36
36
  ).sort(
37
- (y, P) => {
38
- var z, M;
39
- return p * ((((z = y.data) == null ? void 0 : z.index) || 0) - (((M = P.data) == null ? void 0 : M.index) || 0));
37
+ (p, z) => {
38
+ var L, I;
39
+ return m * ((((L = p.data) == null ? void 0 : L.index) || 0) - (((I = z.data) == null ? void 0 : I.index) || 0));
40
40
  }
41
41
  ).forEach(
42
- (y) => {
43
- var P, z;
44
- return L.move(
45
- (P = y.data) == null ? void 0 : P.source,
46
- (z = y.data) == null ? void 0 : z.index,
47
- g,
48
- r
42
+ (p) => {
43
+ var z, L;
44
+ return P.move(
45
+ (z = p.data) == null ? void 0 : z.source,
46
+ (L = p.data) == null ? void 0 : L.index,
47
+ f,
48
+ a
49
49
  );
50
50
  }
51
51
  );
52
- } else if (a) {
53
- const g = (v = (u = t.zonesMap.value.get(a)) == null ? void 0 : u.data) == null ? void 0 : v.source, r = g == null ? void 0 : g.length;
52
+ } else if (r) {
53
+ const f = (d = (u = t.zonesMap.value.get(r)) == null ? void 0 : u.data) == null ? void 0 : d.source, a = f == null ? void 0 : f.length;
54
54
  Array.from(
55
55
  t.draggingElements.value.values()
56
- ).sort((c, p) => {
57
- var m, y;
58
- return (((m = p.data) == null ? void 0 : m.index) || 0) - (((y = c.data) == null ? void 0 : y.index) || 0);
56
+ ).sort((v, m) => {
57
+ var E, p;
58
+ return (((E = m.data) == null ? void 0 : E.index) || 0) - (((p = v.data) == null ? void 0 : p.index) || 0);
59
59
  }).forEach(
60
- (c) => {
61
- var p, m;
62
- return L.move(
63
- (p = c.data) == null ? void 0 : p.source,
64
- (m = c.data) == null ? void 0 : m.index,
65
- g,
66
- r
60
+ (v) => {
61
+ var m, E;
62
+ return P.move(
63
+ (m = v.data) == null ? void 0 : m.source,
64
+ (E = v.data) == null ? void 0 : E.index,
65
+ f,
66
+ a
67
67
  );
68
68
  }
69
69
  );
70
70
  }
71
- }), Z(L, "applyCopy", (t) => {
72
- var l, s, i, f, o, u;
73
- const e = t.hovered.element.value, a = t.hovered.zone.value;
71
+ }), Y(P, "applyCopy", (t) => {
72
+ var l, s, i, g, o, u;
73
+ const e = t.hovered.element.value, r = t.hovered.zone.value;
74
74
  if (e) {
75
- const v = (s = (l = t.elementsMap.value.get(e)) == null ? void 0 : l.data) == null ? void 0 : s.source, g = (f = (i = t.elementsMap.value.get(e)) == null ? void 0 : i.data) == null ? void 0 : f.index;
75
+ const d = (s = (l = t.elementsMap.value.get(e)) == null ? void 0 : l.data) == null ? void 0 : s.source, f = (g = (i = t.elementsMap.value.get(e)) == null ? void 0 : i.data) == null ? void 0 : g.index;
76
76
  Array.from(
77
77
  t.draggingElements.value.values()
78
- ).sort((d, c) => {
79
- var p, m;
80
- return (((p = c.data) == null ? void 0 : p.index) || 0) - (((m = d.data) == null ? void 0 : m.index) || 0);
78
+ ).sort((c, v) => {
79
+ var m, E;
80
+ return (((m = v.data) == null ? void 0 : m.index) || 0) - (((E = c.data) == null ? void 0 : E.index) || 0);
81
81
  }).forEach(
82
- (d) => {
83
- var c, p;
84
- return L.copy(
85
- (c = d.data) == null ? void 0 : c.source,
86
- (p = d.data) == null ? void 0 : p.index,
87
- v,
88
- g
82
+ (c) => {
83
+ var v, m;
84
+ return P.copy(
85
+ (v = c.data) == null ? void 0 : v.source,
86
+ (m = c.data) == null ? void 0 : m.index,
87
+ d,
88
+ f
89
89
  );
90
90
  }
91
91
  );
92
- } else if (a) {
93
- const v = (u = (o = t.zonesMap.value.get(a)) == null ? void 0 : o.data) == null ? void 0 : u.source, g = v == null ? void 0 : v.length;
92
+ } else if (r) {
93
+ const d = (u = (o = t.zonesMap.value.get(r)) == null ? void 0 : o.data) == null ? void 0 : u.source, f = d == null ? void 0 : d.length;
94
94
  Array.from(
95
95
  t.draggingElements.value.values()
96
- ).sort((d, c) => {
97
- var p, m;
98
- return (((p = c.data) == null ? void 0 : p.index) || 0) - (((m = d.data) == null ? void 0 : m.index) || 0);
96
+ ).sort((c, v) => {
97
+ var m, E;
98
+ return (((m = v.data) == null ? void 0 : m.index) || 0) - (((E = c.data) == null ? void 0 : E.index) || 0);
99
99
  }).forEach(
100
- (d) => {
101
- var c, p;
102
- return L.copy(
103
- (c = d.data) == null ? void 0 : c.source,
104
- (p = d.data) == null ? void 0 : p.index,
105
- v,
106
- g
100
+ (c) => {
101
+ var v, m;
102
+ return P.copy(
103
+ (v = c.data) == null ? void 0 : v.source,
104
+ (m = c.data) == null ? void 0 : m.index,
105
+ d,
106
+ f
107
107
  );
108
108
  }
109
109
  );
110
110
  }
111
- }), Z(L, "applySwap", (t) => {
112
- var l, s, i, f, o, u, v, g;
113
- const e = t.hovered.element.value, a = t.hovered.zone.value;
111
+ }), Y(P, "applySwap", (t) => {
112
+ var l, s, i, g, o, u, d, f;
113
+ const e = t.hovered.element.value, r = t.hovered.zone.value;
114
114
  if (e && t.draggingElements.value.size === 1) {
115
- const r = t.draggingElements.value.values().next().value;
116
- L.swap(
117
- (l = r == null ? void 0 : r.data) == null ? void 0 : l.source,
118
- (s = r == null ? void 0 : r.data) == null ? void 0 : s.index,
119
- (f = (i = t.elementsMap.value.get(e)) == null ? void 0 : i.data) == null ? void 0 : f.source,
115
+ const a = t.draggingElements.value.values().next().value;
116
+ P.swap(
117
+ (l = a == null ? void 0 : a.data) == null ? void 0 : l.source,
118
+ (s = a == null ? void 0 : a.data) == null ? void 0 : s.index,
119
+ (g = (i = t.elementsMap.value.get(e)) == null ? void 0 : i.data) == null ? void 0 : g.source,
120
120
  (u = (o = t.elementsMap.value.get(e)) == null ? void 0 : o.data) == null ? void 0 : u.index
121
121
  );
122
- } else if (a) {
123
- const r = (g = (v = t.zonesMap.value.get(a)) == null ? void 0 : v.data) == null ? void 0 : g.source, d = r == null ? void 0 : r.length;
122
+ } else if (r) {
123
+ const a = (f = (d = t.zonesMap.value.get(r)) == null ? void 0 : d.data) == null ? void 0 : f.source, c = a == null ? void 0 : a.length;
124
124
  Array.from(
125
125
  t.draggingElements.value.values()
126
- ).sort((p, m) => {
127
- var y, P;
128
- return (((y = m.data) == null ? void 0 : y.index) || 0) - (((P = p.data) == null ? void 0 : P.index) || 0);
126
+ ).sort((m, E) => {
127
+ var p, z;
128
+ return (((p = E.data) == null ? void 0 : p.index) || 0) - (((z = m.data) == null ? void 0 : z.index) || 0);
129
129
  }).forEach(
130
- (p) => {
131
- var m, y;
132
- return L.move(
133
- (m = p.data) == null ? void 0 : m.source,
134
- (y = p.data) == null ? void 0 : y.index,
135
- r,
136
- d
130
+ (m) => {
131
+ var E, p;
132
+ return P.move(
133
+ (E = m.data) == null ? void 0 : E.source,
134
+ (p = m.data) == null ? void 0 : p.index,
135
+ a,
136
+ c
137
137
  );
138
138
  }
139
139
  );
140
140
  }
141
- }), Z(L, "applyRemove", (t) => {
141
+ }), Y(P, "applyRemove", (t) => {
142
142
  Array.from(
143
143
  t.draggingElements.value.values()
144
- ).sort((a, l) => {
144
+ ).sort((r, l) => {
145
145
  var s, i;
146
- return (((s = l.data) == null ? void 0 : s.index) || 0) - (((i = a.data) == null ? void 0 : i.index) || 0);
147
- }).forEach((a) => {
146
+ return (((s = l.data) == null ? void 0 : s.index) || 0) - (((i = r.data) == null ? void 0 : i.index) || 0);
147
+ }).forEach((r) => {
148
148
  var l, s;
149
- (l = a.data) != null && l.source && ((s = a.data) == null ? void 0 : s.index) !== void 0 && L.remove(a.data.source, a.data.index);
149
+ (l = r.data) != null && l.source && ((s = r.data) == null ? void 0 : s.index) !== void 0 && P.remove(r.data.source, r.data.index);
150
150
  });
151
- }), Z(L, "applyInsert", (t, e) => {
152
- var s, i, f, o, u, v;
153
- const a = t.hovered.element.value, l = t.hovered.zone.value;
154
- if (a && e.length > 0) {
155
- const g = (i = (s = t.elementsMap.value.get(a)) == null ? void 0 : s.data) == null ? void 0 : i.source, r = (o = (f = t.elementsMap.value.get(a)) == null ? void 0 : f.data) == null ? void 0 : o.index;
156
- e.forEach((d) => {
157
- L.insert(g, r, d);
151
+ }), Y(P, "applyInsert", (t, e) => {
152
+ var s, i, g, o, u, d;
153
+ const r = t.hovered.element.value, l = t.hovered.zone.value;
154
+ if (r && e.length > 0) {
155
+ const f = (i = (s = t.elementsMap.value.get(r)) == null ? void 0 : s.data) == null ? void 0 : i.source, a = (o = (g = t.elementsMap.value.get(r)) == null ? void 0 : g.data) == null ? void 0 : o.index;
156
+ e.forEach((c) => {
157
+ P.insert(f, a, c);
158
158
  });
159
159
  } else if (l) {
160
- const g = (v = (u = t.zonesMap.value.get(l)) == null ? void 0 : u.data) == null ? void 0 : v.source, r = g == null ? void 0 : g.length;
161
- e.forEach((d) => {
162
- L.insert(g, r, d);
160
+ const f = (d = (u = t.zonesMap.value.get(l)) == null ? void 0 : u.data) == null ? void 0 : d.source, a = f == null ? void 0 : f.length;
161
+ e.forEach((c) => {
162
+ P.insert(f, a, c);
163
163
  });
164
164
  }
165
165
  });
166
- let oe = L;
167
- const R = me(() => {
168
- const n = S(!1), t = U(
166
+ let oe = P;
167
+ const U = me(() => {
168
+ const n = D(!1), t = X(
169
169
  /* @__PURE__ */ new Map()
170
- ), e = k(() => t.value.size > 0), a = {
171
- component: U(null),
172
- ref: S(null),
173
- options: S(null),
170
+ ), e = O(() => t.value.size > 0), r = {
171
+ component: X(null),
172
+ ref: D(null),
173
+ options: D(null),
174
174
  animating: {
175
- enter: S(!1),
176
- leave: S(!1),
177
- appear: S(!1)
175
+ enter: D(!1),
176
+ leave: D(!1),
177
+ appear: D(!1)
178
178
  }
179
- }, l = U(/* @__PURE__ */ new Map()), s = U(/* @__PURE__ */ new Set()), i = U(/* @__PURE__ */ new Map()), f = S(/* @__PURE__ */ new Set()), o = S(/* @__PURE__ */ new Set()), u = typeof window < "u" && "IntersectionObserver" in window, v = u ? new IntersectionObserver((x) => {
179
+ }, l = X(/* @__PURE__ */ new Map()), s = X(/* @__PURE__ */ new Set()), i = X(/* @__PURE__ */ new Map()), g = D(/* @__PURE__ */ new Set()), o = D(/* @__PURE__ */ new Set()), u = typeof window < "u" && "IntersectionObserver" in window, d = u ? new IntersectionObserver((x) => {
180
180
  x.forEach(
181
181
  (h) => o.value[h.isIntersecting ? "add" : "delete"](
182
182
  h.target
183
183
  )
184
184
  );
185
- }) : null, g = u ? new IntersectionObserver((x) => {
185
+ }) : null, f = u ? new IntersectionObserver((x) => {
186
186
  x.forEach(
187
- (h) => f.value[h.isIntersecting ? "add" : "delete"](
187
+ (h) => g.value[h.isIntersecting ? "add" : "delete"](
188
188
  h.target
189
189
  )
190
190
  );
191
- }) : null, r = (x, h) => {
192
- v && (x === "add" ? v.observe(h) : (v.unobserve(h), o.value.delete(h)));
193
- }, d = (x, h) => {
194
- g && (x === "add" ? g.observe(h) : (g.unobserve(h), f.value.delete(h)));
195
- }, c = {
196
- start: S(null),
197
- current: S(null),
191
+ }) : null, a = (x, h) => {
192
+ d && (x === "add" ? d.observe(h) : (d.unobserve(h), o.value.delete(h)));
193
+ }, c = (x, h) => {
194
+ f && (x === "add" ? f.observe(h) : (f.unobserve(h), g.value.delete(h)));
195
+ }, v = {
196
+ start: D(null),
197
+ current: D(null),
198
198
  offset: {
199
- percent: S(null),
200
- pixel: S(null)
199
+ percent: D(null),
200
+ pixel: D(null)
201
201
  }
202
- }, { KeyW: p, KeyS: m, KeyA: y, KeyD: P, ctrl: z, shift: M, alt: F, meta: X } = Ce(), E = {
203
- zone: S(null),
204
- element: S(null)
202
+ }, { KeyW: m, KeyS: E, KeyA: p, KeyD: z, ctrl: L, shift: I, alt: H, meta: S } = Ie(), w = {
203
+ zone: D(null),
204
+ element: D(null)
205
205
  };
206
206
  return {
207
207
  draggingElements: t,
208
208
  isDragging: e,
209
- activeContainer: a,
209
+ activeContainer: r,
210
210
  elementsMap: l,
211
211
  selectedElements: s,
212
212
  zonesMap: i,
213
- visibleZones: f,
213
+ visibleZones: g,
214
214
  visibleElements: o,
215
- pointerPosition: c,
215
+ pointerPosition: v,
216
216
  keyboard: {
217
- w: p,
218
- s: m,
219
- a: y,
220
- d: P,
221
- ctrl: z,
222
- shift: M,
223
- alt: F,
224
- meta: X
217
+ w: m,
218
+ s: E,
219
+ a: p,
220
+ d: z,
221
+ ctrl: L,
222
+ shift: I,
223
+ alt: H,
224
+ meta: S
225
225
  },
226
- hovered: E,
226
+ hovered: w,
227
227
  isPending: n,
228
- handleDragElementIntersection: r,
229
- handleDropZoneIntersection: d
228
+ handleDragElementIntersection: a,
229
+ handleDropZoneIntersection: c
230
230
  };
231
- }), Se = (n) => {
232
- const t = U(null), { draggingElements: e, pointerPosition: a, isDragging: l, activeContainer: s } = R();
233
- return J(() => {
231
+ }), Ce = (n) => {
232
+ const t = X(null), { draggingElements: e, pointerPosition: r, isDragging: l, activeContainer: s } = U();
233
+ return te(() => {
234
234
  s.ref = t, s.options.value = n ?? null;
235
235
  }), ye(() => {
236
236
  s.ref.value = null, s.options.value = null;
237
237
  }), {
238
238
  elementRef: t,
239
239
  draggingElements: e,
240
- pointerPosition: a,
240
+ pointerPosition: r,
241
241
  isDragging: l,
242
242
  animating: s.animating
243
243
  };
244
- }, De = ["innerHTML"], _e = /* @__PURE__ */ fe({
244
+ }, De = ["innerHTML"], Se = /* @__PURE__ */ fe({
245
245
  __name: "DefaultOverlay",
246
246
  props: {
247
247
  styles: {}
248
248
  },
249
249
  setup(n) {
250
- const { elementRef: t, pointerPosition: e, isDragging: a, draggingElements: l } = Se(), s = k(() => {
251
- var i, f, o, u;
250
+ const { elementRef: t, pointerPosition: e, isDragging: r, draggingElements: l } = Ce(), s = O(() => {
251
+ var i, g, o, u;
252
252
  return {
253
- transform: `translate3d(${(((i = e.current.value) == null ? void 0 : i.x) ?? 0) - (((f = e.offset.pixel.value) == null ? void 0 : f.x) ?? 0)}px, ${(((o = e.current.value) == null ? void 0 : o.y) ?? 0) - (((u = e.offset.pixel.value) == null ? void 0 : u.y) ?? 0)}px, 0)`,
253
+ transform: `translate3d(${(((i = e.current.value) == null ? void 0 : i.x) ?? 0) - (((g = e.offset.pixel.value) == null ? void 0 : g.x) ?? 0)}px, ${(((o = e.current.value) == null ? void 0 : o.y) ?? 0) - (((u = e.offset.pixel.value) == null ? void 0 : u.y) ?? 0)}px, 0)`,
254
254
  zIndex: 1e3,
255
255
  position: "fixed",
256
256
  top: 0,
@@ -259,29 +259,29 @@ const R = me(() => {
259
259
  ...n.styles
260
260
  };
261
261
  });
262
- return (i, f) => w(a) ? (H(), q("div", {
262
+ return (i, g) => M(r) ? (N(), j("div", {
263
263
  key: 0,
264
264
  ref_key: "elementRef",
265
265
  ref: t,
266
266
  style: re(s.value)
267
267
  }, [
268
- (H(!0), q(ae, null, we(w(l), ([o, u]) => {
269
- var v, g;
270
- return H(), q(ae, {
268
+ (N(!0), j(ae, null, we(M(l), ([o, u]) => {
269
+ var d, f;
270
+ return N(), j(ae, {
271
271
  key: u.id
272
272
  }, [
273
- u.layer ? (H(), G(j(u.layer), {
273
+ u.layer ? (N(), J(ee(u.layer), {
274
274
  key: 0,
275
275
  node: o,
276
276
  data: u.data,
277
277
  id: u.id,
278
278
  groups: u.groups
279
- }, null, 8, ["node", "data", "id", "groups"])) : (H(), q("div", {
279
+ }, null, 8, ["node", "data", "id", "groups"])) : (N(), j("div", {
280
280
  key: 1,
281
281
  innerHTML: u.initialHTML,
282
282
  style: re({
283
- width: `${(v = u.initialRect) == null ? void 0 : v.width}px`,
284
- height: `${(g = u.initialRect) == null ? void 0 : g.height}px`
283
+ width: `${(d = u.initialRect) == null ? void 0 : d.width}px`,
284
+ height: `${(f = u.initialRect) == null ? void 0 : f.height}px`
285
285
  })
286
286
  }, null, 12, De))
287
287
  ], 64);
@@ -294,72 +294,72 @@ const R = me(() => {
294
294
  styles: {}
295
295
  },
296
296
  setup(n) {
297
- const t = n, { activeContainer: e } = R(), a = k(() => ({
298
- component: e.component.value ?? _e,
297
+ const t = n, { activeContainer: e } = U(), r = O(() => ({
298
+ component: e.component.value ?? Se,
299
299
  props: t
300
300
  }));
301
- return (l, s) => w(e).options.value ? (H(), G(xe, {
301
+ return (l, s) => M(e).options.value ? (N(), J(Me, {
302
302
  key: 0,
303
- name: w(e).options.value.name,
304
- duration: w(e).options.value.duration,
305
- "enter-from-class": w(e).options.value.enterFromClass,
306
- "enter-to-class": w(e).options.value.enterToClass,
307
- "enter-active-class": w(e).options.value.enterActiveClass,
308
- "leave-from-class": w(e).options.value.leaveFromClass,
309
- "leave-to-class": w(e).options.value.leaveToClass,
310
- "leave-active-class": w(e).options.value.leaveActiveClass,
311
- "appear-active-class": w(e).options.value.appearActiveClass,
312
- "appear-from-class": w(e).options.value.appearFromClass,
313
- "appear-to-class": w(e).options.value.appearToClass,
314
- mode: w(e).options.value.mode,
315
- type: w(e).options.value.type,
316
- css: w(e).options.value.css,
303
+ name: M(e).options.value.name,
304
+ duration: M(e).options.value.duration,
305
+ "enter-from-class": M(e).options.value.enterFromClass,
306
+ "enter-to-class": M(e).options.value.enterToClass,
307
+ "enter-active-class": M(e).options.value.enterActiveClass,
308
+ "leave-from-class": M(e).options.value.leaveFromClass,
309
+ "leave-to-class": M(e).options.value.leaveToClass,
310
+ "leave-active-class": M(e).options.value.leaveActiveClass,
311
+ "appear-active-class": M(e).options.value.appearActiveClass,
312
+ "appear-from-class": M(e).options.value.appearFromClass,
313
+ "appear-to-class": M(e).options.value.appearToClass,
314
+ mode: M(e).options.value.mode,
315
+ type: M(e).options.value.type,
316
+ css: M(e).options.value.css,
317
317
  appear: !0,
318
- persisted: w(e).options.value.persisted,
319
- onEnter: w(e).options.value.onEnter,
320
- onLeave: w(e).options.value.onLeave,
321
- onBeforeEnter: w(e).options.value.onBeforeEnter,
322
- onBeforeLeave: w(e).options.value.onBeforeLeave,
323
- onBeforeAppear: w(e).options.value.onBeforeAppear,
324
- onAfterEnter: w(e).options.value.onAfterEnter,
325
- onAfterLeave: w(e).options.value.onAfterLeave,
326
- onAfterAppear: w(e).options.value.onAfterAppear
318
+ persisted: M(e).options.value.persisted,
319
+ onEnter: M(e).options.value.onEnter,
320
+ onLeave: M(e).options.value.onLeave,
321
+ onBeforeEnter: M(e).options.value.onBeforeEnter,
322
+ onBeforeLeave: M(e).options.value.onBeforeLeave,
323
+ onBeforeAppear: M(e).options.value.onBeforeAppear,
324
+ onAfterEnter: M(e).options.value.onAfterEnter,
325
+ onAfterLeave: M(e).options.value.onAfterLeave,
326
+ onAfterAppear: M(e).options.value.onAfterAppear
327
327
  }, {
328
- default: Pe(() => [
329
- (H(), G(j(a.value.component || a.value), le(Me(a.value.props || {})), null, 16))
328
+ default: xe(() => [
329
+ (N(), J(ee(r.value.component || r.value), le(Pe(r.value.props || {})), null, 16))
330
330
  ]),
331
331
  _: 1
332
- }, 8, ["name", "duration", "enter-from-class", "enter-to-class", "enter-active-class", "leave-from-class", "leave-to-class", "leave-active-class", "appear-active-class", "appear-from-class", "appear-to-class", "mode", "type", "css", "persisted", "onEnter", "onLeave", "onBeforeEnter", "onBeforeLeave", "onBeforeAppear", "onAfterEnter", "onAfterLeave", "onAfterAppear"])) : (H(), G(j(a.value.component || a.value), le(Ae({ key: 1 }, a.value.props || {})), null, 16));
332
+ }, 8, ["name", "duration", "enter-from-class", "enter-to-class", "enter-active-class", "leave-from-class", "leave-to-class", "leave-active-class", "appear-active-class", "appear-from-class", "appear-to-class", "mode", "type", "css", "persisted", "onEnter", "onLeave", "onBeforeEnter", "onBeforeLeave", "onBeforeAppear", "onAfterEnter", "onAfterLeave", "onAfterAppear"])) : (N(), J(ee(r.value.component || r.value), le(Ae({ key: 1 }, r.value.props || {})), null, 16));
333
333
  }
334
334
  }), Be = {
335
335
  install(n, t) {
336
336
  n.component("DragOverlay", ie);
337
337
  const e = n.mount;
338
338
  n.mount = function(l) {
339
- var f;
339
+ var g;
340
340
  const s = e.call(this, l), i = typeof l == "string" ? document.querySelector(l) : l;
341
341
  if (i && i instanceof Element && !i.querySelector("#vue-dnd-kit-overlay")) {
342
342
  const o = document.createElement("div");
343
343
  o.id = "vue-dnd-kit-overlay", o.style.pointerEvents = "none", i.appendChild(o);
344
344
  const u = Le(ie, {
345
- styles: (f = t == null ? void 0 : t.defaultOverlay) == null ? void 0 : f.styles
345
+ styles: (g = t == null ? void 0 : t.defaultOverlay) == null ? void 0 : g.styles
346
346
  });
347
347
  se(u, o), n.__VUE_DND_KIT_OVERLAY__ = {
348
348
  container: o,
349
349
  vnode: u,
350
350
  options: (t == null ? void 0 : t.defaultOverlay) || {}
351
351
  };
352
- const v = R();
353
- n.__VUE_DND_KIT_STORE__ = v;
352
+ const d = U();
353
+ n.__VUE_DND_KIT_STORE__ = d;
354
354
  }
355
355
  return s;
356
356
  };
357
- const a = n.unmount;
357
+ const r = n.unmount;
358
358
  n.unmount = function() {
359
- return n.__VUE_DND_KIT_OVERLAY__ && (se(null, n.__VUE_DND_KIT_OVERLAY__.container), delete n.__VUE_DND_KIT_OVERLAY__), a.call(this);
359
+ return n.__VUE_DND_KIT_OVERLAY__ && (se(null, n.__VUE_DND_KIT_OVERLAY__.container), delete n.__VUE_DND_KIT_OVERLAY__), r.call(this);
360
360
  };
361
361
  }
362
- }, ue = (n, t) => n.x < t.x + t.width && n.x + n.width > t.x && n.y < t.y + t.height && n.y + n.height > t.y, B = (n) => {
362
+ }, ue = (n, t) => n.x < t.x + t.width && n.x + n.width > t.x && n.y < t.y + t.height && n.y + n.height > t.y, q = (n) => {
363
363
  if (!n)
364
364
  return {
365
365
  x: 0,
@@ -382,11 +382,11 @@ const R = me(() => {
382
382
  width: t.width,
383
383
  height: t.height
384
384
  };
385
- }, W = (n) => ({
385
+ }, Q = (n) => ({
386
386
  x: n.x + n.width / 2,
387
387
  y: n.y + n.height / 2
388
- }), be = (n, t) => {
389
- const e = B(n);
388
+ }), _e = (n, t) => {
389
+ const e = q(n);
390
390
  return {
391
391
  pixel: {
392
392
  x: t.x - e.x,
@@ -398,44 +398,44 @@ const R = me(() => {
398
398
  }
399
399
  };
400
400
  }, ce = (n, t) => {
401
- const e = t.x - n.x, a = t.y - n.y;
402
- return Math.sqrt(e * e + a * a);
401
+ const e = t.x - n.x, r = t.y - n.y;
402
+ return Math.sqrt(e * e + r * r);
403
403
  }, ve = (n, t) => {
404
404
  const e = Math.max(
405
405
  0,
406
406
  Math.min(n.x + n.width, t.x + t.width) - Math.max(n.x, t.x)
407
- ), a = Math.max(
407
+ ), r = Math.max(
408
408
  0,
409
409
  Math.min(n.y + n.height, t.y + t.height) - Math.max(n.y, t.y)
410
- ), l = e * a, s = n.width * n.height, i = t.width * t.height;
410
+ ), l = e * r, s = n.width * n.height, i = t.width * t.height;
411
411
  return (l / s * 100 + l / i * 100) / 2;
412
- }, de = "data-vue-dnd-kit-draggable", b = (n) => {
412
+ }, de = "data-vue-dnd-kit-draggable", Z = (n) => {
413
413
  n.preventDefault();
414
- }, Y = (n) => ({
414
+ }, F = (n) => ({
415
415
  items: Array.from(n.draggingElements.value.values())
416
416
  }), ke = (n) => {
417
417
  const {
418
418
  elementsMap: t,
419
419
  draggingElements: e,
420
- hovered: a,
420
+ hovered: r,
421
421
  selectedElements: l,
422
422
  isDragging: s,
423
423
  visibleElements: i,
424
- handleDragElementIntersection: f
425
- } = R(), o = U(null), u = k(() => a.element.value === o.value), v = S((n == null ? void 0 : n.id) || ze()), g = k(() => !o.value || !t.value.has(o.value) ? !1 : e.value.has(o.value)), r = k(() => {
426
- if (!o.value || !s.value || !i.value.has(o.value)) return !1;
427
- const m = t.value.get(o.value);
428
- return m != null && m.groups.length ? !Array.from(e.value.entries()).some(
429
- ([y, P]) => P.groups.length ? !P.groups.some(
430
- (z) => m.groups.includes(z)
424
+ handleDragElementIntersection: g
425
+ } = U(), o = X(null), u = O(() => r.element.value === o.value), d = D((n == null ? void 0 : n.id) || be()), f = D((n == null ? void 0 : n.disabled) ?? !1), a = O(() => f.value || !o.value || !t.value.has(o.value) ? !1 : e.value.has(o.value)), c = O(() => {
426
+ if (f.value || !o.value || !s.value || !i.value.has(o.value)) return !1;
427
+ const p = t.value.get(o.value);
428
+ return p != null && p.groups.length ? !Array.from(e.value.entries()).some(
429
+ ([z, L]) => L.groups.length ? !L.groups.some(
430
+ (I) => p.groups.includes(I)
431
431
  ) : !1
432
432
  ) : !0;
433
- }), d = k(() => {
434
- if (!o.value || !s.value || !i.value.has(o.value) || a.element.value !== o.value) return !1;
435
- const m = t.value.get(o.value);
436
- return m != null && m.groups.length ? !Array.from(e.value.entries()).some(
437
- ([y, P]) => P.groups.length ? !P.groups.some(
438
- (z) => m.groups.includes(z)
433
+ }), v = O(() => {
434
+ if (f.value || !o.value || !s.value || !i.value.has(o.value) || r.element.value !== o.value) return !1;
435
+ const p = t.value.get(o.value);
436
+ return p != null && p.groups.length ? !Array.from(e.value.entries()).some(
437
+ ([z, L]) => L.groups.length ? !L.groups.some(
438
+ (I) => p.groups.includes(I)
439
439
  ) : !1
440
440
  ) : !0;
441
441
  });
@@ -450,93 +450,94 @@ const R = me(() => {
450
450
  defaultLayer: (n == null ? void 0 : n.layer) ?? null,
451
451
  events: (n == null ? void 0 : n.events) ?? {},
452
452
  data: (n == null ? void 0 : n.data) ?? null,
453
- id: v.value
454
- }), f("add", o.value), o.value.addEventListener("dragstart", b), o.value.addEventListener("drag", b), o.value.setAttribute(de, "true"), o.value.setAttribute("draggable", "false");
453
+ id: d.value,
454
+ disabled: f ?? !1
455
+ }), g("add", o.value), o.value.addEventListener("dragstart", Z), o.value.addEventListener("drag", Z), o.value.setAttribute(de, "true"), o.value.setAttribute("draggable", "false");
455
456
  },
456
457
  unregisterElement: () => {
457
- o.value && (t.value.delete(o.value), l.value.delete(o.value), o.value.removeEventListener("dragstart", b), o.value.removeEventListener("drag", b), o.value.removeAttribute(de), o.value.removeAttribute("draggable"));
458
+ o.value && (t.value.delete(o.value), l.value.delete(o.value), o.value.removeEventListener("dragstart", Z), o.value.removeEventListener("drag", Z), o.value.removeAttribute(de), o.value.removeAttribute("draggable"));
458
459
  },
459
- isDragging: g,
460
+ isDragging: a,
460
461
  isOvered: u,
461
- isAllowed: r,
462
- isLazyAllowed: d,
463
- id: v
462
+ isAllowed: c,
463
+ isLazyAllowed: v,
464
+ id: d
464
465
  };
465
- }, O = (n, t) => n ? t.contains(n) : !1, Ke = (n) => {
466
- var v, g;
467
- const t = B(n.activeContainer.ref.value), e = W(t), a = ((v = n.pointerPosition.current.value) == null ? void 0 : v.x) ?? 0, l = ((g = n.pointerPosition.current.value) == null ? void 0 : g.y) ?? 0, i = !(t && a >= t.x && a <= t.x + t.width && l >= t.y && l <= t.y + t.height), f = Array.from(n.draggingElements.value.keys()), o = Array.from(n.visibleElements.value.entries()).filter(([r, d]) => {
468
- if (!r) return !1;
469
- const c = B(r);
470
- return c && t && ue(c, t);
471
- }).map(([r, d]) => {
472
- const c = B(r), p = W(c), m = a >= c.x && a <= c.x + c.width && l >= c.y && l <= c.y + c.height, y = ve(c, t), P = ce(e, p);
473
- let z = 0;
474
- for (const [M, F] of n.visibleElements.value.entries())
475
- M !== r && M && r && O(r, M) && z++;
466
+ }, k = (n, t) => n ? t.contains(n) : !1, Ke = (n) => {
467
+ var d, f;
468
+ const t = q(n.activeContainer.ref.value), e = Q(t), r = ((d = n.pointerPosition.current.value) == null ? void 0 : d.x) ?? 0, l = ((f = n.pointerPosition.current.value) == null ? void 0 : f.y) ?? 0, i = !(t && r >= t.x && r <= t.x + t.width && l >= t.y && l <= t.y + t.height), g = Array.from(n.draggingElements.value.keys()), o = Array.from(n.visibleElements.value.entries()).filter(([a, c]) => {
469
+ if (!a) return !1;
470
+ const v = q(a);
471
+ return v && t && ue(v, t);
472
+ }).map(([a, c]) => {
473
+ const v = q(a), m = Q(v), E = r >= v.x && r <= v.x + v.width && l >= v.y && l <= v.y + v.height, p = ve(v, t), z = ce(e, m);
474
+ let L = 0;
475
+ for (const [I, H] of n.visibleElements.value.entries())
476
+ I !== a && I && a && k(a, I) && L++;
476
477
  return {
477
- element: d,
478
- node: r,
479
- isPointerInElement: m,
480
- overlapPercent: y,
481
- depth: z,
482
- centerDistance: P
478
+ element: c,
479
+ node: a,
480
+ isPointerInElement: E,
481
+ overlapPercent: p,
482
+ depth: L,
483
+ centerDistance: z
483
484
  };
484
- }).sort((r, d) => {
485
+ }).sort((a, c) => {
485
486
  if (!i) {
486
- if (r.isPointerInElement && d.isPointerInElement)
487
- return d.depth - r.depth;
488
- if (r.isPointerInElement !== d.isPointerInElement)
489
- return r.isPointerInElement ? -1 : 1;
487
+ if (a.isPointerInElement && c.isPointerInElement)
488
+ return c.depth - a.depth;
489
+ if (a.isPointerInElement !== c.isPointerInElement)
490
+ return a.isPointerInElement ? -1 : 1;
490
491
  }
491
- return Math.abs(r.overlapPercent - d.overlapPercent) <= 1 ? r.centerDistance - d.centerDistance : d.overlapPercent - r.overlapPercent;
492
- }), u = Array.from(n.visibleZones.value.entries()).filter(([r, d]) => {
493
- if (!r || f.some(
494
- (p) => p && O(r, p)
492
+ return Math.abs(a.overlapPercent - c.overlapPercent) <= 1 ? a.centerDistance - c.centerDistance : c.overlapPercent - a.overlapPercent;
493
+ }), u = Array.from(n.visibleZones.value.entries()).filter(([a, c]) => {
494
+ if (!a || g.some(
495
+ (m) => m && k(a, m)
495
496
  ))
496
497
  return !1;
497
- const c = B(r);
498
- return c && t && ue(c, t);
499
- }).map(([r, d]) => {
500
- const c = B(r), p = W(c), m = a >= c.x && a <= c.x + c.width && l >= c.y && l <= c.y + c.height, y = ve(c, t), P = ce(e, p);
501
- let z = 0;
502
- for (const [M, F] of n.visibleZones.value.entries())
503
- M !== r && M && r && O(r, M) && z++;
498
+ const v = q(a);
499
+ return v && t && ue(v, t);
500
+ }).map(([a, c]) => {
501
+ const v = q(a), m = Q(v), E = r >= v.x && r <= v.x + v.width && l >= v.y && l <= v.y + v.height, p = ve(v, t), z = ce(e, m);
502
+ let L = 0;
503
+ for (const [I, H] of n.visibleZones.value.entries())
504
+ I !== a && I && a && k(a, I) && L++;
504
505
  return {
505
- zone: d,
506
- node: r,
507
- isPointerInElement: m,
508
- overlapPercent: y,
509
- depth: z,
510
- centerDistance: P
506
+ zone: c,
507
+ node: a,
508
+ isPointerInElement: E,
509
+ overlapPercent: p,
510
+ depth: L,
511
+ centerDistance: z
511
512
  };
512
- }).sort((r, d) => {
513
+ }).sort((a, c) => {
513
514
  if (!i) {
514
- if (r.isPointerInElement && d.isPointerInElement)
515
- return d.depth - r.depth;
516
- if (r.isPointerInElement !== d.isPointerInElement)
517
- return r.isPointerInElement ? -1 : 1;
515
+ if (a.isPointerInElement && c.isPointerInElement)
516
+ return c.depth - a.depth;
517
+ if (a.isPointerInElement !== c.isPointerInElement)
518
+ return a.isPointerInElement ? -1 : 1;
518
519
  }
519
- return Math.abs(r.overlapPercent - d.overlapPercent) <= 1 ? r.centerDistance - d.centerDistance : d.overlapPercent - r.overlapPercent;
520
+ return Math.abs(a.overlapPercent - c.overlapPercent) <= 1 ? a.centerDistance - c.centerDistance : c.overlapPercent - a.overlapPercent;
520
521
  });
521
522
  return [
522
- ...o.map((r) => r.node),
523
- ...u.map((r) => r.node)
523
+ ...o.map((a) => a.node),
524
+ ...u.map((a) => a.node)
524
525
  ];
525
526
  }, Te = (n, t) => {
526
- const { pointerPosition: e, keyboard: a } = R(), l = (t == null ? void 0 : t.moveStep) || 10;
527
+ const { pointerPosition: e, keyboard: r } = U(), l = (t == null ? void 0 : t.moveStep) || 10;
527
528
  return {
528
529
  onKeyboardStart: (o) => {
529
- var r;
530
- b(o);
531
- const u = B(n.value);
532
- (r = n.value) == null || r.blur();
533
- const v = u.x + u.width / 2, g = u.y + u.height / 2;
530
+ var a;
531
+ Z(o);
532
+ const u = q(n.value);
533
+ (a = n.value) == null || a.blur();
534
+ const d = u.x + u.width / 2, f = u.y + u.height / 2;
534
535
  e.start.value = {
535
- x: v,
536
- y: g
536
+ x: d,
537
+ y: f
537
538
  }, e.current.value = {
538
- x: v,
539
- y: g
539
+ x: d,
540
+ y: f
540
541
  }, e.offset.pixel.value = {
541
542
  x: u.width / 2,
542
543
  y: u.height / 2
@@ -548,10 +549,10 @@ const R = me(() => {
548
549
  onKeyboardMove: () => {
549
550
  if (!e.current.value) return;
550
551
  const o = e.current.value.x, u = e.current.value.y;
551
- let v = o, g = u;
552
- a.w.value && (g -= l), a.s.value && (g += l), a.a.value && (v -= l), a.d.value && (v += l), e.current.value = {
553
- x: v,
554
- y: g
552
+ let d = o, f = u;
553
+ r.w.value && (f -= l), r.s.value && (f += l), r.a.value && (d -= l), r.d.value && (d += l), e.current.value = {
554
+ x: d,
555
+ y: f
555
556
  };
556
557
  },
557
558
  onKeyboardEnd: () => {
@@ -559,18 +560,18 @@ const R = me(() => {
559
560
  }
560
561
  };
561
562
  }, Ze = (n) => {
562
- const t = R();
563
+ const t = U();
563
564
  return {
564
565
  onPointerStart: (s) => {
565
566
  t.pointerPosition.start.value = { x: s.clientX, y: s.clientY }, t.pointerPosition.current.value = {
566
567
  x: s.clientX,
567
568
  y: s.clientY
568
569
  };
569
- const { pixel: i, percent: f } = be(n.value, {
570
+ const { pixel: i, percent: g } = _e(n.value, {
570
571
  x: s.clientX,
571
572
  y: s.clientY
572
573
  });
573
- t.pointerPosition.offset.pixel.value = i, t.pointerPosition.offset.percent.value = f;
574
+ t.pointerPosition.offset.pixel.value = i, t.pointerPosition.offset.percent.value = g;
574
575
  },
575
576
  onPointerMove: (s) => {
576
577
  t.isPending.value || (t.pointerPosition.current.value = {
@@ -583,187 +584,208 @@ const R = me(() => {
583
584
  }
584
585
  };
585
586
  }, Oe = (n, t) => {
586
- var F, X;
587
- const e = R(), { onPointerStart: a, onPointerMove: l, onPointerEnd: s } = Ze(n), { onKeyboardStart: i, onKeyboardMove: f, onKeyboardEnd: o } = Te(
587
+ var H, S;
588
+ const e = U(), { onPointerStart: r, onPointerMove: l, onPointerEnd: s } = Ze(n), { onKeyboardStart: i, onKeyboardMove: g, onKeyboardEnd: o } = Te(
588
589
  n,
589
590
  t == null ? void 0 : t.keyboard
590
591
  );
591
592
  let u = null;
592
- const v = (E) => {
593
- var D, K;
594
- if (!E) return /* @__PURE__ */ new Map();
595
- const x = e.selectedElements.value.has(E);
593
+ const d = (w) => {
594
+ var _, C;
595
+ if (!w) return /* @__PURE__ */ new Map();
596
+ const x = e.selectedElements.value.has(w);
596
597
  if (e.selectedElements.value.size > 0 && x) {
597
- const C = /* @__PURE__ */ new Map();
598
- return e.selectedElements.value.forEach((_) => {
599
- var T, V;
600
- const I = e.elementsMap.value.get(_);
601
- I && C.set(_, {
602
- ...I,
603
- initialHTML: ((T = I.node) == null ? void 0 : T.outerHTML) ?? "",
604
- initialRect: (V = I.node) == null ? void 0 : V.getBoundingClientRect()
598
+ const R = /* @__PURE__ */ new Map();
599
+ return e.selectedElements.value.forEach((G) => {
600
+ var A, K;
601
+ const y = e.elementsMap.value.get(G);
602
+ y && R.set(G, {
603
+ ...y,
604
+ initialHTML: ((A = y.node) == null ? void 0 : A.outerHTML) ?? "",
605
+ initialRect: (K = y.node) == null ? void 0 : K.getBoundingClientRect()
605
606
  });
606
- }), C;
607
+ }), R;
607
608
  }
608
609
  e.selectedElements.value.clear();
609
- const h = e.elementsMap.value.get(E);
610
+ const h = e.elementsMap.value.get(w);
610
611
  if (!h) return /* @__PURE__ */ new Map();
611
- const A = /* @__PURE__ */ new Map();
612
- return A.set(E, {
612
+ const b = /* @__PURE__ */ new Map();
613
+ return b.set(w, {
613
614
  ...h,
614
- initialHTML: ((D = h.node) == null ? void 0 : D.outerHTML) ?? "",
615
- initialRect: (K = h.node) == null ? void 0 : K.getBoundingClientRect()
616
- }), A;
617
- }, g = (E) => {
618
- if (!E)
615
+ initialHTML: ((_ = h.node) == null ? void 0 : _.outerHTML) ?? "",
616
+ initialRect: (C = h.node) == null ? void 0 : C.getBoundingClientRect()
617
+ }), b;
618
+ }, f = (w) => {
619
+ if (!w)
619
620
  return { element: null, zone: null };
620
- const x = Array.isArray(E) ? E : [E], h = Array.from(e.draggingElements.value.keys()), A = x.find((C) => {
621
- if (!e.visibleZones.value.has(C)) return !1;
622
- const _ = e.zonesMap.value.get(C);
623
- return !(!_ || h.some(
624
- (I) => I && (I === _.node || O(_.node, I))
625
- ) || _.groups.length && !!Array.from(
621
+ const x = Array.isArray(w) ? w : [w], h = Array.from(e.draggingElements.value.keys()), b = Array.from(e.zonesMap.value.entries()).flatMap(
622
+ ([y, A]) => A.disabled ? [y] : []
623
+ ), _ = Array.from(
624
+ e.elementsMap.value.entries()
625
+ ).flatMap(([y, A]) => A.disabled ? [y] : []), C = x.find((y) => {
626
+ if (!e.visibleZones.value.has(y)) return !1;
627
+ const A = e.zonesMap.value.get(y);
628
+ return !(!A || A.disabled || b.some(
629
+ (V) => y === V || k(y, V)
630
+ ) || h.some(
631
+ (V) => V && (V === A.node || k(A.node, V))
632
+ ) || A.groups.length && !!Array.from(
626
633
  e.draggingElements.value.values()
627
- ).some((T) => T.groups.length ? !T.groups.some((V) => _.groups.includes(V)) : !1));
634
+ ).some((B) => B.groups.length ? !B.groups.some((T) => A.groups.includes(T)) : !1));
628
635
  });
629
- return A ? {
630
- element: x.filter((C) => !e.visibleElements.value.has(C) || !e.elementsMap.value.has(C) ? !1 : !Array.from(
631
- e.draggingElements.value.values()
632
- ).some((I) => I.groups.length ? !I.groups.some(
633
- (T) => {
634
- var V;
635
- return (V = e.elementsMap.value.get(C)) == null ? void 0 : V.groups.includes(T);
636
- }
637
- ) : !1)).find((C) => h.some(
638
- (I) => I && (I === C || O(C, I) || O(I, C))
639
- ) ? !1 : C === A || O(
640
- C,
641
- A
636
+ return C ? {
637
+ element: x.filter((y) => {
638
+ if (!e.visibleElements.value.has(y) || !e.elementsMap.value.has(y)) return !1;
639
+ const A = e.elementsMap.value.get(y);
640
+ if (A != null && A.disabled) return !1;
641
+ const K = b.some(
642
+ (T) => y === T || k(y, T)
643
+ ), V = _.some(
644
+ (T) => y === T || k(
645
+ y,
646
+ T
647
+ )
648
+ );
649
+ return K || V ? !1 : !Array.from(
650
+ e.draggingElements.value.values()
651
+ ).some((T) => T.groups.length ? !T.groups.some(
652
+ (W) => {
653
+ var $;
654
+ return ($ = e.elementsMap.value.get(y)) == null ? void 0 : $.groups.includes(W);
655
+ }
656
+ ) : !1);
657
+ }).find((y) => h.some(
658
+ (K) => K && (K === y || k(y, K) || k(K, y))
659
+ ) ? !1 : y === C || k(
660
+ y,
661
+ C
642
662
  )) || null,
643
- zone: A
663
+ zone: C
644
664
  } : { element: null, zone: null };
645
- }, r = ((F = t == null ? void 0 : t.sensor) == null ? void 0 : F.setup) || Ke, d = (E) => {
646
- var K, C, _, I, T, V, Q, N, ee, te, $, ne;
647
- const x = e.hovered.element.value, h = e.hovered.zone.value, A = E.element, D = E.zone;
648
- e.hovered.element.value = A, e.hovered.zone.value = D, x !== A && (x && ((_ = (C = (K = e.elementsMap.value.get(x)) == null ? void 0 : K.events) == null ? void 0 : C.onLeave) == null || _.call(C, e, Y(e))), A && ((V = (T = (I = e.elementsMap.value.get(A)) == null ? void 0 : I.events) == null ? void 0 : T.onHover) == null || V.call(T, e, Y(e)))), h !== D && (h && ((ee = (N = (Q = e.zonesMap.value.get(h)) == null ? void 0 : Q.events) == null ? void 0 : N.onLeave) == null || ee.call(N, e, Y(e))), D && ((ne = ($ = (te = e.zonesMap.value.get(D)) == null ? void 0 : te.events) == null ? void 0 : $.onHover) == null || ne.call($, e, Y(e))));
649
- }, c = Ie(() => {
650
- const E = r(e), x = g(E);
651
- d(x);
652
- }, ((X = t == null ? void 0 : t.sensor) == null ? void 0 : X.throttle) ?? 0), p = () => {
653
- c(), u = requestAnimationFrame(p);
654
- }, m = () => p(), y = () => {
665
+ }, a = ((H = t == null ? void 0 : t.sensor) == null ? void 0 : H.setup) || Ke, c = (w) => {
666
+ var C, R, G, y, A, K, V, B, T, W, $, ne;
667
+ const x = e.hovered.element.value, h = e.hovered.zone.value, b = w.element, _ = w.zone;
668
+ e.hovered.element.value = b, e.hovered.zone.value = _, x !== b && (x && ((G = (R = (C = e.elementsMap.value.get(x)) == null ? void 0 : C.events) == null ? void 0 : R.onLeave) == null || G.call(R, e, F(e))), b && ((K = (A = (y = e.elementsMap.value.get(b)) == null ? void 0 : y.events) == null ? void 0 : A.onHover) == null || K.call(A, e, F(e)))), h !== _ && (h && ((T = (B = (V = e.zonesMap.value.get(h)) == null ? void 0 : V.events) == null ? void 0 : B.onLeave) == null || T.call(B, e, F(e))), _ && ((ne = ($ = (W = e.zonesMap.value.get(_)) == null ? void 0 : W.events) == null ? void 0 : $.onHover) == null || ne.call($, e, F(e))));
669
+ }, v = ze(() => {
670
+ const w = a(e), x = f(w);
671
+ c(x);
672
+ }, ((S = t == null ? void 0 : t.sensor) == null ? void 0 : S.throttle) ?? 0), m = () => {
673
+ v(), u = requestAnimationFrame(m);
674
+ }, E = () => m(), p = () => {
655
675
  u !== null && (s(), o(), cancelAnimationFrame(u), u = null);
656
676
  };
657
677
  return {
658
- activate: (E) => {
659
- e.draggingElements.value = v(n.value), e.draggingElements.value.forEach(
678
+ activate: (w) => {
679
+ e.draggingElements.value = d(n.value), e.draggingElements.value.forEach(
660
680
  (x) => {
661
- var h, A;
662
- return (A = (h = x.events).onStart) == null ? void 0 : A.call(h, e, Y(e));
681
+ var h, b;
682
+ return (b = (h = x.events).onStart) == null ? void 0 : b.call(h, e, F(e));
663
683
  }
664
- ), E instanceof PointerEvent ? a(E) : i(E), m();
684
+ ), w instanceof PointerEvent ? r(w) : i(w), E();
665
685
  },
666
- track: (E) => {
686
+ track: (w) => {
667
687
  e.draggingElements.value.forEach(
668
688
  (x) => {
669
- var h, A;
670
- return (A = (h = x.events).onMove) == null ? void 0 : A.call(h, e, Y(e));
689
+ var h, b;
690
+ return (b = (h = x.events).onMove) == null ? void 0 : b.call(h, e, F(e));
671
691
  }
672
- ), E instanceof KeyboardEvent ? f() : l(E);
692
+ ), w instanceof KeyboardEvent ? g() : l(w);
673
693
  },
674
- deactivate: async (E = !0) => {
694
+ deactivate: async (w = !0) => {
675
695
  var x, h;
676
696
  if (e.hovered.zone.value) {
677
- const A = e.zonesMap.value.get(e.hovered.zone.value), D = (h = A == null ? void 0 : (x = A.events).onDrop) == null ? void 0 : h.call(x, e, Y(e));
678
- if (D instanceof Promise)
697
+ const b = e.zonesMap.value.get(e.hovered.zone.value), _ = (h = b == null ? void 0 : (x = b.events).onDrop) == null ? void 0 : h.call(x, e, F(e));
698
+ if (_ instanceof Promise)
679
699
  try {
680
700
  e.isPending.value = !0;
681
- const K = await D;
682
- return K && (E && e.selectedElements.value.clear(), e.draggingElements.value.clear(), e.hovered.zone.value = null, e.hovered.element.value = null, y()), K;
701
+ const C = await _;
702
+ return C && (w && e.selectedElements.value.clear(), e.draggingElements.value.clear(), e.hovered.zone.value = null, e.hovered.element.value = null, p()), C;
683
703
  } catch {
684
704
  return !1;
685
705
  } finally {
686
706
  e.isPending.value = !1;
687
707
  }
688
708
  else
689
- E && e.selectedElements.value.clear(), e.draggingElements.value.clear(), e.hovered.zone.value = null, e.hovered.element.value = null, y();
709
+ w && e.selectedElements.value.clear(), e.draggingElements.value.clear(), e.hovered.zone.value = null, e.hovered.element.value = null, p();
690
710
  } else
691
711
  e.draggingElements.value.forEach(
692
- (A) => {
693
- var D, K;
694
- return (K = (D = A.events).onEnd) == null ? void 0 : K.call(D, e, Y(e));
712
+ (b) => {
713
+ var _, C;
714
+ return (C = (_ = b.events).onEnd) == null ? void 0 : C.call(_, e, F(e));
695
715
  }
696
- ), E && e.selectedElements.value.clear(), e.draggingElements.value.clear(), e.hovered.zone.value = null, e.hovered.element.value = null, y();
716
+ ), w && e.selectedElements.value.clear(), e.draggingElements.value.clear(), e.hovered.zone.value = null, e.hovered.element.value = null, p();
697
717
  }
698
718
  };
699
- }, Re = me(() => {
700
- let n = "", t = "", e = "", a = null, l = null, s = null, i = null, f = null;
701
- const { activeContainer: o, isPending: u } = R(), v = () => {
702
- const c = document.body;
703
- n = c.style.userSelect, c.style.userSelect = "none", window.addEventListener("contextmenu", b), window.addEventListener("selectstart", b), window.addEventListener("touchstart", b), window.addEventListener("touchmove", b);
704
- }, g = () => {
705
- const c = document.body;
706
- c.style.userSelect = n, c.style.touchAction = t, c.style.overscrollBehavior = e, window.removeEventListener("contextmenu", b), window.removeEventListener("selectstart", b), window.removeEventListener("touchstart", b), window.removeEventListener("touchmove", b);
707
- }, r = () => {
708
- a && (document.removeEventListener("pointermove", a), a = null), l && (document.removeEventListener("pointerup", l), l = null), s && (s = null), i && (document.removeEventListener("wheel", i), i = null), f && (document.removeEventListener("keydown", f), document.removeEventListener("keypress", f), document.removeEventListener("keyup", f), f = null);
719
+ }, Ve = me(() => {
720
+ let n = "", t = "", e = "", r = null, l = null, s = null, i = null, g = null;
721
+ const { activeContainer: o, isPending: u, elementsMap: d } = U(), f = () => {
722
+ const m = document.body;
723
+ n = m.style.userSelect, m.style.userSelect = "none", window.addEventListener("contextmenu", Z), window.addEventListener("selectstart", Z), window.addEventListener("touchstart", Z), window.addEventListener("touchmove", Z);
724
+ }, a = () => {
725
+ const m = document.body;
726
+ m.style.userSelect = n, m.style.touchAction = t, m.style.overscrollBehavior = e, window.removeEventListener("contextmenu", Z), window.removeEventListener("selectstart", Z), window.removeEventListener("touchstart", Z), window.removeEventListener("touchmove", Z);
727
+ }, c = () => {
728
+ r && (document.removeEventListener("pointermove", r), r = null), l && (document.removeEventListener("pointerup", l), l = null), s && (s = null), i && (document.removeEventListener("wheel", i), i = null), g && (document.removeEventListener("keydown", g), document.removeEventListener("keypress", g), document.removeEventListener("keyup", g), g = null);
709
729
  };
710
730
  return {
711
- handleDragStart: (c, p, m) => {
712
- if (u.value) return;
713
- r(), c.target.blur(), m != null && m.container && (o.component.value = m.container);
714
- const { activate: y, track: P, deactivate: z } = Oe(p, m);
731
+ handleDragStart: (m, E, p) => {
732
+ if (!E.value || u.value) return;
733
+ const z = d.value.get(E.value);
734
+ if (z != null && z.disabled) return;
735
+ c(), m.target.blur(), p != null && p.container && (o.component.value = p.container);
736
+ const { activate: L, track: I, deactivate: H } = Oe(E, p);
715
737
  l = () => {
716
- z(!0).then((M) => {
717
- M !== !1 && (o.component.value = null, g(), z(!0), r());
738
+ H(!0).then((S) => {
739
+ S !== !1 && (o.component.value = null, a(), H(!0), c());
718
740
  });
719
741
  }, s = () => {
720
- o.component.value = null, g(), z(!1), r();
721
- }, a = (M) => P(M), i = (M) => P(M), f = (M) => {
722
- M.type === "keyup" && (M.code === "Escape" && (s == null || s()), M.code === "Enter" && (l == null || l())), P(M);
723
- }, v(), y(c), document.addEventListener("pointermove", a), document.addEventListener("pointerup", l), document.addEventListener("wheel", i), document.addEventListener("keydown", f), document.addEventListener("keypress", f), document.addEventListener("keyup", f);
742
+ o.component.value = null, a(), H(!1), c();
743
+ }, r = (S) => I(S), i = (S) => I(S), g = (S) => {
744
+ S.type === "keyup" && (S.code === "Escape" && (s == null || s()), S.code === "Enter" && (l == null || l())), I(S);
745
+ }, f(), L(m), document.addEventListener("pointermove", r), document.addEventListener("pointerup", l), document.addEventListener("wheel", i), document.addEventListener("keydown", g), document.addEventListener("keypress", g), document.addEventListener("keyup", g);
724
746
  }
725
747
  };
726
748
  }), Fe = (n) => {
727
749
  const {
728
750
  id: t,
729
751
  elementRef: e,
730
- isDragging: a,
752
+ isDragging: r,
731
753
  isOvered: l,
732
754
  isAllowed: s,
733
755
  isLazyAllowed: i,
734
- registerElement: f,
756
+ registerElement: g,
735
757
  unregisterElement: o
736
- } = ke(n), { pointerPosition: u } = R(), { handleDragStart: v } = Re(), g = (r) => v(r, e, n);
737
- return J(f), ge(o), {
758
+ } = ke(n), { pointerPosition: u } = U(), { handleDragStart: d } = Ve(), f = (a) => d(a, e, n);
759
+ return te(g), ge(o), {
738
760
  pointerPosition: u,
739
761
  elementRef: e,
740
- isDragging: a,
762
+ isDragging: r,
741
763
  isOvered: l,
742
764
  isAllowed: s,
743
765
  isLazyAllowed: i,
744
- handleDragStart: g,
766
+ handleDragStart: f,
745
767
  id: t
746
768
  };
747
- }, Ve = (n) => {
769
+ }, Ye = (n) => {
748
770
  const {
749
771
  zonesMap: t,
750
772
  hovered: e,
751
- draggingElements: a,
773
+ draggingElements: r,
752
774
  isDragging: l,
753
775
  handleDropZoneIntersection: s
754
- } = R(), i = U(null), f = k(
776
+ } = U(), i = X(null), g = O(
755
777
  () => e.zone.value === i.value
756
- ), o = k(() => {
778
+ ), o = O(() => {
757
779
  if (!i.value || !l.value) return !1;
758
- const r = t.value.get(i.value);
759
- return r != null && r.groups.length ? !Array.from(a.value.values()).some((d) => d.groups.length ? !d.groups.some(
760
- (c) => r.groups.includes(c)
780
+ const a = t.value.get(i.value);
781
+ return a != null && a.groups.length ? !Array.from(r.value.values()).some((c) => c.groups.length ? !c.groups.some(
782
+ (v) => a.groups.includes(v)
761
783
  ) : !1) : !0;
762
- }), u = k(() => {
784
+ }), u = O(() => {
763
785
  if (!i.value || !l.value || e.zone.value !== i.value) return !1;
764
- const r = t.value.get(i.value);
765
- return r != null && r.groups.length ? !Array.from(a.value.values()).some((d) => !d.groups.some(
766
- (c) => r.groups.includes(c)
786
+ const a = t.value.get(i.value);
787
+ return a != null && a.groups.length ? !Array.from(r.value.values()).some((c) => !c.groups.some(
788
+ (v) => a.groups.includes(v)
767
789
  )) : !0;
768
790
  });
769
791
  return {
@@ -774,13 +796,14 @@ const R = me(() => {
774
796
  node: i.value,
775
797
  groups: (n == null ? void 0 : n.groups) ?? [],
776
798
  events: (n == null ? void 0 : n.events) ?? {},
777
- data: (n == null ? void 0 : n.data) ?? void 0
799
+ data: (n == null ? void 0 : n.data) ?? void 0,
800
+ disabled: (n == null ? void 0 : n.disabled) ?? !1
778
801
  }), i.value.setAttribute("data-dnd-droppable", "true");
779
802
  },
780
803
  unregisterZone: () => {
781
804
  i.value && (s("remove", i.value), t.value.delete(i.value));
782
805
  },
783
- isOvered: f,
806
+ isOvered: g,
784
807
  isAllowed: o,
785
808
  isLazyAllowed: u
786
809
  };
@@ -788,56 +811,56 @@ const R = me(() => {
788
811
  const {
789
812
  elementRef: t,
790
813
  registerZone: e,
791
- unregisterZone: a,
814
+ unregisterZone: r,
792
815
  isOvered: l,
793
816
  isAllowed: s,
794
817
  isLazyAllowed: i
795
- } = Ve(n);
796
- return J(e), ge(a), { elementRef: t, isOvered: l, isAllowed: s, isLazyAllowed: i };
818
+ } = Ye(n);
819
+ return te(e), ge(r), { elementRef: t, isOvered: l, isAllowed: s, isLazyAllowed: i };
797
820
  }, Ne = (n) => {
798
- const { selectedElements: t, elementsMap: e } = R(), a = k(
821
+ const { selectedElements: t, elementsMap: e } = U(), r = O(
799
822
  () => n.value ? t.value.has(n.value) : !1
800
- ), l = k(() => {
823
+ ), l = O(() => {
801
824
  if (!n.value) return !1;
802
825
  for (const u of t.value)
803
- if (u && O(u, n.value))
826
+ if (u && k(u, n.value))
804
827
  return !0;
805
828
  return !1;
806
- }), s = k(() => {
829
+ }), s = O(() => {
807
830
  if (!n.value) return !1;
808
831
  for (const u of t.value)
809
- if (u && O(n.value, u))
832
+ if (u && k(n.value, u))
810
833
  return !0;
811
834
  return !1;
812
835
  }), i = () => {
813
836
  n.value && t.value.delete(n.value);
814
- }, f = () => {
837
+ }, g = () => {
815
838
  if (!(!n.value || !e.value.get(n.value))) {
816
839
  if (l.value)
817
- for (const v of t.value)
818
- v && O(v, n.value) && t.value.delete(v);
840
+ for (const d of t.value)
841
+ d && k(d, n.value) && t.value.delete(d);
819
842
  if (s.value)
820
- for (const v of t.value)
821
- v && O(n.value, v) && t.value.delete(v);
843
+ for (const d of t.value)
844
+ d && k(n.value, d) && t.value.delete(d);
822
845
  t.value.add(n.value);
823
846
  }
824
847
  };
825
848
  return {
826
849
  handleUnselect: i,
827
- handleSelect: f,
850
+ handleSelect: g,
828
851
  handleToggleSelect: () => {
829
- n.value && (t.value.has(n.value) ? i() : f());
852
+ n.value && (t.value.has(n.value) ? i() : g());
830
853
  },
831
- isSelected: a,
854
+ isSelected: r,
832
855
  isParentOfSelected: l
833
856
  };
834
857
  };
835
858
  export {
836
859
  oe as DnDOperations,
837
860
  Be as default,
838
- B as getBoundingBox,
839
- R as useDnDStore,
840
- Se as useDragContainer,
861
+ q as getBoundingBox,
862
+ U as useDnDStore,
863
+ Ce as useDragContainer,
841
864
  Fe as useDraggable,
842
865
  Xe as useDroppable,
843
866
  Ne as useSelection