@bravostudioai/react 0.1.35 → 0.1.36
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/codegen/generator.js +243 -234
- package/dist/codegen/generator.js.map +1 -1
- package/dist/codegen/parser.js +150 -149
- package/dist/codegen/parser.js.map +1 -1
- package/dist/components/EncoreApp.js +61 -58
- package/dist/components/EncoreApp.js.map +1 -1
- package/dist/components.js +512 -449
- package/dist/components.js.map +1 -1
- package/dist/contexts/EncoreBindingContext.js +9 -3
- package/dist/contexts/EncoreBindingContext.js.map +1 -1
- package/dist/src/codegen/generator.d.ts.map +1 -1
- package/dist/src/codegen/parser.d.ts.map +1 -1
- package/dist/src/components/EncoreApp.d.ts +3 -1
- package/dist/src/components/EncoreApp.d.ts.map +1 -1
- package/dist/src/components.d.ts.map +1 -1
- package/dist/src/contexts/EncoreBindingContext.d.ts +14 -2
- package/dist/src/contexts/EncoreBindingContext.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/codegen/generator.ts +24 -2
- package/src/codegen/parser.ts +29 -4
- package/src/components/EncoreApp.tsx +6 -1
- package/src/components.tsx +131 -4
- package/src/contexts/EncoreBindingContext.ts +20 -3
- package/src/version.ts +1 -1
package/dist/components.js
CHANGED
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import x, { useContext as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { jsx as d, jsxs as it, Fragment as ut } from "react/jsx-runtime";
|
|
2
|
+
import x, { useContext as M, useMemo as Vt, useState as Mt, useCallback as Nt } from "react";
|
|
3
|
+
import Y from "./contexts/EncoreBindingContext.js";
|
|
4
|
+
import R from "./stores/useEncoreState.js";
|
|
5
5
|
import lt from "./contexts/EncoreComponentIdContext.js";
|
|
6
6
|
import Ot from "axios";
|
|
7
7
|
import ft from "./contexts/EncoreActionContext.js";
|
|
8
|
-
import
|
|
8
|
+
import jt from "./contexts/EncoreRepeatingContainerContext.js";
|
|
9
9
|
const ct = x.createContext({}), V = x.createContext(
|
|
10
10
|
{}
|
|
11
|
-
), st = (t) => t.replace(/#(\w{2})(\w{6})/, "#$2$1"), Gt = (t) => t.slice(1, 3) === "00",
|
|
11
|
+
), st = (t) => t.replace(/#(\w{2})(\w{6})/, "#$2$1"), Gt = (t) => t.slice(1, 3) === "00", Ut = (t) => {
|
|
12
12
|
if (!Array.isArray(t)) return null;
|
|
13
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;
|
|
17
17
|
}, rt = () => {
|
|
18
|
-
const [t, r] =
|
|
18
|
+
const [t, r] = Mt({ width: 0, height: 0 }), e = x.useRef(null);
|
|
19
19
|
return x.useEffect(() => {
|
|
20
20
|
if (!e.current) return;
|
|
21
21
|
const n = e.current, i = () => {
|
|
22
|
-
const { width: o, height:
|
|
23
|
-
r({ width: o, height:
|
|
22
|
+
const { width: o, height: g } = n.getBoundingClientRect();
|
|
23
|
+
r({ width: o, height: g });
|
|
24
24
|
};
|
|
25
25
|
i(), requestAnimationFrame(() => {
|
|
26
26
|
i();
|
|
27
27
|
});
|
|
28
|
-
const
|
|
29
|
-
for (const
|
|
30
|
-
const a =
|
|
28
|
+
const s = new ResizeObserver((o) => {
|
|
29
|
+
for (const g of o) {
|
|
30
|
+
const a = g.contentRect;
|
|
31
31
|
r({ width: a.width, height: a.height });
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
|
-
return
|
|
34
|
+
return s.observe(n), () => s.disconnect();
|
|
35
35
|
}, []), { dimensions: t, ref: e };
|
|
36
|
-
},
|
|
37
|
-
const e =
|
|
36
|
+
}, W = (t, r = {}) => {
|
|
37
|
+
const e = M(ct), n = M(V), i = {
|
|
38
38
|
width: window.innerWidth,
|
|
39
39
|
height: window.innerHeight
|
|
40
|
-
},
|
|
41
|
-
(
|
|
40
|
+
}, s = Nt(
|
|
41
|
+
(l) => (n.dimensions?.width ?? 0) * 0.01 * l,
|
|
42
42
|
[n.dimensions?.width]
|
|
43
43
|
), o = {};
|
|
44
44
|
r = { debug: !1, ...r };
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
45
|
+
const g = R((l) => l.fontsById || {});
|
|
46
|
+
if (R((l) => l.fontsByIdFull || {}), !t || !t) return;
|
|
47
47
|
const a = n.dimensions?.width ?? i.width, y = n.dimensions?.height ?? i.height;
|
|
48
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
|
-
const
|
|
49
|
+
const l = t.layout?.layoutSizingHorizontal === "FIXED" || t.layout?.layoutSizingVertical === "FIXED", u = l && t.positioning.top < 0 ? 0 : t.positioning.top, k = l && t.positioning.left < 0 ? 0 : t.positioning.left;
|
|
50
50
|
let w = !1;
|
|
51
51
|
t.horizontalPosition === "center" && (w = !0), o.top = `${u}%`;
|
|
52
|
-
const
|
|
52
|
+
const v = !!t.inset;
|
|
53
53
|
if (w) {
|
|
54
|
-
if (
|
|
55
|
-
const
|
|
56
|
-
|
|
54
|
+
if (v) {
|
|
55
|
+
const L = String(t.inset).split(/\s+/);
|
|
56
|
+
L.length === 3 ? o.inset = `${L[0]} 50% ${L[2]} auto` : L.length === 4 && (o.inset = `${L[0]} 50% ${L[2]} auto`), delete o.left, delete o.right;
|
|
57
57
|
} else
|
|
58
58
|
o.left = "50%", o.right = "auto";
|
|
59
59
|
o.transform = "translateX(-50%)";
|
|
60
60
|
} else
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
v ? o.inset = t.inset : o.left = `${k}%`;
|
|
62
|
+
l ? (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
|
-
const
|
|
66
|
-
u.top !== void 0 && (o.paddingTop = u.top *
|
|
65
|
+
const l = e.scaleFactor ?? 1, u = t.layout.padding;
|
|
66
|
+
u.top !== void 0 && (o.paddingTop = u.top * l), u.right !== void 0 && (o.paddingRight = u.right * l), u.bottom !== void 0 && (o.paddingBottom = u.bottom * l), u.left !== void 0 && (o.paddingLeft = u.left * l);
|
|
67
67
|
}
|
|
68
68
|
if (t.layout?.mode) {
|
|
69
69
|
o.display = "flex";
|
|
70
|
-
const
|
|
70
|
+
const l = (L) => L ? {
|
|
71
71
|
MIN: "flex-start",
|
|
72
72
|
MAX: "flex-end",
|
|
73
73
|
CENTER: "center",
|
|
74
74
|
SPACE_BETWEEN: "space-between",
|
|
75
75
|
SPACE_AROUND: "space-around",
|
|
76
76
|
SPACE_EVENLY: "space-evenly"
|
|
77
|
-
}[
|
|
78
|
-
t.layout.mode == "HORIZONTAL" ? (o.flexDirection = "row", t.layout.flexWrap && (o.flexWrap = t.layout.flexWrap), o.justifyContent =
|
|
77
|
+
}[L] || L.toLowerCase().replace(/_/g, "-") : void 0;
|
|
78
|
+
t.layout.mode == "HORIZONTAL" ? (o.flexDirection = "row", t.layout.flexWrap && (o.flexWrap = t.layout.flexWrap), o.justifyContent = l(
|
|
79
79
|
t.layout.primaryAxisAlignItems
|
|
80
|
-
), o.alignItems = t.layout.counterAxisAlignItems) : (o.flexDirection = "column", o.justifyContent =
|
|
80
|
+
), o.alignItems = t.layout.counterAxisAlignItems) : (o.flexDirection = "column", o.justifyContent = l(
|
|
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
|
-
const u = t.layout.itemSpacing,
|
|
84
|
-
o.gap =
|
|
83
|
+
const u = t.layout.itemSpacing, k = e.scaleFactor ?? 1, v = t.layout.primaryAxisAlignItems === "SPACE_BETWEEN" ? 0 : (u !== void 0 ? u : 0) * k;
|
|
84
|
+
o.gap = v === 0 ? "0px" : `${v}px`, o.rowGap = v === 0 ? "0px" : `${v}px`, o.columnGap = v === 0 ? "0px" : `${v}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
|
-
spacing:
|
|
86
|
+
spacing: v,
|
|
87
87
|
gap: o.gap,
|
|
88
88
|
rowGap: o.rowGap,
|
|
89
89
|
columnGap: o.columnGap,
|
|
@@ -97,12 +97,12 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
97
97
|
);
|
|
98
98
|
}
|
|
99
99
|
if (t.layout?.layoutSizingHorizontal === "FILL" && (o.width = "100%"), t.layout?.layoutSizingHorizontal === "FIXED") {
|
|
100
|
-
const
|
|
101
|
-
o.width = t.layout.size.x *
|
|
100
|
+
const l = e.scaleFactor ?? 1;
|
|
101
|
+
o.width = t.layout.size.x * l;
|
|
102
102
|
}
|
|
103
103
|
if (t.layout?.layoutSizingHorizontal, t.layout?.layoutSizingVertical === "FIXED") {
|
|
104
|
-
const
|
|
105
|
-
o.height = t.layout.size.y *
|
|
104
|
+
const l = e.scaleFactor ?? 1;
|
|
105
|
+
o.height = t.layout.size.y * l;
|
|
106
106
|
}
|
|
107
107
|
if (t.layout?.layoutSizingVertical === "FILL")
|
|
108
108
|
if (!(n?.isFlex ?? !1) && t.positioning && t.positioning?.top !== void 0) {
|
|
@@ -111,21 +111,32 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
111
111
|
} else
|
|
112
112
|
o.height = "100%";
|
|
113
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
|
-
const
|
|
115
|
-
|
|
114
|
+
const l = g[t.fontId] || "sans-serif";
|
|
115
|
+
[
|
|
116
|
+
"sans-serif",
|
|
117
|
+
"serif",
|
|
118
|
+
"monospace",
|
|
119
|
+
"cursive",
|
|
120
|
+
"fantasy",
|
|
121
|
+
"system-ui",
|
|
122
|
+
"ui-sans-serif",
|
|
123
|
+
"ui-serif",
|
|
124
|
+
"ui-monospace",
|
|
125
|
+
"ui-rounded"
|
|
126
|
+
].includes(l.toLowerCase()) ? o.fontFamily = l : o.fontFamily = `"${l}"`, console.log("[AG_DEBUG] [useEncoreStyle] Font Resolution:", {
|
|
116
127
|
fontId: t.fontId,
|
|
117
|
-
resolvedFamily:
|
|
128
|
+
resolvedFamily: l,
|
|
118
129
|
fontWeight: t.fontWeight,
|
|
119
130
|
finalStyle: o.fontFamily
|
|
120
131
|
});
|
|
121
132
|
}
|
|
122
|
-
if (t.borderRadius && (o.borderRadius =
|
|
123
|
-
const
|
|
124
|
-
o.borderTopLeftRadius =
|
|
133
|
+
if (t.borderRadius && (o.borderRadius = s(t.borderRadius)), t.cornerRadii) {
|
|
134
|
+
const l = t.cornerRadii.map(s);
|
|
135
|
+
o.borderTopLeftRadius = l[0], o.borderTopRightRadius = l[1], o.borderBottomRightRadius = l[2], o.borderBottomLeftRadius = l[3], delete o.borderRadius;
|
|
125
136
|
}
|
|
126
137
|
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
|
-
},
|
|
128
|
-
const e =
|
|
138
|
+
}, _ = ({ id: t, nodeData: r }) => {
|
|
139
|
+
const e = M(Y), n = e?.nodeData?.[t], { patch: i, list: s } = n ?? { list: null, patch: null }, g = 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
140
|
let a = i ? {
|
|
130
141
|
...r,
|
|
131
142
|
...i || {},
|
|
@@ -138,16 +149,16 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
138
149
|
...a,
|
|
139
150
|
data: { ...a?.data || {}, text: String(y) }
|
|
140
151
|
});
|
|
141
|
-
const
|
|
142
|
-
|
|
152
|
+
const S = Array.isArray(r?.tags) && (r.tags.includes("encore:data") || r.tags.includes("bravo:data")), m = e?.rootData;
|
|
153
|
+
m && m[t] && typeof m[t] == "object" && (a = {
|
|
143
154
|
...a,
|
|
144
155
|
data: {
|
|
145
156
|
...a.data || {},
|
|
146
|
-
...
|
|
157
|
+
...m[t]
|
|
147
158
|
}
|
|
148
159
|
});
|
|
149
|
-
const
|
|
150
|
-
if (
|
|
160
|
+
const l = e?.nodeData && typeof e.nodeData == "object";
|
|
161
|
+
if (S || l) {
|
|
151
162
|
const u = e?.nodeData;
|
|
152
163
|
if (u && typeof u == "object") {
|
|
153
164
|
if (u[t] !== void 0) {
|
|
@@ -159,7 +170,7 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
159
170
|
...w
|
|
160
171
|
}
|
|
161
172
|
});
|
|
162
|
-
} else if (
|
|
173
|
+
} else if (S && u.description && a.data && (a = {
|
|
163
174
|
...a,
|
|
164
175
|
data: {
|
|
165
176
|
...a.data,
|
|
@@ -180,45 +191,45 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
180
191
|
}
|
|
181
192
|
return {
|
|
182
193
|
patch: i,
|
|
183
|
-
list:
|
|
194
|
+
list: s || g,
|
|
184
195
|
// Use arrayData if list is not provided
|
|
185
196
|
patchedNodeData: a,
|
|
186
|
-
arrayData:
|
|
197
|
+
arrayData: g
|
|
187
198
|
// Also return separately for components that need it
|
|
188
199
|
};
|
|
189
|
-
},
|
|
200
|
+
}, Q = ({
|
|
190
201
|
id: t,
|
|
191
202
|
nodeData: r,
|
|
192
203
|
children: e,
|
|
193
204
|
_parentStatefulSetId: n,
|
|
194
205
|
_parentInputGroupInfo: i,
|
|
195
|
-
_parentName:
|
|
206
|
+
_parentName: s
|
|
196
207
|
}) => {
|
|
197
|
-
const o =
|
|
198
|
-
|
|
208
|
+
const o = R((h) => h.baseURL), g = R((h) => h.appId);
|
|
209
|
+
R((h) => h.pageId);
|
|
199
210
|
const { onAction: a } = x.useContext(ft), { statefulSetId: y } = x.useContext(
|
|
200
211
|
lt
|
|
201
|
-
),
|
|
212
|
+
), S = n || y, { patchedNodeData: m } = _({ id: t, nodeData: r }), l = R(
|
|
202
213
|
(h) => h.setStatefulSetVariant
|
|
203
|
-
), u =
|
|
214
|
+
), u = R(
|
|
204
215
|
(h) => h.setInputGroupValue
|
|
205
|
-
),
|
|
216
|
+
), k = R((h) => h.setAccessToken), { app: w } = R((h) => h.app);
|
|
206
217
|
w.data?.app?.startPageId, w.data?.app?.PageId;
|
|
207
|
-
const
|
|
218
|
+
const v = W(
|
|
208
219
|
{
|
|
209
220
|
positioning: r.style?.positioning
|
|
210
221
|
},
|
|
211
222
|
{ debug: !1 }
|
|
212
223
|
);
|
|
213
|
-
|
|
214
|
-
const
|
|
224
|
+
v.zIndex = 99999, v.backgroundColor = "transparent", v.position = "absolute", v.top = "0", v.left = "0", v.right = "0", v.bottom = "0", v.width = "100%", v.height = "100%", v.pointerEvents = "auto", v.isolation = "isolate";
|
|
225
|
+
const L = async (h) => {
|
|
215
226
|
let A = !1;
|
|
216
|
-
const
|
|
227
|
+
const j = () => {
|
|
217
228
|
A = !1;
|
|
218
229
|
};
|
|
219
230
|
if (typeof a == "function")
|
|
220
231
|
try {
|
|
221
|
-
await a({ bravo: { cancel:
|
|
232
|
+
await a({ bravo: { cancel: j, action: h, componentId: t } }), A = !0;
|
|
222
233
|
} catch {
|
|
223
234
|
}
|
|
224
235
|
else
|
|
@@ -243,7 +254,7 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
243
254
|
case "homepage":
|
|
244
255
|
break;
|
|
245
256
|
case "logout":
|
|
246
|
-
|
|
257
|
+
k(void 0);
|
|
247
258
|
break;
|
|
248
259
|
case "none":
|
|
249
260
|
break;
|
|
@@ -254,19 +265,19 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
254
265
|
window.location.href = `tel:${h.params.phone}`;
|
|
255
266
|
break;
|
|
256
267
|
case "remote":
|
|
257
|
-
const
|
|
258
|
-
|
|
268
|
+
const q = btoa(JSON.stringify(h.params?.data || {})), Z = `${o}/devices/apps/${g}/node/${t}/trigger/${h.event}?params=${q}`, G = await Ot.post(Z);
|
|
269
|
+
G.data?.action && await L(G.data);
|
|
259
270
|
break;
|
|
260
271
|
case "set-access-token":
|
|
261
|
-
|
|
272
|
+
k(h.params);
|
|
262
273
|
break;
|
|
263
274
|
case "set-state":
|
|
264
|
-
if (i &&
|
|
275
|
+
if (i && s)
|
|
265
276
|
if (console.log("🔵 Input group change:", {
|
|
266
277
|
groupName: i.groupName,
|
|
267
|
-
elementName:
|
|
278
|
+
elementName: s,
|
|
268
279
|
hasOnAction: typeof a == "function"
|
|
269
|
-
}), u(i.groupName,
|
|
280
|
+
}), u(i.groupName, s), typeof a == "function")
|
|
270
281
|
try {
|
|
271
282
|
await a({
|
|
272
283
|
bravo: {
|
|
@@ -277,29 +288,29 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
277
288
|
params: {
|
|
278
289
|
groupName: i.groupName,
|
|
279
290
|
groupType: i.type,
|
|
280
|
-
value:
|
|
291
|
+
value: s
|
|
281
292
|
},
|
|
282
293
|
event: "tap"
|
|
283
294
|
},
|
|
284
295
|
componentId: t
|
|
285
296
|
}
|
|
286
297
|
}), console.log("✅ Input group change event fired");
|
|
287
|
-
} catch (
|
|
288
|
-
console.error("❌ Error in onAction callback:",
|
|
298
|
+
} catch (z) {
|
|
299
|
+
console.error("❌ Error in onAction callback:", z);
|
|
289
300
|
}
|
|
290
301
|
else
|
|
291
302
|
console.warn("⚠️ No onAction callback provided");
|
|
292
303
|
else {
|
|
293
|
-
let
|
|
294
|
-
if (!
|
|
304
|
+
let z = S || h.params?.stateSetId || m.data?.stateSetId;
|
|
305
|
+
if (!z) {
|
|
295
306
|
console.error("❌ No stateSetId found in action or nodeData!", {
|
|
296
307
|
actionParams: h.params,
|
|
297
|
-
nodeDataStateSetId:
|
|
298
|
-
parentStatefulSetId:
|
|
308
|
+
nodeDataStateSetId: m.data?.stateSetId,
|
|
309
|
+
parentStatefulSetId: S
|
|
299
310
|
});
|
|
300
311
|
break;
|
|
301
312
|
}
|
|
302
|
-
|
|
313
|
+
l(z, h.params.state);
|
|
303
314
|
}
|
|
304
315
|
break;
|
|
305
316
|
case "showalert":
|
|
@@ -311,17 +322,17 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
311
322
|
};
|
|
312
323
|
if (r.href)
|
|
313
324
|
return /* @__PURE__ */ it(ut, { children: [
|
|
314
|
-
/* @__PURE__ */
|
|
325
|
+
/* @__PURE__ */ d(
|
|
315
326
|
"button",
|
|
316
327
|
{
|
|
317
328
|
type: "button",
|
|
318
|
-
onClick: () =>
|
|
329
|
+
onClick: () => L({
|
|
319
330
|
action: "goto",
|
|
320
331
|
params: { href: r.href },
|
|
321
332
|
event: "tap"
|
|
322
333
|
}),
|
|
323
334
|
style: {
|
|
324
|
-
...
|
|
335
|
+
...v,
|
|
325
336
|
cursor: "pointer",
|
|
326
337
|
background: "transparent",
|
|
327
338
|
border: "none",
|
|
@@ -332,16 +343,16 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
332
343
|
),
|
|
333
344
|
e
|
|
334
345
|
] });
|
|
335
|
-
let $ =
|
|
336
|
-
if (
|
|
346
|
+
let $ = m.actions && m.actions.length > 0 ? m.actions : r.actions || [];
|
|
347
|
+
if (S && $.length > 0 && ($ = $.map((h) => h.action === "set-state" ? (h.params?.stateSetId, {
|
|
337
348
|
...h,
|
|
338
349
|
params: {
|
|
339
350
|
...h.params,
|
|
340
|
-
stateSetId:
|
|
351
|
+
stateSetId: S
|
|
341
352
|
// Always use parent's id
|
|
342
353
|
}
|
|
343
|
-
}) : h)), $.length === 0 && (
|
|
344
|
-
if (i &&
|
|
354
|
+
}) : h)), $.length === 0 && (m.data?.stateSetId || S))
|
|
355
|
+
if (i && s)
|
|
345
356
|
$ = [
|
|
346
357
|
{
|
|
347
358
|
action: "set-state",
|
|
@@ -353,12 +364,12 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
353
364
|
}
|
|
354
365
|
];
|
|
355
366
|
else {
|
|
356
|
-
const h =
|
|
367
|
+
const h = S || m.data.stateSetId;
|
|
357
368
|
h ? $ = [
|
|
358
369
|
{
|
|
359
370
|
action: "set-state",
|
|
360
371
|
params: {
|
|
361
|
-
state:
|
|
372
|
+
state: R.getState().statefulSetVariants[h] === "active" ? "default" : "active",
|
|
362
373
|
stateSetId: h
|
|
363
374
|
// Use parent's id or button's stateSetId
|
|
364
375
|
},
|
|
@@ -373,25 +384,25 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
373
384
|
const h = $[0];
|
|
374
385
|
return h.event !== "tap" ? e : /* @__PURE__ */ it(ut, { children: [
|
|
375
386
|
e,
|
|
376
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ d(
|
|
377
388
|
"div",
|
|
378
389
|
{
|
|
379
390
|
onClick: (A) => {
|
|
380
|
-
A.stopPropagation(),
|
|
391
|
+
A.stopPropagation(), L(h);
|
|
381
392
|
},
|
|
382
393
|
onMouseDown: (A) => A.stopPropagation(),
|
|
383
394
|
onMouseUp: (A) => A.stopPropagation(),
|
|
384
|
-
style: { ...
|
|
395
|
+
style: { ...v, cursor: "pointer", pointerEvents: "auto" }
|
|
385
396
|
}
|
|
386
397
|
)
|
|
387
398
|
] });
|
|
388
399
|
}
|
|
389
400
|
return e;
|
|
390
401
|
}, ht = ({ id: t, name: r, nodeData: e }) => {
|
|
391
|
-
const n =
|
|
402
|
+
const n = W(e.style, {
|
|
392
403
|
debug: !1
|
|
393
404
|
});
|
|
394
|
-
return /* @__PURE__ */
|
|
405
|
+
return /* @__PURE__ */ d(
|
|
395
406
|
"iframe",
|
|
396
407
|
{
|
|
397
408
|
"data-id": t,
|
|
@@ -401,66 +412,86 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
401
412
|
src: e.data?.params?.url
|
|
402
413
|
}
|
|
403
414
|
);
|
|
415
|
+
}, Xt = ({ id: t, name: r, nodeData: e }) => {
|
|
416
|
+
const { patchedNodeData: n } = _({ id: t, nodeData: e });
|
|
417
|
+
e = n;
|
|
418
|
+
const i = W(e.style, {
|
|
419
|
+
debug: !1
|
|
420
|
+
}), s = R((a) => a.assetsById), o = e.style?.scaleMode || "fill";
|
|
421
|
+
o === "fill" ? i.objectFit = "cover" : o === "fit" && (i.objectFit = "contain"), i.objectPosition = "center";
|
|
422
|
+
let g = e.data?.videoUrl;
|
|
423
|
+
return !g && e.encoreData?.video && (g = e.encoreData.video), g || (g = s[e.assetId]?.url), !g && !i.backgroundColor && !i.borderColor ? null : /* @__PURE__ */ d(
|
|
424
|
+
"video",
|
|
425
|
+
{
|
|
426
|
+
"data-id": t,
|
|
427
|
+
"data-name": r,
|
|
428
|
+
"data-type": "VideoComponent",
|
|
429
|
+
style: { ...i },
|
|
430
|
+
src: g,
|
|
431
|
+
controls: !0,
|
|
432
|
+
playsInline: !0
|
|
433
|
+
}
|
|
434
|
+
);
|
|
404
435
|
}, gt = ({ id: t, name: r, nodeData: e }) => {
|
|
405
|
-
const n =
|
|
436
|
+
const n = W(e.style, {
|
|
406
437
|
debug: !1
|
|
407
438
|
});
|
|
408
439
|
if (!n.backgroundColor && !n.borderColor)
|
|
409
440
|
return null;
|
|
410
441
|
if (n.borderColor && !n.backgroundColor && (n.backgroundColor = "transparent"), n.borderColor && n.borderWidth) {
|
|
411
|
-
const
|
|
412
|
-
(!n.width || typeof n.width == "number" && n.width === 0) && (n.width =
|
|
442
|
+
const S = Math.max(n.borderWidth || 0, 1);
|
|
443
|
+
(!n.width || typeof n.width == "number" && n.width === 0) && (n.width = S), (!n.height || typeof n.height == "number" && n.height === 0) && (n.height = S), n.boxSizing = "border-box";
|
|
413
444
|
}
|
|
414
|
-
const i = Array.isArray(e.tags) && e.tags.includes("bravo:layer"),
|
|
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__ */
|
|
445
|
+
const i = Array.isArray(e.tags) && e.tags.includes("bravo:layer"), s = M(V)?.isFlex ?? !1, o = e.style?.positioning, g = 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 && (s || g), y = r && r.toLowerCase().startsWith("clip");
|
|
446
|
+
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__ */ d(Q, { id: t, nodeData: e, children: /* @__PURE__ */ d("div", { "data-name": r, "data-type": "ColorComponent", style: n }) });
|
|
416
447
|
}, mt = ({
|
|
417
448
|
id: t,
|
|
418
449
|
name: r,
|
|
419
450
|
nodeData: e
|
|
420
451
|
}) => {
|
|
421
|
-
const n =
|
|
452
|
+
const n = W(e.style, {
|
|
422
453
|
debug: !1
|
|
423
|
-
}), i = e.style,
|
|
454
|
+
}), i = e.style, s = Array.isArray(i?.gradientColorStops) ? i.gradientColorStops.map((o) => {
|
|
424
455
|
if (!o?.color) return null;
|
|
425
|
-
const
|
|
456
|
+
const g = st(o.color);
|
|
426
457
|
if (typeof o.position == "number") {
|
|
427
458
|
const a = o.position * 100;
|
|
428
|
-
return `${
|
|
459
|
+
return `${g} ${a}%`;
|
|
429
460
|
}
|
|
430
|
-
return
|
|
461
|
+
return g;
|
|
431
462
|
}).filter(Boolean).join(", ") : "";
|
|
432
|
-
if (
|
|
463
|
+
if (s) {
|
|
433
464
|
const o = i?.gradientType || "linear";
|
|
434
|
-
n.backgroundImage = o === "radial" ? `radial-gradient(${
|
|
465
|
+
n.backgroundImage = o === "radial" ? `radial-gradient(${s})` : `linear-gradient(${s})`, delete n.backgroundColor;
|
|
435
466
|
}
|
|
436
|
-
return /* @__PURE__ */
|
|
467
|
+
return /* @__PURE__ */ d(Q, { id: t, nodeData: e, children: /* @__PURE__ */ d("div", { "data-name": r, "data-type": "GradientComponent", style: n }) });
|
|
437
468
|
}, yt = ({ id: t, name: r, nodeData: e }) => {
|
|
438
|
-
const { patchedNodeData: n } =
|
|
469
|
+
const { patchedNodeData: n } = _({ id: t, nodeData: e });
|
|
439
470
|
e = n;
|
|
440
|
-
const i =
|
|
471
|
+
const i = W(e.style, {
|
|
441
472
|
debug: !1
|
|
442
|
-
}),
|
|
443
|
-
|
|
473
|
+
}), s = M(V), o = R((u) => u.assetsById), g = e.style?.scaleMode || "fill";
|
|
474
|
+
g === "fill" ? i.objectFit = "cover" : g === "fit" && (i.objectFit = "contain"), i.objectPosition = "center";
|
|
444
475
|
let a = e.data?.imageUrl;
|
|
445
476
|
!a && e.encoreData?.image && (a = e.encoreData.image.startsWith("//") ? `https:${e.encoreData.image}` : e.encoreData.image), a || (a = o[e.assetId]?.url);
|
|
446
|
-
const y = e.style?.positioning,
|
|
447
|
-
if (y &&
|
|
448
|
-
const u = typeof y.left == "number" && typeof y.right == "number",
|
|
477
|
+
const y = e.style?.positioning, S = e.style?.aspectRatio, m = s.dimensions?.width || 0, l = s.dimensions?.height || 0;
|
|
478
|
+
if (y && S && m > 0) {
|
|
479
|
+
const u = typeof y.left == "number" && typeof y.right == "number", k = typeof y.top == "number" && typeof y.bottom == "number";
|
|
449
480
|
if (u) {
|
|
450
481
|
const w = 100 - y.left - y.right;
|
|
451
482
|
if (w > 0) {
|
|
452
|
-
const
|
|
453
|
-
i.width =
|
|
483
|
+
const v = w * m / 100;
|
|
484
|
+
i.width = v, i.height = v / S, i.left = `${Math.max(0, y.left)}%`, i.top = `${Math.max(0, y.top)}%`, delete i.right, delete i.bottom;
|
|
454
485
|
}
|
|
455
|
-
} else if (
|
|
486
|
+
} else if (k && l > 0) {
|
|
456
487
|
const w = 100 - y.top - y.bottom;
|
|
457
488
|
if (w > 0) {
|
|
458
|
-
const
|
|
459
|
-
i.height =
|
|
489
|
+
const v = w * l / 100;
|
|
490
|
+
i.height = v, i.width = v * S, i.left = `${Math.max(0, y.left)}%`, i.top = `${Math.max(0, y.top)}%`, delete i.right, delete i.bottom;
|
|
460
491
|
}
|
|
461
492
|
}
|
|
462
493
|
}
|
|
463
|
-
return /* @__PURE__ */
|
|
494
|
+
return /* @__PURE__ */ d(Q, { id: t, nodeData: e, children: /* @__PURE__ */ d(
|
|
464
495
|
"img",
|
|
465
496
|
{
|
|
466
497
|
"data-id": t,
|
|
@@ -476,11 +507,11 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
476
507
|
name: r,
|
|
477
508
|
nodeData: e
|
|
478
509
|
}) => {
|
|
479
|
-
const n =
|
|
480
|
-
return /* @__PURE__ */
|
|
510
|
+
const n = R((s) => s.setFormInputValue), i = W(e.style, { debug: !1 });
|
|
511
|
+
return /* @__PURE__ */ d(
|
|
481
512
|
"input",
|
|
482
513
|
{
|
|
483
|
-
onChange: (
|
|
514
|
+
onChange: (s) => n(t, s.target.value),
|
|
484
515
|
"data-id": t,
|
|
485
516
|
"data-name": r,
|
|
486
517
|
"data-type": "EmailInputComponent",
|
|
@@ -494,8 +525,8 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
494
525
|
name: r,
|
|
495
526
|
nodeData: e
|
|
496
527
|
}) => {
|
|
497
|
-
const n =
|
|
498
|
-
return n.visibility = "hidden", /* @__PURE__ */
|
|
528
|
+
const n = W(e.style);
|
|
529
|
+
return n.visibility = "hidden", /* @__PURE__ */ d(
|
|
499
530
|
"input",
|
|
500
531
|
{
|
|
501
532
|
"data-id": t,
|
|
@@ -505,21 +536,21 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
505
536
|
type: "hidden"
|
|
506
537
|
}
|
|
507
538
|
);
|
|
508
|
-
},
|
|
539
|
+
}, vt = ({
|
|
509
540
|
id: t,
|
|
510
541
|
name: r,
|
|
511
542
|
nodeData: e
|
|
512
543
|
}) => {
|
|
513
|
-
const n =
|
|
544
|
+
const n = R((o) => o.setFormInputValue), i = W(e.style, { debug: !1 }), s = R((o) => o.assetsById);
|
|
514
545
|
return /* @__PURE__ */ it(ut, { children: [
|
|
515
|
-
/* @__PURE__ */
|
|
546
|
+
/* @__PURE__ */ d(
|
|
516
547
|
"div",
|
|
517
548
|
{
|
|
518
549
|
style: { ...i, zIndex: 9999, cursor: "pointer" },
|
|
519
550
|
onClick: () => alert("Image picker")
|
|
520
551
|
}
|
|
521
552
|
),
|
|
522
|
-
/* @__PURE__ */
|
|
553
|
+
/* @__PURE__ */ d(
|
|
523
554
|
"img",
|
|
524
555
|
{
|
|
525
556
|
onChange: (o) => n(t, o.target.value),
|
|
@@ -527,7 +558,7 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
527
558
|
"data-id": t,
|
|
528
559
|
"data-name": r,
|
|
529
560
|
"data-type": "ImageInputComponent",
|
|
530
|
-
src:
|
|
561
|
+
src: s[e.assetId]?.url,
|
|
531
562
|
alt: r
|
|
532
563
|
}
|
|
533
564
|
)
|
|
@@ -537,11 +568,11 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
537
568
|
name: r,
|
|
538
569
|
nodeData: e
|
|
539
570
|
}) => {
|
|
540
|
-
const n =
|
|
541
|
-
return /* @__PURE__ */
|
|
571
|
+
const n = R((s) => s.setFormInputValue), i = W(e.style, { debug: !1 });
|
|
572
|
+
return /* @__PURE__ */ d(
|
|
542
573
|
"input",
|
|
543
574
|
{
|
|
544
|
-
onChange: (
|
|
575
|
+
onChange: (s) => n(t, s.target.value),
|
|
545
576
|
"data-id": t,
|
|
546
577
|
"data-name": r,
|
|
547
578
|
"data-type": "PasswordInputComponent",
|
|
@@ -550,25 +581,25 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
550
581
|
type: "password"
|
|
551
582
|
}
|
|
552
583
|
);
|
|
553
|
-
},
|
|
584
|
+
}, St = ({
|
|
554
585
|
id: t,
|
|
555
586
|
name: r,
|
|
556
587
|
nodeData: e
|
|
557
588
|
}) => {
|
|
558
|
-
const n =
|
|
589
|
+
const n = R((m) => m.setFormInputValue), { onAction: i } = x.useContext(ft), { patchedNodeData: s } = _({ id: t, nodeData: e }), o = W(s.style, { debug: !1 });
|
|
559
590
|
o.width = "100%", o.flex = "1", o.minWidth = "0", o.boxSizing = "border-box", o.borderColor = o.borderColor ?? "transparent";
|
|
560
|
-
const
|
|
591
|
+
const g = s.data?.value, a = s.data?.options, y = x.useMemo(() => !a || !Array.isArray(a) ? [] : a.map((m) => typeof m == "string" ? { value: m, label: m } : m), [a]);
|
|
561
592
|
return /* @__PURE__ */ it(
|
|
562
593
|
"select",
|
|
563
594
|
{
|
|
564
595
|
"data-id": t,
|
|
565
596
|
"data-name": r,
|
|
566
597
|
"data-type": "SelectInputComponent",
|
|
567
|
-
value:
|
|
598
|
+
value: g ?? "",
|
|
568
599
|
style: o,
|
|
569
|
-
onChange: async (
|
|
570
|
-
const
|
|
571
|
-
if (n(t,
|
|
600
|
+
onChange: async (m) => {
|
|
601
|
+
const l = m.target.value;
|
|
602
|
+
if (n(t, l), console.log(`Select changed: ${l}`), typeof i == "function")
|
|
572
603
|
try {
|
|
573
604
|
await i({
|
|
574
605
|
bravo: {
|
|
@@ -577,7 +608,7 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
577
608
|
action: {
|
|
578
609
|
action: "select-change",
|
|
579
610
|
nodeId: t,
|
|
580
|
-
params: { value:
|
|
611
|
+
params: { value: l }
|
|
581
612
|
},
|
|
582
613
|
componentId: t
|
|
583
614
|
}
|
|
@@ -586,8 +617,8 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
586
617
|
}
|
|
587
618
|
},
|
|
588
619
|
children: [
|
|
589
|
-
y.length === 0 && /* @__PURE__ */
|
|
590
|
-
y.map((
|
|
620
|
+
y.length === 0 && /* @__PURE__ */ d("option", { value: "", disabled: !0, children: "Select an option..." }),
|
|
621
|
+
y.map((m) => /* @__PURE__ */ d("option", { value: m.value, children: m.label }, m.value))
|
|
591
622
|
]
|
|
592
623
|
}
|
|
593
624
|
);
|
|
@@ -596,13 +627,13 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
596
627
|
name: r,
|
|
597
628
|
nodeData: e
|
|
598
629
|
}) => {
|
|
599
|
-
const n =
|
|
630
|
+
const n = R((s) => s.setFormInputValue), i = W(e.style, {
|
|
600
631
|
debug: !1
|
|
601
632
|
});
|
|
602
|
-
return /* @__PURE__ */
|
|
633
|
+
return /* @__PURE__ */ d(
|
|
603
634
|
"input",
|
|
604
635
|
{
|
|
605
|
-
onChange: (
|
|
636
|
+
onChange: (s) => n(t, s.target.value),
|
|
606
637
|
name: t,
|
|
607
638
|
"data-id": t,
|
|
608
639
|
"data-name": r,
|
|
@@ -618,8 +649,8 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
618
649
|
nodeData: e,
|
|
619
650
|
children: n
|
|
620
651
|
}) => {
|
|
621
|
-
const i =
|
|
622
|
-
return /* @__PURE__ */
|
|
652
|
+
const i = W(e.style);
|
|
653
|
+
return /* @__PURE__ */ d(Q, { id: t, nodeData: e, children: /* @__PURE__ */ d(
|
|
623
654
|
"div",
|
|
624
655
|
{
|
|
625
656
|
"data-id": t,
|
|
@@ -630,21 +661,21 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
630
661
|
}
|
|
631
662
|
) });
|
|
632
663
|
}, At = ({ id: t, name: r, nodeData: e }) => {
|
|
633
|
-
const n =
|
|
664
|
+
const n = W(e.style, {
|
|
634
665
|
debug: !1
|
|
635
|
-
}), i =
|
|
636
|
-
if (
|
|
637
|
-
const o = typeof
|
|
666
|
+
}), i = R((o) => o.assetsById), s = e.style?.positioning;
|
|
667
|
+
if (s) {
|
|
668
|
+
const o = typeof s.left == "number" && typeof s.right == "number", g = typeof s.top == "number" && typeof s.bottom == "number";
|
|
638
669
|
if (o) {
|
|
639
|
-
const a = 100 -
|
|
640
|
-
n.width = `${a}%`, n.left = `${
|
|
670
|
+
const a = 100 - s.left - s.right;
|
|
671
|
+
n.width = `${a}%`, n.left = `${s.left}%`, delete n.right;
|
|
641
672
|
}
|
|
642
|
-
if (
|
|
643
|
-
const a = 100 -
|
|
644
|
-
n.height = `${a}%`, n.top = `${
|
|
673
|
+
if (g) {
|
|
674
|
+
const a = 100 - s.top - s.bottom;
|
|
675
|
+
n.height = `${a}%`, n.top = `${s.top}%`, delete n.bottom;
|
|
645
676
|
}
|
|
646
677
|
}
|
|
647
|
-
return n.objectFit || (n.objectFit = "fill"), /* @__PURE__ */
|
|
678
|
+
return n.objectFit || (n.objectFit = "fill"), /* @__PURE__ */ d(Q, { id: t, nodeData: e, children: /* @__PURE__ */ d(
|
|
648
679
|
"img",
|
|
649
680
|
{
|
|
650
681
|
"data-id": t,
|
|
@@ -655,8 +686,8 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
655
686
|
alt: r
|
|
656
687
|
}
|
|
657
688
|
) });
|
|
658
|
-
},
|
|
659
|
-
const { patchedNodeData: n } =
|
|
689
|
+
}, Ft = ({ id: t, name: r, nodeData: e }) => {
|
|
690
|
+
const { patchedNodeData: n } = _({ id: t, nodeData: e });
|
|
660
691
|
e = n;
|
|
661
692
|
const i = e.data?.text;
|
|
662
693
|
r && r.includes("Purpose") && console.log("TextComponent Debug:", {
|
|
@@ -666,24 +697,24 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
666
697
|
style: e.style,
|
|
667
698
|
color: e.style?.color
|
|
668
699
|
});
|
|
669
|
-
const
|
|
700
|
+
const s = e.style, o = e.fontId ? { ...s, fontId: e.fontId } : s, g = W(o, {
|
|
670
701
|
debug: !1
|
|
671
702
|
});
|
|
672
|
-
|
|
703
|
+
g.display = "flex", g.flexDirection = "column", s.verticalPosition && (g.justifyContent = {
|
|
673
704
|
"from-top": "flex-start",
|
|
674
705
|
center: "center",
|
|
675
706
|
"from-bottom": "flex-end"
|
|
676
|
-
}[
|
|
707
|
+
}[s.verticalPosition]);
|
|
677
708
|
const a = i && (i.includes(`
|
|
678
709
|
`) || i.includes("\r"));
|
|
679
710
|
let y;
|
|
680
|
-
return a &&
|
|
711
|
+
return a && g.flexDirection === "column" ? y = i.split(/\r?\n/).filter((m) => m.length > 0).map((m, l) => /* @__PURE__ */ d("div", { style: { lineHeight: "inherit" }, children: m }, l)) : y = i, /* @__PURE__ */ d(Q, { id: t, nodeData: e, children: /* @__PURE__ */ d(
|
|
681
712
|
"div",
|
|
682
713
|
{
|
|
683
714
|
"data-id": t,
|
|
684
715
|
"data-name": r,
|
|
685
716
|
"data-type": "TextComponent",
|
|
686
|
-
style:
|
|
717
|
+
style: g,
|
|
687
718
|
children: y
|
|
688
719
|
}
|
|
689
720
|
) });
|
|
@@ -693,82 +724,82 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
693
724
|
nodeData: e,
|
|
694
725
|
children: n
|
|
695
726
|
}) => {
|
|
696
|
-
const i =
|
|
697
|
-
e =
|
|
698
|
-
const o =
|
|
727
|
+
const i = M(Y), { patchedNodeData: s } = _({ id: t, nodeData: e });
|
|
728
|
+
e = s;
|
|
729
|
+
const o = Ut(e.tags), g = o ? R((w) => w.inputGroups[o.groupName]) : null, a = R((w) => w.statefulSetVariants[t]), y = W(e.style, {
|
|
699
730
|
debug: !1
|
|
700
731
|
});
|
|
701
|
-
let
|
|
702
|
-
o &&
|
|
703
|
-
const
|
|
732
|
+
let S;
|
|
733
|
+
o && g !== null ? S = g === r ? "active" : "default" : S = a || e.data.initialState || "default";
|
|
734
|
+
const m = x.Children.toArray(n).find((w) => x.isValidElement(w) ? w.props?.nodeData?.data?.state === S : !1), l = x.isValidElement(m) ? x.cloneElement(m, {
|
|
704
735
|
_parentStatefulSetId: t,
|
|
705
736
|
_parentInputGroupInfo: o,
|
|
706
737
|
_parentName: r
|
|
707
738
|
// Pass the name so we can identify which element is active
|
|
708
|
-
}) :
|
|
739
|
+
}) : m, u = /* @__PURE__ */ d(
|
|
709
740
|
"div",
|
|
710
741
|
{
|
|
711
742
|
"data-id": t,
|
|
712
743
|
"data-name": r,
|
|
713
744
|
"data-type": "StatefulSetComponent",
|
|
714
745
|
style: y,
|
|
715
|
-
children:
|
|
746
|
+
children: l
|
|
716
747
|
}
|
|
717
748
|
);
|
|
718
749
|
if (e.type === "component:input-stateful-set")
|
|
719
750
|
return u;
|
|
720
|
-
const
|
|
721
|
-
return /* @__PURE__ */
|
|
722
|
-
|
|
751
|
+
const k = x.useContext(lt);
|
|
752
|
+
return /* @__PURE__ */ d(
|
|
753
|
+
Y.Provider,
|
|
723
754
|
{
|
|
724
755
|
value: { nodeData: i?.nodeData?.[t] || {} },
|
|
725
|
-
children: /* @__PURE__ */
|
|
756
|
+
children: /* @__PURE__ */ d(
|
|
726
757
|
lt.Provider,
|
|
727
758
|
{
|
|
728
|
-
value: { ...
|
|
759
|
+
value: { ...k, statefulSetId: t },
|
|
729
760
|
children: u
|
|
730
761
|
}
|
|
731
762
|
)
|
|
732
763
|
}
|
|
733
764
|
);
|
|
734
|
-
},
|
|
765
|
+
}, Et = ({
|
|
735
766
|
id: t,
|
|
736
767
|
name: r,
|
|
737
768
|
nodeData: e,
|
|
738
769
|
children: n,
|
|
739
770
|
_parentStatefulSetId: i,
|
|
740
|
-
_parentInputGroupInfo:
|
|
771
|
+
_parentInputGroupInfo: s,
|
|
741
772
|
_parentName: o
|
|
742
773
|
}) => {
|
|
743
|
-
const
|
|
774
|
+
const g = W(e.style, {
|
|
744
775
|
debug: !1
|
|
745
776
|
}), a = {
|
|
746
|
-
...
|
|
747
|
-
position:
|
|
777
|
+
...g,
|
|
778
|
+
position: g.position || "relative"
|
|
748
779
|
};
|
|
749
|
-
return /* @__PURE__ */
|
|
780
|
+
return /* @__PURE__ */ d(
|
|
750
781
|
"div",
|
|
751
782
|
{
|
|
752
783
|
"data-id": t,
|
|
753
784
|
"data-name": r,
|
|
754
785
|
"data-type": "StatefulCompoundComponent",
|
|
755
786
|
style: a,
|
|
756
|
-
children: /* @__PURE__ */
|
|
757
|
-
|
|
787
|
+
children: /* @__PURE__ */ d(
|
|
788
|
+
Q,
|
|
758
789
|
{
|
|
759
790
|
id: t,
|
|
760
791
|
nodeData: e,
|
|
761
792
|
_parentStatefulSetId: i,
|
|
762
|
-
_parentInputGroupInfo:
|
|
793
|
+
_parentInputGroupInfo: s,
|
|
763
794
|
_parentName: o,
|
|
764
795
|
children: n
|
|
765
796
|
}
|
|
766
797
|
)
|
|
767
798
|
}
|
|
768
799
|
);
|
|
769
|
-
},
|
|
770
|
-
|
|
771
|
-
const { dimensions: n, ref: i } = rt(),
|
|
800
|
+
}, Pt = ({ id: t, name: r, children: e }) => {
|
|
801
|
+
M(V);
|
|
802
|
+
const { dimensions: n, ref: i } = rt(), s = {
|
|
772
803
|
zIndex: 0,
|
|
773
804
|
flex: 1,
|
|
774
805
|
position: "absolute",
|
|
@@ -777,14 +808,14 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
777
808
|
width: "100%",
|
|
778
809
|
height: "100%"
|
|
779
810
|
};
|
|
780
|
-
return /* @__PURE__ */
|
|
811
|
+
return /* @__PURE__ */ d(V.Provider, { value: { dimensions: n, isFlex: !1 }, children: /* @__PURE__ */ d(
|
|
781
812
|
"div",
|
|
782
813
|
{
|
|
783
814
|
"data-id": t,
|
|
784
815
|
"data-name": r,
|
|
785
816
|
"data-type": "BackgroundContainerComponent",
|
|
786
817
|
ref: i,
|
|
787
|
-
style:
|
|
818
|
+
style: s,
|
|
788
819
|
children: e
|
|
789
820
|
}
|
|
790
821
|
) });
|
|
@@ -794,57 +825,57 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
794
825
|
nodeData: e,
|
|
795
826
|
children: n,
|
|
796
827
|
_arrayItemIndex: i,
|
|
797
|
-
_arrayItemData:
|
|
828
|
+
_arrayItemData: s
|
|
798
829
|
}) => {
|
|
799
830
|
t === "01KB929X1KK5TX0K8VBNP6ZDPG" && console.log(
|
|
800
831
|
`[DEBUG] ContainerComponent ${t} (Hero) FULL nodeData:`,
|
|
801
832
|
JSON.stringify(e, null, 2)
|
|
802
833
|
);
|
|
803
|
-
const o =
|
|
834
|
+
const o = M(Y), { patchedNodeData: g, list: a, arrayData: y } = _({
|
|
804
835
|
id: t,
|
|
805
836
|
nodeData: e
|
|
806
837
|
});
|
|
807
|
-
e =
|
|
808
|
-
const { dimensions:
|
|
838
|
+
e = g;
|
|
839
|
+
const { dimensions: S, ref: m } = rt(), l = W(e.style, {
|
|
809
840
|
debug: !1
|
|
810
|
-
}), u = !!e.style.layout?.mode,
|
|
811
|
-
if (!w && !A && !(
|
|
812
|
-
const B = !$ && e.style.positioning,
|
|
841
|
+
}), u = !!e.style.layout?.mode, k = e.style.layout?.mode === "HORIZONTAL" ? "row" : "column", w = l.width !== void 0, v = l.height !== void 0, L = M(V), $ = L?.isFlex ?? !1, h = L?.flexDirection, A = $ && h === "row", j = !$ && e.style.positioning, q = e.style.layout?.layoutSizingHorizontal === "FIXED" || e.style.layout?.layoutSizingVertical === "FIXED", Z = e.style.layout?.layoutSizingHorizontal === "HUG" || e.style.layout?.layoutSizingVertical === "HUG";
|
|
842
|
+
if (!w && !A && !(j && (q || Z)) && (l.width = "100%"), !v) {
|
|
843
|
+
const B = !$ && e.style.positioning, O = e.style.layout?.layoutSizingVertical === "FILL";
|
|
813
844
|
if (!(e.style.layout?.layoutSizingVertical === "HUG")) {
|
|
814
|
-
if (!u) if (B &&
|
|
815
|
-
const
|
|
816
|
-
|
|
845
|
+
if (!u) if (B && O && e.style.positioning?.top !== void 0) {
|
|
846
|
+
const tt = 100 - e.style.positioning.top;
|
|
847
|
+
l.height = `${tt}%`;
|
|
817
848
|
} else
|
|
818
|
-
|
|
849
|
+
l.height = "100%";
|
|
819
850
|
}
|
|
820
851
|
}
|
|
821
|
-
const
|
|
822
|
-
width:
|
|
823
|
-
height:
|
|
852
|
+
const G = e.style.layout?.layoutSizingHorizontal || e.style.layout?.layoutSizingVertical, K = e.style.positioning && !u && (G || !0) ? { ...l, position: "absolute" } : l.position === "absolute" ? l : { ...l, position: l.position || "relative" }, U = (B) => typeof B == "number" ? B : typeof B == "string" && B.endsWith("px") && parseFloat(B) || 0, E = U(l.paddingLeft), p = U(l.paddingRight), J = U(l.paddingTop), N = U(l.paddingBottom), P = q && typeof l.width == "number" && typeof l.height == "number" ? {
|
|
853
|
+
width: l.width - E - p,
|
|
854
|
+
height: l.height - J - N
|
|
824
855
|
} : {
|
|
825
|
-
width:
|
|
826
|
-
height:
|
|
856
|
+
width: S.width - E - p,
|
|
857
|
+
height: S.height - J - N
|
|
827
858
|
};
|
|
828
859
|
if (i != null && a) {
|
|
829
860
|
const B = a[i];
|
|
830
861
|
if (B !== void 0) {
|
|
831
|
-
const
|
|
862
|
+
const O = typeof B == "object" && B !== null ? {
|
|
832
863
|
nodeData: B,
|
|
833
864
|
arrayDataById: o?.arrayDataById,
|
|
834
865
|
textOverridesById: o?.textOverridesById,
|
|
835
866
|
rootData: o?.rootData
|
|
836
867
|
} : { nodeData: B };
|
|
837
|
-
return /* @__PURE__ */
|
|
868
|
+
return /* @__PURE__ */ d(Y.Provider, { value: O, children: /* @__PURE__ */ d(
|
|
838
869
|
V.Provider,
|
|
839
870
|
{
|
|
840
|
-
value: { dimensions: P, isFlex: u, flexDirection:
|
|
841
|
-
children: /* @__PURE__ */
|
|
871
|
+
value: { dimensions: P, isFlex: u, flexDirection: k },
|
|
872
|
+
children: /* @__PURE__ */ d(
|
|
842
873
|
"div",
|
|
843
874
|
{
|
|
844
875
|
"data-id": `${t}:${i}`,
|
|
845
876
|
"data-name": r,
|
|
846
877
|
"data-type": "ContainerComponent",
|
|
847
|
-
style:
|
|
878
|
+
style: K,
|
|
848
879
|
children: n
|
|
849
880
|
}
|
|
850
881
|
)
|
|
@@ -854,28 +885,28 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
854
885
|
}
|
|
855
886
|
if (a) {
|
|
856
887
|
const B = y || a;
|
|
857
|
-
return
|
|
858
|
-
const
|
|
859
|
-
nodeData:
|
|
888
|
+
return Vt(() => B.map((X, ot) => {
|
|
889
|
+
const tt = typeof X == "object" && X !== null ? {
|
|
890
|
+
nodeData: X,
|
|
860
891
|
arrayDataById: o?.arrayDataById,
|
|
861
892
|
textOverridesById: o?.textOverridesById,
|
|
862
893
|
rootData: o?.rootData
|
|
863
|
-
} : { nodeData:
|
|
864
|
-
return /* @__PURE__ */
|
|
865
|
-
|
|
894
|
+
} : { nodeData: X };
|
|
895
|
+
return /* @__PURE__ */ d(
|
|
896
|
+
Y.Provider,
|
|
866
897
|
{
|
|
867
|
-
value:
|
|
868
|
-
children: /* @__PURE__ */
|
|
898
|
+
value: tt,
|
|
899
|
+
children: /* @__PURE__ */ d(
|
|
869
900
|
V.Provider,
|
|
870
901
|
{
|
|
871
|
-
value: { dimensions: P, isFlex: u, flexDirection:
|
|
872
|
-
children: /* @__PURE__ */
|
|
902
|
+
value: { dimensions: P, isFlex: u, flexDirection: k },
|
|
903
|
+
children: /* @__PURE__ */ d(
|
|
873
904
|
"div",
|
|
874
905
|
{
|
|
875
906
|
"data-id": `${t}:${ot}`,
|
|
876
907
|
"data-name": r,
|
|
877
908
|
"data-type": "ContainerComponent",
|
|
878
|
-
style:
|
|
909
|
+
style: K,
|
|
879
910
|
children: n
|
|
880
911
|
}
|
|
881
912
|
)
|
|
@@ -888,53 +919,53 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
888
919
|
}
|
|
889
920
|
let F = e.actions || [];
|
|
890
921
|
!Array.isArray(F) && typeof F == "object" && F !== null && (F = Object.entries(F).map(
|
|
891
|
-
([B,
|
|
922
|
+
([B, O]) => ({
|
|
892
923
|
event: B,
|
|
893
|
-
...typeof
|
|
924
|
+
...typeof O == "object" && O !== null ? O : {}
|
|
894
925
|
})
|
|
895
926
|
));
|
|
896
|
-
const
|
|
897
|
-
return /* @__PURE__ */
|
|
927
|
+
const H = Array.isArray(F) && F.length > 0;
|
|
928
|
+
return /* @__PURE__ */ d(
|
|
898
929
|
V.Provider,
|
|
899
930
|
{
|
|
900
|
-
value: { dimensions: P, isFlex: u, flexDirection:
|
|
901
|
-
children: /* @__PURE__ */
|
|
931
|
+
value: { dimensions: P, isFlex: u, flexDirection: k },
|
|
932
|
+
children: /* @__PURE__ */ d(
|
|
902
933
|
"div",
|
|
903
934
|
{
|
|
904
935
|
"data-id": t,
|
|
905
936
|
"data-name": r,
|
|
906
937
|
"data-type": "ContainerComponent",
|
|
907
|
-
ref:
|
|
908
|
-
style:
|
|
909
|
-
children:
|
|
938
|
+
ref: m,
|
|
939
|
+
style: K,
|
|
940
|
+
children: H ? /* @__PURE__ */ d(Q, { id: t, nodeData: e, children: n }) : n
|
|
910
941
|
}
|
|
911
942
|
)
|
|
912
943
|
}
|
|
913
944
|
);
|
|
914
|
-
},
|
|
915
|
-
const { dimensions: i, ref:
|
|
945
|
+
}, Tt = pt, Bt = ({ id: t, name: r, nodeData: e, children: n }) => {
|
|
946
|
+
const { dimensions: i, ref: s } = rt(), o = W(e.style, {
|
|
916
947
|
debug: !1
|
|
917
|
-
}),
|
|
918
|
-
return /* @__PURE__ */
|
|
948
|
+
}), g = !!e.style.layout?.mode, a = e.style.layout?.mode === "HORIZONTAL" ? "row" : "column", y = o.position ? o : { ...o, position: "relative" };
|
|
949
|
+
return /* @__PURE__ */ d(
|
|
919
950
|
V.Provider,
|
|
920
951
|
{
|
|
921
|
-
value: { dimensions: i, isFlex:
|
|
922
|
-
children: /* @__PURE__ */
|
|
952
|
+
value: { dimensions: i, isFlex: g, flexDirection: a },
|
|
953
|
+
children: /* @__PURE__ */ d(
|
|
923
954
|
"div",
|
|
924
955
|
{
|
|
925
956
|
"data-id": t,
|
|
926
957
|
"data-name": r,
|
|
927
958
|
"data-type": "TopBarContainerComponent",
|
|
928
|
-
ref:
|
|
959
|
+
ref: s,
|
|
929
960
|
style: y,
|
|
930
961
|
children: n
|
|
931
962
|
}
|
|
932
963
|
)
|
|
933
964
|
}
|
|
934
965
|
);
|
|
935
|
-
},
|
|
936
|
-
const i =
|
|
937
|
-
return /* @__PURE__ */
|
|
966
|
+
}, Zt = ({ id: t, name: r, nodeData: e, children: n }) => {
|
|
967
|
+
const i = W(e.style, { debug: !1 });
|
|
968
|
+
return /* @__PURE__ */ d(
|
|
938
969
|
"div",
|
|
939
970
|
{
|
|
940
971
|
"data-id": t,
|
|
@@ -944,20 +975,20 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
944
975
|
children: n
|
|
945
976
|
}
|
|
946
977
|
);
|
|
947
|
-
},
|
|
978
|
+
}, Wt = ({ id: t, name: r, nodeData: e, children: n }) => /* @__PURE__ */ d(
|
|
948
979
|
"div",
|
|
949
980
|
{
|
|
950
981
|
"data-id": t,
|
|
951
982
|
"data-name": r,
|
|
952
983
|
"data-type": "TabsMenuComponent",
|
|
953
|
-
style:
|
|
984
|
+
style: W(e.style),
|
|
954
985
|
children: n
|
|
955
986
|
}
|
|
956
|
-
),
|
|
957
|
-
const i =
|
|
987
|
+
), Lt = ({ id: t, name: r, nodeData: e, children: n }) => {
|
|
988
|
+
const i = W(e.style, {
|
|
958
989
|
debug: !1
|
|
959
990
|
});
|
|
960
|
-
return /* @__PURE__ */
|
|
991
|
+
return /* @__PURE__ */ d(
|
|
961
992
|
"div",
|
|
962
993
|
{
|
|
963
994
|
"data-id": t,
|
|
@@ -972,176 +1003,176 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
972
1003
|
`[DEBUG] SliderComponent ${t} FULL nodeData:`,
|
|
973
1004
|
JSON.stringify(e, null, 2)
|
|
974
1005
|
);
|
|
975
|
-
const { dimensions: i, ref:
|
|
1006
|
+
const { dimensions: i, ref: s } = rt(), o = x.useRef(null), g = x.useRef(null), a = x.useRef(!1), y = x.useRef(null), S = M(ct), m = M(jt), { onAction: l } = M(ft), [u, k] = x.useState({
|
|
976
1007
|
currentIndex: void 0,
|
|
977
1008
|
onIndexChange: void 0
|
|
978
|
-
}), [w,
|
|
1009
|
+
}), [w, v] = x.useState(0), L = x.useRef(null), { patchedNodeData: $ } = _({ id: t, nodeData: e });
|
|
979
1010
|
e = $;
|
|
980
|
-
const h = e.data?.params || {}, A = h.infinite === !0,
|
|
981
|
-
let
|
|
982
|
-
if (!
|
|
983
|
-
const c = e.style?.width,
|
|
984
|
-
typeof c == "number" && typeof
|
|
1011
|
+
const h = e.data?.params || {}, A = h.infinite === !0, j = h.automatic === !0;
|
|
1012
|
+
let Z = Array.isArray(e.tags) && e.tags.some((c) => c.includes("container:slider:vertical")) || e.name && e.name.includes("container:slider:vertical");
|
|
1013
|
+
if (!Z && h.animation === "default") {
|
|
1014
|
+
const c = e.style?.width, f = e.style?.height;
|
|
1015
|
+
typeof c == "number" && typeof f == "number" && f > c && (Z = !0);
|
|
985
1016
|
}
|
|
986
|
-
const
|
|
1017
|
+
const G = Z ? "vertical" : h.animation === "default" ? "horizontal" : h.animation || "horizontal", z = W(e.style, {
|
|
987
1018
|
debug: !1
|
|
988
|
-
}),
|
|
989
|
-
|
|
990
|
-
const
|
|
1019
|
+
}), K = z.width !== void 0, U = z.height !== void 0;
|
|
1020
|
+
K || (z.width = "100%"), U || (z.height = "100%"), z.position || (z.position = "relative");
|
|
1021
|
+
const E = M(Y), p = x.useMemo(() => {
|
|
991
1022
|
const c = [];
|
|
992
|
-
return x.Children.forEach(n, (
|
|
993
|
-
if (
|
|
994
|
-
const I =
|
|
995
|
-
if (Array.isArray(C?.tags) && (C.tags.includes("encore:data:array") || C.tags.includes("bravo:data:array")) && I.id &&
|
|
996
|
-
const T =
|
|
997
|
-
T && T.length > 0 ? T.forEach((
|
|
1023
|
+
return x.Children.forEach(n, (f) => {
|
|
1024
|
+
if (f == null) return;
|
|
1025
|
+
const I = f?.props || {}, C = I.nodeData || {};
|
|
1026
|
+
if (Array.isArray(C?.tags) && (C.tags.includes("encore:data:array") || C.tags.includes("bravo:data:array")) && I.id && E) {
|
|
1027
|
+
const T = E?.arrayDataById && E.arrayDataById[I.id] && Array.isArray(E.arrayDataById[I.id]) ? E.arrayDataById[I.id] : null;
|
|
1028
|
+
T && T.length > 0 ? T.forEach((et, nt) => {
|
|
998
1029
|
c.push(
|
|
999
|
-
x.cloneElement(
|
|
1030
|
+
x.cloneElement(f, {
|
|
1000
1031
|
key: `${I.id}:${nt}`,
|
|
1001
1032
|
// ContainerComponent will use this to know which item to render
|
|
1002
1033
|
_arrayItemIndex: nt,
|
|
1003
|
-
_arrayItemData:
|
|
1034
|
+
_arrayItemData: et
|
|
1004
1035
|
})
|
|
1005
1036
|
);
|
|
1006
|
-
}) : c.push(
|
|
1037
|
+
}) : c.push(f);
|
|
1007
1038
|
} else
|
|
1008
|
-
c.push(
|
|
1039
|
+
c.push(f);
|
|
1009
1040
|
}), c;
|
|
1010
|
-
}, [n, t,
|
|
1011
|
-
if (!A ||
|
|
1012
|
-
return
|
|
1013
|
-
const c =
|
|
1041
|
+
}, [n, t, E]), J = x.useMemo(() => {
|
|
1042
|
+
if (!A || p.length === 0)
|
|
1043
|
+
return p;
|
|
1044
|
+
const c = p[0], f = p[p.length - 1];
|
|
1014
1045
|
return [
|
|
1015
|
-
x.cloneElement(
|
|
1016
|
-
key: `clone-last-${
|
|
1046
|
+
x.cloneElement(f, {
|
|
1047
|
+
key: `clone-last-${f.key || f.props.id}`
|
|
1017
1048
|
}),
|
|
1018
|
-
...
|
|
1049
|
+
...p,
|
|
1019
1050
|
x.cloneElement(c, {
|
|
1020
1051
|
key: `clone-first-${c.key || c.props.id}`
|
|
1021
1052
|
})
|
|
1022
1053
|
];
|
|
1023
|
-
}, [
|
|
1024
|
-
if (
|
|
1025
|
-
const
|
|
1054
|
+
}, [p, A]), N = x.useMemo(() => {
|
|
1055
|
+
if (p.length === 0) return { width: 0, height: 0 };
|
|
1056
|
+
const f = p[0]?.props?.nodeData?.style, I = S.scaleFactor || 1;
|
|
1026
1057
|
let C = 0, b = 0;
|
|
1027
|
-
return
|
|
1028
|
-
}, [
|
|
1029
|
-
if (!o.current ||
|
|
1058
|
+
return f?.layout?.layoutSizingHorizontal === "FIXED" && f?.layout?.size?.x ? C = f.layout.size.x * I : C = i.width || 0, f?.layout?.layoutSizingVertical === "FIXED" && f?.layout?.size?.y ? b = f.layout.size.y * I : b = i.height || 0, { width: C, height: b };
|
|
1059
|
+
}, [p, i.width, i.height, S.scaleFactor]), P = N.width, F = N.height, H = G === "vertical", D = x.useCallback(() => {
|
|
1060
|
+
if (!o.current || p.length === 0)
|
|
1030
1061
|
return 0;
|
|
1031
1062
|
const c = o.current;
|
|
1032
|
-
if (
|
|
1063
|
+
if (H) {
|
|
1033
1064
|
if (F === 0) return 0;
|
|
1034
|
-
const
|
|
1065
|
+
const f = c.scrollTop;
|
|
1035
1066
|
if (A) {
|
|
1036
|
-
const C =
|
|
1067
|
+
const C = f - F;
|
|
1037
1068
|
let b = Math.round(C / F);
|
|
1038
|
-
return b < 0 && (b = 0), b >=
|
|
1069
|
+
return b < 0 && (b = 0), b >= p.length && (b = p.length - 1), b;
|
|
1039
1070
|
} else {
|
|
1040
|
-
const I = Math.round(
|
|
1041
|
-
return I < 0 ? 0 : I >=
|
|
1071
|
+
const I = Math.round(f / F);
|
|
1072
|
+
return I < 0 ? 0 : I >= p.length ? p.length - 1 : I;
|
|
1042
1073
|
}
|
|
1043
1074
|
} else {
|
|
1044
1075
|
if (P === 0) return 0;
|
|
1045
|
-
const
|
|
1076
|
+
const f = c.scrollLeft;
|
|
1046
1077
|
if (A) {
|
|
1047
|
-
const C =
|
|
1078
|
+
const C = f - P;
|
|
1048
1079
|
let b = Math.round(C / P);
|
|
1049
|
-
return b < 0 && (b = 0), b >=
|
|
1080
|
+
return b < 0 && (b = 0), b >= p.length && (b = p.length - 1), b;
|
|
1050
1081
|
} else {
|
|
1051
|
-
const I = Math.round(
|
|
1052
|
-
return I < 0 ? 0 : I >=
|
|
1082
|
+
const I = Math.round(f / P);
|
|
1083
|
+
return I < 0 ? 0 : I >= p.length ? p.length - 1 : I;
|
|
1053
1084
|
}
|
|
1054
1085
|
}
|
|
1055
|
-
}, [A,
|
|
1056
|
-
(c,
|
|
1057
|
-
if (!o.current ||
|
|
1086
|
+
}, [A, p.length, P, F, H]), B = x.useCallback(
|
|
1087
|
+
(c, f = !0) => {
|
|
1088
|
+
if (!o.current || p.length === 0) return;
|
|
1058
1089
|
const I = o.current;
|
|
1059
|
-
if (
|
|
1090
|
+
if (H) {
|
|
1060
1091
|
let C;
|
|
1061
1092
|
A ? C = F + c * F : C = c * F, I.scrollTo({
|
|
1062
1093
|
top: C,
|
|
1063
|
-
behavior:
|
|
1094
|
+
behavior: f ? "smooth" : "auto"
|
|
1064
1095
|
});
|
|
1065
1096
|
} else {
|
|
1066
1097
|
let C;
|
|
1067
1098
|
A ? C = P + c * P : C = c * P, I.scrollTo({
|
|
1068
1099
|
left: C,
|
|
1069
|
-
behavior:
|
|
1100
|
+
behavior: f ? "smooth" : "auto"
|
|
1070
1101
|
});
|
|
1071
1102
|
}
|
|
1072
1103
|
},
|
|
1073
|
-
[P, F, A,
|
|
1074
|
-
),
|
|
1075
|
-
if (!A || !o.current ||
|
|
1076
|
-
const c = o.current,
|
|
1077
|
-
if (
|
|
1104
|
+
[P, F, A, p.length, H]
|
|
1105
|
+
), O = x.useCallback(() => {
|
|
1106
|
+
if (!A || !o.current || p.length === 0) return;
|
|
1107
|
+
const c = o.current, f = 1;
|
|
1108
|
+
if (H) {
|
|
1078
1109
|
if (F === 0) return;
|
|
1079
|
-
const I = c.scrollTop, C = F, b = C, T = b +
|
|
1080
|
-
I >= T -
|
|
1110
|
+
const I = c.scrollTop, C = F, b = C, T = b + p.length * C;
|
|
1111
|
+
I >= T - f ? c.scrollTop = b : I <= f && (c.scrollTop = T - C);
|
|
1081
1112
|
} else {
|
|
1082
1113
|
if (P === 0) return;
|
|
1083
|
-
const I = c.scrollLeft, C = P, b = C, T = b +
|
|
1084
|
-
I >= T -
|
|
1114
|
+
const I = c.scrollLeft, C = P, b = C, T = b + p.length * C;
|
|
1115
|
+
I >= T - f ? c.scrollLeft = b : I <= f && (c.scrollLeft = T - C);
|
|
1085
1116
|
}
|
|
1086
|
-
}, [A,
|
|
1117
|
+
}, [A, p.length, P, F, H]);
|
|
1087
1118
|
x.useEffect(() => {
|
|
1088
|
-
if (!
|
|
1119
|
+
if (!j || p.length <= 1 || P === 0) return;
|
|
1089
1120
|
const c = () => {
|
|
1090
1121
|
if (a.current || !o.current) return;
|
|
1091
|
-
const
|
|
1092
|
-
if (
|
|
1122
|
+
const f = o.current;
|
|
1123
|
+
if (H) {
|
|
1093
1124
|
if (F === 0) return;
|
|
1094
|
-
const I =
|
|
1125
|
+
const I = f.scrollTop, C = F;
|
|
1095
1126
|
let b;
|
|
1096
1127
|
if (A) {
|
|
1097
1128
|
const nt = I - C;
|
|
1098
|
-
b = Math.round(nt / C), b < 0 && (b = 0), b >=
|
|
1129
|
+
b = Math.round(nt / C), b < 0 && (b = 0), b >= p.length && (b = p.length - 1);
|
|
1099
1130
|
} else
|
|
1100
1131
|
b = Math.round(I / C);
|
|
1101
1132
|
let T = b + 1;
|
|
1102
1133
|
if (A) {
|
|
1103
|
-
T >=
|
|
1104
|
-
const
|
|
1105
|
-
|
|
1106
|
-
top:
|
|
1134
|
+
T >= p.length && (T = 0);
|
|
1135
|
+
const et = C;
|
|
1136
|
+
f.scrollTo({
|
|
1137
|
+
top: et + T * C,
|
|
1107
1138
|
behavior: "smooth"
|
|
1108
1139
|
});
|
|
1109
1140
|
} else
|
|
1110
|
-
T >=
|
|
1141
|
+
T >= p.length && (T = 0), B(T);
|
|
1111
1142
|
} else {
|
|
1112
1143
|
if (P === 0) return;
|
|
1113
|
-
const I =
|
|
1144
|
+
const I = f.scrollLeft, C = P;
|
|
1114
1145
|
let b;
|
|
1115
1146
|
if (A) {
|
|
1116
1147
|
const nt = I - C;
|
|
1117
|
-
b = Math.round(nt / C), b < 0 && (b = 0), b >=
|
|
1148
|
+
b = Math.round(nt / C), b < 0 && (b = 0), b >= p.length && (b = p.length - 1);
|
|
1118
1149
|
} else
|
|
1119
1150
|
b = Math.round(I / C);
|
|
1120
1151
|
let T = b + 1;
|
|
1121
1152
|
if (A) {
|
|
1122
|
-
T >=
|
|
1123
|
-
const
|
|
1124
|
-
|
|
1125
|
-
left:
|
|
1153
|
+
T >= p.length && (T = 0);
|
|
1154
|
+
const et = C;
|
|
1155
|
+
f.scrollTo({
|
|
1156
|
+
left: et + T * C,
|
|
1126
1157
|
behavior: "smooth"
|
|
1127
1158
|
});
|
|
1128
1159
|
} else
|
|
1129
|
-
T >=
|
|
1160
|
+
T >= p.length && (T = 0), B(T);
|
|
1130
1161
|
}
|
|
1131
1162
|
};
|
|
1132
|
-
return
|
|
1133
|
-
|
|
1163
|
+
return g.current = setInterval(c, 4e3), () => {
|
|
1164
|
+
g.current && (clearInterval(g.current), g.current = null);
|
|
1134
1165
|
};
|
|
1135
1166
|
}, [
|
|
1136
|
-
|
|
1137
|
-
|
|
1167
|
+
j,
|
|
1168
|
+
p.length,
|
|
1138
1169
|
A,
|
|
1139
1170
|
P,
|
|
1140
1171
|
F,
|
|
1141
|
-
|
|
1172
|
+
H,
|
|
1142
1173
|
B
|
|
1143
1174
|
]);
|
|
1144
|
-
const
|
|
1175
|
+
const X = x.useCallback(() => {
|
|
1145
1176
|
a.current = !0, y.current && clearTimeout(y.current), y.current = setTimeout(() => {
|
|
1146
1177
|
a.current = !1;
|
|
1147
1178
|
}, 3e3);
|
|
@@ -1149,14 +1180,14 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
1149
1180
|
x.useEffect(() => {
|
|
1150
1181
|
ot.current = u;
|
|
1151
1182
|
}, [u]);
|
|
1152
|
-
const
|
|
1183
|
+
const tt = x.useCallback(
|
|
1153
1184
|
(c) => {
|
|
1154
|
-
if (
|
|
1155
|
-
|
|
1156
|
-
const
|
|
1157
|
-
if (
|
|
1185
|
+
if (L.current === c) return;
|
|
1186
|
+
L.current = c;
|
|
1187
|
+
const f = ot.current;
|
|
1188
|
+
if (f.currentIndex === void 0 && v(c), f.onIndexChange && f.onIndexChange(c), typeof l == "function")
|
|
1158
1189
|
try {
|
|
1159
|
-
|
|
1190
|
+
l({
|
|
1160
1191
|
bravo: {
|
|
1161
1192
|
cancel: () => {
|
|
1162
1193
|
},
|
|
@@ -1170,138 +1201,144 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
1170
1201
|
} catch {
|
|
1171
1202
|
}
|
|
1172
1203
|
},
|
|
1173
|
-
[
|
|
1204
|
+
[l, t]
|
|
1174
1205
|
// Depend on onAction to ensure we call the latest version
|
|
1175
1206
|
);
|
|
1176
1207
|
x.useEffect(() => {
|
|
1177
1208
|
const c = o.current;
|
|
1178
1209
|
if (!c) return;
|
|
1179
|
-
let
|
|
1210
|
+
let f = null;
|
|
1180
1211
|
const I = () => {
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
const T =
|
|
1184
|
-
|
|
1185
|
-
})) : (
|
|
1186
|
-
const T =
|
|
1187
|
-
|
|
1212
|
+
X(), A ? (f !== null && cancelAnimationFrame(f), f = requestAnimationFrame(() => {
|
|
1213
|
+
O();
|
|
1214
|
+
const T = D();
|
|
1215
|
+
tt(T);
|
|
1216
|
+
})) : (f !== null && cancelAnimationFrame(f), f = requestAnimationFrame(() => {
|
|
1217
|
+
const T = D();
|
|
1218
|
+
tt(T);
|
|
1188
1219
|
}));
|
|
1189
|
-
}, C = () =>
|
|
1220
|
+
}, C = () => X(), b = () => X();
|
|
1190
1221
|
return c.addEventListener("scroll", I, { passive: !0 }), c.addEventListener("touchstart", C, {
|
|
1191
1222
|
passive: !0
|
|
1192
1223
|
}), c.addEventListener("mousedown", b), () => {
|
|
1193
|
-
c.removeEventListener("scroll", I), c.removeEventListener("touchstart", C), c.removeEventListener("mousedown", b), y.current && clearTimeout(y.current),
|
|
1224
|
+
c.removeEventListener("scroll", I), c.removeEventListener("touchstart", C), c.removeEventListener("mousedown", b), y.current && clearTimeout(y.current), f !== null && cancelAnimationFrame(f);
|
|
1194
1225
|
};
|
|
1195
1226
|
}, [
|
|
1196
1227
|
A,
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1228
|
+
X,
|
|
1229
|
+
O,
|
|
1230
|
+
D,
|
|
1231
|
+
tt
|
|
1201
1232
|
]), x.useEffect(() => {
|
|
1202
|
-
if (
|
|
1203
|
-
const c =
|
|
1204
|
-
c && c !== u &&
|
|
1233
|
+
if (m) {
|
|
1234
|
+
const c = m.getControlProps(t);
|
|
1235
|
+
c && c !== u && k(c);
|
|
1205
1236
|
}
|
|
1206
|
-
}, [t,
|
|
1207
|
-
if (u.currentIndex !== void 0 && o.current &&
|
|
1237
|
+
}, [t, m, u]), x.useEffect(() => {
|
|
1238
|
+
if (u.currentIndex !== void 0 && o.current && p.length > 0 && P > 0) {
|
|
1208
1239
|
const c = Math.max(
|
|
1209
1240
|
0,
|
|
1210
|
-
Math.min(u.currentIndex,
|
|
1211
|
-
),
|
|
1212
|
-
c !==
|
|
1241
|
+
Math.min(u.currentIndex, p.length - 1)
|
|
1242
|
+
), f = D();
|
|
1243
|
+
c !== f && B(c, !0);
|
|
1213
1244
|
}
|
|
1214
1245
|
}, [
|
|
1215
1246
|
u.currentIndex,
|
|
1216
|
-
|
|
1217
|
-
|
|
1247
|
+
p.length,
|
|
1248
|
+
p.length,
|
|
1218
1249
|
P,
|
|
1219
1250
|
F,
|
|
1220
|
-
|
|
1251
|
+
H,
|
|
1221
1252
|
B,
|
|
1222
|
-
|
|
1253
|
+
D
|
|
1223
1254
|
]), x.useEffect(() => {
|
|
1224
|
-
if (A && o.current &&
|
|
1225
|
-
const c =
|
|
1255
|
+
if (A && o.current && p.length > 0 && p.length > 0 && (H ? F > 0 : P > 0)) {
|
|
1256
|
+
const c = H ? F : P;
|
|
1226
1257
|
setTimeout(() => {
|
|
1227
|
-
o.current && (
|
|
1258
|
+
o.current && (H ? o.current.scrollTop = c : o.current.scrollLeft = c);
|
|
1228
1259
|
}, 0);
|
|
1229
1260
|
}
|
|
1230
|
-
}, [A,
|
|
1231
|
-
if (!
|
|
1232
|
-
const { registerContainer: c, unregisterContainer:
|
|
1261
|
+
}, [A, p.length, P, F, H]), x.useEffect(() => {
|
|
1262
|
+
if (!m) return;
|
|
1263
|
+
const { registerContainer: c, unregisterContainer: f } = m;
|
|
1233
1264
|
return () => {
|
|
1234
1265
|
};
|
|
1235
1266
|
}, [
|
|
1236
1267
|
t,
|
|
1237
|
-
|
|
1238
|
-
|
|
1268
|
+
m?.registerContainer,
|
|
1269
|
+
m?.unregisterContainer,
|
|
1239
1270
|
// controlProps, // REMOVED to break infinite loop
|
|
1240
1271
|
B,
|
|
1241
|
-
|
|
1272
|
+
D
|
|
1242
1273
|
]);
|
|
1243
|
-
const
|
|
1274
|
+
const zt = {
|
|
1244
1275
|
display: "flex",
|
|
1245
|
-
flexDirection:
|
|
1246
|
-
overflowX:
|
|
1247
|
-
overflowY:
|
|
1248
|
-
scrollSnapType:
|
|
1276
|
+
flexDirection: H ? "column" : "row",
|
|
1277
|
+
overflowX: H ? "hidden" : "auto",
|
|
1278
|
+
overflowY: H ? "auto" : "hidden",
|
|
1279
|
+
scrollSnapType: H ? "y mandatory" : "x mandatory",
|
|
1249
1280
|
scrollBehavior: "smooth",
|
|
1250
1281
|
width: "100%",
|
|
1251
1282
|
height: "100%",
|
|
1252
1283
|
WebkitOverflowScrolling: "touch"
|
|
1253
1284
|
// Smooth scrolling on iOS
|
|
1254
|
-
},
|
|
1285
|
+
}, Ht = {
|
|
1255
1286
|
flexShrink: 0,
|
|
1256
1287
|
scrollSnapAlign: "start",
|
|
1257
|
-
width:
|
|
1258
|
-
height:
|
|
1288
|
+
width: N.width > 0 ? N.width : void 0,
|
|
1289
|
+
height: N.height > 0 ? N.height : void 0,
|
|
1259
1290
|
position: "relative"
|
|
1260
1291
|
};
|
|
1261
|
-
return /* @__PURE__ */
|
|
1292
|
+
return /* @__PURE__ */ d(
|
|
1262
1293
|
"div",
|
|
1263
1294
|
{
|
|
1264
1295
|
"data-id": t,
|
|
1265
1296
|
"data-name": r,
|
|
1266
1297
|
"data-type": "SliderComponent",
|
|
1267
|
-
ref:
|
|
1268
|
-
style:
|
|
1269
|
-
children: /* @__PURE__ */
|
|
1298
|
+
ref: s,
|
|
1299
|
+
style: z,
|
|
1300
|
+
children: /* @__PURE__ */ d("div", { ref: o, style: zt, children: J.map((c, f) => /* @__PURE__ */ d(
|
|
1270
1301
|
V.Provider,
|
|
1271
1302
|
{
|
|
1272
1303
|
value: {
|
|
1273
1304
|
dimensions: {
|
|
1274
|
-
width:
|
|
1275
|
-
height:
|
|
1305
|
+
width: N.width,
|
|
1306
|
+
height: N.height
|
|
1276
1307
|
},
|
|
1277
1308
|
isFlex: !1
|
|
1278
1309
|
},
|
|
1279
|
-
children: /* @__PURE__ */
|
|
1310
|
+
children: /* @__PURE__ */ d("div", { style: Ht, children: c })
|
|
1280
1311
|
},
|
|
1281
|
-
c.key || `slide-${
|
|
1312
|
+
c.key || `slide-${f}`
|
|
1282
1313
|
)) })
|
|
1283
1314
|
}
|
|
1284
1315
|
);
|
|
1285
|
-
},
|
|
1316
|
+
}, $t = (t, r) => {
|
|
1286
1317
|
const e = Array.isArray(t) ? t : [t];
|
|
1287
1318
|
for (const n of e)
|
|
1288
1319
|
if (!(!n || !n.props)) {
|
|
1289
1320
|
if (n.props.id === r)
|
|
1290
1321
|
return n;
|
|
1291
1322
|
if (n.props.children) {
|
|
1292
|
-
const i =
|
|
1323
|
+
const i = $t(n.props.children, r);
|
|
1293
1324
|
if (i) return i;
|
|
1294
1325
|
}
|
|
1295
1326
|
}
|
|
1296
1327
|
return null;
|
|
1297
1328
|
}, Rt = ({ id: t, name: r, nodeData: e, children: n }) => {
|
|
1298
|
-
const { dimensions: i, ref:
|
|
1299
|
-
let w,
|
|
1300
|
-
i.width > 0 && i.height > 0 ? (w = i.width,
|
|
1301
|
-
const
|
|
1329
|
+
const { dimensions: i, ref: s } = rt(), { componentId: o } = M(lt), g = M(V), a = e.style.originalSize?.[0] || 1, y = e.style.originalSize?.[1] || 1, S = g?.dimensions?.width, m = g?.dimensions?.height, l = window.innerWidth, u = window.innerHeight, k = S && S > 0 && S < l * 0.8;
|
|
1330
|
+
let w, v;
|
|
1331
|
+
i.width > 0 && i.height > 0 ? (w = i.width, v = i.height) : k && S && m || S && m && S > 0 && m > 0 ? (w = S, v = m) : (w = l, v = u);
|
|
1332
|
+
const L = a < 768;
|
|
1333
|
+
let $ = w, h = "100%";
|
|
1334
|
+
if (L && w > a * 1.5) {
|
|
1335
|
+
const E = Math.round(a * 1.5);
|
|
1336
|
+
$ = E, h = E;
|
|
1337
|
+
}
|
|
1338
|
+
const j = { scaleFactor: Math.min($ / a, v / y) || 1 };
|
|
1302
1339
|
if (o) {
|
|
1303
|
-
const E =
|
|
1304
|
-
return E ? /* @__PURE__ */
|
|
1340
|
+
const E = $t(n, o);
|
|
1341
|
+
return E ? /* @__PURE__ */ d(ct.Provider, { value: j, children: /* @__PURE__ */ d(
|
|
1305
1342
|
V.Provider,
|
|
1306
1343
|
{
|
|
1307
1344
|
value: {
|
|
@@ -1314,52 +1351,54 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
1314
1351
|
}
|
|
1315
1352
|
) }) : (console.warn(`Child with id "${o}" not found`), null);
|
|
1316
1353
|
}
|
|
1317
|
-
const
|
|
1318
|
-
(E,
|
|
1319
|
-
const
|
|
1320
|
-
return E[
|
|
1354
|
+
const q = Array.isArray(n) ? n : [n], { scrollableChildren: Z, nonScrollableChildren: G } = q.reduce(
|
|
1355
|
+
(E, p) => {
|
|
1356
|
+
const N = p.props.nodeData.type === "container:top-bar" ? "nonScrollableChildren" : "scrollableChildren";
|
|
1357
|
+
return E[N].push(p), E;
|
|
1321
1358
|
},
|
|
1322
1359
|
{
|
|
1323
1360
|
scrollableChildren: [],
|
|
1324
1361
|
nonScrollableChildren: []
|
|
1325
1362
|
}
|
|
1326
1363
|
);
|
|
1327
|
-
let
|
|
1328
|
-
if (!
|
|
1364
|
+
let z = e.style?.layout?.mode;
|
|
1365
|
+
if (!z && t === "01KASW494V02Y8P5JVWV5XK62X" && (console.log("🔧 PATCHING missing layout for page", t), z = "HORIZONTAL"), !z && n) {
|
|
1329
1366
|
const E = Array.isArray(n) ? n : [n];
|
|
1330
|
-
let
|
|
1331
|
-
E.forEach((
|
|
1332
|
-
const
|
|
1333
|
-
|
|
1334
|
-
}),
|
|
1335
|
-
`[PATCH] Detected HORIZONTAL WRAP layout for page ${t} (Partial width children: ${
|
|
1336
|
-
),
|
|
1367
|
+
let p = 0, J = 0;
|
|
1368
|
+
E.forEach((P) => {
|
|
1369
|
+
const F = P?.props?.nodeData?.style?.width;
|
|
1370
|
+
F && (p += F, F < 99 && J++);
|
|
1371
|
+
}), J > 0 && p >= 99 && (console.log(
|
|
1372
|
+
`[PATCH] Detected HORIZONTAL WRAP layout for page ${t} (Partial width children: ${J}, Total width: ${p})`
|
|
1373
|
+
), z = "HORIZONTAL", e.style || (e.style = {}), e.style.layout || (e.style.layout = {}), e.style.layout.mode = "HORIZONTAL", e.style.layout.flexWrap = "wrap", e.style.layout.primaryAxisAlignItems = "flex-start", e.style.layout.counterAxisAlignItems = "flex-start");
|
|
1337
1374
|
}
|
|
1338
|
-
const
|
|
1375
|
+
const K = z === "HORIZONTAL" ? "row" : "column", U = G.some(
|
|
1339
1376
|
(E) => E?.props?.nodeData?.type !== "container:background"
|
|
1340
1377
|
);
|
|
1341
|
-
return /* @__PURE__ */
|
|
1378
|
+
return /* @__PURE__ */ d(ct.Provider, { value: j, children: /* @__PURE__ */ it(
|
|
1342
1379
|
"div",
|
|
1343
1380
|
{
|
|
1344
1381
|
style: {
|
|
1345
1382
|
width: "100%",
|
|
1346
1383
|
height: "100%",
|
|
1384
|
+
maxWidth: typeof h == "number" ? `${h}px` : h,
|
|
1385
|
+
margin: L ? "0 auto" : 0,
|
|
1347
1386
|
position: "relative",
|
|
1348
1387
|
overflow: "hidden",
|
|
1349
1388
|
// Only use flex if we have non-background nonScrollableChildren (like top-bar)
|
|
1350
|
-
...
|
|
1389
|
+
...U ? {
|
|
1351
1390
|
display: "flex",
|
|
1352
|
-
flexDirection:
|
|
1391
|
+
flexDirection: K,
|
|
1353
1392
|
gap: 0,
|
|
1354
1393
|
rowGap: 0,
|
|
1355
1394
|
columnGap: 0
|
|
1356
1395
|
} : {}
|
|
1357
1396
|
},
|
|
1358
|
-
ref:
|
|
1397
|
+
ref: s,
|
|
1359
1398
|
children: [
|
|
1360
1399
|
G.filter(
|
|
1361
1400
|
(E) => E?.props?.nodeData?.type === "container:background"
|
|
1362
|
-
).map((E,
|
|
1401
|
+
).map((E, p) => /* @__PURE__ */ d(
|
|
1363
1402
|
V.Provider,
|
|
1364
1403
|
{
|
|
1365
1404
|
value: {
|
|
@@ -1370,11 +1409,11 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
1370
1409
|
},
|
|
1371
1410
|
children: E
|
|
1372
1411
|
},
|
|
1373
|
-
`bg-${
|
|
1412
|
+
`bg-${p}`
|
|
1374
1413
|
)),
|
|
1375
|
-
|
|
1414
|
+
U && G.filter(
|
|
1376
1415
|
(E) => E?.props?.nodeData?.type !== "container:background"
|
|
1377
|
-
).map((E,
|
|
1416
|
+
).map((E, p) => /* @__PURE__ */ d(
|
|
1378
1417
|
V.Provider,
|
|
1379
1418
|
{
|
|
1380
1419
|
value: {
|
|
@@ -1385,9 +1424,9 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
1385
1424
|
},
|
|
1386
1425
|
children: E
|
|
1387
1426
|
},
|
|
1388
|
-
`non-scroll-${
|
|
1427
|
+
`non-scroll-${p}`
|
|
1389
1428
|
)),
|
|
1390
|
-
/* @__PURE__ */
|
|
1429
|
+
/* @__PURE__ */ d(V.Provider, { value: { dimensions: i }, children: /* @__PURE__ */ d(
|
|
1391
1430
|
"div",
|
|
1392
1431
|
{
|
|
1393
1432
|
"data-id": t,
|
|
@@ -1395,80 +1434,104 @@ const ct = x.createContext({}), V = x.createContext(
|
|
|
1395
1434
|
"data-type": "PageComponent",
|
|
1396
1435
|
style: {
|
|
1397
1436
|
position: "relative",
|
|
1398
|
-
...
|
|
1437
|
+
...U ? {
|
|
1399
1438
|
flex: 1,
|
|
1400
|
-
...
|
|
1439
|
+
...K === "row" ? { alignSelf: "stretch" } : {}
|
|
1401
1440
|
// Removed height: "100%" to allow HUG containers to size based on content
|
|
1402
1441
|
} : {
|
|
1403
1442
|
width: "100%"
|
|
1404
1443
|
// Removed height: "100%" to allow HUG containers to size based on content
|
|
1405
1444
|
},
|
|
1406
1445
|
// Remove overflow: auto in horizontal mode as it causes height collapse
|
|
1407
|
-
...
|
|
1408
|
-
...
|
|
1446
|
+
...K === "column" && { overflow: "auto" },
|
|
1447
|
+
...W(e.style, {
|
|
1409
1448
|
debug: !1
|
|
1410
1449
|
})
|
|
1411
1450
|
},
|
|
1412
|
-
children:
|
|
1451
|
+
children: Z
|
|
1413
1452
|
}
|
|
1414
1453
|
) })
|
|
1415
1454
|
]
|
|
1416
1455
|
}
|
|
1417
1456
|
) });
|
|
1418
|
-
},
|
|
1457
|
+
}, kt = ({
|
|
1458
|
+
id: t,
|
|
1459
|
+
nodeData: r,
|
|
1460
|
+
children: e
|
|
1461
|
+
}) => {
|
|
1462
|
+
const i = M(Y)?.embedsById?.[t], s = W(r.style, { debug: !1 });
|
|
1463
|
+
return i ? /* @__PURE__ */ d(
|
|
1464
|
+
"div",
|
|
1465
|
+
{
|
|
1466
|
+
style: {
|
|
1467
|
+
...s,
|
|
1468
|
+
display: "flex",
|
|
1469
|
+
flexDirection: "column",
|
|
1470
|
+
// Reset positioning if provided by wrapper
|
|
1471
|
+
position: "absolute"
|
|
1472
|
+
},
|
|
1473
|
+
"data-type": "EmbedComponent",
|
|
1474
|
+
"data-id": t,
|
|
1475
|
+
children: i
|
|
1476
|
+
}
|
|
1477
|
+
) : /* @__PURE__ */ d("div", { style: s, "data-type": "EmbedComponent-Empty", "data-id": t, children: e });
|
|
1478
|
+
}, ee = {
|
|
1479
|
+
EmbedComponent: kt,
|
|
1419
1480
|
WebViewComponent: ht,
|
|
1420
1481
|
ColorComponent: gt,
|
|
1421
1482
|
GradientComponent: mt,
|
|
1422
1483
|
ImageComponent: yt,
|
|
1423
1484
|
EmailInputComponent: bt,
|
|
1424
1485
|
HiddenInputComponent: Ct,
|
|
1425
|
-
ImageInputComponent:
|
|
1486
|
+
ImageInputComponent: vt,
|
|
1426
1487
|
PasswordInputComponent: xt,
|
|
1427
|
-
SelectInputComponent:
|
|
1488
|
+
SelectInputComponent: St,
|
|
1428
1489
|
TextInputComponent: It,
|
|
1429
1490
|
LottieComponent: wt,
|
|
1430
1491
|
SvgComponent: At,
|
|
1431
|
-
TextComponent:
|
|
1492
|
+
TextComponent: Ft,
|
|
1432
1493
|
StatefulSetComponent: dt,
|
|
1433
|
-
StatefulCompoundComponent:
|
|
1434
|
-
BackgroundContainerComponent:
|
|
1494
|
+
StatefulCompoundComponent: Et,
|
|
1495
|
+
BackgroundContainerComponent: Pt,
|
|
1435
1496
|
ContainerComponent: pt,
|
|
1436
|
-
CompoundComponent:
|
|
1497
|
+
CompoundComponent: Tt,
|
|
1437
1498
|
TopBarContainerComponent: Bt,
|
|
1438
|
-
DefaultLayerComponent:
|
|
1439
|
-
TabsMenuComponent:
|
|
1440
|
-
MenuSideComponent:
|
|
1499
|
+
DefaultLayerComponent: Zt,
|
|
1500
|
+
TabsMenuComponent: Wt,
|
|
1501
|
+
MenuSideComponent: Lt,
|
|
1441
1502
|
SliderComponent: at,
|
|
1442
1503
|
PageComponent: Rt,
|
|
1443
1504
|
// Type string mappings for dynamically loaded components
|
|
1444
|
-
"menu:side":
|
|
1505
|
+
"menu:side": Lt,
|
|
1445
1506
|
"page:default": Rt,
|
|
1446
|
-
"container:background":
|
|
1507
|
+
"container:background": Pt,
|
|
1447
1508
|
"container:default": pt,
|
|
1448
1509
|
"container:top-bar": Bt,
|
|
1449
1510
|
"container:slider": at,
|
|
1450
|
-
"component:text":
|
|
1511
|
+
"component:text": Ft,
|
|
1451
1512
|
"component:color": gt,
|
|
1452
1513
|
"component:gradient": mt,
|
|
1453
1514
|
"component:image": yt,
|
|
1454
1515
|
"component:svg": At,
|
|
1455
|
-
"component:compound":
|
|
1516
|
+
"component:compound": Tt,
|
|
1456
1517
|
"component:input-stateful-set": dt,
|
|
1457
1518
|
"component:stateful-set": dt,
|
|
1458
|
-
"component:stateful-compound":
|
|
1519
|
+
"component:stateful-compound": Et,
|
|
1459
1520
|
"component:slider": at,
|
|
1460
1521
|
"component:webview": ht,
|
|
1522
|
+
"component:video": Xt,
|
|
1461
1523
|
"component:lottie": wt,
|
|
1462
1524
|
"component:email-input": bt,
|
|
1463
1525
|
"component:text-input": It,
|
|
1464
1526
|
"component:password-input": xt,
|
|
1465
|
-
"component:select-input":
|
|
1466
|
-
"component:image-input":
|
|
1527
|
+
"component:select-input": St,
|
|
1528
|
+
"component:image-input": vt,
|
|
1467
1529
|
"component:hidden-input": Ct,
|
|
1468
|
-
"component:tabs-menu":
|
|
1530
|
+
"component:tabs-menu": Wt,
|
|
1531
|
+
"component:embed": kt,
|
|
1469
1532
|
ContainerSliderComponent: at
|
|
1470
1533
|
};
|
|
1471
1534
|
export {
|
|
1472
|
-
|
|
1535
|
+
ee as default
|
|
1473
1536
|
};
|
|
1474
1537
|
//# sourceMappingURL=components.js.map
|