@bambamboole/pdf-ua-template-builder 0.1.1 → 0.2.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.
- package/dist/builder/pdf/PdfPane.d.ts +6 -3
- package/dist/index.js +1067 -1050
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import z, { useRef as I, useMemo as
|
|
3
|
-
import { unstable_batchedUpdates as
|
|
1
|
+
import { jsx as g, jsxs as x } from "react/jsx-runtime";
|
|
2
|
+
import z, { useRef as I, useMemo as B, useLayoutEffect as Gr, useEffect as O, useCallback as L, useState as $, memo as Jr, useReducer as Zr, useContext as Ae, createContext as it, cloneElement as Qr, forwardRef as eo, Fragment as to } from "react";
|
|
3
|
+
import { unstable_batchedUpdates as pt, createPortal as no } from "react-dom";
|
|
4
4
|
function ro() {
|
|
5
5
|
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
|
|
6
6
|
t[n] = arguments[n];
|
|
7
|
-
return
|
|
7
|
+
return B(
|
|
8
8
|
() => (r) => {
|
|
9
9
|
t.forEach((o) => o(r));
|
|
10
10
|
},
|
|
@@ -12,49 +12,49 @@ function ro() {
|
|
|
12
12
|
t
|
|
13
13
|
);
|
|
14
14
|
}
|
|
15
|
-
const
|
|
15
|
+
const kt = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
|
|
16
16
|
function We(e) {
|
|
17
17
|
const t = Object.prototype.toString.call(e);
|
|
18
18
|
return t === "[object Window]" || // In Electron context the Window object serializes to [object global]
|
|
19
19
|
t === "[object global]";
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function Zt(e) {
|
|
22
22
|
return "nodeType" in e;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function G(e) {
|
|
25
25
|
var t, n;
|
|
26
|
-
return e ? We(e) ? e :
|
|
26
|
+
return e ? We(e) ? e : Zt(e) && (t = (n = e.ownerDocument) == null ? void 0 : n.defaultView) != null ? t : window : window;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function Qt(e) {
|
|
29
29
|
const {
|
|
30
30
|
Document: t
|
|
31
|
-
} =
|
|
31
|
+
} = G(e);
|
|
32
32
|
return e instanceof t;
|
|
33
33
|
}
|
|
34
34
|
function at(e) {
|
|
35
|
-
return We(e) ? !1 : e instanceof
|
|
35
|
+
return We(e) ? !1 : e instanceof G(e).HTMLElement;
|
|
36
36
|
}
|
|
37
37
|
function Vn(e) {
|
|
38
|
-
return e instanceof
|
|
38
|
+
return e instanceof G(e).SVGElement;
|
|
39
39
|
}
|
|
40
40
|
function He(e) {
|
|
41
|
-
return e ? We(e) ? e.document :
|
|
41
|
+
return e ? We(e) ? e.document : Zt(e) ? Qt(e) ? e : at(e) || Vn(e) ? e.ownerDocument : document : document : document;
|
|
42
42
|
}
|
|
43
|
-
const
|
|
44
|
-
function
|
|
43
|
+
const fe = kt ? Gr : O;
|
|
44
|
+
function St(e) {
|
|
45
45
|
const t = I(e);
|
|
46
|
-
return
|
|
46
|
+
return fe(() => {
|
|
47
47
|
t.current = e;
|
|
48
|
-
}),
|
|
48
|
+
}), L(function() {
|
|
49
49
|
for (var n = arguments.length, r = new Array(n), o = 0; o < n; o++)
|
|
50
50
|
r[o] = arguments[o];
|
|
51
51
|
return t.current == null ? void 0 : t.current(...r);
|
|
52
52
|
}, []);
|
|
53
53
|
}
|
|
54
54
|
function oo() {
|
|
55
|
-
const e = I(null), t =
|
|
55
|
+
const e = I(null), t = L((r, o) => {
|
|
56
56
|
e.current = setInterval(r, o);
|
|
57
|
-
}, []), n =
|
|
57
|
+
}, []), n = L(() => {
|
|
58
58
|
e.current !== null && (clearInterval(e.current), e.current = null);
|
|
59
59
|
}, []);
|
|
60
60
|
return [t, n];
|
|
@@ -62,13 +62,13 @@ function oo() {
|
|
|
62
62
|
function tt(e, t) {
|
|
63
63
|
t === void 0 && (t = [e]);
|
|
64
64
|
const n = I(e);
|
|
65
|
-
return
|
|
65
|
+
return fe(() => {
|
|
66
66
|
n.current !== e && (n.current = e);
|
|
67
67
|
}, t), n;
|
|
68
68
|
}
|
|
69
69
|
function st(e, t) {
|
|
70
70
|
const n = I();
|
|
71
|
-
return
|
|
71
|
+
return B(
|
|
72
72
|
() => {
|
|
73
73
|
const r = e(n.current);
|
|
74
74
|
return n.current = r, r;
|
|
@@ -77,8 +77,8 @@ function st(e, t) {
|
|
|
77
77
|
[...t]
|
|
78
78
|
);
|
|
79
79
|
}
|
|
80
|
-
function
|
|
81
|
-
const t =
|
|
80
|
+
function mt(e) {
|
|
81
|
+
const t = St(e), n = I(null), r = L(
|
|
82
82
|
(o) => {
|
|
83
83
|
o !== n.current && t?.(o, n.current), n.current = o;
|
|
84
84
|
},
|
|
@@ -87,19 +87,19 @@ function bt(e) {
|
|
|
87
87
|
);
|
|
88
88
|
return [n, r];
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function yt(e) {
|
|
91
91
|
const t = I();
|
|
92
|
-
return
|
|
92
|
+
return O(() => {
|
|
93
93
|
t.current = e;
|
|
94
94
|
}, [e]), t.current;
|
|
95
95
|
}
|
|
96
|
-
let
|
|
96
|
+
let $t = {};
|
|
97
97
|
function lt(e, t) {
|
|
98
|
-
return
|
|
98
|
+
return B(() => {
|
|
99
99
|
if (t)
|
|
100
100
|
return t;
|
|
101
|
-
const n =
|
|
102
|
-
return
|
|
101
|
+
const n = $t[e] == null ? 0 : $t[e] + 1;
|
|
102
|
+
return $t[e] = n, e + "-" + n;
|
|
103
103
|
}, [e, t]);
|
|
104
104
|
}
|
|
105
105
|
function Kn(e) {
|
|
@@ -109,8 +109,8 @@ function Kn(e) {
|
|
|
109
109
|
return r.reduce((i, a) => {
|
|
110
110
|
const s = Object.entries(a);
|
|
111
111
|
for (const [l, c] of s) {
|
|
112
|
-
const
|
|
113
|
-
|
|
112
|
+
const d = i[l];
|
|
113
|
+
d != null && (i[l] = d + e * c);
|
|
114
114
|
}
|
|
115
115
|
return i;
|
|
116
116
|
}, {
|
|
@@ -122,12 +122,12 @@ const Fe = /* @__PURE__ */ Kn(1), nt = /* @__PURE__ */ Kn(-1);
|
|
|
122
122
|
function io(e) {
|
|
123
123
|
return "clientX" in e && "clientY" in e;
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function Nt(e) {
|
|
126
126
|
if (!e)
|
|
127
127
|
return !1;
|
|
128
128
|
const {
|
|
129
129
|
KeyboardEvent: t
|
|
130
|
-
} =
|
|
130
|
+
} = G(e.target);
|
|
131
131
|
return t && e instanceof t;
|
|
132
132
|
}
|
|
133
133
|
function ao(e) {
|
|
@@ -135,10 +135,10 @@ function ao(e) {
|
|
|
135
135
|
return !1;
|
|
136
136
|
const {
|
|
137
137
|
TouchEvent: t
|
|
138
|
-
} =
|
|
138
|
+
} = G(e.target);
|
|
139
139
|
return t && e instanceof t;
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function wt(e) {
|
|
142
142
|
if (ao(e)) {
|
|
143
143
|
if (e.touches && e.touches.length) {
|
|
144
144
|
const {
|
|
@@ -250,26 +250,26 @@ function uo(e) {
|
|
|
250
250
|
}, n);
|
|
251
251
|
}
|
|
252
252
|
function fo() {
|
|
253
|
-
const [e, t] =
|
|
253
|
+
const [e, t] = $("");
|
|
254
254
|
return {
|
|
255
|
-
announce:
|
|
255
|
+
announce: L((r) => {
|
|
256
256
|
r != null && t(r);
|
|
257
257
|
}, []),
|
|
258
258
|
announcement: e
|
|
259
259
|
};
|
|
260
260
|
}
|
|
261
261
|
const Yn = /* @__PURE__ */ it(null);
|
|
262
|
-
function
|
|
263
|
-
const t =
|
|
264
|
-
|
|
262
|
+
function po(e) {
|
|
263
|
+
const t = Ae(Yn);
|
|
264
|
+
O(() => {
|
|
265
265
|
if (!t)
|
|
266
266
|
throw new Error("useDndMonitor must be used within a children of <DndContext>");
|
|
267
267
|
return t(e);
|
|
268
268
|
}, [e, t]);
|
|
269
269
|
}
|
|
270
|
-
function
|
|
271
|
-
const [e] =
|
|
272
|
-
return [
|
|
270
|
+
function go() {
|
|
271
|
+
const [e] = $(() => /* @__PURE__ */ new Set()), t = L((r) => (e.add(r), () => e.delete(r)), [e]);
|
|
272
|
+
return [L((r) => {
|
|
273
273
|
let {
|
|
274
274
|
type: o,
|
|
275
275
|
event: i
|
|
@@ -324,77 +324,77 @@ function vo(e) {
|
|
|
324
324
|
const {
|
|
325
325
|
announce: i,
|
|
326
326
|
announcement: a
|
|
327
|
-
} = fo(), s = lt("DndLiveRegion"), [l, c] =
|
|
328
|
-
if (
|
|
327
|
+
} = fo(), s = lt("DndLiveRegion"), [l, c] = $(!1);
|
|
328
|
+
if (O(() => {
|
|
329
329
|
c(!0);
|
|
330
|
-
}, []),
|
|
331
|
-
onDragStart(
|
|
330
|
+
}, []), po(B(() => ({
|
|
331
|
+
onDragStart(u) {
|
|
332
332
|
let {
|
|
333
333
|
active: f
|
|
334
|
-
} =
|
|
334
|
+
} = u;
|
|
335
335
|
i(t.onDragStart({
|
|
336
336
|
active: f
|
|
337
337
|
}));
|
|
338
338
|
},
|
|
339
|
-
onDragMove(
|
|
339
|
+
onDragMove(u) {
|
|
340
340
|
let {
|
|
341
341
|
active: f,
|
|
342
|
-
over:
|
|
343
|
-
} =
|
|
342
|
+
over: p
|
|
343
|
+
} = u;
|
|
344
344
|
t.onDragMove && i(t.onDragMove({
|
|
345
345
|
active: f,
|
|
346
|
-
over:
|
|
346
|
+
over: p
|
|
347
347
|
}));
|
|
348
348
|
},
|
|
349
|
-
onDragOver(
|
|
349
|
+
onDragOver(u) {
|
|
350
350
|
let {
|
|
351
351
|
active: f,
|
|
352
|
-
over:
|
|
353
|
-
} =
|
|
352
|
+
over: p
|
|
353
|
+
} = u;
|
|
354
354
|
i(t.onDragOver({
|
|
355
355
|
active: f,
|
|
356
|
-
over:
|
|
356
|
+
over: p
|
|
357
357
|
}));
|
|
358
358
|
},
|
|
359
|
-
onDragEnd(
|
|
359
|
+
onDragEnd(u) {
|
|
360
360
|
let {
|
|
361
361
|
active: f,
|
|
362
|
-
over:
|
|
363
|
-
} =
|
|
362
|
+
over: p
|
|
363
|
+
} = u;
|
|
364
364
|
i(t.onDragEnd({
|
|
365
365
|
active: f,
|
|
366
|
-
over:
|
|
366
|
+
over: p
|
|
367
367
|
}));
|
|
368
368
|
},
|
|
369
|
-
onDragCancel(
|
|
369
|
+
onDragCancel(u) {
|
|
370
370
|
let {
|
|
371
371
|
active: f,
|
|
372
|
-
over:
|
|
373
|
-
} =
|
|
372
|
+
over: p
|
|
373
|
+
} = u;
|
|
374
374
|
i(t.onDragCancel({
|
|
375
375
|
active: f,
|
|
376
|
-
over:
|
|
376
|
+
over: p
|
|
377
377
|
}));
|
|
378
378
|
}
|
|
379
379
|
}), [i, t])), !l)
|
|
380
380
|
return null;
|
|
381
|
-
const
|
|
381
|
+
const d = z.createElement(z.Fragment, null, z.createElement(co, {
|
|
382
382
|
id: r,
|
|
383
383
|
value: o.draggable
|
|
384
384
|
}), z.createElement(uo, {
|
|
385
385
|
id: s,
|
|
386
386
|
announcement: a
|
|
387
387
|
}));
|
|
388
|
-
return n ? no(
|
|
388
|
+
return n ? no(d, n) : d;
|
|
389
389
|
}
|
|
390
390
|
var W;
|
|
391
391
|
(function(e) {
|
|
392
392
|
e.DragStart = "dragStart", e.DragMove = "dragMove", e.DragEnd = "dragEnd", e.DragCancel = "dragCancel", e.DragOver = "dragOver", e.RegisterDroppable = "registerDroppable", e.SetDroppableDisabled = "setDroppableDisabled", e.UnregisterDroppable = "unregisterDroppable";
|
|
393
393
|
})(W || (W = {}));
|
|
394
|
-
function
|
|
394
|
+
function xt() {
|
|
395
395
|
}
|
|
396
396
|
function vn(e, t) {
|
|
397
|
-
return
|
|
397
|
+
return B(
|
|
398
398
|
() => ({
|
|
399
399
|
sensor: e,
|
|
400
400
|
options: t ?? {}
|
|
@@ -406,13 +406,13 @@ function vn(e, t) {
|
|
|
406
406
|
function mo() {
|
|
407
407
|
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
|
|
408
408
|
t[n] = arguments[n];
|
|
409
|
-
return
|
|
409
|
+
return B(
|
|
410
410
|
() => [...t].filter((r) => r != null),
|
|
411
411
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
412
412
|
[...t]
|
|
413
413
|
);
|
|
414
414
|
}
|
|
415
|
-
const
|
|
415
|
+
const pe = /* @__PURE__ */ Object.freeze({
|
|
416
416
|
x: 0,
|
|
417
417
|
y: 0
|
|
418
418
|
});
|
|
@@ -420,7 +420,7 @@ function qn(e, t) {
|
|
|
420
420
|
return Math.sqrt(Math.pow(e.x - t.x, 2) + Math.pow(e.y - t.y, 2));
|
|
421
421
|
}
|
|
422
422
|
function yo(e, t) {
|
|
423
|
-
const n =
|
|
423
|
+
const n = wt(e);
|
|
424
424
|
if (!n)
|
|
425
425
|
return "0 0";
|
|
426
426
|
const r = {
|
|
@@ -521,12 +521,12 @@ const xo = (e) => {
|
|
|
521
521
|
id: s
|
|
522
522
|
} = a, l = n.get(s);
|
|
523
523
|
if (l) {
|
|
524
|
-
const c = mn(l),
|
|
524
|
+
const c = mn(l), d = o.reduce((f, p, R) => f + qn(c[R], p), 0), u = Number((d / 4).toFixed(4));
|
|
525
525
|
i.push({
|
|
526
526
|
id: s,
|
|
527
527
|
data: {
|
|
528
528
|
droppableContainer: a,
|
|
529
|
-
value:
|
|
529
|
+
value: u
|
|
530
530
|
}
|
|
531
531
|
});
|
|
532
532
|
}
|
|
@@ -536,12 +536,12 @@ const xo = (e) => {
|
|
|
536
536
|
function Do(e, t) {
|
|
537
537
|
const n = Math.max(t.top, e.top), r = Math.max(t.left, e.left), o = Math.min(t.left + t.width, e.left + e.width), i = Math.min(t.top + t.height, e.top + e.height), a = o - r, s = i - n;
|
|
538
538
|
if (r < o && n < i) {
|
|
539
|
-
const l = t.width * t.height, c = e.width * e.height,
|
|
540
|
-
return Number(
|
|
539
|
+
const l = t.width * t.height, c = e.width * e.height, d = a * s, u = d / (l + c - d);
|
|
540
|
+
return Number(u.toFixed(4));
|
|
541
541
|
}
|
|
542
542
|
return 0;
|
|
543
543
|
}
|
|
544
|
-
const
|
|
544
|
+
const Co = (e) => {
|
|
545
545
|
let {
|
|
546
546
|
collisionRect: t,
|
|
547
547
|
droppableRects: n,
|
|
@@ -565,7 +565,7 @@ const ko = (e) => {
|
|
|
565
565
|
}
|
|
566
566
|
return o.sort(wo);
|
|
567
567
|
};
|
|
568
|
-
function
|
|
568
|
+
function ko(e, t, n) {
|
|
569
569
|
return {
|
|
570
570
|
...e,
|
|
571
571
|
scaleX: t && n ? t.width / n.width : 1,
|
|
@@ -576,7 +576,7 @@ function Zn(e, t) {
|
|
|
576
576
|
return e && t ? {
|
|
577
577
|
x: e.left - t.left,
|
|
578
578
|
y: e.top - t.top
|
|
579
|
-
} :
|
|
579
|
+
} : pe;
|
|
580
580
|
}
|
|
581
581
|
function So(e) {
|
|
582
582
|
return function(n) {
|
|
@@ -623,13 +623,13 @@ function Ao(e, t, n) {
|
|
|
623
623
|
scaleY: i,
|
|
624
624
|
x: a,
|
|
625
625
|
y: s
|
|
626
|
-
} = r, l = e.left - a - (1 - o) * parseFloat(n), c = e.top - s - (1 - i) * parseFloat(n.slice(n.indexOf(" ") + 1)),
|
|
626
|
+
} = r, l = e.left - a - (1 - o) * parseFloat(n), c = e.top - s - (1 - i) * parseFloat(n.slice(n.indexOf(" ") + 1)), d = o ? e.width / o : e.width, u = i ? e.height / i : e.height;
|
|
627
627
|
return {
|
|
628
|
-
width:
|
|
629
|
-
height:
|
|
628
|
+
width: d,
|
|
629
|
+
height: u,
|
|
630
630
|
top: c,
|
|
631
|
-
right: l +
|
|
632
|
-
bottom: c +
|
|
631
|
+
right: l + d,
|
|
632
|
+
bottom: c + u,
|
|
633
633
|
left: l
|
|
634
634
|
};
|
|
635
635
|
}
|
|
@@ -642,9 +642,9 @@ function Xe(e, t) {
|
|
|
642
642
|
if (t.ignoreTransform) {
|
|
643
643
|
const {
|
|
644
644
|
transform: c,
|
|
645
|
-
transformOrigin:
|
|
646
|
-
} =
|
|
647
|
-
c && (n = Ao(n, c,
|
|
645
|
+
transformOrigin: d
|
|
646
|
+
} = G(e).getComputedStyle(e);
|
|
647
|
+
c && (n = Ao(n, c, d));
|
|
648
648
|
}
|
|
649
649
|
const {
|
|
650
650
|
top: r,
|
|
@@ -680,36 +680,36 @@ function Io(e) {
|
|
|
680
680
|
};
|
|
681
681
|
}
|
|
682
682
|
function To(e, t) {
|
|
683
|
-
return t === void 0 && (t =
|
|
683
|
+
return t === void 0 && (t = G(e).getComputedStyle(e)), t.position === "fixed";
|
|
684
684
|
}
|
|
685
685
|
function Oo(e, t) {
|
|
686
|
-
t === void 0 && (t =
|
|
686
|
+
t === void 0 && (t = G(e).getComputedStyle(e));
|
|
687
687
|
const n = /(auto|scroll|overlay)/;
|
|
688
688
|
return ["overflow", "overflowX", "overflowY"].some((o) => {
|
|
689
689
|
const i = t[o];
|
|
690
690
|
return typeof i == "string" ? n.test(i) : !1;
|
|
691
691
|
});
|
|
692
692
|
}
|
|
693
|
-
function
|
|
693
|
+
function At(e, t) {
|
|
694
694
|
const n = [];
|
|
695
695
|
function r(o) {
|
|
696
696
|
if (t != null && n.length >= t || !o)
|
|
697
697
|
return n;
|
|
698
|
-
if (
|
|
698
|
+
if (Qt(o) && o.scrollingElement != null && !n.includes(o.scrollingElement))
|
|
699
699
|
return n.push(o.scrollingElement), n;
|
|
700
700
|
if (!at(o) || Vn(o) || n.includes(o))
|
|
701
701
|
return n;
|
|
702
|
-
const i =
|
|
702
|
+
const i = G(e).getComputedStyle(o);
|
|
703
703
|
return o !== e && Oo(o, i) && n.push(o), To(o, i) ? n : r(o.parentNode);
|
|
704
704
|
}
|
|
705
705
|
return e ? r(e) : n;
|
|
706
706
|
}
|
|
707
707
|
function er(e) {
|
|
708
|
-
const [t] =
|
|
708
|
+
const [t] = At(e, 1);
|
|
709
709
|
return t ?? null;
|
|
710
710
|
}
|
|
711
|
-
function
|
|
712
|
-
return !
|
|
711
|
+
function Bt(e) {
|
|
712
|
+
return !kt || !e ? null : We(e) ? e : Zt(e) ? Qt(e) || e === He(e).scrollingElement ? window : at(e) ? e : null : null;
|
|
713
713
|
}
|
|
714
714
|
function tr(e) {
|
|
715
715
|
return We(e) ? e.scrollX : e.scrollLeft;
|
|
@@ -717,7 +717,7 @@ function tr(e) {
|
|
|
717
717
|
function nr(e) {
|
|
718
718
|
return We(e) ? e.scrollY : e.scrollTop;
|
|
719
719
|
}
|
|
720
|
-
function
|
|
720
|
+
function Xt(e) {
|
|
721
721
|
return {
|
|
722
722
|
x: tr(e),
|
|
723
723
|
y: nr(e)
|
|
@@ -728,7 +728,7 @@ var H;
|
|
|
728
728
|
e[e.Forward = 1] = "Forward", e[e.Backward = -1] = "Backward";
|
|
729
729
|
})(H || (H = {}));
|
|
730
730
|
function rr(e) {
|
|
731
|
-
return !
|
|
731
|
+
return !kt || !e ? !1 : e === document.scrollingElement;
|
|
732
732
|
}
|
|
733
733
|
function or(e) {
|
|
734
734
|
const t = {
|
|
@@ -767,10 +767,10 @@ function Mo(e, t, n, r, o) {
|
|
|
767
767
|
r === void 0 && (r = 10), o === void 0 && (o = Po);
|
|
768
768
|
const {
|
|
769
769
|
isTop: c,
|
|
770
|
-
isBottom:
|
|
771
|
-
isLeft:
|
|
770
|
+
isBottom: d,
|
|
771
|
+
isLeft: u,
|
|
772
772
|
isRight: f
|
|
773
|
-
} = or(e),
|
|
773
|
+
} = or(e), p = {
|
|
774
774
|
x: 0,
|
|
775
775
|
y: 0
|
|
776
776
|
}, R = {
|
|
@@ -780,8 +780,8 @@ function Mo(e, t, n, r, o) {
|
|
|
780
780
|
height: t.height * o.y,
|
|
781
781
|
width: t.width * o.x
|
|
782
782
|
};
|
|
783
|
-
return !c && i <= t.top + h.height ? (
|
|
784
|
-
direction:
|
|
783
|
+
return !c && i <= t.top + h.height ? (p.y = H.Backward, R.y = r * Math.abs((t.top + h.height - i) / h.height)) : !d && l >= t.bottom - h.height && (p.y = H.Forward, R.y = r * Math.abs((t.bottom - h.height - l) / h.height)), !f && s >= t.right - h.width ? (p.x = H.Forward, R.x = r * Math.abs((t.right - h.width - s) / h.width)) : !u && a <= t.left + h.width && (p.x = H.Backward, R.x = r * Math.abs((t.left + h.width - a) / h.width)), {
|
|
784
|
+
direction: p,
|
|
785
785
|
speed: R
|
|
786
786
|
};
|
|
787
787
|
}
|
|
@@ -816,7 +816,7 @@ function Lo(e) {
|
|
|
816
816
|
};
|
|
817
817
|
}
|
|
818
818
|
function ir(e) {
|
|
819
|
-
return e.reduce((t, n) => Fe(t,
|
|
819
|
+
return e.reduce((t, n) => Fe(t, Xt(n)), pe);
|
|
820
820
|
}
|
|
821
821
|
function _o(e) {
|
|
822
822
|
return e.reduce((t, n) => t + tr(n), 0);
|
|
@@ -839,10 +839,10 @@ function ar(e, t) {
|
|
|
839
839
|
});
|
|
840
840
|
}
|
|
841
841
|
const Bo = [["x", ["left", "right"], _o], ["y", ["top", "bottom"], $o]];
|
|
842
|
-
class
|
|
842
|
+
class en {
|
|
843
843
|
constructor(t, n) {
|
|
844
844
|
this.rect = void 0, this.width = void 0, this.height = void 0, this.top = void 0, this.bottom = void 0, this.right = void 0, this.left = void 0;
|
|
845
|
-
const r =
|
|
845
|
+
const r = At(n), o = ir(r);
|
|
846
846
|
this.rect = {
|
|
847
847
|
...t
|
|
848
848
|
}, this.width = t.width, this.height = t.height;
|
|
@@ -850,8 +850,8 @@ class Qt {
|
|
|
850
850
|
for (const l of a)
|
|
851
851
|
Object.defineProperty(this, l, {
|
|
852
852
|
get: () => {
|
|
853
|
-
const c = s(r),
|
|
854
|
-
return this.rect[l] +
|
|
853
|
+
const c = s(r), d = o[i] - c;
|
|
854
|
+
return this.rect[l] + d;
|
|
855
855
|
},
|
|
856
856
|
enumerable: !0
|
|
857
857
|
});
|
|
@@ -877,17 +877,17 @@ class Je {
|
|
|
877
877
|
function jo(e) {
|
|
878
878
|
const {
|
|
879
879
|
EventTarget: t
|
|
880
|
-
} =
|
|
880
|
+
} = G(e);
|
|
881
881
|
return e instanceof t ? e : He(e);
|
|
882
882
|
}
|
|
883
|
-
function
|
|
883
|
+
function jt(e, t) {
|
|
884
884
|
const n = Math.abs(e.x), r = Math.abs(e.y);
|
|
885
885
|
return typeof t == "number" ? Math.sqrt(n ** 2 + r ** 2) > t : "x" in t && "y" in t ? n > t.x && r > t.y : "x" in t ? n > t.x : "y" in t ? r > t.y : !1;
|
|
886
886
|
}
|
|
887
|
-
var
|
|
887
|
+
var ae;
|
|
888
888
|
(function(e) {
|
|
889
889
|
e.Click = "click", e.DragStart = "dragstart", e.Keydown = "keydown", e.ContextMenu = "contextmenu", e.Resize = "resize", e.SelectionChange = "selectionchange", e.VisibilityChange = "visibilitychange";
|
|
890
|
-
})(
|
|
890
|
+
})(ae || (ae = {}));
|
|
891
891
|
function xn(e) {
|
|
892
892
|
e.preventDefault();
|
|
893
893
|
}
|
|
@@ -929,7 +929,7 @@ const sr = {
|
|
|
929
929
|
};
|
|
930
930
|
}
|
|
931
931
|
};
|
|
932
|
-
class
|
|
932
|
+
class tn {
|
|
933
933
|
constructor(t) {
|
|
934
934
|
this.props = void 0, this.autoScrollEnabled = !1, this.referenceCoordinates = void 0, this.listeners = void 0, this.windowListeners = void 0, this.props = t;
|
|
935
935
|
const {
|
|
@@ -937,20 +937,20 @@ class en {
|
|
|
937
937
|
target: n
|
|
938
938
|
}
|
|
939
939
|
} = t;
|
|
940
|
-
this.props = t, this.listeners = new Je(He(n)), this.windowListeners = new Je(
|
|
940
|
+
this.props = t, this.listeners = new Je(He(n)), this.windowListeners = new Je(G(n)), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleCancel = this.handleCancel.bind(this), this.attach();
|
|
941
941
|
}
|
|
942
942
|
attach() {
|
|
943
|
-
this.handleStart(), this.windowListeners.add(
|
|
943
|
+
this.handleStart(), this.windowListeners.add(ae.Resize, this.handleCancel), this.windowListeners.add(ae.VisibilityChange, this.handleCancel), setTimeout(() => this.listeners.add(ae.Keydown, this.handleKeyDown));
|
|
944
944
|
}
|
|
945
945
|
handleStart() {
|
|
946
946
|
const {
|
|
947
947
|
activeNode: t,
|
|
948
948
|
onStart: n
|
|
949
949
|
} = this.props, r = t.node.current;
|
|
950
|
-
r && ar(r), n(
|
|
950
|
+
r && ar(r), n(pe);
|
|
951
951
|
}
|
|
952
952
|
handleKeyDown(t) {
|
|
953
|
-
if (
|
|
953
|
+
if (Nt(t)) {
|
|
954
954
|
const {
|
|
955
955
|
active: n,
|
|
956
956
|
context: r,
|
|
@@ -972,18 +972,18 @@ class en {
|
|
|
972
972
|
}
|
|
973
973
|
const {
|
|
974
974
|
collisionRect: c
|
|
975
|
-
} = r.current,
|
|
975
|
+
} = r.current, d = c ? {
|
|
976
976
|
x: c.left,
|
|
977
977
|
y: c.top
|
|
978
|
-
} :
|
|
979
|
-
this.referenceCoordinates || (this.referenceCoordinates =
|
|
980
|
-
const
|
|
978
|
+
} : pe;
|
|
979
|
+
this.referenceCoordinates || (this.referenceCoordinates = d);
|
|
980
|
+
const u = a(t, {
|
|
981
981
|
active: n,
|
|
982
982
|
context: r.current,
|
|
983
|
-
currentCoordinates:
|
|
983
|
+
currentCoordinates: d
|
|
984
984
|
});
|
|
985
|
-
if (
|
|
986
|
-
const f = nt(
|
|
985
|
+
if (u) {
|
|
986
|
+
const f = nt(u, d), p = {
|
|
987
987
|
x: 0,
|
|
988
988
|
y: 0
|
|
989
989
|
}, {
|
|
@@ -994,14 +994,14 @@ class en {
|
|
|
994
994
|
isTop: D,
|
|
995
995
|
isRight: m,
|
|
996
996
|
isLeft: y,
|
|
997
|
-
isBottom:
|
|
997
|
+
isBottom: k,
|
|
998
998
|
maxScroll: E,
|
|
999
999
|
minScroll: N
|
|
1000
|
-
} = or(h), S = Lo(h),
|
|
1001
|
-
x: Math.min(b === T.Right ? S.right - S.width / 2 : S.right, Math.max(b === T.Right ? S.left : S.left + S.width / 2,
|
|
1002
|
-
y: Math.min(b === T.Down ? S.bottom - S.height / 2 : S.bottom, Math.max(b === T.Down ? S.top : S.top + S.height / 2,
|
|
1003
|
-
},
|
|
1004
|
-
if (
|
|
1000
|
+
} = or(h), S = Lo(h), C = {
|
|
1001
|
+
x: Math.min(b === T.Right ? S.right - S.width / 2 : S.right, Math.max(b === T.Right ? S.left : S.left + S.width / 2, u.x)),
|
|
1002
|
+
y: Math.min(b === T.Down ? S.bottom - S.height / 2 : S.bottom, Math.max(b === T.Down ? S.top : S.top + S.height / 2, u.y))
|
|
1003
|
+
}, j = b === T.Right && !m || b === T.Left && !y, P = b === T.Down && !k || b === T.Up && !D;
|
|
1004
|
+
if (j && C.x !== u.x) {
|
|
1005
1005
|
const w = h.scrollLeft + f.x, X = b === T.Right && w <= E.x || b === T.Left && w >= N.x;
|
|
1006
1006
|
if (X && !f.y) {
|
|
1007
1007
|
h.scrollTo({
|
|
@@ -1010,12 +1010,12 @@ class en {
|
|
|
1010
1010
|
});
|
|
1011
1011
|
return;
|
|
1012
1012
|
}
|
|
1013
|
-
X ?
|
|
1014
|
-
left: -
|
|
1013
|
+
X ? p.x = h.scrollLeft - w : p.x = b === T.Right ? h.scrollLeft - E.x : h.scrollLeft - N.x, p.x && h.scrollBy({
|
|
1014
|
+
left: -p.x,
|
|
1015
1015
|
behavior: s
|
|
1016
1016
|
});
|
|
1017
1017
|
break;
|
|
1018
|
-
} else if (
|
|
1018
|
+
} else if (P && C.y !== u.y) {
|
|
1019
1019
|
const w = h.scrollTop + f.y, X = b === T.Down && w <= E.y || b === T.Up && w >= N.y;
|
|
1020
1020
|
if (X && !f.x) {
|
|
1021
1021
|
h.scrollTo({
|
|
@@ -1024,14 +1024,14 @@ class en {
|
|
|
1024
1024
|
});
|
|
1025
1025
|
return;
|
|
1026
1026
|
}
|
|
1027
|
-
X ?
|
|
1028
|
-
top: -
|
|
1027
|
+
X ? p.y = h.scrollTop - w : p.y = b === T.Down ? h.scrollTop - E.y : h.scrollTop - N.y, p.y && h.scrollBy({
|
|
1028
|
+
top: -p.y,
|
|
1029
1029
|
behavior: s
|
|
1030
1030
|
});
|
|
1031
1031
|
break;
|
|
1032
1032
|
}
|
|
1033
1033
|
}
|
|
1034
|
-
this.handleMove(t, Fe(nt(
|
|
1034
|
+
this.handleMove(t, Fe(nt(u, this.referenceCoordinates), p));
|
|
1035
1035
|
}
|
|
1036
1036
|
}
|
|
1037
1037
|
}
|
|
@@ -1057,7 +1057,7 @@ class en {
|
|
|
1057
1057
|
this.listeners.removeAll(), this.windowListeners.removeAll();
|
|
1058
1058
|
}
|
|
1059
1059
|
}
|
|
1060
|
-
|
|
1060
|
+
tn.activators = [{
|
|
1061
1061
|
eventName: "onKeyDown",
|
|
1062
1062
|
handler: (e, t, n) => {
|
|
1063
1063
|
let {
|
|
@@ -1084,7 +1084,7 @@ function Rn(e) {
|
|
|
1084
1084
|
function Dn(e) {
|
|
1085
1085
|
return !!(e && "delay" in e);
|
|
1086
1086
|
}
|
|
1087
|
-
class
|
|
1087
|
+
class nn {
|
|
1088
1088
|
constructor(t, n, r) {
|
|
1089
1089
|
var o;
|
|
1090
1090
|
r === void 0 && (r = jo(t.event.target)), this.props = void 0, this.events = void 0, this.autoScrollEnabled = !0, this.document = void 0, this.activated = !1, this.initialCoordinates = void 0, this.timeoutId = null, this.listeners = void 0, this.documentListeners = void 0, this.windowListeners = void 0, this.props = t, this.events = n;
|
|
@@ -1093,7 +1093,7 @@ class tn {
|
|
|
1093
1093
|
} = t, {
|
|
1094
1094
|
target: a
|
|
1095
1095
|
} = i;
|
|
1096
|
-
this.props = t, this.events = n, this.document = He(a), this.documentListeners = new Je(this.document), this.listeners = new Je(r), this.windowListeners = new Je(
|
|
1096
|
+
this.props = t, this.events = n, this.document = He(a), this.documentListeners = new Je(this.document), this.listeners = new Je(r), this.windowListeners = new Je(G(a)), this.initialCoordinates = (o = wt(i)) != null ? o : pe, this.handleStart = this.handleStart.bind(this), this.handleMove = this.handleMove.bind(this), this.handleEnd = this.handleEnd.bind(this), this.handleCancel = this.handleCancel.bind(this), this.handleKeydown = this.handleKeydown.bind(this), this.removeTextSelection = this.removeTextSelection.bind(this), this.attach();
|
|
1097
1097
|
}
|
|
1098
1098
|
attach() {
|
|
1099
1099
|
const {
|
|
@@ -1107,7 +1107,7 @@ class tn {
|
|
|
1107
1107
|
} = this;
|
|
1108
1108
|
if (this.listeners.add(t.move.name, this.handleMove, {
|
|
1109
1109
|
passive: !1
|
|
1110
|
-
}), this.listeners.add(t.end.name, this.handleEnd), t.cancel && this.listeners.add(t.cancel.name, this.handleCancel), this.windowListeners.add(
|
|
1110
|
+
}), this.listeners.add(t.end.name, this.handleEnd), t.cancel && this.listeners.add(t.cancel.name, this.handleCancel), this.windowListeners.add(ae.Resize, this.handleCancel), this.windowListeners.add(ae.DragStart, xn), this.windowListeners.add(ae.VisibilityChange, this.handleCancel), this.windowListeners.add(ae.ContextMenu, xn), this.documentListeners.add(ae.Keydown, this.handleKeydown), n) {
|
|
1111
1111
|
if (r != null && r({
|
|
1112
1112
|
event: this.props.event,
|
|
1113
1113
|
activeNode: this.props.activeNode,
|
|
@@ -1141,9 +1141,9 @@ class tn {
|
|
|
1141
1141
|
} = this, {
|
|
1142
1142
|
onStart: n
|
|
1143
1143
|
} = this.props;
|
|
1144
|
-
t && (this.activated = !0, this.documentListeners.add(
|
|
1144
|
+
t && (this.activated = !0, this.documentListeners.add(ae.Click, Fo, {
|
|
1145
1145
|
capture: !0
|
|
1146
|
-
}), this.removeTextSelection(), this.documentListeners.add(
|
|
1146
|
+
}), this.removeTextSelection(), this.documentListeners.add(ae.SelectionChange, this.removeTextSelection), n(t));
|
|
1147
1147
|
}
|
|
1148
1148
|
handleMove(t) {
|
|
1149
1149
|
var n;
|
|
@@ -1159,15 +1159,15 @@ class tn {
|
|
|
1159
1159
|
} = i;
|
|
1160
1160
|
if (!o)
|
|
1161
1161
|
return;
|
|
1162
|
-
const l = (n =
|
|
1162
|
+
const l = (n = wt(t)) != null ? n : pe, c = nt(o, l);
|
|
1163
1163
|
if (!r && s) {
|
|
1164
1164
|
if (Rn(s)) {
|
|
1165
|
-
if (s.tolerance != null &&
|
|
1165
|
+
if (s.tolerance != null && jt(c, s.tolerance))
|
|
1166
1166
|
return this.handleCancel();
|
|
1167
|
-
if (
|
|
1167
|
+
if (jt(c, s.distance))
|
|
1168
1168
|
return this.handleStart();
|
|
1169
1169
|
}
|
|
1170
|
-
if (Dn(s) &&
|
|
1170
|
+
if (Dn(s) && jt(c, s.tolerance))
|
|
1171
1171
|
return this.handleCancel();
|
|
1172
1172
|
this.handlePending(s, c);
|
|
1173
1173
|
return;
|
|
@@ -1207,7 +1207,7 @@ const Uo = {
|
|
|
1207
1207
|
name: "pointerup"
|
|
1208
1208
|
}
|
|
1209
1209
|
};
|
|
1210
|
-
class
|
|
1210
|
+
class rn extends nn {
|
|
1211
1211
|
constructor(t) {
|
|
1212
1212
|
const {
|
|
1213
1213
|
event: n
|
|
@@ -1215,7 +1215,7 @@ class nn extends tn {
|
|
|
1215
1215
|
super(t, Uo, r);
|
|
1216
1216
|
}
|
|
1217
1217
|
}
|
|
1218
|
-
|
|
1218
|
+
rn.activators = [{
|
|
1219
1219
|
eventName: "onPointerDown",
|
|
1220
1220
|
handler: (e, t) => {
|
|
1221
1221
|
let {
|
|
@@ -1236,11 +1236,11 @@ const Wo = {
|
|
|
1236
1236
|
name: "mouseup"
|
|
1237
1237
|
}
|
|
1238
1238
|
};
|
|
1239
|
-
var
|
|
1239
|
+
var Vt;
|
|
1240
1240
|
(function(e) {
|
|
1241
1241
|
e[e.RightClick = 2] = "RightClick";
|
|
1242
|
-
})(
|
|
1243
|
-
class Ho extends
|
|
1242
|
+
})(Vt || (Vt = {}));
|
|
1243
|
+
class Ho extends nn {
|
|
1244
1244
|
constructor(t) {
|
|
1245
1245
|
super(t, Wo, He(t.event.target));
|
|
1246
1246
|
}
|
|
@@ -1253,12 +1253,12 @@ Ho.activators = [{
|
|
|
1253
1253
|
} = e, {
|
|
1254
1254
|
onActivation: r
|
|
1255
1255
|
} = t;
|
|
1256
|
-
return n.button ===
|
|
1256
|
+
return n.button === Vt.RightClick ? !1 : (r?.({
|
|
1257
1257
|
event: n
|
|
1258
1258
|
}), !0);
|
|
1259
1259
|
}
|
|
1260
1260
|
}];
|
|
1261
|
-
const
|
|
1261
|
+
const Ft = {
|
|
1262
1262
|
cancel: {
|
|
1263
1263
|
name: "touchcancel"
|
|
1264
1264
|
},
|
|
@@ -1269,16 +1269,16 @@ const Bt = {
|
|
|
1269
1269
|
name: "touchend"
|
|
1270
1270
|
}
|
|
1271
1271
|
};
|
|
1272
|
-
class Xo extends
|
|
1272
|
+
class Xo extends nn {
|
|
1273
1273
|
constructor(t) {
|
|
1274
|
-
super(t,
|
|
1274
|
+
super(t, Ft);
|
|
1275
1275
|
}
|
|
1276
1276
|
static setup() {
|
|
1277
|
-
return window.addEventListener(
|
|
1277
|
+
return window.addEventListener(Ft.move.name, t, {
|
|
1278
1278
|
capture: !1,
|
|
1279
1279
|
passive: !1
|
|
1280
1280
|
}), function() {
|
|
1281
|
-
window.removeEventListener(
|
|
1281
|
+
window.removeEventListener(Ft.move.name, t);
|
|
1282
1282
|
};
|
|
1283
1283
|
function t() {
|
|
1284
1284
|
}
|
|
@@ -1304,10 +1304,10 @@ var Ze;
|
|
|
1304
1304
|
(function(e) {
|
|
1305
1305
|
e[e.Pointer = 0] = "Pointer", e[e.DraggableRect = 1] = "DraggableRect";
|
|
1306
1306
|
})(Ze || (Ze = {}));
|
|
1307
|
-
var
|
|
1307
|
+
var Rt;
|
|
1308
1308
|
(function(e) {
|
|
1309
1309
|
e[e.TreeOrder = 0] = "TreeOrder", e[e.ReversedTreeOrder = 1] = "ReversedTreeOrder";
|
|
1310
|
-
})(
|
|
1310
|
+
})(Rt || (Rt = {}));
|
|
1311
1311
|
function Vo(e) {
|
|
1312
1312
|
let {
|
|
1313
1313
|
acceleration: t,
|
|
@@ -1316,15 +1316,15 @@ function Vo(e) {
|
|
|
1316
1316
|
draggingRect: o,
|
|
1317
1317
|
enabled: i,
|
|
1318
1318
|
interval: a = 5,
|
|
1319
|
-
order: s =
|
|
1319
|
+
order: s = Rt.TreeOrder,
|
|
1320
1320
|
pointerCoordinates: l,
|
|
1321
1321
|
scrollableAncestors: c,
|
|
1322
|
-
scrollableAncestorRects:
|
|
1323
|
-
delta:
|
|
1322
|
+
scrollableAncestorRects: d,
|
|
1323
|
+
delta: u,
|
|
1324
1324
|
threshold: f
|
|
1325
1325
|
} = e;
|
|
1326
|
-
const
|
|
1327
|
-
delta:
|
|
1326
|
+
const p = Yo({
|
|
1327
|
+
delta: u,
|
|
1328
1328
|
disabled: !i
|
|
1329
1329
|
}), [R, h] = oo(), b = I({
|
|
1330
1330
|
x: 0,
|
|
@@ -1332,7 +1332,7 @@ function Vo(e) {
|
|
|
1332
1332
|
}), D = I({
|
|
1333
1333
|
x: 0,
|
|
1334
1334
|
y: 0
|
|
1335
|
-
}), m =
|
|
1335
|
+
}), m = B(() => {
|
|
1336
1336
|
switch (n) {
|
|
1337
1337
|
case Ze.Pointer:
|
|
1338
1338
|
return l ? {
|
|
@@ -1344,14 +1344,14 @@ function Vo(e) {
|
|
|
1344
1344
|
case Ze.DraggableRect:
|
|
1345
1345
|
return o;
|
|
1346
1346
|
}
|
|
1347
|
-
}, [n, o, l]), y = I(null),
|
|
1347
|
+
}, [n, o, l]), y = I(null), k = L(() => {
|
|
1348
1348
|
const N = y.current;
|
|
1349
1349
|
if (!N)
|
|
1350
1350
|
return;
|
|
1351
|
-
const S = b.current.x * D.current.x,
|
|
1352
|
-
N.scrollBy(S,
|
|
1353
|
-
}, []), E =
|
|
1354
|
-
|
|
1351
|
+
const S = b.current.x * D.current.x, C = b.current.y * D.current.y;
|
|
1352
|
+
N.scrollBy(S, C);
|
|
1353
|
+
}, []), E = B(() => s === Rt.TreeOrder ? [...c].reverse() : c, [s, c]);
|
|
1354
|
+
O(
|
|
1355
1355
|
() => {
|
|
1356
1356
|
if (!i || !c.length || !m) {
|
|
1357
1357
|
h();
|
|
@@ -1360,17 +1360,17 @@ function Vo(e) {
|
|
|
1360
1360
|
for (const N of E) {
|
|
1361
1361
|
if (r?.(N) === !1)
|
|
1362
1362
|
continue;
|
|
1363
|
-
const S = c.indexOf(N),
|
|
1364
|
-
if (!
|
|
1363
|
+
const S = c.indexOf(N), C = d[S];
|
|
1364
|
+
if (!C)
|
|
1365
1365
|
continue;
|
|
1366
1366
|
const {
|
|
1367
|
-
direction:
|
|
1368
|
-
speed:
|
|
1369
|
-
} = Mo(N,
|
|
1367
|
+
direction: j,
|
|
1368
|
+
speed: P
|
|
1369
|
+
} = Mo(N, C, m, t, f);
|
|
1370
1370
|
for (const w of ["x", "y"])
|
|
1371
|
-
|
|
1372
|
-
if (
|
|
1373
|
-
h(), y.current = N, R(
|
|
1371
|
+
p[w][j[w]] || (P[w] = 0, j[w] = 0);
|
|
1372
|
+
if (P.x > 0 || P.y > 0) {
|
|
1373
|
+
h(), y.current = N, R(k, a), b.current = P, D.current = j;
|
|
1374
1374
|
return;
|
|
1375
1375
|
}
|
|
1376
1376
|
}
|
|
@@ -1385,7 +1385,7 @@ function Vo(e) {
|
|
|
1385
1385
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1386
1386
|
[
|
|
1387
1387
|
t,
|
|
1388
|
-
|
|
1388
|
+
k,
|
|
1389
1389
|
r,
|
|
1390
1390
|
h,
|
|
1391
1391
|
i,
|
|
@@ -1393,11 +1393,11 @@ function Vo(e) {
|
|
|
1393
1393
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1394
1394
|
JSON.stringify(m),
|
|
1395
1395
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1396
|
-
JSON.stringify(
|
|
1396
|
+
JSON.stringify(p),
|
|
1397
1397
|
R,
|
|
1398
1398
|
c,
|
|
1399
1399
|
E,
|
|
1400
|
-
|
|
1400
|
+
d,
|
|
1401
1401
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1402
1402
|
JSON.stringify(f)
|
|
1403
1403
|
]
|
|
@@ -1418,7 +1418,7 @@ function Yo(e) {
|
|
|
1418
1418
|
delta: t,
|
|
1419
1419
|
disabled: n
|
|
1420
1420
|
} = e;
|
|
1421
|
-
const r =
|
|
1421
|
+
const r = yt(t);
|
|
1422
1422
|
return st((o) => {
|
|
1423
1423
|
if (n || !r || !o)
|
|
1424
1424
|
return Ko;
|
|
@@ -1446,7 +1446,7 @@ function qo(e, t) {
|
|
|
1446
1446
|
}, [r, t]);
|
|
1447
1447
|
}
|
|
1448
1448
|
function Go(e, t) {
|
|
1449
|
-
return
|
|
1449
|
+
return B(() => e.reduce((n, r) => {
|
|
1450
1450
|
const {
|
|
1451
1451
|
sensor: o
|
|
1452
1452
|
} = r, i = o.activators.map((a) => ({
|
|
@@ -1460,27 +1460,27 @@ var rt;
|
|
|
1460
1460
|
(function(e) {
|
|
1461
1461
|
e[e.Always = 0] = "Always", e[e.BeforeDragging = 1] = "BeforeDragging", e[e.WhileDragging = 2] = "WhileDragging";
|
|
1462
1462
|
})(rt || (rt = {}));
|
|
1463
|
-
var
|
|
1463
|
+
var Kt;
|
|
1464
1464
|
(function(e) {
|
|
1465
1465
|
e.Optimized = "optimized";
|
|
1466
|
-
})(
|
|
1467
|
-
const
|
|
1466
|
+
})(Kt || (Kt = {}));
|
|
1467
|
+
const Cn = /* @__PURE__ */ new Map();
|
|
1468
1468
|
function Jo(e, t) {
|
|
1469
1469
|
let {
|
|
1470
1470
|
dragging: n,
|
|
1471
1471
|
dependencies: r,
|
|
1472
1472
|
config: o
|
|
1473
1473
|
} = t;
|
|
1474
|
-
const [i, a] =
|
|
1474
|
+
const [i, a] = $(null), {
|
|
1475
1475
|
frequency: s,
|
|
1476
1476
|
measure: l,
|
|
1477
1477
|
strategy: c
|
|
1478
|
-
} = o,
|
|
1478
|
+
} = o, d = I(e), u = b(), f = tt(u), p = L(function(D) {
|
|
1479
1479
|
D === void 0 && (D = []), !f.current && a((m) => m === null ? D : m.concat(D.filter((y) => !m.includes(y))));
|
|
1480
1480
|
}, [f]), R = I(null), h = st((D) => {
|
|
1481
|
-
if (
|
|
1482
|
-
return
|
|
1483
|
-
if (!D || D ===
|
|
1481
|
+
if (u && !n)
|
|
1482
|
+
return Cn;
|
|
1483
|
+
if (!D || D === Cn || d.current !== e || i != null) {
|
|
1484
1484
|
const m = /* @__PURE__ */ new Map();
|
|
1485
1485
|
for (let y of e) {
|
|
1486
1486
|
if (!y)
|
|
@@ -1489,38 +1489,38 @@ function Jo(e, t) {
|
|
|
1489
1489
|
m.set(y.id, y.rect.current);
|
|
1490
1490
|
continue;
|
|
1491
1491
|
}
|
|
1492
|
-
const
|
|
1492
|
+
const k = y.node.current, E = k ? new en(l(k), k) : null;
|
|
1493
1493
|
y.rect.current = E, E && m.set(y.id, E);
|
|
1494
1494
|
}
|
|
1495
1495
|
return m;
|
|
1496
1496
|
}
|
|
1497
1497
|
return D;
|
|
1498
|
-
}, [e, i, n,
|
|
1499
|
-
return
|
|
1500
|
-
|
|
1501
|
-
}, [e]),
|
|
1498
|
+
}, [e, i, n, u, l]);
|
|
1499
|
+
return O(() => {
|
|
1500
|
+
d.current = e;
|
|
1501
|
+
}, [e]), O(
|
|
1502
1502
|
() => {
|
|
1503
|
-
|
|
1503
|
+
u || p();
|
|
1504
1504
|
},
|
|
1505
1505
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1506
|
-
[n,
|
|
1507
|
-
),
|
|
1506
|
+
[n, u]
|
|
1507
|
+
), O(
|
|
1508
1508
|
() => {
|
|
1509
1509
|
i && i.length > 0 && a(null);
|
|
1510
1510
|
},
|
|
1511
1511
|
//eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1512
1512
|
[JSON.stringify(i)]
|
|
1513
|
-
),
|
|
1513
|
+
), O(
|
|
1514
1514
|
() => {
|
|
1515
|
-
|
|
1516
|
-
|
|
1515
|
+
u || typeof s != "number" || R.current !== null || (R.current = setTimeout(() => {
|
|
1516
|
+
p(), R.current = null;
|
|
1517
1517
|
}, s));
|
|
1518
1518
|
},
|
|
1519
1519
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1520
|
-
[s,
|
|
1520
|
+
[s, u, p, ...r]
|
|
1521
1521
|
), {
|
|
1522
1522
|
droppableRects: h,
|
|
1523
|
-
measureDroppableContainers:
|
|
1523
|
+
measureDroppableContainers: p,
|
|
1524
1524
|
measuringScheduled: i != null
|
|
1525
1525
|
};
|
|
1526
1526
|
function b() {
|
|
@@ -1534,18 +1534,18 @@ function Jo(e, t) {
|
|
|
1534
1534
|
}
|
|
1535
1535
|
}
|
|
1536
1536
|
}
|
|
1537
|
-
function
|
|
1537
|
+
function on(e, t) {
|
|
1538
1538
|
return st((n) => e ? n || (typeof t == "function" ? t(e) : e) : null, [t, e]);
|
|
1539
1539
|
}
|
|
1540
1540
|
function Zo(e, t) {
|
|
1541
|
-
return
|
|
1541
|
+
return on(e, t);
|
|
1542
1542
|
}
|
|
1543
1543
|
function Qo(e) {
|
|
1544
1544
|
let {
|
|
1545
1545
|
callback: t,
|
|
1546
1546
|
disabled: n
|
|
1547
1547
|
} = e;
|
|
1548
|
-
const r =
|
|
1548
|
+
const r = St(t), o = B(() => {
|
|
1549
1549
|
if (n || typeof window > "u" || typeof window.MutationObserver > "u")
|
|
1550
1550
|
return;
|
|
1551
1551
|
const {
|
|
@@ -1553,14 +1553,14 @@ function Qo(e) {
|
|
|
1553
1553
|
} = window;
|
|
1554
1554
|
return new i(r);
|
|
1555
1555
|
}, [r, n]);
|
|
1556
|
-
return
|
|
1556
|
+
return O(() => () => o?.disconnect(), [o]), o;
|
|
1557
1557
|
}
|
|
1558
|
-
function
|
|
1558
|
+
function Et(e) {
|
|
1559
1559
|
let {
|
|
1560
1560
|
callback: t,
|
|
1561
1561
|
disabled: n
|
|
1562
1562
|
} = e;
|
|
1563
|
-
const r =
|
|
1563
|
+
const r = St(t), o = B(
|
|
1564
1564
|
() => {
|
|
1565
1565
|
if (n || typeof window > "u" || typeof window.ResizeObserver > "u")
|
|
1566
1566
|
return;
|
|
@@ -1572,14 +1572,14 @@ function Nt(e) {
|
|
|
1572
1572
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1573
1573
|
[n]
|
|
1574
1574
|
);
|
|
1575
|
-
return
|
|
1575
|
+
return O(() => () => o?.disconnect(), [o]), o;
|
|
1576
1576
|
}
|
|
1577
1577
|
function ei(e) {
|
|
1578
|
-
return new
|
|
1578
|
+
return new en(Xe(e), e);
|
|
1579
1579
|
}
|
|
1580
|
-
function
|
|
1580
|
+
function kn(e, t, n) {
|
|
1581
1581
|
t === void 0 && (t = ei);
|
|
1582
|
-
const [r, o] =
|
|
1582
|
+
const [r, o] = $(null);
|
|
1583
1583
|
function i() {
|
|
1584
1584
|
o((l) => {
|
|
1585
1585
|
if (!e)
|
|
@@ -1588,8 +1588,8 @@ function Cn(e, t, n) {
|
|
|
1588
1588
|
var c;
|
|
1589
1589
|
return (c = l ?? n) != null ? c : null;
|
|
1590
1590
|
}
|
|
1591
|
-
const
|
|
1592
|
-
return JSON.stringify(l) === JSON.stringify(
|
|
1591
|
+
const d = t(e);
|
|
1592
|
+
return JSON.stringify(l) === JSON.stringify(d) ? l : d;
|
|
1593
1593
|
});
|
|
1594
1594
|
}
|
|
1595
1595
|
const a = Qo({
|
|
@@ -1597,19 +1597,19 @@ function Cn(e, t, n) {
|
|
|
1597
1597
|
if (e)
|
|
1598
1598
|
for (const c of l) {
|
|
1599
1599
|
const {
|
|
1600
|
-
type:
|
|
1601
|
-
target:
|
|
1600
|
+
type: d,
|
|
1601
|
+
target: u
|
|
1602
1602
|
} = c;
|
|
1603
|
-
if (
|
|
1603
|
+
if (d === "childList" && u instanceof HTMLElement && u.contains(e)) {
|
|
1604
1604
|
i();
|
|
1605
1605
|
break;
|
|
1606
1606
|
}
|
|
1607
1607
|
}
|
|
1608
1608
|
}
|
|
1609
|
-
}), s =
|
|
1609
|
+
}), s = Et({
|
|
1610
1610
|
callback: i
|
|
1611
1611
|
});
|
|
1612
|
-
return
|
|
1612
|
+
return fe(() => {
|
|
1613
1613
|
i(), e ? (s?.observe(e), a?.observe(document.body, {
|
|
1614
1614
|
childList: !0,
|
|
1615
1615
|
subtree: !0
|
|
@@ -1617,30 +1617,30 @@ function Cn(e, t, n) {
|
|
|
1617
1617
|
}, [e]), r;
|
|
1618
1618
|
}
|
|
1619
1619
|
function ti(e) {
|
|
1620
|
-
const t =
|
|
1620
|
+
const t = on(e);
|
|
1621
1621
|
return Zn(e, t);
|
|
1622
1622
|
}
|
|
1623
1623
|
const Sn = [];
|
|
1624
1624
|
function ni(e) {
|
|
1625
|
-
const t = I(e), n = st((r) => e ? r && r !== Sn && e && t.current && e.parentNode === t.current.parentNode ? r :
|
|
1626
|
-
return
|
|
1625
|
+
const t = I(e), n = st((r) => e ? r && r !== Sn && e && t.current && e.parentNode === t.current.parentNode ? r : At(e) : Sn, [e]);
|
|
1626
|
+
return O(() => {
|
|
1627
1627
|
t.current = e;
|
|
1628
1628
|
}, [e]), n;
|
|
1629
1629
|
}
|
|
1630
1630
|
function ri(e) {
|
|
1631
|
-
const [t, n] =
|
|
1632
|
-
const a =
|
|
1633
|
-
a && n((s) => s ? (s.set(a,
|
|
1631
|
+
const [t, n] = $(null), r = I(e), o = L((i) => {
|
|
1632
|
+
const a = Bt(i.target);
|
|
1633
|
+
a && n((s) => s ? (s.set(a, Xt(a)), new Map(s)) : null);
|
|
1634
1634
|
}, []);
|
|
1635
|
-
return
|
|
1635
|
+
return O(() => {
|
|
1636
1636
|
const i = r.current;
|
|
1637
1637
|
if (e !== i) {
|
|
1638
1638
|
a(i);
|
|
1639
1639
|
const s = e.map((l) => {
|
|
1640
|
-
const c =
|
|
1640
|
+
const c = Bt(l);
|
|
1641
1641
|
return c ? (c.addEventListener("scroll", o, {
|
|
1642
1642
|
passive: !0
|
|
1643
|
-
}), [c,
|
|
1643
|
+
}), [c, Xt(c)]) : null;
|
|
1644
1644
|
}).filter((l) => l != null);
|
|
1645
1645
|
n(s.length ? new Map(s) : null), r.current = e;
|
|
1646
1646
|
}
|
|
@@ -1649,30 +1649,30 @@ function ri(e) {
|
|
|
1649
1649
|
};
|
|
1650
1650
|
function a(s) {
|
|
1651
1651
|
s.forEach((l) => {
|
|
1652
|
-
const c =
|
|
1652
|
+
const c = Bt(l);
|
|
1653
1653
|
c?.removeEventListener("scroll", o);
|
|
1654
1654
|
});
|
|
1655
1655
|
}
|
|
1656
|
-
}, [o, e]),
|
|
1656
|
+
}, [o, e]), B(() => e.length ? t ? Array.from(t.values()).reduce((i, a) => Fe(i, a), pe) : ir(e) : pe, [e, t]);
|
|
1657
1657
|
}
|
|
1658
1658
|
function Nn(e, t) {
|
|
1659
1659
|
t === void 0 && (t = []);
|
|
1660
1660
|
const n = I(null);
|
|
1661
|
-
return
|
|
1661
|
+
return O(
|
|
1662
1662
|
() => {
|
|
1663
1663
|
n.current = null;
|
|
1664
1664
|
},
|
|
1665
1665
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1666
1666
|
t
|
|
1667
|
-
),
|
|
1668
|
-
const r = e !==
|
|
1667
|
+
), O(() => {
|
|
1668
|
+
const r = e !== pe;
|
|
1669
1669
|
r && !n.current && (n.current = e), !r && n.current && (n.current = null);
|
|
1670
|
-
}, [e]), n.current ? nt(e, n.current) :
|
|
1670
|
+
}, [e]), n.current ? nt(e, n.current) : pe;
|
|
1671
1671
|
}
|
|
1672
1672
|
function oi(e) {
|
|
1673
|
-
|
|
1673
|
+
O(
|
|
1674
1674
|
() => {
|
|
1675
|
-
if (!
|
|
1675
|
+
if (!kt)
|
|
1676
1676
|
return;
|
|
1677
1677
|
const t = e.map((n) => {
|
|
1678
1678
|
let {
|
|
@@ -1696,7 +1696,7 @@ function oi(e) {
|
|
|
1696
1696
|
);
|
|
1697
1697
|
}
|
|
1698
1698
|
function ii(e, t) {
|
|
1699
|
-
return
|
|
1699
|
+
return B(() => e.reduce((n, r) => {
|
|
1700
1700
|
let {
|
|
1701
1701
|
eventName: o,
|
|
1702
1702
|
handler: i
|
|
@@ -1707,19 +1707,19 @@ function ii(e, t) {
|
|
|
1707
1707
|
}, {}), [e, t]);
|
|
1708
1708
|
}
|
|
1709
1709
|
function lr(e) {
|
|
1710
|
-
return
|
|
1710
|
+
return B(() => e ? Io(e) : null, [e]);
|
|
1711
1711
|
}
|
|
1712
1712
|
const An = [];
|
|
1713
1713
|
function ai(e, t) {
|
|
1714
1714
|
t === void 0 && (t = Xe);
|
|
1715
|
-
const [n] = e, r = lr(n ?
|
|
1715
|
+
const [n] = e, r = lr(n ? G(n) : null), [o, i] = $(An);
|
|
1716
1716
|
function a() {
|
|
1717
|
-
i(() => e.length ? e.map((l) => rr(l) ? r : new
|
|
1717
|
+
i(() => e.length ? e.map((l) => rr(l) ? r : new en(t(l), l)) : An);
|
|
1718
1718
|
}
|
|
1719
|
-
const s =
|
|
1719
|
+
const s = Et({
|
|
1720
1720
|
callback: a
|
|
1721
1721
|
});
|
|
1722
|
-
return
|
|
1722
|
+
return fe(() => {
|
|
1723
1723
|
s?.disconnect(), a(), e.forEach((l) => s?.observe(l));
|
|
1724
1724
|
}, [e]), o;
|
|
1725
1725
|
}
|
|
@@ -1735,49 +1735,49 @@ function si(e) {
|
|
|
1735
1735
|
let {
|
|
1736
1736
|
measure: t
|
|
1737
1737
|
} = e;
|
|
1738
|
-
const [n, r] =
|
|
1738
|
+
const [n, r] = $(null), o = L((c) => {
|
|
1739
1739
|
for (const {
|
|
1740
|
-
target:
|
|
1740
|
+
target: d
|
|
1741
1741
|
} of c)
|
|
1742
|
-
if (at(
|
|
1743
|
-
r((
|
|
1744
|
-
const f = t(
|
|
1745
|
-
return
|
|
1746
|
-
...
|
|
1742
|
+
if (at(d)) {
|
|
1743
|
+
r((u) => {
|
|
1744
|
+
const f = t(d);
|
|
1745
|
+
return u ? {
|
|
1746
|
+
...u,
|
|
1747
1747
|
width: f.width,
|
|
1748
1748
|
height: f.height
|
|
1749
1749
|
} : f;
|
|
1750
1750
|
});
|
|
1751
1751
|
break;
|
|
1752
1752
|
}
|
|
1753
|
-
}, [t]), i =
|
|
1753
|
+
}, [t]), i = Et({
|
|
1754
1754
|
callback: o
|
|
1755
|
-
}), a =
|
|
1756
|
-
const
|
|
1757
|
-
i?.disconnect(),
|
|
1758
|
-
}, [t, i]), [s, l] =
|
|
1759
|
-
return
|
|
1755
|
+
}), a = L((c) => {
|
|
1756
|
+
const d = cr(c);
|
|
1757
|
+
i?.disconnect(), d && i?.observe(d), r(d ? t(d) : null);
|
|
1758
|
+
}, [t, i]), [s, l] = mt(a);
|
|
1759
|
+
return B(() => ({
|
|
1760
1760
|
nodeRef: s,
|
|
1761
1761
|
rect: n,
|
|
1762
1762
|
setRef: l
|
|
1763
1763
|
}), [n, s, l]);
|
|
1764
1764
|
}
|
|
1765
1765
|
const li = [{
|
|
1766
|
-
sensor:
|
|
1766
|
+
sensor: rn,
|
|
1767
1767
|
options: {}
|
|
1768
1768
|
}, {
|
|
1769
|
-
sensor:
|
|
1769
|
+
sensor: tn,
|
|
1770
1770
|
options: {}
|
|
1771
1771
|
}], ci = {
|
|
1772
1772
|
current: {}
|
|
1773
|
-
},
|
|
1773
|
+
}, bt = {
|
|
1774
1774
|
draggable: {
|
|
1775
1775
|
measure: wn
|
|
1776
1776
|
},
|
|
1777
1777
|
droppable: {
|
|
1778
1778
|
measure: wn,
|
|
1779
1779
|
strategy: rt.WhileDragging,
|
|
1780
|
-
frequency:
|
|
1780
|
+
frequency: Kt.Optimized
|
|
1781
1781
|
},
|
|
1782
1782
|
dragOverlay: {
|
|
1783
1783
|
measure: Xe
|
|
@@ -1820,12 +1820,12 @@ const ui = {
|
|
|
1820
1820
|
current: null
|
|
1821
1821
|
},
|
|
1822
1822
|
rect: null,
|
|
1823
|
-
setRef:
|
|
1823
|
+
setRef: xt
|
|
1824
1824
|
},
|
|
1825
1825
|
scrollableAncestors: [],
|
|
1826
1826
|
scrollableAncestorRects: [],
|
|
1827
|
-
measuringConfiguration:
|
|
1828
|
-
measureDroppableContainers:
|
|
1827
|
+
measuringConfiguration: bt,
|
|
1828
|
+
measureDroppableContainers: xt,
|
|
1829
1829
|
windowRect: null,
|
|
1830
1830
|
measuringScheduled: !1
|
|
1831
1831
|
}, ur = {
|
|
@@ -1836,10 +1836,10 @@ const ui = {
|
|
|
1836
1836
|
ariaDescribedById: {
|
|
1837
1837
|
draggable: ""
|
|
1838
1838
|
},
|
|
1839
|
-
dispatch:
|
|
1839
|
+
dispatch: xt,
|
|
1840
1840
|
draggableNodes: /* @__PURE__ */ new Map(),
|
|
1841
1841
|
over: null,
|
|
1842
|
-
measureDroppableContainers:
|
|
1842
|
+
measureDroppableContainers: xt
|
|
1843
1843
|
}, ct = /* @__PURE__ */ it(ur), dr = /* @__PURE__ */ it(ui);
|
|
1844
1844
|
function di() {
|
|
1845
1845
|
return {
|
|
@@ -1953,7 +1953,7 @@ function fi(e, t) {
|
|
|
1953
1953
|
return e;
|
|
1954
1954
|
}
|
|
1955
1955
|
}
|
|
1956
|
-
function
|
|
1956
|
+
function pi(e) {
|
|
1957
1957
|
let {
|
|
1958
1958
|
disabled: t
|
|
1959
1959
|
} = e;
|
|
@@ -1961,10 +1961,10 @@ function gi(e) {
|
|
|
1961
1961
|
active: n,
|
|
1962
1962
|
activatorEvent: r,
|
|
1963
1963
|
draggableNodes: o
|
|
1964
|
-
} =
|
|
1965
|
-
return
|
|
1964
|
+
} = Ae(ct), i = yt(r), a = yt(n?.id);
|
|
1965
|
+
return O(() => {
|
|
1966
1966
|
if (!t && !r && i && a != null) {
|
|
1967
|
-
if (!
|
|
1967
|
+
if (!Nt(i) || document.activeElement === i.target)
|
|
1968
1968
|
return;
|
|
1969
1969
|
const s = o.get(a);
|
|
1970
1970
|
if (!s)
|
|
@@ -1976,12 +1976,12 @@ function gi(e) {
|
|
|
1976
1976
|
if (!l.current && !c.current)
|
|
1977
1977
|
return;
|
|
1978
1978
|
requestAnimationFrame(() => {
|
|
1979
|
-
for (const
|
|
1980
|
-
if (!
|
|
1979
|
+
for (const d of [l.current, c.current]) {
|
|
1980
|
+
if (!d)
|
|
1981
1981
|
continue;
|
|
1982
|
-
const
|
|
1983
|
-
if (
|
|
1984
|
-
|
|
1982
|
+
const u = so(d);
|
|
1983
|
+
if (u) {
|
|
1984
|
+
u.focus();
|
|
1985
1985
|
break;
|
|
1986
1986
|
}
|
|
1987
1987
|
}
|
|
@@ -1999,19 +1999,19 @@ function fr(e, t) {
|
|
|
1999
1999
|
...r
|
|
2000
2000
|
}), n) : n;
|
|
2001
2001
|
}
|
|
2002
|
-
function
|
|
2003
|
-
return
|
|
2002
|
+
function gi(e) {
|
|
2003
|
+
return B(
|
|
2004
2004
|
() => ({
|
|
2005
2005
|
draggable: {
|
|
2006
|
-
...
|
|
2006
|
+
...bt.draggable,
|
|
2007
2007
|
...e?.draggable
|
|
2008
2008
|
},
|
|
2009
2009
|
droppable: {
|
|
2010
|
-
...
|
|
2010
|
+
...bt.droppable,
|
|
2011
2011
|
...e?.droppable
|
|
2012
2012
|
},
|
|
2013
2013
|
dragOverlay: {
|
|
2014
|
-
...
|
|
2014
|
+
...bt.dragOverlay,
|
|
2015
2015
|
...e?.dragOverlay
|
|
2016
2016
|
}
|
|
2017
2017
|
}),
|
|
@@ -2033,7 +2033,7 @@ function hi(e) {
|
|
|
2033
2033
|
x: o,
|
|
2034
2034
|
y: o
|
|
2035
2035
|
} : o;
|
|
2036
|
-
|
|
2036
|
+
fe(() => {
|
|
2037
2037
|
if (!a && !s || !t) {
|
|
2038
2038
|
i.current = !1;
|
|
2039
2039
|
return;
|
|
@@ -2043,25 +2043,25 @@ function hi(e) {
|
|
|
2043
2043
|
const c = t?.node.current;
|
|
2044
2044
|
if (!c || c.isConnected === !1)
|
|
2045
2045
|
return;
|
|
2046
|
-
const
|
|
2047
|
-
if (a || (
|
|
2046
|
+
const d = n(c), u = Zn(d, r);
|
|
2047
|
+
if (a || (u.x = 0), s || (u.y = 0), i.current = !0, Math.abs(u.x) > 0 || Math.abs(u.y) > 0) {
|
|
2048
2048
|
const f = er(c);
|
|
2049
2049
|
f && f.scrollBy({
|
|
2050
|
-
top:
|
|
2051
|
-
left:
|
|
2050
|
+
top: u.y,
|
|
2051
|
+
left: u.x
|
|
2052
2052
|
});
|
|
2053
2053
|
}
|
|
2054
2054
|
}, [t, a, s, r, n]);
|
|
2055
2055
|
}
|
|
2056
|
-
const
|
|
2057
|
-
...
|
|
2056
|
+
const It = /* @__PURE__ */ it({
|
|
2057
|
+
...pe,
|
|
2058
2058
|
scaleX: 1,
|
|
2059
2059
|
scaleY: 1
|
|
2060
2060
|
});
|
|
2061
|
-
var
|
|
2061
|
+
var Ne;
|
|
2062
2062
|
(function(e) {
|
|
2063
2063
|
e[e.Uninitialized = 0] = "Uninitialized", e[e.Initializing = 1] = "Initializing", e[e.Initialized = 2] = "Initialized";
|
|
2064
|
-
})(
|
|
2064
|
+
})(Ne || (Ne = {}));
|
|
2065
2065
|
const bi = /* @__PURE__ */ Jr(function(t) {
|
|
2066
2066
|
var n, r, o, i;
|
|
2067
2067
|
let {
|
|
@@ -2069,160 +2069,160 @@ const bi = /* @__PURE__ */ Jr(function(t) {
|
|
|
2069
2069
|
accessibility: s,
|
|
2070
2070
|
autoScroll: l = !0,
|
|
2071
2071
|
children: c,
|
|
2072
|
-
sensors:
|
|
2073
|
-
collisionDetection:
|
|
2072
|
+
sensors: d = li,
|
|
2073
|
+
collisionDetection: u = Co,
|
|
2074
2074
|
measuring: f,
|
|
2075
|
-
modifiers:
|
|
2075
|
+
modifiers: p,
|
|
2076
2076
|
...R
|
|
2077
2077
|
} = t;
|
|
2078
|
-
const h = Zr(fi, void 0, di), [b, D] = h, [m, y] =
|
|
2078
|
+
const h = Zr(fi, void 0, di), [b, D] = h, [m, y] = go(), [k, E] = $(Ne.Uninitialized), N = k === Ne.Initialized, {
|
|
2079
2079
|
draggable: {
|
|
2080
2080
|
active: S,
|
|
2081
|
-
nodes:
|
|
2082
|
-
translate:
|
|
2081
|
+
nodes: C,
|
|
2082
|
+
translate: j
|
|
2083
2083
|
},
|
|
2084
2084
|
droppable: {
|
|
2085
|
-
containers:
|
|
2085
|
+
containers: P
|
|
2086
2086
|
}
|
|
2087
|
-
} = b, w = S != null ?
|
|
2087
|
+
} = b, w = S != null ? C.get(S) : null, X = I({
|
|
2088
2088
|
initial: null,
|
|
2089
2089
|
translated: null
|
|
2090
|
-
}),
|
|
2091
|
-
var
|
|
2090
|
+
}), q = B(() => {
|
|
2091
|
+
var Y;
|
|
2092
2092
|
return S != null ? {
|
|
2093
2093
|
id: S,
|
|
2094
2094
|
// It's possible for the active node to unmount while dragging
|
|
2095
|
-
data: (
|
|
2095
|
+
data: (Y = w?.data) != null ? Y : ci,
|
|
2096
2096
|
rect: X
|
|
2097
2097
|
} : null;
|
|
2098
|
-
}, [S, w]), ee = I(null), [ye,
|
|
2099
|
-
droppableRects:
|
|
2100
|
-
measureDroppableContainers:
|
|
2101
|
-
measuringScheduled:
|
|
2098
|
+
}, [S, w]), ee = I(null), [ye, Ee] = $(null), [F, Me] = $(null), J = tt(R, Object.values(R)), Ie = lt("DndDescribedBy", a), Le = B(() => P.getEnabled(), [P]), K = gi(f), {
|
|
2099
|
+
droppableRects: le,
|
|
2100
|
+
measureDroppableContainers: ce,
|
|
2101
|
+
measuringScheduled: Te
|
|
2102
2102
|
} = Jo(Le, {
|
|
2103
2103
|
dragging: N,
|
|
2104
|
-
dependencies: [
|
|
2104
|
+
dependencies: [j.x, j.y],
|
|
2105
2105
|
config: K.droppable
|
|
2106
|
-
}),
|
|
2106
|
+
}), Z = qo(C, S), _e = B(() => F ? wt(F) : null, [F]), ge = qr(), ue = Zo(Z, K.draggable.measure);
|
|
2107
2107
|
hi({
|
|
2108
|
-
activeNode: S != null ?
|
|
2108
|
+
activeNode: S != null ? C.get(S) : null,
|
|
2109
2109
|
config: ge.layoutShiftCompensation,
|
|
2110
|
-
initialRect:
|
|
2110
|
+
initialRect: ue,
|
|
2111
2111
|
measure: K.draggable.measure
|
|
2112
2112
|
});
|
|
2113
|
-
const
|
|
2113
|
+
const M = kn(Z, K.draggable.measure, ue), Oe = kn(Z ? Z.parentElement : null), oe = I({
|
|
2114
2114
|
activatorEvent: null,
|
|
2115
2115
|
active: null,
|
|
2116
|
-
activeNode:
|
|
2116
|
+
activeNode: Z,
|
|
2117
2117
|
collisionRect: null,
|
|
2118
2118
|
collisions: null,
|
|
2119
|
-
droppableRects:
|
|
2120
|
-
draggableNodes:
|
|
2119
|
+
droppableRects: le,
|
|
2120
|
+
draggableNodes: C,
|
|
2121
2121
|
draggingNode: null,
|
|
2122
2122
|
draggingNodeRect: null,
|
|
2123
|
-
droppableContainers:
|
|
2123
|
+
droppableContainers: P,
|
|
2124
2124
|
over: null,
|
|
2125
2125
|
scrollableAncestors: [],
|
|
2126
2126
|
scrollAdjustedTranslate: null
|
|
2127
|
-
}),
|
|
2127
|
+
}), we = P.getNodeFor((n = oe.current.over) == null ? void 0 : n.id), de = si({
|
|
2128
2128
|
measure: K.dragOverlay.measure
|
|
2129
|
-
}),
|
|
2129
|
+
}), xe = (r = de.nodeRef.current) != null ? r : Z, Re = N ? (o = de.rect) != null ? o : M : null, dt = !!(de.nodeRef.current && de.rect), ft = ti(dt ? null : M), A = lr(xe ? G(xe) : null), v = ni(N ? we ?? Z : null), _ = ai(v), U = fr(p, {
|
|
2130
2130
|
transform: {
|
|
2131
|
-
x:
|
|
2132
|
-
y:
|
|
2131
|
+
x: j.x - ft.x,
|
|
2132
|
+
y: j.y - ft.y,
|
|
2133
2133
|
scaleX: 1,
|
|
2134
2134
|
scaleY: 1
|
|
2135
2135
|
},
|
|
2136
2136
|
activatorEvent: F,
|
|
2137
|
-
active:
|
|
2138
|
-
activeNodeRect:
|
|
2137
|
+
active: q,
|
|
2138
|
+
activeNodeRect: M,
|
|
2139
2139
|
containerNodeRect: Oe,
|
|
2140
|
-
draggingNodeRect:
|
|
2141
|
-
over:
|
|
2142
|
-
overlayNodeRect:
|
|
2143
|
-
scrollableAncestors:
|
|
2144
|
-
scrollableAncestorRects:
|
|
2145
|
-
windowRect:
|
|
2146
|
-
}),
|
|
2147
|
-
active:
|
|
2140
|
+
draggingNodeRect: Re,
|
|
2141
|
+
over: oe.current.over,
|
|
2142
|
+
overlayNodeRect: de.rect,
|
|
2143
|
+
scrollableAncestors: v,
|
|
2144
|
+
scrollableAncestorRects: _,
|
|
2145
|
+
windowRect: A
|
|
2146
|
+
}), Q = _e ? Fe(_e, j) : null, Ve = ri(v), Ur = Nn(Ve), Wr = Nn(Ve, [M]), $e = Fe(U, Ur), Be = Re ? No(Re, U) : null, Ke = q && Be ? u({
|
|
2147
|
+
active: q,
|
|
2148
2148
|
collisionRect: Be,
|
|
2149
|
-
droppableRects:
|
|
2149
|
+
droppableRects: le,
|
|
2150
2150
|
droppableContainers: Le,
|
|
2151
|
-
pointerCoordinates:
|
|
2152
|
-
}) : null, fn = Jn(Ke, "id"), [
|
|
2153
|
-
(
|
|
2151
|
+
pointerCoordinates: Q
|
|
2152
|
+
}) : null, fn = Jn(Ke, "id"), [De, pn] = $(null), Hr = dt ? U : Fe(U, Wr), Xr = ko(Hr, (i = De?.rect) != null ? i : null, M), Lt = I(null), gn = L(
|
|
2153
|
+
(Y, te) => {
|
|
2154
2154
|
let {
|
|
2155
|
-
sensor:
|
|
2155
|
+
sensor: ne,
|
|
2156
2156
|
options: Ce
|
|
2157
|
-
} =
|
|
2157
|
+
} = te;
|
|
2158
2158
|
if (ee.current == null)
|
|
2159
2159
|
return;
|
|
2160
|
-
const
|
|
2161
|
-
if (!
|
|
2160
|
+
const ie = C.get(ee.current);
|
|
2161
|
+
if (!ie)
|
|
2162
2162
|
return;
|
|
2163
|
-
const
|
|
2163
|
+
const re = Y.nativeEvent, he = new ne({
|
|
2164
2164
|
active: ee.current,
|
|
2165
|
-
activeNode:
|
|
2166
|
-
event:
|
|
2165
|
+
activeNode: ie,
|
|
2166
|
+
event: re,
|
|
2167
2167
|
options: Ce,
|
|
2168
2168
|
// Sensors need to be instantiated with refs for arguments that change over time
|
|
2169
2169
|
// otherwise they are frozen in time with the stale arguments
|
|
2170
|
-
context:
|
|
2170
|
+
context: oe,
|
|
2171
2171
|
onAbort(V) {
|
|
2172
|
-
if (!
|
|
2172
|
+
if (!C.get(V))
|
|
2173
2173
|
return;
|
|
2174
2174
|
const {
|
|
2175
|
-
onDragAbort:
|
|
2176
|
-
} =
|
|
2175
|
+
onDragAbort: be
|
|
2176
|
+
} = J.current, ve = {
|
|
2177
2177
|
id: V
|
|
2178
2178
|
};
|
|
2179
|
-
|
|
2179
|
+
be?.(ve), m({
|
|
2180
2180
|
type: "onDragAbort",
|
|
2181
2181
|
event: ve
|
|
2182
2182
|
});
|
|
2183
2183
|
},
|
|
2184
|
-
onPending(V,
|
|
2185
|
-
if (!
|
|
2184
|
+
onPending(V, ke, be, ve) {
|
|
2185
|
+
if (!C.get(V))
|
|
2186
2186
|
return;
|
|
2187
2187
|
const {
|
|
2188
2188
|
onDragPending: qe
|
|
2189
|
-
} =
|
|
2189
|
+
} = J.current, Se = {
|
|
2190
2190
|
id: V,
|
|
2191
|
-
constraint:
|
|
2192
|
-
initialCoordinates:
|
|
2191
|
+
constraint: ke,
|
|
2192
|
+
initialCoordinates: be,
|
|
2193
2193
|
offset: ve
|
|
2194
2194
|
};
|
|
2195
|
-
qe?.(
|
|
2195
|
+
qe?.(Se), m({
|
|
2196
2196
|
type: "onDragPending",
|
|
2197
|
-
event:
|
|
2197
|
+
event: Se
|
|
2198
2198
|
});
|
|
2199
2199
|
},
|
|
2200
2200
|
onStart(V) {
|
|
2201
|
-
const
|
|
2202
|
-
if (
|
|
2201
|
+
const ke = ee.current;
|
|
2202
|
+
if (ke == null)
|
|
2203
2203
|
return;
|
|
2204
|
-
const
|
|
2205
|
-
if (!
|
|
2204
|
+
const be = C.get(ke);
|
|
2205
|
+
if (!be)
|
|
2206
2206
|
return;
|
|
2207
2207
|
const {
|
|
2208
2208
|
onDragStart: ve
|
|
2209
|
-
} =
|
|
2210
|
-
activatorEvent:
|
|
2209
|
+
} = J.current, Ye = {
|
|
2210
|
+
activatorEvent: re,
|
|
2211
2211
|
active: {
|
|
2212
|
-
id:
|
|
2213
|
-
data:
|
|
2212
|
+
id: ke,
|
|
2213
|
+
data: be.data,
|
|
2214
2214
|
rect: X
|
|
2215
2215
|
}
|
|
2216
2216
|
};
|
|
2217
|
-
|
|
2218
|
-
ve?.(Ye), E(
|
|
2217
|
+
pt(() => {
|
|
2218
|
+
ve?.(Ye), E(Ne.Initializing), D({
|
|
2219
2219
|
type: W.DragStart,
|
|
2220
2220
|
initialCoordinates: V,
|
|
2221
|
-
active:
|
|
2221
|
+
active: ke
|
|
2222
2222
|
}), m({
|
|
2223
2223
|
type: "onDragStart",
|
|
2224
2224
|
event: Ye
|
|
2225
|
-
}),
|
|
2225
|
+
}), Ee(Lt.current), Me(re);
|
|
2226
2226
|
});
|
|
2227
2227
|
},
|
|
2228
2228
|
onMove(V) {
|
|
@@ -2234,38 +2234,38 @@ const bi = /* @__PURE__ */ Jr(function(t) {
|
|
|
2234
2234
|
onEnd: je(W.DragEnd),
|
|
2235
2235
|
onCancel: je(W.DragCancel)
|
|
2236
2236
|
});
|
|
2237
|
-
|
|
2237
|
+
Lt.current = he;
|
|
2238
2238
|
function je(V) {
|
|
2239
2239
|
return async function() {
|
|
2240
2240
|
const {
|
|
2241
|
-
active:
|
|
2241
|
+
active: be,
|
|
2242
2242
|
collisions: ve,
|
|
2243
2243
|
over: Ye,
|
|
2244
2244
|
scrollAdjustedTranslate: qe
|
|
2245
|
-
} =
|
|
2246
|
-
let
|
|
2247
|
-
if (
|
|
2245
|
+
} = oe.current;
|
|
2246
|
+
let Se = null;
|
|
2247
|
+
if (be && qe) {
|
|
2248
2248
|
const {
|
|
2249
2249
|
cancelDrop: Ge
|
|
2250
|
-
} =
|
|
2251
|
-
|
|
2252
|
-
activatorEvent:
|
|
2253
|
-
active:
|
|
2250
|
+
} = J.current;
|
|
2251
|
+
Se = {
|
|
2252
|
+
activatorEvent: re,
|
|
2253
|
+
active: be,
|
|
2254
2254
|
collisions: ve,
|
|
2255
2255
|
delta: qe,
|
|
2256
2256
|
over: Ye
|
|
2257
|
-
}, V === W.DragEnd && typeof Ge == "function" && await Promise.resolve(Ge(
|
|
2257
|
+
}, V === W.DragEnd && typeof Ge == "function" && await Promise.resolve(Ge(Se)) && (V = W.DragCancel);
|
|
2258
2258
|
}
|
|
2259
|
-
ee.current = null,
|
|
2259
|
+
ee.current = null, pt(() => {
|
|
2260
2260
|
D({
|
|
2261
2261
|
type: V
|
|
2262
|
-
}), E(
|
|
2262
|
+
}), E(Ne.Uninitialized), pn(null), Ee(null), Me(null), Lt.current = null;
|
|
2263
2263
|
const Ge = V === W.DragEnd ? "onDragEnd" : "onDragCancel";
|
|
2264
|
-
if (
|
|
2265
|
-
const
|
|
2266
|
-
|
|
2264
|
+
if (Se) {
|
|
2265
|
+
const _t = J.current[Ge];
|
|
2266
|
+
_t?.(Se), m({
|
|
2267
2267
|
type: Ge,
|
|
2268
|
-
event:
|
|
2268
|
+
event: Se
|
|
2269
2269
|
});
|
|
2270
2270
|
}
|
|
2271
2271
|
});
|
|
@@ -2273,86 +2273,86 @@ const bi = /* @__PURE__ */ Jr(function(t) {
|
|
|
2273
2273
|
}
|
|
2274
2274
|
},
|
|
2275
2275
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2276
|
-
[
|
|
2277
|
-
), Vr =
|
|
2278
|
-
const
|
|
2276
|
+
[C]
|
|
2277
|
+
), Vr = L((Y, te) => (ne, Ce) => {
|
|
2278
|
+
const ie = ne.nativeEvent, re = C.get(Ce);
|
|
2279
2279
|
if (
|
|
2280
2280
|
// Another sensor is already instantiating
|
|
2281
2281
|
ee.current !== null || // No active draggable
|
|
2282
|
-
!
|
|
2283
|
-
|
|
2282
|
+
!re || // Event has already been captured
|
|
2283
|
+
ie.dndKit || ie.defaultPrevented
|
|
2284
2284
|
)
|
|
2285
2285
|
return;
|
|
2286
|
-
const
|
|
2287
|
-
active:
|
|
2286
|
+
const he = {
|
|
2287
|
+
active: re
|
|
2288
2288
|
};
|
|
2289
|
-
|
|
2290
|
-
capturedBy:
|
|
2291
|
-
}, ee.current = Ce,
|
|
2292
|
-
}, [
|
|
2293
|
-
oi(
|
|
2294
|
-
|
|
2295
|
-
}, [
|
|
2289
|
+
Y(ne, te.options, he) === !0 && (ie.dndKit = {
|
|
2290
|
+
capturedBy: te.sensor
|
|
2291
|
+
}, ee.current = Ce, gn(ne, te));
|
|
2292
|
+
}, [C, gn]), hn = Go(d, Vr);
|
|
2293
|
+
oi(d), fe(() => {
|
|
2294
|
+
M && k === Ne.Initializing && E(Ne.Initialized);
|
|
2295
|
+
}, [M, k]), O(
|
|
2296
2296
|
() => {
|
|
2297
2297
|
const {
|
|
2298
|
-
onDragMove:
|
|
2299
|
-
} =
|
|
2300
|
-
active:
|
|
2301
|
-
activatorEvent:
|
|
2298
|
+
onDragMove: Y
|
|
2299
|
+
} = J.current, {
|
|
2300
|
+
active: te,
|
|
2301
|
+
activatorEvent: ne,
|
|
2302
2302
|
collisions: Ce,
|
|
2303
|
-
over:
|
|
2304
|
-
} =
|
|
2305
|
-
if (!
|
|
2303
|
+
over: ie
|
|
2304
|
+
} = oe.current;
|
|
2305
|
+
if (!te || !ne)
|
|
2306
2306
|
return;
|
|
2307
|
-
const
|
|
2308
|
-
active:
|
|
2309
|
-
activatorEvent:
|
|
2307
|
+
const re = {
|
|
2308
|
+
active: te,
|
|
2309
|
+
activatorEvent: ne,
|
|
2310
2310
|
collisions: Ce,
|
|
2311
2311
|
delta: {
|
|
2312
2312
|
x: $e.x,
|
|
2313
2313
|
y: $e.y
|
|
2314
2314
|
},
|
|
2315
|
-
over:
|
|
2315
|
+
over: ie
|
|
2316
2316
|
};
|
|
2317
|
-
|
|
2318
|
-
|
|
2317
|
+
pt(() => {
|
|
2318
|
+
Y?.(re), m({
|
|
2319
2319
|
type: "onDragMove",
|
|
2320
|
-
event:
|
|
2320
|
+
event: re
|
|
2321
2321
|
});
|
|
2322
2322
|
});
|
|
2323
2323
|
},
|
|
2324
2324
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2325
2325
|
[$e.x, $e.y]
|
|
2326
|
-
),
|
|
2326
|
+
), O(
|
|
2327
2327
|
() => {
|
|
2328
2328
|
const {
|
|
2329
|
-
active:
|
|
2330
|
-
activatorEvent:
|
|
2331
|
-
collisions:
|
|
2329
|
+
active: Y,
|
|
2330
|
+
activatorEvent: te,
|
|
2331
|
+
collisions: ne,
|
|
2332
2332
|
droppableContainers: Ce,
|
|
2333
|
-
scrollAdjustedTranslate:
|
|
2334
|
-
} =
|
|
2335
|
-
if (!
|
|
2333
|
+
scrollAdjustedTranslate: ie
|
|
2334
|
+
} = oe.current;
|
|
2335
|
+
if (!Y || ee.current == null || !te || !ie)
|
|
2336
2336
|
return;
|
|
2337
2337
|
const {
|
|
2338
|
-
onDragOver:
|
|
2339
|
-
} =
|
|
2340
|
-
id:
|
|
2341
|
-
rect:
|
|
2342
|
-
data:
|
|
2343
|
-
disabled:
|
|
2338
|
+
onDragOver: re
|
|
2339
|
+
} = J.current, he = Ce.get(fn), je = he && he.rect.current ? {
|
|
2340
|
+
id: he.id,
|
|
2341
|
+
rect: he.rect.current,
|
|
2342
|
+
data: he.data,
|
|
2343
|
+
disabled: he.disabled
|
|
2344
2344
|
} : null, V = {
|
|
2345
|
-
active:
|
|
2346
|
-
activatorEvent:
|
|
2347
|
-
collisions:
|
|
2345
|
+
active: Y,
|
|
2346
|
+
activatorEvent: te,
|
|
2347
|
+
collisions: ne,
|
|
2348
2348
|
delta: {
|
|
2349
|
-
x:
|
|
2350
|
-
y:
|
|
2349
|
+
x: ie.x,
|
|
2350
|
+
y: ie.y
|
|
2351
2351
|
},
|
|
2352
2352
|
over: je
|
|
2353
2353
|
};
|
|
2354
|
-
|
|
2355
|
-
|
|
2354
|
+
pt(() => {
|
|
2355
|
+
pn(je), re?.(V), m({
|
|
2356
2356
|
type: "onDragOver",
|
|
2357
2357
|
event: V
|
|
2358
2358
|
});
|
|
@@ -2360,89 +2360,89 @@ const bi = /* @__PURE__ */ Jr(function(t) {
|
|
|
2360
2360
|
},
|
|
2361
2361
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2362
2362
|
[fn]
|
|
2363
|
-
),
|
|
2364
|
-
|
|
2363
|
+
), fe(() => {
|
|
2364
|
+
oe.current = {
|
|
2365
2365
|
activatorEvent: F,
|
|
2366
|
-
active:
|
|
2367
|
-
activeNode:
|
|
2366
|
+
active: q,
|
|
2367
|
+
activeNode: Z,
|
|
2368
2368
|
collisionRect: Be,
|
|
2369
2369
|
collisions: Ke,
|
|
2370
|
-
droppableRects:
|
|
2371
|
-
draggableNodes:
|
|
2372
|
-
draggingNode:
|
|
2373
|
-
draggingNodeRect:
|
|
2374
|
-
droppableContainers:
|
|
2375
|
-
over:
|
|
2376
|
-
scrollableAncestors:
|
|
2370
|
+
droppableRects: le,
|
|
2371
|
+
draggableNodes: C,
|
|
2372
|
+
draggingNode: xe,
|
|
2373
|
+
draggingNodeRect: Re,
|
|
2374
|
+
droppableContainers: P,
|
|
2375
|
+
over: De,
|
|
2376
|
+
scrollableAncestors: v,
|
|
2377
2377
|
scrollAdjustedTranslate: $e
|
|
2378
2378
|
}, X.current = {
|
|
2379
|
-
initial:
|
|
2379
|
+
initial: Re,
|
|
2380
2380
|
translated: Be
|
|
2381
2381
|
};
|
|
2382
|
-
}, [
|
|
2382
|
+
}, [q, Z, Ke, Be, C, xe, Re, le, P, De, v, $e]), Vo({
|
|
2383
2383
|
...ge,
|
|
2384
|
-
delta:
|
|
2384
|
+
delta: j,
|
|
2385
2385
|
draggingRect: Be,
|
|
2386
|
-
pointerCoordinates:
|
|
2387
|
-
scrollableAncestors:
|
|
2388
|
-
scrollableAncestorRects:
|
|
2386
|
+
pointerCoordinates: Q,
|
|
2387
|
+
scrollableAncestors: v,
|
|
2388
|
+
scrollableAncestorRects: _
|
|
2389
2389
|
});
|
|
2390
|
-
const Kr =
|
|
2391
|
-
active:
|
|
2392
|
-
activeNode:
|
|
2393
|
-
activeNodeRect:
|
|
2390
|
+
const Kr = B(() => ({
|
|
2391
|
+
active: q,
|
|
2392
|
+
activeNode: Z,
|
|
2393
|
+
activeNodeRect: M,
|
|
2394
2394
|
activatorEvent: F,
|
|
2395
2395
|
collisions: Ke,
|
|
2396
2396
|
containerNodeRect: Oe,
|
|
2397
|
-
dragOverlay:
|
|
2398
|
-
draggableNodes:
|
|
2399
|
-
droppableContainers:
|
|
2400
|
-
droppableRects:
|
|
2401
|
-
over:
|
|
2402
|
-
measureDroppableContainers:
|
|
2403
|
-
scrollableAncestors:
|
|
2404
|
-
scrollableAncestorRects:
|
|
2397
|
+
dragOverlay: de,
|
|
2398
|
+
draggableNodes: C,
|
|
2399
|
+
droppableContainers: P,
|
|
2400
|
+
droppableRects: le,
|
|
2401
|
+
over: De,
|
|
2402
|
+
measureDroppableContainers: ce,
|
|
2403
|
+
scrollableAncestors: v,
|
|
2404
|
+
scrollableAncestorRects: _,
|
|
2405
2405
|
measuringConfiguration: K,
|
|
2406
|
-
measuringScheduled:
|
|
2407
|
-
windowRect:
|
|
2408
|
-
}), [
|
|
2406
|
+
measuringScheduled: Te,
|
|
2407
|
+
windowRect: A
|
|
2408
|
+
}), [q, Z, M, F, Ke, Oe, de, C, P, le, De, ce, v, _, K, Te, A]), Yr = B(() => ({
|
|
2409
2409
|
activatorEvent: F,
|
|
2410
2410
|
activators: hn,
|
|
2411
|
-
active:
|
|
2412
|
-
activeNodeRect:
|
|
2411
|
+
active: q,
|
|
2412
|
+
activeNodeRect: M,
|
|
2413
2413
|
ariaDescribedById: {
|
|
2414
|
-
draggable:
|
|
2414
|
+
draggable: Ie
|
|
2415
2415
|
},
|
|
2416
2416
|
dispatch: D,
|
|
2417
|
-
draggableNodes:
|
|
2418
|
-
over:
|
|
2419
|
-
measureDroppableContainers:
|
|
2420
|
-
}), [F, hn,
|
|
2417
|
+
draggableNodes: C,
|
|
2418
|
+
over: De,
|
|
2419
|
+
measureDroppableContainers: ce
|
|
2420
|
+
}), [F, hn, q, M, D, Ie, C, De, ce]);
|
|
2421
2421
|
return z.createElement(Yn.Provider, {
|
|
2422
2422
|
value: y
|
|
2423
2423
|
}, z.createElement(ct.Provider, {
|
|
2424
2424
|
value: Yr
|
|
2425
2425
|
}, z.createElement(dr.Provider, {
|
|
2426
2426
|
value: Kr
|
|
2427
|
-
}, z.createElement(
|
|
2427
|
+
}, z.createElement(It.Provider, {
|
|
2428
2428
|
value: Xr
|
|
2429
|
-
}, c)), z.createElement(
|
|
2429
|
+
}, c)), z.createElement(pi, {
|
|
2430
2430
|
disabled: s?.restoreFocus === !1
|
|
2431
2431
|
})), z.createElement(vo, {
|
|
2432
2432
|
...s,
|
|
2433
|
-
hiddenTextDescribedById:
|
|
2433
|
+
hiddenTextDescribedById: Ie
|
|
2434
2434
|
}));
|
|
2435
2435
|
function qr() {
|
|
2436
|
-
const
|
|
2436
|
+
const Y = ye?.autoScrollEnabled === !1, te = typeof l == "object" ? l.enabled === !1 : l === !1, ne = N && !Y && !te;
|
|
2437
2437
|
return typeof l == "object" ? {
|
|
2438
2438
|
...l,
|
|
2439
|
-
enabled:
|
|
2439
|
+
enabled: ne
|
|
2440
2440
|
} : {
|
|
2441
|
-
enabled:
|
|
2441
|
+
enabled: ne
|
|
2442
2442
|
};
|
|
2443
2443
|
}
|
|
2444
2444
|
}), vi = /* @__PURE__ */ it(null), En = "button", mi = "Draggable";
|
|
2445
|
-
function
|
|
2445
|
+
function pr(e) {
|
|
2446
2446
|
let {
|
|
2447
2447
|
id: t,
|
|
2448
2448
|
data: n,
|
|
@@ -2454,41 +2454,41 @@ function gr(e) {
|
|
|
2454
2454
|
activatorEvent: s,
|
|
2455
2455
|
active: l,
|
|
2456
2456
|
activeNodeRect: c,
|
|
2457
|
-
ariaDescribedById:
|
|
2458
|
-
draggableNodes:
|
|
2457
|
+
ariaDescribedById: d,
|
|
2458
|
+
draggableNodes: u,
|
|
2459
2459
|
over: f
|
|
2460
|
-
} =
|
|
2461
|
-
role:
|
|
2460
|
+
} = Ae(ct), {
|
|
2461
|
+
role: p = En,
|
|
2462
2462
|
roleDescription: R = "draggable",
|
|
2463
2463
|
tabIndex: h = 0
|
|
2464
|
-
} = o ?? {}, b = l?.id === t, D =
|
|
2465
|
-
|
|
2466
|
-
() => (
|
|
2464
|
+
} = o ?? {}, b = l?.id === t, D = Ae(b ? It : vi), [m, y] = mt(), [k, E] = mt(), N = ii(a, t), S = tt(n);
|
|
2465
|
+
fe(
|
|
2466
|
+
() => (u.set(t, {
|
|
2467
2467
|
id: t,
|
|
2468
2468
|
key: i,
|
|
2469
2469
|
node: m,
|
|
2470
|
-
activatorNode:
|
|
2470
|
+
activatorNode: k,
|
|
2471
2471
|
data: S
|
|
2472
2472
|
}), () => {
|
|
2473
|
-
const
|
|
2474
|
-
|
|
2473
|
+
const j = u.get(t);
|
|
2474
|
+
j && j.key === i && u.delete(t);
|
|
2475
2475
|
}),
|
|
2476
2476
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2477
|
-
[
|
|
2477
|
+
[u, t]
|
|
2478
2478
|
);
|
|
2479
|
-
const
|
|
2480
|
-
role:
|
|
2479
|
+
const C = B(() => ({
|
|
2480
|
+
role: p,
|
|
2481
2481
|
tabIndex: h,
|
|
2482
2482
|
"aria-disabled": r,
|
|
2483
|
-
"aria-pressed": b &&
|
|
2483
|
+
"aria-pressed": b && p === En ? !0 : void 0,
|
|
2484
2484
|
"aria-roledescription": R,
|
|
2485
|
-
"aria-describedby":
|
|
2486
|
-
}), [r,
|
|
2485
|
+
"aria-describedby": d.draggable
|
|
2486
|
+
}), [r, p, h, b, R, d.draggable]);
|
|
2487
2487
|
return {
|
|
2488
2488
|
active: l,
|
|
2489
2489
|
activatorEvent: s,
|
|
2490
2490
|
activeNodeRect: c,
|
|
2491
|
-
attributes:
|
|
2491
|
+
attributes: C,
|
|
2492
2492
|
isDragging: b,
|
|
2493
2493
|
listeners: r ? void 0 : N,
|
|
2494
2494
|
node: m,
|
|
@@ -2498,8 +2498,8 @@ function gr(e) {
|
|
|
2498
2498
|
transform: D
|
|
2499
2499
|
};
|
|
2500
2500
|
}
|
|
2501
|
-
function
|
|
2502
|
-
return
|
|
2501
|
+
function gr() {
|
|
2502
|
+
return Ae(dr);
|
|
2503
2503
|
}
|
|
2504
2504
|
const yi = "Droppable", wi = {
|
|
2505
2505
|
timeout: 25
|
|
@@ -2516,36 +2516,36 @@ function hr(e) {
|
|
|
2516
2516
|
dispatch: s,
|
|
2517
2517
|
over: l,
|
|
2518
2518
|
measureDroppableContainers: c
|
|
2519
|
-
} =
|
|
2519
|
+
} = Ae(ct), d = I({
|
|
2520
2520
|
disabled: n
|
|
2521
|
-
}),
|
|
2521
|
+
}), u = I(!1), f = I(null), p = I(null), {
|
|
2522
2522
|
disabled: R,
|
|
2523
2523
|
updateMeasurementsFor: h,
|
|
2524
2524
|
timeout: b
|
|
2525
2525
|
} = {
|
|
2526
2526
|
...wi,
|
|
2527
2527
|
...o
|
|
2528
|
-
}, D = tt(h ?? r), m =
|
|
2528
|
+
}, D = tt(h ?? r), m = L(
|
|
2529
2529
|
() => {
|
|
2530
|
-
if (!
|
|
2531
|
-
|
|
2530
|
+
if (!u.current) {
|
|
2531
|
+
u.current = !0;
|
|
2532
2532
|
return;
|
|
2533
2533
|
}
|
|
2534
|
-
|
|
2535
|
-
c(Array.isArray(D.current) ? D.current : [D.current]),
|
|
2534
|
+
p.current != null && clearTimeout(p.current), p.current = setTimeout(() => {
|
|
2535
|
+
c(Array.isArray(D.current) ? D.current : [D.current]), p.current = null;
|
|
2536
2536
|
}, b);
|
|
2537
2537
|
},
|
|
2538
2538
|
//eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2539
2539
|
[b]
|
|
2540
|
-
), y =
|
|
2540
|
+
), y = Et({
|
|
2541
2541
|
callback: m,
|
|
2542
2542
|
disabled: R || !a
|
|
2543
|
-
}),
|
|
2544
|
-
y && (
|
|
2545
|
-
}, [y]), [E, N] =
|
|
2546
|
-
return
|
|
2547
|
-
!y || !E.current || (y.disconnect(),
|
|
2548
|
-
}, [E, y]),
|
|
2543
|
+
}), k = L((C, j) => {
|
|
2544
|
+
y && (j && (y.unobserve(j), u.current = !1), C && y.observe(C));
|
|
2545
|
+
}, [y]), [E, N] = mt(k), S = tt(t);
|
|
2546
|
+
return O(() => {
|
|
2547
|
+
!y || !E.current || (y.disconnect(), u.current = !1, y.observe(E.current));
|
|
2548
|
+
}, [E, y]), O(
|
|
2549
2549
|
() => (s({
|
|
2550
2550
|
type: W.RegisterDroppable,
|
|
2551
2551
|
element: {
|
|
@@ -2563,13 +2563,13 @@ function hr(e) {
|
|
|
2563
2563
|
})),
|
|
2564
2564
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2565
2565
|
[r]
|
|
2566
|
-
),
|
|
2567
|
-
n !==
|
|
2566
|
+
), O(() => {
|
|
2567
|
+
n !== d.current.disabled && (s({
|
|
2568
2568
|
type: W.SetDroppableDisabled,
|
|
2569
2569
|
id: r,
|
|
2570
2570
|
key: i,
|
|
2571
2571
|
disabled: n
|
|
2572
|
-
}),
|
|
2572
|
+
}), d.current.disabled = n);
|
|
2573
2573
|
}, [r, i, n, s]), {
|
|
2574
2574
|
active: a,
|
|
2575
2575
|
rect: f,
|
|
@@ -2584,8 +2584,8 @@ function xi(e) {
|
|
|
2584
2584
|
animation: t,
|
|
2585
2585
|
children: n
|
|
2586
2586
|
} = e;
|
|
2587
|
-
const [r, o] =
|
|
2588
|
-
return !n && !r && s && o(s),
|
|
2587
|
+
const [r, o] = $(null), [i, a] = $(null), s = yt(n);
|
|
2588
|
+
return !n && !r && s && o(s), fe(() => {
|
|
2589
2589
|
if (!i)
|
|
2590
2590
|
return;
|
|
2591
2591
|
const l = r?.key, c = r?.props.id;
|
|
@@ -2612,14 +2612,14 @@ function Di(e) {
|
|
|
2612
2612
|
} = e;
|
|
2613
2613
|
return z.createElement(ct.Provider, {
|
|
2614
2614
|
value: ur
|
|
2615
|
-
}, z.createElement(
|
|
2615
|
+
}, z.createElement(It.Provider, {
|
|
2616
2616
|
value: Ri
|
|
2617
2617
|
}, t));
|
|
2618
2618
|
}
|
|
2619
|
-
const
|
|
2619
|
+
const Ci = {
|
|
2620
2620
|
position: "fixed",
|
|
2621
2621
|
touchAction: "none"
|
|
2622
|
-
},
|
|
2622
|
+
}, ki = (e) => Nt(e) ? "transform 250ms ease" : void 0, Si = /* @__PURE__ */ eo((e, t) => {
|
|
2623
2623
|
let {
|
|
2624
2624
|
as: n,
|
|
2625
2625
|
activatorEvent: r,
|
|
@@ -2629,23 +2629,23 @@ const ki = {
|
|
|
2629
2629
|
rect: s,
|
|
2630
2630
|
style: l,
|
|
2631
2631
|
transform: c,
|
|
2632
|
-
transition:
|
|
2632
|
+
transition: d = ki
|
|
2633
2633
|
} = e;
|
|
2634
2634
|
if (!s)
|
|
2635
2635
|
return null;
|
|
2636
|
-
const
|
|
2636
|
+
const u = o ? c : {
|
|
2637
2637
|
...c,
|
|
2638
2638
|
scaleX: 1,
|
|
2639
2639
|
scaleY: 1
|
|
2640
2640
|
}, f = {
|
|
2641
|
-
...
|
|
2641
|
+
...Ci,
|
|
2642
2642
|
width: s.width,
|
|
2643
2643
|
height: s.height,
|
|
2644
2644
|
top: s.top,
|
|
2645
2645
|
left: s.left,
|
|
2646
|
-
transform: me.Transform.toString(
|
|
2646
|
+
transform: me.Transform.toString(u),
|
|
2647
2647
|
transformOrigin: o && r ? yo(r, s) : void 0,
|
|
2648
|
-
transition: typeof
|
|
2648
|
+
transition: typeof d == "function" ? d(r) : d,
|
|
2649
2649
|
...l
|
|
2650
2650
|
};
|
|
2651
2651
|
return z.createElement(n, {
|
|
@@ -2704,7 +2704,7 @@ function Ii(e) {
|
|
|
2704
2704
|
droppableContainers: r,
|
|
2705
2705
|
measuringConfiguration: o
|
|
2706
2706
|
} = e;
|
|
2707
|
-
return
|
|
2707
|
+
return St((i, a) => {
|
|
2708
2708
|
if (t === null)
|
|
2709
2709
|
return;
|
|
2710
2710
|
const s = n.get(i);
|
|
@@ -2717,9 +2717,9 @@ function Ii(e) {
|
|
|
2717
2717
|
if (!c)
|
|
2718
2718
|
return;
|
|
2719
2719
|
const {
|
|
2720
|
-
transform:
|
|
2721
|
-
} =
|
|
2722
|
-
if (!
|
|
2720
|
+
transform: d
|
|
2721
|
+
} = G(a).getComputedStyle(a), u = Qn(d);
|
|
2722
|
+
if (!u)
|
|
2723
2723
|
return;
|
|
2724
2724
|
const f = typeof t == "function" ? t : Ti(t);
|
|
2725
2725
|
return ar(l, o.draggable.measure), f({
|
|
@@ -2736,7 +2736,7 @@ function Ii(e) {
|
|
|
2736
2736
|
},
|
|
2737
2737
|
droppableContainers: r,
|
|
2738
2738
|
measuringConfiguration: o,
|
|
2739
|
-
transform:
|
|
2739
|
+
transform: u
|
|
2740
2740
|
});
|
|
2741
2741
|
});
|
|
2742
2742
|
}
|
|
@@ -2759,17 +2759,17 @@ function Ti(e) {
|
|
|
2759
2759
|
} = i;
|
|
2760
2760
|
if (!t)
|
|
2761
2761
|
return;
|
|
2762
|
-
const
|
|
2762
|
+
const d = {
|
|
2763
2763
|
x: s.rect.left - a.rect.left,
|
|
2764
2764
|
y: s.rect.top - a.rect.top
|
|
2765
|
-
},
|
|
2765
|
+
}, u = {
|
|
2766
2766
|
scaleX: l.scaleX !== 1 ? a.rect.width * l.scaleX / s.rect.width : 1,
|
|
2767
2767
|
scaleY: l.scaleY !== 1 ? a.rect.height * l.scaleY / s.rect.height : 1
|
|
2768
2768
|
}, f = {
|
|
2769
|
-
x: l.x -
|
|
2770
|
-
y: l.y -
|
|
2771
|
-
...
|
|
2772
|
-
},
|
|
2769
|
+
x: l.x - d.x,
|
|
2770
|
+
y: l.y - d.y,
|
|
2771
|
+
...u
|
|
2772
|
+
}, p = o({
|
|
2773
2773
|
...c,
|
|
2774
2774
|
active: a,
|
|
2775
2775
|
dragOverlay: s,
|
|
@@ -2777,14 +2777,14 @@ function Ti(e) {
|
|
|
2777
2777
|
initial: l,
|
|
2778
2778
|
final: f
|
|
2779
2779
|
}
|
|
2780
|
-
}), [R] =
|
|
2780
|
+
}), [R] = p, h = p[p.length - 1];
|
|
2781
2781
|
if (JSON.stringify(R) === JSON.stringify(h))
|
|
2782
2782
|
return;
|
|
2783
2783
|
const b = r?.({
|
|
2784
2784
|
active: a,
|
|
2785
2785
|
dragOverlay: s,
|
|
2786
2786
|
...c
|
|
2787
|
-
}), D = s.node.animate(
|
|
2787
|
+
}), D = s.node.animate(p, {
|
|
2788
2788
|
duration: t,
|
|
2789
2789
|
easing: n,
|
|
2790
2790
|
fill: "forwards"
|
|
@@ -2798,7 +2798,7 @@ function Ti(e) {
|
|
|
2798
2798
|
}
|
|
2799
2799
|
let In = 0;
|
|
2800
2800
|
function Oi(e) {
|
|
2801
|
-
return
|
|
2801
|
+
return B(() => {
|
|
2802
2802
|
if (e != null)
|
|
2803
2803
|
return In++, In;
|
|
2804
2804
|
}, [e]);
|
|
@@ -2816,53 +2816,53 @@ const Pi = /* @__PURE__ */ z.memo((e) => {
|
|
|
2816
2816
|
zIndex: c = 999
|
|
2817
2817
|
} = e;
|
|
2818
2818
|
const {
|
|
2819
|
-
activatorEvent:
|
|
2820
|
-
active:
|
|
2819
|
+
activatorEvent: d,
|
|
2820
|
+
active: u,
|
|
2821
2821
|
activeNodeRect: f,
|
|
2822
|
-
containerNodeRect:
|
|
2822
|
+
containerNodeRect: p,
|
|
2823
2823
|
draggableNodes: R,
|
|
2824
2824
|
droppableContainers: h,
|
|
2825
2825
|
dragOverlay: b,
|
|
2826
2826
|
over: D,
|
|
2827
2827
|
measuringConfiguration: m,
|
|
2828
2828
|
scrollableAncestors: y,
|
|
2829
|
-
scrollableAncestorRects:
|
|
2829
|
+
scrollableAncestorRects: k,
|
|
2830
2830
|
windowRect: E
|
|
2831
|
-
} =
|
|
2832
|
-
activatorEvent:
|
|
2833
|
-
active:
|
|
2831
|
+
} = gr(), N = Ae(It), S = Oi(u?.id), C = fr(a, {
|
|
2832
|
+
activatorEvent: d,
|
|
2833
|
+
active: u,
|
|
2834
2834
|
activeNodeRect: f,
|
|
2835
|
-
containerNodeRect:
|
|
2835
|
+
containerNodeRect: p,
|
|
2836
2836
|
draggingNodeRect: b.rect,
|
|
2837
2837
|
over: D,
|
|
2838
2838
|
overlayNodeRect: b.rect,
|
|
2839
2839
|
scrollableAncestors: y,
|
|
2840
|
-
scrollableAncestorRects:
|
|
2840
|
+
scrollableAncestorRects: k,
|
|
2841
2841
|
transform: N,
|
|
2842
2842
|
windowRect: E
|
|
2843
|
-
}),
|
|
2843
|
+
}), j = on(f), P = Ii({
|
|
2844
2844
|
config: r,
|
|
2845
2845
|
draggableNodes: R,
|
|
2846
2846
|
droppableContainers: h,
|
|
2847
2847
|
measuringConfiguration: m
|
|
2848
|
-
}), w =
|
|
2848
|
+
}), w = j ? b.setRef : void 0;
|
|
2849
2849
|
return z.createElement(Di, null, z.createElement(xi, {
|
|
2850
|
-
animation:
|
|
2851
|
-
},
|
|
2850
|
+
animation: P
|
|
2851
|
+
}, u && S ? z.createElement(Si, {
|
|
2852
2852
|
key: S,
|
|
2853
|
-
id:
|
|
2853
|
+
id: u.id,
|
|
2854
2854
|
ref: w,
|
|
2855
2855
|
as: s,
|
|
2856
|
-
activatorEvent:
|
|
2856
|
+
activatorEvent: d,
|
|
2857
2857
|
adjustScale: t,
|
|
2858
2858
|
className: l,
|
|
2859
2859
|
transition: i,
|
|
2860
|
-
rect:
|
|
2860
|
+
rect: j,
|
|
2861
2861
|
style: {
|
|
2862
2862
|
zIndex: c,
|
|
2863
2863
|
...o
|
|
2864
2864
|
},
|
|
2865
|
-
transform:
|
|
2865
|
+
transform: C
|
|
2866
2866
|
}, n) : null));
|
|
2867
2867
|
});
|
|
2868
2868
|
function br(e, t, n) {
|
|
@@ -2908,7 +2908,7 @@ const vr = (e) => {
|
|
|
2908
2908
|
scaleX: s.width / a.width,
|
|
2909
2909
|
scaleY: s.height / a.height
|
|
2910
2910
|
};
|
|
2911
|
-
},
|
|
2911
|
+
}, ht = {
|
|
2912
2912
|
scaleX: 1,
|
|
2913
2913
|
scaleY: 1
|
|
2914
2914
|
}, $i = (e) => {
|
|
@@ -2928,22 +2928,22 @@ const vr = (e) => {
|
|
|
2928
2928
|
return c ? {
|
|
2929
2929
|
x: 0,
|
|
2930
2930
|
y: n < a ? c.top + c.height - (s.top + s.height) : c.top - s.top,
|
|
2931
|
-
...
|
|
2931
|
+
...ht
|
|
2932
2932
|
} : null;
|
|
2933
2933
|
}
|
|
2934
2934
|
const l = Bi(i, o, n);
|
|
2935
2935
|
return o > n && o <= a ? {
|
|
2936
2936
|
x: 0,
|
|
2937
2937
|
y: -s.height - l,
|
|
2938
|
-
...
|
|
2938
|
+
...ht
|
|
2939
2939
|
} : o < n && o >= a ? {
|
|
2940
2940
|
x: 0,
|
|
2941
2941
|
y: s.height + l,
|
|
2942
|
-
...
|
|
2942
|
+
...ht
|
|
2943
2943
|
} : {
|
|
2944
2944
|
x: 0,
|
|
2945
2945
|
y: 0,
|
|
2946
|
-
...
|
|
2946
|
+
...ht
|
|
2947
2947
|
};
|
|
2948
2948
|
};
|
|
2949
2949
|
function Bi(e, t, n) {
|
|
@@ -2977,27 +2977,27 @@ function wr(e) {
|
|
|
2977
2977
|
dragOverlay: s,
|
|
2978
2978
|
droppableRects: l,
|
|
2979
2979
|
over: c,
|
|
2980
|
-
measureDroppableContainers:
|
|
2981
|
-
} =
|
|
2982
|
-
|
|
2983
|
-
m && R &&
|
|
2984
|
-
}, [m,
|
|
2985
|
-
D.current =
|
|
2986
|
-
}, [
|
|
2987
|
-
const E =
|
|
2980
|
+
measureDroppableContainers: d
|
|
2981
|
+
} = gr(), u = lt(mr, n), f = s.rect !== null, p = B(() => r.map((N) => typeof N == "object" && "id" in N ? N.id : N), [r]), R = a != null, h = a ? p.indexOf(a.id) : -1, b = c ? p.indexOf(c.id) : -1, D = I(p), m = !Li(p, D.current), y = b !== -1 && h === -1 || m, k = _i(i);
|
|
2982
|
+
fe(() => {
|
|
2983
|
+
m && R && d(p);
|
|
2984
|
+
}, [m, p, R, d]), O(() => {
|
|
2985
|
+
D.current = p;
|
|
2986
|
+
}, [p]);
|
|
2987
|
+
const E = B(
|
|
2988
2988
|
() => ({
|
|
2989
2989
|
activeIndex: h,
|
|
2990
|
-
containerId:
|
|
2991
|
-
disabled:
|
|
2990
|
+
containerId: u,
|
|
2991
|
+
disabled: k,
|
|
2992
2992
|
disableTransforms: y,
|
|
2993
|
-
items:
|
|
2993
|
+
items: p,
|
|
2994
2994
|
overIndex: b,
|
|
2995
2995
|
useDragOverlay: f,
|
|
2996
|
-
sortedRects: Mi(
|
|
2996
|
+
sortedRects: Mi(p, l),
|
|
2997
2997
|
strategy: o
|
|
2998
2998
|
}),
|
|
2999
2999
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3000
|
-
[h,
|
|
3000
|
+
[h, u, k.draggable, k.droppable, y, p, b, l, f, o]
|
|
3001
3001
|
);
|
|
3002
3002
|
return z.createElement(yr.Provider, {
|
|
3003
3003
|
value: E
|
|
@@ -3041,24 +3041,24 @@ function Hi(e) {
|
|
|
3041
3041
|
node: r,
|
|
3042
3042
|
rect: o
|
|
3043
3043
|
} = e;
|
|
3044
|
-
const [i, a] =
|
|
3045
|
-
return
|
|
3044
|
+
const [i, a] = $(null), s = I(n);
|
|
3045
|
+
return fe(() => {
|
|
3046
3046
|
if (!t && n !== s.current && r.current) {
|
|
3047
3047
|
const l = o.current;
|
|
3048
3048
|
if (l) {
|
|
3049
3049
|
const c = Xe(r.current, {
|
|
3050
3050
|
ignoreTransform: !0
|
|
3051
|
-
}),
|
|
3051
|
+
}), d = {
|
|
3052
3052
|
x: l.left - c.left,
|
|
3053
3053
|
y: l.top - c.top,
|
|
3054
3054
|
scaleX: l.width / c.width,
|
|
3055
3055
|
scaleY: l.height / c.height
|
|
3056
3056
|
};
|
|
3057
|
-
(
|
|
3057
|
+
(d.x || d.y) && a(d);
|
|
3058
3058
|
}
|
|
3059
3059
|
}
|
|
3060
3060
|
n !== s.current && (s.current = n);
|
|
3061
|
-
}, [t, n, r, o]),
|
|
3061
|
+
}, [t, n, r, o]), O(() => {
|
|
3062
3062
|
i && a(null);
|
|
3063
3063
|
}, [i]), i;
|
|
3064
3064
|
}
|
|
@@ -3075,27 +3075,27 @@ function Rr(e) {
|
|
|
3075
3075
|
transition: c = zi
|
|
3076
3076
|
} = e;
|
|
3077
3077
|
const {
|
|
3078
|
-
items:
|
|
3079
|
-
containerId:
|
|
3078
|
+
items: d,
|
|
3079
|
+
containerId: u,
|
|
3080
3080
|
activeIndex: f,
|
|
3081
|
-
disabled:
|
|
3081
|
+
disabled: p,
|
|
3082
3082
|
disableTransforms: R,
|
|
3083
3083
|
sortedRects: h,
|
|
3084
3084
|
overIndex: b,
|
|
3085
3085
|
useDragOverlay: D,
|
|
3086
3086
|
strategy: m
|
|
3087
|
-
} =
|
|
3087
|
+
} = Ae(yr), y = Xi(r, p), k = d.indexOf(a), E = B(() => ({
|
|
3088
3088
|
sortable: {
|
|
3089
|
-
containerId:
|
|
3090
|
-
index:
|
|
3091
|
-
items:
|
|
3089
|
+
containerId: u,
|
|
3090
|
+
index: k,
|
|
3091
|
+
items: d
|
|
3092
3092
|
},
|
|
3093
3093
|
...o
|
|
3094
|
-
}), [
|
|
3094
|
+
}), [u, o, k, d]), N = B(() => d.slice(d.indexOf(a)), [d, a]), {
|
|
3095
3095
|
rect: S,
|
|
3096
|
-
node:
|
|
3097
|
-
isOver:
|
|
3098
|
-
setNodeRef:
|
|
3096
|
+
node: C,
|
|
3097
|
+
isOver: j,
|
|
3098
|
+
setNodeRef: P
|
|
3099
3099
|
} = hr({
|
|
3100
3100
|
id: a,
|
|
3101
3101
|
data: E,
|
|
@@ -3107,15 +3107,15 @@ function Rr(e) {
|
|
|
3107
3107
|
}), {
|
|
3108
3108
|
active: w,
|
|
3109
3109
|
activatorEvent: X,
|
|
3110
|
-
activeNodeRect:
|
|
3110
|
+
activeNodeRect: q,
|
|
3111
3111
|
attributes: ee,
|
|
3112
3112
|
setNodeRef: ye,
|
|
3113
|
-
listeners:
|
|
3113
|
+
listeners: Ee,
|
|
3114
3114
|
isDragging: F,
|
|
3115
3115
|
over: Me,
|
|
3116
|
-
setActivatorNodeRef:
|
|
3117
|
-
transform:
|
|
3118
|
-
} =
|
|
3116
|
+
setActivatorNodeRef: J,
|
|
3117
|
+
transform: Ie
|
|
3118
|
+
} = pr({
|
|
3119
3119
|
id: a,
|
|
3120
3120
|
data: E,
|
|
3121
3121
|
attributes: {
|
|
@@ -3123,85 +3123,85 @@ function Rr(e) {
|
|
|
3123
3123
|
...n
|
|
3124
3124
|
},
|
|
3125
3125
|
disabled: y.draggable
|
|
3126
|
-
}), Le = ro(
|
|
3126
|
+
}), Le = ro(P, ye), K = !!w, le = K && !R && gt(f) && gt(b), ce = !D && F, Te = ce && le ? Ie : null, _e = le ? Te ?? (s ?? m)({
|
|
3127
3127
|
rects: h,
|
|
3128
|
-
activeNodeRect:
|
|
3128
|
+
activeNodeRect: q,
|
|
3129
3129
|
activeIndex: f,
|
|
3130
3130
|
overIndex: b,
|
|
3131
|
-
index:
|
|
3131
|
+
index: k
|
|
3132
3132
|
}) : null, ge = gt(f) && gt(b) ? i({
|
|
3133
3133
|
id: a,
|
|
3134
|
-
items:
|
|
3134
|
+
items: d,
|
|
3135
3135
|
activeIndex: f,
|
|
3136
3136
|
overIndex: b
|
|
3137
|
-
}) :
|
|
3138
|
-
activeId:
|
|
3139
|
-
items:
|
|
3137
|
+
}) : k, ue = w?.id, M = I({
|
|
3138
|
+
activeId: ue,
|
|
3139
|
+
items: d,
|
|
3140
3140
|
newIndex: ge,
|
|
3141
|
-
containerId:
|
|
3142
|
-
}), Oe =
|
|
3141
|
+
containerId: u
|
|
3142
|
+
}), Oe = d !== M.current.items, oe = t({
|
|
3143
3143
|
active: w,
|
|
3144
|
-
containerId:
|
|
3144
|
+
containerId: u,
|
|
3145
3145
|
isDragging: F,
|
|
3146
3146
|
isSorting: K,
|
|
3147
3147
|
id: a,
|
|
3148
|
-
index:
|
|
3149
|
-
items:
|
|
3150
|
-
newIndex:
|
|
3151
|
-
previousItems:
|
|
3152
|
-
previousContainerId:
|
|
3148
|
+
index: k,
|
|
3149
|
+
items: d,
|
|
3150
|
+
newIndex: M.current.newIndex,
|
|
3151
|
+
previousItems: M.current.items,
|
|
3152
|
+
previousContainerId: M.current.containerId,
|
|
3153
3153
|
transition: c,
|
|
3154
|
-
wasDragging:
|
|
3155
|
-
}),
|
|
3156
|
-
disabled: !
|
|
3157
|
-
index:
|
|
3158
|
-
node:
|
|
3154
|
+
wasDragging: M.current.activeId != null
|
|
3155
|
+
}), we = Hi({
|
|
3156
|
+
disabled: !oe,
|
|
3157
|
+
index: k,
|
|
3158
|
+
node: C,
|
|
3159
3159
|
rect: S
|
|
3160
3160
|
});
|
|
3161
|
-
return
|
|
3162
|
-
K &&
|
|
3163
|
-
}, [K, ge,
|
|
3164
|
-
if (
|
|
3161
|
+
return O(() => {
|
|
3162
|
+
K && M.current.newIndex !== ge && (M.current.newIndex = ge), u !== M.current.containerId && (M.current.containerId = u), d !== M.current.items && (M.current.items = d);
|
|
3163
|
+
}, [K, ge, u, d]), O(() => {
|
|
3164
|
+
if (ue === M.current.activeId)
|
|
3165
3165
|
return;
|
|
3166
|
-
if (
|
|
3167
|
-
|
|
3166
|
+
if (ue != null && M.current.activeId == null) {
|
|
3167
|
+
M.current.activeId = ue;
|
|
3168
3168
|
return;
|
|
3169
3169
|
}
|
|
3170
|
-
const
|
|
3171
|
-
|
|
3170
|
+
const xe = setTimeout(() => {
|
|
3171
|
+
M.current.activeId = ue;
|
|
3172
3172
|
}, 50);
|
|
3173
|
-
return () => clearTimeout(
|
|
3174
|
-
}, [
|
|
3173
|
+
return () => clearTimeout(xe);
|
|
3174
|
+
}, [ue]), {
|
|
3175
3175
|
active: w,
|
|
3176
3176
|
activeIndex: f,
|
|
3177
3177
|
attributes: ee,
|
|
3178
3178
|
data: E,
|
|
3179
3179
|
rect: S,
|
|
3180
|
-
index:
|
|
3180
|
+
index: k,
|
|
3181
3181
|
newIndex: ge,
|
|
3182
|
-
items:
|
|
3183
|
-
isOver:
|
|
3182
|
+
items: d,
|
|
3183
|
+
isOver: j,
|
|
3184
3184
|
isSorting: K,
|
|
3185
3185
|
isDragging: F,
|
|
3186
|
-
listeners:
|
|
3187
|
-
node:
|
|
3186
|
+
listeners: Ee,
|
|
3187
|
+
node: C,
|
|
3188
3188
|
overIndex: b,
|
|
3189
3189
|
over: Me,
|
|
3190
3190
|
setNodeRef: Le,
|
|
3191
|
-
setActivatorNodeRef:
|
|
3192
|
-
setDroppableNodeRef:
|
|
3191
|
+
setActivatorNodeRef: J,
|
|
3192
|
+
setDroppableNodeRef: P,
|
|
3193
3193
|
setDraggableNodeRef: ye,
|
|
3194
|
-
transform:
|
|
3195
|
-
transition:
|
|
3194
|
+
transform: we ?? _e,
|
|
3195
|
+
transition: de()
|
|
3196
3196
|
};
|
|
3197
|
-
function
|
|
3197
|
+
function de() {
|
|
3198
3198
|
if (
|
|
3199
3199
|
// Temporarily disable transitions for a single frame to set up derived transforms
|
|
3200
|
-
|
|
3201
|
-
Oe &&
|
|
3200
|
+
we || // Or to prevent items jumping to back to their "new" position when items change
|
|
3201
|
+
Oe && M.current.newIndex === k
|
|
3202
3202
|
)
|
|
3203
3203
|
return Ui;
|
|
3204
|
-
if (!(
|
|
3204
|
+
if (!(ce && !Nt(X) || !c) && (K || oe))
|
|
3205
3205
|
return me.Transition.toString({
|
|
3206
3206
|
...c,
|
|
3207
3207
|
property: xr
|
|
@@ -3219,7 +3219,7 @@ function Xi(e, t) {
|
|
|
3219
3219
|
droppable: (r = e?.droppable) != null ? r : t.droppable
|
|
3220
3220
|
};
|
|
3221
3221
|
}
|
|
3222
|
-
function
|
|
3222
|
+
function Dt(e) {
|
|
3223
3223
|
if (!e)
|
|
3224
3224
|
return !1;
|
|
3225
3225
|
const t = e.data.current;
|
|
@@ -3240,23 +3240,23 @@ const Vi = [T.Down, T.Right, T.Up, T.Left], Ki = (e, t) => {
|
|
|
3240
3240
|
if (e.preventDefault(), !n || !r)
|
|
3241
3241
|
return;
|
|
3242
3242
|
const l = [];
|
|
3243
|
-
i.getEnabled().forEach((
|
|
3244
|
-
if (!
|
|
3243
|
+
i.getEnabled().forEach((u) => {
|
|
3244
|
+
if (!u || u != null && u.disabled)
|
|
3245
3245
|
return;
|
|
3246
|
-
const f = o.get(
|
|
3246
|
+
const f = o.get(u.id);
|
|
3247
3247
|
if (f)
|
|
3248
3248
|
switch (e.code) {
|
|
3249
3249
|
case T.Down:
|
|
3250
|
-
r.top < f.top && l.push(
|
|
3250
|
+
r.top < f.top && l.push(u);
|
|
3251
3251
|
break;
|
|
3252
3252
|
case T.Up:
|
|
3253
|
-
r.top > f.top && l.push(
|
|
3253
|
+
r.top > f.top && l.push(u);
|
|
3254
3254
|
break;
|
|
3255
3255
|
case T.Left:
|
|
3256
|
-
r.left > f.left && l.push(
|
|
3256
|
+
r.left > f.left && l.push(u);
|
|
3257
3257
|
break;
|
|
3258
3258
|
case T.Right:
|
|
3259
|
-
r.left < f.left && l.push(
|
|
3259
|
+
r.left < f.left && l.push(u);
|
|
3260
3260
|
break;
|
|
3261
3261
|
}
|
|
3262
3262
|
});
|
|
@@ -3265,53 +3265,53 @@ const Vi = [T.Down, T.Right, T.Up, T.Left], Ki = (e, t) => {
|
|
|
3265
3265
|
droppableRects: o,
|
|
3266
3266
|
droppableContainers: l
|
|
3267
3267
|
});
|
|
3268
|
-
let
|
|
3269
|
-
if (
|
|
3270
|
-
const
|
|
3271
|
-
if (R &&
|
|
3272
|
-
const b =
|
|
3268
|
+
let d = Jn(c, "id");
|
|
3269
|
+
if (d === a?.id && c.length > 1 && (d = c[1].id), d != null) {
|
|
3270
|
+
const u = i.get(n.id), f = i.get(d), p = f ? o.get(f.id) : null, R = f?.node.current;
|
|
3271
|
+
if (R && p && u && f) {
|
|
3272
|
+
const b = At(R).some((N, S) => s[S] !== N), D = Dr(u, f), m = Yi(u, f), y = b || !D ? {
|
|
3273
3273
|
x: 0,
|
|
3274
3274
|
y: 0
|
|
3275
3275
|
} : {
|
|
3276
|
-
x: m ? r.width -
|
|
3277
|
-
y: m ? r.height -
|
|
3278
|
-
},
|
|
3279
|
-
x:
|
|
3280
|
-
y:
|
|
3276
|
+
x: m ? r.width - p.width : 0,
|
|
3277
|
+
y: m ? r.height - p.height : 0
|
|
3278
|
+
}, k = {
|
|
3279
|
+
x: p.left,
|
|
3280
|
+
y: p.top
|
|
3281
3281
|
};
|
|
3282
|
-
return y.x && y.y ?
|
|
3282
|
+
return y.x && y.y ? k : nt(k, y);
|
|
3283
3283
|
}
|
|
3284
3284
|
}
|
|
3285
3285
|
}
|
|
3286
3286
|
};
|
|
3287
3287
|
function Dr(e, t) {
|
|
3288
|
-
return !
|
|
3288
|
+
return !Dt(e) || !Dt(t) ? !1 : e.data.current.sortable.containerId === t.data.current.sortable.containerId;
|
|
3289
3289
|
}
|
|
3290
3290
|
function Yi(e, t) {
|
|
3291
|
-
return !
|
|
3291
|
+
return !Dt(e) || !Dt(t) || !Dr(e, t) ? !1 : e.data.current.sortable.index < t.data.current.sortable.index;
|
|
3292
3292
|
}
|
|
3293
3293
|
function qi(e) {
|
|
3294
3294
|
return e ?? "";
|
|
3295
3295
|
}
|
|
3296
|
-
function
|
|
3296
|
+
function Cr(e, t) {
|
|
3297
3297
|
return `${e.replace(/\/+$/, "")}/${t.replace(/^\/+/, "")}`;
|
|
3298
3298
|
}
|
|
3299
|
-
async function
|
|
3299
|
+
async function kr(e) {
|
|
3300
3300
|
const t = e.headers.get("content-type") ?? "", n = `${e.status} ${e.statusText || "Request failed"}`;
|
|
3301
3301
|
return t.includes("application/json") ? (await e.json()).error || n : (await e.text()).trim() || n;
|
|
3302
3302
|
}
|
|
3303
3303
|
async function Gi(e) {
|
|
3304
|
-
const t = await fetch(
|
|
3304
|
+
const t = await fetch(Cr(e, "/schema"), {
|
|
3305
3305
|
headers: {
|
|
3306
3306
|
Accept: "application/json"
|
|
3307
3307
|
}
|
|
3308
3308
|
});
|
|
3309
3309
|
if (!t.ok)
|
|
3310
|
-
throw new Error(await
|
|
3310
|
+
throw new Error(await kr(t));
|
|
3311
3311
|
return await t.json();
|
|
3312
3312
|
}
|
|
3313
3313
|
async function Ji(e, t) {
|
|
3314
|
-
const n = await fetch(
|
|
3314
|
+
const n = await fetch(Cr(e, "/render/template"), {
|
|
3315
3315
|
method: "POST",
|
|
3316
3316
|
headers: {
|
|
3317
3317
|
Accept: "application/pdf",
|
|
@@ -3324,7 +3324,7 @@ async function Ji(e, t) {
|
|
|
3324
3324
|
})
|
|
3325
3325
|
});
|
|
3326
3326
|
if (!n.ok)
|
|
3327
|
-
throw new Error(await
|
|
3327
|
+
throw new Error(await kr(n));
|
|
3328
3328
|
return n.blob();
|
|
3329
3329
|
}
|
|
3330
3330
|
const Zi = {
|
|
@@ -3337,18 +3337,18 @@ const Zi = {
|
|
|
3337
3337
|
spacer: { chip: "↕", label: "Spacer" },
|
|
3338
3338
|
divider: { chip: "─", label: "Divider" }
|
|
3339
3339
|
};
|
|
3340
|
-
function
|
|
3340
|
+
function an(e) {
|
|
3341
3341
|
return Zi[e] ?? { chip: "?", label: Qi(e) };
|
|
3342
3342
|
}
|
|
3343
3343
|
function Sr(e) {
|
|
3344
3344
|
switch (e.type) {
|
|
3345
3345
|
case "heading":
|
|
3346
3346
|
case "text":
|
|
3347
|
-
return
|
|
3347
|
+
return zt(e.text);
|
|
3348
3348
|
case "html":
|
|
3349
|
-
return
|
|
3349
|
+
return zt(e.html);
|
|
3350
3350
|
case "image":
|
|
3351
|
-
return
|
|
3351
|
+
return zt(e.alt ?? e.src);
|
|
3352
3352
|
case "key-value": {
|
|
3353
3353
|
const t = e.config?.fields ?? [];
|
|
3354
3354
|
return t.length > 0 ? `${t.length} field${t.length === 1 ? "" : "s"}` : "";
|
|
@@ -3369,7 +3369,7 @@ function Sr(e) {
|
|
|
3369
3369
|
return "";
|
|
3370
3370
|
}
|
|
3371
3371
|
}
|
|
3372
|
-
function
|
|
3372
|
+
function zt(e, t = 56) {
|
|
3373
3373
|
if (!e)
|
|
3374
3374
|
return "";
|
|
3375
3375
|
const n = e.replace(/\s+/g, " ").trim();
|
|
@@ -3379,10 +3379,10 @@ function Qi(e) {
|
|
|
3379
3379
|
return e.split("-").filter(Boolean).map((t) => `${t.charAt(0).toUpperCase()}${t.slice(1)}`).join(" ");
|
|
3380
3380
|
}
|
|
3381
3381
|
function ea({ blockTypes: e, onAdd: t }) {
|
|
3382
|
-
return /* @__PURE__ */
|
|
3382
|
+
return /* @__PURE__ */ g("div", { className: "builder-palette__list", "aria-label": "Block palette", children: e.map((n) => /* @__PURE__ */ g(ta, { type: n, onAdd: t }, n)) });
|
|
3383
3383
|
}
|
|
3384
3384
|
function ta({ type: e, onAdd: t }) {
|
|
3385
|
-
const n =
|
|
3385
|
+
const n = an(e), { attributes: r, listeners: o, setNodeRef: i, transform: a, isDragging: s } = pr({
|
|
3386
3386
|
id: `palette:${e}`,
|
|
3387
3387
|
data: {
|
|
3388
3388
|
source: "palette",
|
|
@@ -3404,22 +3404,22 @@ function ta({ type: e, onAdd: t }) {
|
|
|
3404
3404
|
...o,
|
|
3405
3405
|
...r,
|
|
3406
3406
|
children: [
|
|
3407
|
-
/* @__PURE__ */
|
|
3408
|
-
/* @__PURE__ */
|
|
3407
|
+
/* @__PURE__ */ g("span", { className: "builder-chip", "aria-hidden": "true", children: n.chip }),
|
|
3408
|
+
/* @__PURE__ */ g("span", { children: n.label })
|
|
3409
3409
|
]
|
|
3410
3410
|
}
|
|
3411
3411
|
);
|
|
3412
3412
|
}
|
|
3413
3413
|
function Tn({ type: e, summary: t, prefix: n }) {
|
|
3414
|
-
const r =
|
|
3415
|
-
return /* @__PURE__ */
|
|
3416
|
-
/* @__PURE__ */
|
|
3414
|
+
const r = an(e);
|
|
3415
|
+
return /* @__PURE__ */ g("div", { className: "builder-drag-overlay", children: /* @__PURE__ */ x("div", { className: "builder-drag-overlay__card", children: [
|
|
3416
|
+
/* @__PURE__ */ g("span", { className: "builder-chip", "aria-hidden": "true", children: r.chip }),
|
|
3417
3417
|
/* @__PURE__ */ x("span", { style: { display: "inline-flex", alignItems: "baseline", gap: 8 }, children: [
|
|
3418
3418
|
/* @__PURE__ */ x("span", { style: { fontWeight: 500 }, children: [
|
|
3419
3419
|
n,
|
|
3420
3420
|
r.label
|
|
3421
3421
|
] }),
|
|
3422
|
-
t ? /* @__PURE__ */
|
|
3422
|
+
t ? /* @__PURE__ */ g("span", { style: { color: "var(--ink-muted)", fontWeight: 400 }, children: t }) : null
|
|
3423
3423
|
] })
|
|
3424
3424
|
] }) });
|
|
3425
3425
|
}
|
|
@@ -3471,17 +3471,17 @@ function la({
|
|
|
3471
3471
|
return;
|
|
3472
3472
|
const l = s;
|
|
3473
3473
|
a.preventDefault(), a.currentTarget.setPointerCapture(a.pointerId);
|
|
3474
|
-
const c = Nr(e, t),
|
|
3475
|
-
function
|
|
3476
|
-
const h = (
|
|
3474
|
+
const c = Nr(e, t), d = c.slice(0, n).reduce((p, R) => p + R, 0);
|
|
3475
|
+
function u(p) {
|
|
3476
|
+
const h = (p.clientX - l.left) / l.width * 100 - d;
|
|
3477
3477
|
o(ra(ia(c, n, h)));
|
|
3478
3478
|
}
|
|
3479
3479
|
function f() {
|
|
3480
|
-
window.removeEventListener("pointermove",
|
|
3480
|
+
window.removeEventListener("pointermove", u), window.removeEventListener("pointerup", f);
|
|
3481
3481
|
}
|
|
3482
|
-
window.addEventListener("pointermove",
|
|
3482
|
+
window.addEventListener("pointermove", u), window.addEventListener("pointerup", f);
|
|
3483
3483
|
}
|
|
3484
|
-
return /* @__PURE__ */
|
|
3484
|
+
return /* @__PURE__ */ g(
|
|
3485
3485
|
"button",
|
|
3486
3486
|
{
|
|
3487
3487
|
type: "button",
|
|
@@ -3495,7 +3495,7 @@ const ca = 96, ua = 25.4;
|
|
|
3495
3495
|
function da(e) {
|
|
3496
3496
|
return Math.round(e / ua * ca);
|
|
3497
3497
|
}
|
|
3498
|
-
const
|
|
3498
|
+
const Yt = {
|
|
3499
3499
|
A3: [297, 420],
|
|
3500
3500
|
A4: [210, 297],
|
|
3501
3501
|
A5: [148, 210],
|
|
@@ -3505,10 +3505,10 @@ const Vt = {
|
|
|
3505
3505
|
Tabloid: [279.4, 431.8]
|
|
3506
3506
|
};
|
|
3507
3507
|
function fa(e, t = "portrait") {
|
|
3508
|
-
const n =
|
|
3508
|
+
const n = Yt[e ?? "A4"] ?? Yt.A4;
|
|
3509
3509
|
return t === "landscape" ? [n[1], n[0]] : n;
|
|
3510
3510
|
}
|
|
3511
|
-
function
|
|
3511
|
+
function pa({ format: e, orientation: t, children: n }) {
|
|
3512
3512
|
const [r] = fa(e, t), o = { "--page-width": `${da(r)}px` };
|
|
3513
3513
|
return /* @__PURE__ */ x("div", { className: "builder-page-sheet", style: o, children: [
|
|
3514
3514
|
/* @__PURE__ */ x("div", { className: "builder-page-sheet__meta", children: [
|
|
@@ -3525,19 +3525,19 @@ function ga({ format: e, orientation: t, children: n }) {
|
|
|
3525
3525
|
n
|
|
3526
3526
|
] });
|
|
3527
3527
|
}
|
|
3528
|
-
function
|
|
3528
|
+
function ga({
|
|
3529
3529
|
block: e,
|
|
3530
3530
|
fieldSchema: t,
|
|
3531
3531
|
configSchema: n,
|
|
3532
3532
|
onChange: r
|
|
3533
3533
|
}) {
|
|
3534
|
-
const o =
|
|
3534
|
+
const o = Ct(t), i = n ? Ct(n) : {};
|
|
3535
3535
|
return /* @__PURE__ */ x("div", { className: "inline-block-form", children: [
|
|
3536
3536
|
Object.entries(o).map(
|
|
3537
|
-
([a, s]) =>
|
|
3537
|
+
([a, s]) => qt({
|
|
3538
3538
|
key: a,
|
|
3539
3539
|
name: a,
|
|
3540
|
-
label:
|
|
3540
|
+
label: Gt(a, s),
|
|
3541
3541
|
schema: ot(s, t),
|
|
3542
3542
|
value: ya(e, a),
|
|
3543
3543
|
preserveEmptyString: !0,
|
|
@@ -3545,10 +3545,10 @@ function pa({
|
|
|
3545
3545
|
})
|
|
3546
3546
|
),
|
|
3547
3547
|
Object.entries(i).map(
|
|
3548
|
-
([a, s]) =>
|
|
3548
|
+
([a, s]) => qt({
|
|
3549
3549
|
key: `config.${a}`,
|
|
3550
3550
|
name: `config.${a}`,
|
|
3551
|
-
label:
|
|
3551
|
+
label: Gt(a, s),
|
|
3552
3552
|
schema: n ? ot(s, n) : s,
|
|
3553
3553
|
value: wa(e, a),
|
|
3554
3554
|
preserveEmptyString: !1,
|
|
@@ -3557,7 +3557,7 @@ function pa({
|
|
|
3557
3557
|
)
|
|
3558
3558
|
] });
|
|
3559
3559
|
}
|
|
3560
|
-
function
|
|
3560
|
+
function qt({
|
|
3561
3561
|
key: e,
|
|
3562
3562
|
name: t,
|
|
3563
3563
|
label: n,
|
|
@@ -3566,7 +3566,7 @@ function Kt({
|
|
|
3566
3566
|
preserveEmptyString: i,
|
|
3567
3567
|
onChange: a
|
|
3568
3568
|
}) {
|
|
3569
|
-
const s =
|
|
3569
|
+
const s = Tt(r), l = Ar(r), c = o ?? "";
|
|
3570
3570
|
if (l.length > 0)
|
|
3571
3571
|
return /* @__PURE__ */ x("label", { children: [
|
|
3572
3572
|
n,
|
|
@@ -3575,17 +3575,17 @@ function Kt({
|
|
|
3575
3575
|
{
|
|
3576
3576
|
name: t,
|
|
3577
3577
|
value: String(c),
|
|
3578
|
-
onChange: (
|
|
3578
|
+
onChange: (d) => a(Pr(d.currentTarget.value)),
|
|
3579
3579
|
children: [
|
|
3580
|
-
/* @__PURE__ */
|
|
3581
|
-
l.map((
|
|
3580
|
+
/* @__PURE__ */ g("option", { value: "" }),
|
|
3581
|
+
l.map((d) => /* @__PURE__ */ g("option", { value: String(d), children: String(d) }, String(d)))
|
|
3582
3582
|
]
|
|
3583
3583
|
}
|
|
3584
3584
|
)
|
|
3585
3585
|
] }, e);
|
|
3586
3586
|
if (Tr(s))
|
|
3587
3587
|
return /* @__PURE__ */ x("fieldset", { className: "builder-array-field", children: [
|
|
3588
|
-
/* @__PURE__ */
|
|
3588
|
+
/* @__PURE__ */ g("legend", { children: n }),
|
|
3589
3589
|
ha(t, s, o, a),
|
|
3590
3590
|
/* @__PURE__ */ x(
|
|
3591
3591
|
"button",
|
|
@@ -3603,17 +3603,17 @@ function Kt({
|
|
|
3603
3603
|
if (Or(s))
|
|
3604
3604
|
return /* @__PURE__ */ x("label", { children: [
|
|
3605
3605
|
n,
|
|
3606
|
-
/* @__PURE__ */
|
|
3606
|
+
/* @__PURE__ */ g(_r, { name: t, value: c, onChange: a })
|
|
3607
3607
|
] }, e);
|
|
3608
3608
|
if (Ir(s))
|
|
3609
3609
|
return /* @__PURE__ */ x("label", { className: "builder-field builder-field--checkbox", children: [
|
|
3610
|
-
/* @__PURE__ */
|
|
3610
|
+
/* @__PURE__ */ g(
|
|
3611
3611
|
"input",
|
|
3612
3612
|
{
|
|
3613
3613
|
name: t,
|
|
3614
3614
|
type: "checkbox",
|
|
3615
3615
|
checked: o === !0,
|
|
3616
|
-
onChange: (
|
|
3616
|
+
onChange: (d) => a(d.currentTarget.checked)
|
|
3617
3617
|
}
|
|
3618
3618
|
),
|
|
3619
3619
|
n
|
|
@@ -3621,27 +3621,27 @@ function Kt({
|
|
|
3621
3621
|
if (Er(s))
|
|
3622
3622
|
return /* @__PURE__ */ x("label", { children: [
|
|
3623
3623
|
n,
|
|
3624
|
-
/* @__PURE__ */
|
|
3624
|
+
/* @__PURE__ */ g(
|
|
3625
3625
|
"input",
|
|
3626
3626
|
{
|
|
3627
3627
|
name: t,
|
|
3628
3628
|
type: "number",
|
|
3629
3629
|
value: String(c),
|
|
3630
|
-
onChange: (
|
|
3630
|
+
onChange: (d) => a(Ra(d))
|
|
3631
3631
|
}
|
|
3632
3632
|
)
|
|
3633
3633
|
] }, e);
|
|
3634
3634
|
if (xa(s)) {
|
|
3635
|
-
const
|
|
3635
|
+
const d = String(c);
|
|
3636
3636
|
return /* @__PURE__ */ x("label", { children: [
|
|
3637
3637
|
n,
|
|
3638
|
-
/* @__PURE__ */
|
|
3638
|
+
/* @__PURE__ */ g(
|
|
3639
3639
|
"input",
|
|
3640
3640
|
{
|
|
3641
3641
|
name: t,
|
|
3642
3642
|
type: "text",
|
|
3643
|
-
value:
|
|
3644
|
-
onChange: (
|
|
3643
|
+
value: d,
|
|
3644
|
+
onChange: (u) => a(Da(u.currentTarget.value, i))
|
|
3645
3645
|
}
|
|
3646
3646
|
)
|
|
3647
3647
|
] }, e);
|
|
@@ -3649,22 +3649,22 @@ function Kt({
|
|
|
3649
3649
|
return null;
|
|
3650
3650
|
}
|
|
3651
3651
|
function ha(e, t, n, r) {
|
|
3652
|
-
const o = Mr(n), i = Lr(t), a = i ?
|
|
3653
|
-
return Object.keys(a).length === 0 ? /* @__PURE__ */
|
|
3652
|
+
const o = Mr(n), i = Lr(t), a = i ? Ct(i) : {};
|
|
3653
|
+
return Object.keys(a).length === 0 ? /* @__PURE__ */ g(_r, { name: e, value: o, onChange: r }) : o.map((s, l) => {
|
|
3654
3654
|
const c = Pe(s) ? s : {};
|
|
3655
3655
|
return /* @__PURE__ */ x("div", { className: "builder-array-field__item", children: [
|
|
3656
3656
|
Object.entries(a).map(
|
|
3657
|
-
([
|
|
3658
|
-
key: `${e}.${l}.${
|
|
3659
|
-
name: `${e}.${l}.${
|
|
3660
|
-
label:
|
|
3661
|
-
schema: ot(
|
|
3662
|
-
value: c[
|
|
3657
|
+
([d, u]) => qt({
|
|
3658
|
+
key: `${e}.${l}.${d}`,
|
|
3659
|
+
name: `${e}.${l}.${d}`,
|
|
3660
|
+
label: Gt(d, u),
|
|
3661
|
+
schema: ot(u, t),
|
|
3662
|
+
value: c[d],
|
|
3663
3663
|
preserveEmptyString: !0,
|
|
3664
|
-
onChange: (f) => r(
|
|
3664
|
+
onChange: (f) => r(Ca(o, l, { ...c, [d]: f }))
|
|
3665
3665
|
})
|
|
3666
3666
|
),
|
|
3667
|
-
/* @__PURE__ */
|
|
3667
|
+
/* @__PURE__ */ g("button", { type: "button", onClick: () => r(ka(o, l)), children: "Remove" })
|
|
3668
3668
|
] }, ba(e, l));
|
|
3669
3669
|
});
|
|
3670
3670
|
}
|
|
@@ -3694,7 +3694,7 @@ function ya(e, t) {
|
|
|
3694
3694
|
function wa(e, t) {
|
|
3695
3695
|
return e.config?.[t];
|
|
3696
3696
|
}
|
|
3697
|
-
function
|
|
3697
|
+
function Ct(e) {
|
|
3698
3698
|
const t = e.properties;
|
|
3699
3699
|
return Pe(t) ? Object.fromEntries(
|
|
3700
3700
|
Object.entries(t).filter(
|
|
@@ -3702,11 +3702,11 @@ function Rt(e) {
|
|
|
3702
3702
|
)
|
|
3703
3703
|
) : {};
|
|
3704
3704
|
}
|
|
3705
|
-
function
|
|
3705
|
+
function Gt(e, t) {
|
|
3706
3706
|
return typeof t.title == "string" ? t.title : e;
|
|
3707
3707
|
}
|
|
3708
3708
|
function Ar(e) {
|
|
3709
|
-
const t =
|
|
3709
|
+
const t = Tt(e);
|
|
3710
3710
|
return Array.isArray(t.enum) ? t.enum.filter((n) => n !== null) : [];
|
|
3711
3711
|
}
|
|
3712
3712
|
function Er(e) {
|
|
@@ -3739,14 +3739,14 @@ function Da(e, t) {
|
|
|
3739
3739
|
function Mr(e) {
|
|
3740
3740
|
return Array.isArray(e) ? e : [];
|
|
3741
3741
|
}
|
|
3742
|
-
function
|
|
3742
|
+
function Ca(e, t, n) {
|
|
3743
3743
|
return e.map((r, o) => o === t ? n : r);
|
|
3744
3744
|
}
|
|
3745
|
-
function
|
|
3745
|
+
function ka(e, t) {
|
|
3746
3746
|
return e.filter((n, r) => r !== t);
|
|
3747
3747
|
}
|
|
3748
3748
|
function Sa(e) {
|
|
3749
|
-
const t = Lr(e), n = t ?
|
|
3749
|
+
const t = Lr(e), n = t ? Ct(t) : {};
|
|
3750
3750
|
return Object.keys(n).length === 0 ? "" : Object.fromEntries(
|
|
3751
3751
|
Object.entries(n).map(([r, o]) => [
|
|
3752
3752
|
r,
|
|
@@ -3755,16 +3755,16 @@ function Sa(e) {
|
|
|
3755
3755
|
);
|
|
3756
3756
|
}
|
|
3757
3757
|
function Na(e) {
|
|
3758
|
-
const t =
|
|
3758
|
+
const t = Tt(e);
|
|
3759
3759
|
if ("default" in t)
|
|
3760
3760
|
return t.default;
|
|
3761
3761
|
const n = Ar(t);
|
|
3762
3762
|
return n.length > 0 ? n[0] : Er(t) ? 0 : Ir(t) ? !1 : Tr(t) ? [] : Or(t) ? {} : "";
|
|
3763
3763
|
}
|
|
3764
3764
|
function Lr(e) {
|
|
3765
|
-
return Pe(e.items) ?
|
|
3765
|
+
return Pe(e.items) ? Tt(ot(e.items, e)) : void 0;
|
|
3766
3766
|
}
|
|
3767
|
-
function
|
|
3767
|
+
function Tt(e) {
|
|
3768
3768
|
if (typeof e.$ref != "string")
|
|
3769
3769
|
return e;
|
|
3770
3770
|
const t = e.$defs;
|
|
@@ -3801,10 +3801,10 @@ function _r({
|
|
|
3801
3801
|
value: t,
|
|
3802
3802
|
onChange: n
|
|
3803
3803
|
}) {
|
|
3804
|
-
const [r, o] =
|
|
3805
|
-
return
|
|
3804
|
+
const [r, o] = $(() => Ln(t));
|
|
3805
|
+
return O(() => {
|
|
3806
3806
|
o(Ln(t));
|
|
3807
|
-
}, [t]), /* @__PURE__ */
|
|
3807
|
+
}, [t]), /* @__PURE__ */ g(
|
|
3808
3808
|
"textarea",
|
|
3809
3809
|
{
|
|
3810
3810
|
name: e,
|
|
@@ -3822,14 +3822,14 @@ function Pe(e) {
|
|
|
3822
3822
|
function Ea(e) {
|
|
3823
3823
|
return Ma(e["x-pdfUa"]);
|
|
3824
3824
|
}
|
|
3825
|
-
function
|
|
3825
|
+
function sn(e, t) {
|
|
3826
3826
|
if (!t.startsWith("#/"))
|
|
3827
3827
|
throw new Error(`Unsupported schema ref: ${t}`);
|
|
3828
3828
|
const n = t.slice(2).split("/").reduce((r, o) => {
|
|
3829
|
-
if (
|
|
3829
|
+
if (se(r))
|
|
3830
3830
|
return r[_a(o)];
|
|
3831
3831
|
}, e);
|
|
3832
|
-
if (!
|
|
3832
|
+
if (!se(n))
|
|
3833
3833
|
throw new Error(`Schema ref not found: ${t}`);
|
|
3834
3834
|
return n;
|
|
3835
3835
|
}
|
|
@@ -3843,7 +3843,7 @@ function $r(e, t) {
|
|
|
3843
3843
|
return Br(e).find((n) => jr(n) === t);
|
|
3844
3844
|
}
|
|
3845
3845
|
function Ta(e, t) {
|
|
3846
|
-
const n =
|
|
3846
|
+
const n = ln(e, t), r = Ot(n), o = Object.fromEntries(
|
|
3847
3847
|
Object.entries(r).filter(([a]) => a !== "type" && a !== "config")
|
|
3848
3848
|
), i = Fr(n.required).filter((a) => a !== "type");
|
|
3849
3849
|
return {
|
|
@@ -3854,17 +3854,17 @@ function Ta(e, t) {
|
|
|
3854
3854
|
};
|
|
3855
3855
|
}
|
|
3856
3856
|
function Oa(e, t) {
|
|
3857
|
-
const n =
|
|
3858
|
-
if (!
|
|
3857
|
+
const n = ln(e, t), r = Ot(n).config;
|
|
3858
|
+
if (!se(r))
|
|
3859
3859
|
return;
|
|
3860
3860
|
const o = r.$ref;
|
|
3861
3861
|
return {
|
|
3862
|
-
...typeof o == "string" ?
|
|
3862
|
+
...typeof o == "string" ? sn(e, o) : r,
|
|
3863
3863
|
$defs: e.$defs
|
|
3864
3864
|
};
|
|
3865
3865
|
}
|
|
3866
3866
|
function _n(e, t, n) {
|
|
3867
|
-
const r =
|
|
3867
|
+
const r = ln(e, t), o = Ot(r), i = {
|
|
3868
3868
|
type: t,
|
|
3869
3869
|
id: n
|
|
3870
3870
|
};
|
|
@@ -3872,34 +3872,34 @@ function _n(e, t, n) {
|
|
|
3872
3872
|
if (a === "type" || a === "config" || a === "id" || i[a] !== void 0)
|
|
3873
3873
|
continue;
|
|
3874
3874
|
const s = o[a];
|
|
3875
|
-
|
|
3875
|
+
se(s) && (i[a] = Jt(e, s));
|
|
3876
3876
|
}
|
|
3877
3877
|
return i;
|
|
3878
3878
|
}
|
|
3879
3879
|
function Br(e) {
|
|
3880
|
-
const t = e.$defs, n =
|
|
3881
|
-
return (
|
|
3882
|
-
if (!
|
|
3880
|
+
const t = e.$defs, n = se(t) ? t.block : void 0;
|
|
3881
|
+
return (se(n) && Array.isArray(n.oneOf) ? n.oneOf : []).map((o) => {
|
|
3882
|
+
if (!se(o))
|
|
3883
3883
|
return;
|
|
3884
3884
|
const i = o.$ref;
|
|
3885
|
-
return typeof i == "string" ?
|
|
3885
|
+
return typeof i == "string" ? sn(e, i) : o;
|
|
3886
3886
|
}).filter((o) => o !== void 0);
|
|
3887
3887
|
}
|
|
3888
|
-
function
|
|
3888
|
+
function ln(e, t) {
|
|
3889
3889
|
const n = $r(e, t);
|
|
3890
3890
|
if (!n)
|
|
3891
3891
|
throw new Error(`Unknown block type: ${t}`);
|
|
3892
3892
|
return n;
|
|
3893
3893
|
}
|
|
3894
3894
|
function jr(e) {
|
|
3895
|
-
const t =
|
|
3896
|
-
if (
|
|
3895
|
+
const t = Ot(e).type;
|
|
3896
|
+
if (se(t))
|
|
3897
3897
|
return typeof t.const == "string" ? t.const : void 0;
|
|
3898
3898
|
}
|
|
3899
|
-
function
|
|
3900
|
-
return
|
|
3899
|
+
function Ot(e) {
|
|
3900
|
+
return se(e.properties) ? e.properties : {};
|
|
3901
3901
|
}
|
|
3902
|
-
function
|
|
3902
|
+
function Jt(e, t) {
|
|
3903
3903
|
if ("default" in t)
|
|
3904
3904
|
return t.default;
|
|
3905
3905
|
if (Array.isArray(t.enum))
|
|
@@ -3907,12 +3907,12 @@ function qt(e, t) {
|
|
|
3907
3907
|
if (typeof t.const == "string" || typeof t.const == "number")
|
|
3908
3908
|
return t.const;
|
|
3909
3909
|
if (typeof t.$ref == "string")
|
|
3910
|
-
return
|
|
3910
|
+
return Jt(e, sn(e, t.$ref));
|
|
3911
3911
|
if (Array.isArray(t.oneOf)) {
|
|
3912
3912
|
const r = t.oneOf.find(
|
|
3913
|
-
(o) =>
|
|
3913
|
+
(o) => se(o) && o.type !== "null"
|
|
3914
3914
|
);
|
|
3915
|
-
return
|
|
3915
|
+
return se(r) ? Jt(e, r) : void 0;
|
|
3916
3916
|
}
|
|
3917
3917
|
switch (Pa(t.type)) {
|
|
3918
3918
|
case "string":
|
|
@@ -3940,14 +3940,14 @@ function Fr(e) {
|
|
|
3940
3940
|
return Array.isArray(e) ? e.filter((t) => typeof t == "string") : [];
|
|
3941
3941
|
}
|
|
3942
3942
|
function Ma(e) {
|
|
3943
|
-
if (!
|
|
3943
|
+
if (!se(e) || !La(e.blockOrder))
|
|
3944
3944
|
throw new Error("Invalid template schema metadata");
|
|
3945
3945
|
return e;
|
|
3946
3946
|
}
|
|
3947
3947
|
function La(e) {
|
|
3948
3948
|
return Array.isArray(e) && e.every((t) => typeof t == "string");
|
|
3949
3949
|
}
|
|
3950
|
-
function
|
|
3950
|
+
function se(e) {
|
|
3951
3951
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
3952
3952
|
}
|
|
3953
3953
|
function _a(e) {
|
|
@@ -3962,12 +3962,12 @@ function $a({
|
|
|
3962
3962
|
onRemoveBlock: i,
|
|
3963
3963
|
style: a
|
|
3964
3964
|
}) {
|
|
3965
|
-
const [s, l] =
|
|
3965
|
+
const [s, l] = $(!1), {
|
|
3966
3966
|
attributes: c,
|
|
3967
|
-
listeners:
|
|
3968
|
-
setActivatorNodeRef:
|
|
3967
|
+
listeners: d,
|
|
3968
|
+
setActivatorNodeRef: u,
|
|
3969
3969
|
setNodeRef: f,
|
|
3970
|
-
transform:
|
|
3970
|
+
transform: p,
|
|
3971
3971
|
transition: R,
|
|
3972
3972
|
isDragging: h
|
|
3973
3973
|
} = Rr({
|
|
@@ -3978,22 +3978,22 @@ function $a({
|
|
|
3978
3978
|
blockUid: n.uid,
|
|
3979
3979
|
area: t
|
|
3980
3980
|
}
|
|
3981
|
-
}), b = r, D = $r(b, n.block.type) !== void 0, m = D ? Ta(b, n.block.type) : null, y = D ? Oa(b, n.block.type) : void 0,
|
|
3981
|
+
}), b = r, D = $r(b, n.block.type) !== void 0, m = D ? Ta(b, n.block.type) : null, y = D ? Oa(b, n.block.type) : void 0, k = an(n.block.type), E = Sr(n.block), N = [
|
|
3982
3982
|
"builder-card",
|
|
3983
3983
|
h ? "is-dragging" : "",
|
|
3984
3984
|
s ? "is-expanded" : ""
|
|
3985
3985
|
].filter(Boolean).join(" "), S = {
|
|
3986
|
-
transform: me.Transform.toString(
|
|
3986
|
+
transform: me.Transform.toString(p),
|
|
3987
3987
|
transition: R,
|
|
3988
3988
|
...a
|
|
3989
3989
|
};
|
|
3990
|
-
function
|
|
3990
|
+
function C() {
|
|
3991
3991
|
l((w) => !w);
|
|
3992
3992
|
}
|
|
3993
|
-
function
|
|
3994
|
-
w.target === w.currentTarget && (w.key === "Enter" || w.key === " ") && (w.preventDefault(),
|
|
3993
|
+
function j(w) {
|
|
3994
|
+
w.target === w.currentTarget && (w.key === "Enter" || w.key === " ") && (w.preventDefault(), C());
|
|
3995
3995
|
}
|
|
3996
|
-
function
|
|
3996
|
+
function P(w) {
|
|
3997
3997
|
w.stopPropagation(), i(n.uid);
|
|
3998
3998
|
}
|
|
3999
3999
|
return /* @__PURE__ */ x("article", { ref: f, className: N, style: S, children: [
|
|
@@ -4004,47 +4004,47 @@ function $a({
|
|
|
4004
4004
|
role: "button",
|
|
4005
4005
|
tabIndex: 0,
|
|
4006
4006
|
"aria-expanded": s,
|
|
4007
|
-
onClick:
|
|
4008
|
-
onKeyDown:
|
|
4007
|
+
onClick: C,
|
|
4008
|
+
onKeyDown: j,
|
|
4009
4009
|
children: [
|
|
4010
|
-
/* @__PURE__ */
|
|
4010
|
+
/* @__PURE__ */ g(
|
|
4011
4011
|
"button",
|
|
4012
4012
|
{
|
|
4013
|
-
ref:
|
|
4013
|
+
ref: u,
|
|
4014
4014
|
type: "button",
|
|
4015
4015
|
className: "builder-card__handle",
|
|
4016
4016
|
"aria-label": "Drag to move block",
|
|
4017
4017
|
onClick: (w) => w.stopPropagation(),
|
|
4018
4018
|
...c,
|
|
4019
|
-
...
|
|
4019
|
+
...d,
|
|
4020
4020
|
children: "⋮⋮"
|
|
4021
4021
|
}
|
|
4022
4022
|
),
|
|
4023
|
-
/* @__PURE__ */
|
|
4023
|
+
/* @__PURE__ */ g("span", { className: "builder-chip", "aria-hidden": "true", children: k.chip }),
|
|
4024
4024
|
/* @__PURE__ */ x("div", { className: "builder-card__title", children: [
|
|
4025
|
-
/* @__PURE__ */
|
|
4026
|
-
E ? /* @__PURE__ */
|
|
4025
|
+
/* @__PURE__ */ g("span", { className: "builder-card__label", children: k.label }),
|
|
4026
|
+
E ? /* @__PURE__ */ g("span", { className: "builder-card__summary", children: E }) : null
|
|
4027
4027
|
] }),
|
|
4028
4028
|
/* @__PURE__ */ x("div", { className: "builder-card__actions", children: [
|
|
4029
|
-
/* @__PURE__ */
|
|
4029
|
+
/* @__PURE__ */ g(
|
|
4030
4030
|
"button",
|
|
4031
4031
|
{
|
|
4032
4032
|
type: "button",
|
|
4033
4033
|
className: "builder-card__icon-button",
|
|
4034
4034
|
"aria-label": s ? "Collapse block" : "Expand block",
|
|
4035
4035
|
onClick: (w) => {
|
|
4036
|
-
w.stopPropagation(),
|
|
4036
|
+
w.stopPropagation(), C();
|
|
4037
4037
|
},
|
|
4038
4038
|
children: s ? "▴" : "▾"
|
|
4039
4039
|
}
|
|
4040
4040
|
),
|
|
4041
|
-
/* @__PURE__ */
|
|
4041
|
+
/* @__PURE__ */ g(
|
|
4042
4042
|
"button",
|
|
4043
4043
|
{
|
|
4044
4044
|
type: "button",
|
|
4045
4045
|
className: "builder-card__icon-button builder-card__icon-button--danger",
|
|
4046
4046
|
"aria-label": "Remove block",
|
|
4047
|
-
onClick:
|
|
4047
|
+
onClick: P,
|
|
4048
4048
|
children: "✕"
|
|
4049
4049
|
}
|
|
4050
4050
|
)
|
|
@@ -4052,8 +4052,8 @@ function $a({
|
|
|
4052
4052
|
]
|
|
4053
4053
|
}
|
|
4054
4054
|
),
|
|
4055
|
-
s ? /* @__PURE__ */
|
|
4056
|
-
|
|
4055
|
+
s ? /* @__PURE__ */ g("div", { className: "builder-card__form", children: m ? /* @__PURE__ */ g(
|
|
4056
|
+
ga,
|
|
4057
4057
|
{
|
|
4058
4058
|
block: n.block,
|
|
4059
4059
|
fieldSchema: m,
|
|
@@ -4062,7 +4062,7 @@ function $a({
|
|
|
4062
4062
|
}
|
|
4063
4063
|
) : /* @__PURE__ */ x("p", { className: "builder-card__warning", children: [
|
|
4064
4064
|
"The backend schema does not advertise ",
|
|
4065
|
-
/* @__PURE__ */
|
|
4065
|
+
/* @__PURE__ */ g("code", { children: n.block.type }),
|
|
4066
4066
|
". Update or restart the API to edit this block."
|
|
4067
4067
|
] }) }) : null
|
|
4068
4068
|
] });
|
|
@@ -4078,10 +4078,10 @@ function Ba({
|
|
|
4078
4078
|
onRemoveBlock: s,
|
|
4079
4079
|
onSetRowWidths: l,
|
|
4080
4080
|
onToggleFooterRepeat: c,
|
|
4081
|
-
onChangePageNumbers:
|
|
4081
|
+
onChangePageNumbers: d
|
|
4082
4082
|
}) {
|
|
4083
|
-
return /* @__PURE__ */
|
|
4084
|
-
/* @__PURE__ */
|
|
4083
|
+
return /* @__PURE__ */ g("div", { className: "builder-canvas", children: /* @__PURE__ */ x(pa, { format: n, orientation: r, children: [
|
|
4084
|
+
/* @__PURE__ */ g(
|
|
4085
4085
|
$n,
|
|
4086
4086
|
{
|
|
4087
4087
|
area: "body",
|
|
@@ -4098,22 +4098,22 @@ function Ba({
|
|
|
4098
4098
|
/* @__PURE__ */ x("section", { className: "builder-footer-section", "aria-label": "Page footer", children: [
|
|
4099
4099
|
/* @__PURE__ */ x("header", { className: "builder-footer-section__header", children: [
|
|
4100
4100
|
/* @__PURE__ */ x("div", { children: [
|
|
4101
|
-
/* @__PURE__ */
|
|
4102
|
-
/* @__PURE__ */
|
|
4101
|
+
/* @__PURE__ */ g("h2", { className: "builder-footer-section__title", children: "Footer" }),
|
|
4102
|
+
/* @__PURE__ */ g("p", { className: "builder-footer-section__hint", children: "Repeated content rendered in the page footer area." })
|
|
4103
4103
|
] }),
|
|
4104
4104
|
/* @__PURE__ */ x("label", { className: "builder-footer-section__repeat", children: [
|
|
4105
|
-
/* @__PURE__ */
|
|
4105
|
+
/* @__PURE__ */ g(
|
|
4106
4106
|
"input",
|
|
4107
4107
|
{
|
|
4108
4108
|
type: "checkbox",
|
|
4109
4109
|
checked: o,
|
|
4110
|
-
onChange: (
|
|
4110
|
+
onChange: (u) => c(u.currentTarget.checked)
|
|
4111
4111
|
}
|
|
4112
4112
|
),
|
|
4113
4113
|
"Repeat on every page"
|
|
4114
4114
|
] })
|
|
4115
4115
|
] }),
|
|
4116
|
-
/* @__PURE__ */
|
|
4116
|
+
/* @__PURE__ */ g(
|
|
4117
4117
|
$n,
|
|
4118
4118
|
{
|
|
4119
4119
|
area: "footer",
|
|
@@ -4127,19 +4127,19 @@ function Ba({
|
|
|
4127
4127
|
onSetRowWidths: l
|
|
4128
4128
|
}
|
|
4129
4129
|
),
|
|
4130
|
-
/* @__PURE__ */
|
|
4130
|
+
/* @__PURE__ */ g("footer", { className: "builder-footer-section__page-numbers", children: /* @__PURE__ */ x("label", { children: [
|
|
4131
4131
|
"Page numbers",
|
|
4132
4132
|
/* @__PURE__ */ x(
|
|
4133
4133
|
"select",
|
|
4134
4134
|
{
|
|
4135
4135
|
className: "builder-select",
|
|
4136
4136
|
value: i,
|
|
4137
|
-
onChange: (
|
|
4137
|
+
onChange: (u) => d(u.currentTarget.value),
|
|
4138
4138
|
children: [
|
|
4139
|
-
/* @__PURE__ */
|
|
4140
|
-
/* @__PURE__ */
|
|
4141
|
-
/* @__PURE__ */
|
|
4142
|
-
/* @__PURE__ */
|
|
4139
|
+
/* @__PURE__ */ g("option", { value: "disabled", children: "Disabled" }),
|
|
4140
|
+
/* @__PURE__ */ g("option", { value: "left", children: "Left" }),
|
|
4141
|
+
/* @__PURE__ */ g("option", { value: "center", children: "Center" }),
|
|
4142
|
+
/* @__PURE__ */ g("option", { value: "right", children: "Right" })
|
|
4143
4143
|
]
|
|
4144
4144
|
}
|
|
4145
4145
|
)
|
|
@@ -4158,35 +4158,35 @@ function $n({
|
|
|
4158
4158
|
onRemoveBlock: s,
|
|
4159
4159
|
onSetRowWidths: l
|
|
4160
4160
|
}) {
|
|
4161
|
-
const { setNodeRef: c, isOver:
|
|
4161
|
+
const { setNodeRef: c, isOver: d } = hr({
|
|
4162
4162
|
id: r,
|
|
4163
4163
|
data: { type: "new-row", area: e }
|
|
4164
4164
|
});
|
|
4165
4165
|
return /* @__PURE__ */ x("div", { className: "builder-canvas__area", children: [
|
|
4166
|
-
/* @__PURE__ */
|
|
4166
|
+
/* @__PURE__ */ g(
|
|
4167
4167
|
wr,
|
|
4168
4168
|
{
|
|
4169
|
-
items: t.map((
|
|
4169
|
+
items: t.map((u) => u.uid),
|
|
4170
4170
|
strategy: $i,
|
|
4171
|
-
children: t.map((
|
|
4171
|
+
children: t.map((u) => /* @__PURE__ */ g(
|
|
4172
4172
|
ja,
|
|
4173
4173
|
{
|
|
4174
|
-
row:
|
|
4174
|
+
row: u,
|
|
4175
4175
|
area: e,
|
|
4176
4176
|
schema: n,
|
|
4177
4177
|
onChangeBlock: a,
|
|
4178
4178
|
onRemoveBlock: s,
|
|
4179
4179
|
onSetRowWidths: l
|
|
4180
4180
|
},
|
|
4181
|
-
|
|
4181
|
+
u.uid
|
|
4182
4182
|
))
|
|
4183
4183
|
}
|
|
4184
4184
|
),
|
|
4185
|
-
/* @__PURE__ */
|
|
4185
|
+
/* @__PURE__ */ g(
|
|
4186
4186
|
"div",
|
|
4187
4187
|
{
|
|
4188
4188
|
ref: c,
|
|
4189
|
-
className:
|
|
4189
|
+
className: d ? "builder-new-row is-over" : "builder-new-row",
|
|
4190
4190
|
children: t.length === 0 ? o : i
|
|
4191
4191
|
}
|
|
4192
4192
|
)
|
|
@@ -4204,10 +4204,10 @@ function ja({
|
|
|
4204
4204
|
attributes: s,
|
|
4205
4205
|
listeners: l,
|
|
4206
4206
|
setActivatorNodeRef: c,
|
|
4207
|
-
setNodeRef:
|
|
4208
|
-
transform:
|
|
4207
|
+
setNodeRef: d,
|
|
4208
|
+
transform: u,
|
|
4209
4209
|
transition: f,
|
|
4210
|
-
isDragging:
|
|
4210
|
+
isDragging: p
|
|
4211
4211
|
} = Rr({
|
|
4212
4212
|
id: e.uid,
|
|
4213
4213
|
data: {
|
|
@@ -4219,17 +4219,17 @@ function ja({
|
|
|
4219
4219
|
h ? R ?? [] : R,
|
|
4220
4220
|
e.blocks.length
|
|
4221
4221
|
), D = {
|
|
4222
|
-
transform: me.Transform.toString(
|
|
4222
|
+
transform: me.Transform.toString(u),
|
|
4223
4223
|
transition: f
|
|
4224
4224
|
};
|
|
4225
4225
|
return /* @__PURE__ */ x(
|
|
4226
4226
|
"section",
|
|
4227
4227
|
{
|
|
4228
|
-
ref:
|
|
4229
|
-
className:
|
|
4228
|
+
ref: d,
|
|
4229
|
+
className: p ? "builder-row is-dragging" : "builder-row",
|
|
4230
4230
|
style: D,
|
|
4231
4231
|
children: [
|
|
4232
|
-
/* @__PURE__ */
|
|
4232
|
+
/* @__PURE__ */ g("div", { className: "builder-row__header", children: /* @__PURE__ */ g(
|
|
4233
4233
|
"button",
|
|
4234
4234
|
{
|
|
4235
4235
|
ref: c,
|
|
@@ -4241,14 +4241,14 @@ function ja({
|
|
|
4241
4241
|
children: "⋮⋮ row"
|
|
4242
4242
|
}
|
|
4243
4243
|
) }),
|
|
4244
|
-
/* @__PURE__ */
|
|
4244
|
+
/* @__PURE__ */ g(
|
|
4245
4245
|
"div",
|
|
4246
4246
|
{
|
|
4247
4247
|
ref: a,
|
|
4248
4248
|
className: "builder-row__grid",
|
|
4249
4249
|
style: b ? { gridTemplateColumns: b } : void 0,
|
|
4250
|
-
children: /* @__PURE__ */
|
|
4251
|
-
/* @__PURE__ */
|
|
4250
|
+
children: /* @__PURE__ */ g(wr, { items: e.blocks.map((m) => m.uid), children: e.blocks.map((m, y) => /* @__PURE__ */ x(to, { children: [
|
|
4251
|
+
/* @__PURE__ */ g(
|
|
4252
4252
|
$a,
|
|
4253
4253
|
{
|
|
4254
4254
|
rowUid: e.uid,
|
|
@@ -4259,14 +4259,14 @@ function ja({
|
|
|
4259
4259
|
onRemoveBlock: o
|
|
4260
4260
|
}
|
|
4261
4261
|
),
|
|
4262
|
-
h && y < e.blocks.length - 1 ? /* @__PURE__ */
|
|
4262
|
+
h && y < e.blocks.length - 1 ? /* @__PURE__ */ g(
|
|
4263
4263
|
la,
|
|
4264
4264
|
{
|
|
4265
4265
|
widths: R,
|
|
4266
4266
|
count: e.blocks.length,
|
|
4267
4267
|
leftIndex: y,
|
|
4268
4268
|
containerRef: a,
|
|
4269
|
-
onResize: (
|
|
4269
|
+
onResize: (k) => i(e.uid, k)
|
|
4270
4270
|
},
|
|
4271
4271
|
`${m.uid}:resizer`
|
|
4272
4272
|
) : null
|
|
@@ -4281,42 +4281,61 @@ function Fa(e) {
|
|
|
4281
4281
|
const t = e.blocks.map((n) => n.block.config?.width);
|
|
4282
4282
|
return t.every((n) => typeof n == "string") ? t : null;
|
|
4283
4283
|
}
|
|
4284
|
-
function za({ pdfUrl: e, error: t, loading: n,
|
|
4285
|
-
const i = n ? "rendering" : e ? "ready" : "empty";
|
|
4286
|
-
return /* @__PURE__ */ x("aside", { className: "pdf-pane", "aria-label": "
|
|
4284
|
+
function za({ pdfUrl: e, error: t, loading: n, template: r, data: o }) {
|
|
4285
|
+
const [i, a] = $("pdf"), s = n ? "rendering" : e ? "ready" : "empty";
|
|
4286
|
+
return /* @__PURE__ */ x("aside", { className: "pdf-pane", "aria-label": "Output", children: [
|
|
4287
4287
|
/* @__PURE__ */ x("header", { className: "pdf-pane__header", children: [
|
|
4288
|
-
/* @__PURE__ */
|
|
4289
|
-
|
|
4288
|
+
/* @__PURE__ */ x("div", { className: "pdf-pane__tabs", role: "tablist", "aria-label": "Output view", children: [
|
|
4289
|
+
/* @__PURE__ */ g(
|
|
4290
|
+
"button",
|
|
4291
|
+
{
|
|
4292
|
+
type: "button",
|
|
4293
|
+
role: "tab",
|
|
4294
|
+
className: "pdf-pane__tab",
|
|
4295
|
+
"aria-selected": i === "pdf",
|
|
4296
|
+
"data-active": i === "pdf",
|
|
4297
|
+
onClick: () => a("pdf"),
|
|
4298
|
+
children: "PDF"
|
|
4299
|
+
}
|
|
4300
|
+
),
|
|
4301
|
+
/* @__PURE__ */ g(
|
|
4302
|
+
"button",
|
|
4303
|
+
{
|
|
4304
|
+
type: "button",
|
|
4305
|
+
role: "tab",
|
|
4306
|
+
className: "pdf-pane__tab",
|
|
4307
|
+
"aria-selected": i === "data",
|
|
4308
|
+
"data-active": i === "data",
|
|
4309
|
+
onClick: () => a("data"),
|
|
4310
|
+
children: "Data"
|
|
4311
|
+
}
|
|
4312
|
+
),
|
|
4313
|
+
i === "data" ? /* @__PURE__ */ g(Ha, { template: r, data: o }) : null
|
|
4314
|
+
] }),
|
|
4315
|
+
/* @__PURE__ */ g("span", { className: "pdf-pane__status-pill", "data-status": s, children: s === "rendering" ? "Rendering…" : s === "ready" ? "Ready" : "Idle" })
|
|
4290
4316
|
] }),
|
|
4291
|
-
t ? /* @__PURE__ */
|
|
4292
|
-
/* @__PURE__ */
|
|
4293
|
-
/* @__PURE__ */ x("footer", { className: "pdf-pane__footer", children: [
|
|
4294
|
-
e ? /* @__PURE__ */ p(
|
|
4295
|
-
"a",
|
|
4296
|
-
{
|
|
4297
|
-
href: e,
|
|
4298
|
-
target: "_blank",
|
|
4299
|
-
rel: "noreferrer",
|
|
4300
|
-
download: "template-preview.pdf",
|
|
4301
|
-
className: "builder-button builder-button--ghost",
|
|
4302
|
-
children: "⤓ Download"
|
|
4303
|
-
}
|
|
4304
|
-
) : /* @__PURE__ */ p("span", {}),
|
|
4305
|
-
r ? /* @__PURE__ */ p(
|
|
4306
|
-
"button",
|
|
4307
|
-
{
|
|
4308
|
-
type: "button",
|
|
4309
|
-
className: "builder-button",
|
|
4310
|
-
onClick: r,
|
|
4311
|
-
disabled: o,
|
|
4312
|
-
children: n ? "Rendering…" : e ? "Re-render" : "Render PDF"
|
|
4313
|
-
}
|
|
4314
|
-
) : null
|
|
4315
|
-
] })
|
|
4317
|
+
t ? /* @__PURE__ */ g("p", { className: "pdf-pane__error", children: t }) : null,
|
|
4318
|
+
/* @__PURE__ */ g("div", { className: "pdf-pane__body", children: i === "pdf" ? /* @__PURE__ */ g(Ua, { pdfUrl: e, loading: n }) : /* @__PURE__ */ g(Wa, { template: r, data: o }) })
|
|
4316
4319
|
] });
|
|
4317
4320
|
}
|
|
4318
|
-
|
|
4319
|
-
|
|
4321
|
+
function Ua({ pdfUrl: e, loading: t }) {
|
|
4322
|
+
return e ? /* @__PURE__ */ g("object", { data: e, type: "application/pdf", className: "pdf-pane__object" }) : /* @__PURE__ */ g("div", { className: "pdf-pane__empty", children: t ? "Rendering the latest template…" : "Render the template to preview the PDF here." });
|
|
4323
|
+
}
|
|
4324
|
+
function Wa({ template: e, data: t }) {
|
|
4325
|
+
return /* @__PURE__ */ g("pre", { className: "pdf-pane__json", children: /* @__PURE__ */ g("code", { children: JSON.stringify({ template: e ?? null, data: t ?? {} }, null, 2) }) });
|
|
4326
|
+
}
|
|
4327
|
+
function Ha({ template: e, data: t }) {
|
|
4328
|
+
const [n, r] = $(!1);
|
|
4329
|
+
function o() {
|
|
4330
|
+
const i = JSON.stringify({ template: e ?? null, data: t ?? {} }, null, 2);
|
|
4331
|
+
navigator.clipboard.writeText(i).then(() => {
|
|
4332
|
+
r(!0), setTimeout(() => r(!1), 1500);
|
|
4333
|
+
});
|
|
4334
|
+
}
|
|
4335
|
+
return /* @__PURE__ */ g("button", { type: "button", className: "pdf-pane__copy", onClick: o, children: n ? "✓ Copied" : "⧉ Copy JSON" });
|
|
4336
|
+
}
|
|
4337
|
+
const Xa = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNjAiIGhlaWdodD0iNzIiIHZpZXdCb3g9IjAgMCAyNjAgNzIiPjx0ZXh0IHg9IjAiIHk9IjQyIiBmaWxsPSIjMTExODI3IiBmb250LWZhbWlseT0iQXJpYWwsIHNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMzAiIGZvbnQtd2VpZ2h0PSI3MDAiPlBERiBVQSBLaXQ8L3RleHQ+PC9zdmc+";
|
|
4338
|
+
function Va() {
|
|
4320
4339
|
return { template: {
|
|
4321
4340
|
version: 1,
|
|
4322
4341
|
config: {
|
|
@@ -4365,7 +4384,7 @@ function Wa() {
|
|
|
4365
4384
|
{
|
|
4366
4385
|
type: "image",
|
|
4367
4386
|
id: "logo",
|
|
4368
|
-
src:
|
|
4387
|
+
src: Xa,
|
|
4369
4388
|
alt: "PDF UA Kit GmbH logo",
|
|
4370
4389
|
config: { width: "58%", maxHeight: 28 }
|
|
4371
4390
|
},
|
|
@@ -4582,13 +4601,13 @@ let Bn = 1;
|
|
|
4582
4601
|
function jn(e) {
|
|
4583
4602
|
const { rows: t = [], ...n } = e, r = n.config?.page?.footer?.rows ?? [];
|
|
4584
4603
|
return {
|
|
4585
|
-
template:
|
|
4604
|
+
template: os(dn(n)),
|
|
4586
4605
|
rows: t.map((i) => Un(i)),
|
|
4587
4606
|
footerRows: r.map((i) => Un(i))
|
|
4588
4607
|
};
|
|
4589
4608
|
}
|
|
4590
|
-
function
|
|
4591
|
-
const t =
|
|
4609
|
+
function vt(e) {
|
|
4610
|
+
const t = dn(e.template), n = is(t, e.footerRows);
|
|
4592
4611
|
return e.rows.length === 0 ? n : {
|
|
4593
4612
|
...n,
|
|
4594
4613
|
rows: e.rows.map((r) => ({
|
|
@@ -4599,20 +4618,20 @@ function Gt(e) {
|
|
|
4599
4618
|
function Fn(e, t, n = "body") {
|
|
4600
4619
|
return Ue(e, n, (r) => [
|
|
4601
4620
|
...r,
|
|
4602
|
-
{ uid:
|
|
4621
|
+
{ uid: Mt("row"), blocks: [cn(t)] }
|
|
4603
4622
|
]);
|
|
4604
4623
|
}
|
|
4605
|
-
function
|
|
4606
|
-
const o =
|
|
4624
|
+
function Ka(e, t, n, r) {
|
|
4625
|
+
const o = Pt(e, t);
|
|
4607
4626
|
return o ? Ue(
|
|
4608
4627
|
e,
|
|
4609
4628
|
o,
|
|
4610
4629
|
(i) => i.map(
|
|
4611
|
-
(a) => a.uid === t ? { ...a, blocks:
|
|
4630
|
+
(a) => a.uid === t ? { ...a, blocks: un(a.blocks, cn(n), r) } : a
|
|
4612
4631
|
)
|
|
4613
4632
|
) : e;
|
|
4614
4633
|
}
|
|
4615
|
-
function
|
|
4634
|
+
function Ya(e, t) {
|
|
4616
4635
|
return et(
|
|
4617
4636
|
e,
|
|
4618
4637
|
(n) => n.map((r) => ({
|
|
@@ -4621,52 +4640,52 @@ function Xa(e, t) {
|
|
|
4621
4640
|
})).filter((r) => r.blocks.length > 0)
|
|
4622
4641
|
);
|
|
4623
4642
|
}
|
|
4624
|
-
function
|
|
4625
|
-
const i =
|
|
4643
|
+
function qa(e, t, n, r, o = "body") {
|
|
4644
|
+
const i = as(e, t);
|
|
4626
4645
|
if (!i)
|
|
4627
4646
|
return e;
|
|
4628
4647
|
if (n === null) {
|
|
4629
4648
|
const c = et(
|
|
4630
4649
|
e,
|
|
4631
|
-
(
|
|
4632
|
-
...
|
|
4633
|
-
blocks:
|
|
4634
|
-
})).filter((
|
|
4650
|
+
(d) => d.map((u) => ({
|
|
4651
|
+
...u,
|
|
4652
|
+
blocks: u.blocks.filter((f) => f.uid !== t)
|
|
4653
|
+
})).filter((u) => u.blocks.length > 0)
|
|
4635
4654
|
);
|
|
4636
|
-
return Ue(c, o, (
|
|
4637
|
-
...
|
|
4638
|
-
{ uid:
|
|
4655
|
+
return Ue(c, o, (d) => [
|
|
4656
|
+
...d,
|
|
4657
|
+
{ uid: Mt("row"), blocks: [i] }
|
|
4639
4658
|
]);
|
|
4640
4659
|
}
|
|
4641
|
-
const a =
|
|
4660
|
+
const a = Pt(e, n);
|
|
4642
4661
|
if (!a)
|
|
4643
4662
|
return e;
|
|
4644
4663
|
const s = et(
|
|
4645
4664
|
e,
|
|
4646
|
-
(c) => c.map((
|
|
4647
|
-
...
|
|
4648
|
-
blocks:
|
|
4665
|
+
(c) => c.map((d) => ({
|
|
4666
|
+
...d,
|
|
4667
|
+
blocks: d.blocks.filter((u) => u.uid !== t)
|
|
4649
4668
|
}))
|
|
4650
4669
|
), l = Ue(
|
|
4651
4670
|
s,
|
|
4652
4671
|
a,
|
|
4653
4672
|
(c) => c.map(
|
|
4654
|
-
(
|
|
4673
|
+
(d) => d.uid === n ? { ...d, blocks: un(d.blocks, i, r) } : d
|
|
4655
4674
|
)
|
|
4656
4675
|
);
|
|
4657
|
-
return et(l, (c) => c.filter((
|
|
4676
|
+
return et(l, (c) => c.filter((d) => d.blocks.length > 0));
|
|
4658
4677
|
}
|
|
4659
|
-
function
|
|
4660
|
-
const r =
|
|
4678
|
+
function Ga(e, t, n) {
|
|
4679
|
+
const r = Pt(e, t);
|
|
4661
4680
|
return r ? Ue(e, r, (o) => {
|
|
4662
4681
|
const i = o.find((s) => s.uid === t);
|
|
4663
4682
|
if (!i)
|
|
4664
4683
|
return o;
|
|
4665
4684
|
const a = o.filter((s) => s.uid !== t);
|
|
4666
|
-
return
|
|
4685
|
+
return un(a, i, n);
|
|
4667
4686
|
}) : e;
|
|
4668
4687
|
}
|
|
4669
|
-
function
|
|
4688
|
+
function Ja(e, t, n) {
|
|
4670
4689
|
return et(
|
|
4671
4690
|
e,
|
|
4672
4691
|
(r) => r.map((o) => ({
|
|
@@ -4677,9 +4696,9 @@ function Ya(e, t, n) {
|
|
|
4677
4696
|
}))
|
|
4678
4697
|
);
|
|
4679
4698
|
}
|
|
4680
|
-
function
|
|
4699
|
+
function Ut(e) {
|
|
4681
4700
|
const t = e.template.config?.page?.size;
|
|
4682
|
-
return
|
|
4701
|
+
return Za(t) ? { format: "A4", orientation: "portrait", custom: t } : {
|
|
4683
4702
|
format: t?.format ?? "A4",
|
|
4684
4703
|
orientation: t?.orientation ?? "portrait",
|
|
4685
4704
|
custom: null
|
|
@@ -4692,11 +4711,11 @@ function zn(e, t, n) {
|
|
|
4692
4711
|
template: { ...e.template, config: s }
|
|
4693
4712
|
};
|
|
4694
4713
|
}
|
|
4695
|
-
function
|
|
4714
|
+
function Za(e) {
|
|
4696
4715
|
return typeof e == "object" && e !== null && "width" in e && "height" in e && typeof e.width == "number" && typeof e.height == "number";
|
|
4697
4716
|
}
|
|
4698
|
-
function
|
|
4699
|
-
const r =
|
|
4717
|
+
function Qa(e, t, n) {
|
|
4718
|
+
const r = Pt(e, t);
|
|
4700
4719
|
return r ? Ue(
|
|
4701
4720
|
e,
|
|
4702
4721
|
r,
|
|
@@ -4705,26 +4724,26 @@ function Ga(e, t, n) {
|
|
|
4705
4724
|
...i,
|
|
4706
4725
|
blocks: i.blocks.map((a, s) => ({
|
|
4707
4726
|
...a,
|
|
4708
|
-
block:
|
|
4727
|
+
block: ss(a.block, n[s])
|
|
4709
4728
|
}))
|
|
4710
4729
|
} : i
|
|
4711
4730
|
)
|
|
4712
4731
|
) : e;
|
|
4713
4732
|
}
|
|
4714
|
-
function
|
|
4733
|
+
function es(e) {
|
|
4715
4734
|
return e.template.config?.page?.footer?.repeat !== !1;
|
|
4716
4735
|
}
|
|
4717
|
-
function
|
|
4736
|
+
function ts(e, t) {
|
|
4718
4737
|
return zr(e, (n) => {
|
|
4719
4738
|
const r = { ...n.footer, repeat: t };
|
|
4720
4739
|
return { ...n, footer: r };
|
|
4721
4740
|
});
|
|
4722
4741
|
}
|
|
4723
|
-
function
|
|
4742
|
+
function ns(e) {
|
|
4724
4743
|
const t = e.template.config?.page?.pageNumbers;
|
|
4725
4744
|
return t?.enabled !== !0 ? "disabled" : t.position ?? "center";
|
|
4726
4745
|
}
|
|
4727
|
-
function
|
|
4746
|
+
function rs(e, t) {
|
|
4728
4747
|
return zr(e, (n) => {
|
|
4729
4748
|
if (t === "disabled") {
|
|
4730
4749
|
const o = { ...n.pageNumbers, enabled: !1 };
|
|
@@ -4737,7 +4756,7 @@ function zr(e, t) {
|
|
|
4737
4756
|
const n = e.template.config ?? {}, r = n.page ?? {}, o = t(r), i = { ...n, page: o };
|
|
4738
4757
|
return { ...e, template: { ...e.template, config: i } };
|
|
4739
4758
|
}
|
|
4740
|
-
function
|
|
4759
|
+
function Pt(e, t) {
|
|
4741
4760
|
return e.rows.some((n) => n.uid === t) ? "body" : e.footerRows.some((n) => n.uid === t) ? "footer" : null;
|
|
4742
4761
|
}
|
|
4743
4762
|
function Ue(e, t, n) {
|
|
@@ -4750,7 +4769,7 @@ function et(e, t) {
|
|
|
4750
4769
|
footerRows: t(e.footerRows)
|
|
4751
4770
|
};
|
|
4752
4771
|
}
|
|
4753
|
-
function
|
|
4772
|
+
function os(e) {
|
|
4754
4773
|
const t = e.config?.page?.footer;
|
|
4755
4774
|
if (!t)
|
|
4756
4775
|
return e;
|
|
@@ -4760,7 +4779,7 @@ function ts(e) {
|
|
|
4760
4779
|
config: { ...e.config, page: i }
|
|
4761
4780
|
};
|
|
4762
4781
|
}
|
|
4763
|
-
function
|
|
4782
|
+
function is(e, t) {
|
|
4764
4783
|
const n = e.config?.page ?? {}, r = n.footer ?? {};
|
|
4765
4784
|
if (!(t.length > 0 || r.repeat !== void 0))
|
|
4766
4785
|
return e;
|
|
@@ -4774,20 +4793,20 @@ function ns(e, t) {
|
|
|
4774
4793
|
}
|
|
4775
4794
|
function Un(e) {
|
|
4776
4795
|
return {
|
|
4777
|
-
uid:
|
|
4778
|
-
blocks: e.blocks.map((t) =>
|
|
4796
|
+
uid: Mt("row"),
|
|
4797
|
+
blocks: e.blocks.map((t) => cn(t))
|
|
4779
4798
|
};
|
|
4780
4799
|
}
|
|
4781
|
-
function
|
|
4800
|
+
function cn(e) {
|
|
4782
4801
|
return {
|
|
4783
|
-
uid:
|
|
4802
|
+
uid: Mt("block"),
|
|
4784
4803
|
block: ut(e)
|
|
4785
4804
|
};
|
|
4786
4805
|
}
|
|
4787
|
-
function
|
|
4806
|
+
function as(e, t) {
|
|
4788
4807
|
return [...e.rows, ...e.footerRows].flatMap((r) => r.blocks).find((r) => r.uid === t);
|
|
4789
4808
|
}
|
|
4790
|
-
function
|
|
4809
|
+
function ss(e, t) {
|
|
4791
4810
|
return {
|
|
4792
4811
|
...ut(e),
|
|
4793
4812
|
config: {
|
|
@@ -4796,22 +4815,22 @@ function os(e, t) {
|
|
|
4796
4815
|
}
|
|
4797
4816
|
};
|
|
4798
4817
|
}
|
|
4799
|
-
function
|
|
4818
|
+
function un(e, t, n) {
|
|
4800
4819
|
const r = [...e], o = Math.max(0, Math.min(n, r.length));
|
|
4801
4820
|
return r.splice(o, 0, t), r;
|
|
4802
4821
|
}
|
|
4803
4822
|
function ut(e) {
|
|
4804
|
-
return
|
|
4823
|
+
return dn(e);
|
|
4805
4824
|
}
|
|
4806
|
-
function
|
|
4825
|
+
function dn(e) {
|
|
4807
4826
|
return structuredClone(e);
|
|
4808
4827
|
}
|
|
4809
|
-
function
|
|
4828
|
+
function Mt(e) {
|
|
4810
4829
|
const t = `${e}-${Bn}`;
|
|
4811
4830
|
return Bn += 1, t;
|
|
4812
4831
|
}
|
|
4813
|
-
const
|
|
4814
|
-
function
|
|
4832
|
+
const ls = Object.keys(Yt);
|
|
4833
|
+
function cs({
|
|
4815
4834
|
format: e,
|
|
4816
4835
|
orientation: t,
|
|
4817
4836
|
onChangeFormat: n,
|
|
@@ -4822,26 +4841,26 @@ function as({
|
|
|
4822
4841
|
schemaLoading: s,
|
|
4823
4842
|
onLoadExample: l,
|
|
4824
4843
|
exampleDisabled: c,
|
|
4825
|
-
onRender:
|
|
4826
|
-
renderDisabled:
|
|
4844
|
+
onRender: d,
|
|
4845
|
+
renderDisabled: u,
|
|
4827
4846
|
rendering: f
|
|
4828
4847
|
}) {
|
|
4829
4848
|
return /* @__PURE__ */ x("header", { className: "builder-topbar", "aria-label": "Template builder toolbar", children: [
|
|
4830
4849
|
/* @__PURE__ */ x("div", { className: "builder-topbar__brand", children: [
|
|
4831
|
-
/* @__PURE__ */
|
|
4832
|
-
/* @__PURE__ */
|
|
4833
|
-
/* @__PURE__ */
|
|
4850
|
+
/* @__PURE__ */ g("span", { className: "builder-topbar__brand-mark", "aria-hidden": "true", children: "◳" }),
|
|
4851
|
+
/* @__PURE__ */ g("span", { children: "Template Builder" }),
|
|
4852
|
+
/* @__PURE__ */ g("span", { className: "builder-topbar__brand-sub", children: "· pdf-ua" })
|
|
4834
4853
|
] }),
|
|
4835
|
-
/* @__PURE__ */
|
|
4854
|
+
/* @__PURE__ */ g("div", { className: "builder-topbar__spacer" }),
|
|
4836
4855
|
/* @__PURE__ */ x("div", { className: "builder-topbar__group", children: [
|
|
4837
|
-
/* @__PURE__ */
|
|
4856
|
+
/* @__PURE__ */ g(
|
|
4838
4857
|
"select",
|
|
4839
4858
|
{
|
|
4840
4859
|
className: "builder-select",
|
|
4841
4860
|
value: e,
|
|
4842
|
-
onChange: (
|
|
4861
|
+
onChange: (p) => n(p.currentTarget.value),
|
|
4843
4862
|
"aria-label": "Page format",
|
|
4844
|
-
children:
|
|
4863
|
+
children: ls.map((p) => /* @__PURE__ */ g("option", { value: p, children: p }, p))
|
|
4845
4864
|
}
|
|
4846
4865
|
),
|
|
4847
4866
|
/* @__PURE__ */ x(
|
|
@@ -4849,17 +4868,17 @@ function as({
|
|
|
4849
4868
|
{
|
|
4850
4869
|
className: "builder-select",
|
|
4851
4870
|
value: t,
|
|
4852
|
-
onChange: (
|
|
4871
|
+
onChange: (p) => r(p.currentTarget.value),
|
|
4853
4872
|
"aria-label": "Orientation",
|
|
4854
4873
|
children: [
|
|
4855
|
-
/* @__PURE__ */
|
|
4856
|
-
/* @__PURE__ */
|
|
4874
|
+
/* @__PURE__ */ g("option", { value: "portrait", children: "Portrait" }),
|
|
4875
|
+
/* @__PURE__ */ g("option", { value: "landscape", children: "Landscape" })
|
|
4857
4876
|
]
|
|
4858
4877
|
}
|
|
4859
4878
|
)
|
|
4860
4879
|
] }),
|
|
4861
4880
|
/* @__PURE__ */ x("div", { className: "builder-topbar__group", children: [
|
|
4862
|
-
/* @__PURE__ */
|
|
4881
|
+
/* @__PURE__ */ g(
|
|
4863
4882
|
"button",
|
|
4864
4883
|
{
|
|
4865
4884
|
type: "button",
|
|
@@ -4869,18 +4888,18 @@ function as({
|
|
|
4869
4888
|
children: "Load example"
|
|
4870
4889
|
}
|
|
4871
4890
|
),
|
|
4872
|
-
/* @__PURE__ */
|
|
4891
|
+
/* @__PURE__ */ g(
|
|
4873
4892
|
"button",
|
|
4874
4893
|
{
|
|
4875
4894
|
type: "button",
|
|
4876
4895
|
className: "builder-button builder-button--primary",
|
|
4877
|
-
onClick:
|
|
4878
|
-
disabled:
|
|
4896
|
+
onClick: d,
|
|
4897
|
+
disabled: u,
|
|
4879
4898
|
children: f ? "Rendering…" : "Render PDF"
|
|
4880
4899
|
}
|
|
4881
4900
|
),
|
|
4882
|
-
/* @__PURE__ */
|
|
4883
|
-
|
|
4901
|
+
/* @__PURE__ */ g(
|
|
4902
|
+
us,
|
|
4884
4903
|
{
|
|
4885
4904
|
apiUrl: o,
|
|
4886
4905
|
onApiUrlChange: i,
|
|
@@ -4891,14 +4910,14 @@ function as({
|
|
|
4891
4910
|
] })
|
|
4892
4911
|
] });
|
|
4893
4912
|
}
|
|
4894
|
-
function
|
|
4913
|
+
function us({
|
|
4895
4914
|
apiUrl: e,
|
|
4896
4915
|
onApiUrlChange: t,
|
|
4897
4916
|
onLoadSchema: n,
|
|
4898
4917
|
schemaLoading: r
|
|
4899
4918
|
}) {
|
|
4900
|
-
const [o, i] =
|
|
4901
|
-
return
|
|
4919
|
+
const [o, i] = $(!1), a = I(null);
|
|
4920
|
+
return O(() => {
|
|
4902
4921
|
if (!o)
|
|
4903
4922
|
return;
|
|
4904
4923
|
function s(c) {
|
|
@@ -4911,7 +4930,7 @@ function ss({
|
|
|
4911
4930
|
window.removeEventListener("mousedown", s), window.removeEventListener("keydown", l);
|
|
4912
4931
|
};
|
|
4913
4932
|
}, [o]), /* @__PURE__ */ x("div", { className: "builder-topbar__settings", ref: a, children: [
|
|
4914
|
-
/* @__PURE__ */
|
|
4933
|
+
/* @__PURE__ */ g(
|
|
4915
4934
|
"button",
|
|
4916
4935
|
{
|
|
4917
4936
|
type: "button",
|
|
@@ -4925,7 +4944,7 @@ function ss({
|
|
|
4925
4944
|
o ? /* @__PURE__ */ x("div", { className: "builder-topbar__settings-panel", role: "dialog", "aria-label": "Settings", children: [
|
|
4926
4945
|
/* @__PURE__ */ x("label", { children: [
|
|
4927
4946
|
"API URL",
|
|
4928
|
-
/* @__PURE__ */
|
|
4947
|
+
/* @__PURE__ */ g(
|
|
4929
4948
|
"input",
|
|
4930
4949
|
{
|
|
4931
4950
|
className: "builder-input",
|
|
@@ -4934,7 +4953,7 @@ function ss({
|
|
|
4934
4953
|
}
|
|
4935
4954
|
)
|
|
4936
4955
|
] }),
|
|
4937
|
-
/* @__PURE__ */
|
|
4956
|
+
/* @__PURE__ */ g(
|
|
4938
4957
|
"button",
|
|
4939
4958
|
{
|
|
4940
4959
|
type: "button",
|
|
@@ -4947,10 +4966,10 @@ function ss({
|
|
|
4947
4966
|
] }) : null
|
|
4948
4967
|
] });
|
|
4949
4968
|
}
|
|
4950
|
-
const
|
|
4969
|
+
const ds = {
|
|
4951
4970
|
version: 1
|
|
4952
4971
|
};
|
|
4953
|
-
function
|
|
4972
|
+
function xs({
|
|
4954
4973
|
apiUrl: e,
|
|
4955
4974
|
initialTemplate: t,
|
|
4956
4975
|
initialData: n,
|
|
@@ -4958,163 +4977,163 @@ function ms({
|
|
|
4958
4977
|
onRendered: o,
|
|
4959
4978
|
className: i
|
|
4960
4979
|
} = {}) {
|
|
4961
|
-
const a = qi(e), [s, l] =
|
|
4962
|
-
() => jn(t ??
|
|
4963
|
-
), [
|
|
4964
|
-
|
|
4980
|
+
const a = qi(e), [s, l] = $(a), [c, d] = $(null), [u, f] = $(
|
|
4981
|
+
() => jn(t ?? ds)
|
|
4982
|
+
), [p, R] = $(n ?? {}), [h, b] = $(null), [D, m] = $(!1), [y, k] = $(!1), [E, N] = $(null), [S, C] = $(null), j = I(a), P = I(!1), w = I(0), X = I(0), q = I(null), ee = I(r), ye = I(o), Ee = I(!0);
|
|
4983
|
+
O(() => {
|
|
4965
4984
|
ee.current = r, ye.current = o;
|
|
4966
|
-
}, [r, o]),
|
|
4967
|
-
if (
|
|
4968
|
-
|
|
4985
|
+
}, [r, o]), O(() => {
|
|
4986
|
+
if (Ee.current) {
|
|
4987
|
+
Ee.current = !1;
|
|
4969
4988
|
return;
|
|
4970
4989
|
}
|
|
4971
|
-
ee.current?.(
|
|
4972
|
-
}, [
|
|
4973
|
-
const F = c, Me =
|
|
4990
|
+
ee.current?.(vt(u), p);
|
|
4991
|
+
}, [u, p]);
|
|
4992
|
+
const F = c, Me = B(
|
|
4974
4993
|
() => F ? Ia(F) : [],
|
|
4975
4994
|
[F]
|
|
4976
|
-
),
|
|
4977
|
-
vn(
|
|
4995
|
+
), J = Ut(u), Ie = es(u), Le = ns(u), K = B(() => vt(u), [u]), le = mo(
|
|
4996
|
+
vn(rn, {
|
|
4978
4997
|
activationConstraint: { distance: 4 }
|
|
4979
4998
|
}),
|
|
4980
|
-
vn(
|
|
4999
|
+
vn(tn, {
|
|
4981
5000
|
coordinateGetter: Ki
|
|
4982
5001
|
})
|
|
4983
5002
|
);
|
|
4984
|
-
|
|
4985
|
-
|
|
5003
|
+
O(() => (P.current = !0, () => {
|
|
5004
|
+
P.current = !1, Wt(q.current), q.current = null;
|
|
4986
5005
|
}), []);
|
|
4987
|
-
const
|
|
5006
|
+
const ce = L(async (A) => {
|
|
4988
5007
|
const v = w.current + 1;
|
|
4989
5008
|
w.current = v, m(!0), N(null);
|
|
4990
5009
|
try {
|
|
4991
|
-
const
|
|
4992
|
-
|
|
4993
|
-
} catch (
|
|
4994
|
-
|
|
5010
|
+
const _ = await Gi(A);
|
|
5011
|
+
P.current && v === w.current && d(_);
|
|
5012
|
+
} catch (_) {
|
|
5013
|
+
P.current && v === w.current && N(Wn(_));
|
|
4995
5014
|
} finally {
|
|
4996
|
-
|
|
5015
|
+
P.current && v === w.current && m(!1);
|
|
4997
5016
|
}
|
|
4998
5017
|
}, []);
|
|
4999
|
-
|
|
5000
|
-
|
|
5001
|
-
}, [
|
|
5002
|
-
const
|
|
5003
|
-
const A =
|
|
5018
|
+
O(() => {
|
|
5019
|
+
ce(j.current);
|
|
5020
|
+
}, [ce]);
|
|
5021
|
+
const Te = L(() => {
|
|
5022
|
+
const A = Va();
|
|
5004
5023
|
f(jn(A.template)), R(A.data);
|
|
5005
|
-
}, []),
|
|
5024
|
+
}, []), Z = L(async () => {
|
|
5006
5025
|
const A = X.current + 1;
|
|
5007
|
-
X.current = A,
|
|
5026
|
+
X.current = A, k(!0), N(null);
|
|
5008
5027
|
try {
|
|
5009
5028
|
const v = await Ji(s, {
|
|
5010
|
-
template:
|
|
5011
|
-
data:
|
|
5029
|
+
template: vt(u),
|
|
5030
|
+
data: p,
|
|
5012
5031
|
options: {
|
|
5013
5032
|
title: "Template Preview"
|
|
5014
5033
|
}
|
|
5015
|
-
}),
|
|
5016
|
-
if (!
|
|
5017
|
-
|
|
5034
|
+
}), _ = URL.createObjectURL(v);
|
|
5035
|
+
if (!P.current || A !== X.current) {
|
|
5036
|
+
Wt(_);
|
|
5018
5037
|
return;
|
|
5019
5038
|
}
|
|
5020
|
-
b((U) => (
|
|
5039
|
+
b((U) => (Wt(U), q.current = _, _)), ye.current?.(v);
|
|
5021
5040
|
} catch (v) {
|
|
5022
|
-
|
|
5041
|
+
P.current && A === X.current && N(Wn(v));
|
|
5023
5042
|
} finally {
|
|
5024
|
-
|
|
5043
|
+
P.current && A === X.current && k(!1);
|
|
5025
5044
|
}
|
|
5026
|
-
}, [s,
|
|
5027
|
-
f((
|
|
5028
|
-
}, []),
|
|
5029
|
-
f((v) =>
|
|
5030
|
-
}, []),
|
|
5031
|
-
f((
|
|
5032
|
-
}, []),
|
|
5045
|
+
}, [s, p, u]), _e = L((A, v) => {
|
|
5046
|
+
f((_) => Ja(_, A, v));
|
|
5047
|
+
}, []), ge = L((A) => {
|
|
5048
|
+
f((v) => Ya(v, A));
|
|
5049
|
+
}, []), ue = L((A, v) => {
|
|
5050
|
+
f((_) => Qa(_, A, v));
|
|
5051
|
+
}, []), M = L(
|
|
5033
5052
|
(A) => {
|
|
5034
5053
|
F && f((v) => {
|
|
5035
|
-
const
|
|
5054
|
+
const _ = _n(
|
|
5036
5055
|
F,
|
|
5037
5056
|
A,
|
|
5038
5057
|
Xn(v, A)
|
|
5039
5058
|
);
|
|
5040
|
-
return Fn(v,
|
|
5059
|
+
return Fn(v, _);
|
|
5041
5060
|
});
|
|
5042
5061
|
},
|
|
5043
5062
|
[F]
|
|
5044
|
-
),
|
|
5063
|
+
), Oe = L((A) => {
|
|
5045
5064
|
f((v) => {
|
|
5046
|
-
const
|
|
5047
|
-
return zn(v, A,
|
|
5065
|
+
const _ = Ut(v);
|
|
5066
|
+
return zn(v, A, _.orientation);
|
|
5048
5067
|
});
|
|
5049
|
-
}, []),
|
|
5068
|
+
}, []), oe = L((A) => {
|
|
5050
5069
|
f((v) => {
|
|
5051
|
-
const
|
|
5052
|
-
return zn(v,
|
|
5070
|
+
const _ = Ut(v);
|
|
5071
|
+
return zn(v, _.format, A);
|
|
5053
5072
|
});
|
|
5054
|
-
}, []),
|
|
5055
|
-
f((v) =>
|
|
5056
|
-
}, []),
|
|
5057
|
-
f((v) =>
|
|
5058
|
-
}, []),
|
|
5059
|
-
const v =
|
|
5073
|
+
}, []), we = L((A) => {
|
|
5074
|
+
f((v) => ts(v, A));
|
|
5075
|
+
}, []), de = L((A) => {
|
|
5076
|
+
f((v) => rs(v, A));
|
|
5077
|
+
}, []), xe = L((A) => {
|
|
5078
|
+
const v = Ht(A.active.data.current);
|
|
5060
5079
|
if (v.source === "palette" && v.type) {
|
|
5061
|
-
|
|
5080
|
+
C({ kind: "palette", type: v.type });
|
|
5062
5081
|
return;
|
|
5063
5082
|
}
|
|
5064
5083
|
if (v.type === "row") {
|
|
5065
|
-
|
|
5084
|
+
C({ kind: "row" });
|
|
5066
5085
|
return;
|
|
5067
5086
|
}
|
|
5068
|
-
v.type === "block" && v.blockUid && f((
|
|
5069
|
-
const U =
|
|
5070
|
-
return
|
|
5087
|
+
v.type === "block" && v.blockUid && f((_) => {
|
|
5088
|
+
const U = bs(_, v.blockUid ?? "");
|
|
5089
|
+
return C(U ? { kind: "block", block: U.block } : null), _;
|
|
5071
5090
|
});
|
|
5072
|
-
}, []), Re =
|
|
5091
|
+
}, []), Re = L(
|
|
5073
5092
|
(A) => {
|
|
5074
|
-
if (
|
|
5093
|
+
if (C(null), !A.over)
|
|
5075
5094
|
return;
|
|
5076
|
-
const v =
|
|
5095
|
+
const v = Ht(A.active.data.current), _ = Ht(A.over.data.current);
|
|
5077
5096
|
if (v.source === "palette" && v.type && F) {
|
|
5078
5097
|
f((U) => {
|
|
5079
|
-
const
|
|
5098
|
+
const Q = Hn(U, A.over?.id, _), Ve = _n(
|
|
5080
5099
|
F,
|
|
5081
5100
|
v.type ?? "",
|
|
5082
5101
|
Xn(U, v.type ?? "")
|
|
5083
5102
|
);
|
|
5084
|
-
return
|
|
5103
|
+
return Q.rowUid === null ? Fn(U, Ve, Q.area) : Ka(U, Q.rowUid, Ve, Q.index);
|
|
5085
5104
|
});
|
|
5086
5105
|
return;
|
|
5087
5106
|
}
|
|
5088
5107
|
if (v.type === "row" && v.rowUid) {
|
|
5089
5108
|
f((U) => {
|
|
5090
|
-
const
|
|
5091
|
-
return
|
|
5109
|
+
const Q = ps(U, A.over?.id, _);
|
|
5110
|
+
return Q === null ? U : Ga(U, v.rowUid ?? "", Q);
|
|
5092
5111
|
});
|
|
5093
5112
|
return;
|
|
5094
5113
|
}
|
|
5095
5114
|
v.type === "block" && v.blockUid && f((U) => {
|
|
5096
|
-
const
|
|
5097
|
-
return
|
|
5115
|
+
const Q = Hn(U, A.over?.id, _);
|
|
5116
|
+
return qa(
|
|
5098
5117
|
U,
|
|
5099
5118
|
v.blockUid ?? "",
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5119
|
+
Q.rowUid,
|
|
5120
|
+
Q.index,
|
|
5121
|
+
Q.area
|
|
5103
5122
|
);
|
|
5104
5123
|
});
|
|
5105
5124
|
},
|
|
5106
5125
|
[F]
|
|
5107
|
-
),
|
|
5108
|
-
|
|
5109
|
-
}, []),
|
|
5110
|
-
return /* @__PURE__ */
|
|
5126
|
+
), dt = L(() => {
|
|
5127
|
+
C(null);
|
|
5128
|
+
}, []), ft = i ? `template-builder-page ${i}` : "template-builder-page";
|
|
5129
|
+
return /* @__PURE__ */ g("main", { className: ft, children: /* @__PURE__ */ x(
|
|
5111
5130
|
bi,
|
|
5112
5131
|
{
|
|
5113
|
-
sensors:
|
|
5132
|
+
sensors: le,
|
|
5114
5133
|
collisionDetection: xo,
|
|
5115
|
-
onDragStart:
|
|
5134
|
+
onDragStart: xe,
|
|
5116
5135
|
onDragEnd: Re,
|
|
5117
|
-
onDragCancel:
|
|
5136
|
+
onDragCancel: dt,
|
|
5118
5137
|
children: [
|
|
5119
5138
|
/* @__PURE__ */ x(
|
|
5120
5139
|
"section",
|
|
@@ -5122,108 +5141,106 @@ function ms({
|
|
|
5122
5141
|
className: "template-builder-page__authoring",
|
|
5123
5142
|
"aria-label": "Template authoring",
|
|
5124
5143
|
children: [
|
|
5125
|
-
/* @__PURE__ */
|
|
5126
|
-
|
|
5144
|
+
/* @__PURE__ */ g(
|
|
5145
|
+
cs,
|
|
5127
5146
|
{
|
|
5128
|
-
format:
|
|
5129
|
-
orientation:
|
|
5130
|
-
onChangeFormat:
|
|
5131
|
-
onChangeOrientation:
|
|
5147
|
+
format: J.format,
|
|
5148
|
+
orientation: J.orientation,
|
|
5149
|
+
onChangeFormat: Oe,
|
|
5150
|
+
onChangeOrientation: oe,
|
|
5132
5151
|
apiUrl: s,
|
|
5133
5152
|
onApiUrlChange: l,
|
|
5134
5153
|
onLoadSchema: () => {
|
|
5135
|
-
|
|
5154
|
+
ce(s);
|
|
5136
5155
|
},
|
|
5137
5156
|
schemaLoading: D,
|
|
5138
|
-
onLoadExample:
|
|
5157
|
+
onLoadExample: Te,
|
|
5139
5158
|
exampleDisabled: !c,
|
|
5140
5159
|
onRender: () => {
|
|
5141
|
-
|
|
5160
|
+
Z();
|
|
5142
5161
|
},
|
|
5143
5162
|
renderDisabled: !c || y,
|
|
5144
5163
|
rendering: y
|
|
5145
5164
|
}
|
|
5146
5165
|
),
|
|
5147
|
-
/* @__PURE__ */
|
|
5148
|
-
/* @__PURE__ */
|
|
5149
|
-
/* @__PURE__ */
|
|
5166
|
+
/* @__PURE__ */ g("aside", { className: "builder-palette", "aria-label": "Block palette", children: /* @__PURE__ */ x("div", { children: [
|
|
5167
|
+
/* @__PURE__ */ g("h2", { className: "builder-palette__section-title", children: "Blocks" }),
|
|
5168
|
+
/* @__PURE__ */ g(ea, { blockTypes: Me, onAdd: M })
|
|
5150
5169
|
] }) }),
|
|
5151
|
-
c ? /* @__PURE__ */
|
|
5170
|
+
c ? /* @__PURE__ */ g(
|
|
5152
5171
|
Ba,
|
|
5153
5172
|
{
|
|
5154
5173
|
schema: c,
|
|
5155
|
-
model:
|
|
5156
|
-
format:
|
|
5157
|
-
orientation:
|
|
5158
|
-
footerRepeat:
|
|
5174
|
+
model: u,
|
|
5175
|
+
format: J.format,
|
|
5176
|
+
orientation: J.orientation,
|
|
5177
|
+
footerRepeat: Ie,
|
|
5159
5178
|
pageNumbers: Le,
|
|
5160
|
-
onChangeBlock:
|
|
5161
|
-
onRemoveBlock:
|
|
5162
|
-
onSetRowWidths:
|
|
5163
|
-
onToggleFooterRepeat:
|
|
5164
|
-
onChangePageNumbers:
|
|
5179
|
+
onChangeBlock: _e,
|
|
5180
|
+
onRemoveBlock: ge,
|
|
5181
|
+
onSetRowWidths: ue,
|
|
5182
|
+
onToggleFooterRepeat: we,
|
|
5183
|
+
onChangePageNumbers: de
|
|
5165
5184
|
}
|
|
5166
|
-
) : /* @__PURE__ */
|
|
5185
|
+
) : /* @__PURE__ */ g("div", { className: "builder-canvas", children: /* @__PURE__ */ g("div", { className: "builder-canvas__empty", children: D ? "Loading schema…" : "Load the schema to start building." }) })
|
|
5167
5186
|
]
|
|
5168
5187
|
}
|
|
5169
5188
|
),
|
|
5170
|
-
/* @__PURE__ */
|
|
5189
|
+
/* @__PURE__ */ g(
|
|
5171
5190
|
za,
|
|
5172
5191
|
{
|
|
5173
5192
|
pdfUrl: h,
|
|
5174
5193
|
error: E,
|
|
5175
5194
|
loading: y,
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
},
|
|
5179
|
-
renderDisabled: !c || y
|
|
5195
|
+
template: K,
|
|
5196
|
+
data: p
|
|
5180
5197
|
}
|
|
5181
5198
|
),
|
|
5182
|
-
/* @__PURE__ */
|
|
5199
|
+
/* @__PURE__ */ g(Pi, { dropAnimation: null, children: S ? /* @__PURE__ */ g(fs, { drag: S }) : null })
|
|
5183
5200
|
]
|
|
5184
5201
|
}
|
|
5185
5202
|
) });
|
|
5186
5203
|
}
|
|
5187
|
-
function
|
|
5188
|
-
return e.kind === "palette" ? /* @__PURE__ */
|
|
5204
|
+
function fs({ drag: e }) {
|
|
5205
|
+
return e.kind === "palette" ? /* @__PURE__ */ g(Tn, { type: e.type, prefix: "+ " }) : e.kind === "block" ? /* @__PURE__ */ g(
|
|
5189
5206
|
Tn,
|
|
5190
5207
|
{
|
|
5191
5208
|
type: e.block.type,
|
|
5192
5209
|
summary: Sr(e.block)
|
|
5193
5210
|
}
|
|
5194
|
-
) : /* @__PURE__ */
|
|
5195
|
-
/* @__PURE__ */
|
|
5196
|
-
/* @__PURE__ */
|
|
5211
|
+
) : /* @__PURE__ */ g("div", { className: "builder-drag-overlay", children: /* @__PURE__ */ x("div", { className: "builder-drag-overlay__card", children: [
|
|
5212
|
+
/* @__PURE__ */ g("span", { className: "builder-chip", "aria-hidden": "true", children: "⋮⋮" }),
|
|
5213
|
+
/* @__PURE__ */ g("span", { style: { fontWeight: 500 }, children: "Row" })
|
|
5197
5214
|
] }) });
|
|
5198
5215
|
}
|
|
5199
|
-
function
|
|
5216
|
+
function Wt(e) {
|
|
5200
5217
|
e && URL.revokeObjectURL(e);
|
|
5201
5218
|
}
|
|
5202
5219
|
function Wn(e) {
|
|
5203
5220
|
return e instanceof Error ? e.message : String(e);
|
|
5204
5221
|
}
|
|
5205
|
-
function
|
|
5206
|
-
return
|
|
5222
|
+
function Ht(e) {
|
|
5223
|
+
return vs(e) ? e : {};
|
|
5207
5224
|
}
|
|
5208
5225
|
function Hn(e, t, n) {
|
|
5209
5226
|
return t === "new-row" ? { rowUid: null, index: 0, area: "body" } : t === "new-footer-row" ? { rowUid: null, index: 0, area: "footer" } : n.type === "block" && n.rowUid && n.blockUid ? {
|
|
5210
5227
|
rowUid: n.rowUid,
|
|
5211
|
-
index:
|
|
5228
|
+
index: gs(e, n.blockUid),
|
|
5212
5229
|
area: n.area ?? "body"
|
|
5213
5230
|
} : n.type === "row" && n.rowUid ? {
|
|
5214
5231
|
rowUid: n.rowUid,
|
|
5215
|
-
index:
|
|
5232
|
+
index: hs(e, n.rowUid),
|
|
5216
5233
|
area: n.area ?? "body"
|
|
5217
5234
|
} : { rowUid: null, index: 0, area: "body" };
|
|
5218
5235
|
}
|
|
5219
|
-
function
|
|
5236
|
+
function ps(e, t, n) {
|
|
5220
5237
|
const r = (n.type === "row" || n.type === "block") && n.rowUid ? n.rowUid : String(t), o = e.rows.findIndex((a) => a.uid === r);
|
|
5221
5238
|
if (o !== -1)
|
|
5222
5239
|
return o;
|
|
5223
5240
|
const i = e.footerRows.findIndex((a) => a.uid === r);
|
|
5224
5241
|
return i === -1 ? null : i;
|
|
5225
5242
|
}
|
|
5226
|
-
function
|
|
5243
|
+
function gs(e, t) {
|
|
5227
5244
|
for (const n of [...e.rows, ...e.footerRows]) {
|
|
5228
5245
|
const r = n.blocks.findIndex((o) => o.uid === t);
|
|
5229
5246
|
if (r !== -1)
|
|
@@ -5231,15 +5248,15 @@ function ds(e, t) {
|
|
|
5231
5248
|
}
|
|
5232
5249
|
return 0;
|
|
5233
5250
|
}
|
|
5234
|
-
function
|
|
5251
|
+
function hs(e, t) {
|
|
5235
5252
|
return (e.rows.find((r) => r.uid === t) ?? e.footerRows.find((r) => r.uid === t))?.blocks.length ?? 0;
|
|
5236
5253
|
}
|
|
5237
|
-
function
|
|
5254
|
+
function bs(e, t) {
|
|
5238
5255
|
return [...e.rows, ...e.footerRows].flatMap((n) => n.blocks).find((n) => n.uid === t);
|
|
5239
5256
|
}
|
|
5240
5257
|
function Xn(e, t) {
|
|
5241
5258
|
const n = new Set(
|
|
5242
|
-
|
|
5259
|
+
vt(e).rows?.flatMap(
|
|
5243
5260
|
(o) => o.blocks.map((i) => i.id).filter((i) => typeof i == "string" && i.length > 0)
|
|
5244
5261
|
) ?? []
|
|
5245
5262
|
);
|
|
@@ -5248,25 +5265,25 @@ function Xn(e, t) {
|
|
|
5248
5265
|
r += 1;
|
|
5249
5266
|
return `${t}-${r}`;
|
|
5250
5267
|
}
|
|
5251
|
-
function
|
|
5268
|
+
function vs(e) {
|
|
5252
5269
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
5253
5270
|
}
|
|
5254
5271
|
export {
|
|
5255
|
-
|
|
5256
|
-
|
|
5272
|
+
Yt as PAGE_SIZES_MM,
|
|
5273
|
+
xs as TemplateBuilder,
|
|
5257
5274
|
jn as createEditorModel,
|
|
5258
|
-
|
|
5275
|
+
Va as createInvoiceExample,
|
|
5259
5276
|
Gi as fetchTemplateSchema,
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5277
|
+
es as getFooterRepeat,
|
|
5278
|
+
ns as getPageNumbers,
|
|
5279
|
+
Ut as getPageSize,
|
|
5263
5280
|
da as mmToPx,
|
|
5264
5281
|
fa as pageSizeForFormat,
|
|
5265
5282
|
Ji as renderTemplatePdf,
|
|
5266
5283
|
qi as resolveDefaultApiUrl,
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5284
|
+
vt as serializeTemplate,
|
|
5285
|
+
ts as setFooterRepeat,
|
|
5286
|
+
rs as setPageNumbers,
|
|
5270
5287
|
zn as setPageSize
|
|
5271
5288
|
};
|
|
5272
5289
|
//# sourceMappingURL=index.js.map
|