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