@caspeco/casper-ui-library 10.0.0 → 10.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.
- package/dist/components/image-upload/image-upload-dropzone.js +88 -86
- package/dist/components/image-upload/image-upload-helper.d.ts +3 -0
- package/dist/components/image-upload/image-upload-helper.d.ts.map +1 -1
- package/dist/components/image-upload/image-upload-helper.js +20 -3
- package/dist/components/image-upload/image-upload-modal.d.ts.map +1 -1
- package/dist/components/image-upload/image-upload-modal.js +98 -73
- package/dist/components/image-upload/translations.d.ts +7 -0
- package/dist/components/image-upload/translations.d.ts.map +1 -1
- package/dist/components/image-upload/translations.js +6 -0
- package/dist/node_modules/@dnd-kit/dom/index.js +237 -233
- package/dist/node_modules/@dnd-kit/dom/sortable.js +367 -326
- package/dist/node_modules/@dnd-kit/dom/utilities.js +11 -11
- package/dist/node_modules/@dnd-kit/react/sortable.js +55 -40
- package/package.json +20 -20
|
@@ -1,114 +1,114 @@
|
|
|
1
|
-
import { WeakStore as
|
|
2
|
-
import { Plugin as
|
|
3
|
-
import { closestCorners as
|
|
4
|
-
import { Droppable as
|
|
5
|
-
import { isKeyboardEvent as
|
|
6
|
-
import { Rectangle as
|
|
7
|
-
import { effect as
|
|
8
|
-
var
|
|
1
|
+
import { WeakStore as Ge, reactive as ne } from "../state/dist/index.js";
|
|
2
|
+
import { Plugin as _e, resolveCustomizable as ie } from "../abstract/index.js";
|
|
3
|
+
import { closestCorners as ke, defaultCollisionDetection as Te } from "../collision/dist/index.js";
|
|
4
|
+
import { Droppable as je, Draggable as Ce, Scroller as Me, Feedback as Re } from "./index.js";
|
|
5
|
+
import { isKeyboardEvent as oe, DOMRectangle as se, getVisibleBoundingRectangle as ze, scrollIntoViewIfNeeded as Ae, ProxiedElements as We, getComputedStyles as Be, computeTranslate as ae, prefersReducedMotion as $e, getWindow as Le, animateTransform as Ke } from "./utilities.js";
|
|
6
|
+
import { Rectangle as le } from "../geometry/dist/index.js";
|
|
7
|
+
import { effect as Ne, batch as w, untracked as de } from "../../@preact/signals-core/dist/signals-core.module.js";
|
|
8
|
+
var Ve = Object.create, xe = Object.defineProperty, qe = Object.defineProperties, Fe = Object.getOwnPropertyDescriptor, He = Object.getOwnPropertyDescriptors, F = Object.getOwnPropertySymbols, ye = Object.prototype.hasOwnProperty, Ie = Object.prototype.propertyIsEnumerable, Je = (e, t) => (t = Symbol[e]) ? t : /* @__PURE__ */ Symbol.for("Symbol." + e), $ = (e) => {
|
|
9
9
|
throw TypeError(e);
|
|
10
|
-
},
|
|
10
|
+
}, X = (e, t, r) => t in e ? xe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, J = (e, t) => {
|
|
11
11
|
for (var r in t || (t = {}))
|
|
12
|
-
|
|
13
|
-
if (
|
|
14
|
-
for (var r of
|
|
15
|
-
|
|
12
|
+
ye.call(t, r) && X(e, r, t[r]);
|
|
13
|
+
if (F)
|
|
14
|
+
for (var r of F(t))
|
|
15
|
+
Ie.call(t, r) && X(e, r, t[r]);
|
|
16
16
|
return e;
|
|
17
|
-
},
|
|
17
|
+
}, Q = (e, t) => qe(e, He(t)), Qe = (e, t) => {
|
|
18
18
|
var r = {};
|
|
19
|
-
for (var
|
|
20
|
-
|
|
21
|
-
if (e != null &&
|
|
22
|
-
for (var
|
|
23
|
-
t.indexOf(
|
|
19
|
+
for (var n in e)
|
|
20
|
+
ye.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
|
|
21
|
+
if (e != null && F)
|
|
22
|
+
for (var n of F(e))
|
|
23
|
+
t.indexOf(n) < 0 && Ie.call(e, n) && (r[n] = e[n]);
|
|
24
24
|
return r;
|
|
25
|
-
},
|
|
25
|
+
}, Ue = (e) => {
|
|
26
26
|
var t;
|
|
27
|
-
return [, , ,
|
|
28
|
-
},
|
|
29
|
-
for (var
|
|
30
|
-
return
|
|
31
|
-
},
|
|
32
|
-
for (var
|
|
33
|
-
return
|
|
34
|
-
}, set [r](
|
|
35
|
-
return
|
|
36
|
-
} }, r)),
|
|
37
|
-
|
|
38
|
-
return I &&
|
|
39
|
-
},
|
|
40
|
-
function
|
|
41
|
-
return e instanceof
|
|
27
|
+
return [, , , Ve((t = void 0) != null ? t : null)];
|
|
28
|
+
}, Oe = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], z = (e) => e !== void 0 && typeof e != "function" ? $("Function expected") : e, Xe = (e, t, r, n, a) => ({ kind: Oe[e], name: t, metadata: n, addInitializer: (i) => r._ ? $("Already initialized") : a.push(z(i || null)) }), Ye = (e, t) => X(t, Je("metadata"), e[3]), L = (e, t, r, n) => {
|
|
29
|
+
for (var a = 0, i = e[t >> 1], o = i && i.length; a < o; a++) t & 1 ? i[a].call(r) : n = i[a].call(r, n);
|
|
30
|
+
return n;
|
|
31
|
+
}, Pe = (e, t, r, n, a, i) => {
|
|
32
|
+
for (var o, l, h, v, c, u = t & 7, _ = !1, b = !1, g = e.length + 1, f = Oe[u + 5], O = e[g - 1] = [], x = e[g] || (e[g] = []), I = (a = a.prototype, Fe({ get [r]() {
|
|
33
|
+
return A(this, i);
|
|
34
|
+
}, set [r](p) {
|
|
35
|
+
return G(this, i, p);
|
|
36
|
+
} }, r)), d = n.length - 1; d >= 0; d--)
|
|
37
|
+
v = Xe(u, r, h = {}, e[3], x), v.static = _, v.private = b, c = v.access = { has: (p) => r in p }, c.get = (p) => p[r], c.set = (p, s) => p[r] = s, l = (0, n[d])({ get: I.get, set: I.set }, v), h._ = 1, l === void 0 ? z(l) && (I[f] = l) : typeof l != "object" || l === null ? $("Object expected") : (z(o = l.get) && (I.get = o), z(o = l.set) && (I.set = o), z(o = l.init) && O.unshift(o));
|
|
38
|
+
return I && xe(a, r, I), a;
|
|
39
|
+
}, we = (e, t, r) => t.has(e) || $("Cannot " + r), A = (e, t, r) => (we(e, t, "read from private field"), t.get(e)), R = (e, t, r) => t.has(e) ? $("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), G = (e, t, r, n) => (we(e, t, "write to private field"), t.set(e, r), r);
|
|
40
|
+
function m(e) {
|
|
41
|
+
return e instanceof te || e instanceof De;
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
return
|
|
43
|
+
function yt(e) {
|
|
44
|
+
return m(e.source) && m(e.target);
|
|
45
45
|
}
|
|
46
|
-
var
|
|
46
|
+
var K = 10, Ze = class extends _e {
|
|
47
47
|
constructor(e) {
|
|
48
48
|
super(e);
|
|
49
|
-
const t =
|
|
50
|
-
const { dragOperation:
|
|
51
|
-
if (
|
|
52
|
-
const
|
|
53
|
-
if (
|
|
54
|
-
return
|
|
49
|
+
const t = Ne(() => {
|
|
50
|
+
const { dragOperation: n } = e;
|
|
51
|
+
if (oe(n.activatorEvent) && m(n.source) && n.status.initialized) {
|
|
52
|
+
const a = e.registry.plugins.get(Me);
|
|
53
|
+
if (a)
|
|
54
|
+
return a.disable(), () => a.enable();
|
|
55
55
|
}
|
|
56
56
|
}), r = e.monitor.addEventListener(
|
|
57
57
|
"dragmove",
|
|
58
|
-
(
|
|
58
|
+
(n, a) => {
|
|
59
59
|
queueMicrotask(() => {
|
|
60
|
-
if (this.disabled ||
|
|
60
|
+
if (this.disabled || n.defaultPrevented || !n.nativeEvent)
|
|
61
61
|
return;
|
|
62
|
-
const { dragOperation:
|
|
63
|
-
if (!
|
|
62
|
+
const { dragOperation: i } = a;
|
|
63
|
+
if (!oe(n.nativeEvent) || !m(i.source) || !i.shape)
|
|
64
64
|
return;
|
|
65
|
-
const { actions:
|
|
66
|
-
if (!
|
|
65
|
+
const { actions: o, collisionObserver: l, registry: h } = a, { by: v } = n;
|
|
66
|
+
if (!v)
|
|
67
67
|
return;
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
for (const
|
|
71
|
-
const { id:
|
|
72
|
-
if (!
|
|
68
|
+
const c = et(v), { source: u, target: _ } = i, { center: b } = i.shape.current, g = [], f = [];
|
|
69
|
+
w(() => {
|
|
70
|
+
for (const s of h.droppables) {
|
|
71
|
+
const { id: y } = s;
|
|
72
|
+
if (!s.accepts(u) || y === _?.id && m(s) || !s.element)
|
|
73
73
|
continue;
|
|
74
|
-
let
|
|
75
|
-
const
|
|
76
|
-
getBoundingClientRect: (
|
|
74
|
+
let P = s.shape;
|
|
75
|
+
const S = new se(s.element, {
|
|
76
|
+
getBoundingClientRect: (C) => ze(C, void 0, 0.2)
|
|
77
77
|
});
|
|
78
|
-
!
|
|
78
|
+
!S.height || !S.width || (c == "down" && b.y + K < S.center.y || c == "up" && b.y - K > S.center.y || c == "left" && b.x - K > S.center.x || c == "right" && b.x + K < S.center.x) && (g.push(s), s.shape = S, f.push(() => s.shape = P));
|
|
79
79
|
}
|
|
80
|
-
}),
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
}), n.preventDefault(), l.disable();
|
|
81
|
+
const O = l.computeCollisions(
|
|
82
|
+
g,
|
|
83
|
+
ke
|
|
84
84
|
);
|
|
85
|
-
|
|
86
|
-
const [
|
|
87
|
-
if (!
|
|
85
|
+
w(() => f.forEach((s) => s()));
|
|
86
|
+
const [x] = O;
|
|
87
|
+
if (!x)
|
|
88
88
|
return;
|
|
89
|
-
const { id: I } =
|
|
90
|
-
|
|
91
|
-
const { source:
|
|
92
|
-
if (!
|
|
89
|
+
const { id: I } = x, { index: d, group: p } = u.sortable;
|
|
90
|
+
o.setDropTarget(I).then(() => {
|
|
91
|
+
const { source: s, target: y, shape: P } = i;
|
|
92
|
+
if (!s || !m(s) || !P)
|
|
93
93
|
return;
|
|
94
94
|
const {
|
|
95
|
-
index:
|
|
96
|
-
group:
|
|
97
|
-
target:
|
|
98
|
-
} =
|
|
99
|
-
if (!
|
|
100
|
-
|
|
101
|
-
const
|
|
102
|
-
if (!
|
|
95
|
+
index: S,
|
|
96
|
+
group: C,
|
|
97
|
+
target: M
|
|
98
|
+
} = s.sortable, E = d !== S || p !== C, H = E ? M : y?.element;
|
|
99
|
+
if (!H) return;
|
|
100
|
+
Ae(H);
|
|
101
|
+
const re = new se(H);
|
|
102
|
+
if (!re)
|
|
103
103
|
return;
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
const Ee = le.delta(
|
|
105
|
+
re,
|
|
106
|
+
le.from(P.current.boundingRectangle),
|
|
107
|
+
s.alignment
|
|
108
108
|
);
|
|
109
|
-
|
|
110
|
-
by:
|
|
111
|
-
}),
|
|
109
|
+
o.move({
|
|
110
|
+
by: Ee
|
|
111
|
+
}), E ? o.setDropTarget(s.id).then(() => l.enable()) : l.enable();
|
|
112
112
|
});
|
|
113
113
|
});
|
|
114
114
|
}
|
|
@@ -118,7 +118,7 @@ var F = 10, Qe = class extends he {
|
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
120
|
};
|
|
121
|
-
function
|
|
121
|
+
function et(e) {
|
|
122
122
|
const { x: t, y: r } = e;
|
|
123
123
|
if (t > 0)
|
|
124
124
|
return "right";
|
|
@@ -129,101 +129,108 @@ function Ue(e) {
|
|
|
129
129
|
if (r < 0)
|
|
130
130
|
return "up";
|
|
131
131
|
}
|
|
132
|
-
var
|
|
132
|
+
var tt = Object.defineProperty, rt = Object.defineProperties, nt = Object.getOwnPropertyDescriptors, ce = Object.getOwnPropertySymbols, it = Object.prototype.hasOwnProperty, ot = Object.prototype.propertyIsEnumerable, ue = (e, t, r) => t in e ? tt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, k = (e, t) => {
|
|
133
133
|
for (var r in t || (t = {}))
|
|
134
|
-
|
|
134
|
+
it.call(t, r) && ue(e, r, t[r]);
|
|
135
135
|
if (ce)
|
|
136
136
|
for (var r of ce(t))
|
|
137
|
-
|
|
137
|
+
ot.call(t, r) && ue(e, r, t[r]);
|
|
138
138
|
return e;
|
|
139
|
-
},
|
|
140
|
-
function
|
|
139
|
+
}, T = (e, t) => rt(e, nt(t));
|
|
140
|
+
function st(e, t, r) {
|
|
141
141
|
if (t === r)
|
|
142
142
|
return e;
|
|
143
|
-
const
|
|
144
|
-
return
|
|
143
|
+
const n = e.slice();
|
|
144
|
+
return n.splice(r, 0, n.splice(t, 1)[0]), n;
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function N(e, t) {
|
|
147
|
+
const r = String(t);
|
|
148
|
+
return Object.prototype.hasOwnProperty.call(e, r) ? r : void 0;
|
|
149
|
+
}
|
|
150
|
+
function U(e) {
|
|
147
151
|
return "initialIndex" in e && typeof e.initialIndex == "number" && "index" in e && typeof e.index == "number";
|
|
148
152
|
}
|
|
149
|
-
function
|
|
150
|
-
var
|
|
151
|
-
const { source:
|
|
152
|
-
if (!
|
|
153
|
+
function at(e, t, r) {
|
|
154
|
+
var n, a;
|
|
155
|
+
const { source: i, target: o, canceled: l } = t.operation;
|
|
156
|
+
if (!i || !o || l)
|
|
153
157
|
return "preventDefault" in t && t.preventDefault(), e;
|
|
154
|
-
const
|
|
158
|
+
const h = (d, p) => d === p || d !== null && typeof d == "object" && "id" in d && d.id === p;
|
|
155
159
|
if (Array.isArray(e)) {
|
|
156
|
-
const d = e.findIndex((
|
|
157
|
-
if (d === -1 ||
|
|
158
|
-
if (
|
|
159
|
-
const
|
|
160
|
-
return
|
|
160
|
+
const d = e.findIndex((s) => h(s, i.id)), p = e.findIndex((s) => h(s, o.id));
|
|
161
|
+
if (d === -1 || p === -1) {
|
|
162
|
+
if (U(i)) {
|
|
163
|
+
const s = i.initialIndex, y = i.index;
|
|
164
|
+
return s === y || s < 0 || s >= e.length ? ("preventDefault" in t && t.preventDefault(), e) : r(e, s, y);
|
|
161
165
|
}
|
|
162
166
|
return e;
|
|
163
167
|
}
|
|
164
|
-
if (!
|
|
165
|
-
const
|
|
166
|
-
if (
|
|
167
|
-
return r(e, d,
|
|
168
|
+
if (!l && "index" in i && typeof i.index == "number") {
|
|
169
|
+
const s = i.index;
|
|
170
|
+
if (s !== d)
|
|
171
|
+
return r(e, d, s);
|
|
168
172
|
}
|
|
169
|
-
return r(e, d,
|
|
173
|
+
return r(e, d, p);
|
|
170
174
|
}
|
|
171
|
-
const
|
|
172
|
-
let
|
|
173
|
-
for (const [d,
|
|
174
|
-
if (
|
|
175
|
+
const v = Object.entries(e);
|
|
176
|
+
let c = -1, u, _ = -1, b;
|
|
177
|
+
for (const [d, p] of v)
|
|
178
|
+
if (c === -1 && (c = p.findIndex((s) => h(s, i.id)), c !== -1 && (u = d)), _ === -1 && (_ = p.findIndex((s) => h(s, o.id)), _ !== -1 && (b = d)), c !== -1 && _ !== -1)
|
|
175
179
|
break;
|
|
176
|
-
if (
|
|
177
|
-
const d =
|
|
178
|
-
if (d == null ||
|
|
180
|
+
if (c === -1 && U(i)) {
|
|
181
|
+
const d = i.initialGroup == null ? void 0 : N(e, i.initialGroup), p = i.initialIndex, s = i.group == null ? void 0 : N(e, i.group), y = i.index;
|
|
182
|
+
if (d == null || s == null || d === s && p === y)
|
|
179
183
|
return "preventDefault" in t && t.preventDefault(), e;
|
|
180
|
-
if (d ===
|
|
181
|
-
return
|
|
182
|
-
[d]: r(e[d],
|
|
184
|
+
if (d === s)
|
|
185
|
+
return T(k({}, e), {
|
|
186
|
+
[d]: r(e[d], p, y)
|
|
183
187
|
});
|
|
184
|
-
const
|
|
185
|
-
return
|
|
188
|
+
const P = e[d][p];
|
|
189
|
+
return T(k({}, e), {
|
|
186
190
|
[d]: [
|
|
187
|
-
...e[d].slice(0,
|
|
188
|
-
...e[d].slice(
|
|
191
|
+
...e[d].slice(0, p),
|
|
192
|
+
...e[d].slice(p + 1)
|
|
189
193
|
],
|
|
190
|
-
[
|
|
191
|
-
...e[
|
|
192
|
-
|
|
193
|
-
...e[
|
|
194
|
+
[s]: [
|
|
195
|
+
...e[s].slice(0, y),
|
|
196
|
+
P,
|
|
197
|
+
...e[s].slice(y)
|
|
194
198
|
]
|
|
195
199
|
});
|
|
196
200
|
}
|
|
197
|
-
if (!
|
|
198
|
-
const { dragOperation:
|
|
199
|
-
if (
|
|
200
|
-
const d =
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
201
|
+
if (!i.manager) return e;
|
|
202
|
+
const { dragOperation: g } = i.manager, f = (a = (n = g.shape) == null ? void 0 : n.current.center) != null ? a : g.position.current;
|
|
203
|
+
if (b == null) {
|
|
204
|
+
const d = N(e, o.id);
|
|
205
|
+
if (d != null) {
|
|
206
|
+
const p = o.shape && f.y > o.shape.center.y ? e[d].length : 0;
|
|
207
|
+
b = d, _ = p;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
if (u == null || b == null || u === b && c === _) {
|
|
211
|
+
if (u != null && u === b && c === _ && U(i)) {
|
|
212
|
+
const d = i.group == null ? void 0 : N(e, i.group), p = i.group != null && d !== u, s = i.index !== c;
|
|
213
|
+
if (p || s) {
|
|
214
|
+
const y = i.group == null ? u : d;
|
|
215
|
+
if (y != null) {
|
|
216
|
+
if (u === y)
|
|
217
|
+
return T(k({}, e), {
|
|
218
|
+
[u]: r(
|
|
219
|
+
e[u],
|
|
220
|
+
c,
|
|
221
|
+
i.index
|
|
215
222
|
)
|
|
216
223
|
});
|
|
217
|
-
const
|
|
218
|
-
return
|
|
219
|
-
[a]: [
|
|
220
|
-
...e[a].slice(0, g),
|
|
221
|
-
...e[a].slice(g + 1)
|
|
222
|
-
],
|
|
224
|
+
const P = e[u][c];
|
|
225
|
+
return T(k({}, e), {
|
|
223
226
|
[u]: [
|
|
224
|
-
...e[u].slice(0,
|
|
225
|
-
|
|
226
|
-
|
|
227
|
+
...e[u].slice(0, c),
|
|
228
|
+
...e[u].slice(c + 1)
|
|
229
|
+
],
|
|
230
|
+
[y]: [
|
|
231
|
+
...e[y].slice(0, i.index),
|
|
232
|
+
P,
|
|
233
|
+
...e[y].slice(i.index)
|
|
227
234
|
]
|
|
228
235
|
});
|
|
229
236
|
}
|
|
@@ -231,98 +238,109 @@ function nt(e, t, r) {
|
|
|
231
238
|
}
|
|
232
239
|
return "preventDefault" in t && t.preventDefault(), e;
|
|
233
240
|
}
|
|
234
|
-
if (
|
|
235
|
-
return
|
|
236
|
-
[
|
|
241
|
+
if (u === b)
|
|
242
|
+
return T(k({}, e), {
|
|
243
|
+
[u]: r(e[u], c, _)
|
|
237
244
|
});
|
|
238
|
-
const
|
|
239
|
-
return
|
|
240
|
-
[
|
|
241
|
-
...e[
|
|
242
|
-
...e[
|
|
245
|
+
const x = o.shape && Math.round(f.y) > Math.round(o.shape.center.y) ? 1 : 0, I = e[u][c];
|
|
246
|
+
return T(k({}, e), {
|
|
247
|
+
[u]: [
|
|
248
|
+
...e[u].slice(0, c),
|
|
249
|
+
...e[u].slice(c + 1)
|
|
243
250
|
],
|
|
244
|
-
[
|
|
245
|
-
...e[
|
|
246
|
-
|
|
247
|
-
...e[
|
|
251
|
+
[b]: [
|
|
252
|
+
...e[b].slice(0, _ + x),
|
|
253
|
+
I,
|
|
254
|
+
...e[b].slice(_ + x)
|
|
248
255
|
]
|
|
249
256
|
});
|
|
250
257
|
}
|
|
251
|
-
function
|
|
252
|
-
return
|
|
258
|
+
function lt(e, t) {
|
|
259
|
+
return at(e, t, st);
|
|
253
260
|
}
|
|
254
|
-
|
|
261
|
+
function pe(e) {
|
|
262
|
+
const t = /* @__PURE__ */ new Map();
|
|
263
|
+
for (const [, r] of e)
|
|
264
|
+
for (const n of r)
|
|
265
|
+
t.set(n.id, n.index);
|
|
266
|
+
return t;
|
|
267
|
+
}
|
|
268
|
+
function ge(e, t, r) {
|
|
269
|
+
var n;
|
|
270
|
+
for (const [a, i] of t)
|
|
271
|
+
for (const o of i) {
|
|
272
|
+
const l = e.get(o.id);
|
|
273
|
+
if (o.index !== l || o.group !== a || !((n = r.get(a)) != null && n.has(o)))
|
|
274
|
+
return !0;
|
|
275
|
+
}
|
|
276
|
+
return !1;
|
|
277
|
+
}
|
|
278
|
+
var fe = "__default__", dt = class extends _e {
|
|
255
279
|
constructor(e) {
|
|
256
280
|
super(e);
|
|
257
281
|
const t = () => {
|
|
258
|
-
const
|
|
259
|
-
for (const
|
|
260
|
-
if (
|
|
261
|
-
const { sortable:
|
|
262
|
-
let
|
|
263
|
-
|
|
282
|
+
const n = /* @__PURE__ */ new Map();
|
|
283
|
+
for (const a of e.registry.droppables)
|
|
284
|
+
if (a instanceof te) {
|
|
285
|
+
const { sortable: i } = a, { group: o } = i;
|
|
286
|
+
let l = n.get(o);
|
|
287
|
+
l || (l = /* @__PURE__ */ new Set(), n.set(o, l)), l.add(i);
|
|
264
288
|
}
|
|
265
|
-
|
|
266
|
-
i.set(o, new Set(K(p)));
|
|
267
|
-
return i;
|
|
289
|
+
return n;
|
|
268
290
|
}, r = [
|
|
269
|
-
e.monitor.addEventListener("dragover", (
|
|
291
|
+
e.monitor.addEventListener("dragover", (n, a) => {
|
|
270
292
|
if (this.disabled)
|
|
271
293
|
return;
|
|
272
|
-
const { dragOperation:
|
|
273
|
-
if (!
|
|
294
|
+
const { dragOperation: i } = a, { source: o, target: l } = i;
|
|
295
|
+
if (!m(o) || !m(l) || o.sortable === l.sortable)
|
|
274
296
|
return;
|
|
275
|
-
const
|
|
276
|
-
!
|
|
277
|
-
|
|
278
|
-
var
|
|
279
|
-
const
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
const y = n.sortable.element, w = s.sortable.element;
|
|
287
|
-
if (!w || !y || !b && s.id === n.sortable.group)
|
|
297
|
+
const h = t(), v = pe(h), c = o.sortable.group === l.sortable.group, u = h.get(o.sortable.group), _ = c ? u : h.get(l.sortable.group);
|
|
298
|
+
!u || !_ || queueMicrotask(() => {
|
|
299
|
+
n.defaultPrevented || a.renderer.rendering.then(() => {
|
|
300
|
+
var b, g;
|
|
301
|
+
const f = t();
|
|
302
|
+
if (ge(v, h, f))
|
|
303
|
+
return;
|
|
304
|
+
const O = o.sortable.element, x = l.sortable.element;
|
|
305
|
+
if (!x || !O || !c && l.id === o.sortable.group)
|
|
288
306
|
return;
|
|
289
|
-
const I =
|
|
290
|
-
[
|
|
291
|
-
[
|
|
292
|
-
},
|
|
293
|
-
if (
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
-
for (const [
|
|
297
|
-
|
|
298
|
-
if (!
|
|
299
|
-
for (const [
|
|
300
|
-
|
|
301
|
-
}),
|
|
307
|
+
const I = V(u), d = c ? I : V(_), p = (b = o.sortable.group) != null ? b : fe, s = (g = l.sortable.group) != null ? g : fe, y = {
|
|
308
|
+
[p]: I,
|
|
309
|
+
[s]: d
|
|
310
|
+
}, P = lt(y, n);
|
|
311
|
+
if (y === P) return;
|
|
312
|
+
const S = P[s].indexOf(o.sortable), C = P[s].indexOf(l.sortable);
|
|
313
|
+
a.collisionObserver.disable(), be(O, S, x, C), w(() => {
|
|
314
|
+
for (const [M, E] of P[p].entries())
|
|
315
|
+
E.index = M;
|
|
316
|
+
if (!c)
|
|
317
|
+
for (const [M, E] of P[s].entries())
|
|
318
|
+
E.group = l.sortable.group, E.index = M;
|
|
319
|
+
}), a.actions.setDropTarget(o.id).then(() => a.collisionObserver.enable());
|
|
302
320
|
});
|
|
303
321
|
});
|
|
304
322
|
}),
|
|
305
|
-
e.monitor.addEventListener("dragend", (
|
|
306
|
-
if (!
|
|
323
|
+
e.monitor.addEventListener("dragend", (n, a) => {
|
|
324
|
+
if (!n.canceled)
|
|
307
325
|
return;
|
|
308
|
-
const { dragOperation:
|
|
309
|
-
|
|
310
|
-
const
|
|
311
|
-
|
|
326
|
+
const { dragOperation: i } = a, { source: o } = i;
|
|
327
|
+
m(o) && (o.sortable.initialIndex === o.sortable.index && o.sortable.initialGroup === o.sortable.group || queueMicrotask(() => {
|
|
328
|
+
const l = t(), h = pe(l), v = l.get(
|
|
329
|
+
o.sortable.initialGroup
|
|
312
330
|
);
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
!
|
|
322
|
-
for (const
|
|
323
|
-
const
|
|
324
|
-
for (const
|
|
325
|
-
|
|
331
|
+
v && a.renderer.rendering.then(() => {
|
|
332
|
+
const c = t();
|
|
333
|
+
if (ge(h, l, c))
|
|
334
|
+
return;
|
|
335
|
+
const u = V(v), _ = V(
|
|
336
|
+
v,
|
|
337
|
+
ut
|
|
338
|
+
), b = o.sortable.element, g = _.indexOf(o.sortable), f = u[g], O = f?.element;
|
|
339
|
+
!f || !O || !b || (be(b, f.index, O, o.index), w(() => {
|
|
340
|
+
for (const x of l.values()) {
|
|
341
|
+
const I = Array.from(x).values();
|
|
342
|
+
for (const d of I)
|
|
343
|
+
d.index = d.initialIndex, d.group = d.initialGroup;
|
|
326
344
|
}
|
|
327
345
|
}));
|
|
328
346
|
});
|
|
@@ -330,55 +348,71 @@ var pe = "__default__", st = class extends he {
|
|
|
330
348
|
})
|
|
331
349
|
];
|
|
332
350
|
this.destroy = () => {
|
|
333
|
-
for (const
|
|
334
|
-
|
|
351
|
+
for (const n of r)
|
|
352
|
+
n();
|
|
335
353
|
};
|
|
336
354
|
}
|
|
337
355
|
};
|
|
338
|
-
function
|
|
339
|
-
const
|
|
340
|
-
r.insertAdjacentElement(
|
|
356
|
+
function be(e, t, r, n) {
|
|
357
|
+
const a = n < t ? "afterend" : "beforebegin";
|
|
358
|
+
r.insertAdjacentElement(a, e);
|
|
341
359
|
}
|
|
342
|
-
function
|
|
360
|
+
function ct(e, t) {
|
|
343
361
|
return e.index - t.index;
|
|
344
362
|
}
|
|
345
|
-
function
|
|
346
|
-
return
|
|
363
|
+
function ut(e, t) {
|
|
364
|
+
return e.initialIndex - t.initialIndex;
|
|
365
|
+
}
|
|
366
|
+
function V(e, t = ct) {
|
|
367
|
+
return Array.from(e).sort(t);
|
|
347
368
|
}
|
|
348
|
-
var
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
],
|
|
369
|
+
var he = [
|
|
370
|
+
Ze,
|
|
371
|
+
dt
|
|
372
|
+
], pt = {
|
|
352
373
|
duration: 250,
|
|
353
374
|
easing: "cubic-bezier(0.25, 1, 0.5, 1)",
|
|
354
375
|
idle: !1
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
var
|
|
376
|
+
};
|
|
377
|
+
function ve(e) {
|
|
378
|
+
var t, r;
|
|
379
|
+
return typeof e == "boolean" ? {
|
|
380
|
+
draggable: e,
|
|
381
|
+
droppable: e
|
|
382
|
+
} : {
|
|
383
|
+
draggable: (t = e?.draggable) != null ? t : !1,
|
|
384
|
+
droppable: (r = e?.droppable) != null ? r : !1
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
var q = new Ge(), Se, me, D, Y, W, B, Z, j;
|
|
388
|
+
me = [ne], Se = [ne];
|
|
389
|
+
var ee = class {
|
|
358
390
|
constructor(e, t) {
|
|
359
|
-
|
|
360
|
-
var
|
|
361
|
-
(
|
|
391
|
+
R(this, Y, L(D, 8, this)), L(D, 11, this), R(this, W), R(this, B), R(this, Z, L(D, 12, this)), L(D, 15, this), R(this, j), this.register = () => (w(() => {
|
|
392
|
+
var g, f;
|
|
393
|
+
(g = this.manager) == null || g.registry.register(this.droppable), (f = this.manager) == null || f.registry.register(this.draggable);
|
|
362
394
|
}), () => this.unregister()), this.unregister = () => {
|
|
363
|
-
|
|
364
|
-
var
|
|
365
|
-
(
|
|
395
|
+
w(() => {
|
|
396
|
+
var g, f;
|
|
397
|
+
(g = this.manager) == null || g.registry.unregister(this.droppable), (f = this.manager) == null || f.registry.unregister(this.draggable);
|
|
366
398
|
});
|
|
367
399
|
}, this.destroy = () => {
|
|
368
|
-
|
|
400
|
+
w(() => {
|
|
369
401
|
this.droppable.destroy(), this.draggable.destroy();
|
|
370
402
|
});
|
|
371
403
|
};
|
|
372
404
|
var r = e, {
|
|
373
|
-
effects:
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
405
|
+
effects: n = () => [],
|
|
406
|
+
disabled: a,
|
|
407
|
+
group: i,
|
|
408
|
+
index: o,
|
|
409
|
+
sensors: l,
|
|
410
|
+
type: h,
|
|
411
|
+
transition: v = pt,
|
|
412
|
+
plugins: c
|
|
413
|
+
} = r, u = Qe(r, [
|
|
381
414
|
"effects",
|
|
415
|
+
"disabled",
|
|
382
416
|
"group",
|
|
383
417
|
"index",
|
|
384
418
|
"sensors",
|
|
@@ -386,78 +420,83 @@ var Z = class {
|
|
|
386
420
|
"transition",
|
|
387
421
|
"plugins"
|
|
388
422
|
]);
|
|
389
|
-
const
|
|
390
|
-
this.droppable = new
|
|
391
|
-
|
|
392
|
-
|
|
423
|
+
const _ = ie(c, he), b = ve(a);
|
|
424
|
+
this.droppable = new te(
|
|
425
|
+
Q(J({}, u), { disabled: b.droppable }),
|
|
426
|
+
t,
|
|
427
|
+
this
|
|
428
|
+
), this.draggable = new De(
|
|
429
|
+
Q(J({}, u), {
|
|
430
|
+
disabled: b.draggable,
|
|
431
|
+
plugins: _,
|
|
393
432
|
effects: () => [
|
|
394
433
|
() => {
|
|
395
|
-
var
|
|
396
|
-
const
|
|
397
|
-
|
|
434
|
+
var g, f, O;
|
|
435
|
+
const x = (g = this.manager) == null ? void 0 : g.dragOperation.status;
|
|
436
|
+
x?.initializing && this.id === ((O = (f = this.manager) == null ? void 0 : f.dragOperation.source) == null ? void 0 : O.id) && q.clear(this.manager), x?.dragging && q.set(
|
|
398
437
|
this.manager,
|
|
399
438
|
this.id,
|
|
400
|
-
|
|
439
|
+
de(() => ({
|
|
401
440
|
initialIndex: this.index,
|
|
402
441
|
initialGroup: this.group
|
|
403
442
|
}))
|
|
404
443
|
);
|
|
405
444
|
},
|
|
406
445
|
() => {
|
|
407
|
-
const { index:
|
|
408
|
-
(
|
|
446
|
+
const { index: g, group: f, manager: O } = this, x = A(this, B), I = A(this, W);
|
|
447
|
+
(g !== x || f !== I) && (G(this, B, g), G(this, W, f), this.animate());
|
|
409
448
|
},
|
|
410
449
|
() => {
|
|
411
|
-
var
|
|
412
|
-
const { target:
|
|
413
|
-
((
|
|
450
|
+
var g, f;
|
|
451
|
+
const { target: O } = this, { isDragSource: x } = this.draggable;
|
|
452
|
+
((f = (g = this.draggable.pluginConfig(Re)) == null ? void 0 : g.feedback) != null ? f : "default") === "move" && x && (this.droppable.disabled = !O);
|
|
414
453
|
},
|
|
415
|
-
...
|
|
454
|
+
...n()
|
|
416
455
|
],
|
|
417
|
-
type:
|
|
418
|
-
sensors:
|
|
456
|
+
type: h,
|
|
457
|
+
sensors: l
|
|
419
458
|
}),
|
|
420
459
|
t,
|
|
421
460
|
this
|
|
422
|
-
),
|
|
461
|
+
), G(this, j, u.element), this.manager = t, this.index = o, G(this, B, o), this.group = i, G(this, W, i), this.type = h, this.transition = v;
|
|
423
462
|
}
|
|
424
463
|
get initialIndex() {
|
|
425
464
|
var e, t;
|
|
426
|
-
return (t = (e =
|
|
465
|
+
return (t = (e = q.get(this.manager, this.id)) == null ? void 0 : e.initialIndex) != null ? t : this.index;
|
|
427
466
|
}
|
|
428
467
|
get initialGroup() {
|
|
429
468
|
var e, t;
|
|
430
|
-
return (t = (e =
|
|
469
|
+
return (t = (e = q.get(this.manager, this.id)) == null ? void 0 : e.initialGroup) != null ? t : this.group;
|
|
431
470
|
}
|
|
432
471
|
animate() {
|
|
433
|
-
|
|
472
|
+
de(() => {
|
|
434
473
|
const { manager: e, transition: t } = this, { shape: r } = this.droppable;
|
|
435
474
|
if (!e) return;
|
|
436
|
-
const { idle:
|
|
437
|
-
!r || !t ||
|
|
438
|
-
const { element:
|
|
439
|
-
if (!
|
|
475
|
+
const { idle: n } = e.dragOperation.status;
|
|
476
|
+
!r || !t || n && !t.idle || e.renderer.rendering.then(() => {
|
|
477
|
+
const { element: a } = this;
|
|
478
|
+
if (!a)
|
|
440
479
|
return;
|
|
441
|
-
for (const
|
|
442
|
-
"transitionProperty" in
|
|
443
|
-
const
|
|
444
|
-
if (!
|
|
480
|
+
for (const c of a.getAnimations())
|
|
481
|
+
"transitionProperty" in c && (c.transitionProperty === "transform" || c.transitionProperty === "translate" || c.transitionProperty === "scale") && c.cancel();
|
|
482
|
+
const i = this.refreshShape();
|
|
483
|
+
if (!i)
|
|
445
484
|
return;
|
|
446
|
-
const
|
|
447
|
-
x: r.boundingRectangle.left -
|
|
448
|
-
y: r.boundingRectangle.top -
|
|
449
|
-
}, { translate:
|
|
450
|
-
if (
|
|
451
|
-
const
|
|
452
|
-
|
|
453
|
-
element:
|
|
485
|
+
const o = {
|
|
486
|
+
x: r.boundingRectangle.left - i.boundingRectangle.left,
|
|
487
|
+
y: r.boundingRectangle.top - i.boundingRectangle.top
|
|
488
|
+
}, { translate: l } = Be(a), h = ae(a, l, !1), v = ae(a, l);
|
|
489
|
+
if (o.x || o.y) {
|
|
490
|
+
const c = $e(Le(a)) ? Q(J({}, t), { duration: 0 }) : t;
|
|
491
|
+
Ke({
|
|
492
|
+
element: a,
|
|
454
493
|
keyframes: {
|
|
455
494
|
translate: [
|
|
456
|
-
`${
|
|
457
|
-
`${
|
|
495
|
+
`${h.x + o.x}px ${h.y + o.y}px ${h.z}`,
|
|
496
|
+
`${v.x}px ${v.y}px ${v.z}`
|
|
458
497
|
]
|
|
459
498
|
},
|
|
460
|
-
options:
|
|
499
|
+
options: c
|
|
461
500
|
}).then(() => {
|
|
462
501
|
e.dragOperation.status.dragging || (this.droppable.shape = void 0);
|
|
463
502
|
});
|
|
@@ -469,21 +508,21 @@ var Z = class {
|
|
|
469
508
|
return this.draggable.manager;
|
|
470
509
|
}
|
|
471
510
|
set manager(e) {
|
|
472
|
-
|
|
511
|
+
w(() => {
|
|
473
512
|
this.draggable.manager = e, this.droppable.manager = e;
|
|
474
513
|
});
|
|
475
514
|
}
|
|
476
515
|
set element(e) {
|
|
477
|
-
|
|
478
|
-
const t =
|
|
479
|
-
(!r || r === t) && (this.droppable.element = e), (!
|
|
516
|
+
w(() => {
|
|
517
|
+
const t = A(this, j), r = this.droppable.element, n = this.draggable.element;
|
|
518
|
+
(!r || r === t) && (this.droppable.element = e), (!n || n === t) && (this.draggable.element = e), G(this, j, e);
|
|
480
519
|
});
|
|
481
520
|
}
|
|
482
521
|
get element() {
|
|
483
522
|
var e, t;
|
|
484
|
-
const r =
|
|
523
|
+
const r = A(this, j);
|
|
485
524
|
if (r)
|
|
486
|
-
return (t = (e =
|
|
525
|
+
return (t = (e = We.get(r)) != null ? e : r) != null ? t : this.droppable.element;
|
|
487
526
|
}
|
|
488
527
|
set target(e) {
|
|
489
528
|
this.droppable.element = e;
|
|
@@ -498,18 +537,20 @@ var Z = class {
|
|
|
498
537
|
return this.draggable.element;
|
|
499
538
|
}
|
|
500
539
|
get disabled() {
|
|
501
|
-
|
|
540
|
+
const { disabled: e } = this.draggable, { disabled: t } = this.droppable;
|
|
541
|
+
return e === t ? e : { draggable: e, droppable: t };
|
|
502
542
|
}
|
|
503
543
|
set plugins(e) {
|
|
504
|
-
this.draggable.plugins =
|
|
544
|
+
this.draggable.plugins = ie(e, he);
|
|
505
545
|
}
|
|
506
546
|
set disabled(e) {
|
|
507
|
-
|
|
508
|
-
|
|
547
|
+
const t = ve(e);
|
|
548
|
+
w(() => {
|
|
549
|
+
this.droppable.disabled = t.droppable, this.draggable.disabled = t.draggable;
|
|
509
550
|
});
|
|
510
551
|
}
|
|
511
552
|
set data(e) {
|
|
512
|
-
|
|
553
|
+
w(() => {
|
|
513
554
|
this.droppable.data = e, this.draggable.data = e;
|
|
514
555
|
});
|
|
515
556
|
}
|
|
@@ -532,7 +573,7 @@ var Z = class {
|
|
|
532
573
|
this.droppable.collisionPriority = e;
|
|
533
574
|
}
|
|
534
575
|
set collisionDetector(e) {
|
|
535
|
-
this.droppable.collisionDetector = e ??
|
|
576
|
+
this.droppable.collisionDetector = e ?? Te;
|
|
536
577
|
}
|
|
537
578
|
set alignment(e) {
|
|
538
579
|
this.draggable.alignment = e;
|
|
@@ -541,7 +582,7 @@ var Z = class {
|
|
|
541
582
|
return this.draggable.alignment;
|
|
542
583
|
}
|
|
543
584
|
set type(e) {
|
|
544
|
-
|
|
585
|
+
w(() => {
|
|
545
586
|
this.droppable.type = e, this.draggable.type = e;
|
|
546
587
|
});
|
|
547
588
|
}
|
|
@@ -585,16 +626,16 @@ var Z = class {
|
|
|
585
626
|
return this.droppable.accepts(e);
|
|
586
627
|
}
|
|
587
628
|
};
|
|
588
|
-
|
|
589
|
-
X = /* @__PURE__ */ new WeakMap();
|
|
590
|
-
B = /* @__PURE__ */ new WeakMap();
|
|
591
|
-
L = /* @__PURE__ */ new WeakMap();
|
|
629
|
+
D = Ue();
|
|
592
630
|
Y = /* @__PURE__ */ new WeakMap();
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
631
|
+
W = /* @__PURE__ */ new WeakMap();
|
|
632
|
+
B = /* @__PURE__ */ new WeakMap();
|
|
633
|
+
Z = /* @__PURE__ */ new WeakMap();
|
|
634
|
+
j = /* @__PURE__ */ new WeakMap();
|
|
635
|
+
Pe(D, 4, "index", me, ee, Y);
|
|
636
|
+
Pe(D, 4, "group", Se, ee, Z);
|
|
637
|
+
Ye(D, ee);
|
|
638
|
+
var De = class extends Ce {
|
|
598
639
|
constructor(e, t, r) {
|
|
599
640
|
super(e, t), this.sortable = r;
|
|
600
641
|
}
|
|
@@ -610,7 +651,7 @@ var we = class extends Ge {
|
|
|
610
651
|
get initialGroup() {
|
|
611
652
|
return this.sortable.initialGroup;
|
|
612
653
|
}
|
|
613
|
-
},
|
|
654
|
+
}, te = class extends je {
|
|
614
655
|
constructor(e, t, r) {
|
|
615
656
|
super(e, t), this.sortable = r;
|
|
616
657
|
}
|
|
@@ -622,12 +663,12 @@ var we = class extends Ge {
|
|
|
622
663
|
}
|
|
623
664
|
};
|
|
624
665
|
export {
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
666
|
+
dt as OptimisticSortingPlugin,
|
|
667
|
+
ee as Sortable,
|
|
668
|
+
De as SortableDraggable,
|
|
669
|
+
te as SortableDroppable,
|
|
670
|
+
Ze as SortableKeyboardPlugin,
|
|
671
|
+
pt as defaultSortableTransition,
|
|
672
|
+
m as isSortable,
|
|
673
|
+
yt as isSortableOperation
|
|
633
674
|
};
|