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