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