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