uhuu-components 0.2.36 → 0.2.37
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/package.json +1 -1
- package/uhuu-components.es.js +363 -363
- package/uhuu-components.es.js.map +1 -1
- package/uhuu-components.umd.js +3 -3
- package/uhuu-components.umd.js.map +1 -1
package/uhuu-components.es.js
CHANGED
|
@@ -166,51 +166,51 @@ function Sa() {
|
|
|
166
166
|
Tt = 1;
|
|
167
167
|
var e = Zt(), t = ya(), n = Ca(), r = "Expected a function", i = Math.max, o = Math.min;
|
|
168
168
|
function s(c, d, l) {
|
|
169
|
-
var f, u, g, m, C, p, w = 0,
|
|
169
|
+
var f, u, g, m, C, p, w = 0, P = !1, S = !1, k = !0;
|
|
170
170
|
if (typeof c != "function")
|
|
171
171
|
throw new TypeError(r);
|
|
172
|
-
d = n(d) || 0, e(l) && (
|
|
173
|
-
function
|
|
172
|
+
d = n(d) || 0, e(l) && (P = !!l.leading, S = "maxWait" in l, g = S ? i(n(l.maxWait) || 0, d) : g, k = "trailing" in l ? !!l.trailing : k);
|
|
173
|
+
function v(j) {
|
|
174
174
|
var H = f, z = u;
|
|
175
175
|
return f = u = void 0, w = j, m = c.apply(z, H), m;
|
|
176
176
|
}
|
|
177
|
-
function
|
|
178
|
-
return w = j, C = setTimeout(y, d),
|
|
177
|
+
function E(j) {
|
|
178
|
+
return w = j, C = setTimeout(y, d), P ? v(j) : m;
|
|
179
179
|
}
|
|
180
|
-
function
|
|
180
|
+
function D(j) {
|
|
181
181
|
var H = j - p, z = j - w, b = d - H;
|
|
182
182
|
return S ? o(b, g - z) : b;
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function T(j) {
|
|
185
185
|
var H = j - p, z = j - w;
|
|
186
186
|
return p === void 0 || H >= d || H < 0 || S && z >= g;
|
|
187
187
|
}
|
|
188
188
|
function y() {
|
|
189
189
|
var j = t();
|
|
190
|
-
if (
|
|
191
|
-
return
|
|
192
|
-
C = setTimeout(y,
|
|
190
|
+
if (T(j))
|
|
191
|
+
return x(j);
|
|
192
|
+
C = setTimeout(y, D(j));
|
|
193
193
|
}
|
|
194
|
-
function
|
|
195
|
-
return C = void 0, k && f ?
|
|
194
|
+
function x(j) {
|
|
195
|
+
return C = void 0, k && f ? v(j) : (f = u = void 0, m);
|
|
196
196
|
}
|
|
197
197
|
function R() {
|
|
198
198
|
C !== void 0 && clearTimeout(C), w = 0, f = p = u = C = void 0;
|
|
199
199
|
}
|
|
200
|
-
function
|
|
201
|
-
return C === void 0 ? m :
|
|
200
|
+
function A() {
|
|
201
|
+
return C === void 0 ? m : x(t());
|
|
202
202
|
}
|
|
203
203
|
function O() {
|
|
204
|
-
var j = t(), H =
|
|
204
|
+
var j = t(), H = T(j);
|
|
205
205
|
if (f = arguments, u = this, p = j, H) {
|
|
206
206
|
if (C === void 0)
|
|
207
|
-
return
|
|
207
|
+
return E(p);
|
|
208
208
|
if (S)
|
|
209
|
-
return clearTimeout(C), C = setTimeout(y, d),
|
|
209
|
+
return clearTimeout(C), C = setTimeout(y, d), v(p);
|
|
210
210
|
}
|
|
211
211
|
return C === void 0 && (C = setTimeout(y, d)), m;
|
|
212
212
|
}
|
|
213
|
-
return O.cancel = R, O.flush =
|
|
213
|
+
return O.cancel = R, O.flush = A, O;
|
|
214
214
|
}
|
|
215
215
|
return Qe = s, Qe;
|
|
216
216
|
}
|
|
@@ -509,27 +509,27 @@ const tn = ({ children: e, className: t, setup: n }) => {
|
|
|
509
509
|
right: f = 0,
|
|
510
510
|
top: u = 0,
|
|
511
511
|
bottom: g = 0
|
|
512
|
-
} = e, [m, C] = J("h-full w-full object-cover object-center"), p = (
|
|
513
|
-
let
|
|
514
|
-
return d || (
|
|
512
|
+
} = e, [m, C] = J("h-full w-full object-cover object-center"), p = (x) => `${x}mm`, w = () => {
|
|
513
|
+
let x = d;
|
|
514
|
+
return d || (x = i, u || (x += n), g || (x += n), (u || g) && (x -= (u ?? 0) + (g ?? 0))), x;
|
|
515
515
|
}, S = (() => {
|
|
516
|
-
let
|
|
517
|
-
return c || (
|
|
518
|
-
})(), k = w(),
|
|
519
|
-
Object.entries(
|
|
516
|
+
let x = c;
|
|
517
|
+
return c || (x = r, l || (x += n), f || (x += n), (l || f) && (x -= (l ?? 0) + (f ?? 0))), x;
|
|
518
|
+
})(), k = w(), v = (x) => x !== void 0 ? p(x) : void 0, D = ((x) => Object.fromEntries(
|
|
519
|
+
Object.entries(x).filter(([R, A]) => A !== void 0)
|
|
520
520
|
))({
|
|
521
521
|
backgroundColor: s,
|
|
522
|
-
width:
|
|
523
|
-
height:
|
|
524
|
-
left:
|
|
525
|
-
right:
|
|
526
|
-
top:
|
|
527
|
-
bottom:
|
|
528
|
-
}),
|
|
529
|
-
let
|
|
530
|
-
C(
|
|
522
|
+
width: v(S),
|
|
523
|
+
height: v(k),
|
|
524
|
+
left: v(l > 0 ? l + n : l),
|
|
525
|
+
right: v(f > 0 ? f + n : f),
|
|
526
|
+
top: v(u > 0 ? u + n : u),
|
|
527
|
+
bottom: v(g > 0 ? g + n : g)
|
|
528
|
+
}), T = k > 0 ? S / k : S / (i - (u ?? 0) - (g ?? 0)), y = (x) => {
|
|
529
|
+
let A = x.target.naturalWidth / x.target.naturalHeight > T ? "cover-vertical" : "cover-horizontal";
|
|
530
|
+
C(A);
|
|
531
531
|
};
|
|
532
|
-
return /* @__PURE__ */ a("div", { className: "uhuu-image-container", style:
|
|
532
|
+
return /* @__PURE__ */ a("div", { className: "uhuu-image-container", style: D, ...e.dataUhuu !== void 0 ? { "data-uhuu": e.dataUhuu } : {}, children: /* @__PURE__ */ h(
|
|
533
533
|
"div",
|
|
534
534
|
{
|
|
535
535
|
className: "uhuu-image-inner",
|
|
@@ -540,7 +540,7 @@ const tn = ({ children: e, className: t, setup: n }) => {
|
|
|
540
540
|
{
|
|
541
541
|
className: m,
|
|
542
542
|
src: o,
|
|
543
|
-
onLoad: (
|
|
543
|
+
onLoad: (x) => y(x)
|
|
544
544
|
},
|
|
545
545
|
`${o}-${S}-${k}`
|
|
546
546
|
),
|
|
@@ -832,28 +832,28 @@ function cn(e) {
|
|
|
832
832
|
right: u = 0,
|
|
833
833
|
top: g = 0,
|
|
834
834
|
bottom: m = 0
|
|
835
|
-
} = e, [C, p] = J("h-full w-full object-cover object-center"), w = (b) => `${b}mm`,
|
|
835
|
+
} = e, [C, p] = J("h-full w-full object-cover object-center"), w = (b) => `${b}mm`, P = () => {
|
|
836
836
|
let b = d;
|
|
837
837
|
return d || (b = 2 * r, f || (b += 2 * n), u || (b += 2 * n), (f || u) && (b -= (f ?? 0) + (u ?? 0))), b;
|
|
838
838
|
}, S = () => {
|
|
839
839
|
let b = l;
|
|
840
840
|
return l || (b = i, g || (b += n), m || (b += n), (g || m) && (b -= (g ?? 0) + (m ?? 0))), b;
|
|
841
|
-
}, k =
|
|
841
|
+
}, k = P(), v = S(), E = (b) => b !== void 0 ? w(b) : void 0, D = (b) => Object.fromEntries(
|
|
842
842
|
Object.entries(b).filter(([M, _]) => _ !== void 0)
|
|
843
|
-
),
|
|
843
|
+
), T = f > 0 ? f + n : -1 * n, y = g > 0 ? g + n : -1 * n, x = m > 0 ? m + n : -1 * n, R = -1 * r + T, A = g > 0 && m > 0, O = D({
|
|
844
844
|
backgroundColor: c,
|
|
845
|
-
width:
|
|
846
|
-
...
|
|
847
|
-
left: T
|
|
848
|
-
top:
|
|
849
|
-
bottom:
|
|
850
|
-
}), j =
|
|
851
|
-
width:
|
|
852
|
-
...
|
|
853
|
-
left:
|
|
854
|
-
top:
|
|
855
|
-
bottom:
|
|
856
|
-
}), H =
|
|
845
|
+
width: E(k),
|
|
846
|
+
...A ? { height: E(v) } : {},
|
|
847
|
+
left: E(T),
|
|
848
|
+
top: E(y),
|
|
849
|
+
bottom: E(x)
|
|
850
|
+
}), j = D({
|
|
851
|
+
width: E(k),
|
|
852
|
+
...A ? { height: E(v) } : {},
|
|
853
|
+
left: E(R),
|
|
854
|
+
top: E(y),
|
|
855
|
+
bottom: E(x)
|
|
856
|
+
}), H = v != 0 ? k / v : k / (i - (g ?? 0) - (m ?? 0)), z = (b) => {
|
|
857
857
|
let _ = b.target.naturalWidth / b.target.naturalHeight > H ? "cover-vertical" : "cover-horizontal";
|
|
858
858
|
p(_);
|
|
859
859
|
};
|
|
@@ -864,7 +864,7 @@ function cn(e) {
|
|
|
864
864
|
src: o,
|
|
865
865
|
onLoad: (b) => z(b)
|
|
866
866
|
},
|
|
867
|
-
`${o}-${k}-${
|
|
867
|
+
`${o}-${k}-${v}`
|
|
868
868
|
) }) });
|
|
869
869
|
}
|
|
870
870
|
const jt = ({
|
|
@@ -884,34 +884,34 @@ const jt = ({
|
|
|
884
884
|
imageProps: m,
|
|
885
885
|
renderImage: C
|
|
886
886
|
}) => {
|
|
887
|
-
const p = oe(we), w = l ? Ie({ dialog: l }, p) : {},
|
|
887
|
+
const p = oe(we), w = l ? Ie({ dialog: l }, p) : {}, P = ln(d), S = I.useMemo(() => {
|
|
888
888
|
if (!f) return w;
|
|
889
|
-
const
|
|
890
|
-
return (w.className || f.className) && (
|
|
891
|
-
const
|
|
892
|
-
y.startsWith("on") && typeof
|
|
893
|
-
|
|
889
|
+
const T = { ...w, ...f };
|
|
890
|
+
return (w.className || f.className) && (T.className = W(w.className, f.className)), Object.keys(w).forEach((y) => {
|
|
891
|
+
const x = w[y], R = f[y];
|
|
892
|
+
y.startsWith("on") && typeof x == "function" && typeof R == "function" && (T[y] = (A) => {
|
|
893
|
+
x(A), R(A);
|
|
894
894
|
});
|
|
895
|
-
}),
|
|
895
|
+
}), T;
|
|
896
896
|
}, [w, f]), k = () => {
|
|
897
|
-
const
|
|
897
|
+
const T = m?.className, y = m?.style, x = m?.src ?? e, R = m?.alt ?? t, A = {
|
|
898
898
|
...m,
|
|
899
|
-
src:
|
|
899
|
+
src: x,
|
|
900
900
|
alt: R,
|
|
901
|
-
className: W("h-full w-full object-cover", r,
|
|
901
|
+
className: W("h-full w-full object-cover", r, T),
|
|
902
902
|
style: { ...o, ...y }
|
|
903
903
|
};
|
|
904
|
-
return C ? C(
|
|
905
|
-
},
|
|
906
|
-
I.Children.toArray(g).some((
|
|
907
|
-
const
|
|
904
|
+
return C ? C(A) : x ? /* @__PURE__ */ a("img", { ...A }) : u ?? null;
|
|
905
|
+
}, v = S["data-uhuu"];
|
|
906
|
+
I.Children.toArray(g).some((T) => I.isValidElement(T) ? T.type === cn || T.type === at : !1) && delete S["data-uhuu"];
|
|
907
|
+
const D = I.Children.map(g, (T) => I.isValidElement(T) ? I.cloneElement(T, { dataUhuu: v }) : T);
|
|
908
908
|
return /* @__PURE__ */ h("div", { className: W("relative", n), style: i, children: [
|
|
909
909
|
/* @__PURE__ */ h("div", { className: "relative h-full w-full", ...S, children: [
|
|
910
910
|
k(),
|
|
911
|
-
|
|
911
|
+
D,
|
|
912
912
|
sn(s, c)
|
|
913
913
|
] }),
|
|
914
|
-
on(d,
|
|
914
|
+
on(d, P)
|
|
915
915
|
] });
|
|
916
916
|
}, Zr = (e) => {
|
|
917
917
|
const { computedOverlaySvg: t, computedOptions: n, computedDirectDialog: r } = ae(() => {
|
|
@@ -991,17 +991,17 @@ const jt = ({
|
|
|
991
991
|
backgroundColor: C,
|
|
992
992
|
width: p,
|
|
993
993
|
height: w,
|
|
994
|
-
left:
|
|
994
|
+
left: P,
|
|
995
995
|
right: S,
|
|
996
996
|
top: k,
|
|
997
|
-
bottom:
|
|
998
|
-
pageWidth:
|
|
999
|
-
pageHeight:
|
|
1000
|
-
bleed:
|
|
997
|
+
bottom: v,
|
|
998
|
+
pageWidth: E,
|
|
999
|
+
pageHeight: D,
|
|
1000
|
+
bleed: T,
|
|
1001
1001
|
overlayClassName: y,
|
|
1002
|
-
dialogProps:
|
|
1002
|
+
dialogProps: x,
|
|
1003
1003
|
placeholder: R,
|
|
1004
|
-
children:
|
|
1004
|
+
children: A,
|
|
1005
1005
|
imageProps: O,
|
|
1006
1006
|
renderImage: j
|
|
1007
1007
|
} = e, H = {
|
|
@@ -1009,13 +1009,13 @@ const jt = ({
|
|
|
1009
1009
|
backgroundColor: C,
|
|
1010
1010
|
width: p,
|
|
1011
1011
|
height: w,
|
|
1012
|
-
left:
|
|
1012
|
+
left: P,
|
|
1013
1013
|
right: S,
|
|
1014
1014
|
top: k,
|
|
1015
|
-
bottom:
|
|
1016
|
-
pageWidth:
|
|
1017
|
-
pageHeight:
|
|
1018
|
-
bleed:
|
|
1015
|
+
bottom: v,
|
|
1016
|
+
pageWidth: E,
|
|
1017
|
+
pageHeight: D,
|
|
1018
|
+
bleed: T
|
|
1019
1019
|
};
|
|
1020
1020
|
if (i === "auto")
|
|
1021
1021
|
return /* @__PURE__ */ a(
|
|
@@ -1031,9 +1031,9 @@ const jt = ({
|
|
|
1031
1031
|
overlayClassName: y,
|
|
1032
1032
|
options: n,
|
|
1033
1033
|
dialog: r,
|
|
1034
|
-
dialogProps:
|
|
1034
|
+
dialogProps: x,
|
|
1035
1035
|
placeholder: R,
|
|
1036
|
-
children:
|
|
1036
|
+
children: A,
|
|
1037
1037
|
imageProps: O,
|
|
1038
1038
|
renderImage: j
|
|
1039
1039
|
}
|
|
@@ -1055,10 +1055,10 @@ const jt = ({
|
|
|
1055
1055
|
overlayClassName: y,
|
|
1056
1056
|
options: n,
|
|
1057
1057
|
dialog: r,
|
|
1058
|
-
dialogProps:
|
|
1058
|
+
dialogProps: x,
|
|
1059
1059
|
children: [
|
|
1060
1060
|
z,
|
|
1061
|
-
|
|
1061
|
+
A
|
|
1062
1062
|
]
|
|
1063
1063
|
}
|
|
1064
1064
|
) : z;
|
|
@@ -1072,9 +1072,9 @@ const jt = ({
|
|
|
1072
1072
|
overlayClassName: y,
|
|
1073
1073
|
options: n,
|
|
1074
1074
|
dialog: r,
|
|
1075
|
-
dialogProps:
|
|
1075
|
+
dialogProps: x,
|
|
1076
1076
|
bleedProps: H,
|
|
1077
|
-
children:
|
|
1077
|
+
children: A
|
|
1078
1078
|
}
|
|
1079
1079
|
) : /* @__PURE__ */ a(at, { ...H });
|
|
1080
1080
|
}, Jr = (e) => {
|
|
@@ -1410,11 +1410,11 @@ function yn({
|
|
|
1410
1410
|
} catch {
|
|
1411
1411
|
return String(y);
|
|
1412
1412
|
}
|
|
1413
|
-
}, []), g = I.useMemo(() => Qa(r), [r]), m = I.useCallback((y,
|
|
1413
|
+
}, []), g = I.useMemo(() => Qa(r), [r]), m = I.useCallback((y, x) => {
|
|
1414
1414
|
if (!y) return null;
|
|
1415
1415
|
const R = { ...y };
|
|
1416
|
-
return
|
|
1417
|
-
delete R[
|
|
1416
|
+
return x.forEach((A) => {
|
|
1417
|
+
delete R[A];
|
|
1418
1418
|
}), R;
|
|
1419
1419
|
}, []);
|
|
1420
1420
|
I.useEffect(() => {
|
|
@@ -1431,7 +1431,7 @@ function yn({
|
|
|
1431
1431
|
return;
|
|
1432
1432
|
}
|
|
1433
1433
|
if (Date.now() - l.current < 500 && d.current !== null) {
|
|
1434
|
-
const R = m(e, g),
|
|
1434
|
+
const R = m(e, g), A = m(d.current, g), O = R ? u(R) : null, j = A ? u(A) : null;
|
|
1435
1435
|
if (O && O === j) {
|
|
1436
1436
|
console.log("[TemplateDataProvider] Skipping round-trip"), d.current = null, s.current = e;
|
|
1437
1437
|
return;
|
|
@@ -1439,8 +1439,8 @@ function yn({
|
|
|
1439
1439
|
}
|
|
1440
1440
|
console.log("[TemplateDataProvider] External payload update detected, merging...", e), s.current = e, o((R) => {
|
|
1441
1441
|
if (!e) return R;
|
|
1442
|
-
const
|
|
1443
|
-
return console.log("[TemplateDataProvider] Merged payload:",
|
|
1442
|
+
const A = er(R, e, g);
|
|
1443
|
+
return console.log("[TemplateDataProvider] Merged payload:", A), A;
|
|
1444
1444
|
});
|
|
1445
1445
|
}, [e, g, u, m]);
|
|
1446
1446
|
const C = I.useCallback(
|
|
@@ -1450,37 +1450,37 @@ function yn({
|
|
|
1450
1450
|
[t]
|
|
1451
1451
|
), p = I.useCallback(
|
|
1452
1452
|
(y) => {
|
|
1453
|
-
c.current = !0, o((
|
|
1454
|
-
const R = typeof y == "function" ? y(
|
|
1455
|
-
let
|
|
1453
|
+
c.current = !0, o((x) => {
|
|
1454
|
+
const R = typeof y == "function" ? y(x) : y;
|
|
1455
|
+
let A = R;
|
|
1456
1456
|
return R && typeof R == "object" && Object.keys(R).filter(
|
|
1457
1457
|
(j) => j.startsWith("integrations.") || j === "integrations"
|
|
1458
|
-
).length > 0 && R.integrations && (
|
|
1458
|
+
).length > 0 && R.integrations && (A = R), d.current = A, l.current = Date.now(), C(A), A;
|
|
1459
1459
|
});
|
|
1460
1460
|
},
|
|
1461
1461
|
[C]
|
|
1462
1462
|
), w = I.useCallback(
|
|
1463
|
-
(y,
|
|
1464
|
-
p((
|
|
1465
|
-
...
|
|
1463
|
+
(y, x, R) => {
|
|
1464
|
+
p((A) => ({
|
|
1465
|
+
...A ?? {},
|
|
1466
1466
|
pages: {
|
|
1467
|
-
...
|
|
1467
|
+
...A?.pages ?? {},
|
|
1468
1468
|
[y]: {
|
|
1469
|
-
...
|
|
1470
|
-
[
|
|
1469
|
+
...A?.pages?.[y] ?? {},
|
|
1470
|
+
[x]: R
|
|
1471
1471
|
}
|
|
1472
1472
|
}
|
|
1473
1473
|
}));
|
|
1474
1474
|
},
|
|
1475
1475
|
[p]
|
|
1476
|
-
),
|
|
1477
|
-
(y,
|
|
1476
|
+
), P = I.useCallback(
|
|
1477
|
+
(y, x) => {
|
|
1478
1478
|
p((R) => {
|
|
1479
|
-
const
|
|
1479
|
+
const A = R?.integrations ?? {}, O = A[y], j = typeof x == "function" ? x(O) : x;
|
|
1480
1480
|
return {
|
|
1481
1481
|
...R ?? {},
|
|
1482
1482
|
integrations: {
|
|
1483
|
-
...
|
|
1483
|
+
...A,
|
|
1484
1484
|
[y]: j
|
|
1485
1485
|
}
|
|
1486
1486
|
};
|
|
@@ -1488,65 +1488,65 @@ function yn({
|
|
|
1488
1488
|
},
|
|
1489
1489
|
[p]
|
|
1490
1490
|
), S = I.useCallback(
|
|
1491
|
-
(y,
|
|
1492
|
-
|
|
1493
|
-
...
|
|
1494
|
-
[
|
|
1491
|
+
(y, x, R) => {
|
|
1492
|
+
P(y, (A) => ({
|
|
1493
|
+
...A ?? {},
|
|
1494
|
+
[x]: R
|
|
1495
1495
|
}));
|
|
1496
1496
|
},
|
|
1497
|
-
[
|
|
1497
|
+
[P]
|
|
1498
1498
|
), k = I.useCallback(
|
|
1499
1499
|
(y) => {
|
|
1500
|
-
p((
|
|
1501
|
-
if (!
|
|
1502
|
-
return
|
|
1503
|
-
const { [y]: R, ...
|
|
1500
|
+
p((x) => {
|
|
1501
|
+
if (!x?.integrations || !x.integrations[y])
|
|
1502
|
+
return x;
|
|
1503
|
+
const { [y]: R, ...A } = x.integrations;
|
|
1504
1504
|
return {
|
|
1505
|
-
...
|
|
1506
|
-
integrations: Object.keys(
|
|
1505
|
+
...x,
|
|
1506
|
+
integrations: Object.keys(A).length > 0 ? A : void 0
|
|
1507
1507
|
};
|
|
1508
1508
|
});
|
|
1509
1509
|
},
|
|
1510
1510
|
[p]
|
|
1511
|
-
),
|
|
1512
|
-
(y,
|
|
1513
|
-
p((R) => Ya(R, y,
|
|
1511
|
+
), v = I.useCallback(
|
|
1512
|
+
(y, x) => {
|
|
1513
|
+
p((R) => Ya(R, y, x));
|
|
1514
1514
|
},
|
|
1515
1515
|
[p]
|
|
1516
|
-
),
|
|
1517
|
-
(y,
|
|
1518
|
-
const R =
|
|
1519
|
-
p((
|
|
1516
|
+
), E = I.useCallback(
|
|
1517
|
+
(y, x) => {
|
|
1518
|
+
const R = x ?? r;
|
|
1519
|
+
p((A) => qa(A, y, R));
|
|
1520
1520
|
},
|
|
1521
1521
|
[p, r]
|
|
1522
|
-
),
|
|
1522
|
+
), D = I.useCallback(
|
|
1523
1523
|
(y) => $e(i, y),
|
|
1524
1524
|
[i]
|
|
1525
|
-
),
|
|
1525
|
+
), T = I.useMemo(
|
|
1526
1526
|
() => ({
|
|
1527
1527
|
payload: i,
|
|
1528
1528
|
setPayload: p,
|
|
1529
1529
|
setPageOptionValue: w,
|
|
1530
|
-
setIntegrationPayload:
|
|
1530
|
+
setIntegrationPayload: P,
|
|
1531
1531
|
setIntegrationPayloadValue: S,
|
|
1532
1532
|
removeIntegrationPayload: k,
|
|
1533
|
-
updateIntegrationByDialogPath:
|
|
1534
|
-
mergePageEditorState:
|
|
1535
|
-
getPagePayload:
|
|
1533
|
+
updateIntegrationByDialogPath: v,
|
|
1534
|
+
mergePageEditorState: E,
|
|
1535
|
+
getPagePayload: D
|
|
1536
1536
|
}),
|
|
1537
1537
|
[
|
|
1538
1538
|
i,
|
|
1539
1539
|
p,
|
|
1540
1540
|
w,
|
|
1541
|
-
|
|
1541
|
+
P,
|
|
1542
1542
|
S,
|
|
1543
1543
|
k,
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1544
|
+
v,
|
|
1545
|
+
E,
|
|
1546
|
+
D
|
|
1547
1547
|
]
|
|
1548
1548
|
);
|
|
1549
|
-
return /* @__PURE__ */ a(ke.Provider, { value:
|
|
1549
|
+
return /* @__PURE__ */ a(ke.Provider, { value: T, children: n });
|
|
1550
1550
|
}
|
|
1551
1551
|
function tr(e) {
|
|
1552
1552
|
return e.defaultValue !== void 0 ? e.defaultValue : e.type === "toggle" ? !1 : e.type === "slider" || e.type === "counter" ? 0 : "";
|
|
@@ -1600,17 +1600,17 @@ function Oe({ children: e, title: t, className: n = "", controls: r, origin: i =
|
|
|
1600
1600
|
const { scaleValue: o, hideUI: s } = oe(Me), c = de(null), [d, l] = J(0), [f, u] = J(0);
|
|
1601
1601
|
xe(() => {
|
|
1602
1602
|
if (c.current) {
|
|
1603
|
-
const
|
|
1603
|
+
const P = () => {
|
|
1604
1604
|
const k = c.current;
|
|
1605
1605
|
if (k) {
|
|
1606
|
-
const
|
|
1606
|
+
const v = k.style.transform;
|
|
1607
1607
|
k.style.transform = "scale(1)";
|
|
1608
|
-
const
|
|
1609
|
-
k.style.transform =
|
|
1608
|
+
const E = k.scrollHeight, D = k.scrollWidth;
|
|
1609
|
+
k.style.transform = v, l(E), u(D);
|
|
1610
1610
|
}
|
|
1611
1611
|
};
|
|
1612
|
-
|
|
1613
|
-
const S = new ResizeObserver(
|
|
1612
|
+
P();
|
|
1613
|
+
const S = new ResizeObserver(P);
|
|
1614
1614
|
return S.observe(c.current), () => {
|
|
1615
1615
|
S.disconnect();
|
|
1616
1616
|
};
|
|
@@ -1673,7 +1673,7 @@ function ir({
|
|
|
1673
1673
|
hideUI: c,
|
|
1674
1674
|
preview: d = "single_page"
|
|
1675
1675
|
}) {
|
|
1676
|
-
const l = st(), f = c ?? l, [u, g] = J(n), [m, C] = J("none"), p = de(null), w = de(null), [
|
|
1676
|
+
const l = st(), f = c ?? l, [u, g] = J(n), [m, C] = J("none"), p = de(null), w = de(null), [P, S] = J(!1), [k, v] = J(0), [E, D] = J(!0), T = (O) => {
|
|
1677
1677
|
if (!p.current || !w.current) return u;
|
|
1678
1678
|
const j = p.current.getBoundingClientRect(), H = w.current.querySelector("[data-section-content]");
|
|
1679
1679
|
if (!H) return u;
|
|
@@ -1694,10 +1694,10 @@ function ir({
|
|
|
1694
1694
|
}
|
|
1695
1695
|
}, y = (O) => {
|
|
1696
1696
|
if (C(O), O !== "none") {
|
|
1697
|
-
const j =
|
|
1697
|
+
const j = T(O);
|
|
1698
1698
|
g(j);
|
|
1699
1699
|
}
|
|
1700
|
-
},
|
|
1700
|
+
}, x = () => {
|
|
1701
1701
|
const O = Math.min(u + 25, i);
|
|
1702
1702
|
g(O), C("none");
|
|
1703
1703
|
}, R = () => {
|
|
@@ -1708,42 +1708,42 @@ function ir({
|
|
|
1708
1708
|
const O = () => {
|
|
1709
1709
|
if (!p.current || !w.current) return;
|
|
1710
1710
|
const z = p.current.getBoundingClientRect().width;
|
|
1711
|
-
if (!
|
|
1711
|
+
if (!P) {
|
|
1712
1712
|
const b = w.current.querySelector("[data-section-content]");
|
|
1713
1713
|
if (b) {
|
|
1714
1714
|
const M = Number.parseInt(b.getAttribute("data-natural-width") || "0");
|
|
1715
1715
|
if (M > 0) {
|
|
1716
1716
|
if (M > z - 48) {
|
|
1717
|
-
const _ =
|
|
1717
|
+
const _ = T("both");
|
|
1718
1718
|
C("both"), g(_);
|
|
1719
1719
|
}
|
|
1720
|
-
S(!0),
|
|
1720
|
+
S(!0), v(z), D(!1);
|
|
1721
1721
|
return;
|
|
1722
1722
|
}
|
|
1723
1723
|
}
|
|
1724
|
-
if (
|
|
1724
|
+
if (E) {
|
|
1725
1725
|
setTimeout(O, 50);
|
|
1726
1726
|
return;
|
|
1727
1727
|
}
|
|
1728
1728
|
}
|
|
1729
|
-
|
|
1729
|
+
D(!1);
|
|
1730
1730
|
}, j = () => {
|
|
1731
|
-
if (!p.current ||
|
|
1731
|
+
if (!p.current || E) return;
|
|
1732
1732
|
const z = p.current.getBoundingClientRect().width;
|
|
1733
1733
|
if (Math.abs(z - k) > 10) {
|
|
1734
1734
|
if (m !== "none") {
|
|
1735
|
-
const b =
|
|
1735
|
+
const b = T(m);
|
|
1736
1736
|
g(b);
|
|
1737
1737
|
}
|
|
1738
|
-
|
|
1738
|
+
v(z);
|
|
1739
1739
|
}
|
|
1740
1740
|
};
|
|
1741
1741
|
return O(), window.addEventListener("resize", j), () => {
|
|
1742
1742
|
window.removeEventListener("resize", j);
|
|
1743
1743
|
};
|
|
1744
|
-
}, [m, r, i,
|
|
1745
|
-
const
|
|
1746
|
-
return f ? /* @__PURE__ */ a(Me.Provider, { value: { zoom: 100, scaleValue: 1, hideUI: !0 }, children: /* @__PURE__ */ a("div", { className: t, children: e }) }) : /* @__PURE__ */ a(Me.Provider, { value: { zoom: u, scaleValue:
|
|
1744
|
+
}, [m, r, i, P, k, E]);
|
|
1745
|
+
const A = u / 100;
|
|
1746
|
+
return f ? /* @__PURE__ */ a(Me.Provider, { value: { zoom: 100, scaleValue: 1, hideUI: !0 }, children: /* @__PURE__ */ a("div", { className: t, children: e }) }) : /* @__PURE__ */ a(Me.Provider, { value: { zoom: u, scaleValue: A, hideUI: !1 }, children: /* @__PURE__ */ h("div", { ref: p, className: `flex flex-col min-h-0 ${t}`, children: [
|
|
1747
1747
|
/* @__PURE__ */ h("div", { "data-uhuu-editor": !0, className: "fixed right-4 bottom-4 z-50 flex items-center gap-1.5 px-2.5 py-1.5 bg-white/90 backdrop-blur-md border border-gray-200/60 rounded-lg shadow-sm", children: [
|
|
1748
1748
|
s,
|
|
1749
1749
|
/* @__PURE__ */ a("div", { className: "h-4 w-px bg-gray-200 mx-0.5" }),
|
|
@@ -1830,7 +1830,7 @@ function ir({
|
|
|
1830
1830
|
variant: "ghost",
|
|
1831
1831
|
size: "sm",
|
|
1832
1832
|
onClick: (O) => {
|
|
1833
|
-
O.stopPropagation(),
|
|
1833
|
+
O.stopPropagation(), x();
|
|
1834
1834
|
},
|
|
1835
1835
|
disabled: u >= i,
|
|
1836
1836
|
className: "h-8 w-8 p-0 hover:bg-gray-100 disabled:opacity-40",
|
|
@@ -1943,17 +1943,17 @@ function mt(e) {
|
|
|
1943
1943
|
thumbnailHeight: o
|
|
1944
1944
|
} = e, s = r.width || 210, c = r.height || 297, d = s / c, l = i, f = o ?? Math.round(l / d), u = s * 3.779527559, g = c * 3.779527559;
|
|
1945
1945
|
return (m, C, p) => {
|
|
1946
|
-
const w = m.strictPosition,
|
|
1946
|
+
const w = m.strictPosition, P = w === "start" || w === "end";
|
|
1947
1947
|
if (m.kind === "group") {
|
|
1948
|
-
const S = m.firstPageId, k = m.firstPageComponentKey ?? S,
|
|
1948
|
+
const S = m.firstPageId, k = m.firstPageComponentKey ?? S, v = $e(n, { id: S, componentKey: k }), E = m.firstPageComponent || (k ? t[k] : null), D = n?.integrations?.[m.id];
|
|
1949
1949
|
return /* @__PURE__ */ h(
|
|
1950
1950
|
"div",
|
|
1951
1951
|
{
|
|
1952
|
-
className: `relative bg-white border transition-all ${p ? "border-blue-400 shadow-2xl scale-105" :
|
|
1952
|
+
className: `relative bg-white border transition-all ${p ? "border-blue-400 shadow-2xl scale-105" : P ? "border-gray-300 bg-gray-50" : "border-gray-200 hover:border-gray-300 hover:shadow-lg"}`,
|
|
1953
1953
|
style: { width: `${l}px`, height: `${f}px` },
|
|
1954
1954
|
title: m.id,
|
|
1955
1955
|
children: [
|
|
1956
|
-
|
|
1956
|
+
E ? /* @__PURE__ */ a(
|
|
1957
1957
|
"div",
|
|
1958
1958
|
{
|
|
1959
1959
|
className: "w-full h-full flex items-center justify-center bg-gray-50 overflow-hidden relative pointer-events-none",
|
|
@@ -1966,14 +1966,14 @@ function mt(e) {
|
|
|
1966
1966
|
transformOrigin: "center"
|
|
1967
1967
|
},
|
|
1968
1968
|
children: /* @__PURE__ */ a("div", { className: "!shrink-0", style: { width: `${u}px`, height: `${g}px`, backgroundColor: "white", pointerEvents: "none" }, children: /* @__PURE__ */ a(
|
|
1969
|
-
|
|
1969
|
+
E,
|
|
1970
1970
|
{
|
|
1971
1971
|
payload: n,
|
|
1972
1972
|
pageId: S,
|
|
1973
1973
|
templateId: k,
|
|
1974
|
-
pagePayload:
|
|
1974
|
+
pagePayload: v,
|
|
1975
1975
|
componentKey: k,
|
|
1976
|
-
integration:
|
|
1976
|
+
integration: D
|
|
1977
1977
|
}
|
|
1978
1978
|
) })
|
|
1979
1979
|
}
|
|
@@ -1991,7 +1991,7 @@ function mt(e) {
|
|
|
1991
1991
|
m.pageCount,
|
|
1992
1992
|
" pages)"
|
|
1993
1993
|
] }),
|
|
1994
|
-
|
|
1994
|
+
P && /* @__PURE__ */ h("div", { className: "absolute top-2 left-2 px-2 py-1 bg-gray-600/80 backdrop-blur-sm text-white text-xs font-medium rounded shadow-lg pointer-events-none flex items-center gap-1", children: [
|
|
1995
1995
|
/* @__PURE__ */ a(et, { className: "size-3" }),
|
|
1996
1996
|
/* @__PURE__ */ a("span", { children: w === "start" ? "Start" : "End" })
|
|
1997
1997
|
] }),
|
|
@@ -2001,15 +2001,15 @@ function mt(e) {
|
|
|
2001
2001
|
}
|
|
2002
2002
|
);
|
|
2003
2003
|
} else {
|
|
2004
|
-
const S = m.pageId, k = m.pageComponentKey ?? S,
|
|
2004
|
+
const S = m.pageId, k = m.pageComponentKey ?? S, v = $e(n, { id: S, componentKey: k }), E = m.pageComponent || (k ? t[k] : null), D = S ? pn(n, { id: S }) : void 0;
|
|
2005
2005
|
return /* @__PURE__ */ h(
|
|
2006
2006
|
"div",
|
|
2007
2007
|
{
|
|
2008
|
-
className: `relative bg-white border transition-all ${p ? "border-blue-400 shadow-2xl scale-105" :
|
|
2008
|
+
className: `relative bg-white border transition-all ${p ? "border-blue-400 shadow-2xl scale-105" : P ? "border-gray-300 bg-gray-50" : "border-gray-200 hover:border-gray-300 hover:shadow-lg"}`,
|
|
2009
2009
|
style: { width: `${l}px`, height: `${f}px` },
|
|
2010
2010
|
title: m.pageId,
|
|
2011
2011
|
children: [
|
|
2012
|
-
|
|
2012
|
+
E ? /* @__PURE__ */ a(
|
|
2013
2013
|
"div",
|
|
2014
2014
|
{
|
|
2015
2015
|
className: "w-full h-full flex items-center justify-center bg-gray-50 overflow-hidden relative pointer-events-none",
|
|
@@ -2022,14 +2022,14 @@ function mt(e) {
|
|
|
2022
2022
|
transformOrigin: "center"
|
|
2023
2023
|
},
|
|
2024
2024
|
children: /* @__PURE__ */ a("div", { className: "!shrink-0", style: { width: `${u}px`, height: `${g}px`, backgroundColor: "white", pointerEvents: "none" }, children: /* @__PURE__ */ a(
|
|
2025
|
-
|
|
2025
|
+
E,
|
|
2026
2026
|
{
|
|
2027
2027
|
payload: n,
|
|
2028
2028
|
pageId: S,
|
|
2029
2029
|
templateId: k,
|
|
2030
|
-
pagePayload:
|
|
2030
|
+
pagePayload: v,
|
|
2031
2031
|
componentKey: k,
|
|
2032
|
-
integration:
|
|
2032
|
+
integration: D
|
|
2033
2033
|
}
|
|
2034
2034
|
) })
|
|
2035
2035
|
}
|
|
@@ -2042,7 +2042,7 @@ function mt(e) {
|
|
|
2042
2042
|
] }),
|
|
2043
2043
|
/* @__PURE__ */ a("div", { className: "text-xs text-gray-500 mt-1", children: S || "No preview" })
|
|
2044
2044
|
] }) }),
|
|
2045
|
-
|
|
2045
|
+
P && /* @__PURE__ */ h("div", { className: "absolute top-2 left-2 px-2 py-1 bg-gray-600/80 backdrop-blur-sm text-white text-xs font-medium rounded shadow-lg pointer-events-none flex items-center gap-1", children: [
|
|
2046
2046
|
/* @__PURE__ */ a(et, { className: "size-3" }),
|
|
2047
2047
|
/* @__PURE__ */ a("span", { children: w === "start" ? "Start" : "End" })
|
|
2048
2048
|
] }),
|
|
@@ -2066,50 +2066,50 @@ function or({
|
|
|
2066
2066
|
}) {
|
|
2067
2067
|
const [d, l] = I.useState(""), f = I.useMemo(() => {
|
|
2068
2068
|
if (!d.trim()) return n;
|
|
2069
|
-
const
|
|
2069
|
+
const v = d.toLowerCase();
|
|
2070
2070
|
return n.filter(
|
|
2071
|
-
(
|
|
2071
|
+
(E) => (E.label || "").toLowerCase().includes(v) || E.id.toLowerCase().includes(v)
|
|
2072
2072
|
);
|
|
2073
|
-
}, [n, d]), u = (
|
|
2074
|
-
t(!1), r(
|
|
2075
|
-
}, g = s.width || 210, m = s.height || 297, C = g / m, p = 200, w = Math.round(p / C),
|
|
2073
|
+
}, [n, d]), u = (v) => {
|
|
2074
|
+
t(!1), r(v);
|
|
2075
|
+
}, g = s.width || 210, m = s.height || 297, C = g / m, p = 200, w = Math.round(p / C), P = I.useMemo(() => i ? mt({
|
|
2076
2076
|
pageComponents: i,
|
|
2077
2077
|
payload: o,
|
|
2078
2078
|
setup: s,
|
|
2079
2079
|
thumbnailWidth: p,
|
|
2080
2080
|
thumbnailHeight: w
|
|
2081
|
-
}) : null, [i, o, s, p, w]), S = (
|
|
2082
|
-
if (!
|
|
2083
|
-
if (Array.isArray(
|
|
2081
|
+
}) : null, [i, o, s, p, w]), S = (v, E) => {
|
|
2082
|
+
if (!v) return [];
|
|
2083
|
+
if (Array.isArray(v)) return v;
|
|
2084
2084
|
try {
|
|
2085
|
-
const
|
|
2086
|
-
if (!Array.isArray(
|
|
2087
|
-
return console.error("[uhuu-components] pageComponentKeys function must return an array, got:", typeof
|
|
2088
|
-
const
|
|
2089
|
-
return
|
|
2090
|
-
} catch (
|
|
2091
|
-
return console.error("[uhuu-components] Error evaluating pageComponentKeys function:",
|
|
2092
|
-
}
|
|
2093
|
-
}, k = (
|
|
2094
|
-
if (
|
|
2095
|
-
const y =
|
|
2085
|
+
const D = v(E);
|
|
2086
|
+
if (!Array.isArray(D))
|
|
2087
|
+
return console.error("[uhuu-components] pageComponentKeys function must return an array, got:", typeof D), [];
|
|
2088
|
+
const T = D.filter((y) => typeof y == "string");
|
|
2089
|
+
return T.length !== D.length && console.warn("[uhuu-components] pageComponentKeys returned non-string values, filtering them out"), T;
|
|
2090
|
+
} catch (D) {
|
|
2091
|
+
return console.error("[uhuu-components] Error evaluating pageComponentKeys function:", D), [];
|
|
2092
|
+
}
|
|
2093
|
+
}, k = (v, E) => {
|
|
2094
|
+
if (v.kind === "group") {
|
|
2095
|
+
const y = v, x = { payload: o, item: void 0, parent: void 0 }, R = S(y.pageComponentKeys, x), A = R[0];
|
|
2096
2096
|
return {
|
|
2097
2097
|
kind: "group",
|
|
2098
|
-
id:
|
|
2099
|
-
label:
|
|
2098
|
+
id: v.id,
|
|
2099
|
+
label: v.label,
|
|
2100
2100
|
pageCount: R.length,
|
|
2101
|
-
firstPageId:
|
|
2102
|
-
firstPageComponentKey:
|
|
2101
|
+
firstPageId: A,
|
|
2102
|
+
firstPageComponentKey: A
|
|
2103
2103
|
};
|
|
2104
2104
|
}
|
|
2105
|
-
const
|
|
2105
|
+
const D = v, T = D.componentKey ?? D.id;
|
|
2106
2106
|
return {
|
|
2107
2107
|
kind: "page",
|
|
2108
|
-
id:
|
|
2109
|
-
pageId:
|
|
2110
|
-
pageComponentKey:
|
|
2111
|
-
pageLabel:
|
|
2112
|
-
pageNum:
|
|
2108
|
+
id: D.id,
|
|
2109
|
+
pageId: D.id,
|
|
2110
|
+
pageComponentKey: T,
|
|
2111
|
+
pageLabel: D.label,
|
|
2112
|
+
pageNum: E + 1
|
|
2113
2113
|
};
|
|
2114
2114
|
};
|
|
2115
2115
|
return /* @__PURE__ */ a(bn, { open: e, onOpenChange: t, children: /* @__PURE__ */ h(ct, { side: "bottom", className: "h-[90vh] p-0 gap-0 w-full max-w-none bg-gray-50", "data-uhuu-editor": !0, children: [
|
|
@@ -2127,7 +2127,7 @@ function or({
|
|
|
2127
2127
|
type: "text",
|
|
2128
2128
|
placeholder: "Filter…",
|
|
2129
2129
|
value: d,
|
|
2130
|
-
onChange: (
|
|
2130
|
+
onChange: (v) => l(v.target.value),
|
|
2131
2131
|
tabIndex: -1,
|
|
2132
2132
|
className: "w-24 bg-transparent border-0 focus:outline-none text-sm text-gray-600 placeholder:text-gray-400 focus:w-40 transition-all duration-150"
|
|
2133
2133
|
}
|
|
@@ -2138,26 +2138,26 @@ function or({
|
|
|
2138
2138
|
/* @__PURE__ */ a("div", { className: "w-16 h-16 bg-gray-100 rounded-full flex items-center justify-center mx-auto mb-4", children: /* @__PURE__ */ a(ye, { className: "w-8 h-8 text-gray-400" }) }),
|
|
2139
2139
|
/* @__PURE__ */ a("div", { className: "text-lg font-medium text-gray-900 mb-2", children: "No items available" }),
|
|
2140
2140
|
/* @__PURE__ */ a("p", { className: "text-gray-500 mb-4", children: d.trim() ? "No pages or groups match your search." : "All pages and groups have been added." })
|
|
2141
|
-
] }) : /* @__PURE__ */ a("div", { className: c, children: f.map((
|
|
2142
|
-
const
|
|
2141
|
+
] }) : /* @__PURE__ */ a("div", { className: c, children: f.map((v, E) => {
|
|
2142
|
+
const D = v.kind === "group", T = v.id, y = D ? v.label || `Group ${E + 1}` : v.label || `Page ${v.id}`, x = { payload: o, item: void 0, parent: void 0 }, R = D ? S(v.pageComponentKeys, x).length : 1;
|
|
2143
2143
|
return /* @__PURE__ */ h(
|
|
2144
2144
|
"div",
|
|
2145
2145
|
{
|
|
2146
|
-
onClick: () => u(
|
|
2146
|
+
onClick: () => u(v),
|
|
2147
2147
|
className: [
|
|
2148
2148
|
"relative w-full h-[280px] cursor-pointer transition-all group",
|
|
2149
|
-
!!!
|
|
2149
|
+
!!!P && "bg-white border-2 border-gray-200"
|
|
2150
2150
|
// compact + default, always base + addition if not default
|
|
2151
2151
|
].filter(Boolean).join(" "),
|
|
2152
2152
|
children: [
|
|
2153
|
-
/* @__PURE__ */ a("div", { className: "w-full h-full relative bg-gray-100 hover:bg-white", children:
|
|
2153
|
+
/* @__PURE__ */ a("div", { className: "w-full h-full relative bg-gray-100 hover:bg-white", children: v.thumbnail ? /* @__PURE__ */ a(
|
|
2154
2154
|
"img",
|
|
2155
2155
|
{
|
|
2156
|
-
src:
|
|
2156
|
+
src: v.thumbnail,
|
|
2157
2157
|
className: "w-full h-full object-contain pointer-events-none object-top border border-gray-200 p-4",
|
|
2158
2158
|
alt: y
|
|
2159
2159
|
}
|
|
2160
|
-
) :
|
|
2160
|
+
) : P ? /* @__PURE__ */ a("div", { className: "absolute inset-0 flex items-center pointer-events-none", children: P(k(v, E), E, !1) }) : /* @__PURE__ */ a(ue, { children: D ? /* @__PURE__ */ h("div", { className: "p-4", children: [
|
|
2161
2161
|
/* @__PURE__ */ a("div", { className: "w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-3", children: /* @__PURE__ */ a(ye, { className: "w-8 h-8 text-blue-600" }) }),
|
|
2162
2162
|
/* @__PURE__ */ a("div", { className: "text-sm font-medium text-gray-700", children: y }),
|
|
2163
2163
|
/* @__PURE__ */ h("div", { className: "text-xs text-gray-500 mt-1", children: [
|
|
@@ -2168,9 +2168,9 @@ function or({
|
|
|
2168
2168
|
] }) : /* @__PURE__ */ h("div", { className: "p-4", children: [
|
|
2169
2169
|
/* @__PURE__ */ a("div", { className: "w-16 h-16 bg-gray-100 rounded-full flex items-center justify-center mx-auto mb-3", children: /* @__PURE__ */ a(ye, { className: "w-8 h-8 text-gray-400" }) }),
|
|
2170
2170
|
/* @__PURE__ */ a("div", { className: "text-sm font-medium text-gray-700", children: y }),
|
|
2171
|
-
/* @__PURE__ */ a("div", { className: "text-xs text-gray-500 mt-1", children:
|
|
2171
|
+
/* @__PURE__ */ a("div", { className: "text-xs text-gray-500 mt-1", children: T })
|
|
2172
2172
|
] }) }) }),
|
|
2173
|
-
(!
|
|
2173
|
+
(!P || v?.thumbnail) && /* @__PURE__ */ h(ue, { children: [
|
|
2174
2174
|
/* @__PURE__ */ h("div", { className: "absolute top-2 right-2 px-2 py-1 bg-blue-600/80 backdrop-blur-sm text-white text-xs font-medium rounded shadow-lg pointer-events-none", children: [
|
|
2175
2175
|
"Group (",
|
|
2176
2176
|
R,
|
|
@@ -2178,12 +2178,12 @@ function or({
|
|
|
2178
2178
|
R === 1 ? "page" : "pages",
|
|
2179
2179
|
")"
|
|
2180
2180
|
] }),
|
|
2181
|
-
/* @__PURE__ */ a("div", { className: "absolute bottom-0 left-0 right-0 bg-black/40 backdrop-blur-sm p-3 pointer-events-none", "data-item-id":
|
|
2181
|
+
/* @__PURE__ */ a("div", { className: "absolute bottom-0 left-0 right-0 bg-black/40 backdrop-blur-sm p-3 pointer-events-none", "data-item-id": T, children: /* @__PURE__ */ a("div", { className: "flex items-center justify-between gap-2 text-white", children: /* @__PURE__ */ a("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ a("div", { className: "text-sm font-medium truncate", children: y }) }) }) })
|
|
2182
2182
|
] }),
|
|
2183
2183
|
/* @__PURE__ */ a("div", { className: "absolute top-3 left-3 w-8 h-8 bg-black rounded-full flex items-center justify-center shadow-lg opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none z-10", children: /* @__PURE__ */ a(ye, { className: "w-4 h-4 text-white" }) })
|
|
2184
2184
|
]
|
|
2185
2185
|
},
|
|
2186
|
-
|
|
2186
|
+
T
|
|
2187
2187
|
);
|
|
2188
2188
|
}) }) }) })
|
|
2189
2189
|
] }) });
|
|
@@ -2244,58 +2244,58 @@ function dr({
|
|
|
2244
2244
|
xe(() => {
|
|
2245
2245
|
C(e);
|
|
2246
2246
|
}, [e]);
|
|
2247
|
-
const [p, w] = J(null),
|
|
2247
|
+
const [p, w] = J(null), P = aa(
|
|
2248
2248
|
bt(ra),
|
|
2249
2249
|
bt(ia, {
|
|
2250
2250
|
coordinateGetter: ca
|
|
2251
2251
|
})
|
|
2252
|
-
), S = (
|
|
2253
|
-
const
|
|
2254
|
-
|
|
2255
|
-
}, k = (
|
|
2256
|
-
const { active:
|
|
2257
|
-
if (!y ||
|
|
2252
|
+
), S = (D) => {
|
|
2253
|
+
const T = m.find((y) => i(y) === D.active.id);
|
|
2254
|
+
T && u && u(T) || w(D.active.id);
|
|
2255
|
+
}, k = (D) => {
|
|
2256
|
+
const { active: T, over: y } = D;
|
|
2257
|
+
if (!y || T.id === y.id) {
|
|
2258
2258
|
w(null);
|
|
2259
2259
|
return;
|
|
2260
2260
|
}
|
|
2261
|
-
const
|
|
2262
|
-
if (
|
|
2261
|
+
const x = m.find((O) => i(O) === T.id), R = m.findIndex((O) => i(O) === T.id), A = m.findIndex((O) => i(O) === y.id);
|
|
2262
|
+
if (x && u && u(x)) {
|
|
2263
2263
|
w(null);
|
|
2264
2264
|
return;
|
|
2265
2265
|
}
|
|
2266
|
-
if (g && !g(
|
|
2266
|
+
if (g && !g(x, A, m)) {
|
|
2267
2267
|
w(null);
|
|
2268
2268
|
return;
|
|
2269
2269
|
}
|
|
2270
|
-
if (R !== -1 &&
|
|
2271
|
-
const O = ga(m, R,
|
|
2270
|
+
if (R !== -1 && A !== -1) {
|
|
2271
|
+
const O = ga(m, R, A);
|
|
2272
2272
|
C(O), t(O);
|
|
2273
2273
|
}
|
|
2274
2274
|
w(null);
|
|
2275
|
-
},
|
|
2275
|
+
}, v = m.find((D) => i(D) === p), E = v ? m.findIndex((D) => i(D) === p) : -1;
|
|
2276
2276
|
return /* @__PURE__ */ h("div", { className: `w-full ${s}`, children: [
|
|
2277
2277
|
c && /* @__PURE__ */ a("div", { className: "mb-6", children: c() }),
|
|
2278
2278
|
m.length === 0 && d ? d() : /* @__PURE__ */ a("div", { className: "mb-6", children: /* @__PURE__ */ h(
|
|
2279
2279
|
sa,
|
|
2280
2280
|
{
|
|
2281
|
-
sensors:
|
|
2281
|
+
sensors: P,
|
|
2282
2282
|
collisionDetection: oa,
|
|
2283
2283
|
onDragStart: S,
|
|
2284
2284
|
onDragEnd: k,
|
|
2285
2285
|
children: [
|
|
2286
|
-
/* @__PURE__ */ a(da, { items: m.map(i), strategy: ua, children: /* @__PURE__ */ a("div", { className: o, children: m.map((
|
|
2286
|
+
/* @__PURE__ */ a(da, { items: m.map(i), strategy: ua, children: /* @__PURE__ */ a("div", { className: o, children: m.map((D, T) => /* @__PURE__ */ a(
|
|
2287
2287
|
lr,
|
|
2288
2288
|
{
|
|
2289
|
-
item:
|
|
2290
|
-
index:
|
|
2289
|
+
item: D,
|
|
2290
|
+
index: T,
|
|
2291
2291
|
renderItem: n,
|
|
2292
2292
|
renderDragIndicator: r,
|
|
2293
2293
|
keyExtractor: i,
|
|
2294
|
-
disabled: u ? u(
|
|
2294
|
+
disabled: u ? u(D) : !1
|
|
2295
2295
|
},
|
|
2296
|
-
i(
|
|
2296
|
+
i(D)
|
|
2297
2297
|
)) }) }),
|
|
2298
|
-
/* @__PURE__ */ a(la, { children:
|
|
2298
|
+
/* @__PURE__ */ a(la, { children: v ? f ? /* @__PURE__ */ a("div", { className: "rotate-2 shadow-lg", children: f(v, E) }) : /* @__PURE__ */ a(cr, { item: v, index: E, renderItem: n }) : null })
|
|
2299
2299
|
]
|
|
2300
2300
|
}
|
|
2301
2301
|
) }),
|
|
@@ -2309,7 +2309,7 @@ function dr({
|
|
|
2309
2309
|
] }),
|
|
2310
2310
|
/* @__PURE__ */ h("div", { className: "text-xs text-gray-500 mt-1 break-all", children: [
|
|
2311
2311
|
"Order: ",
|
|
2312
|
-
m.map((
|
|
2312
|
+
m.map((D, T) => `${T + 1}:${i(D).slice(0, 3)}`).join(" → ")
|
|
2313
2313
|
] })
|
|
2314
2314
|
] })
|
|
2315
2315
|
] });
|
|
@@ -2386,28 +2386,28 @@ function mr({
|
|
|
2386
2386
|
g(y), C(!0);
|
|
2387
2387
|
}, w = () => {
|
|
2388
2388
|
r(u), C(!1), t(!1);
|
|
2389
|
-
},
|
|
2389
|
+
}, P = () => {
|
|
2390
2390
|
g(n), C(!1), t(!1);
|
|
2391
|
-
}, S = I.useMemo(() => (!i || typeof i != "function") && o ? mt({ pageComponents: o, payload: s, setup: c }) : null, [i, o, s, c]), k = (y,
|
|
2391
|
+
}, S = I.useMemo(() => (!i || typeof i != "function") && o ? mt({ pageComponents: o, payload: s, setup: c }) : null, [i, o, s, c]), k = (y, x, R) => i && typeof i == "function" ? i(y, x, R) : S ? S(y, x, R) : /* @__PURE__ */ a(gr, { page: y, index: x, isDragging: R }), v = () => /* @__PURE__ */ h("div", { className: "text-center py-20", children: [
|
|
2392
2392
|
/* @__PURE__ */ a("div", { className: "w-12 h-12 bg-gray-50 rounded-lg flex items-center justify-center mx-auto mb-3", children: /* @__PURE__ */ a(pt, { className: "w-6 h-6 text-gray-400" }) }),
|
|
2393
2393
|
/* @__PURE__ */ a("div", { className: "text-base font-medium text-gray-900 mb-1", children: "No pages found" }),
|
|
2394
2394
|
/* @__PURE__ */ a("p", { className: "text-sm text-gray-500", children: "Add some pages to get started with reordering." })
|
|
2395
|
-
] }),
|
|
2396
|
-
const
|
|
2397
|
-
return
|
|
2398
|
-
}, []),
|
|
2399
|
-
const
|
|
2400
|
-
if (
|
|
2395
|
+
] }), E = (y) => y.id, D = I.useCallback((y) => {
|
|
2396
|
+
const x = y.strictPosition;
|
|
2397
|
+
return x === "start" || x === "end";
|
|
2398
|
+
}, []), T = I.useCallback((y, x, R) => {
|
|
2399
|
+
const A = y.strictPosition;
|
|
2400
|
+
if (A === "start" || A === "end")
|
|
2401
2401
|
return !1;
|
|
2402
2402
|
let O = -1, j = R.length;
|
|
2403
2403
|
for (let H = 0; H < R.length; H++) {
|
|
2404
2404
|
const z = R[H].strictPosition;
|
|
2405
2405
|
z === "start" ? O = H : z === "end" && j === R.length && (j = H);
|
|
2406
2406
|
}
|
|
2407
|
-
return !(
|
|
2407
|
+
return !(x <= O || x >= j);
|
|
2408
2408
|
}, []);
|
|
2409
2409
|
return /* @__PURE__ */ a(bn, { open: e, onOpenChange: (y) => {
|
|
2410
|
-
y ||
|
|
2410
|
+
y || P();
|
|
2411
2411
|
}, children: /* @__PURE__ */ h(
|
|
2412
2412
|
ct,
|
|
2413
2413
|
{
|
|
@@ -2439,12 +2439,12 @@ function mr({
|
|
|
2439
2439
|
items: u,
|
|
2440
2440
|
onChange: p,
|
|
2441
2441
|
renderItem: k,
|
|
2442
|
-
keyExtractor:
|
|
2443
|
-
renderEmptyState:
|
|
2442
|
+
keyExtractor: E,
|
|
2443
|
+
renderEmptyState: v,
|
|
2444
2444
|
gridColsClass: f,
|
|
2445
2445
|
className: "pb-4",
|
|
2446
|
-
isItemDisabled:
|
|
2447
|
-
canDropAt:
|
|
2446
|
+
isItemDisabled: D,
|
|
2447
|
+
canDropAt: T
|
|
2448
2448
|
}
|
|
2449
2449
|
) }) }),
|
|
2450
2450
|
/* @__PURE__ */ h(xn, { className: "border-t border-gray-200 px-4 py-3 gap-3", children: [
|
|
@@ -2452,7 +2452,7 @@ function mr({
|
|
|
2452
2452
|
Q,
|
|
2453
2453
|
{
|
|
2454
2454
|
variant: "outline",
|
|
2455
|
-
onClick:
|
|
2455
|
+
onClick: P,
|
|
2456
2456
|
children: "Cancel"
|
|
2457
2457
|
}
|
|
2458
2458
|
),
|
|
@@ -2846,11 +2846,11 @@ function yr(e) {
|
|
|
2846
2846
|
w.current !== t && (w.current = t, m(t));
|
|
2847
2847
|
}
|
|
2848
2848
|
}, [t]);
|
|
2849
|
-
const
|
|
2849
|
+
const P = oe(ke), S = he((b) => {
|
|
2850
2850
|
m(b);
|
|
2851
2851
|
const M = dn(b, d);
|
|
2852
|
-
|
|
2853
|
-
}, [r, i, d,
|
|
2852
|
+
P?.mergePageEditorState && P.mergePageEditorState(b, d), i?.(M), r?.(b, M);
|
|
2853
|
+
}, [r, i, d, P]), k = ae(() => {
|
|
2854
2854
|
const b = /* @__PURE__ */ new Map();
|
|
2855
2855
|
return g.forEach((M) => {
|
|
2856
2856
|
const _ = M.templateId ?? M.id;
|
|
@@ -2859,14 +2859,14 @@ function yr(e) {
|
|
|
2859
2859
|
b.set(K, (b.get(K) ?? 0) + 1);
|
|
2860
2860
|
});
|
|
2861
2861
|
}), b;
|
|
2862
|
-
}, [g]),
|
|
2862
|
+
}, [g]), v = ae(() => n.filter((b) => {
|
|
2863
2863
|
if (b.kind === "page") {
|
|
2864
2864
|
const U = b, ee = U.templateId ?? U.id, ne = k.get(ee) ?? 0, ie = U.repeatable ?? !1, L = U.maxInstances ?? null;
|
|
2865
2865
|
return !(!ie && ne > 0 || L !== null && ne >= L);
|
|
2866
2866
|
}
|
|
2867
2867
|
const M = b, _ = M.templateId ?? M.id, B = k.get(_) ?? 0, K = M.repeatable ?? !1, G = M.maxInstances ?? null;
|
|
2868
2868
|
return !(!K && B > 0 || K && G !== null && B >= G);
|
|
2869
|
-
}), [n, k]),
|
|
2869
|
+
}), [n, k]), E = ae(() => be(g), [g]), D = he(async (b) => {
|
|
2870
2870
|
const M = (L) => L ? typeof L == "string" ? L : L.mode ?? "optional" : "none", _ = (L, F) => {
|
|
2871
2871
|
if (!L) return [];
|
|
2872
2872
|
if (Array.isArray(L)) return L;
|
|
@@ -2923,13 +2923,13 @@ function yr(e) {
|
|
|
2923
2923
|
}
|
|
2924
2924
|
if (ee === null) return;
|
|
2925
2925
|
const ne = ee ?? K;
|
|
2926
|
-
if (U !== void 0 &&
|
|
2926
|
+
if (U !== void 0 && P?.setIntegrationPayload) {
|
|
2927
2927
|
const L = ne.id;
|
|
2928
2928
|
G && console.debug("[usePageGroups] storing integration data", {
|
|
2929
2929
|
instanceId: L,
|
|
2930
2930
|
hasData: U != null,
|
|
2931
2931
|
dataKeys: U ? Object.keys(U) : []
|
|
2932
|
-
}),
|
|
2932
|
+
}), P.setIntegrationPayload(L, U);
|
|
2933
2933
|
}
|
|
2934
2934
|
S(((L, F) => {
|
|
2935
2935
|
const X = F.strictPosition;
|
|
@@ -2943,7 +2943,7 @@ function yr(e) {
|
|
|
2943
2943
|
pe === "start" ? le.push(me) : pe === "end" ? V.push(me) : ce.push(me);
|
|
2944
2944
|
}), [...le, ...ce, F, ...V];
|
|
2945
2945
|
})(g, ne));
|
|
2946
|
-
}, [g, S, l,
|
|
2946
|
+
}, [g, S, l, P]), T = he((b) => {
|
|
2947
2947
|
const M = (B) => {
|
|
2948
2948
|
f ? f(B) : alert(B);
|
|
2949
2949
|
}, _ = g.find((B) => B.id === b);
|
|
@@ -2952,9 +2952,9 @@ function yr(e) {
|
|
|
2952
2952
|
M("Cannot remove the last page. At least one page is required.");
|
|
2953
2953
|
return;
|
|
2954
2954
|
}
|
|
2955
|
-
if (
|
|
2955
|
+
if (P?.removeIntegrationPayload) {
|
|
2956
2956
|
const K = _.id;
|
|
2957
|
-
|
|
2957
|
+
P.payload?.integrations?.[K] !== void 0 && P.removeIntegrationPayload(K);
|
|
2958
2958
|
}
|
|
2959
2959
|
S(g.filter((K) => K.id !== b));
|
|
2960
2960
|
return;
|
|
@@ -2966,9 +2966,9 @@ function yr(e) {
|
|
|
2966
2966
|
return;
|
|
2967
2967
|
}
|
|
2968
2968
|
if (B.pages.length === 1) {
|
|
2969
|
-
if (
|
|
2969
|
+
if (P?.removeIntegrationPayload) {
|
|
2970
2970
|
const G = B.id;
|
|
2971
|
-
|
|
2971
|
+
P.payload?.integrations?.[G] !== void 0 && P.removeIntegrationPayload(G);
|
|
2972
2972
|
}
|
|
2973
2973
|
S(g.filter((G) => G.id !== B.id));
|
|
2974
2974
|
} else
|
|
@@ -2978,17 +2978,17 @@ function yr(e) {
|
|
|
2978
2978
|
} : G));
|
|
2979
2979
|
return;
|
|
2980
2980
|
}
|
|
2981
|
-
}, [g, f, S,
|
|
2981
|
+
}, [g, f, S, P]), y = he((b, M) => {
|
|
2982
2982
|
S(g.map((_) => _.id === b ? te(_) ? {
|
|
2983
2983
|
..._,
|
|
2984
2984
|
...M
|
|
2985
2985
|
} : { ..._, ...M } : _));
|
|
2986
|
-
}, [g, S]),
|
|
2986
|
+
}, [g, S]), x = he((b) => {
|
|
2987
2987
|
S(b);
|
|
2988
2988
|
}, [S]), R = ae(() => {
|
|
2989
2989
|
const b = Ga(g);
|
|
2990
2990
|
return u ? Va(b, u) : b;
|
|
2991
|
-
}, [g, u]),
|
|
2991
|
+
}, [g, u]), A = he((b) => {
|
|
2992
2992
|
const M = [];
|
|
2993
2993
|
return R.forEach((_) => {
|
|
2994
2994
|
te(_) ? (_.pages ?? []).forEach((K) => {
|
|
@@ -3016,16 +3016,16 @@ function yr(e) {
|
|
|
3016
3016
|
return {
|
|
3017
3017
|
items: g,
|
|
3018
3018
|
itemsWithPageNum: R,
|
|
3019
|
-
totalPageCount:
|
|
3020
|
-
availableItemsToAdd:
|
|
3021
|
-
addItem:
|
|
3022
|
-
removeItem:
|
|
3019
|
+
totalPageCount: E,
|
|
3020
|
+
availableItemsToAdd: v,
|
|
3021
|
+
addItem: D,
|
|
3022
|
+
removeItem: T,
|
|
3023
3023
|
updateItemFields: y,
|
|
3024
|
-
reorderItems:
|
|
3024
|
+
reorderItems: x,
|
|
3025
3025
|
addDialogOpen: C,
|
|
3026
3026
|
setAddDialogOpen: p,
|
|
3027
3027
|
openAddDialog: H,
|
|
3028
|
-
renderItems:
|
|
3028
|
+
renderItems: A,
|
|
3029
3029
|
itemsForReorder: O,
|
|
3030
3030
|
handleReorder: j,
|
|
3031
3031
|
defaultRenderThumbnail: z
|
|
@@ -3160,8 +3160,8 @@ const Lt = (e, t, n = !1, r) => {
|
|
|
3160
3160
|
});
|
|
3161
3161
|
const u = t.map((p) => {
|
|
3162
3162
|
if (typeof p == "string") {
|
|
3163
|
-
const
|
|
3164
|
-
return
|
|
3163
|
+
const P = d.get(p);
|
|
3164
|
+
return P ? zt(P, !0, s, i) : Lt(p, void 0, !0, i);
|
|
3165
3165
|
}
|
|
3166
3166
|
return p.pageComponentKeys !== void 0 ? zt(p, !0, s, i) : Lt(p, void 0, !0, i);
|
|
3167
3167
|
}), g = c.map((p) => ({
|
|
@@ -3359,18 +3359,18 @@ function Wt({
|
|
|
3359
3359
|
stateKey: C = Ne,
|
|
3360
3360
|
onItemsChange: p,
|
|
3361
3361
|
onStateChange: w,
|
|
3362
|
-
resolveNewItem:
|
|
3362
|
+
resolveNewItem: P,
|
|
3363
3363
|
pageFilter: S,
|
|
3364
3364
|
printConfigs: k
|
|
3365
3365
|
}) {
|
|
3366
|
-
const
|
|
3366
|
+
const v = i ?? { width: 210, height: 297 }, { interactive: E, setInteractive: D, enableDevTools: T } = it(), y = st(), [x, R] = J(null), [A, O] = J(null), [j, H] = J(void 0), z = x ?? S, b = ae(() => A ? { ...v, ...A } : v, [v, A]), M = oe(ke), _ = M?.payload ?? r, [B, K] = J(!1), G = b?.preview ?? "single_page", U = ae(
|
|
3367
3367
|
() => G === "two_pages" ? { ...b, preview: "single_page" } : b,
|
|
3368
3368
|
[G, b]
|
|
3369
|
-
), ee = ae(() => lt(e), [e]), ne = ae(() => o?.length ? o.map((
|
|
3370
|
-
|
|
3369
|
+
), ee = ae(() => lt(e), [e]), ne = ae(() => o?.length ? o.map((N) => "getValue" in N ? N : M?.setPageOptionValue ? ar(
|
|
3370
|
+
N,
|
|
3371
3371
|
M.payload,
|
|
3372
3372
|
M.setPageOptionValue
|
|
3373
|
-
) : ((Rr() ||
|
|
3373
|
+
) : ((Rr() || T) && console.warn(
|
|
3374
3374
|
"PageEditor: payload-backed pageOptions require TemplateDataProvider or payload/onPayloadChange."
|
|
3375
3375
|
), null)).filter(Boolean) : [], [o, M]), {
|
|
3376
3376
|
items: ie,
|
|
@@ -3391,73 +3391,73 @@ function Wt({
|
|
|
3391
3391
|
availableItems: t,
|
|
3392
3392
|
pageComponents: n,
|
|
3393
3393
|
payload: _,
|
|
3394
|
-
setup:
|
|
3394
|
+
setup: v,
|
|
3395
3395
|
stateKey: C,
|
|
3396
3396
|
onItemsChange: p,
|
|
3397
3397
|
onStateChange: w,
|
|
3398
|
-
resolveNewItem:
|
|
3398
|
+
resolveNewItem: P,
|
|
3399
3399
|
notifyError: s,
|
|
3400
3400
|
pageFilter: z
|
|
3401
3401
|
}), ft = I.useCallback(
|
|
3402
|
-
(
|
|
3402
|
+
(N, $, q) => {
|
|
3403
3403
|
if (!$) return;
|
|
3404
|
-
const Z =
|
|
3405
|
-
Z && V($.id, Z),
|
|
3404
|
+
const Z = N.applyPatch?.(q, $);
|
|
3405
|
+
Z && V($.id, Z), N.onChange?.($.id, q, {
|
|
3406
3406
|
item: $,
|
|
3407
3407
|
updateItem: (se) => V($.id, se)
|
|
3408
3408
|
});
|
|
3409
3409
|
},
|
|
3410
3410
|
[V]
|
|
3411
|
-
), $n = (
|
|
3411
|
+
), $n = (N) => /* @__PURE__ */ h("div", { className: "absolute bottom-[10mm] left-[15mm] right-[15mm] text-[7pt] text-gray-600 flex items-center justify-between pointer-events-none", children: [
|
|
3412
3412
|
/* @__PURE__ */ a("span", { children: "Page" }),
|
|
3413
3413
|
/* @__PURE__ */ h("span", { children: [
|
|
3414
|
-
|
|
3414
|
+
N.pageNo,
|
|
3415
3415
|
" / ",
|
|
3416
|
-
|
|
3416
|
+
N.total
|
|
3417
3417
|
] })
|
|
3418
|
-
] }), Mn = (
|
|
3418
|
+
] }), Mn = (N, $, q) => d ? d({ pageNo: N, total: F, pageId: $, parent: q }) : $n({ pageNo: N, total: F }), Ae = (N, $) => {
|
|
3419
3419
|
if (l)
|
|
3420
|
-
return l({ page:
|
|
3421
|
-
const q =
|
|
3420
|
+
return l({ page: N, parent: $ });
|
|
3421
|
+
const q = N.componentKey ?? N.id, Z = c ? c(N) : null, se = N.templateId ?? q, fe = n[q], Ee = M?.getPagePayload ? M.getPagePayload(N) : $e(_, { id: N.id, templateId: se, componentKey: q }), Kn = pn(
|
|
3422
3422
|
_,
|
|
3423
|
-
|
|
3423
|
+
N,
|
|
3424
3424
|
$
|
|
3425
3425
|
), Ln = vr({
|
|
3426
3426
|
payload: _,
|
|
3427
|
-
page:
|
|
3427
|
+
page: N,
|
|
3428
3428
|
parentGroup: $,
|
|
3429
3429
|
pagePayload: Ee
|
|
3430
3430
|
});
|
|
3431
3431
|
return /* @__PURE__ */ a(
|
|
3432
3432
|
pr,
|
|
3433
3433
|
{
|
|
3434
|
-
pageId:
|
|
3434
|
+
pageId: N.id,
|
|
3435
3435
|
templateId: se,
|
|
3436
|
-
pageNo:
|
|
3436
|
+
pageNo: N.pageNum,
|
|
3437
3437
|
component: fe,
|
|
3438
3438
|
payload: _,
|
|
3439
3439
|
pagePayload: Ee,
|
|
3440
3440
|
integration: Kn,
|
|
3441
|
-
page:
|
|
3441
|
+
page: N,
|
|
3442
3442
|
parentGroup: $,
|
|
3443
3443
|
componentKey: q,
|
|
3444
3444
|
setup: U,
|
|
3445
3445
|
reference: Z,
|
|
3446
|
-
overlay: ({ pageNo: zn }) => Mn(zn,
|
|
3447
|
-
className:
|
|
3446
|
+
overlay: ({ pageNo: zn }) => Mn(zn, N.id, $),
|
|
3447
|
+
className: N.className,
|
|
3448
3448
|
dataBinding: Ln
|
|
3449
3449
|
}
|
|
3450
3450
|
);
|
|
3451
|
-
}, Le = (
|
|
3452
|
-
const q = !!$ && te($), Z = q && $.pages[0]?.id ===
|
|
3451
|
+
}, Le = (N, $) => {
|
|
3452
|
+
const q = !!$ && te($), Z = q && $.pages[0]?.id === N.id;
|
|
3453
3453
|
return q && !Z ? /* @__PURE__ */ a("div", { className: "pl-0 pr-3 py-1.5 flex justify-between items-center h-10", children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
3454
|
-
/* @__PURE__ */ a("span", { className: "page-number", children:
|
|
3455
|
-
|
|
3454
|
+
/* @__PURE__ */ a("span", { className: "page-number", children: N.pageNum }),
|
|
3455
|
+
N.label && /* @__PURE__ */ a("span", { className: "text-xs text-gray-500", children: N.label }),
|
|
3456
3456
|
/* @__PURE__ */ a("span", { className: "text-xs text-gray-400", children: "·" })
|
|
3457
3457
|
] }) }) : /* @__PURE__ */ h("div", { className: "pl-0 py-1.5 flex justify-start gap-2 items-center", children: [
|
|
3458
3458
|
/* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
3459
|
-
/* @__PURE__ */ a("span", { className: "page-number", children:
|
|
3460
|
-
|
|
3459
|
+
/* @__PURE__ */ a("span", { className: "page-number", children: N.pageNum }),
|
|
3460
|
+
N.label && /* @__PURE__ */ a("span", { className: "text-xs text-gray-500", children: N.label }),
|
|
3461
3461
|
q && /* @__PURE__ */ a(
|
|
3462
3462
|
Se,
|
|
3463
3463
|
{
|
|
@@ -3480,7 +3480,7 @@ function Wt({
|
|
|
3480
3480
|
In,
|
|
3481
3481
|
{
|
|
3482
3482
|
pageOptions: ne,
|
|
3483
|
-
targetItem: q ? $ :
|
|
3483
|
+
targetItem: q ? $ : N,
|
|
3484
3484
|
onChange: ft,
|
|
3485
3485
|
onRemove: ce,
|
|
3486
3486
|
showRemove: F > 1,
|
|
@@ -3491,11 +3491,11 @@ function Wt({
|
|
|
3491
3491
|
] });
|
|
3492
3492
|
}, ht = ae(() => {
|
|
3493
3493
|
if (G !== "two_pages") return [];
|
|
3494
|
-
const
|
|
3494
|
+
const N = [];
|
|
3495
3495
|
for (const $ of L) {
|
|
3496
3496
|
const q = te($) ? $.pages ?? [] : [$];
|
|
3497
3497
|
for (const Z of q)
|
|
3498
|
-
Z?.id &&
|
|
3498
|
+
Z?.id && N.push({
|
|
3499
3499
|
...Z,
|
|
3500
3500
|
kind: "page",
|
|
3501
3501
|
id: Z.id,
|
|
@@ -3503,14 +3503,14 @@ function Wt({
|
|
|
3503
3503
|
parentGroup: te($) ? $ : void 0
|
|
3504
3504
|
});
|
|
3505
3505
|
}
|
|
3506
|
-
return
|
|
3506
|
+
return N.sort(($, q) => ($.pageNum ?? 0) - (q.pageNum ?? 0));
|
|
3507
3507
|
}, [G, L]), _n = ae(() => {
|
|
3508
3508
|
if (G !== "two_pages") return [];
|
|
3509
|
-
const
|
|
3510
|
-
if (!
|
|
3511
|
-
const $ = [{ left: void 0, right:
|
|
3512
|
-
for (let q = 1; q <
|
|
3513
|
-
const Z =
|
|
3509
|
+
const N = ht;
|
|
3510
|
+
if (!N.length) return [];
|
|
3511
|
+
const $ = [{ left: void 0, right: N[0], layout: "right" }];
|
|
3512
|
+
for (let q = 1; q < N.length; q += 2) {
|
|
3513
|
+
const Z = N[q], se = N[q + 1];
|
|
3514
3514
|
if (se)
|
|
3515
3515
|
$.push({ left: Z, right: se, layout: "spread" });
|
|
3516
3516
|
else {
|
|
@@ -3525,10 +3525,10 @@ function Wt({
|
|
|
3525
3525
|
return $;
|
|
3526
3526
|
}, [G, ht]);
|
|
3527
3527
|
return /* @__PURE__ */ h(ue, { children: [
|
|
3528
|
-
|
|
3528
|
+
T && !E && /* @__PURE__ */ h(
|
|
3529
3529
|
Q,
|
|
3530
3530
|
{
|
|
3531
|
-
onClick: () =>
|
|
3531
|
+
onClick: () => D(!0),
|
|
3532
3532
|
"data-uhuu-editor": !0,
|
|
3533
3533
|
size: "sm",
|
|
3534
3534
|
className: "screen-only fixed top-4 right-4 z-50 flex items-center gap-1.5 !text-xs rounded-full",
|
|
@@ -3551,21 +3551,21 @@ function Wt({
|
|
|
3551
3551
|
" ",
|
|
3552
3552
|
F === 1 ? "Page" : "Pages"
|
|
3553
3553
|
] }),
|
|
3554
|
-
|
|
3554
|
+
T && k && /* @__PURE__ */ a(
|
|
3555
3555
|
Sr,
|
|
3556
3556
|
{
|
|
3557
3557
|
modes: k,
|
|
3558
3558
|
selectedMode: j,
|
|
3559
|
-
onModeChange: (
|
|
3560
|
-
H(
|
|
3559
|
+
onModeChange: (N, $) => {
|
|
3560
|
+
H(N), R($.filter ?? null), O($.pageFormat ?? null);
|
|
3561
3561
|
},
|
|
3562
|
-
interactive:
|
|
3563
|
-
onInteractiveChange: (
|
|
3564
|
-
|
|
3562
|
+
interactive: E,
|
|
3563
|
+
onInteractiveChange: (N) => {
|
|
3564
|
+
D(N), N && O(null);
|
|
3565
3565
|
}
|
|
3566
3566
|
}
|
|
3567
3567
|
),
|
|
3568
|
-
|
|
3568
|
+
E && /* @__PURE__ */ h(ue, { children: [
|
|
3569
3569
|
/* @__PURE__ */ h(
|
|
3570
3570
|
Q,
|
|
3571
3571
|
{
|
|
@@ -3598,48 +3598,48 @@ function Wt({
|
|
|
3598
3598
|
] }),
|
|
3599
3599
|
onAddPage: De,
|
|
3600
3600
|
preview: G,
|
|
3601
|
-
children: G === "two_pages" ? _n.map((
|
|
3602
|
-
|
|
3601
|
+
children: G === "two_pages" ? _n.map((N, $) => /* @__PURE__ */ h(rr, { layout: N.layout, children: [
|
|
3602
|
+
N.left && /* @__PURE__ */ a(
|
|
3603
3603
|
Oe,
|
|
3604
3604
|
{
|
|
3605
|
-
title: `Sheet ${
|
|
3606
|
-
controls: Le(
|
|
3607
|
-
origin:
|
|
3608
|
-
children: Ae(
|
|
3605
|
+
title: `Sheet ${N.left.pageNum}`,
|
|
3606
|
+
controls: Le(N.left, N.left.parentGroup),
|
|
3607
|
+
origin: N.left.pageNum % 2 === 0 ? "right" : "left",
|
|
3608
|
+
children: Ae(N.left, N.left.parentGroup)
|
|
3609
3609
|
},
|
|
3610
|
-
|
|
3610
|
+
N.left.id
|
|
3611
3611
|
),
|
|
3612
|
-
|
|
3612
|
+
N.right && /* @__PURE__ */ a(
|
|
3613
3613
|
Oe,
|
|
3614
3614
|
{
|
|
3615
|
-
title: `Sheet ${
|
|
3616
|
-
controls: Le(
|
|
3617
|
-
origin:
|
|
3618
|
-
children: Ae(
|
|
3615
|
+
title: `Sheet ${N.right.pageNum}`,
|
|
3616
|
+
controls: Le(N.right, N.right.parentGroup),
|
|
3617
|
+
origin: N.right.pageNum % 2 === 0 ? "right" : "left",
|
|
3618
|
+
children: Ae(N.right, N.right.parentGroup)
|
|
3619
3619
|
},
|
|
3620
|
-
|
|
3620
|
+
N.right.id
|
|
3621
3621
|
)
|
|
3622
|
-
] }, `pair-${$}`)) : L.map((
|
|
3623
|
-
if (te(
|
|
3624
|
-
const q =
|
|
3622
|
+
] }, `pair-${$}`)) : L.map((N) => {
|
|
3623
|
+
if (te(N)) {
|
|
3624
|
+
const q = N.pages ?? [];
|
|
3625
3625
|
return /* @__PURE__ */ a(
|
|
3626
3626
|
hr,
|
|
3627
3627
|
{
|
|
3628
|
-
group:
|
|
3628
|
+
group: N,
|
|
3629
3629
|
pagesWithPageNum: q,
|
|
3630
3630
|
onRemove: ce,
|
|
3631
3631
|
onLabelChange: (Z, se) => {
|
|
3632
3632
|
V(Z, { label: se || void 0 });
|
|
3633
3633
|
},
|
|
3634
3634
|
totalItems: ie.length,
|
|
3635
|
-
renderPage: (Z) => Ae(Z,
|
|
3635
|
+
renderPage: (Z) => Ae(Z, N),
|
|
3636
3636
|
pageOptions: ne,
|
|
3637
3637
|
onPageOptionChange: (Z, se, fe) => ft(Z, se, fe)
|
|
3638
3638
|
},
|
|
3639
|
-
|
|
3639
|
+
N.id
|
|
3640
3640
|
);
|
|
3641
3641
|
}
|
|
3642
|
-
const $ =
|
|
3642
|
+
const $ = N;
|
|
3643
3643
|
return /* @__PURE__ */ a(
|
|
3644
3644
|
Oe,
|
|
3645
3645
|
{
|
|
@@ -3652,7 +3652,7 @@ function Wt({
|
|
|
3652
3652
|
})
|
|
3653
3653
|
}
|
|
3654
3654
|
),
|
|
3655
|
-
|
|
3655
|
+
E && !y && /* @__PURE__ */ h(ue, { children: [
|
|
3656
3656
|
/* @__PURE__ */ a(
|
|
3657
3657
|
or,
|
|
3658
3658
|
{
|
|
@@ -3662,7 +3662,7 @@ function Wt({
|
|
|
3662
3662
|
onSelectItem: le,
|
|
3663
3663
|
pageComponents: n,
|
|
3664
3664
|
payload: _,
|
|
3665
|
-
setup:
|
|
3665
|
+
setup: v,
|
|
3666
3666
|
gridColsClass: u,
|
|
3667
3667
|
"data-uhuu-editor": !0
|
|
3668
3668
|
}
|
|
@@ -3673,12 +3673,12 @@ function Wt({
|
|
|
3673
3673
|
open: B,
|
|
3674
3674
|
onOpenChange: K,
|
|
3675
3675
|
pages: Tn,
|
|
3676
|
-
onReorder: (
|
|
3677
|
-
On(
|
|
3676
|
+
onReorder: (N) => {
|
|
3677
|
+
On(N), K(!1);
|
|
3678
3678
|
},
|
|
3679
3679
|
pageComponents: n,
|
|
3680
3680
|
payload: _,
|
|
3681
|
-
setup:
|
|
3681
|
+
setup: v,
|
|
3682
3682
|
renderThumbnail: jn,
|
|
3683
3683
|
title: g,
|
|
3684
3684
|
description: m,
|
|
@@ -3716,38 +3716,38 @@ function Dr(e) {
|
|
|
3716
3716
|
), d = I.useMemo(() => {
|
|
3717
3717
|
if (!c?.items)
|
|
3718
3718
|
return r.initialItems;
|
|
3719
|
-
const l = e.templateConfig.groups ?? {}, f = Array.isArray(l) ? l : Object.entries(l).map(([
|
|
3720
|
-
if (
|
|
3721
|
-
const S =
|
|
3722
|
-
if (!k || typeof k.pageComponentKeys != "function") return
|
|
3719
|
+
const l = e.templateConfig.groups ?? {}, f = Array.isArray(l) ? l : Object.entries(l).map(([P, S]) => ({ id: P, ...S })), u = new Map(f.map((P) => [P.id, P])), g = e.templateConfig.pages ?? {}, m = c.items.map((P) => {
|
|
3720
|
+
if (P.kind !== "group") return P;
|
|
3721
|
+
const S = P.templateId ?? P.id, k = u.get(S), v = k?.strictPosition !== void 0 && !P.strictPosition ? { ...P, strictPosition: k.strictPosition } : P;
|
|
3722
|
+
if (!k || typeof k.pageComponentKeys != "function") return v;
|
|
3723
3723
|
try {
|
|
3724
|
-
const
|
|
3725
|
-
return Array.isArray(
|
|
3726
|
-
...
|
|
3724
|
+
const E = k.pageComponentKeys({ payload: n, item: void 0, parent: void 0 });
|
|
3725
|
+
return Array.isArray(E) ? E.length === 0 ? {
|
|
3726
|
+
...v,
|
|
3727
3727
|
pages: []
|
|
3728
3728
|
} : {
|
|
3729
|
-
...
|
|
3730
|
-
pages:
|
|
3731
|
-
const
|
|
3729
|
+
...v,
|
|
3730
|
+
pages: E.map((D, T) => {
|
|
3731
|
+
const y = g[D]?.dataKey;
|
|
3732
3732
|
return {
|
|
3733
|
-
id: `${
|
|
3734
|
-
componentKey:
|
|
3735
|
-
templateId:
|
|
3736
|
-
...
|
|
3733
|
+
id: `${v.id}__${y ?? D}__${T}`,
|
|
3734
|
+
componentKey: D,
|
|
3735
|
+
templateId: D,
|
|
3736
|
+
...y ? { dataKey: y } : {}
|
|
3737
3737
|
};
|
|
3738
3738
|
})
|
|
3739
|
-
} : (console.error(`[PageEditor] pageComponentKeys for group ${
|
|
3740
|
-
} catch (
|
|
3741
|
-
return console.error(`[PageEditor] Error evaluating pageComponentKeys for group ${
|
|
3739
|
+
} : (console.error(`[PageEditor] pageComponentKeys for group ${v.id} must return an array, got:`, typeof E), v);
|
|
3740
|
+
} catch (E) {
|
|
3741
|
+
return console.error(`[PageEditor] Error evaluating pageComponentKeys for group ${v.id}:`, E), v;
|
|
3742
3742
|
}
|
|
3743
|
-
}), C = new Set(r.initialItems.map((
|
|
3743
|
+
}), C = new Set(r.initialItems.map((P) => P.id)), p = be(m.filter((P) => C.has(P.id))), w = be(r.initialItems);
|
|
3744
3744
|
if (p !== w) {
|
|
3745
|
-
const
|
|
3745
|
+
const P = m.filter((S) => {
|
|
3746
3746
|
if (S.kind !== "group") return !C.has(S.id);
|
|
3747
3747
|
const k = S.templateId ?? S.id;
|
|
3748
3748
|
return S.id !== k && !C.has(S.id);
|
|
3749
3749
|
});
|
|
3750
|
-
return
|
|
3750
|
+
return P.length > 0 ? [...r.initialItems, ...P] : r.initialItems;
|
|
3751
3751
|
}
|
|
3752
3752
|
return m;
|
|
3753
3753
|
}, [c?.items, r.initialItems, n, e.templateConfig.groups]);
|