@builder.io/sdk-react 3.0.0 → 3.0.2

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