@builder.io/sdk-react-nextjs 0.8.1 → 0.10.0

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 (50) hide show
  1. package/lib/browser/{USE_CLIENT_BUNDLE-0479ddc8.js → USE_CLIENT_BUNDLE-8a469a88.js} +195 -189
  2. package/lib/browser/USE_CLIENT_BUNDLE-bd42f34e.cjs +23 -0
  3. package/lib/{edge/USE_SERVER_BUNDLE-70f5e4b2.cjs → browser/USE_SERVER_BUNDLE-608eb1c6.cjs} +1 -1
  4. package/lib/{edge/USE_SERVER_BUNDLE-de23a873.js → browser/USE_SERVER_BUNDLE-b0fcc116.js} +1 -1
  5. package/lib/browser/{bundle-e4200429.cjs → bundle-6593f46a.cjs} +10 -10
  6. package/lib/browser/{bundle-179c65a2.js → bundle-f23172a5.js} +288 -268
  7. package/lib/browser/index.cjs +1 -1
  8. package/lib/browser/index.mjs +3 -3
  9. package/lib/edge/USE_CLIENT_BUNDLE-2ee2538b.cjs +23 -0
  10. package/lib/{node/USE_CLIENT_BUNDLE-ac10325c.js → edge/USE_CLIENT_BUNDLE-474e3242.js} +195 -189
  11. package/lib/{node/USE_SERVER_BUNDLE-de4b4ff0.cjs → edge/USE_SERVER_BUNDLE-b5ccb43b.cjs} +1 -1
  12. package/lib/{node/USE_SERVER_BUNDLE-2b7a9305.js → edge/USE_SERVER_BUNDLE-da7c49b1.js} +1 -1
  13. package/lib/edge/{bundle-a1501121.cjs → bundle-7c571d18.cjs} +30 -30
  14. package/lib/edge/{bundle-a958c31b.js → bundle-bd18331d.js} +1037 -1017
  15. package/lib/edge/index.cjs +1 -1
  16. package/lib/edge/index.mjs +3 -3
  17. package/lib/{edge/USE_CLIENT_BUNDLE-8c3da5c9.js → node/USE_CLIENT_BUNDLE-39759ac3.js} +195 -189
  18. package/lib/node/USE_CLIENT_BUNDLE-fcb61de5.cjs +23 -0
  19. package/lib/{browser/USE_SERVER_BUNDLE-71c86494.cjs → node/USE_SERVER_BUNDLE-9a538e9b.cjs} +1 -1
  20. package/lib/{browser/USE_SERVER_BUNDLE-88940a10.js → node/USE_SERVER_BUNDLE-9cade0d5.js} +1 -1
  21. package/lib/node/{bundle-59bd1206.js → bundle-49222e30.js} +188 -168
  22. package/lib/node/{bundle-ef482315.cjs → bundle-ad89090d.cjs} +9 -9
  23. package/lib/node/index.cjs +1 -1
  24. package/lib/node/index.mjs +3 -3
  25. package/package.json +1 -1
  26. package/types/cjs/components/blocks/blocks-wrapper.d.ts +8 -0
  27. package/types/cjs/components/blocks/blocks.d.ts +1 -1
  28. package/types/cjs/components/content/components/enable-editor.d.ts +1 -1
  29. package/types/cjs/components/content-variants/content-variants.types.d.ts +16 -0
  30. package/types/cjs/constants/sdk-version.d.ts +1 -1
  31. package/types/cjs/context/types.d.ts +2 -1
  32. package/types/cjs/functions/get-content/index.d.ts +2 -2
  33. package/types/cjs/functions/transform-block-properties.d.ts +5 -1
  34. package/types/cjs/types/enforced-partials.d.ts +7 -2
  35. package/types/esm/components/blocks/blocks-wrapper.d.ts +8 -0
  36. package/types/esm/components/blocks/blocks.d.ts +1 -1
  37. package/types/esm/components/content/components/enable-editor.d.ts +1 -1
  38. package/types/esm/components/content-variants/content-variants.types.d.ts +16 -0
  39. package/types/esm/constants/sdk-version.d.ts +1 -1
  40. package/types/esm/context/types.d.ts +2 -1
  41. package/types/esm/functions/get-content/index.d.ts +2 -2
  42. package/types/esm/functions/transform-block-properties.d.ts +5 -1
  43. package/types/esm/types/enforced-partials.d.ts +7 -2
  44. package/lib/browser/USE_CLIENT_BUNDLE-38635250.cjs +0 -23
  45. package/lib/edge/USE_CLIENT_BUNDLE-7d1db7a7.cjs +0 -23
  46. package/lib/node/USE_CLIENT_BUNDLE-1fd9261f.cjs +0 -23
  47. package/types/cjs/functions/get-react-native-block-styles.d.ts +0 -7
  48. package/types/cjs/functions/sanitize-react-native-block-styles.d.ts +0 -3
  49. package/types/esm/functions/get-react-native-block-styles.d.ts +0 -7
  50. package/types/esm/functions/sanitize-react-native-block-styles.d.ts +0 -3
@@ -1,12 +1,12 @@
1
1
  "use client";
2
- import { jsxs as C, Fragment as h, jsx as i } from "react/jsx-runtime";
3
- import { g as T, a as N, i as E, b as R, c as Q, d as P, e as D, _ as U, f as X, l as Y, h as H, j as Z, k as p, r as ee, s as te, m as ne, n as ie, o as ae } from "./bundle-179c65a2.js";
4
- import { useRef as B, useState as k, useEffect as v, createContext as ce, createElement as le } from "react";
5
- import { p as oe } from "./USE_SERVER_BUNDLE-88940a10.js";
6
- import { useRouter as re } from "next/navigation";
7
- function ge(e) {
8
- return /* @__PURE__ */ C(h, { children: [
9
- e.link ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
2
+ import { jsxs as C, Fragment as m, jsx as i } from "react/jsx-runtime";
3
+ import { g as T, a as B, i as E, b as R, c as Y, d as P, e as U, _ as H, f as Z, l as p, h as O, j as ee, k as te, r as ne, s as ie, m as ae, n as ce, o as re } from "./bundle-f23172a5.js";
4
+ import { useRef as N, useState as k, useEffect as v, createContext as oe, createElement as le } from "react";
5
+ import { p as de } from "./USE_SERVER_BUNDLE-b0fcc116.js";
6
+ import { useRouter as se } from "next/navigation";
7
+ function Se(e) {
8
+ return /* @__PURE__ */ C(m, { children: [
9
+ e.link ? /* @__PURE__ */ i(m, { children: /* @__PURE__ */ i(
10
10
  "a",
11
11
  {
12
12
  ...e.attributes,
@@ -15,7 +15,7 @@ function ge(e) {
15
15
  role: "button",
16
16
  children: e.text
17
17
  }
18
- ) }) : /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
18
+ ) }) : /* @__PURE__ */ i(m, { children: /* @__PURE__ */ i(
19
19
  "button",
20
20
  {
21
21
  ...e.attributes,
@@ -29,17 +29,17 @@ function ge(e) {
29
29
  }` })
30
30
  ] });
31
31
  }
32
- function fe(e) {
33
- return /* @__PURE__ */ C(h, { children: [
32
+ function xe(e) {
33
+ return /* @__PURE__ */ C(m, { children: [
34
34
  " ",
35
- e.hasChildren ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ C(
35
+ e.hasChildren ? /* @__PURE__ */ i(m, { children: /* @__PURE__ */ C(
36
36
  e.Wrapper,
37
37
  {
38
38
  ...T({
39
39
  block: e.block,
40
40
  context: e.context
41
41
  }),
42
- ...N({
42
+ ...B({
43
43
  block: e.block,
44
44
  rootState: e.context.rootState,
45
45
  rootSetState: e.context.rootSetState,
@@ -53,14 +53,14 @@ function fe(e) {
53
53
  " "
54
54
  ]
55
55
  }
56
- ) }) : /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
56
+ ) }) : /* @__PURE__ */ i(m, { children: /* @__PURE__ */ i(
57
57
  e.Wrapper,
58
58
  {
59
59
  ...T({
60
60
  block: e.block,
61
61
  context: e.context
62
62
  }),
63
- ...N({
63
+ ...B({
64
64
  block: e.block,
65
65
  rootState: e.context.rootState,
66
66
  rootSetState: e.context.rootSetState,
@@ -73,7 +73,7 @@ function fe(e) {
73
73
  " "
74
74
  ] });
75
75
  }
76
- function Se(e) {
76
+ function ve(e) {
77
77
  return /* @__PURE__ */ i(
78
78
  e.Wrapper,
79
79
  {
@@ -83,7 +83,7 @@ function Se(e) {
83
83
  block: e.block,
84
84
  context: e.context
85
85
  }),
86
- ...N({
86
+ ...B({
87
87
  block: e.block,
88
88
  rootState: e.context.rootState,
89
89
  rootSetState: e.context.rootSetState,
@@ -95,14 +95,14 @@ function Se(e) {
95
95
  }
96
96
  );
97
97
  }
98
- function xe(e) {
98
+ function ye(e) {
99
99
  function a() {
100
- var l;
101
- return "builder-blocks" + ((l = e.blocks) != null && l.length ? "" : " no-blocks");
100
+ var o;
101
+ return "builder-blocks" + ((o = e.blocks) != null && o.length ? "" : " no-blocks");
102
102
  }
103
103
  function s() {
104
- var l, b;
105
- E() && !((l = e.blocks) != null && l.length) && ((b = window.parent) == null || b.postMessage(
104
+ var o, h;
105
+ E() && !((o = e.blocks) != null && o.length) && ((h = window.parent) == null || h.postMessage(
106
106
  {
107
107
  type: "builder.clickEmptyBlocks",
108
108
  data: {
@@ -113,9 +113,9 @@ function xe(e) {
113
113
  "*"
114
114
  ));
115
115
  }
116
- function S() {
117
- var l, b;
118
- E() && !((l = e.blocks) != null && l.length) && ((b = window.parent) == null || b.postMessage(
116
+ function f() {
117
+ var o, h;
118
+ E() && !((o = e.blocks) != null && o.length) && ((h = window.parent) == null || h.postMessage(
119
119
  {
120
120
  type: "builder.hoverEmptyBlocks",
121
121
  data: {
@@ -126,64 +126,65 @@ function xe(e) {
126
126
  "*"
127
127
  ));
128
128
  }
129
- return /* @__PURE__ */ C(h, { children: [
129
+ return /* @__PURE__ */ C(m, { children: [
130
130
  /* @__PURE__ */ i(
131
- "div",
131
+ e.BlocksWrapper,
132
132
  {
133
- className: a() + " div-02c7a115",
133
+ className: a() + " props-blocks-wrapper-4f2c12d8",
134
134
  "builder-path": e.path,
135
135
  "builder-parent-id": e.parent,
136
136
  style: e.styleProp,
137
- onClick: (l) => s(),
138
- onMouseEnter: (l) => S(),
139
- onKeyPress: (l) => s(),
137
+ onClick: (o) => s(),
138
+ onMouseEnter: (o) => f(),
139
+ onKeyPress: (o) => s(),
140
+ ...e.BlocksWrapperProps,
140
141
  children: e.children
141
142
  }
142
143
  ),
143
- /* @__PURE__ */ i("style", { children: `.div-02c7a115 {
144
+ /* @__PURE__ */ i("style", { children: `.props-blocks-wrapper-4f2c12d8 {
144
145
  display: flex;
145
146
  flex-direction: column;
146
147
  align-items: stretch;
147
148
  }` })
148
149
  ] });
149
150
  }
150
- function ve(e) {
151
+ function ke(e) {
151
152
  return /* @__PURE__ */ i("span", { children: e.children });
152
153
  }
153
- function ye(e) {
154
- var l, b, x, g;
154
+ function Ce(e) {
155
+ var o, h, S, x;
155
156
  function a() {
156
- var f;
157
- const o = e.image || e.src;
158
- if (!o || // We can auto add srcset for cdn.builder.io and shopify
157
+ var g;
158
+ const c = e.image || e.src;
159
+ if (!c || // We can auto add srcset for cdn.builder.io and shopify
159
160
  // images, otherwise you can supply this prop manually
160
- !(o.match(/builder\.io/) || o.match(/cdn\.shopify\.com/)))
161
+ !(c.match(/builder\.io/) || c.match(/cdn\.shopify\.com/)))
161
162
  return e.srcset;
162
- if (e.srcset && ((f = e.image) != null && f.includes("builder.io/api/v1/image"))) {
163
+ if (e.srcset && ((g = e.image) != null && g.includes("builder.io/api/v1/image"))) {
163
164
  if (!e.srcset.includes(e.image.split("?")[0]))
164
- return console.debug("Removed given srcset"), R(o);
165
+ return console.debug("Removed given srcset"), R(c);
165
166
  } else if (e.image && !e.srcset)
166
- return R(o);
167
- return R(o);
167
+ return R(c);
168
+ return R(c);
168
169
  }
169
170
  function s() {
170
- var u;
171
- return (u = a == null ? void 0 : a()) != null && u.match(/builder\.io/) && !e.noWebp ? a().replace(/\?/g, "?format=webp&") : "";
171
+ var b;
172
+ return (b = a == null ? void 0 : a()) != null && b.match(/builder\.io/) && !e.noWebp ? a().replace(/\?/g, "?format=webp&") : "";
172
173
  }
173
- function S() {
174
- const u = {
174
+ function f() {
175
+ const b = {
175
176
  position: "absolute",
176
177
  height: "100%",
177
178
  width: "100%",
178
179
  left: "0px",
179
180
  top: "0px"
180
181
  };
181
- return e.aspectRatio ? u : void 0;
182
+ return e.aspectRatio ? b : void 0;
182
183
  }
183
- return /* @__PURE__ */ C(h, { children: [
184
- /* @__PURE__ */ C(h, { children: [
184
+ return /* @__PURE__ */ C(m, { children: [
185
+ /* @__PURE__ */ C(m, { children: [
185
186
  /* @__PURE__ */ C("picture", { children: [
186
- s() ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i("source", { type: "image/webp", srcSet: s() }) }) : null,
187
+ s() ? /* @__PURE__ */ i(m, { children: /* @__PURE__ */ i("source", { type: "image/webp", srcSet: s() }) }) : null,
187
188
  /* @__PURE__ */ i(
188
189
  "img",
189
190
  {
@@ -193,7 +194,7 @@ function ye(e) {
193
194
  style: {
194
195
  objectPosition: e.backgroundPosition || "center",
195
196
  objectFit: e.backgroundSize || "cover",
196
- ...S()
197
+ ...f()
197
198
  },
198
199
  className: "builder-image" + (e.className ? " " + e.className : "") + " img-dbab4030",
199
200
  src: e.image,
@@ -202,7 +203,7 @@ function ye(e) {
202
203
  }
203
204
  )
204
205
  ] }),
205
- e.aspectRatio && !((b = (l = e.builderBlock) == null ? void 0 : l.children) != null && b.length && e.fitContent) ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
206
+ e.aspectRatio && !((h = (o = e.builderBlock) == null ? void 0 : o.children) != null && h.length && e.fitContent) ? /* @__PURE__ */ i(m, { children: /* @__PURE__ */ i(
206
207
  "div",
207
208
  {
208
209
  className: "builder-image-sizer div-dbab4030",
@@ -211,8 +212,8 @@ function ye(e) {
211
212
  }
212
213
  }
213
214
  ) }) : null,
214
- (g = (x = e.builderBlock) == null ? void 0 : x.children) != null && g.length && e.fitContent ? /* @__PURE__ */ i(h, { children: e.children }) : null,
215
- !e.fitContent && e.children ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i("div", { className: "div-dbab4030-2", children: e.children }) }) : null
215
+ (x = (S = e.builderBlock) == null ? void 0 : S.children) != null && x.length && e.fitContent ? /* @__PURE__ */ i(m, { children: e.children }) : null,
216
+ !e.fitContent && e.children ? /* @__PURE__ */ i(m, { children: /* @__PURE__ */ i("div", { className: "div-dbab4030-2", children: e.children }) }) : null
216
217
  ] }),
217
218
  /* @__PURE__ */ i("style", { children: `.img-dbab4030 {
218
219
  opacity: 1;
@@ -233,7 +234,7 @@ function ye(e) {
233
234
  }` })
234
235
  ] });
235
236
  }
236
- function ke(e) {
237
+ function we(e) {
237
238
  return /* @__PURE__ */ i(
238
239
  "section",
239
240
  {
@@ -254,32 +255,32 @@ function ke(e) {
254
255
  }
255
256
  );
256
257
  }
257
- function Ce(e) {
258
- const a = B(null), [s, S] = k(() => []), [l, b] = k(() => []);
258
+ function Ee(e) {
259
+ const a = N(null), [s, f] = k(() => []), [o, h] = k(() => []);
259
260
  return v(() => {
260
- var g;
261
- if (!((g = a.current) != null && g.getElementsByTagName) || typeof window > "u")
261
+ var x;
262
+ if (!((x = a.current) != null && x.getElementsByTagName) || typeof window > "u")
262
263
  return;
263
- const x = a.current.getElementsByTagName("script");
264
- for (let u = 0; u < x.length; u++) {
265
- const o = x[u];
266
- if (o.src) {
267
- if (s.includes(o.src))
264
+ const S = a.current.getElementsByTagName("script");
265
+ for (let b = 0; b < S.length; b++) {
266
+ const c = S[b];
267
+ if (c.src) {
268
+ if (s.includes(c.src))
268
269
  continue;
269
- s.push(o.src);
270
- const f = document.createElement("script");
271
- f.async = !0, f.src = o.src, document.head.appendChild(f);
272
- } else if (!o.type || [
270
+ s.push(c.src);
271
+ const g = document.createElement("script");
272
+ g.async = !0, g.src = c.src, document.head.appendChild(g);
273
+ } else if (!c.type || [
273
274
  "text/javascript",
274
275
  "application/javascript",
275
276
  "application/ecmascript"
276
- ].includes(o.type)) {
277
- if (l.includes(o.innerText))
277
+ ].includes(c.type)) {
278
+ if (o.includes(c.innerText))
278
279
  continue;
279
280
  try {
280
- l.push(o.innerText), new Function(o.innerText)();
281
- } catch (f) {
282
- console.warn("`CustomCode`: Error running script:", f);
281
+ o.push(c.innerText), new Function(c.innerText)();
282
+ } catch (g) {
283
+ console.warn("`CustomCode`: Error running script:", g);
283
284
  }
284
285
  }
285
286
  }
@@ -292,29 +293,29 @@ function Ce(e) {
292
293
  }
293
294
  );
294
295
  }
295
- function we(e) {
296
- const a = B(null), [s, S] = k(() => []), [l, b] = k(() => []), [x, g] = k(() => !1);
297
- function u() {
296
+ function Ie(e) {
297
+ const a = N(null), [s, f] = k(() => []), [o, h] = k(() => []), [S, x] = k(() => !1);
298
+ function b() {
298
299
  if (!a.current || !a.current.getElementsByTagName)
299
300
  return;
300
- const o = a.current.getElementsByTagName("script");
301
- for (let f = 0; f < o.length; f++) {
302
- const y = o[f];
301
+ const c = a.current.getElementsByTagName("script");
302
+ for (let g = 0; g < c.length; g++) {
303
+ const y = c[g];
303
304
  if (y.src && !s.includes(y.src)) {
304
305
  s.push(y.src);
305
306
  const w = document.createElement("script");
306
307
  w.async = !0, w.src = y.src, document.head.appendChild(w);
307
- } else if (Q(y) && !l.includes(y.innerText))
308
+ } else if (Y(y) && !o.includes(y.innerText))
308
309
  try {
309
- l.push(y.innerText), new Function(y.innerText)();
310
+ o.push(y.innerText), new Function(y.innerText)();
310
311
  } catch (w) {
311
312
  console.warn("`Embed`: Error running script:", w);
312
313
  }
313
314
  }
314
315
  }
315
316
  return v(() => {
316
- a.current && !x && (g(!0), u());
317
- }, [a.current, x]), /* @__PURE__ */ i(
317
+ a.current && !S && (x(!0), b());
318
+ }, [a.current, S]), /* @__PURE__ */ i(
318
319
  "div",
319
320
  {
320
321
  className: "builder-embed",
@@ -323,7 +324,7 @@ function we(e) {
323
324
  }
324
325
  );
325
326
  }
326
- function Ee(e) {
327
+ function Re(e) {
327
328
  return /* @__PURE__ */ i(
328
329
  "img",
329
330
  {
@@ -338,8 +339,8 @@ function Ee(e) {
338
339
  E() && e.imgSrc || "default-key"
339
340
  );
340
341
  }
341
- function Ie(e) {
342
- var S, l, b, x, g, u, o;
342
+ function Pe(e) {
343
+ var f, o, h, S, x, b, c;
343
344
  function a() {
344
345
  return {
345
346
  ...e.autoPlay === !0 ? {
@@ -380,7 +381,7 @@ function Ie(e) {
380
381
  style: {
381
382
  width: "100%",
382
383
  height: "100%",
383
- ...(S = e.attributes) == null ? void 0 : S.style,
384
+ ...(f = e.attributes) == null ? void 0 : f.style,
384
385
  objectFit: e.fit,
385
386
  objectPosition: e.position,
386
387
  // Hack to get object fit to work as expected and
@@ -396,7 +397,7 @@ function Ie(e) {
396
397
  children: e.lazyLoad ? null : /* @__PURE__ */ i("source", { type: "video/mp4", src: e.video })
397
398
  }
398
399
  ),
399
- e.aspectRatio && !(e.fitContent && ((b = (l = e.builderBlock) == null ? void 0 : l.children) != null && b.length)) ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
400
+ e.aspectRatio && !(e.fitContent && ((h = (o = e.builderBlock) == null ? void 0 : o.children) != null && h.length)) ? /* @__PURE__ */ i(m, { children: /* @__PURE__ */ i(
400
401
  "div",
401
402
  {
402
403
  style: {
@@ -407,7 +408,7 @@ function Ie(e) {
407
408
  }
408
409
  }
409
410
  ) }) : null,
410
- (g = (x = e.builderBlock) == null ? void 0 : x.children) != null && g.length && e.fitContent ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
411
+ (x = (S = e.builderBlock) == null ? void 0 : S.children) != null && x.length && e.fitContent ? /* @__PURE__ */ i(m, { children: /* @__PURE__ */ i(
411
412
  "div",
412
413
  {
413
414
  style: {
@@ -418,7 +419,7 @@ function Ie(e) {
418
419
  children: e.children
419
420
  }
420
421
  ) }) : null,
421
- (o = (u = e.builderBlock) == null ? void 0 : u.children) != null && o.length && !e.fitContent ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
422
+ (c = (b = e.builderBlock) == null ? void 0 : b.children) != null && c.length && !e.fitContent ? /* @__PURE__ */ i(m, { children: /* @__PURE__ */ i(
422
423
  "div",
423
424
  {
424
425
  style: {
@@ -439,7 +440,7 @@ function Ie(e) {
439
440
  }
440
441
  );
441
442
  }
442
- const de = ce({
443
+ const ue = oe({
443
444
  content: null,
444
445
  context: {},
445
446
  localState: void 0,
@@ -449,64 +450,68 @@ const de = ce({
449
450
  apiKey: null,
450
451
  apiVersion: void 0,
451
452
  componentInfos: {},
452
- inheritedStyles: {}
453
+ inheritedStyles: {},
454
+ BlocksWrapper: "div",
455
+ BlocksWrapperProps: {}
453
456
  });
454
- function Re(e) {
455
- var F, z, M, _, V, q, W;
456
- const a = B(null), [s, S] = k(() => 0);
457
- function l(t) {
458
- var c, r, d, m, A;
457
+ function Te(e) {
458
+ var F, z, M, _, V, q, A;
459
+ const a = N(null), [s, f] = k(() => 0);
460
+ function o(t) {
461
+ var r, l, d, u, D;
459
462
  const n = {
460
463
  ...e.builderContextSignal.content,
461
464
  ...t,
462
465
  data: {
463
- ...(c = e.builderContextSignal.content) == null ? void 0 : c.data,
466
+ ...(r = e.builderContextSignal.content) == null ? void 0 : r.data,
464
467
  ...t == null ? void 0 : t.data
465
468
  },
466
469
  meta: {
467
- ...(r = e.builderContextSignal.content) == null ? void 0 : r.meta,
470
+ ...(l = e.builderContextSignal.content) == null ? void 0 : l.meta,
468
471
  ...t == null ? void 0 : t.meta,
469
- breakpoints: ((d = t == null ? void 0 : t.meta) == null ? void 0 : d.breakpoints) || ((A = (m = e.builderContextSignal.content) == null ? void 0 : m.meta) == null ? void 0 : A.breakpoints)
472
+ breakpoints: ((d = t == null ? void 0 : t.meta) == null ? void 0 : d.breakpoints) || ((D = (u = e.builderContextSignal.content) == null ? void 0 : u.meta) == null ? void 0 : D.breakpoints)
470
473
  }
471
474
  };
472
- oe({
475
+ de({
473
476
  value: n,
474
477
  key: n.id
475
478
  }).then(() => {
476
- G.refresh();
479
+ X.refresh();
477
480
  });
478
481
  }
479
482
  k(() => 0);
480
- const [b, x] = k(
483
+ const [h, S] = k(
481
484
  () => !1
485
+ ), [x, b] = k(
486
+ () => e.contentWrapper || "div"
482
487
  );
483
- function g(t) {
484
- var c;
488
+ function c(t) {
489
+ var r;
485
490
  const { data: n } = t;
486
491
  if (n)
487
492
  switch (n.type) {
488
493
  case "builder.configureSdk": {
489
- const r = n.data, { breakpoints: d, contentId: m } = r;
490
- if (!m || m !== ((c = e.builderContextSignal.content) == null ? void 0 : c.id))
494
+ const l = n.data, { breakpoints: d, contentId: u } = l;
495
+ if (!u || u !== ((r = e.builderContextSignal.content) == null ? void 0 : r.id))
491
496
  return;
492
- d && l({
497
+ d && o({
493
498
  meta: {
494
499
  breakpoints: d
495
500
  }
496
- }), S(s + 1);
501
+ }), f(s + 1);
497
502
  break;
498
503
  }
499
504
  case "builder.contentUpdate": {
500
- const r = n.data, d = r.key || r.alias || r.entry || r.modelName, m = r.data;
501
- d === e.model && (l(m), S(s + 1));
505
+ const l = n.data, d = l.key || l.alias || l.entry || l.modelName, u = l.data;
506
+ d === e.model && (o(u), f(s + 1));
502
507
  break;
503
508
  }
504
509
  }
505
510
  }
506
- function u() {
507
- var n, c;
508
- const t = (c = (n = e.builderContextSignal.content) == null ? void 0 : n.data) == null ? void 0 : c.jsCode;
509
- t && H({
511
+ function g() {
512
+ var n, r;
513
+ const t = (r = (n = e.builderContextSignal.content) == null ? void 0 : n.data) == null ? void 0 : r.jsCode;
514
+ t && O({
510
515
  code: t,
511
516
  context: e.context || {},
512
517
  localState: void 0,
@@ -514,28 +519,28 @@ function Re(e) {
514
519
  rootSetState: e.builderContextSignal.rootSetState
515
520
  });
516
521
  }
517
- const [o, f] = k(() => ({})), [y, w] = k(() => !1);
518
- function O(t) {
519
- var n, c;
522
+ const [y, w] = k(() => ({})), [L, J] = k(() => !1);
523
+ function $(t) {
524
+ var n, r;
520
525
  if (e.builderContextSignal.content) {
521
- const r = (n = e.builderContextSignal.content) == null ? void 0 : n.testVariationId, d = (c = e.builderContextSignal.content) == null ? void 0 : c.id;
522
- U({
526
+ const l = (n = e.builderContextSignal.content) == null ? void 0 : n.testVariationId, d = (r = e.builderContextSignal.content) == null ? void 0 : r.id;
527
+ H({
523
528
  type: "click",
524
- canTrack: D(e.canTrack),
529
+ canTrack: U(e.canTrack),
525
530
  contentId: d,
526
531
  apiKey: e.apiKey,
527
- variationId: r !== d ? r : void 0,
528
- ...Z(t),
529
- unique: !y
532
+ variationId: l !== d ? l : void 0,
533
+ ...ee(t),
534
+ unique: !L
530
535
  });
531
536
  }
532
- y || w(!0);
537
+ L || J(!0);
533
538
  }
534
- function J(t) {
539
+ function G(t) {
535
540
  return t.replace(
536
541
  /{{([^}]+)}}/g,
537
- (n, c) => H({
538
- code: c,
542
+ (n, r) => O({
543
+ code: r,
539
544
  context: e.context || {},
540
545
  localState: void 0,
541
546
  rootState: e.builderContextSignal.rootState,
@@ -543,27 +548,27 @@ function Re(e) {
543
548
  })
544
549
  );
545
550
  }
546
- function $({ url: t, key: n }) {
547
- ae(t).then((c) => c.json()).then((c) => {
548
- var d, m;
549
- const r = {
551
+ function Q({ url: t, key: n }) {
552
+ re(t).then((r) => r.json()).then((r) => {
553
+ var d, u;
554
+ const l = {
550
555
  ...e.builderContextSignal.rootState,
551
- [n]: c
556
+ [n]: r
552
557
  };
553
- (m = (d = e.builderContextSignal).rootSetState) == null || m.call(d, r), o[n] = !0;
554
- }).catch((c) => {
555
- console.error("error fetching dynamic data", t, c);
558
+ (u = (d = e.builderContextSignal).rootSetState) == null || u.call(d, l), y[n] = !0;
559
+ }).catch((r) => {
560
+ console.error("error fetching dynamic data", t, r);
556
561
  });
557
562
  }
558
- function L() {
559
- var n, c;
560
- const t = ((c = (n = e.builderContextSignal.content) == null ? void 0 : n.data) == null ? void 0 : c.httpRequests) ?? {};
561
- Object.entries(t).forEach(([r, d]) => {
562
- if (d && (!o[r] || E())) {
563
- const m = J(d);
564
- $({
565
- url: m,
566
- key: r
563
+ function j() {
564
+ var n, r;
565
+ const t = ((r = (n = e.builderContextSignal.content) == null ? void 0 : n.data) == null ? void 0 : r.httpRequests) ?? {};
566
+ Object.entries(t).forEach(([l, d]) => {
567
+ if (d && (!y[l] || E())) {
568
+ const u = G(d);
569
+ Q({
570
+ url: u,
571
+ key: l
567
572
  });
568
573
  }
569
574
  });
@@ -574,7 +579,7 @@ function Re(e) {
574
579
  "builder:component:stateChange",
575
580
  {
576
581
  detail: {
577
- state: p(e.builderContextSignal.rootState),
582
+ state: te(e.builderContextSignal.rootState),
578
583
  ref: {
579
584
  name: e.model
580
585
  }
@@ -583,8 +588,8 @@ function Re(e) {
583
588
  )
584
589
  );
585
590
  }
586
- function j(t) {
587
- S(s + 1), window.addEventListener("message", g), ee(), te({
591
+ function W(t) {
592
+ f(s + 1), window.addEventListener("message", c), ne(), ie({
588
593
  ...e.locale ? {
589
594
  locale: e.locale
590
595
  } : {},
@@ -597,37 +602,37 @@ function Re(e) {
597
602
  }), Object.values(
598
603
  e.builderContextSignal.componentInfos
599
604
  ).forEach((n) => {
600
- var r;
601
- const c = ne(n);
602
- (r = window.parent) == null || r.postMessage(c, "*");
605
+ var l;
606
+ const r = ae(n);
607
+ (l = window.parent) == null || l.postMessage(r, "*");
603
608
  }), window.addEventListener(
604
609
  "builder:component:stateChangeListenerActivated",
605
610
  I
606
611
  );
607
612
  }
608
613
  function K(t) {
609
- const n = new URL(location.href).searchParams, c = n.get("builder.preview"), r = n.get(
610
- `builder.preview.${c}`
614
+ const n = new URL(location.href).searchParams, r = n.get("builder.preview"), l = n.get(
615
+ `builder.preview.${r}`
611
616
  ), d = n.get("apiKey") || n.get("builder.space");
612
- c === e.model && d === e.apiKey && (!e.content || r === e.content.id) && ie({
617
+ r === e.model && d === e.apiKey && (!e.content || l === e.content.id) && ce({
613
618
  model: e.model,
614
619
  apiKey: e.apiKey,
615
620
  apiVersion: e.builderContextSignal.apiVersion
616
- }).then((m) => {
617
- m && l(m);
621
+ }).then((u) => {
622
+ u && o(u);
618
623
  });
619
624
  }
620
- const G = re();
625
+ const X = se();
621
626
  return v(() => {
622
627
  var t;
623
628
  return (t = a.current) == null || t.addEventListener(
624
629
  "initeditingbldr",
625
- j
630
+ W
626
631
  ), () => {
627
632
  var n;
628
633
  return (n = a.current) == null ? void 0 : n.removeEventListener(
629
634
  "initeditingbldr",
630
- j
635
+ W
631
636
  );
632
637
  };
633
638
  }, []), v(() => {
@@ -645,67 +650,68 @@ function Re(e) {
645
650
  }, []), v(() => {
646
651
  var t, n;
647
652
  if (P()) {
648
- if (E() && a.current && a.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && D(e.canTrack)) {
649
- const r = (t = e.builderContextSignal.content) == null ? void 0 : t.testVariationId, d = (n = e.builderContextSignal.content) == null ? void 0 : n.id, m = e.apiKey;
650
- U({
653
+ if (E() && a.current && a.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && U(e.canTrack)) {
654
+ const l = (t = e.builderContextSignal.content) == null ? void 0 : t.testVariationId, d = (n = e.builderContextSignal.content) == null ? void 0 : n.id, u = e.apiKey;
655
+ H({
651
656
  type: "impression",
652
657
  canTrack: !0,
653
658
  contentId: d,
654
- apiKey: m,
655
- variationId: r !== d ? r : void 0
659
+ apiKey: u,
660
+ variationId: l !== d ? l : void 0
656
661
  });
657
662
  }
658
- X() && a.current;
663
+ Z() && a.current;
659
664
  }
660
665
  }, []), v(() => {
661
- e.apiKey || Y.error(
666
+ e.apiKey || p.error(
662
667
  "No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
663
- ), u(), L(), I();
668
+ ), g(), j(), I();
664
669
  }, []), v(() => {
665
670
  }, [e.content]), v(() => {
666
- P() && (window.removeEventListener("message", g), window.addEventListener("message", g));
667
- }, [b]), v(() => {
668
- u();
671
+ P() && (window.removeEventListener("message", c), window.addEventListener("message", c));
672
+ }, [h]), v(() => {
673
+ g();
669
674
  }, [
670
675
  (z = (F = e.builderContextSignal.content) == null ? void 0 : F.data) == null ? void 0 : z.jsCode,
671
676
  e.builderContextSignal.rootState
672
677
  ]), v(() => {
673
- L();
678
+ j();
674
679
  }, [(_ = (M = e.builderContextSignal.content) == null ? void 0 : M.data) == null ? void 0 : _.httpRequests]), v(() => {
675
680
  I();
676
681
  }, [e.builderContextSignal.rootState]), v(() => () => {
677
- P() && (window.removeEventListener("message", g), window.removeEventListener(
682
+ P() && (window.removeEventListener("message", c), window.removeEventListener(
678
683
  "builder:component:stateChangeListenerActivated",
679
684
  I
680
685
  ));
681
- }, []), /* @__PURE__ */ i(de.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ le(
682
- "div",
686
+ }, []), /* @__PURE__ */ i(ue.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ i(m, { children: /* @__PURE__ */ le(
687
+ x,
683
688
  {
684
689
  key: s,
685
690
  ref: a,
686
- onClick: (t) => O(t),
691
+ onClick: (t) => $(t),
687
692
  "builder-content-id": (V = e.builderContextSignal.content) == null ? void 0 : V.id,
688
693
  "builder-model": e.model,
689
694
  ...e.showContent ? {} : {
690
695
  hidden: !0,
691
696
  "aria-hidden": !0
692
697
  },
693
- className: `variant-${((q = e.content) == null ? void 0 : q.testVariationId) || ((W = e.content) == null ? void 0 : W.id)}`
698
+ ...e.contentWrapperProps,
699
+ className: `variant-${((q = e.content) == null ? void 0 : q.testVariationId) || ((A = e.content) == null ? void 0 : A.id)}`
694
700
  },
695
701
  e.children
696
702
  ) }) : null });
697
703
  }
698
704
  export {
699
- fe as B,
700
- Ce as C,
701
- we as E,
702
- ve as F,
703
- Se as I,
704
- ke as S,
705
- Ie as V,
706
- xe as a,
707
- ge as b,
708
- ye as c,
709
- Ee as d,
710
- Re as e
705
+ xe as B,
706
+ Ee as C,
707
+ Ie as E,
708
+ ke as F,
709
+ ve as I,
710
+ we as S,
711
+ Pe as V,
712
+ ye as a,
713
+ Se as b,
714
+ Ce as c,
715
+ Re as d,
716
+ Te as e
711
717
  };