@bravostudioai/react 0.1.30 → 0.1.32
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/cli/commands/generate.js +69 -65
- package/dist/cli/commands/generate.js.map +1 -1
- package/dist/codegen/generator.js.map +1 -1
- package/dist/codegen/parser.js +256 -593
- package/dist/codegen/parser.js.map +1 -1
- package/dist/codegen/propQualification.js +117 -0
- package/dist/codegen/propQualification.js.map +1 -0
- package/dist/components/DynamicComponent.js.map +1 -1
- package/dist/components/EncoreApp.js +142 -275
- package/dist/components/EncoreApp.js.map +1 -1
- package/dist/components/EncoreContextProviders.js +24 -0
- package/dist/components/EncoreContextProviders.js.map +1 -0
- package/dist/components.js +179 -174
- package/dist/components.js.map +1 -1
- package/dist/hooks/useFontLoader.js +41 -0
- package/dist/hooks/useFontLoader.js.map +1 -0
- package/dist/hooks/usePusherUpdates.js +41 -45
- package/dist/hooks/usePusherUpdates.js.map +1 -1
- package/dist/hooks/useRepeatingContainers.js +79 -0
- package/dist/hooks/useRepeatingContainers.js.map +1 -0
- package/dist/index.js +13 -14
- package/dist/index.js.map +1 -1
- package/dist/lib/dataPatching.js +24 -0
- package/dist/lib/dataPatching.js.map +1 -0
- package/dist/lib/dynamicModules.js +44 -45
- package/dist/lib/dynamicModules.js.map +1 -1
- package/dist/lib/fetcher.js +6 -13
- package/dist/lib/fetcher.js.map +1 -1
- package/dist/lib/logger.js +35 -0
- package/dist/lib/logger.js.map +1 -0
- package/dist/lib/moduleRegistry.js +9 -8
- package/dist/lib/moduleRegistry.js.map +1 -1
- package/dist/src/cli/commands/generate.d.ts.map +1 -1
- package/dist/src/codegen/generator.d.ts +74 -0
- package/dist/src/codegen/generator.d.ts.map +1 -1
- package/dist/src/codegen/parser.d.ts +39 -0
- package/dist/src/codegen/parser.d.ts.map +1 -1
- package/dist/src/codegen/propQualification.d.ts +42 -0
- package/dist/src/codegen/propQualification.d.ts.map +1 -0
- package/dist/src/components/DynamicComponent.d.ts +1 -1
- package/dist/src/components/DynamicComponent.d.ts.map +1 -1
- package/dist/src/components/EncoreApp.d.ts +55 -2
- package/dist/src/components/EncoreApp.d.ts.map +1 -1
- package/dist/src/components/EncoreContextProviders.d.ts +34 -0
- package/dist/src/components/EncoreContextProviders.d.ts.map +1 -0
- package/dist/src/components.d.ts.map +1 -1
- package/dist/src/hooks/useFontLoader.d.ts +17 -0
- package/dist/src/hooks/useFontLoader.d.ts.map +1 -0
- package/dist/src/hooks/usePusherUpdates.d.ts.map +1 -1
- package/dist/src/hooks/useRepeatingContainers.d.ts +31 -0
- package/dist/src/hooks/useRepeatingContainers.d.ts.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/lib/dataPatching.d.ts +18 -0
- package/dist/src/lib/dataPatching.d.ts.map +1 -0
- package/dist/src/lib/dynamicModules.d.ts.map +1 -1
- package/dist/src/lib/fetcher.d.ts.map +1 -1
- package/dist/src/lib/logger.d.ts +33 -0
- package/dist/src/lib/logger.d.ts.map +1 -0
- package/dist/src/lib/moduleRegistry.d.ts.map +1 -1
- package/dist/src/stores/useEncoreState.d.ts +43 -1
- package/dist/src/stores/useEncoreState.d.ts.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/stores/useEncoreState.js.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +1 -1
- package/src/cli/commands/generate.ts +7 -2
- package/src/components/DynamicComponent.tsx +1 -1
- package/src/components.tsx +6 -1
- package/src/hooks/useRepeatingContainers.ts +1 -1
- package/src/version.ts +1 -1
package/dist/components.js
CHANGED
|
@@ -10,7 +10,7 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
10
10
|
{}
|
|
11
11
|
), st = (t) => t.replace(/#(\w{2})(\w{6})/, "#$2$1"), Gt = (t) => t.slice(1, 3) === "00", jt = (t) => {
|
|
12
12
|
if (!Array.isArray(t)) return null;
|
|
13
|
-
const r = t.find((
|
|
13
|
+
const r = t.find((n) => n.startsWith("input-group:"));
|
|
14
14
|
if (!r) return null;
|
|
15
15
|
const e = r.split(":");
|
|
16
16
|
return e.length >= 3 ? { type: e[1], groupName: e[2] } : null;
|
|
@@ -18,55 +18,55 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
18
18
|
const [t, r] = Vt({ width: 0, height: 0 }), e = x.useRef(null);
|
|
19
19
|
return x.useEffect(() => {
|
|
20
20
|
if (!e.current) return;
|
|
21
|
-
const
|
|
22
|
-
const { width:
|
|
23
|
-
r({ width:
|
|
21
|
+
const n = e.current, i = () => {
|
|
22
|
+
const { width: o, height: m } = n.getBoundingClientRect();
|
|
23
|
+
r({ width: o, height: m });
|
|
24
24
|
};
|
|
25
25
|
i(), requestAnimationFrame(() => {
|
|
26
26
|
i();
|
|
27
27
|
});
|
|
28
|
-
const l = new ResizeObserver((
|
|
29
|
-
for (const m of
|
|
28
|
+
const l = new ResizeObserver((o) => {
|
|
29
|
+
for (const m of o) {
|
|
30
30
|
const a = m.contentRect;
|
|
31
31
|
r({ width: a.width, height: a.height });
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
|
-
return l.observe(
|
|
34
|
+
return l.observe(n), () => l.disconnect();
|
|
35
35
|
}, []), { dimensions: t, ref: e };
|
|
36
36
|
}, L = (t, r = {}) => {
|
|
37
|
-
const e = N(ct),
|
|
37
|
+
const e = N(ct), n = N(V), i = {
|
|
38
38
|
width: window.innerWidth,
|
|
39
39
|
height: window.innerHeight
|
|
40
40
|
}, l = Nt(
|
|
41
|
-
(s) => (
|
|
42
|
-
[
|
|
43
|
-
),
|
|
41
|
+
(s) => (n.dimensions?.width ?? 0) * 0.01 * s,
|
|
42
|
+
[n.dimensions?.width]
|
|
43
|
+
), o = {};
|
|
44
44
|
r = { debug: !1, ...r };
|
|
45
45
|
const m = k((s) => s.fontsById || {});
|
|
46
46
|
if (k((s) => s.fontsByIdFull || {}), !t || !t) return;
|
|
47
|
-
const a =
|
|
48
|
-
if (t.layout?.layoutSizingHorizontal || t.layout?.layoutSizingVertical || (t.width && a > 0 && (
|
|
47
|
+
const a = n.dimensions?.width ?? i.width, y = n.dimensions?.height ?? i.height;
|
|
48
|
+
if (t.layout?.layoutSizingHorizontal || t.layout?.layoutSizingVertical || (t.width && a > 0 && (o.width = t.width * a * 0.01), t.aspectRatio && t.width ? a > 0 && (o.height = t.width * a * 0.01 / t.aspectRatio) : t.height && y > 0 && (o.height = t.height * y * 0.01)), !(n?.isFlex ?? !1) && t.positioning) {
|
|
49
49
|
const s = t.layout?.layoutSizingHorizontal === "FIXED" || t.layout?.layoutSizingVertical === "FIXED", u = s && t.positioning.top < 0 ? 0 : t.positioning.top, R = s && t.positioning.left < 0 ? 0 : t.positioning.left;
|
|
50
50
|
let w = !1;
|
|
51
|
-
t.horizontalPosition === "center" && (w = !0),
|
|
51
|
+
t.horizontalPosition === "center" && (w = !0), o.top = `${u}%`;
|
|
52
52
|
const S = !!t.inset;
|
|
53
53
|
if (w) {
|
|
54
54
|
if (S) {
|
|
55
55
|
const W = String(t.inset).split(/\s+/);
|
|
56
|
-
W.length === 3 ?
|
|
56
|
+
W.length === 3 ? o.inset = `${W[0]} 50% ${W[2]} auto` : W.length === 4 && (o.inset = `${W[0]} 50% ${W[2]} auto`), delete o.left, delete o.right;
|
|
57
57
|
} else
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
o.left = "50%", o.right = "auto";
|
|
59
|
+
o.transform = "translateX(-50%)";
|
|
60
60
|
} else
|
|
61
|
-
S ?
|
|
62
|
-
s ? (
|
|
61
|
+
S ? o.inset = t.inset : o.left = `${R}%`;
|
|
62
|
+
s ? (o.right = "auto", o.bottom = "auto") : (t.positioning.bottom !== void 0 && (o.bottom = `${t.positioning.bottom}%`), t.positioning.right !== void 0 && (o.right = `${t.positioning.right}%`)), o.position = "absolute";
|
|
63
63
|
}
|
|
64
64
|
if (t.layout?.padding) {
|
|
65
65
|
const s = e.scaleFactor ?? 1, u = t.layout.padding;
|
|
66
|
-
u.top !== void 0 && (
|
|
66
|
+
u.top !== void 0 && (o.paddingTop = u.top * s), u.right !== void 0 && (o.paddingRight = u.right * s), u.bottom !== void 0 && (o.paddingBottom = u.bottom * s), u.left !== void 0 && (o.paddingLeft = u.left * s);
|
|
67
67
|
}
|
|
68
68
|
if (t.layout?.mode) {
|
|
69
|
-
|
|
69
|
+
o.display = "flex";
|
|
70
70
|
const s = (W) => W ? {
|
|
71
71
|
MIN: "flex-start",
|
|
72
72
|
MAX: "flex-end",
|
|
@@ -75,18 +75,18 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
75
75
|
SPACE_AROUND: "space-around",
|
|
76
76
|
SPACE_EVENLY: "space-evenly"
|
|
77
77
|
}[W] || W.toLowerCase().replace(/_/g, "-") : void 0;
|
|
78
|
-
t.layout.mode == "HORIZONTAL" ? (
|
|
78
|
+
t.layout.mode == "HORIZONTAL" ? (o.flexDirection = "row", t.layout.flexWrap && (o.flexWrap = t.layout.flexWrap), o.justifyContent = s(
|
|
79
79
|
t.layout.primaryAxisAlignItems
|
|
80
|
-
),
|
|
80
|
+
), o.alignItems = t.layout.counterAxisAlignItems) : (o.flexDirection = "column", o.justifyContent = s(
|
|
81
81
|
t.layout.primaryAxisAlignItems
|
|
82
|
-
),
|
|
82
|
+
), o.alignItems = t.layout.counterAxisAlignItems), o.flexGrow = t.layout.grow, t.layout.wrap === "WRAP" || t.layout.flexWrap === "wrap" ? o.flexWrap = "wrap" : t.layout.flexWrap ? o.flexWrap = t.layout.flexWrap : o.flexWrap = "nowrap";
|
|
83
83
|
const u = t.layout.itemSpacing, R = e.scaleFactor ?? 1, S = t.layout.primaryAxisAlignItems === "SPACE_BETWEEN" ? 0 : (u !== void 0 ? u : 0) * R;
|
|
84
|
-
|
|
84
|
+
o.gap = S === 0 ? "0px" : `${S}px`, o.rowGap = S === 0 ? "0px" : `${S}px`, o.columnGap = S === 0 ? "0px" : `${S}px`, (o.flexWrap === "wrap" || o.flexWrap === "wrap-reverse") && (o.alignContent = "flex-start"), r.debug || t.layout?.mode === "HORIZONTAL" && u === 0 ? console.log("[useEncoreStyle] Setting gap properties:", {
|
|
85
85
|
itemSpacing: u,
|
|
86
86
|
spacing: S,
|
|
87
|
-
gap:
|
|
88
|
-
rowGap:
|
|
89
|
-
columnGap:
|
|
87
|
+
gap: o.gap,
|
|
88
|
+
rowGap: o.rowGap,
|
|
89
|
+
columnGap: o.columnGap,
|
|
90
90
|
hasLayout: !!t.layout,
|
|
91
91
|
layoutMode: t.layout?.mode
|
|
92
92
|
}) : console.log(
|
|
@@ -96,36 +96,36 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
96
96
|
u
|
|
97
97
|
);
|
|
98
98
|
}
|
|
99
|
-
if (t.layout?.layoutSizingHorizontal === "FILL" && (
|
|
99
|
+
if (t.layout?.layoutSizingHorizontal === "FILL" && (o.width = "100%"), t.layout?.layoutSizingHorizontal === "FIXED") {
|
|
100
100
|
const s = e.scaleFactor ?? 1;
|
|
101
|
-
|
|
101
|
+
o.width = t.layout.size.x * s;
|
|
102
102
|
}
|
|
103
103
|
if (t.layout?.layoutSizingHorizontal, t.layout?.layoutSizingVertical === "FIXED") {
|
|
104
104
|
const s = e.scaleFactor ?? 1;
|
|
105
|
-
|
|
105
|
+
o.height = t.layout.size.y * s;
|
|
106
106
|
}
|
|
107
107
|
if (t.layout?.layoutSizingVertical === "FILL")
|
|
108
|
-
if (!(
|
|
108
|
+
if (!(n?.isFlex ?? !1) && t.positioning && t.positioning?.top !== void 0) {
|
|
109
109
|
const w = 100 - t.positioning.top;
|
|
110
|
-
|
|
110
|
+
o.height = `${w}%`;
|
|
111
111
|
} else
|
|
112
|
-
|
|
113
|
-
if (t.layout?.layoutSizingVertical, t.backgroundColor && !Gt(t.backgroundColor) && (
|
|
112
|
+
o.height = "100%";
|
|
113
|
+
if (t.layout?.layoutSizingVertical, t.backgroundColor && !Gt(t.backgroundColor) && (o.backgroundColor = st(t.backgroundColor)), t.color && (o.color = st(t.color)), t.lineHeightPx && (o.lineHeight = (t.lineHeightPx * (e.scaleFactor ?? 1)).toString() + "px"), t.fontSize && (o.fontSize = t.fontSize * (e.scaleFactor ?? 1)), t.fontWeight && (o.fontWeight = `${t.fontWeight}`), t.opacity && (o.opacity = t.opacity * 0.01), t.fontId) {
|
|
114
114
|
const s = m[t.fontId] || "sans-serif";
|
|
115
|
-
|
|
115
|
+
o.fontFamily = `"${s}"`, console.log("[AG_DEBUG] [useEncoreStyle] Font Resolution:", {
|
|
116
116
|
fontId: t.fontId,
|
|
117
117
|
resolvedFamily: s,
|
|
118
118
|
fontWeight: t.fontWeight,
|
|
119
|
-
finalStyle:
|
|
119
|
+
finalStyle: o.fontFamily
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
|
-
if (t.borderRadius && (
|
|
122
|
+
if (t.borderRadius && (o.borderRadius = l(t.borderRadius)), t.cornerRadii) {
|
|
123
123
|
const s = t.cornerRadii.map(l);
|
|
124
|
-
|
|
124
|
+
o.borderTopLeftRadius = s[0], o.borderTopRightRadius = s[1], o.borderBottomRightRadius = s[2], o.borderBottomLeftRadius = s[3], delete o.borderRadius;
|
|
125
125
|
}
|
|
126
|
-
return t.borderWidth && (t.borderWidth > 5 ?
|
|
126
|
+
return t.borderWidth && (t.borderWidth > 5 ? o.borderWidth = t.borderWidth * 0.5 : o.borderWidth = t.borderWidth * 1.5), t.borderColor && (o.borderColor = st(t.borderColor)), (t.borderWidth || t.borderColor) && (o.borderStyle = "solid"), t.rotation && (o.transform = `rotate(${t.rotation}deg)`), t.textCase === "upper" && (o.textTransform = "uppercase"), t.textCase === "lower" && (o.textTransform = "lowercase"), t.letterSpacing && (o.letterSpacing = t.letterSpacing), t.textAlign && (o.textAlign = t.textAlign), r.debug && (o.borderWidth = 1, o.borderColor = "#FF0000FF", o.borderStyle = "solid"), o;
|
|
127
127
|
}, et = ({ id: t, nodeData: r }) => {
|
|
128
|
-
const e = N(tt),
|
|
128
|
+
const e = N(tt), n = e?.nodeData?.[t], { patch: i, list: l } = n ?? { list: null, patch: null }, m = Array.isArray(r?.tags) && (r.tags.includes("encore:data:array") || r.tags.includes("bravo:data:array")) && e?.arrayDataById && e.arrayDataById[t] && Array.isArray(e.arrayDataById[t]) ? e.arrayDataById[t] : null;
|
|
129
129
|
let a = i ? {
|
|
130
130
|
...r,
|
|
131
131
|
...i || {},
|
|
@@ -190,15 +190,15 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
190
190
|
id: t,
|
|
191
191
|
nodeData: r,
|
|
192
192
|
children: e,
|
|
193
|
-
_parentStatefulSetId:
|
|
193
|
+
_parentStatefulSetId: n,
|
|
194
194
|
_parentInputGroupInfo: i,
|
|
195
195
|
_parentName: l
|
|
196
196
|
}) => {
|
|
197
|
-
const
|
|
197
|
+
const o = k((h) => h.baseURL), m = k((h) => h.appId);
|
|
198
198
|
k((h) => h.pageId);
|
|
199
199
|
const { onAction: a } = x.useContext(ft), { statefulSetId: y } = x.useContext(
|
|
200
200
|
lt
|
|
201
|
-
), v =
|
|
201
|
+
), v = n || y, { patchedNodeData: f } = et({ id: t, nodeData: r }), s = k(
|
|
202
202
|
(h) => h.setStatefulSetVariant
|
|
203
203
|
), u = k(
|
|
204
204
|
(h) => h.setInputGroupValue
|
|
@@ -254,7 +254,7 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
254
254
|
window.location.href = `tel:${h.params.phone}`;
|
|
255
255
|
break;
|
|
256
256
|
case "remote":
|
|
257
|
-
const O = btoa(JSON.stringify(h.params?.data || {})), j = `${
|
|
257
|
+
const O = btoa(JSON.stringify(h.params?.data || {})), j = `${o}/devices/apps/${m}/node/${t}/trigger/${h.event}?params=${O}`, K = await Ot.post(j);
|
|
258
258
|
K.data?.action && await W(K.data);
|
|
259
259
|
break;
|
|
260
260
|
case "set-access-token":
|
|
@@ -388,7 +388,7 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
388
388
|
}
|
|
389
389
|
return e;
|
|
390
390
|
}, ht = ({ id: t, name: r, nodeData: e }) => {
|
|
391
|
-
const
|
|
391
|
+
const n = L(e.style, {
|
|
392
392
|
debug: !1
|
|
393
393
|
});
|
|
394
394
|
return /* @__PURE__ */ p(
|
|
@@ -397,52 +397,52 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
397
397
|
"data-id": t,
|
|
398
398
|
"data-name": r,
|
|
399
399
|
"data-type": "WebViewComponent",
|
|
400
|
-
style: { border: "none", ...
|
|
400
|
+
style: { border: "none", ...n },
|
|
401
401
|
src: e.data?.params?.url
|
|
402
402
|
}
|
|
403
403
|
);
|
|
404
404
|
}, gt = ({ id: t, name: r, nodeData: e }) => {
|
|
405
|
-
const
|
|
405
|
+
const n = L(e.style, {
|
|
406
406
|
debug: !1
|
|
407
407
|
});
|
|
408
|
-
if (!
|
|
408
|
+
if (!n.backgroundColor && !n.borderColor)
|
|
409
409
|
return null;
|
|
410
|
-
if (
|
|
411
|
-
const v = Math.max(
|
|
412
|
-
(!
|
|
410
|
+
if (n.borderColor && !n.backgroundColor && (n.backgroundColor = "transparent"), n.borderColor && n.borderWidth) {
|
|
411
|
+
const v = Math.max(n.borderWidth || 0, 1);
|
|
412
|
+
(!n.width || typeof n.width == "number" && n.width === 0) && (n.width = v), (!n.height || typeof n.height == "number" && n.height === 0) && (n.height = v), n.boxSizing = "border-box";
|
|
413
413
|
}
|
|
414
|
-
const i = Array.isArray(e.tags) && e.tags.includes("bravo:layer"), l = N(V)?.isFlex ?? !1,
|
|
415
|
-
return a && (
|
|
414
|
+
const i = Array.isArray(e.tags) && e.tags.includes("bravo:layer"), l = N(V)?.isFlex ?? !1, o = e.style?.positioning, m = o && typeof o.top == "number" && typeof o.left == "number" && typeof o.right == "number" && typeof o.bottom == "number" && o.top === 0 && o.left === 0 && o.right === 0 && o.bottom === 0, a = i && (l || m), y = r && r.toLowerCase().startsWith("clip");
|
|
415
|
+
return a && (n.position = "absolute", n.top = 0, n.left = 0, n.right = 0, n.bottom = 0, n.zIndex = -1, n.width && typeof n.width == "string" && n.width.includes("%") && delete n.width, n.height && typeof n.height == "string" && n.height.includes("%") && delete n.height), y && (n.backgroundColor = "transparent"), /* @__PURE__ */ p(Y, { id: t, nodeData: e, children: /* @__PURE__ */ p("div", { "data-name": r, "data-type": "ColorComponent", style: n }) });
|
|
416
416
|
}, mt = ({
|
|
417
417
|
id: t,
|
|
418
418
|
name: r,
|
|
419
419
|
nodeData: e
|
|
420
420
|
}) => {
|
|
421
|
-
const
|
|
421
|
+
const n = L(e.style, {
|
|
422
422
|
debug: !1
|
|
423
|
-
}), i = e.style, l = Array.isArray(i?.gradientColorStops) ? i.gradientColorStops.map((
|
|
424
|
-
if (!
|
|
425
|
-
const m = st(
|
|
426
|
-
if (typeof
|
|
427
|
-
const a =
|
|
423
|
+
}), i = e.style, l = Array.isArray(i?.gradientColorStops) ? i.gradientColorStops.map((o) => {
|
|
424
|
+
if (!o?.color) return null;
|
|
425
|
+
const m = st(o.color);
|
|
426
|
+
if (typeof o.position == "number") {
|
|
427
|
+
const a = o.position * 100;
|
|
428
428
|
return `${m} ${a}%`;
|
|
429
429
|
}
|
|
430
430
|
return m;
|
|
431
431
|
}).filter(Boolean).join(", ") : "";
|
|
432
432
|
if (l) {
|
|
433
|
-
const
|
|
434
|
-
|
|
433
|
+
const o = i?.gradientType || "linear";
|
|
434
|
+
n.backgroundImage = o === "radial" ? `radial-gradient(${l})` : `linear-gradient(${l})`, delete n.backgroundColor;
|
|
435
435
|
}
|
|
436
|
-
return /* @__PURE__ */ p(Y, { id: t, nodeData: e, children: /* @__PURE__ */ p("div", { "data-name": r, "data-type": "GradientComponent", style:
|
|
436
|
+
return /* @__PURE__ */ p(Y, { id: t, nodeData: e, children: /* @__PURE__ */ p("div", { "data-name": r, "data-type": "GradientComponent", style: n }) });
|
|
437
437
|
}, yt = ({ id: t, name: r, nodeData: e }) => {
|
|
438
|
-
const { patchedNodeData:
|
|
439
|
-
e =
|
|
438
|
+
const { patchedNodeData: n } = et({ id: t, nodeData: e });
|
|
439
|
+
e = n;
|
|
440
440
|
const i = L(e.style, {
|
|
441
441
|
debug: !1
|
|
442
|
-
}), l = N(V),
|
|
442
|
+
}), l = N(V), o = k((u) => u.assetsById), m = e.style?.scaleMode || "fill";
|
|
443
443
|
m === "fill" ? i.objectFit = "cover" : m === "fit" && (i.objectFit = "contain"), i.objectPosition = "center";
|
|
444
444
|
let a = e.data?.imageUrl;
|
|
445
|
-
!a && e.encoreData?.image && (a = e.encoreData.image.startsWith("//") ? `https:${e.encoreData.image}` : e.encoreData.image), a || (a =
|
|
445
|
+
!a && e.encoreData?.image && (a = e.encoreData.image.startsWith("//") ? `https:${e.encoreData.image}` : e.encoreData.image), a || (a = o[e.assetId]?.url);
|
|
446
446
|
const y = e.style?.positioning, v = e.style?.aspectRatio, f = l.dimensions?.width || 0, s = l.dimensions?.height || 0;
|
|
447
447
|
if (y && v && f > 0) {
|
|
448
448
|
const u = typeof y.left == "number" && typeof y.right == "number", R = typeof y.top == "number" && typeof y.bottom == "number";
|
|
@@ -467,7 +467,7 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
467
467
|
"data-name": r,
|
|
468
468
|
"data-type": "ImageComponent",
|
|
469
469
|
style: i,
|
|
470
|
-
src: a ||
|
|
470
|
+
src: a || o[e.assetId]?.url,
|
|
471
471
|
alt: r
|
|
472
472
|
}
|
|
473
473
|
) });
|
|
@@ -476,11 +476,11 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
476
476
|
name: r,
|
|
477
477
|
nodeData: e
|
|
478
478
|
}) => {
|
|
479
|
-
const
|
|
479
|
+
const n = k((l) => l.setFormInputValue), i = L(e.style, { debug: !1 });
|
|
480
480
|
return /* @__PURE__ */ p(
|
|
481
481
|
"input",
|
|
482
482
|
{
|
|
483
|
-
onChange: (l) =>
|
|
483
|
+
onChange: (l) => n(t, l.target.value),
|
|
484
484
|
"data-id": t,
|
|
485
485
|
"data-name": r,
|
|
486
486
|
"data-type": "EmailInputComponent",
|
|
@@ -494,14 +494,14 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
494
494
|
name: r,
|
|
495
495
|
nodeData: e
|
|
496
496
|
}) => {
|
|
497
|
-
const
|
|
498
|
-
return
|
|
497
|
+
const n = L(e.style);
|
|
498
|
+
return n.visibility = "hidden", /* @__PURE__ */ p(
|
|
499
499
|
"input",
|
|
500
500
|
{
|
|
501
501
|
"data-id": t,
|
|
502
502
|
"data-name": r,
|
|
503
503
|
"data-type": "HiddenInputComponent",
|
|
504
|
-
style:
|
|
504
|
+
style: n,
|
|
505
505
|
type: "hidden"
|
|
506
506
|
}
|
|
507
507
|
);
|
|
@@ -510,7 +510,7 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
510
510
|
name: r,
|
|
511
511
|
nodeData: e
|
|
512
512
|
}) => {
|
|
513
|
-
const
|
|
513
|
+
const n = k((o) => o.setFormInputValue), i = L(e.style, { debug: !1 }), l = k((o) => o.assetsById);
|
|
514
514
|
return /* @__PURE__ */ it(ut, { children: [
|
|
515
515
|
/* @__PURE__ */ p(
|
|
516
516
|
"div",
|
|
@@ -522,7 +522,7 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
522
522
|
/* @__PURE__ */ p(
|
|
523
523
|
"img",
|
|
524
524
|
{
|
|
525
|
-
onChange: (
|
|
525
|
+
onChange: (o) => n(t, o.target.value),
|
|
526
526
|
style: i,
|
|
527
527
|
"data-id": t,
|
|
528
528
|
"data-name": r,
|
|
@@ -537,11 +537,11 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
537
537
|
name: r,
|
|
538
538
|
nodeData: e
|
|
539
539
|
}) => {
|
|
540
|
-
const
|
|
540
|
+
const n = k((l) => l.setFormInputValue), i = L(e.style, { debug: !1 });
|
|
541
541
|
return /* @__PURE__ */ p(
|
|
542
542
|
"input",
|
|
543
543
|
{
|
|
544
|
-
onChange: (l) =>
|
|
544
|
+
onChange: (l) => n(t, l.target.value),
|
|
545
545
|
"data-id": t,
|
|
546
546
|
"data-name": r,
|
|
547
547
|
"data-type": "PasswordInputComponent",
|
|
@@ -555,8 +555,8 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
555
555
|
name: r,
|
|
556
556
|
nodeData: e
|
|
557
557
|
}) => {
|
|
558
|
-
const
|
|
559
|
-
|
|
558
|
+
const n = k((f) => f.setFormInputValue), { onAction: i } = x.useContext(ft), { patchedNodeData: l } = et({ id: t, nodeData: e }), o = L(l.style, { debug: !1 });
|
|
559
|
+
o.width = "100%", o.flex = "1", o.minWidth = "0", o.boxSizing = "border-box", o.borderColor = o.borderColor ?? "transparent";
|
|
560
560
|
const m = l.data?.value, a = l.data?.options, y = x.useMemo(() => !a || !Array.isArray(a) ? [] : a.map((f) => typeof f == "string" ? { value: f, label: f } : f), [a]);
|
|
561
561
|
return /* @__PURE__ */ it(
|
|
562
562
|
"select",
|
|
@@ -565,10 +565,10 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
565
565
|
"data-name": r,
|
|
566
566
|
"data-type": "SelectInputComponent",
|
|
567
567
|
value: m ?? "",
|
|
568
|
-
style:
|
|
568
|
+
style: o,
|
|
569
569
|
onChange: async (f) => {
|
|
570
570
|
const s = f.target.value;
|
|
571
|
-
if (
|
|
571
|
+
if (n(t, s), console.log(`Select changed: ${s}`), typeof i == "function")
|
|
572
572
|
try {
|
|
573
573
|
await i({
|
|
574
574
|
bravo: {
|
|
@@ -596,13 +596,13 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
596
596
|
name: r,
|
|
597
597
|
nodeData: e
|
|
598
598
|
}) => {
|
|
599
|
-
const
|
|
599
|
+
const n = k((l) => l.setFormInputValue), i = L(e.style, {
|
|
600
600
|
debug: !1
|
|
601
601
|
});
|
|
602
602
|
return /* @__PURE__ */ p(
|
|
603
603
|
"input",
|
|
604
604
|
{
|
|
605
|
-
onChange: (l) =>
|
|
605
|
+
onChange: (l) => n(t, l.target.value),
|
|
606
606
|
name: t,
|
|
607
607
|
"data-id": t,
|
|
608
608
|
"data-name": r,
|
|
@@ -612,47 +612,52 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
612
612
|
type: "text"
|
|
613
613
|
}
|
|
614
614
|
);
|
|
615
|
-
}, wt = ({
|
|
616
|
-
|
|
615
|
+
}, wt = ({
|
|
616
|
+
id: t,
|
|
617
|
+
name: r,
|
|
618
|
+
nodeData: e,
|
|
619
|
+
children: n
|
|
620
|
+
}) => {
|
|
621
|
+
const i = L(e.style);
|
|
617
622
|
return /* @__PURE__ */ p(Y, { id: t, nodeData: e, children: /* @__PURE__ */ p(
|
|
618
623
|
"div",
|
|
619
624
|
{
|
|
620
625
|
"data-id": t,
|
|
621
626
|
"data-name": r,
|
|
622
627
|
"data-type": "LottieComponent",
|
|
623
|
-
style:
|
|
624
|
-
children
|
|
628
|
+
style: i,
|
|
629
|
+
children: n
|
|
625
630
|
}
|
|
626
631
|
) });
|
|
627
632
|
}, At = ({ id: t, name: r, nodeData: e }) => {
|
|
628
|
-
const
|
|
633
|
+
const n = L(e.style, {
|
|
629
634
|
debug: !1
|
|
630
|
-
}), i = k((
|
|
635
|
+
}), i = k((o) => o.assetsById), l = e.style?.positioning;
|
|
631
636
|
if (l) {
|
|
632
|
-
const
|
|
633
|
-
if (
|
|
637
|
+
const o = typeof l.left == "number" && typeof l.right == "number", m = typeof l.top == "number" && typeof l.bottom == "number";
|
|
638
|
+
if (o) {
|
|
634
639
|
const a = 100 - l.left - l.right;
|
|
635
|
-
|
|
640
|
+
n.width = `${a}%`, n.left = `${l.left}%`, delete n.right;
|
|
636
641
|
}
|
|
637
642
|
if (m) {
|
|
638
643
|
const a = 100 - l.top - l.bottom;
|
|
639
|
-
|
|
644
|
+
n.height = `${a}%`, n.top = `${l.top}%`, delete n.bottom;
|
|
640
645
|
}
|
|
641
646
|
}
|
|
642
|
-
return
|
|
647
|
+
return n.objectFit || (n.objectFit = "fill"), /* @__PURE__ */ p(Y, { id: t, nodeData: e, children: /* @__PURE__ */ p(
|
|
643
648
|
"img",
|
|
644
649
|
{
|
|
645
650
|
"data-id": t,
|
|
646
651
|
"data-name": r,
|
|
647
652
|
"data-type": "SvgComponent",
|
|
648
|
-
style:
|
|
653
|
+
style: n,
|
|
649
654
|
src: i[e.assetId]?.url,
|
|
650
655
|
alt: r
|
|
651
656
|
}
|
|
652
657
|
) });
|
|
653
658
|
}, Et = ({ id: t, name: r, nodeData: e }) => {
|
|
654
|
-
const { patchedNodeData:
|
|
655
|
-
e =
|
|
659
|
+
const { patchedNodeData: n } = et({ id: t, nodeData: e });
|
|
660
|
+
e = n;
|
|
656
661
|
const i = e.data?.text;
|
|
657
662
|
r && r.includes("Purpose") && console.log("TextComponent Debug:", {
|
|
658
663
|
id: t,
|
|
@@ -661,7 +666,7 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
661
666
|
style: e.style,
|
|
662
667
|
color: e.style?.color
|
|
663
668
|
});
|
|
664
|
-
const l = e.style,
|
|
669
|
+
const l = e.style, o = e.fontId ? { ...l, fontId: e.fontId } : l, m = L(o, {
|
|
665
670
|
debug: !1
|
|
666
671
|
});
|
|
667
672
|
m.display = "flex", m.flexDirection = "column", l.verticalPosition && (m.justifyContent = {
|
|
@@ -686,18 +691,18 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
686
691
|
id: t,
|
|
687
692
|
name: r,
|
|
688
693
|
nodeData: e,
|
|
689
|
-
children:
|
|
694
|
+
children: n
|
|
690
695
|
}) => {
|
|
691
696
|
const i = N(tt), { patchedNodeData: l } = et({ id: t, nodeData: e });
|
|
692
697
|
e = l;
|
|
693
|
-
const
|
|
698
|
+
const o = jt(e.tags), m = o ? k((w) => w.inputGroups[o.groupName]) : null, a = k((w) => w.statefulSetVariants[t]), y = L(e.style, {
|
|
694
699
|
debug: !1
|
|
695
700
|
});
|
|
696
701
|
let v;
|
|
697
|
-
|
|
698
|
-
const f = x.Children.toArray(
|
|
702
|
+
o && m !== null ? v = m === r ? "active" : "default" : v = a || e.data.initialState || "default";
|
|
703
|
+
const f = x.Children.toArray(n).find((w) => x.isValidElement(w) ? w.props?.nodeData?.data?.state === v : !1), s = x.isValidElement(f) ? x.cloneElement(f, {
|
|
699
704
|
_parentStatefulSetId: t,
|
|
700
|
-
_parentInputGroupInfo:
|
|
705
|
+
_parentInputGroupInfo: o,
|
|
701
706
|
_parentName: r
|
|
702
707
|
// Pass the name so we can identify which element is active
|
|
703
708
|
}) : f, u = /* @__PURE__ */ p(
|
|
@@ -730,10 +735,10 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
730
735
|
id: t,
|
|
731
736
|
name: r,
|
|
732
737
|
nodeData: e,
|
|
733
|
-
children:
|
|
738
|
+
children: n,
|
|
734
739
|
_parentStatefulSetId: i,
|
|
735
740
|
_parentInputGroupInfo: l,
|
|
736
|
-
_parentName:
|
|
741
|
+
_parentName: o
|
|
737
742
|
}) => {
|
|
738
743
|
const m = L(e.style, {
|
|
739
744
|
debug: !1
|
|
@@ -755,15 +760,15 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
755
760
|
nodeData: e,
|
|
756
761
|
_parentStatefulSetId: i,
|
|
757
762
|
_parentInputGroupInfo: l,
|
|
758
|
-
_parentName:
|
|
759
|
-
children:
|
|
763
|
+
_parentName: o,
|
|
764
|
+
children: n
|
|
760
765
|
}
|
|
761
766
|
)
|
|
762
767
|
}
|
|
763
768
|
);
|
|
764
769
|
}, Tt = ({ id: t, name: r, children: e }) => {
|
|
765
770
|
N(V);
|
|
766
|
-
const { dimensions:
|
|
771
|
+
const { dimensions: n, ref: i } = rt(), l = {
|
|
767
772
|
zIndex: 0,
|
|
768
773
|
flex: 1,
|
|
769
774
|
position: "absolute",
|
|
@@ -772,7 +777,7 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
772
777
|
width: "100%",
|
|
773
778
|
height: "100%"
|
|
774
779
|
};
|
|
775
|
-
return /* @__PURE__ */ p(V.Provider, { value: { dimensions:
|
|
780
|
+
return /* @__PURE__ */ p(V.Provider, { value: { dimensions: n, isFlex: !1 }, children: /* @__PURE__ */ p(
|
|
776
781
|
"div",
|
|
777
782
|
{
|
|
778
783
|
"data-id": t,
|
|
@@ -787,7 +792,7 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
787
792
|
id: t,
|
|
788
793
|
name: r,
|
|
789
794
|
nodeData: e,
|
|
790
|
-
children:
|
|
795
|
+
children: n,
|
|
791
796
|
_arrayItemIndex: i,
|
|
792
797
|
_arrayItemData: l
|
|
793
798
|
}) => {
|
|
@@ -795,7 +800,7 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
795
800
|
`[DEBUG] ContainerComponent ${t} (Hero) FULL nodeData:`,
|
|
796
801
|
JSON.stringify(e, null, 2)
|
|
797
802
|
);
|
|
798
|
-
const
|
|
803
|
+
const o = N(tt), { patchedNodeData: m, list: a, arrayData: y } = et({
|
|
799
804
|
id: t,
|
|
800
805
|
nodeData: e
|
|
801
806
|
});
|
|
@@ -825,9 +830,9 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
825
830
|
if (B !== void 0) {
|
|
826
831
|
const Z = typeof B == "object" && B !== null ? {
|
|
827
832
|
nodeData: B,
|
|
828
|
-
arrayDataById:
|
|
829
|
-
textOverridesById:
|
|
830
|
-
rootData:
|
|
833
|
+
arrayDataById: o?.arrayDataById,
|
|
834
|
+
textOverridesById: o?.textOverridesById,
|
|
835
|
+
rootData: o?.rootData
|
|
831
836
|
} : { nodeData: B };
|
|
832
837
|
return /* @__PURE__ */ p(tt.Provider, { value: Z, children: /* @__PURE__ */ p(
|
|
833
838
|
V.Provider,
|
|
@@ -840,7 +845,7 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
840
845
|
"data-name": r,
|
|
841
846
|
"data-type": "ContainerComponent",
|
|
842
847
|
style: H,
|
|
843
|
-
children:
|
|
848
|
+
children: n
|
|
844
849
|
}
|
|
845
850
|
)
|
|
846
851
|
}
|
|
@@ -849,12 +854,12 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
849
854
|
}
|
|
850
855
|
if (a) {
|
|
851
856
|
const B = y || a;
|
|
852
|
-
return Ht(() => B.map((J,
|
|
857
|
+
return Ht(() => B.map((J, ot) => {
|
|
853
858
|
const Q = typeof J == "object" && J !== null ? {
|
|
854
859
|
nodeData: J,
|
|
855
|
-
arrayDataById:
|
|
856
|
-
textOverridesById:
|
|
857
|
-
rootData:
|
|
860
|
+
arrayDataById: o?.arrayDataById,
|
|
861
|
+
textOverridesById: o?.textOverridesById,
|
|
862
|
+
rootData: o?.rootData
|
|
858
863
|
} : { nodeData: J };
|
|
859
864
|
return /* @__PURE__ */ p(
|
|
860
865
|
tt.Provider,
|
|
@@ -867,17 +872,17 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
867
872
|
children: /* @__PURE__ */ p(
|
|
868
873
|
"div",
|
|
869
874
|
{
|
|
870
|
-
"data-id": `${t}:${
|
|
875
|
+
"data-id": `${t}:${ot}`,
|
|
871
876
|
"data-name": r,
|
|
872
877
|
"data-type": "ContainerComponent",
|
|
873
878
|
style: H,
|
|
874
|
-
children:
|
|
879
|
+
children: n
|
|
875
880
|
}
|
|
876
881
|
)
|
|
877
882
|
}
|
|
878
883
|
)
|
|
879
884
|
},
|
|
880
|
-
`${t}:${
|
|
885
|
+
`${t}:${ot}`
|
|
881
886
|
);
|
|
882
887
|
}), [B, t]);
|
|
883
888
|
}
|
|
@@ -901,15 +906,15 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
901
906
|
"data-type": "ContainerComponent",
|
|
902
907
|
ref: f,
|
|
903
908
|
style: H,
|
|
904
|
-
children: z ? /* @__PURE__ */ p(Y, { id: t, nodeData: e, children:
|
|
909
|
+
children: z ? /* @__PURE__ */ p(Y, { id: t, nodeData: e, children: n }) : n
|
|
905
910
|
}
|
|
906
911
|
)
|
|
907
912
|
}
|
|
908
913
|
);
|
|
909
|
-
}, Pt = pt, Bt = ({ id: t, name: r, nodeData: e, children:
|
|
910
|
-
const { dimensions: i, ref: l } = rt(),
|
|
914
|
+
}, Pt = pt, Bt = ({ id: t, name: r, nodeData: e, children: n }) => {
|
|
915
|
+
const { dimensions: i, ref: l } = rt(), o = L(e.style, {
|
|
911
916
|
debug: !1
|
|
912
|
-
}), m = !!e.style.layout?.mode, a = e.style.layout?.mode === "HORIZONTAL" ? "row" : "column", y =
|
|
917
|
+
}), m = !!e.style.layout?.mode, a = e.style.layout?.mode === "HORIZONTAL" ? "row" : "column", y = o.position ? o : { ...o, position: "relative" };
|
|
913
918
|
return /* @__PURE__ */ p(
|
|
914
919
|
V.Provider,
|
|
915
920
|
{
|
|
@@ -922,12 +927,12 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
922
927
|
"data-type": "TopBarContainerComponent",
|
|
923
928
|
ref: l,
|
|
924
929
|
style: y,
|
|
925
|
-
children:
|
|
930
|
+
children: n
|
|
926
931
|
}
|
|
927
932
|
)
|
|
928
933
|
}
|
|
929
934
|
);
|
|
930
|
-
}, Ut = ({ id: t, name: r, nodeData: e, children:
|
|
935
|
+
}, Ut = ({ id: t, name: r, nodeData: e, children: n }) => {
|
|
931
936
|
const i = L(e.style, { debug: !1 });
|
|
932
937
|
return /* @__PURE__ */ p(
|
|
933
938
|
"div",
|
|
@@ -936,19 +941,19 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
936
941
|
"data-name": r,
|
|
937
942
|
"data-type": "DefaultLayerComponent",
|
|
938
943
|
style: i,
|
|
939
|
-
children:
|
|
944
|
+
children: n
|
|
940
945
|
}
|
|
941
946
|
);
|
|
942
|
-
}, Lt = ({ id: t, name: r, nodeData: e, children:
|
|
947
|
+
}, Lt = ({ id: t, name: r, nodeData: e, children: n }) => /* @__PURE__ */ p(
|
|
943
948
|
"div",
|
|
944
949
|
{
|
|
945
950
|
"data-id": t,
|
|
946
951
|
"data-name": r,
|
|
947
952
|
"data-type": "TabsMenuComponent",
|
|
948
953
|
style: L(e.style),
|
|
949
|
-
children:
|
|
954
|
+
children: n
|
|
950
955
|
}
|
|
951
|
-
), Wt = ({ id: t, name: r, nodeData: e, children:
|
|
956
|
+
), Wt = ({ id: t, name: r, nodeData: e, children: n }) => {
|
|
952
957
|
const i = L(e.style, {
|
|
953
958
|
debug: !1
|
|
954
959
|
});
|
|
@@ -959,15 +964,15 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
959
964
|
"data-name": r,
|
|
960
965
|
"data-type": "MenuSideComponent",
|
|
961
966
|
style: i,
|
|
962
|
-
children:
|
|
967
|
+
children: n
|
|
963
968
|
}
|
|
964
969
|
);
|
|
965
|
-
}, at = ({ id: t, name: r, nodeData: e, children:
|
|
970
|
+
}, at = ({ id: t, name: r, nodeData: e, children: n }) => {
|
|
966
971
|
t === "01KB929X1DQJN954WNGF5AH38B" && console.log(
|
|
967
972
|
`[DEBUG] SliderComponent ${t} FULL nodeData:`,
|
|
968
973
|
JSON.stringify(e, null, 2)
|
|
969
974
|
);
|
|
970
|
-
const { dimensions: i, ref: l } = rt(),
|
|
975
|
+
const { dimensions: i, ref: l } = rt(), o = x.useRef(null), m = x.useRef(null), a = x.useRef(!1), y = x.useRef(null), v = N(ct), f = N(Mt), { onAction: s } = N(ft), [u, R] = x.useState({
|
|
971
976
|
currentIndex: void 0,
|
|
972
977
|
onIndexChange: void 0
|
|
973
978
|
}), [w, S] = x.useState(0), W = x.useRef(null), { patchedNodeData: $ } = et({ id: t, nodeData: e });
|
|
@@ -984,17 +989,17 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
984
989
|
H || (E.width = "100%"), U || (E.height = "100%"), E.position || (E.position = "relative");
|
|
985
990
|
const M = N(tt), g = x.useMemo(() => {
|
|
986
991
|
const c = [];
|
|
987
|
-
return x.Children.forEach(
|
|
992
|
+
return x.Children.forEach(n, (d) => {
|
|
988
993
|
if (d == null) return;
|
|
989
994
|
const I = d?.props || {}, C = I.nodeData || {};
|
|
990
995
|
if (Array.isArray(C?.tags) && (C.tags.includes("encore:data:array") || C.tags.includes("bravo:data:array")) && I.id && M) {
|
|
991
996
|
const T = M?.arrayDataById && M.arrayDataById[I.id] && Array.isArray(M.arrayDataById[I.id]) ? M.arrayDataById[I.id] : null;
|
|
992
|
-
T && T.length > 0 ? T.forEach((D,
|
|
997
|
+
T && T.length > 0 ? T.forEach((D, nt) => {
|
|
993
998
|
c.push(
|
|
994
999
|
x.cloneElement(d, {
|
|
995
|
-
key: `${I.id}:${
|
|
1000
|
+
key: `${I.id}:${nt}`,
|
|
996
1001
|
// ContainerComponent will use this to know which item to render
|
|
997
|
-
_arrayItemIndex:
|
|
1002
|
+
_arrayItemIndex: nt,
|
|
998
1003
|
_arrayItemData: D
|
|
999
1004
|
})
|
|
1000
1005
|
);
|
|
@@ -1002,7 +1007,7 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
1002
1007
|
} else
|
|
1003
1008
|
c.push(d);
|
|
1004
1009
|
}), c;
|
|
1005
|
-
}, [
|
|
1010
|
+
}, [n, t, M]), q = x.useMemo(() => {
|
|
1006
1011
|
if (!A || g.length === 0)
|
|
1007
1012
|
return g;
|
|
1008
1013
|
const c = g[0], d = g[g.length - 1];
|
|
@@ -1021,9 +1026,9 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
1021
1026
|
let C = 0, b = 0;
|
|
1022
1027
|
return d?.layout?.layoutSizingHorizontal === "FIXED" && d?.layout?.size?.x ? C = d.layout.size.x * I : C = i.width || 0, d?.layout?.layoutSizingVertical === "FIXED" && d?.layout?.size?.y ? b = d.layout.size.y * I : b = i.height || 0, { width: C, height: b };
|
|
1023
1028
|
}, [g, i.width, i.height, v.scaleFactor]), P = X.width, F = X.height, z = K === "vertical", _ = x.useCallback(() => {
|
|
1024
|
-
if (!
|
|
1029
|
+
if (!o.current || g.length === 0)
|
|
1025
1030
|
return 0;
|
|
1026
|
-
const c =
|
|
1031
|
+
const c = o.current;
|
|
1027
1032
|
if (z) {
|
|
1028
1033
|
if (F === 0) return 0;
|
|
1029
1034
|
const d = c.scrollTop;
|
|
@@ -1049,8 +1054,8 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
1049
1054
|
}
|
|
1050
1055
|
}, [A, g.length, P, F, z]), B = x.useCallback(
|
|
1051
1056
|
(c, d = !0) => {
|
|
1052
|
-
if (!
|
|
1053
|
-
const I =
|
|
1057
|
+
if (!o.current || g.length === 0) return;
|
|
1058
|
+
const I = o.current;
|
|
1054
1059
|
if (z) {
|
|
1055
1060
|
let C;
|
|
1056
1061
|
A ? C = F + c * F : C = c * F, I.scrollTo({
|
|
@@ -1067,8 +1072,8 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
1067
1072
|
},
|
|
1068
1073
|
[P, F, A, g.length, z]
|
|
1069
1074
|
), Z = x.useCallback(() => {
|
|
1070
|
-
if (!A || !
|
|
1071
|
-
const c =
|
|
1075
|
+
if (!A || !o.current || g.length === 0) return;
|
|
1076
|
+
const c = o.current, d = 1;
|
|
1072
1077
|
if (z) {
|
|
1073
1078
|
if (F === 0) return;
|
|
1074
1079
|
const I = c.scrollTop, C = F, b = C, T = b + g.length * C;
|
|
@@ -1082,15 +1087,15 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
1082
1087
|
x.useEffect(() => {
|
|
1083
1088
|
if (!G || g.length <= 1 || P === 0) return;
|
|
1084
1089
|
const c = () => {
|
|
1085
|
-
if (a.current || !
|
|
1086
|
-
const d =
|
|
1090
|
+
if (a.current || !o.current) return;
|
|
1091
|
+
const d = o.current;
|
|
1087
1092
|
if (z) {
|
|
1088
1093
|
if (F === 0) return;
|
|
1089
1094
|
const I = d.scrollTop, C = F;
|
|
1090
1095
|
let b;
|
|
1091
1096
|
if (A) {
|
|
1092
|
-
const
|
|
1093
|
-
b = Math.round(
|
|
1097
|
+
const nt = I - C;
|
|
1098
|
+
b = Math.round(nt / C), b < 0 && (b = 0), b >= g.length && (b = g.length - 1);
|
|
1094
1099
|
} else
|
|
1095
1100
|
b = Math.round(I / C);
|
|
1096
1101
|
let T = b + 1;
|
|
@@ -1108,8 +1113,8 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
1108
1113
|
const I = d.scrollLeft, C = P;
|
|
1109
1114
|
let b;
|
|
1110
1115
|
if (A) {
|
|
1111
|
-
const
|
|
1112
|
-
b = Math.round(
|
|
1116
|
+
const nt = I - C;
|
|
1117
|
+
b = Math.round(nt / C), b < 0 && (b = 0), b >= g.length && (b = g.length - 1);
|
|
1113
1118
|
} else
|
|
1114
1119
|
b = Math.round(I / C);
|
|
1115
1120
|
let T = b + 1;
|
|
@@ -1140,15 +1145,15 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
1140
1145
|
a.current = !0, y.current && clearTimeout(y.current), y.current = setTimeout(() => {
|
|
1141
1146
|
a.current = !1;
|
|
1142
1147
|
}, 3e3);
|
|
1143
|
-
}, []),
|
|
1148
|
+
}, []), ot = x.useRef(u);
|
|
1144
1149
|
x.useEffect(() => {
|
|
1145
|
-
|
|
1150
|
+
ot.current = u;
|
|
1146
1151
|
}, [u]);
|
|
1147
1152
|
const Q = x.useCallback(
|
|
1148
1153
|
(c) => {
|
|
1149
1154
|
if (W.current === c) return;
|
|
1150
1155
|
W.current = c;
|
|
1151
|
-
const d =
|
|
1156
|
+
const d = ot.current;
|
|
1152
1157
|
if (d.currentIndex === void 0 && S(c), d.onIndexChange && d.onIndexChange(c), typeof s == "function")
|
|
1153
1158
|
try {
|
|
1154
1159
|
s({
|
|
@@ -1169,7 +1174,7 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
1169
1174
|
// Depend on onAction to ensure we call the latest version
|
|
1170
1175
|
);
|
|
1171
1176
|
x.useEffect(() => {
|
|
1172
|
-
const c =
|
|
1177
|
+
const c = o.current;
|
|
1173
1178
|
if (!c) return;
|
|
1174
1179
|
let d = null;
|
|
1175
1180
|
const I = () => {
|
|
@@ -1199,7 +1204,7 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
1199
1204
|
c && c !== u && R(c);
|
|
1200
1205
|
}
|
|
1201
1206
|
}, [t, f, u]), x.useEffect(() => {
|
|
1202
|
-
if (u.currentIndex !== void 0 &&
|
|
1207
|
+
if (u.currentIndex !== void 0 && o.current && g.length > 0 && P > 0) {
|
|
1203
1208
|
const c = Math.max(
|
|
1204
1209
|
0,
|
|
1205
1210
|
Math.min(u.currentIndex, g.length - 1)
|
|
@@ -1216,10 +1221,10 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
1216
1221
|
B,
|
|
1217
1222
|
_
|
|
1218
1223
|
]), x.useEffect(() => {
|
|
1219
|
-
if (A &&
|
|
1224
|
+
if (A && o.current && g.length > 0 && g.length > 0 && (z ? F > 0 : P > 0)) {
|
|
1220
1225
|
const c = z ? F : P;
|
|
1221
1226
|
setTimeout(() => {
|
|
1222
|
-
|
|
1227
|
+
o.current && (z ? o.current.scrollTop = c : o.current.scrollLeft = c);
|
|
1223
1228
|
}, 0);
|
|
1224
1229
|
}
|
|
1225
1230
|
}, [A, g.length, P, F, z]), x.useEffect(() => {
|
|
@@ -1261,7 +1266,7 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
1261
1266
|
"data-type": "SliderComponent",
|
|
1262
1267
|
ref: l,
|
|
1263
1268
|
style: E,
|
|
1264
|
-
children: /* @__PURE__ */ p("div", { ref:
|
|
1269
|
+
children: /* @__PURE__ */ p("div", { ref: o, style: $t, children: q.map((c, d) => /* @__PURE__ */ p(
|
|
1265
1270
|
V.Provider,
|
|
1266
1271
|
{
|
|
1267
1272
|
value: {
|
|
@@ -1279,23 +1284,23 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
1279
1284
|
);
|
|
1280
1285
|
}, kt = (t, r) => {
|
|
1281
1286
|
const e = Array.isArray(t) ? t : [t];
|
|
1282
|
-
for (const
|
|
1283
|
-
if (!(!
|
|
1284
|
-
if (
|
|
1285
|
-
return
|
|
1286
|
-
if (
|
|
1287
|
-
const i = kt(
|
|
1287
|
+
for (const n of e)
|
|
1288
|
+
if (!(!n || !n.props)) {
|
|
1289
|
+
if (n.props.id === r)
|
|
1290
|
+
return n;
|
|
1291
|
+
if (n.props.children) {
|
|
1292
|
+
const i = kt(n.props.children, r);
|
|
1288
1293
|
if (i) return i;
|
|
1289
1294
|
}
|
|
1290
1295
|
}
|
|
1291
1296
|
return null;
|
|
1292
|
-
}, Rt = ({ id: t, name: r, nodeData: e, children:
|
|
1293
|
-
const { dimensions: i, ref: l } = rt(), { componentId:
|
|
1297
|
+
}, Rt = ({ id: t, name: r, nodeData: e, children: n }) => {
|
|
1298
|
+
const { dimensions: i, ref: l } = rt(), { componentId: o } = N(lt), m = N(V), a = e.style.originalSize?.[0] || 1, y = e.style.originalSize?.[1] || 1, v = m?.dimensions?.width, f = m?.dimensions?.height, s = window.innerWidth, u = window.innerHeight, R = v && v > 0 && v < s * 0.8;
|
|
1294
1299
|
let w, S;
|
|
1295
1300
|
i.width > 0 && i.height > 0 ? (w = i.width, S = i.height) : R && v && f || v && f && v > 0 && f > 0 ? (w = v, S = f) : (w = s, S = u);
|
|
1296
1301
|
const $ = { scaleFactor: Math.min(w / a, S / y) || 1 };
|
|
1297
|
-
if (
|
|
1298
|
-
const E = kt(
|
|
1302
|
+
if (o) {
|
|
1303
|
+
const E = kt(n, o);
|
|
1299
1304
|
return E ? /* @__PURE__ */ p(ct.Provider, { value: $, children: /* @__PURE__ */ p(
|
|
1300
1305
|
V.Provider,
|
|
1301
1306
|
{
|
|
@@ -1307,9 +1312,9 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
1307
1312
|
},
|
|
1308
1313
|
children: E
|
|
1309
1314
|
}
|
|
1310
|
-
) }) : (console.warn(`Child with id "${
|
|
1315
|
+
) }) : (console.warn(`Child with id "${o}" not found`), null);
|
|
1311
1316
|
}
|
|
1312
|
-
const h = Array.isArray(
|
|
1317
|
+
const h = Array.isArray(n) ? n : [n], { scrollableChildren: A, nonScrollableChildren: G } = h.reduce(
|
|
1313
1318
|
(E, H) => {
|
|
1314
1319
|
const M = H.props.nodeData.type === "container:top-bar" ? "nonScrollableChildren" : "scrollableChildren";
|
|
1315
1320
|
return E[M].push(H), E;
|
|
@@ -1320,8 +1325,8 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
1320
1325
|
}
|
|
1321
1326
|
);
|
|
1322
1327
|
let O = e.style?.layout?.mode;
|
|
1323
|
-
if (!O && t === "01KASW494V02Y8P5JVWV5XK62X" && (console.log("🔧 PATCHING missing layout for page", t), O = "HORIZONTAL"), !O &&
|
|
1324
|
-
const E = Array.isArray(
|
|
1328
|
+
if (!O && t === "01KASW494V02Y8P5JVWV5XK62X" && (console.log("🔧 PATCHING missing layout for page", t), O = "HORIZONTAL"), !O && n) {
|
|
1329
|
+
const E = Array.isArray(n) ? n : [n];
|
|
1325
1330
|
let H = 0, U = 0;
|
|
1326
1331
|
E.forEach((g) => {
|
|
1327
1332
|
const q = g?.props?.nodeData?.style?.width;
|