@vue-dnd-kit/core 2.4.7 → 3.0.0-beta.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.
- package/LICENSE +21 -0
- package/dist/devtools.cjs +2 -0
- package/dist/devtools.cjs.map +1 -0
- package/dist/devtools.d.cts +610 -0
- package/dist/devtools.d.ts +610 -0
- package/dist/devtools.js +569 -0
- package/dist/devtools.js.map +1 -0
- package/dist/index.cjs +12 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2425 -0
- package/dist/index.d.ts +2425 -2
- package/dist/index.js +5865 -0
- package/dist/index.js.map +1 -0
- package/package.json +59 -29
- package/dist/external/components/DnDProvider.vue.d.ts +0 -25
- package/dist/external/components/DragPreview.vue.d.ts +0 -89
- package/dist/external/composables/makeAutoScroll.d.ts +0 -14
- package/dist/external/composables/makeConstraintArea.d.ts +0 -7
- package/dist/external/composables/makeDraggable.d.ts +0 -24
- package/dist/external/composables/makeDroppable.d.ts +0 -21
- package/dist/external/composables/makeSelectionArea.d.ts +0 -15
- package/dist/external/composables/useDnDProvider.d.ts +0 -2
- package/dist/external/env.d.ts +0 -7
- package/dist/external/index.d.ts +0 -11
- package/dist/external/types/entities.d.ts +0 -208
- package/dist/external/types/index.d.ts +0 -5
- package/dist/external/types/operations.d.ts +0 -187
- package/dist/external/types/placement.d.ts +0 -34
- package/dist/external/types/pointer.d.ts +0 -10
- package/dist/external/types/provider.d.ts +0 -89
- package/dist/internal/composables/useDnDProviderEvents.d.ts +0 -2
- package/dist/internal/composables/useDnDProviderInternal.d.ts +0 -2
- package/dist/internal/composables/useDnDProviderState.d.ts +0 -4
- package/dist/internal/composables/useViewportAutoScroll.d.ts +0 -9
- package/dist/internal/logic/hover.d.ts +0 -6
- package/dist/internal/logic/keyboard.d.ts +0 -6
- package/dist/internal/logic/operations.d.ts +0 -35
- package/dist/internal/logic/payload.d.ts +0 -5
- package/dist/internal/logic/pointer.d.ts +0 -11
- package/dist/internal/logic/scroll.d.ts +0 -2
- package/dist/internal/sensors/default-collision.d.ts +0 -18
- package/dist/internal/sensors/index.d.ts +0 -2
- package/dist/internal/sensors/sensor.d.ts +0 -68
- package/dist/internal/sensors/steps.d.ts +0 -58
- package/dist/internal/types/auto-scroll.d.ts +0 -20
- package/dist/internal/types/observer.d.ts +0 -11
- package/dist/internal/types/provider.d.ts +0 -31
- package/dist/internal/utils/auto-scroll.d.ts +0 -13
- package/dist/internal/utils/constraints.d.ts +0 -43
- package/dist/internal/utils/disabled.d.ts +0 -9
- package/dist/internal/utils/dom.d.ts +0 -44
- package/dist/internal/utils/drag-activation.d.ts +0 -29
- package/dist/internal/utils/events.d.ts +0 -22
- package/dist/internal/utils/geometry.d.ts +0 -23
- package/dist/internal/utils/groups.d.ts +0 -23
- package/dist/internal/utils/hover.d.ts +0 -15
- package/dist/internal/utils/keyboard.d.ts +0 -5
- package/dist/internal/utils/namespaces.d.ts +0 -18
- package/dist/internal/utils/observer.d.ts +0 -15
- package/dist/internal/utils/placement.d.ts +0 -22
- package/dist/internal/utils/pointer.d.ts +0 -33
- package/dist/internal/utils/provider.d.ts +0 -12
- package/dist/internal/utils/selection.d.ts +0 -36
- package/dist/internal/utils/session.d.ts +0 -5
- package/dist/vite.svg +0 -1
- package/dist/vue-dnd-kit-core.cjs.js +0 -2
- package/dist/vue-dnd-kit-core.es.js +0 -1524
package/dist/devtools.js
ADDED
|
@@ -0,0 +1,569 @@
|
|
|
1
|
+
import { toValue as $, unref as z, getCurrentScope as H, watch as k, nextTick as q, shallowReactive as C, toRaw as T, isRef as G, triggerRef as W, getCurrentInstance as B, effectScope as U, onScopeDispose as Z } from "vue";
|
|
2
|
+
const V = (e) => ({
|
|
3
|
+
id: e.id,
|
|
4
|
+
ids: [...e.ids],
|
|
5
|
+
items: e.items.map(({ id: o, type: t, data: n, item: a }) => a === void 0 ? { id: o, type: t, data: n } : { id: o, type: t, data: n, item: a }),
|
|
6
|
+
type: e.type,
|
|
7
|
+
sensor: e.sensor,
|
|
8
|
+
element: e.element,
|
|
9
|
+
rect: e.rect
|
|
10
|
+
}), D = (e) => e && { id: e.id, accepted: e.accepted, data: e.data, element: e.element, rect: e.rect }, J = (e) => {
|
|
11
|
+
const o = e.active.value;
|
|
12
|
+
return {
|
|
13
|
+
status: e.status.value,
|
|
14
|
+
active: o && V(o),
|
|
15
|
+
over: D(e.over.value),
|
|
16
|
+
pointer: e.pointer.value,
|
|
17
|
+
transform: e.transform.value,
|
|
18
|
+
mode: e.mode.value,
|
|
19
|
+
landingKey: e.landingKey.value,
|
|
20
|
+
landings: [...e.landings.value],
|
|
21
|
+
fitSize: e.fitSize.value,
|
|
22
|
+
overlay: !!o && e.hasOverlay,
|
|
23
|
+
overlayElement: e.overlayElement.value,
|
|
24
|
+
previews: [...e.previewIds],
|
|
25
|
+
// A decided drop lands as a flight, the drag state already gone: the latest one.
|
|
26
|
+
settling: e.flights.value.length > 0,
|
|
27
|
+
dropTarget: D(e.flights.value.at(-1)?.over ?? null),
|
|
28
|
+
autoScrolling: e.isAutoScrolling.value,
|
|
29
|
+
activation: e.activationProgress.value,
|
|
30
|
+
// The live region adds a space to repeat a text (screen readers speak changes only).
|
|
31
|
+
announcement: e.announcement.value.trim()
|
|
32
|
+
};
|
|
33
|
+
}, Q = (e) => ({
|
|
34
|
+
activeKey: e.activeKey,
|
|
35
|
+
lead: e.lead,
|
|
36
|
+
keys: [...e.keys],
|
|
37
|
+
origin: { ...e.origin },
|
|
38
|
+
slot: e.slot,
|
|
39
|
+
list: e.list,
|
|
40
|
+
// The session's own mode: a held exchange shows in the drag's `mode` ('swap').
|
|
41
|
+
kind: e.mode.name,
|
|
42
|
+
block: [...e.block],
|
|
43
|
+
swap: e.swap,
|
|
44
|
+
removed: e.removed
|
|
45
|
+
}), X = (e, o) => {
|
|
46
|
+
const t = o.result?.event;
|
|
47
|
+
return t ? {
|
|
48
|
+
group: e.name,
|
|
49
|
+
keys: [...t.keys],
|
|
50
|
+
accepted: [...t.accepted],
|
|
51
|
+
rejected: [...t.rejected],
|
|
52
|
+
from: { ...t.from },
|
|
53
|
+
to: { ...t.to },
|
|
54
|
+
sameList: t.sameList,
|
|
55
|
+
mode: t.mode,
|
|
56
|
+
...t.partner ? { partner: t.partner.key } : {},
|
|
57
|
+
result: t.result,
|
|
58
|
+
defaultPrevented: t.defaultPrevented
|
|
59
|
+
} : null;
|
|
60
|
+
}, F = (e, o, t) => {
|
|
61
|
+
const n = e.active.value;
|
|
62
|
+
if (!n) return null;
|
|
63
|
+
if (o.isDisabled()) return !1;
|
|
64
|
+
const a = e.over.value;
|
|
65
|
+
return a?.id === o.id ? a.accepted : t && t.session.value?.mode.name === "insert" ? null : o.accepts(n);
|
|
66
|
+
}, Y = (e, o, t) => {
|
|
67
|
+
const n = t.getKeys(), a = e.getDroppable(t.id);
|
|
68
|
+
return {
|
|
69
|
+
id: t.id,
|
|
70
|
+
kind: t.layout.nested ? "tree" : "list",
|
|
71
|
+
group: o.name,
|
|
72
|
+
strategy: t.strategy(),
|
|
73
|
+
placeholder: t.placeholder(),
|
|
74
|
+
behavior: t.behavior?.() ?? "sort",
|
|
75
|
+
multiple: t.multiple?.() ?? "stack",
|
|
76
|
+
pull: t.pull(),
|
|
77
|
+
sort: t.canSort(),
|
|
78
|
+
dropOutside: t.dropOutside(),
|
|
79
|
+
acceptMode: t.acceptMode?.() ?? "all",
|
|
80
|
+
disabled: t.isDisabled(),
|
|
81
|
+
controlled: t.isReadonly(),
|
|
82
|
+
count: n.length,
|
|
83
|
+
keys: n,
|
|
84
|
+
draft: t.draft.value,
|
|
85
|
+
element: t.getElement(),
|
|
86
|
+
over: e.over.value?.id === t.id,
|
|
87
|
+
accepting: a ? F(e, a, o) : null
|
|
88
|
+
};
|
|
89
|
+
}, ee = (e, o) => {
|
|
90
|
+
const t = o.session.value;
|
|
91
|
+
return {
|
|
92
|
+
name: o.name,
|
|
93
|
+
lists: [...o.lists.values()].map((n) => Y(e, o, n)),
|
|
94
|
+
session: t && Q(t),
|
|
95
|
+
indicator: o.indicator.value
|
|
96
|
+
};
|
|
97
|
+
}, te = (e, o, t) => ({
|
|
98
|
+
id: o.id,
|
|
99
|
+
type: o.getTypes(),
|
|
100
|
+
disabled: o.isDisabled(),
|
|
101
|
+
selected: e.selection.has(o.id),
|
|
102
|
+
dragging: e.active.value?.ids.includes(o.id) ?? !1,
|
|
103
|
+
element: o.getElement(),
|
|
104
|
+
handle: o.getHandle(),
|
|
105
|
+
data: o.getData(),
|
|
106
|
+
// Sortable items have a container: their list.
|
|
107
|
+
list: o.getContainer ? t.get(o.id) ?? null : null
|
|
108
|
+
}), oe = (e, o, t) => ({
|
|
109
|
+
id: o.id,
|
|
110
|
+
// A function is a rule, not a getter: `unref`, as the droppable reads it.
|
|
111
|
+
accept: z(o.options?.accept),
|
|
112
|
+
acceptMode: $(o.options?.acceptMode) ?? "all",
|
|
113
|
+
priority: o.getPriority(),
|
|
114
|
+
disabled: o.isDisabled(),
|
|
115
|
+
over: e.over.value?.id === o.id,
|
|
116
|
+
accepting: F(e, o, t),
|
|
117
|
+
element: o.getElement(),
|
|
118
|
+
data: o.getData(),
|
|
119
|
+
sortable: !!o.sortable
|
|
120
|
+
}), se = (e, o) => {
|
|
121
|
+
const t = [...o].filter((s) => s.lists.size > 0), n = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
|
|
122
|
+
for (const s of t)
|
|
123
|
+
for (const r of s.lists.values()) {
|
|
124
|
+
a.set(r.id, s);
|
|
125
|
+
for (const i of r.draft.value ?? r.getKeys()) n.set(i, r.id);
|
|
126
|
+
}
|
|
127
|
+
return {
|
|
128
|
+
status: e.status.value,
|
|
129
|
+
options: { ...e.props },
|
|
130
|
+
draggables: [...e.getDraggables()].map((s) => te(e, s, n)),
|
|
131
|
+
droppables: [...e.getDroppables()].map(
|
|
132
|
+
(s) => oe(e, s, s.sortable ? a.get(s.id) : void 0)
|
|
133
|
+
),
|
|
134
|
+
groups: t.map((s) => ee(e, s)),
|
|
135
|
+
selection: [...e.selection],
|
|
136
|
+
session: J(e)
|
|
137
|
+
};
|
|
138
|
+
}, ne = (e, o) => {
|
|
139
|
+
const t = new Set(e), n = new Set(o), a = o.filter((p) => !t.has(p)), s = e.filter((p) => !n.has(p)), r = o.filter((p) => t.has(p)), i = e.filter((p) => n.has(p)), v = r.some((p, y) => p !== i[y]);
|
|
140
|
+
return a.length || s.length || v ? { added: a, removed: s, reordered: v } : null;
|
|
141
|
+
};
|
|
142
|
+
function re(e, o) {
|
|
143
|
+
const t = H();
|
|
144
|
+
let n = !1;
|
|
145
|
+
const a = [
|
|
146
|
+
k(
|
|
147
|
+
e.session,
|
|
148
|
+
(s, r) => {
|
|
149
|
+
const i = r && X(e, r);
|
|
150
|
+
i && o.drop(i);
|
|
151
|
+
},
|
|
152
|
+
{ flush: "sync" }
|
|
153
|
+
)
|
|
154
|
+
];
|
|
155
|
+
return q(() => {
|
|
156
|
+
if (n || !t?.active) return;
|
|
157
|
+
const s = t.run(
|
|
158
|
+
() => k(
|
|
159
|
+
() => [...e.lists.values()].filter((r) => r.animate?.()).map((r) => [r.id, r.getKeys()]),
|
|
160
|
+
(r, i) => {
|
|
161
|
+
if (e.dragPass || e.session.value) return;
|
|
162
|
+
const v = new Map(i);
|
|
163
|
+
for (const [p, y] of r) {
|
|
164
|
+
const w = v.has(p) && ne(v.get(p), y);
|
|
165
|
+
w && o.change({ type: "change", group: e.name, list: p, ...w });
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
{ flush: "pre" }
|
|
169
|
+
)
|
|
170
|
+
);
|
|
171
|
+
s && a.push(s);
|
|
172
|
+
}), () => {
|
|
173
|
+
n = !0, a.forEach((s) => s());
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
const R = {
|
|
177
|
+
disabled: ["isDisabled", (e) => !!e],
|
|
178
|
+
keyboardMode: ["getKeyboard", (e) => e],
|
|
179
|
+
activation: ["getActivation", (e) => e]
|
|
180
|
+
}, _ = /* @__PURE__ */ new Set(["disabled", "priority", "accept", "acceptMode"]), le = /* @__PURE__ */ new Set(["animation", "accept", "overlay"]), L = (e, o) => `${e.kind === "provider" ? e.kind : `${e.kind}:${typeof e.id}:${e.id}`}|${o}`, ce = (e, o) => e.kind === o.kind && (e.kind === "provider" || e.id === o.id);
|
|
181
|
+
function ie(e, o) {
|
|
182
|
+
const t = C(/* @__PURE__ */ new Map()), n = /* @__PURE__ */ new WeakMap(), a = /* @__PURE__ */ new WeakMap();
|
|
183
|
+
let s = [], r = !1;
|
|
184
|
+
const i = (l) => {
|
|
185
|
+
if (l.kind === "provider") return T(e.props);
|
|
186
|
+
if (l.kind === "list") {
|
|
187
|
+
for (const h of o()) if (h.id === l.id) return h.options ? T(h.options) : null;
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
190
|
+
const d = l.kind === "droppable" ? e.getDroppable(l.id) : void 0;
|
|
191
|
+
return d && !d.sortable && d.options ? T(d.options) : null;
|
|
192
|
+
}, v = (l, d, h, f) => {
|
|
193
|
+
let m = n.get(l);
|
|
194
|
+
if (m?.has(d)) return !0;
|
|
195
|
+
const g = Object.getOwnPropertyDescriptor(l, d);
|
|
196
|
+
let b = g?.value;
|
|
197
|
+
const c = g?.get ? () => g.get.call(l) : () => b;
|
|
198
|
+
try {
|
|
199
|
+
Object.defineProperty(l, d, {
|
|
200
|
+
configurable: !0,
|
|
201
|
+
enumerable: g?.enumerable ?? !1,
|
|
202
|
+
get: () => {
|
|
203
|
+
const u = t.get(h);
|
|
204
|
+
return u ? u.value : c();
|
|
205
|
+
},
|
|
206
|
+
set: (u) => {
|
|
207
|
+
g?.set ? g.set.call(l, u) : b = u;
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
} catch {
|
|
211
|
+
return !1;
|
|
212
|
+
}
|
|
213
|
+
return m || n.set(l, m = /* @__PURE__ */ new Map()), m.set(d, c), s.push(() => {
|
|
214
|
+
m.delete(d), g ? Object.defineProperty(l, d, g.get || g.set ? g : { ...g, value: c() }) : delete l[d];
|
|
215
|
+
}), f ? C(l)[d] = c() : G(b) && W(b), !0;
|
|
216
|
+
}, p = (l, d, h) => {
|
|
217
|
+
const f = R[d];
|
|
218
|
+
if (!f) return !1;
|
|
219
|
+
const [m, g] = f;
|
|
220
|
+
let b = a.get(l);
|
|
221
|
+
if (b?.has(m)) return !0;
|
|
222
|
+
const c = l[m];
|
|
223
|
+
return b || a.set(l, b = /* @__PURE__ */ new Map()), b.set(m, c), l[m] = (() => {
|
|
224
|
+
const u = t.get(h);
|
|
225
|
+
return u ? g(u.value) : c?.call(l);
|
|
226
|
+
}), s.push(() => {
|
|
227
|
+
b.delete(m), c ? l[m] = c : delete l[m];
|
|
228
|
+
}), !0;
|
|
229
|
+
}, y = ({ target: l, option: d }, h) => {
|
|
230
|
+
if (l.kind === "draggable") {
|
|
231
|
+
const m = e.getDraggable(l.id);
|
|
232
|
+
return !!m && p(m, d, h);
|
|
233
|
+
}
|
|
234
|
+
if (l.kind === "droppable" && !_.has(d)) return !1;
|
|
235
|
+
const f = i(l);
|
|
236
|
+
return !!f && v(f, d, h, l.kind === "provider");
|
|
237
|
+
}, w = () => {
|
|
238
|
+
for (const [l, d] of t) y(d, l);
|
|
239
|
+
}, x = () => {
|
|
240
|
+
if (r) return;
|
|
241
|
+
r = !0;
|
|
242
|
+
const { registerDraggable: l, registerDroppable: d } = e;
|
|
243
|
+
e.registerDraggable = (h) => {
|
|
244
|
+
const f = l(h);
|
|
245
|
+
return w(), f;
|
|
246
|
+
}, e.registerDroppable = (h) => {
|
|
247
|
+
const f = d(h);
|
|
248
|
+
return w(), f;
|
|
249
|
+
}, s.push(() => {
|
|
250
|
+
e.registerDraggable = l, e.registerDroppable = d, r = !1;
|
|
251
|
+
});
|
|
252
|
+
}, E = () => {
|
|
253
|
+
const l = s;
|
|
254
|
+
s = [];
|
|
255
|
+
for (let d = l.length - 1; d >= 0; d--) l[d]();
|
|
256
|
+
t.clear();
|
|
257
|
+
};
|
|
258
|
+
return {
|
|
259
|
+
set(l, d, h) {
|
|
260
|
+
const f = L(l, d), m = t.get(f);
|
|
261
|
+
return t.set(f, { target: l, option: d, value: h }), y({ target: l, option: d }, f) ? (l.kind !== "provider" && x(), !0) : (m ? t.set(f, m) : t.delete(f), !1);
|
|
262
|
+
},
|
|
263
|
+
reset(l, d) {
|
|
264
|
+
if (!l) return E();
|
|
265
|
+
for (const [h, f] of [...t])
|
|
266
|
+
ce(f.target, l) && (d === void 0 || f.option === d) && t.delete(h);
|
|
267
|
+
t.size || E();
|
|
268
|
+
},
|
|
269
|
+
read(l, d) {
|
|
270
|
+
const h = t.has(L(l, d));
|
|
271
|
+
if (l.kind === "draggable") {
|
|
272
|
+
const b = e.getDraggable(l.id), c = R[d]?.[0];
|
|
273
|
+
if (!b || !c) return;
|
|
274
|
+
const u = a.get(b)?.has(c) ? a.get(b).get(c) : b[c];
|
|
275
|
+
return { value: b[c]?.(), code: u?.call(b), overridden: h };
|
|
276
|
+
}
|
|
277
|
+
if (l.kind === "droppable" && !_.has(d)) return;
|
|
278
|
+
const f = i(l);
|
|
279
|
+
if (!f) return;
|
|
280
|
+
const m = n.get(f)?.get(d), g = f[d];
|
|
281
|
+
return {
|
|
282
|
+
value: l.kind === "provider" ? g : le.has(d) ? z(g) : $(g),
|
|
283
|
+
code: m ? m() : g,
|
|
284
|
+
overridden: h
|
|
285
|
+
};
|
|
286
|
+
},
|
|
287
|
+
list: () => [...t.values()].map(({ target: l, option: d, value: h }) => ({ target: l, option: d, value: h }))
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
let ae = 0;
|
|
291
|
+
const de = (e) => {
|
|
292
|
+
const o = e?.parent?.type, t = o?.name ?? o?.__name ?? o?.__file?.match(/([^/\\]+)\.vue$/)?.[1];
|
|
293
|
+
return t ? `DnDProvider · ${t}` : "DnDProvider";
|
|
294
|
+
};
|
|
295
|
+
function ue(e, o) {
|
|
296
|
+
const t = B(), n = /* @__PURE__ */ new Map();
|
|
297
|
+
let a = null, s = null, r = 0, i = null, v = null, p = [], y = null;
|
|
298
|
+
const w = ie(e, () => [...n.keys()].flatMap((c) => [...c.lists.values()])), x = (c) => a.run(
|
|
299
|
+
() => re(c, {
|
|
300
|
+
drop: (u) => p.push(u),
|
|
301
|
+
change: (u) => l(u)
|
|
302
|
+
})
|
|
303
|
+
), E = {
|
|
304
|
+
id: `provider-${++ae}`,
|
|
305
|
+
label: de(t),
|
|
306
|
+
app: t?.appContext.app ?? null,
|
|
307
|
+
// What `useDnDContext()` hands out: the manager, opaque.
|
|
308
|
+
context: e,
|
|
309
|
+
snapshot() {
|
|
310
|
+
for (const [c, u] of n)
|
|
311
|
+
c.lists.size || (u?.(), n.delete(c));
|
|
312
|
+
return se(e, n.keys());
|
|
313
|
+
},
|
|
314
|
+
cancel: () => e.cancel(),
|
|
315
|
+
clearSelection: () => e.selection.clear(),
|
|
316
|
+
overrides: w,
|
|
317
|
+
addGroup(c) {
|
|
318
|
+
n.has(c) || n.set(c, a && x(c));
|
|
319
|
+
},
|
|
320
|
+
sensorStarts(c, u, S) {
|
|
321
|
+
y = { id: c, sensor: { name: u?.name, touch: S } };
|
|
322
|
+
},
|
|
323
|
+
follow() {
|
|
324
|
+
if (!a) {
|
|
325
|
+
a = U(!0), s = e.addMonitor(g);
|
|
326
|
+
for (const c of n.keys()) n.set(c, x(c));
|
|
327
|
+
a.run(b);
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
stop() {
|
|
331
|
+
a?.stop(), s?.(), a = s = null, n.clear(), w.reset();
|
|
332
|
+
}
|
|
333
|
+
}, l = (c) => o(E, c), d = () => v === null ? null : Math.round(performance.now() - v), h = () => {
|
|
334
|
+
const c = p;
|
|
335
|
+
return p = [], c;
|
|
336
|
+
}, f = () => {
|
|
337
|
+
i = null, v = null;
|
|
338
|
+
}, m = (c) => {
|
|
339
|
+
for (const u of n.keys()) {
|
|
340
|
+
const S = u.session.value;
|
|
341
|
+
if (S?.activeKey === c) return S.origin.list;
|
|
342
|
+
}
|
|
343
|
+
return null;
|
|
344
|
+
}, g = {
|
|
345
|
+
onDragStart(c) {
|
|
346
|
+
r++, f(), p = [];
|
|
347
|
+
const u = y?.id === c.active.id ? y.sensor : null;
|
|
348
|
+
y = null, l({
|
|
349
|
+
type: "start",
|
|
350
|
+
drag: r,
|
|
351
|
+
active: V(c.active),
|
|
352
|
+
pointer: c.pointer,
|
|
353
|
+
source: c.source?.list ?? m(c.active.id),
|
|
354
|
+
sensor: u
|
|
355
|
+
});
|
|
356
|
+
},
|
|
357
|
+
onDragOver(c) {
|
|
358
|
+
const u = i;
|
|
359
|
+
i = c.over?.id ?? null, l({ type: "over", drag: r, over: D(c.over), previous: u });
|
|
360
|
+
},
|
|
361
|
+
onDragMove: () => l({ type: "move", drag: r }),
|
|
362
|
+
onBeforeDrop(c) {
|
|
363
|
+
v = performance.now(), l({ type: "release", drag: r, over: D(c.over) });
|
|
364
|
+
},
|
|
365
|
+
onDragEnd(c) {
|
|
366
|
+
const u = new Set(c.accepted);
|
|
367
|
+
l({
|
|
368
|
+
type: "drop",
|
|
369
|
+
drag: r,
|
|
370
|
+
over: D(c.over),
|
|
371
|
+
dropped: c.dropped,
|
|
372
|
+
accepted: [...c.accepted],
|
|
373
|
+
rejected: c.active.ids.filter((S) => !u.has(S)),
|
|
374
|
+
waited: d() ?? 0,
|
|
375
|
+
sortable: h()
|
|
376
|
+
}), f();
|
|
377
|
+
},
|
|
378
|
+
onDragCancel(c) {
|
|
379
|
+
const u = v === null ? "cancelled" : c.over && !c.over.accepted ? "refused" : "rejected";
|
|
380
|
+
l({ type: "cancel", drag: r, reason: u, over: D(c.over), waited: d(), sortable: h() }), f();
|
|
381
|
+
}
|
|
382
|
+
}, b = () => {
|
|
383
|
+
const c = { flush: "sync" };
|
|
384
|
+
k(e.status, (u) => l({ type: "status", status: u }), c), k(e.isAutoScrolling, (u) => l({ type: "autoScroll", scrolling: u }), c), k(
|
|
385
|
+
e.announcement,
|
|
386
|
+
(u) => {
|
|
387
|
+
u.trim() && l({ type: "announcement", text: u.trim() });
|
|
388
|
+
},
|
|
389
|
+
c
|
|
390
|
+
), k(
|
|
391
|
+
() => [...e.selection],
|
|
392
|
+
(u) => l({ type: "selection", ids: u })
|
|
393
|
+
);
|
|
394
|
+
};
|
|
395
|
+
return E;
|
|
396
|
+
}
|
|
397
|
+
const pe = 200, I = 4, O = (e) => e.split(" "), N = new Set(
|
|
398
|
+
O(
|
|
399
|
+
"color font-family font-size font-weight font-style font-variant font-feature-settings line-height letter-spacing text-align text-transform text-shadow white-space word-break overflow-wrap direction visibility list-style-type"
|
|
400
|
+
)
|
|
401
|
+
), fe = [
|
|
402
|
+
...N,
|
|
403
|
+
...O(
|
|
404
|
+
"display opacity filter box-shadow outline background overflow text-overflow text-decoration-line border-radius padding border-width border-style border-color flex-flow place-content place-items gap position z-index vertical-align flex object-fit"
|
|
405
|
+
)
|
|
406
|
+
], K = O("grid-template-columns grid-template-rows margin inset transform translate rotate scale"), ve = O("width height"), P = (e, o, t = /* @__PURE__ */ new Map()) => {
|
|
407
|
+
for (const n of o) t.set(n, e.getPropertyValue(n));
|
|
408
|
+
return t;
|
|
409
|
+
}, he = (e, o) => {
|
|
410
|
+
const t = [{ source: e, clone: o, passes: [] }];
|
|
411
|
+
for (const n of t)
|
|
412
|
+
n.source.localName !== "svg" && [...n.source.children].forEach((a, s) => {
|
|
413
|
+
const r = n.clone.children[s];
|
|
414
|
+
r && t.length < pe && t.push({ source: a, clone: r, parent: n, passes: [] });
|
|
415
|
+
});
|
|
416
|
+
return t;
|
|
417
|
+
}, me = (e, o) => {
|
|
418
|
+
for (let t = 0; t < e.length; t++) {
|
|
419
|
+
const n = e.item(t);
|
|
420
|
+
n.startsWith("--") && o.set(n, e.getPropertyValue(n));
|
|
421
|
+
}
|
|
422
|
+
return o;
|
|
423
|
+
}, ge = (e) => {
|
|
424
|
+
const o = getComputedStyle(e.source), { parent: t } = e, n = P(o, t ? ve : []), a = P(o, fe);
|
|
425
|
+
e.passes = [
|
|
426
|
+
t ? a : me(o, a),
|
|
427
|
+
P(o, t ? K : K.slice(0, 2)),
|
|
428
|
+
n,
|
|
429
|
+
n,
|
|
430
|
+
/* @__PURE__ */ new Map()
|
|
431
|
+
];
|
|
432
|
+
}, be = (e, o) => {
|
|
433
|
+
try {
|
|
434
|
+
return e.styleMap ??= e.source.computedStyleMap?.() ?? null, e.styleMap?.get(o)?.toString();
|
|
435
|
+
} catch {
|
|
436
|
+
}
|
|
437
|
+
}, ye = (e, o) => {
|
|
438
|
+
const { clone: t, parent: n, passes: a } = e, s = getComputedStyle(t), r = [];
|
|
439
|
+
for (const [i, v] of a[o]) {
|
|
440
|
+
let p = s.getPropertyValue(i);
|
|
441
|
+
const y = N.has(i);
|
|
442
|
+
if (a[I].set(i, p), y && n && p === n.passes[I].get(i) && (p = n.passes[0].get(i)), p === v || o > 1 && Math.abs(parseFloat(p) - parseFloat(v)) < 0.5) continue;
|
|
443
|
+
const w = o % 3 || y ? be(e, i) : void 0;
|
|
444
|
+
o === 2 && /^[a-z-]*$/.test(w + "") || r.push(() => t.style.setProperty(i, w ?? v));
|
|
445
|
+
}
|
|
446
|
+
return r;
|
|
447
|
+
}, we = (e, o) => {
|
|
448
|
+
const t = e.map((s) => ({ ...s, entries: he(s.source, s.clone) }));
|
|
449
|
+
for (const s of t) s.entries.forEach(ge);
|
|
450
|
+
const n = t.map((s) => s.source.getBoundingClientRect()), a = t.map((s, r) => {
|
|
451
|
+
const i = document.createElement("div");
|
|
452
|
+
return i.style.cssText = `position:fixed;contain:strict;width:${n[r].width}px;height:${n[r].height}px`, i.appendChild(s.mount), i;
|
|
453
|
+
});
|
|
454
|
+
o.append(...a);
|
|
455
|
+
try {
|
|
456
|
+
for (let s = 0; s < 4; s++) {
|
|
457
|
+
for (const r of t) r.mount.getAnimations?.({ subtree: !0 }).forEach((i) => i.cancel());
|
|
458
|
+
t.flatMap((r) => r.entries.flatMap((i) => ye(i, s))).forEach((r) => r());
|
|
459
|
+
}
|
|
460
|
+
} finally {
|
|
461
|
+
for (const s of t) s.mount.remove();
|
|
462
|
+
for (const s of a) s.remove();
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
let Se = 0;
|
|
466
|
+
const ke = (e, o) => {
|
|
467
|
+
const t = e.querySelectorAll("input, textarea, select"), n = o.querySelectorAll("input, textarea, select"), a = `-dnd-clone-${++Se}`;
|
|
468
|
+
t.forEach((s, r) => {
|
|
469
|
+
const i = n[r];
|
|
470
|
+
i && (s instanceof HTMLInputElement && i instanceof HTMLInputElement ? (i.value = s.value, i.checked = s.checked, s.type === "radio" && s.name && (i.name = s.name + a)) : s instanceof HTMLTextAreaElement && i instanceof HTMLTextAreaElement ? i.value = s.value : s instanceof HTMLSelectElement && i instanceof HTMLSelectElement && (i.selectedIndex = s.selectedIndex));
|
|
471
|
+
});
|
|
472
|
+
}, De = (e, o) => {
|
|
473
|
+
const t = e.querySelectorAll("canvas"), n = o.querySelectorAll("canvas");
|
|
474
|
+
t.forEach((a, s) => {
|
|
475
|
+
const r = n[s];
|
|
476
|
+
try {
|
|
477
|
+
r?.getContext("2d")?.drawImage(a, 0, 0);
|
|
478
|
+
} catch {
|
|
479
|
+
}
|
|
480
|
+
});
|
|
481
|
+
}, Ee = (e, o) => {
|
|
482
|
+
const t = document.createElement("table"), n = document.createElement("tbody");
|
|
483
|
+
t.style.borderCollapse = "collapse", t.style.width = "100%", t.style.height = "100%";
|
|
484
|
+
const a = o.children;
|
|
485
|
+
return Array.from(e.children).forEach((s, r) => {
|
|
486
|
+
const i = a[r]?.getBoundingClientRect().width;
|
|
487
|
+
i && (s.style.width = `${i}px`);
|
|
488
|
+
}), n.appendChild(e), t.appendChild(n), t;
|
|
489
|
+
}, Me = ".v-ripple__container, .q-ripple, .p-ink, .n-base-wave", j = /* @__PURE__ */ new WeakSet(), xe = (e) => {
|
|
490
|
+
for (const o of e.querySelectorAll("*"))
|
|
491
|
+
(j.has(o) || o.matches(Me)) && o.remove();
|
|
492
|
+
}, Oe = (e) => {
|
|
493
|
+
const o = e.cloneNode(!0);
|
|
494
|
+
for (const t of [o, ...o.querySelectorAll("*")]) {
|
|
495
|
+
t.removeAttribute("id"), t.hasAttribute("data-dnd-no-clone") && j.add(t);
|
|
496
|
+
for (const n of t.getAttributeNames())
|
|
497
|
+
n.startsWith("data-dnd-") && t.removeAttribute(n);
|
|
498
|
+
}
|
|
499
|
+
return ke(e, o), De(e, o), o.setAttribute("aria-hidden", "true"), o.removeAttribute("tabindex"), o;
|
|
500
|
+
}, Ce = (e, o = {}) => Pe([e], o)[0], Te = (e) => {
|
|
501
|
+
const o = Oe(e), t = getComputedStyle(e), n = document.createElement("div");
|
|
502
|
+
n.style.cssText = "width:100%;height:100%";
|
|
503
|
+
for (let a = 0; a < t.length; a++) {
|
|
504
|
+
const s = t.item(a);
|
|
505
|
+
s.startsWith("--") && n.style.setProperty(s, t.getPropertyValue(s));
|
|
506
|
+
}
|
|
507
|
+
return Object.assign(o.style, {
|
|
508
|
+
width: "100%",
|
|
509
|
+
height: "100%",
|
|
510
|
+
margin: "0",
|
|
511
|
+
boxSizing: "border-box",
|
|
512
|
+
transform: "none",
|
|
513
|
+
translate: "none",
|
|
514
|
+
transition: "none",
|
|
515
|
+
pointerEvents: "none"
|
|
516
|
+
}), n.appendChild(e.tagName === "TR" ? Ee(o, e) : o), { source: e, clone: o, mount: n, positioned: t.position !== "static" };
|
|
517
|
+
}, Pe = (e, { container: o } = {}) => {
|
|
518
|
+
const t = e.map(Te);
|
|
519
|
+
return we(t, o ?? document.body), t.map(({ clone: n, mount: a, positioned: s }) => (xe(n), n.style.removeProperty("transition"), s && Object.assign(n.style, { position: "relative", inset: "auto" }), a));
|
|
520
|
+
}, A = "__VUE_DND_KIT_DEVTOOLS_HOOK__";
|
|
521
|
+
let M = null;
|
|
522
|
+
function Re() {
|
|
523
|
+
if (M) return M;
|
|
524
|
+
const e = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(), t = (r) => {
|
|
525
|
+
for (const i of o)
|
|
526
|
+
try {
|
|
527
|
+
r(i);
|
|
528
|
+
} catch (v) {
|
|
529
|
+
console.error(v);
|
|
530
|
+
}
|
|
531
|
+
}, n = () => [...o].some((r) => r.event), a = {
|
|
532
|
+
provider(r) {
|
|
533
|
+
if (e.has(r)) return;
|
|
534
|
+
const i = ue(r, (v, p) => t((y) => y.event?.(v, p)));
|
|
535
|
+
e.set(r, i), n() && i.follow(), H() && Z(() => {
|
|
536
|
+
e.get(r) === i && (i.stop(), e.delete(r), t((v) => v.removed?.(i)));
|
|
537
|
+
}), t((v) => v.added?.(i));
|
|
538
|
+
},
|
|
539
|
+
group(r) {
|
|
540
|
+
e.get(r.manager)?.addGroup(r);
|
|
541
|
+
},
|
|
542
|
+
sensor(r, i, v, p) {
|
|
543
|
+
e.get(r)?.sensorStarts(i, v, p);
|
|
544
|
+
}
|
|
545
|
+
};
|
|
546
|
+
globalThis[A] = a;
|
|
547
|
+
const s = {
|
|
548
|
+
providers: () => [...e.values()],
|
|
549
|
+
subscribe(r) {
|
|
550
|
+
if (o.add(r), r.event) for (const i of e.values()) i.follow();
|
|
551
|
+
return () => {
|
|
552
|
+
o.delete(r);
|
|
553
|
+
};
|
|
554
|
+
},
|
|
555
|
+
disconnect() {
|
|
556
|
+
const r = globalThis;
|
|
557
|
+
r[A] === a && delete r[A];
|
|
558
|
+
for (const i of e.values()) i.stop();
|
|
559
|
+
e.clear(), o.clear(), M === s && (M = null);
|
|
560
|
+
}
|
|
561
|
+
};
|
|
562
|
+
return M = s, s;
|
|
563
|
+
}
|
|
564
|
+
export {
|
|
565
|
+
Ce as clonePreview,
|
|
566
|
+
Re as connectDevtools,
|
|
567
|
+
Oe as copyElement
|
|
568
|
+
};
|
|
569
|
+
//# sourceMappingURL=devtools.js.map
|