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