@builder.io/sdk-react 2.0.3 → 2.0.8
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/lib/browser/blocks-exports.cjs +14 -14
- package/lib/browser/blocks-exports.mjs +191 -170
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/init.cjs +1 -1
- package/lib/browser/init.mjs +1 -1
- package/lib/browser/{server-entry-02cecfb7.cjs → server-entry-ba3e0524.cjs} +1 -1
- package/lib/{node/server-entry-0687830a.js → browser/server-entry-f6ee5d92.js} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-368a2cf8.cjs → accordion-88007399.cjs} +1 -1
- package/lib/edge/{accordion-0eca9b08.js → accordion-ef5e6161.js} +1 -1
- package/lib/edge/blocks-90fd2fd8.js +808 -0
- package/lib/edge/blocks-dc478c97.cjs +12 -0
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-3ed29654.cjs → button-228f448d.cjs} +1 -1
- package/lib/edge/{button-e852700f.js → button-8d307faf.js} +2 -2
- package/lib/edge/columns-3547be8c.cjs +28 -0
- package/lib/edge/{columns-ee464f6c.js → columns-77b7011a.js} +10 -9
- package/lib/edge/{content-variants-c0257a99.js → content-variants-4f7cad1a.js} +15 -13
- package/lib/edge/content-variants-f0edf280.cjs +134 -0
- package/lib/edge/evaluate-384a03ed.js +2615 -0
- package/lib/edge/evaluate-39c2c786.cjs +21 -0
- package/lib/edge/form-c6da17f5.cjs +1 -0
- package/lib/edge/{form-8191004e.js → form-d40e9eca.js} +8 -7
- package/lib/edge/{get-class-prop-name-5fc98fcc.cjs → get-class-prop-name-4f8743e9.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-d18337d2.js → get-class-prop-name-767dbeb0.js} +1 -1
- package/lib/edge/{image-e3fcd611.js → image-6a074aab.js} +27 -25
- package/lib/edge/image-eebfcbac.cjs +17 -0
- package/lib/edge/{img-10ef20a5.cjs → img-c50b3839.cjs} +1 -1
- package/lib/edge/{img-a24ed75f.js → img-d650b796.js} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/init.cjs +1 -1
- package/lib/edge/init.mjs +1 -1
- package/lib/edge/{input-3876429d.js → input-5646dcb2.js} +1 -1
- package/lib/edge/{input-6325bfc0.cjs → input-aaba7df0.cjs} +1 -1
- package/lib/edge/{select-3f0f00f3.cjs → select-2e7bf7d0.cjs} +1 -1
- package/lib/edge/{select-5dc1c7d1.js → select-d3905dcd.js} +1 -1
- package/lib/edge/{server-entry-ff728468.js → server-entry-29a170e3.js} +1 -1
- package/lib/edge/{server-entry-805b9266.cjs → server-entry-b0e7430b.cjs} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/slot-695259cf.cjs +1 -0
- package/lib/edge/{slot-20fe5e4f.js → slot-82c0b340.js} +12 -11
- package/lib/edge/{symbol-5012ed02.cjs → symbol-5a6a783f.cjs} +1 -1
- package/lib/edge/{symbol-e95082e1.js → symbol-91897bd4.js} +2 -2
- package/lib/edge/tabs-4c4a6b19.cjs +1 -0
- package/lib/edge/{tabs-261e8cd4.js → tabs-a191e7b1.js} +10 -9
- package/lib/edge/text-7a00e2f8.cjs +1 -0
- package/lib/edge/text-ca974245.js +38 -0
- package/lib/node/blocks-exports.cjs +15 -15
- package/lib/node/blocks-exports.mjs +192 -171
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +2 -2
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +2 -2
- package/lib/node/{node-runtime-160b6846.cjs → node-runtime-a6fb6ac7.cjs} +1 -1
- package/lib/node/{node-runtime-405effc5.js → node-runtime-d8e6d827.js} +1 -1
- package/lib/node/{server-entry-02cecfb7.cjs → server-entry-ba3e0524.cjs} +1 -1
- package/lib/{browser/server-entry-0687830a.js → node/server-entry-f6ee5d92.js} +1 -1
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/package.json +1 -1
- package/types/blocks/image/image.types.d.ts +2 -0
- package/types/blocks/symbol/symbol.types.d.ts +1 -0
- package/types/components/content-variants/content-variants.types.d.ts +2 -1
- package/types/components/content-variants/extra-framework-props-types.d.ts +2 -0
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/context/extra-context-types.d.ts +6 -0
- package/types/context/types.d.ts +2 -1
- package/lib/edge/blocks-db3cfcac.js +0 -3419
- package/lib/edge/blocks-f524a758.cjs +0 -32
- package/lib/edge/columns-1f84e26e.cjs +0 -28
- package/lib/edge/content-variants-42f2495b.cjs +0 -134
- package/lib/edge/form-4444faf2.cjs +0 -1
- package/lib/edge/image-344ddbb0.cjs +0 -17
- package/lib/edge/slot-a64b535f.cjs +0 -1
- package/lib/edge/tabs-d672f816.cjs +0 -1
- package/lib/edge/text-5915f038.js +0 -17
- package/lib/edge/text-e6dbb721.cjs +0 -1
|
@@ -0,0 +1,808 @@
|
|
|
1
|
+
import { jsx as i, Fragment as y, jsxs as B } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as F, useState as j, useEffect as V, useContext as W } from "react";
|
|
3
|
+
import { BuilderContext as D } from "./blocks-exports.mjs";
|
|
4
|
+
import { checkIsDefined as v, TARGET as P, isEditing as N } from "./server-entry-29a170e3.js";
|
|
5
|
+
import { evaluate as w, set as K } from "./evaluate-384a03ed.js";
|
|
6
|
+
import { getClassPropName as Z } from "./get-class-prop-name-767dbeb0.js";
|
|
7
|
+
import { DynamicRenderer as J } from "./dynamic-renderer-8b343325.js";
|
|
8
|
+
const M = (e) => JSON.parse(JSON.stringify(e)), Q = F({ registeredComponents: {} });
|
|
9
|
+
function q(e) {
|
|
10
|
+
var t;
|
|
11
|
+
return {
|
|
12
|
+
...(t = e.component) == null ? void 0 : t.options,
|
|
13
|
+
...e.options
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
const G = ({
|
|
17
|
+
block: e,
|
|
18
|
+
context: t,
|
|
19
|
+
localState: n,
|
|
20
|
+
rootState: o,
|
|
21
|
+
rootSetState: r
|
|
22
|
+
}) => {
|
|
23
|
+
if (!e.bindings)
|
|
24
|
+
return e;
|
|
25
|
+
const l = M(e), s = {
|
|
26
|
+
...l,
|
|
27
|
+
properties: {
|
|
28
|
+
...l.properties
|
|
29
|
+
},
|
|
30
|
+
actions: {
|
|
31
|
+
...l.actions
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
for (const c in e.bindings) {
|
|
35
|
+
const u = e.bindings[c], f = w({
|
|
36
|
+
code: u,
|
|
37
|
+
localState: n,
|
|
38
|
+
rootState: o,
|
|
39
|
+
rootSetState: r,
|
|
40
|
+
context: t,
|
|
41
|
+
enableCache: !0
|
|
42
|
+
});
|
|
43
|
+
K(s, c, f);
|
|
44
|
+
}
|
|
45
|
+
return s;
|
|
46
|
+
};
|
|
47
|
+
function k({
|
|
48
|
+
block: e,
|
|
49
|
+
context: t,
|
|
50
|
+
shouldEvaluateBindings: n,
|
|
51
|
+
localState: o,
|
|
52
|
+
rootState: r,
|
|
53
|
+
rootSetState: l
|
|
54
|
+
}) {
|
|
55
|
+
const s = e;
|
|
56
|
+
return n ? G({
|
|
57
|
+
block: s,
|
|
58
|
+
localState: o,
|
|
59
|
+
rootState: r,
|
|
60
|
+
rootSetState: l,
|
|
61
|
+
context: t
|
|
62
|
+
}) : s;
|
|
63
|
+
}
|
|
64
|
+
const C = (e) => e ? e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase() : "";
|
|
65
|
+
function X(e, t, n = {}) {
|
|
66
|
+
let o, r, l, s = null, c = 0;
|
|
67
|
+
const u = function() {
|
|
68
|
+
c = n.leading === !1 ? 0 : Date.now(), s = null, l = e.apply(o, r), s || (o = r = null);
|
|
69
|
+
};
|
|
70
|
+
return function() {
|
|
71
|
+
const f = Date.now();
|
|
72
|
+
!c && n.leading === !1 && (c = f);
|
|
73
|
+
const h = t - (f - c);
|
|
74
|
+
return o = this, r = arguments, h <= 0 || h > t ? (s && (clearTimeout(s), s = null), c = f, l = e.apply(o, r), s || (o = r = null)) : !s && n.trailing !== !1 && (s = setTimeout(u, h)), l;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function g(e, ...t) {
|
|
78
|
+
const n = Object(e);
|
|
79
|
+
for (let o = 1; o < arguments.length; o++) {
|
|
80
|
+
const r = arguments[o];
|
|
81
|
+
if (r != null)
|
|
82
|
+
for (const l in r)
|
|
83
|
+
Object.prototype.hasOwnProperty.call(r, l) && (n[l] = r[l]);
|
|
84
|
+
}
|
|
85
|
+
return n;
|
|
86
|
+
}
|
|
87
|
+
function Y(e) {
|
|
88
|
+
for (const t of e)
|
|
89
|
+
switch (t.trigger) {
|
|
90
|
+
case "pageLoad":
|
|
91
|
+
te(t);
|
|
92
|
+
break;
|
|
93
|
+
case "scrollInView":
|
|
94
|
+
ne(t);
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
function L(e) {
|
|
99
|
+
console.warn(`Cannot animate element: element with ID ${e} not found!`);
|
|
100
|
+
}
|
|
101
|
+
function z(e, t) {
|
|
102
|
+
const n = ee(e), o = getComputedStyle(t), r = e.steps[0].styles, l = e.steps[e.steps.length - 1].styles, s = [r, l];
|
|
103
|
+
for (const c of s)
|
|
104
|
+
for (const u of n)
|
|
105
|
+
u in c || (c[u] = o[u]);
|
|
106
|
+
}
|
|
107
|
+
function ee(e) {
|
|
108
|
+
const t = [];
|
|
109
|
+
for (const n of e.steps)
|
|
110
|
+
for (const o in n.styles)
|
|
111
|
+
t.indexOf(o) === -1 && t.push(o);
|
|
112
|
+
return t;
|
|
113
|
+
}
|
|
114
|
+
function te(e) {
|
|
115
|
+
const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
|
|
116
|
+
if (!t.length) {
|
|
117
|
+
L(e.elementId || e.id || "");
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
Array.from(t).forEach((n) => {
|
|
121
|
+
z(e, n), n.style.transition = "none", n.style.transitionDelay = "0", g(n.style, e.steps[0].styles), setTimeout(() => {
|
|
122
|
+
n.style.transition = `all ${e.duration}s ${C(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s"), g(n.style, e.steps[1].styles), setTimeout(() => {
|
|
123
|
+
n.style.transition = "", n.style.transitionDelay = "";
|
|
124
|
+
}, (e.delay || 0) * 1e3 + e.duration * 1e3 + 100);
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
function ne(e) {
|
|
129
|
+
const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
|
|
130
|
+
if (!t.length) {
|
|
131
|
+
L(e.elementId || e.id || "");
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
Array.from(t).forEach((n) => {
|
|
135
|
+
z(e, n);
|
|
136
|
+
let o = !1, r = !1;
|
|
137
|
+
function l() {
|
|
138
|
+
!o && c(n) ? (o = !0, r = !0, setTimeout(() => {
|
|
139
|
+
g(n.style, e.steps[1].styles), e.repeat || document.removeEventListener("scroll", s), setTimeout(() => {
|
|
140
|
+
r = !1, e.repeat || (n.style.transition = "", n.style.transitionDelay = "");
|
|
141
|
+
}, (e.duration + (e.delay || 0)) * 1e3 + 100);
|
|
142
|
+
})) : e.repeat && o && !r && !c(n) && (o = !1, g(n.style, e.steps[0].styles));
|
|
143
|
+
}
|
|
144
|
+
const s = X(l, 200, {
|
|
145
|
+
leading: !1
|
|
146
|
+
});
|
|
147
|
+
function c(h) {
|
|
148
|
+
const a = h.getBoundingClientRect(), d = window.innerHeight, m = (e.thresholdPercent || 0) / 100 * d;
|
|
149
|
+
return a.bottom > m && a.top < d - m;
|
|
150
|
+
}
|
|
151
|
+
const u = e.steps[0].styles;
|
|
152
|
+
function f() {
|
|
153
|
+
g(n.style, u);
|
|
154
|
+
}
|
|
155
|
+
f(), setTimeout(() => {
|
|
156
|
+
n.style.transition = `all ${e.duration}s ${C(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s");
|
|
157
|
+
}), document.addEventListener("scroll", s, {
|
|
158
|
+
capture: !0,
|
|
159
|
+
passive: !0
|
|
160
|
+
}), l();
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
const H = (e) => Object.entries(e).map(([n, o]) => {
|
|
164
|
+
if (typeof o == "string")
|
|
165
|
+
return `${C(n)}: ${o};`;
|
|
166
|
+
}).filter(v), oe = (e) => H(e).join(`
|
|
167
|
+
`), x = ({
|
|
168
|
+
mediaQuery: e,
|
|
169
|
+
className: t,
|
|
170
|
+
styles: n
|
|
171
|
+
}) => {
|
|
172
|
+
const o = `.${t} {
|
|
173
|
+
${oe(n)}
|
|
174
|
+
}`;
|
|
175
|
+
return e ? `${e} {
|
|
176
|
+
${o}
|
|
177
|
+
}` : o;
|
|
178
|
+
};
|
|
179
|
+
function re({
|
|
180
|
+
style: e
|
|
181
|
+
}) {
|
|
182
|
+
return e;
|
|
183
|
+
}
|
|
184
|
+
const le = ({
|
|
185
|
+
block: e,
|
|
186
|
+
context: t
|
|
187
|
+
}) => ce(re({
|
|
188
|
+
style: e.style || {},
|
|
189
|
+
context: t,
|
|
190
|
+
block: e
|
|
191
|
+
}));
|
|
192
|
+
function ce(e) {
|
|
193
|
+
switch (P) {
|
|
194
|
+
case "svelte":
|
|
195
|
+
case "vue":
|
|
196
|
+
case "solid":
|
|
197
|
+
case "angular":
|
|
198
|
+
return H(e).join(" ");
|
|
199
|
+
case "qwik":
|
|
200
|
+
case "reactNative":
|
|
201
|
+
case "react":
|
|
202
|
+
case "rsc":
|
|
203
|
+
return e;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
const se = ({
|
|
207
|
+
block: e,
|
|
208
|
+
context: t,
|
|
209
|
+
registeredComponents: n
|
|
210
|
+
}) => {
|
|
211
|
+
var l;
|
|
212
|
+
const o = (l = k({
|
|
213
|
+
block: e,
|
|
214
|
+
localState: t.localState,
|
|
215
|
+
rootState: t.rootState,
|
|
216
|
+
rootSetState: t.rootSetState,
|
|
217
|
+
context: t.context,
|
|
218
|
+
shouldEvaluateBindings: !1
|
|
219
|
+
}).component) == null ? void 0 : l.name;
|
|
220
|
+
if (!o)
|
|
221
|
+
return null;
|
|
222
|
+
const r = n[o];
|
|
223
|
+
if (r)
|
|
224
|
+
return r;
|
|
225
|
+
console.warn(`
|
|
226
|
+
Could not find a registered component named "${o}".
|
|
227
|
+
If you registered it, is the file that registered it imported by the file that needs to render it?`);
|
|
228
|
+
}, ie = ({
|
|
229
|
+
block: e,
|
|
230
|
+
context: t
|
|
231
|
+
}) => {
|
|
232
|
+
const {
|
|
233
|
+
repeat: n,
|
|
234
|
+
...o
|
|
235
|
+
} = e;
|
|
236
|
+
if (!(n != null && n.collection))
|
|
237
|
+
return;
|
|
238
|
+
const r = w({
|
|
239
|
+
code: n.collection,
|
|
240
|
+
localState: t.localState,
|
|
241
|
+
rootState: t.rootState,
|
|
242
|
+
rootSetState: t.rootSetState,
|
|
243
|
+
context: t.context,
|
|
244
|
+
enableCache: !0
|
|
245
|
+
});
|
|
246
|
+
if (!Array.isArray(r))
|
|
247
|
+
return;
|
|
248
|
+
const l = n.collection.split(".").pop(), s = n.itemName || (l ? l + "Item" : "item");
|
|
249
|
+
return r.map((u, f) => ({
|
|
250
|
+
context: {
|
|
251
|
+
...t,
|
|
252
|
+
localState: {
|
|
253
|
+
...t.localState,
|
|
254
|
+
$index: f,
|
|
255
|
+
$item: u,
|
|
256
|
+
[s]: u,
|
|
257
|
+
[`$${s}Index`]: f
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
block: o
|
|
261
|
+
}));
|
|
262
|
+
}, ae = (e, t) => {
|
|
263
|
+
var n;
|
|
264
|
+
return (n = e == null ? void 0 : e.shouldReceiveBuilderProps) != null && n.builderLinkComponent ? {
|
|
265
|
+
builderLinkComponent: t
|
|
266
|
+
} : {};
|
|
267
|
+
}, ue = (e, t) => {
|
|
268
|
+
var n;
|
|
269
|
+
return (n = e == null ? void 0 : e.shouldReceiveBuilderProps) != null && n.builderComponents ? {
|
|
270
|
+
builderComponents: t
|
|
271
|
+
} : {};
|
|
272
|
+
}, de = (e, t) => {
|
|
273
|
+
var n;
|
|
274
|
+
return (n = e == null ? void 0 : e.shouldReceiveBuilderProps) != null && n.builderBlock ? {
|
|
275
|
+
builderBlock: t
|
|
276
|
+
} : {};
|
|
277
|
+
}, fe = (e, t) => {
|
|
278
|
+
var n;
|
|
279
|
+
return (n = e == null ? void 0 : e.shouldReceiveBuilderProps) != null && n.builderContext ? {
|
|
280
|
+
builderContext: t
|
|
281
|
+
} : {};
|
|
282
|
+
}, U = {
|
|
283
|
+
small: {
|
|
284
|
+
min: 320,
|
|
285
|
+
default: 321,
|
|
286
|
+
max: 640
|
|
287
|
+
},
|
|
288
|
+
medium: {
|
|
289
|
+
min: 641,
|
|
290
|
+
default: 642,
|
|
291
|
+
max: 991
|
|
292
|
+
},
|
|
293
|
+
large: {
|
|
294
|
+
min: 990,
|
|
295
|
+
default: 991,
|
|
296
|
+
max: 1200
|
|
297
|
+
}
|
|
298
|
+
}, O = (e, t = U) => `@media (max-width: ${t[e].max}px)`, me = ({
|
|
299
|
+
small: e,
|
|
300
|
+
medium: t
|
|
301
|
+
}) => {
|
|
302
|
+
const n = M(U);
|
|
303
|
+
if (!e || !t)
|
|
304
|
+
return n;
|
|
305
|
+
const o = Math.floor(e / 2);
|
|
306
|
+
n.small = {
|
|
307
|
+
max: e,
|
|
308
|
+
min: o,
|
|
309
|
+
default: o + 1
|
|
310
|
+
};
|
|
311
|
+
const r = n.small.max + 1;
|
|
312
|
+
n.medium = {
|
|
313
|
+
max: t,
|
|
314
|
+
min: r,
|
|
315
|
+
default: r + 1
|
|
316
|
+
};
|
|
317
|
+
const l = n.medium.max + 1;
|
|
318
|
+
return n.large = {
|
|
319
|
+
max: 2e3,
|
|
320
|
+
// TODO: decide upper limit
|
|
321
|
+
min: l,
|
|
322
|
+
default: l + 1
|
|
323
|
+
}, n;
|
|
324
|
+
};
|
|
325
|
+
function he(e) {
|
|
326
|
+
return /* @__PURE__ */ i(
|
|
327
|
+
"style",
|
|
328
|
+
{
|
|
329
|
+
dangerouslySetInnerHTML: { __html: e.styles },
|
|
330
|
+
"data-id": e.id,
|
|
331
|
+
nonce: e.nonce
|
|
332
|
+
}
|
|
333
|
+
);
|
|
334
|
+
}
|
|
335
|
+
function Se(e) {
|
|
336
|
+
function t() {
|
|
337
|
+
const o = k({
|
|
338
|
+
block: e.block,
|
|
339
|
+
localState: e.context.localState,
|
|
340
|
+
rootState: e.context.rootState,
|
|
341
|
+
rootSetState: e.context.rootSetState,
|
|
342
|
+
context: e.context.context,
|
|
343
|
+
shouldEvaluateBindings: !0
|
|
344
|
+
});
|
|
345
|
+
return v(o.hide) ? !o.hide : v(o.show) ? o.show : !0;
|
|
346
|
+
}
|
|
347
|
+
function n() {
|
|
348
|
+
var E, A, $;
|
|
349
|
+
const o = k({
|
|
350
|
+
block: e.block,
|
|
351
|
+
localState: e.context.localState,
|
|
352
|
+
rootState: e.context.rootState,
|
|
353
|
+
rootSetState: e.context.rootSetState,
|
|
354
|
+
context: e.context.context,
|
|
355
|
+
shouldEvaluateBindings: !0
|
|
356
|
+
}), r = o.responsiveStyles, l = e.context.content, s = me(
|
|
357
|
+
((E = l == null ? void 0 : l.meta) == null ? void 0 : E.breakpoints) || {}
|
|
358
|
+
), c = r == null ? void 0 : r.large, u = r == null ? void 0 : r.medium, f = r == null ? void 0 : r.small, h = o.id;
|
|
359
|
+
if (!h)
|
|
360
|
+
return "";
|
|
361
|
+
const a = c ? x({
|
|
362
|
+
className: h,
|
|
363
|
+
styles: c
|
|
364
|
+
}) : "", d = u ? x({
|
|
365
|
+
className: h,
|
|
366
|
+
styles: u,
|
|
367
|
+
mediaQuery: O(
|
|
368
|
+
"medium",
|
|
369
|
+
s
|
|
370
|
+
)
|
|
371
|
+
}) : "", S = f ? x({
|
|
372
|
+
className: h,
|
|
373
|
+
styles: f,
|
|
374
|
+
mediaQuery: O(
|
|
375
|
+
"small",
|
|
376
|
+
s
|
|
377
|
+
)
|
|
378
|
+
}) : "", m = o.animations && o.animations.find((b) => b.trigger === "hover");
|
|
379
|
+
let R = "";
|
|
380
|
+
if (m) {
|
|
381
|
+
const b = (($ = (A = m.steps) == null ? void 0 : A[1]) == null ? void 0 : $.styles) || {};
|
|
382
|
+
R = x({
|
|
383
|
+
className: `${h}:hover`,
|
|
384
|
+
styles: {
|
|
385
|
+
...b,
|
|
386
|
+
transition: `all ${m.duration}s ${C(
|
|
387
|
+
m.easing
|
|
388
|
+
)}`,
|
|
389
|
+
transitionDelay: m.delay ? `${m.delay}s` : "0s"
|
|
390
|
+
}
|
|
391
|
+
}) || "";
|
|
392
|
+
}
|
|
393
|
+
return [
|
|
394
|
+
a,
|
|
395
|
+
d,
|
|
396
|
+
S,
|
|
397
|
+
R
|
|
398
|
+
].join(" ");
|
|
399
|
+
}
|
|
400
|
+
return /* @__PURE__ */ i(y, { children: n() && t() ? /* @__PURE__ */ i(y, { children: /* @__PURE__ */ i(
|
|
401
|
+
he,
|
|
402
|
+
{
|
|
403
|
+
id: "builderio-block",
|
|
404
|
+
styles: n(),
|
|
405
|
+
nonce: e.context.nonce
|
|
406
|
+
}
|
|
407
|
+
) }) : null });
|
|
408
|
+
}
|
|
409
|
+
function ye(e) {
|
|
410
|
+
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
411
|
+
}
|
|
412
|
+
const ge = (e) => `on${ye(e)}`, xe = (e, t) => (n) => w({
|
|
413
|
+
code: e,
|
|
414
|
+
context: t.context,
|
|
415
|
+
localState: t.localState,
|
|
416
|
+
rootState: t.rootState,
|
|
417
|
+
rootSetState: t.rootSetState,
|
|
418
|
+
event: n,
|
|
419
|
+
isExpression: !1,
|
|
420
|
+
enableCache: !0
|
|
421
|
+
});
|
|
422
|
+
function _(e) {
|
|
423
|
+
var o;
|
|
424
|
+
const t = {}, n = (o = e.block.actions) != null ? o : {};
|
|
425
|
+
for (const r in n) {
|
|
426
|
+
if (!n.hasOwnProperty(r))
|
|
427
|
+
continue;
|
|
428
|
+
const l = n[r];
|
|
429
|
+
let s = ge(r);
|
|
430
|
+
if (e.stripPrefix)
|
|
431
|
+
switch (P) {
|
|
432
|
+
case "vue":
|
|
433
|
+
s = s.replace("v-on:", "");
|
|
434
|
+
break;
|
|
435
|
+
case "svelte":
|
|
436
|
+
s = s.replace("on:", "");
|
|
437
|
+
break;
|
|
438
|
+
}
|
|
439
|
+
t[s] = xe(l, e);
|
|
440
|
+
}
|
|
441
|
+
return t;
|
|
442
|
+
}
|
|
443
|
+
function ke({
|
|
444
|
+
properties: e
|
|
445
|
+
}) {
|
|
446
|
+
return e;
|
|
447
|
+
}
|
|
448
|
+
const Ce = (e) => ({
|
|
449
|
+
href: e.href
|
|
450
|
+
});
|
|
451
|
+
function I({
|
|
452
|
+
block: e,
|
|
453
|
+
context: t
|
|
454
|
+
}) {
|
|
455
|
+
var o;
|
|
456
|
+
const n = {
|
|
457
|
+
...Ce(e),
|
|
458
|
+
...e.properties,
|
|
459
|
+
"builder-id": e.id,
|
|
460
|
+
style: le({
|
|
461
|
+
block: e,
|
|
462
|
+
context: t
|
|
463
|
+
}),
|
|
464
|
+
[Z()]: [e.id, "builder-block", e.class, (o = e.properties) == null ? void 0 : o.class].filter(Boolean).join(" ")
|
|
465
|
+
};
|
|
466
|
+
return ke({
|
|
467
|
+
properties: n,
|
|
468
|
+
context: t,
|
|
469
|
+
block: e
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
function pe(e) {
|
|
473
|
+
return /* @__PURE__ */ i(
|
|
474
|
+
J,
|
|
475
|
+
{
|
|
476
|
+
TagName: e.Wrapper,
|
|
477
|
+
attributes: I({
|
|
478
|
+
block: e.block,
|
|
479
|
+
context: e.context
|
|
480
|
+
}),
|
|
481
|
+
actionAttributes: _({
|
|
482
|
+
block: e.block,
|
|
483
|
+
rootState: e.context.rootState,
|
|
484
|
+
rootSetState: e.context.rootSetState,
|
|
485
|
+
localState: e.context.localState,
|
|
486
|
+
context: e.context.context,
|
|
487
|
+
stripPrefix: !0
|
|
488
|
+
}),
|
|
489
|
+
children: e.children
|
|
490
|
+
}
|
|
491
|
+
);
|
|
492
|
+
}
|
|
493
|
+
function be(e) {
|
|
494
|
+
function t() {
|
|
495
|
+
return e.includeBlockProps ? {
|
|
496
|
+
...I({
|
|
497
|
+
block: e.block,
|
|
498
|
+
context: e.context
|
|
499
|
+
}),
|
|
500
|
+
..._({
|
|
501
|
+
block: e.block,
|
|
502
|
+
rootState: e.context.rootState,
|
|
503
|
+
rootSetState: e.context.rootSetState,
|
|
504
|
+
localState: e.context.localState,
|
|
505
|
+
context: e.context.context
|
|
506
|
+
})
|
|
507
|
+
} : {};
|
|
508
|
+
}
|
|
509
|
+
return /* @__PURE__ */ i(e.Wrapper, { ...e.wrapperProps, attributes: t(), children: e.children });
|
|
510
|
+
}
|
|
511
|
+
const Be = ({
|
|
512
|
+
componentOptions: e,
|
|
513
|
+
builderBlock: t,
|
|
514
|
+
context: n,
|
|
515
|
+
componentRef: o,
|
|
516
|
+
includeBlockProps: r,
|
|
517
|
+
isInteractive: l,
|
|
518
|
+
contextValue: s
|
|
519
|
+
}) => {
|
|
520
|
+
const c = {
|
|
521
|
+
...e,
|
|
522
|
+
/**
|
|
523
|
+
* If `noWrap` is set to `true`, then the block's props/attributes are provided to the
|
|
524
|
+
* component itself directly. Otherwise, they are provided to the wrapper element.
|
|
525
|
+
*/
|
|
526
|
+
...r ? {
|
|
527
|
+
attributes: I({
|
|
528
|
+
block: t,
|
|
529
|
+
context: s
|
|
530
|
+
})
|
|
531
|
+
} : {}
|
|
532
|
+
};
|
|
533
|
+
return l ? {
|
|
534
|
+
Wrapper: o,
|
|
535
|
+
block: t,
|
|
536
|
+
context: n,
|
|
537
|
+
wrapperProps: e,
|
|
538
|
+
includeBlockProps: r
|
|
539
|
+
} : c;
|
|
540
|
+
};
|
|
541
|
+
function T(e) {
|
|
542
|
+
var o;
|
|
543
|
+
const [t, n] = j(
|
|
544
|
+
() => e.isInteractive ? be : e.componentRef
|
|
545
|
+
);
|
|
546
|
+
return /* @__PURE__ */ i(y, { children: e.componentRef ? /* @__PURE__ */ i(y, { children: /* @__PURE__ */ i(
|
|
547
|
+
t,
|
|
548
|
+
{
|
|
549
|
+
...Be({
|
|
550
|
+
componentOptions: e.componentOptions,
|
|
551
|
+
builderBlock: e.builderBlock,
|
|
552
|
+
context: e.context,
|
|
553
|
+
componentRef: e.componentRef,
|
|
554
|
+
linkComponent: e.linkComponent,
|
|
555
|
+
includeBlockProps: e.includeBlockProps,
|
|
556
|
+
isInteractive: e.isInteractive,
|
|
557
|
+
contextValue: e.context
|
|
558
|
+
}),
|
|
559
|
+
children: (o = e.blockChildren) == null ? void 0 : o.map((r) => /* @__PURE__ */ i(
|
|
560
|
+
p,
|
|
561
|
+
{
|
|
562
|
+
block: r,
|
|
563
|
+
context: e.context,
|
|
564
|
+
registeredComponents: e.registeredComponents,
|
|
565
|
+
linkComponent: e.linkComponent
|
|
566
|
+
},
|
|
567
|
+
r.id
|
|
568
|
+
))
|
|
569
|
+
}
|
|
570
|
+
) }) : null });
|
|
571
|
+
}
|
|
572
|
+
function ve(e) {
|
|
573
|
+
const [t, n] = j(() => e.repeatContext);
|
|
574
|
+
return /* @__PURE__ */ i(D.Provider, { value: t, children: /* @__PURE__ */ i(
|
|
575
|
+
p,
|
|
576
|
+
{
|
|
577
|
+
block: e.block,
|
|
578
|
+
context: t,
|
|
579
|
+
registeredComponents: e.registeredComponents,
|
|
580
|
+
linkComponent: e.linkComponent
|
|
581
|
+
}
|
|
582
|
+
) });
|
|
583
|
+
}
|
|
584
|
+
function p(e) {
|
|
585
|
+
var u, f, h;
|
|
586
|
+
function t() {
|
|
587
|
+
return se({
|
|
588
|
+
block: e.block,
|
|
589
|
+
context: e.context,
|
|
590
|
+
registeredComponents: e.registeredComponents
|
|
591
|
+
});
|
|
592
|
+
}
|
|
593
|
+
function n() {
|
|
594
|
+
return ie({
|
|
595
|
+
block: e.block,
|
|
596
|
+
context: e.context
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
function o() {
|
|
600
|
+
var a;
|
|
601
|
+
return (a = e.block.repeat) != null && a.collection ? e.block : k({
|
|
602
|
+
block: e.block,
|
|
603
|
+
localState: e.context.localState,
|
|
604
|
+
rootState: e.context.rootState,
|
|
605
|
+
rootSetState: e.context.rootSetState,
|
|
606
|
+
context: e.context.context,
|
|
607
|
+
shouldEvaluateBindings: !0
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
function r() {
|
|
611
|
+
var d;
|
|
612
|
+
return e.block.tagName === "a" || ((d = o().properties) == null ? void 0 : d.href) || o().href ? e.linkComponent || "a" : e.block.tagName || "div";
|
|
613
|
+
}
|
|
614
|
+
function l() {
|
|
615
|
+
var S, m;
|
|
616
|
+
if ((S = e.block.repeat) != null && S.collection)
|
|
617
|
+
return !!((m = n == null ? void 0 : n()) != null && m.length);
|
|
618
|
+
const a = "hide" in o() ? o().hide : !1;
|
|
619
|
+
return ("show" in o() ? o().show : !0) && !a;
|
|
620
|
+
}
|
|
621
|
+
function s() {
|
|
622
|
+
var d, S;
|
|
623
|
+
return !((d = t == null ? void 0 : t()) != null && d.component) && !n() ? (S = o().children) != null ? S : [] : [];
|
|
624
|
+
}
|
|
625
|
+
function c() {
|
|
626
|
+
var a, d, S, m;
|
|
627
|
+
return {
|
|
628
|
+
blockChildren: (a = o().children) != null ? a : [],
|
|
629
|
+
componentRef: (d = t == null ? void 0 : t()) == null ? void 0 : d.component,
|
|
630
|
+
componentOptions: {
|
|
631
|
+
...q(o()),
|
|
632
|
+
...de(t(), o()),
|
|
633
|
+
...fe(t(), e.context),
|
|
634
|
+
...ae(t(), e.linkComponent),
|
|
635
|
+
...ue(
|
|
636
|
+
t(),
|
|
637
|
+
e.registeredComponents
|
|
638
|
+
)
|
|
639
|
+
},
|
|
640
|
+
context: e.context,
|
|
641
|
+
linkComponent: e.linkComponent,
|
|
642
|
+
registeredComponents: e.registeredComponents,
|
|
643
|
+
builderBlock: o(),
|
|
644
|
+
includeBlockProps: ((S = t == null ? void 0 : t()) == null ? void 0 : S.noWrap) === !0,
|
|
645
|
+
isInteractive: !((m = t == null ? void 0 : t()) != null && m.isRSC && P === "rsc")
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
return V(() => {
|
|
649
|
+
const a = o().id, d = o().animations;
|
|
650
|
+
d && a && Y(
|
|
651
|
+
d.map((S) => ({
|
|
652
|
+
...S,
|
|
653
|
+
elementId: a
|
|
654
|
+
}))
|
|
655
|
+
);
|
|
656
|
+
}, []), /* @__PURE__ */ i(y, { children: l() ? /* @__PURE__ */ B(y, { children: [
|
|
657
|
+
/* @__PURE__ */ i(Se, { block: e.block, context: e.context }),
|
|
658
|
+
(u = t == null ? void 0 : t()) != null && u.noWrap ? /* @__PURE__ */ i(y, { children: /* @__PURE__ */ i(
|
|
659
|
+
T,
|
|
660
|
+
{
|
|
661
|
+
componentRef: c().componentRef,
|
|
662
|
+
componentOptions: c().componentOptions,
|
|
663
|
+
blockChildren: c().blockChildren,
|
|
664
|
+
context: c().context,
|
|
665
|
+
registeredComponents: c().registeredComponents,
|
|
666
|
+
linkComponent: c().linkComponent,
|
|
667
|
+
builderBlock: c().builderBlock,
|
|
668
|
+
includeBlockProps: c().includeBlockProps,
|
|
669
|
+
isInteractive: c().isInteractive
|
|
670
|
+
}
|
|
671
|
+
) }) : /* @__PURE__ */ i(y, { children: n() ? /* @__PURE__ */ i(y, { children: (h = n()) == null ? void 0 : h.map((a, d) => /* @__PURE__ */ i(
|
|
672
|
+
ve,
|
|
673
|
+
{
|
|
674
|
+
repeatContext: a.context,
|
|
675
|
+
block: a.block,
|
|
676
|
+
registeredComponents: e.registeredComponents,
|
|
677
|
+
linkComponent: e.linkComponent
|
|
678
|
+
},
|
|
679
|
+
d
|
|
680
|
+
)) }) : /* @__PURE__ */ B(
|
|
681
|
+
pe,
|
|
682
|
+
{
|
|
683
|
+
Wrapper: r(),
|
|
684
|
+
block: o(),
|
|
685
|
+
context: e.context,
|
|
686
|
+
children: [
|
|
687
|
+
/* @__PURE__ */ i(
|
|
688
|
+
T,
|
|
689
|
+
{
|
|
690
|
+
componentRef: c().componentRef,
|
|
691
|
+
componentOptions: c().componentOptions,
|
|
692
|
+
blockChildren: c().blockChildren,
|
|
693
|
+
context: c().context,
|
|
694
|
+
registeredComponents: c().registeredComponents,
|
|
695
|
+
linkComponent: c().linkComponent,
|
|
696
|
+
builderBlock: c().builderBlock,
|
|
697
|
+
includeBlockProps: c().includeBlockProps,
|
|
698
|
+
isInteractive: c().isInteractive
|
|
699
|
+
}
|
|
700
|
+
),
|
|
701
|
+
(f = s()) == null ? void 0 : f.map((a) => /* @__PURE__ */ i(
|
|
702
|
+
p,
|
|
703
|
+
{
|
|
704
|
+
block: a,
|
|
705
|
+
registeredComponents: e.registeredComponents,
|
|
706
|
+
linkComponent: e.linkComponent,
|
|
707
|
+
context: e.context
|
|
708
|
+
},
|
|
709
|
+
a.id
|
|
710
|
+
))
|
|
711
|
+
]
|
|
712
|
+
}
|
|
713
|
+
) })
|
|
714
|
+
] }) : null });
|
|
715
|
+
}
|
|
716
|
+
function Pe(e) {
|
|
717
|
+
function t() {
|
|
718
|
+
var r;
|
|
719
|
+
return "builder-blocks" + ((r = e.blocks) != null && r.length ? "" : " no-blocks");
|
|
720
|
+
}
|
|
721
|
+
function n() {
|
|
722
|
+
var r, l;
|
|
723
|
+
N() && !((r = e.blocks) != null && r.length) && ((l = window.parent) == null || l.postMessage(
|
|
724
|
+
{
|
|
725
|
+
type: "builder.clickEmptyBlocks",
|
|
726
|
+
data: {
|
|
727
|
+
parentElementId: e.parent,
|
|
728
|
+
dataPath: e.path
|
|
729
|
+
}
|
|
730
|
+
},
|
|
731
|
+
"*"
|
|
732
|
+
));
|
|
733
|
+
}
|
|
734
|
+
function o() {
|
|
735
|
+
var r, l;
|
|
736
|
+
N() && !((r = e.blocks) != null && r.length) && ((l = window.parent) == null || l.postMessage(
|
|
737
|
+
{
|
|
738
|
+
type: "builder.hoverEmptyBlocks",
|
|
739
|
+
data: {
|
|
740
|
+
parentElementId: e.parent,
|
|
741
|
+
dataPath: e.path
|
|
742
|
+
}
|
|
743
|
+
},
|
|
744
|
+
"*"
|
|
745
|
+
));
|
|
746
|
+
}
|
|
747
|
+
return /* @__PURE__ */ B(y, { children: [
|
|
748
|
+
/* @__PURE__ */ i(
|
|
749
|
+
e.BlocksWrapper,
|
|
750
|
+
{
|
|
751
|
+
className: t() + " props-blocks-wrapper-7cd1560e",
|
|
752
|
+
"builder-path": e.path,
|
|
753
|
+
"builder-parent-id": e.parent,
|
|
754
|
+
style: e.styleProp,
|
|
755
|
+
onClick: (r) => n(),
|
|
756
|
+
onMouseEnter: (r) => o(),
|
|
757
|
+
onKeyPress: (r) => n(),
|
|
758
|
+
...e.BlocksWrapperProps,
|
|
759
|
+
children: e.children
|
|
760
|
+
}
|
|
761
|
+
),
|
|
762
|
+
/* @__PURE__ */ i("style", { children: `.props-blocks-wrapper-7cd1560e {
|
|
763
|
+
display: flex;
|
|
764
|
+
flex-direction: column;
|
|
765
|
+
align-items: stretch;
|
|
766
|
+
}` })
|
|
767
|
+
] });
|
|
768
|
+
}
|
|
769
|
+
function we(e) {
|
|
770
|
+
var o, r, l;
|
|
771
|
+
const t = W(D), n = W(Q);
|
|
772
|
+
return /* @__PURE__ */ i(
|
|
773
|
+
Pe,
|
|
774
|
+
{
|
|
775
|
+
blocks: e.blocks,
|
|
776
|
+
parent: e.parent,
|
|
777
|
+
path: e.path,
|
|
778
|
+
styleProp: e.styleProp,
|
|
779
|
+
BlocksWrapper: ((o = e.context) == null ? void 0 : o.BlocksWrapper) || t.BlocksWrapper,
|
|
780
|
+
BlocksWrapperProps: ((r = e.context) == null ? void 0 : r.BlocksWrapperProps) || t.BlocksWrapperProps,
|
|
781
|
+
children: e.blocks ? /* @__PURE__ */ i(y, { children: (l = e.blocks) == null ? void 0 : l.map((s) => /* @__PURE__ */ i(
|
|
782
|
+
p,
|
|
783
|
+
{
|
|
784
|
+
block: s,
|
|
785
|
+
linkComponent: e.linkComponent,
|
|
786
|
+
context: e.context || t,
|
|
787
|
+
registeredComponents: e.registeredComponents || n.registeredComponents
|
|
788
|
+
},
|
|
789
|
+
s.id
|
|
790
|
+
)) }) : null
|
|
791
|
+
}
|
|
792
|
+
);
|
|
793
|
+
}
|
|
794
|
+
const Oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
795
|
+
__proto__: null,
|
|
796
|
+
default: we
|
|
797
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
798
|
+
export {
|
|
799
|
+
p as Block,
|
|
800
|
+
we as Blocks,
|
|
801
|
+
Q as ComponentsContext,
|
|
802
|
+
he as InlinedStyles,
|
|
803
|
+
Oe as blocks,
|
|
804
|
+
M as fastClone,
|
|
805
|
+
me as getSizesForBreakpoints,
|
|
806
|
+
ce as mapStyleObjToStrIfNeeded,
|
|
807
|
+
te as triggerAnimation
|
|
808
|
+
};
|