@bravostudioai/react 0.1.9 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/commands/download.js +19 -19
- package/dist/cli/commands/download.js.map +1 -1
- package/dist/cli/commands/generate.js +1 -1
- package/dist/cli/commands/generate.js.map +1 -1
- package/dist/components/EncoreApp.js +206 -179
- package/dist/components/EncoreApp.js.map +1 -1
- package/dist/components.js +277 -272
- package/dist/components.js.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/packages/encore-lib/constants.js +2 -2
- package/dist/packages/encore-lib/constants.js.map +1 -1
- package/dist/src/cli/commands/download.d.ts.map +1 -1
- package/dist/src/cli/commands/generate.d.ts.map +1 -1
- package/dist/src/components/EncoreApp.d.ts.map +1 -1
- package/dist/src/components.d.ts.map +1 -1
- package/dist/src/stores/useEncoreState.d.ts.map +1 -1
- package/dist/stores/useEncoreState.js +24 -24
- package/dist/stores/useEncoreState.js.map +1 -1
- package/package.json +1 -1
package/dist/components.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import v, { useContext as
|
|
1
|
+
import { jsx as f, jsxs as it, Fragment as ut } from "react/jsx-runtime";
|
|
2
|
+
import v, { useContext as j, useMemo as zt, useState as Ht, useCallback as Vt } from "react";
|
|
3
3
|
import Q from "./contexts/EncoreBindingContext.js";
|
|
4
4
|
import z from "./stores/useEncoreState.js";
|
|
5
5
|
import lt from "./contexts/EncoreComponentIdContext.js";
|
|
@@ -8,7 +8,7 @@ import Lt from "./contexts/EncoreActionContext.js";
|
|
|
8
8
|
import Ot from "./contexts/EncoreRepeatingContainerContext.js";
|
|
9
9
|
const ct = v.createContext({}), O = v.createContext(
|
|
10
10
|
{}
|
|
11
|
-
), st = (t) => t.replace(/#(\w{2})(\w{6})/, "#$2$1"), Mt = (t) => t.slice(1, 3) === "00",
|
|
11
|
+
), st = (t) => t.replace(/#(\w{2})(\w{6})/, "#$2$1"), Mt = (t) => t.slice(1, 3) === "00", Gt = (t) => {
|
|
12
12
|
if (!Array.isArray(t)) return null;
|
|
13
13
|
const r = t.find((o) => o.startsWith("input-group:"));
|
|
14
14
|
if (!r) return null;
|
|
@@ -35,42 +35,42 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
35
35
|
}, []), { dimensions: t, ref: e };
|
|
36
36
|
}, R = (t, r = {}) => {
|
|
37
37
|
let e = !1;
|
|
38
|
-
const o =
|
|
38
|
+
const o = j(ct), i = j(O), d = {
|
|
39
39
|
width: window.innerWidth,
|
|
40
40
|
height: window.innerHeight
|
|
41
41
|
}, a = Vt(
|
|
42
|
-
(
|
|
42
|
+
(s) => (i.dimensions?.width ?? 0) * 0.01 * s,
|
|
43
43
|
[i.dimensions?.width]
|
|
44
44
|
), n = {};
|
|
45
45
|
r = { debug: !1, ...r };
|
|
46
|
-
const c = z((
|
|
47
|
-
if (z((
|
|
48
|
-
const y = i.dimensions?.width ?? d.width,
|
|
49
|
-
if (t.layout?.layoutSizingHorizontal || t.layout?.layoutSizingVertical || (t.width && y > 0 && (n.width = t.width * y * 0.01), t.aspectRatio && t.width ? y > 0 && (n.height = t.width * y * 0.01 / t.aspectRatio) : t.height &&
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
52
|
-
const
|
|
53
|
-
W && typeof W == "number" && W > 0 &&
|
|
46
|
+
const c = z((s) => s.fontsById || {});
|
|
47
|
+
if (z((s) => s.fontsByIdFull || {}), !t) return;
|
|
48
|
+
const y = i.dimensions?.width ?? d.width, x = i.dimensions?.height ?? d.height;
|
|
49
|
+
if (t.layout?.layoutSizingHorizontal || t.layout?.layoutSizingVertical || (t.width && y > 0 && (n.width = t.width * y * 0.01), t.aspectRatio && t.width ? y > 0 && (n.height = t.width * y * 0.01 / t.aspectRatio) : t.height && x > 0 && (n.height = t.height * x * 0.01)), !(i?.isFlex ?? !1) && t.positioning) {
|
|
50
|
+
const s = t.layout?.layoutSizingHorizontal === "FIXED" || t.layout?.layoutSizingVertical === "FIXED", g = s && t.positioning.top < 0 ? 0 : t.positioning.top, I = s && t.positioning.left < 0 ? 0 : t.positioning.left;
|
|
51
|
+
if (s && t.layout?.layoutSizingHorizontal === "FIXED" && t.layout?.size?.x) {
|
|
52
|
+
const T = t.layout.size.x, E = o.scaleFactor ?? 1, l = T * E, W = i?.dimensions?.width;
|
|
53
|
+
W && typeof W == "number" && W > 0 && l / W >= 0.95 && I >= 15 && I <= 35 && (e = !0);
|
|
54
54
|
}
|
|
55
55
|
n.top = `${g}%`;
|
|
56
56
|
const A = !!t.inset;
|
|
57
57
|
if (e)
|
|
58
58
|
if (A) {
|
|
59
|
-
const
|
|
60
|
-
|
|
59
|
+
const T = String(t.inset).split(/\s+/);
|
|
60
|
+
T.length === 3 ? n.inset = `${T[0]} 50% ${T[2]} auto` : T.length === 4 && (n.inset = `${T[0]} 50% ${T[2]} auto`), delete n.left, delete n.right;
|
|
61
61
|
} else
|
|
62
62
|
n.left = "50%", n.right = "auto";
|
|
63
63
|
else
|
|
64
64
|
A ? n.inset = t.inset : n.left = `${I}%`;
|
|
65
|
-
|
|
65
|
+
s ? (n.right = "auto", n.bottom = "auto") : (t.positioning.bottom !== void 0 && (n.bottom = `${t.positioning.bottom}%`), t.positioning.right !== void 0 && (n.right = `${t.positioning.right}%`)), n.position = "absolute";
|
|
66
66
|
}
|
|
67
67
|
if (t.layout?.padding) {
|
|
68
|
-
const
|
|
69
|
-
g.top !== void 0 && (n.paddingTop = g.top *
|
|
68
|
+
const s = o.scaleFactor ?? 1, g = t.layout.padding;
|
|
69
|
+
g.top !== void 0 && (n.paddingTop = g.top * s), g.right !== void 0 && (n.paddingRight = g.right * s), g.bottom !== void 0 && (n.paddingBottom = g.bottom * s), g.left !== void 0 && (n.paddingLeft = g.left * s);
|
|
70
70
|
}
|
|
71
71
|
if (t.layout?.mode) {
|
|
72
72
|
n.display = "flex";
|
|
73
|
-
const
|
|
73
|
+
const s = (E) => E ? {
|
|
74
74
|
MIN: "flex-start",
|
|
75
75
|
MAX: "flex-end",
|
|
76
76
|
CENTER: "center",
|
|
@@ -78,15 +78,15 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
78
78
|
SPACE_AROUND: "space-around",
|
|
79
79
|
SPACE_EVENLY: "space-evenly"
|
|
80
80
|
}[E] || E.toLowerCase().replace(/_/g, "-") : void 0;
|
|
81
|
-
t.layout.mode == "HORIZONTAL" ? (n.flexDirection = "row", t.layout.flexWrap && (n.flexWrap = t.layout.flexWrap), n.justifyContent =
|
|
81
|
+
t.layout.mode == "HORIZONTAL" ? (n.flexDirection = "row", t.layout.flexWrap && (n.flexWrap = t.layout.flexWrap), n.justifyContent = s(
|
|
82
82
|
t.layout.primaryAxisAlignItems
|
|
83
|
-
), n.alignItems = t.layout.counterAxisAlignItems) : (n.flexDirection = "column", n.justifyContent =
|
|
83
|
+
), n.alignItems = t.layout.counterAxisAlignItems) : (n.flexDirection = "column", n.justifyContent = s(
|
|
84
84
|
t.layout.primaryAxisAlignItems
|
|
85
85
|
), n.alignItems = t.layout.counterAxisAlignItems), n.flexGrow = t.layout.grow, t.layout.wrap === "NO_WRAP" ? n.flexWrap = "nowrap" : t.layout.flexWrap ? n.flexWrap = t.layout.flexWrap : n.flexWrap = "wrap";
|
|
86
|
-
const g = t.layout.itemSpacing, I = o.scaleFactor ?? 1,
|
|
87
|
-
n.gap =
|
|
86
|
+
const g = t.layout.itemSpacing, I = o.scaleFactor ?? 1, T = t.layout.primaryAxisAlignItems === "SPACE_BETWEEN" ? 0 : (g !== void 0 ? g : 0) * I;
|
|
87
|
+
n.gap = T === 0 ? "0px" : `${T}px`, n.rowGap = T === 0 ? "0px" : `${T}px`, n.columnGap = T === 0 ? "0px" : `${T}px`, (n.flexWrap === "wrap" || n.flexWrap === "wrap-reverse") && (n.alignContent = "flex-start"), r.debug || t.layout?.mode === "HORIZONTAL" && g === 0 ? console.log("[useEncoreStyle] Setting gap properties:", {
|
|
88
88
|
itemSpacing: g,
|
|
89
|
-
spacing:
|
|
89
|
+
spacing: T,
|
|
90
90
|
gap: n.gap,
|
|
91
91
|
rowGap: n.rowGap,
|
|
92
92
|
columnGap: n.columnGap,
|
|
@@ -100,12 +100,12 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
100
100
|
);
|
|
101
101
|
}
|
|
102
102
|
if (t.layout?.layoutSizingHorizontal === "FILL" && (n.width = "100%"), t.layout?.layoutSizingHorizontal === "FIXED") {
|
|
103
|
-
const
|
|
104
|
-
n.width = t.layout.size.x *
|
|
103
|
+
const s = o.scaleFactor ?? 1;
|
|
104
|
+
n.width = t.layout.size.x * s;
|
|
105
105
|
}
|
|
106
106
|
if (t.layout?.layoutSizingVertical === "FIXED") {
|
|
107
|
-
const
|
|
108
|
-
n.height = t.layout.size.y *
|
|
107
|
+
const s = o.scaleFactor ?? 1;
|
|
108
|
+
n.height = t.layout.size.y * s;
|
|
109
109
|
}
|
|
110
110
|
if (t.layout?.layoutSizingVertical === "FILL")
|
|
111
111
|
if (!(i?.isFlex ?? !1) && t.positioning && t.positioning?.top !== void 0) {
|
|
@@ -114,16 +114,21 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
114
114
|
} else
|
|
115
115
|
n.height = "100%";
|
|
116
116
|
if (t.layout?.layoutSizingVertical, t.backgroundColor && !Mt(t.backgroundColor) && (n.backgroundColor = st(t.backgroundColor)), t.color && (n.color = st(t.color)), t.lineHeightPx && (n.lineHeight = (t.lineHeightPx * (o.scaleFactor ?? 1)).toString() + "px"), t.fontSize && (n.fontSize = t.fontSize * (o.scaleFactor ?? 1)), t.fontWeight && (n.fontWeight = `${t.fontWeight}`), t.opacity && (n.opacity = t.opacity * 0.01), t.fontId) {
|
|
117
|
-
const
|
|
118
|
-
n.fontFamily =
|
|
117
|
+
const s = c[t.fontId] || "sans-serif";
|
|
118
|
+
n.fontFamily = `"${s}"`, console.log("[AG_DEBUG] [useEncoreStyle] Font Resolution:", {
|
|
119
|
+
fontId: t.fontId,
|
|
120
|
+
resolvedFamily: s,
|
|
121
|
+
fontWeight: t.fontWeight,
|
|
122
|
+
finalStyle: n.fontFamily
|
|
123
|
+
});
|
|
119
124
|
}
|
|
120
125
|
if (t.borderRadius && (n.borderRadius = a(t.borderRadius)), t.cornerRadii) {
|
|
121
|
-
const
|
|
122
|
-
n.borderTopLeftRadius =
|
|
126
|
+
const s = t.cornerRadii.map(a);
|
|
127
|
+
n.borderTopLeftRadius = s[0], n.borderTopRightRadius = s[1], n.borderBottomRightRadius = s[2], n.borderBottomLeftRadius = s[3], delete n.borderRadius;
|
|
123
128
|
}
|
|
124
129
|
if (t.borderWidth && (t.borderWidth > 5 ? n.borderWidth = t.borderWidth * 0.5 : n.borderWidth = t.borderWidth * 1.5), t.borderColor && (n.borderColor = st(t.borderColor)), (t.borderWidth || t.borderColor) && (n.borderStyle = "solid"), t.rotation && (n.transform = `rotate(${t.rotation}deg)`), e) {
|
|
125
|
-
const
|
|
126
|
-
if (n.transform =
|
|
130
|
+
const s = n.transform || "";
|
|
131
|
+
if (n.transform = s ? `${s} translateX(-50%)` : "translateX(-50%)", n.inset) {
|
|
127
132
|
const g = String(n.inset).split(/\s+/);
|
|
128
133
|
g.length === 3 ? n.inset = `${g[0]} 50% ${g[2]} auto` : g.length === 4 && (n.inset = `${g[0]} 50% ${g[2]} auto`);
|
|
129
134
|
} else if (t.inset) {
|
|
@@ -132,12 +137,12 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
132
137
|
}
|
|
133
138
|
}
|
|
134
139
|
if (t.textCase === "upper" && (n.textTransform = "uppercase"), t.textCase === "lower" && (n.textTransform = "lowercase"), t.letterSpacing && (n.letterSpacing = t.letterSpacing), t.textAlign && (n.textAlign = t.textAlign), r.debug && (n.borderWidth = 1, n.borderColor = "#FF0000FF", n.borderStyle = "solid"), e && (n.inset || t.inset)) {
|
|
135
|
-
const
|
|
140
|
+
const s = n.inset || t.inset, g = String(s).split(/\s+/);
|
|
136
141
|
g.length === 3 ? n.inset = `${g[0]} 50% ${g[2]} auto` : g.length === 4 && (n.inset = `${g[0]} 50% ${g[2]} auto`);
|
|
137
142
|
}
|
|
138
143
|
return n;
|
|
139
144
|
}, tt = ({ id: t, nodeData: r }) => {
|
|
140
|
-
const e =
|
|
145
|
+
const e = j(Q), o = e?.nodeData?.[t], { patch: i, list: d } = o ?? { list: null, patch: null }, n = 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;
|
|
141
146
|
let c = i ? {
|
|
142
147
|
...r,
|
|
143
148
|
...i || {},
|
|
@@ -150,20 +155,20 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
150
155
|
...c,
|
|
151
156
|
data: { ...c?.data || {}, text: String(y) }
|
|
152
157
|
});
|
|
153
|
-
const
|
|
154
|
-
|
|
158
|
+
const x = Array.isArray(r?.tags) && (r.tags.includes("encore:data") || r.tags.includes("bravo:data")), h = e?.rootData;
|
|
159
|
+
h && h[t] && typeof h[t] == "object" && (c = {
|
|
155
160
|
...c,
|
|
156
161
|
data: {
|
|
157
162
|
...c.data || {},
|
|
158
|
-
...
|
|
163
|
+
...h[t]
|
|
159
164
|
}
|
|
160
165
|
});
|
|
161
166
|
const b = e?.nodeData && typeof e.nodeData == "object";
|
|
162
|
-
if (
|
|
163
|
-
const
|
|
164
|
-
if (
|
|
165
|
-
if (
|
|
166
|
-
const I =
|
|
167
|
+
if (x || b) {
|
|
168
|
+
const s = e?.nodeData;
|
|
169
|
+
if (s && typeof s == "object") {
|
|
170
|
+
if (s[t] !== void 0) {
|
|
171
|
+
const I = s[t];
|
|
167
172
|
I && typeof I == "object" && c.data && (c = {
|
|
168
173
|
...c,
|
|
169
174
|
data: {
|
|
@@ -171,14 +176,14 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
171
176
|
...I
|
|
172
177
|
}
|
|
173
178
|
});
|
|
174
|
-
} else if (
|
|
179
|
+
} else if (x && s.description && c.data && (c = {
|
|
175
180
|
...c,
|
|
176
181
|
data: {
|
|
177
182
|
...c.data,
|
|
178
|
-
text:
|
|
183
|
+
text: s.description
|
|
179
184
|
}
|
|
180
|
-
}),
|
|
181
|
-
const I =
|
|
185
|
+
}), s.image && c.data) {
|
|
186
|
+
const I = s.image.startsWith("//") ? `https:${s.image}` : s.image;
|
|
182
187
|
c = {
|
|
183
188
|
...c,
|
|
184
189
|
data: {
|
|
@@ -187,7 +192,7 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
187
192
|
}
|
|
188
193
|
};
|
|
189
194
|
}
|
|
190
|
-
c.encoreData =
|
|
195
|
+
c.encoreData = s;
|
|
191
196
|
}
|
|
192
197
|
}
|
|
193
198
|
return {
|
|
@@ -206,15 +211,15 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
206
211
|
_parentInputGroupInfo: i,
|
|
207
212
|
_parentName: d
|
|
208
213
|
}) => {
|
|
209
|
-
const a = z((
|
|
210
|
-
z((
|
|
214
|
+
const a = z((l) => l.baseURL), n = z((l) => l.appId);
|
|
215
|
+
z((l) => l.pageId);
|
|
211
216
|
const { onAction: c } = v.useContext(Lt), { statefulSetId: y } = v.useContext(
|
|
212
217
|
lt
|
|
213
|
-
),
|
|
214
|
-
(
|
|
215
|
-
),
|
|
216
|
-
(
|
|
217
|
-
), g = z((
|
|
218
|
+
), x = o || y, { patchedNodeData: h } = tt({ id: t, nodeData: r }), b = z(
|
|
219
|
+
(l) => l.setStatefulSetVariant
|
|
220
|
+
), s = z(
|
|
221
|
+
(l) => l.setInputGroupValue
|
|
222
|
+
), g = z((l) => l.setAccessToken), { app: I } = z((l) => l.app);
|
|
218
223
|
I.data?.app?.startPageId, I.data?.app?.PageId;
|
|
219
224
|
const A = R(
|
|
220
225
|
{
|
|
@@ -223,20 +228,20 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
223
228
|
{ debug: !1 }
|
|
224
229
|
);
|
|
225
230
|
A.zIndex = 99999, A.backgroundColor = "transparent", A.position = "absolute", A.top = "0", A.left = "0", A.right = "0", A.bottom = "0", A.width = "100%", A.height = "100%", A.pointerEvents = "auto", A.isolation = "isolate";
|
|
226
|
-
const
|
|
231
|
+
const T = async (l) => {
|
|
227
232
|
let W = !1;
|
|
228
233
|
const U = () => {
|
|
229
234
|
W = !1;
|
|
230
235
|
};
|
|
231
236
|
if (typeof c == "function")
|
|
232
237
|
try {
|
|
233
|
-
await c({ bravo: { cancel: U, action:
|
|
238
|
+
await c({ bravo: { cancel: U, action: l } }), W = !0;
|
|
234
239
|
} catch {
|
|
235
240
|
}
|
|
236
241
|
else
|
|
237
242
|
W = !0;
|
|
238
243
|
if (W)
|
|
239
|
-
switch (
|
|
244
|
+
switch (l.action) {
|
|
240
245
|
case "login":
|
|
241
246
|
// TODO firebase
|
|
242
247
|
// TODO oauth
|
|
@@ -246,7 +251,7 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
246
251
|
case "submit":
|
|
247
252
|
break;
|
|
248
253
|
case "email":
|
|
249
|
-
window.location.href = `mailto:${
|
|
254
|
+
window.location.href = `mailto:${l.params.email}`;
|
|
250
255
|
break;
|
|
251
256
|
case "goback":
|
|
252
257
|
break;
|
|
@@ -260,17 +265,17 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
260
265
|
case "none":
|
|
261
266
|
break;
|
|
262
267
|
case "openurl":
|
|
263
|
-
window.open(
|
|
268
|
+
window.open(l.params.url, "_blank");
|
|
264
269
|
break;
|
|
265
270
|
case "phone":
|
|
266
|
-
window.location.href = `tel:${
|
|
271
|
+
window.location.href = `tel:${l.params.phone}`;
|
|
267
272
|
break;
|
|
268
273
|
case "remote":
|
|
269
|
-
const M = btoa(JSON.stringify(
|
|
270
|
-
H.data?.action && await
|
|
274
|
+
const M = btoa(JSON.stringify(l.params?.data || {})), Z = `${a}/devices/apps/${n}/node/${t}/trigger/${l.event}?params=${M}`, H = await Nt.post(Z);
|
|
275
|
+
H.data?.action && await T(H.data);
|
|
271
276
|
break;
|
|
272
277
|
case "set-access-token":
|
|
273
|
-
g(
|
|
278
|
+
g(l.params);
|
|
274
279
|
break;
|
|
275
280
|
case "set-state":
|
|
276
281
|
if (i && d)
|
|
@@ -278,7 +283,7 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
278
283
|
groupName: i.groupName,
|
|
279
284
|
elementName: d,
|
|
280
285
|
hasOnAction: typeof c == "function"
|
|
281
|
-
}),
|
|
286
|
+
}), s(i.groupName, d), typeof c == "function")
|
|
282
287
|
try {
|
|
283
288
|
await c({
|
|
284
289
|
bravo: {
|
|
@@ -301,32 +306,32 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
301
306
|
else
|
|
302
307
|
console.warn("⚠️ No onAction callback provided");
|
|
303
308
|
else {
|
|
304
|
-
let P =
|
|
309
|
+
let P = x || l.params?.stateSetId || h.data?.stateSetId;
|
|
305
310
|
if (!P) {
|
|
306
311
|
console.error("❌ No stateSetId found in action or nodeData!", {
|
|
307
|
-
actionParams:
|
|
308
|
-
nodeDataStateSetId:
|
|
309
|
-
parentStatefulSetId:
|
|
312
|
+
actionParams: l.params,
|
|
313
|
+
nodeDataStateSetId: h.data?.stateSetId,
|
|
314
|
+
parentStatefulSetId: x
|
|
310
315
|
});
|
|
311
316
|
break;
|
|
312
317
|
}
|
|
313
|
-
b(P,
|
|
318
|
+
b(P, l.params.state);
|
|
314
319
|
}
|
|
315
320
|
break;
|
|
316
321
|
case "showalert":
|
|
317
|
-
alert(
|
|
322
|
+
alert(l.params.message);
|
|
318
323
|
break;
|
|
319
324
|
default:
|
|
320
|
-
console.log(
|
|
325
|
+
console.log(l), alert(l.action);
|
|
321
326
|
}
|
|
322
327
|
};
|
|
323
328
|
if (r.href)
|
|
324
329
|
return /* @__PURE__ */ it(ut, { children: [
|
|
325
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ f(
|
|
326
331
|
"button",
|
|
327
332
|
{
|
|
328
333
|
type: "button",
|
|
329
|
-
onClick: () =>
|
|
334
|
+
onClick: () => T({
|
|
330
335
|
action: "goto",
|
|
331
336
|
params: { href: r.href },
|
|
332
337
|
event: "tap"
|
|
@@ -343,15 +348,15 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
343
348
|
),
|
|
344
349
|
e
|
|
345
350
|
] });
|
|
346
|
-
let E =
|
|
347
|
-
if (
|
|
348
|
-
...
|
|
351
|
+
let E = h.actions && h.actions.length > 0 ? h.actions : r.actions || [];
|
|
352
|
+
if (x && E.length > 0 && (E = E.map((l) => l.action === "set-state" ? (l.params?.stateSetId, {
|
|
353
|
+
...l,
|
|
349
354
|
params: {
|
|
350
|
-
...
|
|
351
|
-
stateSetId:
|
|
355
|
+
...l.params,
|
|
356
|
+
stateSetId: x
|
|
352
357
|
// Always use parent's id
|
|
353
358
|
}
|
|
354
|
-
}) :
|
|
359
|
+
}) : l)), E.length === 0 && (h.data?.stateSetId || x))
|
|
355
360
|
if (i && d)
|
|
356
361
|
E = [
|
|
357
362
|
{
|
|
@@ -364,13 +369,13 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
364
369
|
}
|
|
365
370
|
];
|
|
366
371
|
else {
|
|
367
|
-
const
|
|
368
|
-
|
|
372
|
+
const l = x || h.data.stateSetId;
|
|
373
|
+
l ? E = [
|
|
369
374
|
{
|
|
370
375
|
action: "set-state",
|
|
371
376
|
params: {
|
|
372
|
-
state: z.getState().statefulSetVariants[
|
|
373
|
-
stateSetId:
|
|
377
|
+
state: z.getState().statefulSetVariants[l] === "active" ? "default" : "active",
|
|
378
|
+
stateSetId: l
|
|
374
379
|
// Use parent's id or button's stateSetId
|
|
375
380
|
},
|
|
376
381
|
event: "tap"
|
|
@@ -381,14 +386,14 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
381
386
|
);
|
|
382
387
|
}
|
|
383
388
|
if (E && E.length > 0) {
|
|
384
|
-
const
|
|
385
|
-
return
|
|
389
|
+
const l = E[0];
|
|
390
|
+
return l.event !== "tap" ? e : /* @__PURE__ */ it(ut, { children: [
|
|
386
391
|
e,
|
|
387
|
-
/* @__PURE__ */
|
|
392
|
+
/* @__PURE__ */ f(
|
|
388
393
|
"div",
|
|
389
394
|
{
|
|
390
395
|
onClick: (W) => {
|
|
391
|
-
W.stopPropagation(),
|
|
396
|
+
W.stopPropagation(), T(l);
|
|
392
397
|
},
|
|
393
398
|
onMouseDown: (W) => W.stopPropagation(),
|
|
394
399
|
onMouseUp: (W) => W.stopPropagation(),
|
|
@@ -398,11 +403,11 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
398
403
|
] });
|
|
399
404
|
}
|
|
400
405
|
return e;
|
|
401
|
-
},
|
|
406
|
+
}, ft = ({ id: t, name: r, nodeData: e }) => {
|
|
402
407
|
const o = R(e.style, {
|
|
403
408
|
debug: !1
|
|
404
409
|
});
|
|
405
|
-
return /* @__PURE__ */
|
|
410
|
+
return /* @__PURE__ */ f(
|
|
406
411
|
"iframe",
|
|
407
412
|
{
|
|
408
413
|
"data-id": t,
|
|
@@ -412,18 +417,18 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
412
417
|
src: e.data?.params?.url
|
|
413
418
|
}
|
|
414
419
|
);
|
|
415
|
-
},
|
|
420
|
+
}, ht = ({ id: t, name: r, nodeData: e }) => {
|
|
416
421
|
const o = R(e.style, {
|
|
417
422
|
debug: !1
|
|
418
423
|
});
|
|
419
424
|
if (!o.backgroundColor && !o.borderColor)
|
|
420
425
|
return null;
|
|
421
426
|
if (o.borderColor && !o.backgroundColor && (o.backgroundColor = "transparent"), o.borderColor && o.borderWidth) {
|
|
422
|
-
const
|
|
423
|
-
(!o.width || typeof o.width == "number" && o.width === 0) && (o.width =
|
|
427
|
+
const x = Math.max(o.borderWidth || 0, 1);
|
|
428
|
+
(!o.width || typeof o.width == "number" && o.width === 0) && (o.width = x), (!o.height || typeof o.height == "number" && o.height === 0) && (o.height = x), o.boxSizing = "border-box";
|
|
424
429
|
}
|
|
425
|
-
const i = Array.isArray(e.tags) && e.tags.includes("bravo:layer"), d =
|
|
426
|
-
return c && (o.position = "absolute", o.top = 0, o.left = 0, o.right = 0, o.bottom = 0, o.zIndex = -1, o.width && typeof o.width == "string" && o.width.includes("%") && delete o.width, o.height && typeof o.height == "string" && o.height.includes("%") && delete o.height), y && (o.backgroundColor = "transparent"), /* @__PURE__ */
|
|
430
|
+
const i = Array.isArray(e.tags) && e.tags.includes("bravo:layer"), d = j(O)?.isFlex ?? !1, a = e.style?.positioning, n = a && typeof a.top == "number" && typeof a.left == "number" && typeof a.right == "number" && typeof a.bottom == "number" && a.top === 0 && a.left === 0 && a.right === 0 && a.bottom === 0, c = i && (d || n), y = r && r.toLowerCase().startsWith("clip");
|
|
431
|
+
return c && (o.position = "absolute", o.top = 0, o.left = 0, o.right = 0, o.bottom = 0, o.zIndex = -1, o.width && typeof o.width == "string" && o.width.includes("%") && delete o.width, o.height && typeof o.height == "string" && o.height.includes("%") && delete o.height), y && (o.backgroundColor = "transparent"), /* @__PURE__ */ f(q, { id: t, nodeData: e, children: /* @__PURE__ */ f("div", { "data-name": r, "data-type": "ColorComponent", style: o }) });
|
|
427
432
|
}, gt = ({
|
|
428
433
|
id: t,
|
|
429
434
|
name: r,
|
|
@@ -444,34 +449,34 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
444
449
|
const a = i?.gradientType || "linear";
|
|
445
450
|
o.backgroundImage = a === "radial" ? `radial-gradient(${d})` : `linear-gradient(${d})`, delete o.backgroundColor;
|
|
446
451
|
}
|
|
447
|
-
return /* @__PURE__ */
|
|
452
|
+
return /* @__PURE__ */ f(q, { id: t, nodeData: e, children: /* @__PURE__ */ f("div", { "data-name": r, "data-type": "GradientComponent", style: o }) });
|
|
448
453
|
}, mt = ({ id: t, name: r, nodeData: e }) => {
|
|
449
454
|
const { patchedNodeData: o } = tt({ id: t, nodeData: e });
|
|
450
455
|
e = o;
|
|
451
456
|
const i = R(e.style, {
|
|
452
457
|
debug: !1
|
|
453
|
-
}), d =
|
|
458
|
+
}), d = j(O), a = z((s) => s.assetsById), n = e.style?.scaleMode || "fill";
|
|
454
459
|
n === "fill" ? i.objectFit = "cover" : n === "fit" && (i.objectFit = "contain"), i.objectPosition = "center";
|
|
455
460
|
let c = e.data?.imageUrl;
|
|
456
461
|
!c && e.encoreData?.image && (c = e.encoreData.image.startsWith("//") ? `https:${e.encoreData.image}` : e.encoreData.image), c || (c = a[e.assetId]?.url);
|
|
457
|
-
const y = e.style?.positioning,
|
|
458
|
-
if (y &&
|
|
459
|
-
const
|
|
460
|
-
if (
|
|
462
|
+
const y = e.style?.positioning, x = e.style?.aspectRatio, h = d.dimensions?.width || 0, b = d.dimensions?.height || 0;
|
|
463
|
+
if (y && x && h > 0) {
|
|
464
|
+
const s = typeof y.left == "number" && typeof y.right == "number", g = typeof y.top == "number" && typeof y.bottom == "number";
|
|
465
|
+
if (s) {
|
|
461
466
|
const I = 100 - y.left - y.right;
|
|
462
467
|
if (I > 0) {
|
|
463
|
-
const A = I *
|
|
464
|
-
i.width = A, i.height = A /
|
|
468
|
+
const A = I * h / 100;
|
|
469
|
+
i.width = A, i.height = A / x, i.left = `${Math.max(0, y.left)}%`, i.top = `${Math.max(0, y.top)}%`, delete i.right, delete i.bottom;
|
|
465
470
|
}
|
|
466
471
|
} else if (g && b > 0) {
|
|
467
472
|
const I = 100 - y.top - y.bottom;
|
|
468
473
|
if (I > 0) {
|
|
469
474
|
const A = I * b / 100;
|
|
470
|
-
i.height = A, i.width = A *
|
|
475
|
+
i.height = A, i.width = A * x, i.left = `${Math.max(0, y.left)}%`, i.top = `${Math.max(0, y.top)}%`, delete i.right, delete i.bottom;
|
|
471
476
|
}
|
|
472
477
|
}
|
|
473
478
|
}
|
|
474
|
-
return /* @__PURE__ */
|
|
479
|
+
return /* @__PURE__ */ f(q, { id: t, nodeData: e, children: /* @__PURE__ */ f(
|
|
475
480
|
"img",
|
|
476
481
|
{
|
|
477
482
|
"data-id": t,
|
|
@@ -488,7 +493,7 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
488
493
|
nodeData: e
|
|
489
494
|
}) => {
|
|
490
495
|
const o = z((d) => d.setFormInputValue), i = R(e.style, { debug: !1 });
|
|
491
|
-
return /* @__PURE__ */
|
|
496
|
+
return /* @__PURE__ */ f(
|
|
492
497
|
"input",
|
|
493
498
|
{
|
|
494
499
|
onChange: (d) => o(t, d.target.value),
|
|
@@ -506,7 +511,7 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
506
511
|
nodeData: e
|
|
507
512
|
}) => {
|
|
508
513
|
const o = R(e.style);
|
|
509
|
-
return o.visibility = "hidden", /* @__PURE__ */
|
|
514
|
+
return o.visibility = "hidden", /* @__PURE__ */ f(
|
|
510
515
|
"input",
|
|
511
516
|
{
|
|
512
517
|
"data-id": t,
|
|
@@ -523,14 +528,14 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
523
528
|
}) => {
|
|
524
529
|
const o = z((a) => a.setFormInputValue), i = R(e.style, { debug: !1 }), d = z((a) => a.assetsById);
|
|
525
530
|
return /* @__PURE__ */ it(ut, { children: [
|
|
526
|
-
/* @__PURE__ */
|
|
531
|
+
/* @__PURE__ */ f(
|
|
527
532
|
"div",
|
|
528
533
|
{
|
|
529
534
|
style: { ...i, zIndex: 9999, cursor: "pointer" },
|
|
530
535
|
onClick: () => alert("Image picker")
|
|
531
536
|
}
|
|
532
537
|
),
|
|
533
|
-
/* @__PURE__ */
|
|
538
|
+
/* @__PURE__ */ f(
|
|
534
539
|
"img",
|
|
535
540
|
{
|
|
536
541
|
onChange: (a) => o(t, a.target.value),
|
|
@@ -543,13 +548,13 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
543
548
|
}
|
|
544
549
|
)
|
|
545
550
|
] });
|
|
546
|
-
},
|
|
551
|
+
}, St = ({
|
|
547
552
|
id: t,
|
|
548
553
|
name: r,
|
|
549
554
|
nodeData: e
|
|
550
555
|
}) => {
|
|
551
556
|
const o = z((d) => d.setFormInputValue), i = R(e.style, { debug: !1 });
|
|
552
|
-
return /* @__PURE__ */
|
|
557
|
+
return /* @__PURE__ */ f(
|
|
553
558
|
"input",
|
|
554
559
|
{
|
|
555
560
|
onChange: (d) => o(t, d.target.value),
|
|
@@ -561,14 +566,14 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
561
566
|
type: "password"
|
|
562
567
|
}
|
|
563
568
|
);
|
|
564
|
-
},
|
|
569
|
+
}, xt = ({
|
|
565
570
|
id: t,
|
|
566
571
|
name: r,
|
|
567
572
|
nodeData: e
|
|
568
573
|
}) => {
|
|
569
|
-
const o = z((
|
|
574
|
+
const o = z((h) => h.setFormInputValue), { onAction: i } = v.useContext(Lt), { patchedNodeData: d } = tt({ id: t, nodeData: e }), a = R(d.style, { debug: !1 });
|
|
570
575
|
a.width = "100%", a.flex = "1", a.minWidth = "0", a.boxSizing = "border-box", a.borderColor = a.borderColor ?? "transparent";
|
|
571
|
-
const n = d.data?.value, c = d.data?.options, y = v.useMemo(() => !c || !Array.isArray(c) ? [] : c.map((
|
|
576
|
+
const n = d.data?.value, c = d.data?.options, y = v.useMemo(() => !c || !Array.isArray(c) ? [] : c.map((h) => typeof h == "string" ? { value: h, label: h } : h), [c]);
|
|
572
577
|
return /* @__PURE__ */ it(
|
|
573
578
|
"select",
|
|
574
579
|
{
|
|
@@ -577,8 +582,8 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
577
582
|
"data-type": "SelectInputComponent",
|
|
578
583
|
value: n ?? "",
|
|
579
584
|
style: a,
|
|
580
|
-
onChange: async (
|
|
581
|
-
const b =
|
|
585
|
+
onChange: async (h) => {
|
|
586
|
+
const b = h.target.value;
|
|
582
587
|
if (o(t, b), console.log(`Select changed: ${b}`), typeof i == "function")
|
|
583
588
|
try {
|
|
584
589
|
await i({
|
|
@@ -596,8 +601,8 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
596
601
|
}
|
|
597
602
|
},
|
|
598
603
|
children: [
|
|
599
|
-
y.length === 0 && /* @__PURE__ */
|
|
600
|
-
y.map((
|
|
604
|
+
y.length === 0 && /* @__PURE__ */ f("option", { value: "", disabled: !0, children: "Select an option..." }),
|
|
605
|
+
y.map((h) => /* @__PURE__ */ f("option", { value: h.value, children: h.label }, h.value))
|
|
601
606
|
]
|
|
602
607
|
}
|
|
603
608
|
);
|
|
@@ -609,7 +614,7 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
609
614
|
const o = z((d) => d.setFormInputValue), i = R(e.style, {
|
|
610
615
|
debug: !1
|
|
611
616
|
});
|
|
612
|
-
return /* @__PURE__ */
|
|
617
|
+
return /* @__PURE__ */ f(
|
|
613
618
|
"input",
|
|
614
619
|
{
|
|
615
620
|
onChange: (d) => o(t, d.target.value),
|
|
@@ -624,7 +629,7 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
624
629
|
);
|
|
625
630
|
}, It = ({ id: t, name: r, nodeData: e }) => {
|
|
626
631
|
const o = R(e.style);
|
|
627
|
-
return /* @__PURE__ */
|
|
632
|
+
return /* @__PURE__ */ f(q, { id: t, nodeData: e, children: /* @__PURE__ */ f(
|
|
628
633
|
"div",
|
|
629
634
|
{
|
|
630
635
|
"data-id": t,
|
|
@@ -638,7 +643,7 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
638
643
|
const o = R(e.style, {
|
|
639
644
|
debug: !1
|
|
640
645
|
}), i = z((d) => d.assetsById);
|
|
641
|
-
return /* @__PURE__ */
|
|
646
|
+
return /* @__PURE__ */ f(q, { id: t, nodeData: e, children: /* @__PURE__ */ f(
|
|
642
647
|
"img",
|
|
643
648
|
{
|
|
644
649
|
"data-id": t,
|
|
@@ -671,7 +676,7 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
671
676
|
const c = i && (i.includes(`
|
|
672
677
|
`) || i.includes("\r"));
|
|
673
678
|
let y;
|
|
674
|
-
return c && n.flexDirection === "column" ? y = i.split(/\r?\n/).filter((
|
|
679
|
+
return c && n.flexDirection === "column" ? y = i.split(/\r?\n/).filter((h) => h.length > 0).map((h, b) => /* @__PURE__ */ f("div", { style: { lineHeight: "inherit" }, children: h }, b)) : y = i, /* @__PURE__ */ f(q, { id: t, nodeData: e, children: /* @__PURE__ */ f(
|
|
675
680
|
"div",
|
|
676
681
|
{
|
|
677
682
|
"data-id": t,
|
|
@@ -687,19 +692,19 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
687
692
|
nodeData: e,
|
|
688
693
|
children: o
|
|
689
694
|
}) => {
|
|
690
|
-
const i =
|
|
695
|
+
const i = j(Q), { patchedNodeData: d } = tt({ id: t, nodeData: e });
|
|
691
696
|
e = d;
|
|
692
|
-
const a =
|
|
697
|
+
const a = Gt(e.tags), n = a ? z((I) => I.inputGroups[a.groupName]) : null, c = z((I) => I.statefulSetVariants[t]), y = R(e.style, {
|
|
693
698
|
debug: !1
|
|
694
699
|
});
|
|
695
|
-
let
|
|
696
|
-
a && n !== null ?
|
|
697
|
-
const
|
|
700
|
+
let x;
|
|
701
|
+
a && n !== null ? x = n === r ? "active" : "default" : x = c || e.data.initialState || "default";
|
|
702
|
+
const h = v.Children.toArray(o).find((I) => v.isValidElement(I) ? I.props?.nodeData?.data?.state === x : !1), b = v.isValidElement(h) ? v.cloneElement(h, {
|
|
698
703
|
_parentStatefulSetId: t,
|
|
699
704
|
_parentInputGroupInfo: a,
|
|
700
705
|
_parentName: r
|
|
701
706
|
// Pass the name so we can identify which element is active
|
|
702
|
-
}) :
|
|
707
|
+
}) : h, s = /* @__PURE__ */ f(
|
|
703
708
|
"div",
|
|
704
709
|
{
|
|
705
710
|
"data-id": t,
|
|
@@ -710,17 +715,17 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
710
715
|
}
|
|
711
716
|
);
|
|
712
717
|
if (e.type === "component:input-stateful-set")
|
|
713
|
-
return
|
|
718
|
+
return s;
|
|
714
719
|
const g = v.useContext(lt);
|
|
715
|
-
return /* @__PURE__ */
|
|
720
|
+
return /* @__PURE__ */ f(
|
|
716
721
|
Q.Provider,
|
|
717
722
|
{
|
|
718
723
|
value: { nodeData: i?.nodeData?.[t] || {} },
|
|
719
|
-
children: /* @__PURE__ */
|
|
724
|
+
children: /* @__PURE__ */ f(
|
|
720
725
|
lt.Provider,
|
|
721
726
|
{
|
|
722
727
|
value: { ...g, statefulSetId: t },
|
|
723
|
-
children:
|
|
728
|
+
children: s
|
|
724
729
|
}
|
|
725
730
|
)
|
|
726
731
|
}
|
|
@@ -740,14 +745,14 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
740
745
|
...n,
|
|
741
746
|
position: n.position || "relative"
|
|
742
747
|
};
|
|
743
|
-
return /* @__PURE__ */
|
|
748
|
+
return /* @__PURE__ */ f(
|
|
744
749
|
"div",
|
|
745
750
|
{
|
|
746
751
|
"data-id": t,
|
|
747
752
|
"data-name": r,
|
|
748
753
|
"data-type": "StatefulCompoundComponent",
|
|
749
754
|
style: c,
|
|
750
|
-
children: /* @__PURE__ */
|
|
755
|
+
children: /* @__PURE__ */ f(
|
|
751
756
|
q,
|
|
752
757
|
{
|
|
753
758
|
id: t,
|
|
@@ -760,8 +765,8 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
760
765
|
)
|
|
761
766
|
}
|
|
762
767
|
);
|
|
763
|
-
},
|
|
764
|
-
|
|
768
|
+
}, Ft = ({ id: t, name: r, children: e }) => {
|
|
769
|
+
j(O);
|
|
765
770
|
const { dimensions: o, ref: i } = rt(), d = {
|
|
766
771
|
zIndex: 0,
|
|
767
772
|
flex: 1,
|
|
@@ -771,7 +776,7 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
771
776
|
width: "100%",
|
|
772
777
|
height: "100%"
|
|
773
778
|
};
|
|
774
|
-
return /* @__PURE__ */
|
|
779
|
+
return /* @__PURE__ */ f(O.Provider, { value: { dimensions: o, isFlex: !1 }, children: /* @__PURE__ */ f(
|
|
775
780
|
"div",
|
|
776
781
|
{
|
|
777
782
|
"data-id": t,
|
|
@@ -794,30 +799,30 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
794
799
|
`[DEBUG] ContainerComponent ${t} (Hero) FULL nodeData:`,
|
|
795
800
|
JSON.stringify(e, null, 2)
|
|
796
801
|
);
|
|
797
|
-
const a =
|
|
802
|
+
const a = j(Q), { patchedNodeData: n, list: c, arrayData: y } = tt({
|
|
798
803
|
id: t,
|
|
799
804
|
nodeData: e
|
|
800
805
|
});
|
|
801
806
|
e = n;
|
|
802
|
-
const { dimensions:
|
|
807
|
+
const { dimensions: x, ref: h } = rt(), b = R(e.style, {
|
|
803
808
|
debug: !1
|
|
804
|
-
}),
|
|
809
|
+
}), s = !!e.style.layout?.mode, g = e.style.layout?.mode === "HORIZONTAL" ? "row" : "column", I = b.width !== void 0, A = b.height !== void 0, T = j(O), E = T?.isFlex ?? !1, l = T?.flexDirection, W = E && l === "row", U = !E && e.style.positioning, M = e.style.layout?.layoutSizingHorizontal === "FIXED" || e.style.layout?.layoutSizingVertical === "FIXED", Z = e.style.layout?.layoutSizingHorizontal === "HUG" || e.style.layout?.layoutSizingVertical === "HUG";
|
|
805
810
|
if (!I && !W && !(U && (M || Z)) && (b.width = "100%"), !A) {
|
|
806
811
|
const k = !E && e.style.positioning, X = e.style.layout?.layoutSizingVertical === "FILL";
|
|
807
812
|
if (!(e.style.layout?.layoutSizingVertical === "HUG")) {
|
|
808
|
-
if (!
|
|
813
|
+
if (!s) if (k && X && e.style.positioning?.top !== void 0) {
|
|
809
814
|
const ot = 100 - e.style.positioning.top;
|
|
810
815
|
b.height = `${ot}%`;
|
|
811
816
|
} else
|
|
812
817
|
b.height = "100%";
|
|
813
818
|
}
|
|
814
819
|
}
|
|
815
|
-
const H = e.style.layout?.layoutSizingHorizontal || e.style.layout?.layoutSizingVertical, V = e.style.positioning && !
|
|
820
|
+
const H = e.style.layout?.layoutSizingHorizontal || e.style.layout?.layoutSizingVertical, V = e.style.positioning && !s && (H || !0) ? { ...b, position: "absolute" } : b.position === "absolute" ? b : { ...b, position: b.position || "relative" }, N = (k) => typeof k == "number" ? k : typeof k == "string" && k.endsWith("px") && parseFloat(k) || 0, m = N(b.paddingLeft), et = N(b.paddingRight), G = N(b.paddingTop), B = N(b.paddingBottom), L = M && typeof b.width == "number" && typeof b.height == "number" ? {
|
|
816
821
|
width: b.width - m - et,
|
|
817
|
-
height: b.height -
|
|
822
|
+
height: b.height - G - B
|
|
818
823
|
} : {
|
|
819
|
-
width:
|
|
820
|
-
height:
|
|
824
|
+
width: x.width - m - et,
|
|
825
|
+
height: x.height - G - B
|
|
821
826
|
};
|
|
822
827
|
if (i != null && c) {
|
|
823
828
|
const k = c[i];
|
|
@@ -828,11 +833,11 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
828
833
|
textOverridesById: a?.textOverridesById,
|
|
829
834
|
rootData: a?.rootData
|
|
830
835
|
} : { nodeData: k };
|
|
831
|
-
return /* @__PURE__ */
|
|
836
|
+
return /* @__PURE__ */ f(Q.Provider, { value: X, children: /* @__PURE__ */ f(
|
|
832
837
|
O.Provider,
|
|
833
838
|
{
|
|
834
|
-
value: { dimensions: L, isFlex:
|
|
835
|
-
children: /* @__PURE__ */
|
|
839
|
+
value: { dimensions: L, isFlex: s, flexDirection: g },
|
|
840
|
+
children: /* @__PURE__ */ f(
|
|
836
841
|
"div",
|
|
837
842
|
{
|
|
838
843
|
"data-id": `${t}:${i}`,
|
|
@@ -855,15 +860,15 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
855
860
|
textOverridesById: a?.textOverridesById,
|
|
856
861
|
rootData: a?.rootData
|
|
857
862
|
} : { nodeData: J };
|
|
858
|
-
return /* @__PURE__ */
|
|
863
|
+
return /* @__PURE__ */ f(
|
|
859
864
|
Q.Provider,
|
|
860
865
|
{
|
|
861
866
|
value: ot,
|
|
862
|
-
children: /* @__PURE__ */
|
|
867
|
+
children: /* @__PURE__ */ f(
|
|
863
868
|
O.Provider,
|
|
864
869
|
{
|
|
865
|
-
value: { dimensions: L, isFlex:
|
|
866
|
-
children: /* @__PURE__ */
|
|
870
|
+
value: { dimensions: L, isFlex: s, flexDirection: g },
|
|
871
|
+
children: /* @__PURE__ */ f(
|
|
867
872
|
"div",
|
|
868
873
|
{
|
|
869
874
|
"data-id": `${t}:${_}`,
|
|
@@ -888,32 +893,32 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
888
893
|
})
|
|
889
894
|
));
|
|
890
895
|
const K = Array.isArray($) && $.length > 0;
|
|
891
|
-
return /* @__PURE__ */
|
|
896
|
+
return /* @__PURE__ */ f(
|
|
892
897
|
O.Provider,
|
|
893
898
|
{
|
|
894
|
-
value: { dimensions: L, isFlex:
|
|
895
|
-
children: /* @__PURE__ */
|
|
899
|
+
value: { dimensions: L, isFlex: s, flexDirection: g },
|
|
900
|
+
children: /* @__PURE__ */ f(
|
|
896
901
|
"div",
|
|
897
902
|
{
|
|
898
903
|
"data-id": t,
|
|
899
904
|
"data-name": r,
|
|
900
905
|
"data-type": "ContainerComponent",
|
|
901
|
-
ref:
|
|
906
|
+
ref: h,
|
|
902
907
|
style: V,
|
|
903
|
-
children: K ? /* @__PURE__ */
|
|
908
|
+
children: K ? /* @__PURE__ */ f(q, { id: t, nodeData: e, children: o }) : o
|
|
904
909
|
}
|
|
905
910
|
)
|
|
906
911
|
}
|
|
907
912
|
);
|
|
908
|
-
},
|
|
913
|
+
}, Tt = pt, Pt = ({ id: t, name: r, nodeData: e, children: o }) => {
|
|
909
914
|
const { dimensions: i, ref: d } = rt(), a = R(e.style, {
|
|
910
915
|
debug: !1
|
|
911
916
|
}), n = !!e.style.layout?.mode, c = e.style.layout?.mode === "HORIZONTAL" ? "row" : "column", y = a.position ? a : { ...a, position: "relative" };
|
|
912
|
-
return /* @__PURE__ */
|
|
917
|
+
return /* @__PURE__ */ f(
|
|
913
918
|
O.Provider,
|
|
914
919
|
{
|
|
915
920
|
value: { dimensions: i, isFlex: n, flexDirection: c },
|
|
916
|
-
children: /* @__PURE__ */
|
|
921
|
+
children: /* @__PURE__ */ f(
|
|
917
922
|
"div",
|
|
918
923
|
{
|
|
919
924
|
"data-id": t,
|
|
@@ -926,9 +931,9 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
926
931
|
)
|
|
927
932
|
}
|
|
928
933
|
);
|
|
929
|
-
},
|
|
934
|
+
}, jt = ({ id: t, name: r, nodeData: e, children: o }) => {
|
|
930
935
|
const i = R(e.style, { debug: !1 });
|
|
931
|
-
return /* @__PURE__ */
|
|
936
|
+
return /* @__PURE__ */ f(
|
|
932
937
|
"div",
|
|
933
938
|
{
|
|
934
939
|
"data-id": t,
|
|
@@ -938,7 +943,7 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
938
943
|
children: o
|
|
939
944
|
}
|
|
940
945
|
);
|
|
941
|
-
}, $t = ({ id: t, name: r, nodeData: e, children: o }) => /* @__PURE__ */
|
|
946
|
+
}, $t = ({ id: t, name: r, nodeData: e, children: o }) => /* @__PURE__ */ f(
|
|
942
947
|
"div",
|
|
943
948
|
{
|
|
944
949
|
"data-id": t,
|
|
@@ -951,7 +956,7 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
951
956
|
const i = R(e.style, {
|
|
952
957
|
debug: !1
|
|
953
958
|
});
|
|
954
|
-
return /* @__PURE__ */
|
|
959
|
+
return /* @__PURE__ */ f(
|
|
955
960
|
"div",
|
|
956
961
|
{
|
|
957
962
|
"data-id": t,
|
|
@@ -966,12 +971,12 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
966
971
|
`[DEBUG] SliderComponent ${t} FULL nodeData:`,
|
|
967
972
|
JSON.stringify(e, null, 2)
|
|
968
973
|
);
|
|
969
|
-
const { dimensions: i, ref: d } = rt(), a = v.useRef(null), n = v.useRef(null), c = v.useRef(!1), y = v.useRef(null),
|
|
974
|
+
const { dimensions: i, ref: d } = rt(), a = v.useRef(null), n = v.useRef(null), c = v.useRef(!1), y = v.useRef(null), x = j(ct), h = j(Ot), [b, s] = v.useState({
|
|
970
975
|
currentIndex: void 0,
|
|
971
976
|
onIndexChange: void 0
|
|
972
|
-
}), [g, I] = v.useState(0), A = v.useRef(null), { patchedNodeData:
|
|
973
|
-
e =
|
|
974
|
-
const E = e.data?.params || {},
|
|
977
|
+
}), [g, I] = v.useState(0), A = v.useRef(null), { patchedNodeData: T } = tt({ id: t, nodeData: e });
|
|
978
|
+
e = T;
|
|
979
|
+
const E = e.data?.params || {}, l = E.infinite === !0, W = E.automatic === !0;
|
|
975
980
|
let M = Array.isArray(e.tags) && e.tags.some((u) => u.includes("container:slider:vertical")) || e.name && e.name.includes("container:slider:vertical");
|
|
976
981
|
if (!M && E.animation === "default") {
|
|
977
982
|
const u = e.style?.width, p = e.style?.height;
|
|
@@ -981,14 +986,14 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
981
986
|
debug: !1
|
|
982
987
|
}), P = H.width !== void 0, V = H.height !== void 0;
|
|
983
988
|
P || (H.width = "100%"), V || (H.height = "100%"), H.position || (H.position = "relative");
|
|
984
|
-
const N =
|
|
989
|
+
const N = j(Q), m = v.useMemo(() => {
|
|
985
990
|
const u = [];
|
|
986
991
|
return v.Children.forEach(o, (p) => {
|
|
987
992
|
if (p == null) return;
|
|
988
|
-
const w = p?.props || {},
|
|
989
|
-
if (Array.isArray(
|
|
990
|
-
const
|
|
991
|
-
|
|
993
|
+
const w = p?.props || {}, S = w.nodeData || {};
|
|
994
|
+
if (Array.isArray(S?.tags) && (S.tags.includes("encore:data:array") || S.tags.includes("bravo:data:array")) && w.id && N) {
|
|
995
|
+
const F = N?.arrayDataById && N.arrayDataById[w.id] && Array.isArray(N.arrayDataById[w.id]) ? N.arrayDataById[w.id] : null;
|
|
996
|
+
F && F.length > 0 ? F.forEach((D, nt) => {
|
|
992
997
|
u.push(
|
|
993
998
|
v.cloneElement(p, {
|
|
994
999
|
key: `${w.id}:${nt}`,
|
|
@@ -1002,7 +1007,7 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
1002
1007
|
u.push(p);
|
|
1003
1008
|
}), u;
|
|
1004
1009
|
}, [o, t, N]), et = v.useMemo(() => {
|
|
1005
|
-
if (!
|
|
1010
|
+
if (!l || m.length === 0)
|
|
1006
1011
|
return m;
|
|
1007
1012
|
const u = m[0], p = m[m.length - 1];
|
|
1008
1013
|
return [
|
|
@@ -1014,21 +1019,21 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
1014
1019
|
key: `clone-first-${u.key || u.props.id}`
|
|
1015
1020
|
})
|
|
1016
1021
|
];
|
|
1017
|
-
}, [m,
|
|
1022
|
+
}, [m, l]), G = v.useMemo(() => {
|
|
1018
1023
|
if (m.length === 0) return { width: 0, height: 0 };
|
|
1019
|
-
const p = m[0]?.props?.nodeData?.style, w =
|
|
1020
|
-
let
|
|
1021
|
-
return p?.layout?.layoutSizingHorizontal === "FIXED" && p?.layout?.size?.x ?
|
|
1022
|
-
}, [m, i.width, i.height,
|
|
1024
|
+
const p = m[0]?.props?.nodeData?.style, w = x.scaleFactor || 1;
|
|
1025
|
+
let S = 0, C = 0;
|
|
1026
|
+
return p?.layout?.layoutSizingHorizontal === "FIXED" && p?.layout?.size?.x ? S = p.layout.size.x * w : S = i.width || 0, p?.layout?.layoutSizingVertical === "FIXED" && p?.layout?.size?.y ? C = p.layout.size.y * w : C = i.height || 0, { width: S, height: C };
|
|
1027
|
+
}, [m, i.width, i.height, x.scaleFactor]), B = G.width, L = G.height, $ = Z === "vertical", K = v.useCallback(() => {
|
|
1023
1028
|
if (!a.current || m.length === 0)
|
|
1024
1029
|
return 0;
|
|
1025
1030
|
const u = a.current;
|
|
1026
1031
|
if ($) {
|
|
1027
1032
|
if (L === 0) return 0;
|
|
1028
1033
|
const p = u.scrollTop;
|
|
1029
|
-
if (
|
|
1030
|
-
const
|
|
1031
|
-
let C = Math.round(
|
|
1034
|
+
if (l) {
|
|
1035
|
+
const S = p - L;
|
|
1036
|
+
let C = Math.round(S / L);
|
|
1032
1037
|
return C < 0 && (C = 0), C >= m.length && (C = m.length - 1), C;
|
|
1033
1038
|
} else {
|
|
1034
1039
|
const w = Math.round(p / L);
|
|
@@ -1037,47 +1042,47 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
1037
1042
|
} else {
|
|
1038
1043
|
if (B === 0) return 0;
|
|
1039
1044
|
const p = u.scrollLeft;
|
|
1040
|
-
if (
|
|
1041
|
-
const
|
|
1042
|
-
let C = Math.round(
|
|
1045
|
+
if (l) {
|
|
1046
|
+
const S = p - B;
|
|
1047
|
+
let C = Math.round(S / B);
|
|
1043
1048
|
return C < 0 && (C = 0), C >= m.length && (C = m.length - 1), C;
|
|
1044
1049
|
} else {
|
|
1045
1050
|
const w = Math.round(p / B);
|
|
1046
1051
|
return w < 0 ? 0 : w >= m.length ? m.length - 1 : w;
|
|
1047
1052
|
}
|
|
1048
1053
|
}
|
|
1049
|
-
}, [
|
|
1054
|
+
}, [l, m.length, B, L, $]), Y = v.useCallback(
|
|
1050
1055
|
(u, p = !0) => {
|
|
1051
1056
|
if (!a.current || m.length === 0) return;
|
|
1052
1057
|
const w = a.current;
|
|
1053
1058
|
if ($) {
|
|
1054
|
-
let
|
|
1055
|
-
|
|
1056
|
-
top:
|
|
1059
|
+
let S;
|
|
1060
|
+
l ? S = L + u * L : S = u * L, w.scrollTo({
|
|
1061
|
+
top: S,
|
|
1057
1062
|
behavior: p ? "smooth" : "auto"
|
|
1058
1063
|
});
|
|
1059
1064
|
} else {
|
|
1060
|
-
let
|
|
1061
|
-
|
|
1062
|
-
left:
|
|
1065
|
+
let S;
|
|
1066
|
+
l ? S = B + u * B : S = u * B, w.scrollTo({
|
|
1067
|
+
left: S,
|
|
1063
1068
|
behavior: p ? "smooth" : "auto"
|
|
1064
1069
|
});
|
|
1065
1070
|
}
|
|
1066
1071
|
},
|
|
1067
|
-
[B, L,
|
|
1072
|
+
[B, L, l, m.length, $]
|
|
1068
1073
|
), k = v.useCallback(() => {
|
|
1069
|
-
if (!
|
|
1074
|
+
if (!l || !a.current || m.length === 0) return;
|
|
1070
1075
|
const u = a.current, p = 1;
|
|
1071
1076
|
if ($) {
|
|
1072
1077
|
if (L === 0) return;
|
|
1073
|
-
const w = u.scrollTop,
|
|
1074
|
-
w >=
|
|
1078
|
+
const w = u.scrollTop, S = L, C = S, F = C + m.length * S;
|
|
1079
|
+
w >= F - p ? u.scrollTop = C : w <= p && (u.scrollTop = F - S);
|
|
1075
1080
|
} else {
|
|
1076
1081
|
if (B === 0) return;
|
|
1077
|
-
const w = u.scrollLeft,
|
|
1078
|
-
w >=
|
|
1082
|
+
const w = u.scrollLeft, S = B, C = S, F = C + m.length * S;
|
|
1083
|
+
w >= F - p ? u.scrollLeft = C : w <= p && (u.scrollLeft = F - S);
|
|
1079
1084
|
}
|
|
1080
|
-
}, [
|
|
1085
|
+
}, [l, m.length, B, L, $]);
|
|
1081
1086
|
v.useEffect(() => {
|
|
1082
1087
|
if (!W || m.length <= 1 || B === 0) return;
|
|
1083
1088
|
const u = () => {
|
|
@@ -1085,42 +1090,42 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
1085
1090
|
const p = a.current;
|
|
1086
1091
|
if ($) {
|
|
1087
1092
|
if (L === 0) return;
|
|
1088
|
-
const w = p.scrollTop,
|
|
1093
|
+
const w = p.scrollTop, S = L;
|
|
1089
1094
|
let C;
|
|
1090
|
-
if (
|
|
1091
|
-
const nt = w -
|
|
1092
|
-
C = Math.round(nt /
|
|
1095
|
+
if (l) {
|
|
1096
|
+
const nt = w - S;
|
|
1097
|
+
C = Math.round(nt / S), C < 0 && (C = 0), C >= m.length && (C = m.length - 1);
|
|
1093
1098
|
} else
|
|
1094
|
-
C = Math.round(w /
|
|
1095
|
-
let
|
|
1096
|
-
if (
|
|
1097
|
-
|
|
1098
|
-
const D =
|
|
1099
|
+
C = Math.round(w / S);
|
|
1100
|
+
let F = C + 1;
|
|
1101
|
+
if (l) {
|
|
1102
|
+
F >= m.length && (F = 0);
|
|
1103
|
+
const D = S;
|
|
1099
1104
|
p.scrollTo({
|
|
1100
|
-
top: D +
|
|
1105
|
+
top: D + F * S,
|
|
1101
1106
|
behavior: "smooth"
|
|
1102
1107
|
});
|
|
1103
1108
|
} else
|
|
1104
|
-
|
|
1109
|
+
F >= m.length && (F = 0), Y(F);
|
|
1105
1110
|
} else {
|
|
1106
1111
|
if (B === 0) return;
|
|
1107
|
-
const w = p.scrollLeft,
|
|
1112
|
+
const w = p.scrollLeft, S = B;
|
|
1108
1113
|
let C;
|
|
1109
|
-
if (
|
|
1110
|
-
const nt = w -
|
|
1111
|
-
C = Math.round(nt /
|
|
1114
|
+
if (l) {
|
|
1115
|
+
const nt = w - S;
|
|
1116
|
+
C = Math.round(nt / S), C < 0 && (C = 0), C >= m.length && (C = m.length - 1);
|
|
1112
1117
|
} else
|
|
1113
|
-
C = Math.round(w /
|
|
1114
|
-
let
|
|
1115
|
-
if (
|
|
1116
|
-
|
|
1117
|
-
const D =
|
|
1118
|
+
C = Math.round(w / S);
|
|
1119
|
+
let F = C + 1;
|
|
1120
|
+
if (l) {
|
|
1121
|
+
F >= m.length && (F = 0);
|
|
1122
|
+
const D = S;
|
|
1118
1123
|
p.scrollTo({
|
|
1119
|
-
left: D +
|
|
1124
|
+
left: D + F * S,
|
|
1120
1125
|
behavior: "smooth"
|
|
1121
1126
|
});
|
|
1122
1127
|
} else
|
|
1123
|
-
|
|
1128
|
+
F >= m.length && (F = 0), Y(F);
|
|
1124
1129
|
}
|
|
1125
1130
|
};
|
|
1126
1131
|
return n.current = setInterval(u, 4e3), () => {
|
|
@@ -1129,7 +1134,7 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
1129
1134
|
}, [
|
|
1130
1135
|
W,
|
|
1131
1136
|
m.length,
|
|
1132
|
-
|
|
1137
|
+
l,
|
|
1133
1138
|
B,
|
|
1134
1139
|
L,
|
|
1135
1140
|
$,
|
|
@@ -1158,32 +1163,32 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
1158
1163
|
if (!u) return;
|
|
1159
1164
|
let p = null;
|
|
1160
1165
|
const w = () => {
|
|
1161
|
-
X(),
|
|
1166
|
+
X(), l ? (p !== null && cancelAnimationFrame(p), p = requestAnimationFrame(() => {
|
|
1162
1167
|
k();
|
|
1163
|
-
const
|
|
1164
|
-
_(
|
|
1168
|
+
const F = K();
|
|
1169
|
+
_(F);
|
|
1165
1170
|
})) : (p !== null && cancelAnimationFrame(p), p = requestAnimationFrame(() => {
|
|
1166
|
-
const
|
|
1167
|
-
_(
|
|
1171
|
+
const F = K();
|
|
1172
|
+
_(F);
|
|
1168
1173
|
}));
|
|
1169
|
-
},
|
|
1170
|
-
return u.addEventListener("scroll", w, { passive: !0 }), u.addEventListener("touchstart",
|
|
1174
|
+
}, S = () => X(), C = () => X();
|
|
1175
|
+
return u.addEventListener("scroll", w, { passive: !0 }), u.addEventListener("touchstart", S, {
|
|
1171
1176
|
passive: !0
|
|
1172
1177
|
}), u.addEventListener("mousedown", C), () => {
|
|
1173
|
-
u.removeEventListener("scroll", w), u.removeEventListener("touchstart",
|
|
1178
|
+
u.removeEventListener("scroll", w), u.removeEventListener("touchstart", S), u.removeEventListener("mousedown", C), y.current && clearTimeout(y.current), p !== null && cancelAnimationFrame(p);
|
|
1174
1179
|
};
|
|
1175
1180
|
}, [
|
|
1176
|
-
|
|
1181
|
+
l,
|
|
1177
1182
|
X,
|
|
1178
1183
|
k,
|
|
1179
1184
|
K,
|
|
1180
1185
|
_
|
|
1181
1186
|
]), v.useEffect(() => {
|
|
1182
|
-
if (
|
|
1183
|
-
const u =
|
|
1184
|
-
u && u !== b &&
|
|
1187
|
+
if (h) {
|
|
1188
|
+
const u = h.getControlProps(t);
|
|
1189
|
+
u && u !== b && s(u);
|
|
1185
1190
|
}
|
|
1186
|
-
}, [t,
|
|
1191
|
+
}, [t, h, b]), v.useEffect(() => {
|
|
1187
1192
|
if (b.currentIndex !== void 0 && a.current && m.length > 0 && B > 0) {
|
|
1188
1193
|
const u = Math.max(
|
|
1189
1194
|
0,
|
|
@@ -1201,21 +1206,21 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
1201
1206
|
Y,
|
|
1202
1207
|
K
|
|
1203
1208
|
]), v.useEffect(() => {
|
|
1204
|
-
if (
|
|
1209
|
+
if (l && a.current && m.length > 0 && m.length > 0 && ($ ? L > 0 : B > 0)) {
|
|
1205
1210
|
const u = $ ? L : B;
|
|
1206
1211
|
setTimeout(() => {
|
|
1207
1212
|
a.current && ($ ? a.current.scrollTop = u : a.current.scrollLeft = u);
|
|
1208
1213
|
}, 0);
|
|
1209
1214
|
}
|
|
1210
|
-
}, [
|
|
1211
|
-
if (!
|
|
1212
|
-
const { registerContainer: u, unregisterContainer: p } =
|
|
1215
|
+
}, [l, m.length, B, L, $]), v.useEffect(() => {
|
|
1216
|
+
if (!h) return;
|
|
1217
|
+
const { registerContainer: u, unregisterContainer: p } = h;
|
|
1213
1218
|
return () => {
|
|
1214
1219
|
};
|
|
1215
1220
|
}, [
|
|
1216
1221
|
t,
|
|
1217
|
-
|
|
1218
|
-
|
|
1222
|
+
h?.registerContainer,
|
|
1223
|
+
h?.unregisterContainer,
|
|
1219
1224
|
// controlProps, // REMOVED to break infinite loop
|
|
1220
1225
|
Y,
|
|
1221
1226
|
K
|
|
@@ -1234,11 +1239,11 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
1234
1239
|
}, kt = {
|
|
1235
1240
|
flexShrink: 0,
|
|
1236
1241
|
scrollSnapAlign: "start",
|
|
1237
|
-
width:
|
|
1238
|
-
height:
|
|
1242
|
+
width: G.width > 0 ? G.width : void 0,
|
|
1243
|
+
height: G.height > 0 ? G.height : void 0,
|
|
1239
1244
|
position: "relative"
|
|
1240
1245
|
};
|
|
1241
|
-
return /* @__PURE__ */
|
|
1246
|
+
return /* @__PURE__ */ f(
|
|
1242
1247
|
"div",
|
|
1243
1248
|
{
|
|
1244
1249
|
"data-id": t,
|
|
@@ -1246,17 +1251,17 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
1246
1251
|
"data-type": "SliderComponent",
|
|
1247
1252
|
ref: d,
|
|
1248
1253
|
style: H,
|
|
1249
|
-
children: /* @__PURE__ */
|
|
1254
|
+
children: /* @__PURE__ */ f("div", { ref: a, style: ot, children: et.map((u, p) => /* @__PURE__ */ f(
|
|
1250
1255
|
O.Provider,
|
|
1251
1256
|
{
|
|
1252
1257
|
value: {
|
|
1253
1258
|
dimensions: {
|
|
1254
|
-
width:
|
|
1255
|
-
height:
|
|
1259
|
+
width: G.width,
|
|
1260
|
+
height: G.height
|
|
1256
1261
|
},
|
|
1257
1262
|
isFlex: !1
|
|
1258
1263
|
},
|
|
1259
|
-
children: /* @__PURE__ */
|
|
1264
|
+
children: /* @__PURE__ */ f("div", { style: kt, children: u })
|
|
1260
1265
|
},
|
|
1261
1266
|
u.key || `slide-${p}`
|
|
1262
1267
|
)) })
|
|
@@ -1275,13 +1280,13 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
1275
1280
|
}
|
|
1276
1281
|
return null;
|
|
1277
1282
|
}, Bt = ({ id: t, name: r, nodeData: e, children: o }) => {
|
|
1278
|
-
const { dimensions: i, ref: d } = rt(), { componentId: a } =
|
|
1283
|
+
const { dimensions: i, ref: d } = rt(), { componentId: a } = j(lt), n = j(O), c = e.style.originalSize?.[0] || 1, y = e.style.originalSize?.[1] || 1, x = n?.dimensions?.width, h = n?.dimensions?.height, b = window.innerWidth, s = window.innerHeight, g = x && x > 0 && x < b * 0.8;
|
|
1279
1284
|
let I, A;
|
|
1280
|
-
i.width > 0 && i.height > 0 ? (I = i.width, A = i.height) : g &&
|
|
1285
|
+
i.width > 0 && i.height > 0 ? (I = i.width, A = i.height) : g && x && h || x && h && x > 0 && h > 0 ? (I = x, A = h) : (I = b, A = s);
|
|
1281
1286
|
const E = { scaleFactor: Math.min(I / c, A / y) || 1 };
|
|
1282
1287
|
if (a) {
|
|
1283
1288
|
const P = Rt(o, a);
|
|
1284
|
-
return P ? /* @__PURE__ */
|
|
1289
|
+
return P ? /* @__PURE__ */ f(ct.Provider, { value: E, children: /* @__PURE__ */ f(
|
|
1285
1290
|
O.Provider,
|
|
1286
1291
|
{
|
|
1287
1292
|
value: {
|
|
@@ -1294,7 +1299,7 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
1294
1299
|
}
|
|
1295
1300
|
) }) : (console.warn(`Child with id "${a}" not found`), null);
|
|
1296
1301
|
}
|
|
1297
|
-
const
|
|
1302
|
+
const l = Array.isArray(o) ? o : [o], { scrollableChildren: W, nonScrollableChildren: U } = l.reduce(
|
|
1298
1303
|
(P, V) => {
|
|
1299
1304
|
const m = V.props.nodeData.type === "container:top-bar" ? "nonScrollableChildren" : "scrollableChildren";
|
|
1300
1305
|
return P[m].push(V), P;
|
|
@@ -1309,8 +1314,8 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
1309
1314
|
const P = Array.isArray(o) ? o : [o];
|
|
1310
1315
|
let V = 0, N = 0;
|
|
1311
1316
|
P.forEach((et) => {
|
|
1312
|
-
const
|
|
1313
|
-
|
|
1317
|
+
const G = et?.props?.nodeData?.style?.width;
|
|
1318
|
+
G && (V += G, G < 99 && N++);
|
|
1314
1319
|
}), N > 0 && V >= 99 && (console.log(
|
|
1315
1320
|
`[PATCH] Detected HORIZONTAL WRAP layout for page ${t} (Partial width children: ${N}, Total width: ${V})`
|
|
1316
1321
|
), M = "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");
|
|
@@ -1318,7 +1323,7 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
1318
1323
|
const Z = M === "HORIZONTAL" ? "row" : "column", H = U.some(
|
|
1319
1324
|
(P) => P?.props?.nodeData?.type !== "container:background"
|
|
1320
1325
|
);
|
|
1321
|
-
return /* @__PURE__ */
|
|
1326
|
+
return /* @__PURE__ */ f(ct.Provider, { value: E, children: /* @__PURE__ */ it(
|
|
1322
1327
|
"div",
|
|
1323
1328
|
{
|
|
1324
1329
|
style: {
|
|
@@ -1339,7 +1344,7 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
1339
1344
|
children: [
|
|
1340
1345
|
U.filter(
|
|
1341
1346
|
(P) => P?.props?.nodeData?.type === "container:background"
|
|
1342
|
-
).map((P, V) => /* @__PURE__ */
|
|
1347
|
+
).map((P, V) => /* @__PURE__ */ f(
|
|
1343
1348
|
O.Provider,
|
|
1344
1349
|
{
|
|
1345
1350
|
value: {
|
|
@@ -1354,7 +1359,7 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
1354
1359
|
)),
|
|
1355
1360
|
H && U.filter(
|
|
1356
1361
|
(P) => P?.props?.nodeData?.type !== "container:background"
|
|
1357
|
-
).map((P, V) => /* @__PURE__ */
|
|
1362
|
+
).map((P, V) => /* @__PURE__ */ f(
|
|
1358
1363
|
O.Provider,
|
|
1359
1364
|
{
|
|
1360
1365
|
value: {
|
|
@@ -1367,7 +1372,7 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
1367
1372
|
},
|
|
1368
1373
|
`non-scroll-${V}`
|
|
1369
1374
|
)),
|
|
1370
|
-
/* @__PURE__ */
|
|
1375
|
+
/* @__PURE__ */ f(O.Provider, { value: { dimensions: i }, children: /* @__PURE__ */ f(
|
|
1371
1376
|
"div",
|
|
1372
1377
|
{
|
|
1373
1378
|
"data-id": t,
|
|
@@ -1396,26 +1401,26 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
1396
1401
|
}
|
|
1397
1402
|
) });
|
|
1398
1403
|
}, Dt = {
|
|
1399
|
-
WebViewComponent:
|
|
1400
|
-
ColorComponent:
|
|
1404
|
+
WebViewComponent: ft,
|
|
1405
|
+
ColorComponent: ht,
|
|
1401
1406
|
GradientComponent: gt,
|
|
1402
1407
|
ImageComponent: mt,
|
|
1403
1408
|
EmailInputComponent: yt,
|
|
1404
1409
|
HiddenInputComponent: bt,
|
|
1405
1410
|
ImageInputComponent: Ct,
|
|
1406
|
-
PasswordInputComponent:
|
|
1407
|
-
SelectInputComponent:
|
|
1411
|
+
PasswordInputComponent: St,
|
|
1412
|
+
SelectInputComponent: xt,
|
|
1408
1413
|
TextInputComponent: vt,
|
|
1409
1414
|
LottieComponent: It,
|
|
1410
1415
|
SvgComponent: wt,
|
|
1411
1416
|
TextComponent: At,
|
|
1412
1417
|
StatefulSetComponent: dt,
|
|
1413
1418
|
StatefulCompoundComponent: Et,
|
|
1414
|
-
BackgroundContainerComponent:
|
|
1419
|
+
BackgroundContainerComponent: Ft,
|
|
1415
1420
|
ContainerComponent: pt,
|
|
1416
|
-
CompoundComponent:
|
|
1421
|
+
CompoundComponent: Tt,
|
|
1417
1422
|
TopBarContainerComponent: Pt,
|
|
1418
|
-
DefaultLayerComponent:
|
|
1423
|
+
DefaultLayerComponent: jt,
|
|
1419
1424
|
TabsMenuComponent: $t,
|
|
1420
1425
|
MenuSideComponent: Wt,
|
|
1421
1426
|
SliderComponent: at,
|
|
@@ -1423,26 +1428,26 @@ const ct = v.createContext({}), O = v.createContext(
|
|
|
1423
1428
|
// Type string mappings for dynamically loaded components
|
|
1424
1429
|
"menu:side": Wt,
|
|
1425
1430
|
"page:default": Bt,
|
|
1426
|
-
"container:background":
|
|
1431
|
+
"container:background": Ft,
|
|
1427
1432
|
"container:default": pt,
|
|
1428
1433
|
"container:top-bar": Pt,
|
|
1429
1434
|
"container:slider": at,
|
|
1430
1435
|
"component:text": At,
|
|
1431
|
-
"component:color":
|
|
1436
|
+
"component:color": ht,
|
|
1432
1437
|
"component:gradient": gt,
|
|
1433
1438
|
"component:image": mt,
|
|
1434
1439
|
"component:svg": wt,
|
|
1435
|
-
"component:compound":
|
|
1440
|
+
"component:compound": Tt,
|
|
1436
1441
|
"component:input-stateful-set": dt,
|
|
1437
1442
|
"component:stateful-set": dt,
|
|
1438
1443
|
"component:stateful-compound": Et,
|
|
1439
1444
|
"component:slider": at,
|
|
1440
|
-
"component:webview":
|
|
1445
|
+
"component:webview": ft,
|
|
1441
1446
|
"component:lottie": It,
|
|
1442
1447
|
"component:email-input": yt,
|
|
1443
1448
|
"component:text-input": vt,
|
|
1444
|
-
"component:password-input":
|
|
1445
|
-
"component:select-input":
|
|
1449
|
+
"component:password-input": St,
|
|
1450
|
+
"component:select-input": xt,
|
|
1446
1451
|
"component:image-input": Ct,
|
|
1447
1452
|
"component:hidden-input": bt,
|
|
1448
1453
|
"component:tabs-menu": $t,
|