@builder.io/sdk-react 2.0.16 → 2.0.21

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