@builder.io/sdk-react-nextjs 0.11.2 → 0.11.3

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 (72) hide show
  1. package/lib/browser/{USE_CLIENT_BUNDLE-27f8858d.cjs → USE_CLIENT_BUNDLE-2986f66f.cjs} +4 -4
  2. package/lib/{node/USE_CLIENT_BUNDLE-fef58fdc.js → browser/USE_CLIENT_BUNDLE-812d744e.js} +32 -32
  3. package/lib/{edge/USE_SERVER_BUNDLE-8b1e2888.cjs → browser/USE_SERVER_BUNDLE-3646ae12.cjs} +1 -1
  4. package/lib/{edge/USE_SERVER_BUNDLE-bc0c817b.js → browser/USE_SERVER_BUNDLE-7d93f151.js} +1 -1
  5. package/lib/browser/{bundle-4ee84dab.js → bundle-062859d6.js} +353 -378
  6. package/lib/browser/bundle-b781019e.cjs +168 -0
  7. package/lib/browser/index.cjs +1 -1
  8. package/lib/browser/index.mjs +3 -3
  9. package/lib/{node/USE_CLIENT_BUNDLE-cdd14ec9.cjs → edge/USE_CLIENT_BUNDLE-7f127af4.cjs} +4 -4
  10. package/lib/{browser/USE_CLIENT_BUNDLE-336f80e4.js → edge/USE_CLIENT_BUNDLE-dc52931c.js} +32 -32
  11. package/lib/{node/USE_SERVER_BUNDLE-0bc450f5.js → edge/USE_SERVER_BUNDLE-207cbf86.js} +1 -1
  12. package/lib/{node/USE_SERVER_BUNDLE-830537df.cjs → edge/USE_SERVER_BUNDLE-29a862aa.cjs} +1 -1
  13. package/lib/edge/{bundle-d029deb6.cjs → bundle-24c6dba3.cjs} +32 -32
  14. package/lib/edge/{bundle-cd2b1a4d.js → bundle-52f65e64.js} +1018 -1043
  15. package/lib/edge/index.cjs +1 -1
  16. package/lib/edge/index.mjs +3 -3
  17. package/lib/{edge/USE_CLIENT_BUNDLE-c3dc5e68.cjs → node/USE_CLIENT_BUNDLE-c9e8796d.cjs} +4 -4
  18. package/lib/{edge/USE_CLIENT_BUNDLE-73820ea9.js → node/USE_CLIENT_BUNDLE-d5a78124.js} +32 -32
  19. package/lib/{browser/USE_SERVER_BUNDLE-657cf8f3.js → node/USE_SERVER_BUNDLE-5a34a612.js} +1 -1
  20. package/lib/{browser/USE_SERVER_BUNDLE-57d976dd.cjs → node/USE_SERVER_BUNDLE-f94a06b5.cjs} +1 -1
  21. package/lib/node/{bundle-e760a35e.js → bundle-829842dd.js} +232 -257
  22. package/lib/node/{bundle-a03659b6.cjs → bundle-b0598b3a.cjs} +11 -11
  23. package/lib/node/index.cjs +1 -1
  24. package/lib/node/index.mjs +3 -3
  25. package/package.json +97 -5
  26. package/types/cjs/blocks/button/button.d.ts +1 -9
  27. package/types/cjs/blocks/button/button.types.d.ts +6 -0
  28. package/types/cjs/blocks/columns/columns.d.ts +2 -14
  29. package/types/cjs/blocks/columns/columns.types.d.ts +15 -0
  30. package/types/cjs/blocks/fragment/fragment.d.ts +1 -5
  31. package/types/cjs/blocks/fragment/fragment.types.d.ts +5 -0
  32. package/types/cjs/blocks/image/image.d.ts +1 -19
  33. package/types/cjs/blocks/image/image.types.d.ts +19 -0
  34. package/types/cjs/blocks/section/section.d.ts +1 -9
  35. package/types/cjs/blocks/section/section.types.d.ts +6 -0
  36. package/types/cjs/blocks/symbol/symbol.d.ts +2 -23
  37. package/types/cjs/blocks/symbol/symbol.types.d.ts +18 -0
  38. package/types/cjs/blocks/text/text.d.ts +1 -3
  39. package/types/cjs/blocks/text/text.types.d.ts +3 -0
  40. package/types/cjs/blocks/video/video.d.ts +1 -21
  41. package/types/cjs/blocks/video/video.types.d.ts +21 -0
  42. package/types/cjs/components/blocks/blocks.d.ts +1 -6
  43. package/types/cjs/components/blocks/blocks.types.d.ts +6 -0
  44. package/types/cjs/components/content-variants/content-variants.types.d.ts +30 -1
  45. package/types/cjs/constants/sdk-version.d.ts +1 -1
  46. package/types/cjs/functions/get-content/index.d.ts +1 -1
  47. package/types/cjs/functions/get-content/types.d.ts +2 -2
  48. package/types/cjs/server-index.d.ts +10 -1
  49. package/types/esm/blocks/button/button.d.ts +1 -9
  50. package/types/esm/blocks/button/button.types.d.ts +6 -0
  51. package/types/esm/blocks/columns/columns.d.ts +2 -14
  52. package/types/esm/blocks/columns/columns.types.d.ts +15 -0
  53. package/types/esm/blocks/fragment/fragment.d.ts +1 -5
  54. package/types/esm/blocks/fragment/fragment.types.d.ts +5 -0
  55. package/types/esm/blocks/image/image.d.ts +1 -19
  56. package/types/esm/blocks/image/image.types.d.ts +19 -0
  57. package/types/esm/blocks/section/section.d.ts +1 -9
  58. package/types/esm/blocks/section/section.types.d.ts +6 -0
  59. package/types/esm/blocks/symbol/symbol.d.ts +2 -23
  60. package/types/esm/blocks/symbol/symbol.types.d.ts +18 -0
  61. package/types/esm/blocks/text/text.d.ts +1 -3
  62. package/types/esm/blocks/text/text.types.d.ts +3 -0
  63. package/types/esm/blocks/video/video.d.ts +1 -21
  64. package/types/esm/blocks/video/video.types.d.ts +21 -0
  65. package/types/esm/components/blocks/blocks.d.ts +1 -6
  66. package/types/esm/components/blocks/blocks.types.d.ts +6 -0
  67. package/types/esm/components/content-variants/content-variants.types.d.ts +30 -1
  68. package/types/esm/constants/sdk-version.d.ts +1 -1
  69. package/types/esm/functions/get-content/index.d.ts +1 -1
  70. package/types/esm/functions/get-content/types.d.ts +2 -2
  71. package/types/esm/server-index.d.ts +10 -1
  72. package/lib/browser/bundle-343c6c9c.cjs +0 -168
@@ -1,7 +1,7 @@
1
1
  import { LRUCache } from "lru-cache";
2
2
  import { jsx, Fragment, jsxs } from "react/jsx-runtime";
3
3
  import { createElement } from "react";
4
- import { I as InteractiveElement, B as BlockWrapper, a as BlocksWrapper, b as Button, C as CustomCode, E as Embed, F as FragmentComponent, c as Image, d as ImgComponent, S as SectionComponent, V as Video, e as EnableEditor } from "./USE_CLIENT_BUNDLE-fef58fdc.js";
4
+ import { I as InteractiveElement, B as BlockWrapper, a as BlocksWrapper, b as Button, C as CustomCode, E as Embed, F as FragmentComponent, c as Image, d as ImgComponent, S as SectionComponent, V as Video, e as EnableEditor } from "./USE_CLIENT_BUNDLE-d5a78124.js";
5
5
  import "next/navigation";
6
6
  function getBlockComponentOptions(e) {
7
7
  var t;
@@ -187,29 +187,29 @@ output;
187
187
  context: n,
188
188
  event: o,
189
189
  state: s
190
- }), m = getIsolateContext(), f = m.global;
191
- f.setSync("global", f.derefInto()), f.setSync("log", function(...l) {
192
- console.log(...l);
193
- }), f.setSync(BUILDER_SET_STATE_NAME, function(l, u) {
194
- set(a, l, u), i == null || i(a);
195
- }), c.forEach(([l, u]) => {
196
- const d = typeof u == "object" ? new ivm.Reference(
190
+ }), u = getIsolateContext(), m = u.global;
191
+ m.setSync("global", m.derefInto()), m.setSync("log", function(...d) {
192
+ console.log(...d);
193
+ }), m.setSync(BUILDER_SET_STATE_NAME, function(d, f) {
194
+ set(a, d, f), i == null || i(a);
195
+ }), c.forEach(([d, f]) => {
196
+ const l = typeof f == "object" ? new ivm.Reference(
197
197
  // workaround: methods with default values for arguments is not being cloned over
198
- l === "builder" ? {
199
- ...u,
200
- getUserAttributes: () => u.getUserAttributes()
201
- } : u
198
+ d === "builder" ? {
199
+ ...f,
200
+ getUserAttributes: () => f.getUserAttributes()
201
+ } : f
202
202
  ) : null;
203
- f.setSync(getSyncValName(l), d);
204
- }), f.setSync(INJECTED_IVM_GLOBAL, ivm);
205
- const g = processCode({
203
+ m.setSync(getSyncValName(d), l);
204
+ }), m.setSync(INJECTED_IVM_GLOBAL, ivm);
205
+ const p = processCode({
206
206
  code: e,
207
207
  args: c
208
- }), p = m.evalSync(g);
208
+ }), g = u.evalSync(p);
209
209
  try {
210
- return JSON.parse(p);
210
+ return JSON.parse(g);
211
211
  } catch {
212
- return p;
212
+ return g;
213
213
  }
214
214
  }, chooseBrowserOrServerEval = (e) => isBrowser() ? runInBrowser(e) : runInNode(e);
215
215
  function evaluate({
@@ -267,14 +267,14 @@ const evaluateBindings = ({
267
267
  }
268
268
  };
269
269
  for (const s in e.bindings) {
270
- const c = e.bindings[s], m = evaluate({
270
+ const c = e.bindings[s], u = evaluate({
271
271
  code: c,
272
272
  localState: n,
273
273
  rootState: o,
274
274
  rootSetState: r,
275
275
  context: t
276
276
  });
277
- set(a, s, m);
277
+ set(a, s, u);
278
278
  }
279
279
  return a;
280
280
  };
@@ -337,15 +337,15 @@ const EMPTY_HTML_ELEMENTS = ["area", "base", "br", "col", "embed", "hr", "img",
337
337
  if (!Array.isArray(r))
338
338
  return;
339
339
  const i = n.collection.split(".").pop(), a = n.itemName || (i ? i + "Item" : "item");
340
- return r.map((c, m) => ({
340
+ return r.map((c, u) => ({
341
341
  context: {
342
342
  ...t,
343
343
  localState: {
344
344
  ...t.localState,
345
- $index: m,
345
+ $index: u,
346
346
  $item: c,
347
347
  [a]: c,
348
- [`$${a}Index`]: m
348
+ [`$${a}Index`]: u
349
349
  }
350
350
  },
351
351
  block: o
@@ -423,7 +423,7 @@ function BlockStyles(e) {
423
423
  });
424
424
  return checkIsDefined(r.hide) ? !r.hide : checkIsDefined(r.show) ? r.show : !0;
425
425
  }, n = function() {
426
- var d;
426
+ var l;
427
427
  const r = getProcessedBlock({
428
428
  block: e.block,
429
429
  localState: e.context.localState,
@@ -432,29 +432,29 @@ function BlockStyles(e) {
432
432
  context: e.context.context,
433
433
  shouldEvaluateBindings: !0
434
434
  }), i = r.responsiveStyles, a = e.context.content, s = getSizesForBreakpoints(
435
- ((d = a == null ? void 0 : a.meta) == null ? void 0 : d.breakpoints) || {}
436
- ), c = i == null ? void 0 : i.large, m = i == null ? void 0 : i.medium, f = i == null ? void 0 : i.small, g = r.id;
437
- if (!g)
435
+ ((l = a == null ? void 0 : a.meta) == null ? void 0 : l.breakpoints) || {}
436
+ ), c = i == null ? void 0 : i.large, u = i == null ? void 0 : i.medium, m = i == null ? void 0 : i.small, p = r.id;
437
+ if (!p)
438
438
  return "";
439
- const p = c ? createCssClass({
440
- className: g,
439
+ const g = c ? createCssClass({
440
+ className: p,
441
441
  styles: c
442
- }) : "", l = m ? createCssClass({
443
- className: g,
444
- styles: m,
442
+ }) : "", d = u ? createCssClass({
443
+ className: p,
444
+ styles: u,
445
445
  mediaQuery: getMaxWidthQueryForSize(
446
446
  "medium",
447
447
  s
448
448
  )
449
- }) : "", u = f ? createCssClass({
450
- className: g,
451
- styles: f,
449
+ }) : "", f = m ? createCssClass({
450
+ className: p,
451
+ styles: m,
452
452
  mediaQuery: getMaxWidthQueryForSize(
453
453
  "small",
454
454
  s
455
455
  )
456
456
  }) : "";
457
- return [p, l, u].join(" ");
457
+ return [g, d, f].join(" ");
458
458
  };
459
459
  return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: n() }) }) : null });
460
460
  }
@@ -560,9 +560,9 @@ const getWrapperProps = ({
560
560
  } : s;
561
561
  };
562
562
  function ComponentRef(e) {
563
- var n, o;
563
+ var n;
564
564
  const t = e.isInteractive ? InteractiveElement : e.componentRef;
565
- return /* @__PURE__ */ jsx(Fragment, { children: e.componentRef ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
565
+ return /* @__PURE__ */ jsx(Fragment, { children: e.componentRef ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
566
566
  t,
567
567
  {
568
568
  ...getWrapperProps({
@@ -574,25 +574,15 @@ function ComponentRef(e) {
574
574
  isInteractive: e.isInteractive,
575
575
  contextValue: e.context
576
576
  }),
577
- children: [
578
- (n = e.blockChildren) == null ? void 0 : n.map((r) => /* @__PURE__ */ jsx(
579
- Block,
580
- {
581
- block: r,
582
- context: e.context,
583
- registeredComponents: e.registeredComponents
584
- },
585
- "block-" + r.id
586
- )),
587
- (o = e.blockChildren) == null ? void 0 : o.map((r) => /* @__PURE__ */ jsx(
588
- BlockStyles,
589
- {
590
- block: r,
591
- context: e.context
592
- },
593
- "block-style-" + r.id
594
- ))
595
- ]
577
+ children: (n = e.blockChildren) == null ? void 0 : n.map((o) => /* @__PURE__ */ jsx(
578
+ Block,
579
+ {
580
+ block: o,
581
+ context: e.context,
582
+ registeredComponents: e.registeredComponents
583
+ },
584
+ o.id
585
+ ))
596
586
  }
597
587
  ) }) : null });
598
588
  }
@@ -608,7 +598,7 @@ function RepeatedBlock(e) {
608
598
  );
609
599
  }
610
600
  function Block(e) {
611
- var m, f, g, p;
601
+ var u, m, p;
612
602
  const t = function() {
613
603
  return getComponent({
614
604
  block: e.block,
@@ -621,8 +611,8 @@ function Block(e) {
621
611
  context: e.context
622
612
  });
623
613
  }, o = function() {
624
- var u;
625
- return (u = e.block.repeat) != null && u.collection ? e.block : getProcessedBlock({
614
+ var d;
615
+ return (d = e.block.repeat) != null && d.collection ? e.block : getProcessedBlock({
626
616
  block: e.block,
627
617
  localState: e.context.localState,
628
618
  rootState: e.context.rootState,
@@ -633,110 +623,105 @@ function Block(e) {
633
623
  }, r = function() {
634
624
  return e.block.tagName || "div";
635
625
  }, i = function() {
636
- var b, y;
637
- if ((b = e.block.repeat) != null && b.collection)
638
- return !!((y = n()) != null && y.length);
639
- const u = "hide" in o() ? o().hide : !1;
640
- return ("show" in o() ? o().show : !0) && !u;
626
+ var l, h;
627
+ if ((l = e.block.repeat) != null && l.collection)
628
+ return !!((h = n()) != null && h.length);
629
+ const d = "hide" in o() ? o().hide : !1;
630
+ return ("show" in o() ? o().show : !0) && !d;
641
631
  }, a = function() {
642
- var d;
643
- return !((d = t()) != null && d.component) && !n() ? o().children ?? [] : [];
632
+ var f;
633
+ return !((f = t()) != null && f.component) && !n() ? o().children ?? [] : [];
644
634
  }, s = function() {
645
- var u, d, b, y, h;
635
+ var d, f, l, h, y;
646
636
  return {
647
637
  blockChildren: o().children ?? [],
648
- componentRef: (u = t()) == null ? void 0 : u.component,
638
+ componentRef: (d = t()) == null ? void 0 : d.component,
649
639
  componentOptions: {
650
640
  ...getBlockComponentOptions(o()),
651
641
  builderContext: e.context,
652
- ...((d = t()) == null ? void 0 : d.name) === "Symbol" || ((b = t()) == null ? void 0 : b.name) === "Columns" ? {
642
+ ...((f = t()) == null ? void 0 : f.name) === "Symbol" || ((l = t()) == null ? void 0 : l.name) === "Columns" ? {
653
643
  builderComponents: e.registeredComponents
654
644
  } : {}
655
645
  },
656
646
  context: c,
657
647
  registeredComponents: e.registeredComponents,
658
648
  builderBlock: o(),
659
- includeBlockProps: ((y = t()) == null ? void 0 : y.noWrap) === !0,
660
- isInteractive: !((h = t()) != null && h.isRSC)
649
+ includeBlockProps: ((h = t()) == null ? void 0 : h.noWrap) === !0,
650
+ isInteractive: !((y = t()) != null && y.isRSC)
661
651
  };
662
652
  }, c = e.context;
663
- return /* @__PURE__ */ jsx(Fragment, { children: i() ? /* @__PURE__ */ jsx(Fragment, { children: (m = t()) != null && m.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
664
- ComponentRef,
665
- {
666
- componentRef: s().componentRef,
667
- componentOptions: s().componentOptions,
668
- blockChildren: s().blockChildren,
669
- context: s().context,
670
- registeredComponents: s().registeredComponents,
671
- builderBlock: s().builderBlock,
672
- includeBlockProps: s().includeBlockProps,
673
- isInteractive: s().isInteractive
674
- }
675
- ) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
676
- isEmptyHtmlElement(r()) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
677
- BlockWrapper,
653
+ return /* @__PURE__ */ jsx(Fragment, { children: i() ? /* @__PURE__ */ jsxs(Fragment, { children: [
654
+ /* @__PURE__ */ jsx(BlockStyles, { block: e.block, context: e.context }),
655
+ (u = t()) != null && u.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
656
+ ComponentRef,
678
657
  {
679
- Wrapper: r(),
680
- block: o(),
681
- context: e.context,
682
- hasChildren: !1
683
- }
684
- ) }) : null,
685
- !isEmptyHtmlElement(r()) && n() ? /* @__PURE__ */ jsx(Fragment, { children: (f = n()) == null ? void 0 : f.map((l, u) => /* @__PURE__ */ jsx(
686
- RepeatedBlock,
687
- {
688
- repeatContext: l.context,
689
- block: l.block,
690
- registeredComponents: e.registeredComponents
691
- },
692
- u
693
- )) }) : null,
694
- !isEmptyHtmlElement(r()) && !n() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
695
- BlockWrapper,
696
- {
697
- Wrapper: r(),
698
- block: o(),
699
- context: e.context,
700
- hasChildren: !0,
701
- children: [
702
- /* @__PURE__ */ jsx(
703
- ComponentRef,
704
- {
705
- componentRef: s().componentRef,
706
- componentOptions: s().componentOptions,
707
- blockChildren: s().blockChildren,
708
- context: s().context,
709
- registeredComponents: s().registeredComponents,
710
- builderBlock: s().builderBlock,
711
- includeBlockProps: s().includeBlockProps,
712
- isInteractive: s().isInteractive
713
- }
714
- ),
715
- (g = a()) == null ? void 0 : g.map((l) => /* @__PURE__ */ jsx(
716
- Block,
717
- {
718
- block: l,
719
- context: c,
720
- registeredComponents: e.registeredComponents
721
- },
722
- "block-" + l.id
723
- )),
724
- (p = a()) == null ? void 0 : p.map((l) => /* @__PURE__ */ jsx(
725
- BlockStyles,
726
- {
727
- block: l,
728
- context: c
729
- },
730
- "block-style-" + l.id
731
- ))
732
- ]
658
+ componentRef: s().componentRef,
659
+ componentOptions: s().componentOptions,
660
+ blockChildren: s().blockChildren,
661
+ context: s().context,
662
+ registeredComponents: s().registeredComponents,
663
+ builderBlock: s().builderBlock,
664
+ includeBlockProps: s().includeBlockProps,
665
+ isInteractive: s().isInteractive
733
666
  }
734
- ) }) : null
735
- ] }) }) : null });
667
+ ) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
668
+ isEmptyHtmlElement(r()) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
669
+ BlockWrapper,
670
+ {
671
+ Wrapper: r(),
672
+ block: o(),
673
+ context: e.context,
674
+ hasChildren: !1
675
+ }
676
+ ) }) : null,
677
+ !isEmptyHtmlElement(r()) && n() ? /* @__PURE__ */ jsx(Fragment, { children: (m = n()) == null ? void 0 : m.map((g, d) => /* @__PURE__ */ jsx(
678
+ RepeatedBlock,
679
+ {
680
+ repeatContext: g.context,
681
+ block: g.block,
682
+ registeredComponents: e.registeredComponents
683
+ },
684
+ d
685
+ )) }) : null,
686
+ !isEmptyHtmlElement(r()) && !n() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
687
+ BlockWrapper,
688
+ {
689
+ Wrapper: r(),
690
+ block: o(),
691
+ context: e.context,
692
+ hasChildren: !0,
693
+ children: [
694
+ /* @__PURE__ */ jsx(
695
+ ComponentRef,
696
+ {
697
+ componentRef: s().componentRef,
698
+ componentOptions: s().componentOptions,
699
+ blockChildren: s().blockChildren,
700
+ context: s().context,
701
+ registeredComponents: s().registeredComponents,
702
+ builderBlock: s().builderBlock,
703
+ includeBlockProps: s().includeBlockProps,
704
+ isInteractive: s().isInteractive
705
+ }
706
+ ),
707
+ (p = a()) == null ? void 0 : p.map((g) => /* @__PURE__ */ jsx(
708
+ Block,
709
+ {
710
+ block: g,
711
+ context: c,
712
+ registeredComponents: e.registeredComponents
713
+ },
714
+ g.id
715
+ ))
716
+ ]
717
+ }
718
+ ) }) : null
719
+ ] })
720
+ ] }) : null });
736
721
  }
737
722
  function Blocks(e) {
738
- var t, n, o, r;
739
- return /* @__PURE__ */ jsxs(
723
+ var t, n, o;
724
+ return /* @__PURE__ */ jsx(
740
725
  BlocksWrapper,
741
726
  {
742
727
  blocks: e.blocks,
@@ -745,47 +730,37 @@ function Blocks(e) {
745
730
  styleProp: e.styleProp,
746
731
  BlocksWrapper: (t = e.context) == null ? void 0 : t.BlocksWrapper,
747
732
  BlocksWrapperProps: (n = e.context) == null ? void 0 : n.BlocksWrapperProps,
748
- children: [
749
- e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (o = e.blocks) == null ? void 0 : o.map((i) => /* @__PURE__ */ jsx(
750
- Block,
751
- {
752
- block: i,
753
- context: e.context,
754
- registeredComponents: e.registeredComponents
755
- },
756
- "render-block-" + i.id
757
- )) }) : null,
758
- e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (r = e.blocks) == null ? void 0 : r.map((i) => /* @__PURE__ */ jsx(
759
- BlockStyles,
760
- {
761
- block: i,
762
- context: e.context
763
- },
764
- "block-style-" + i.id
765
- )) }) : null
766
- ]
733
+ children: e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (o = e.blocks) == null ? void 0 : o.map((r) => /* @__PURE__ */ jsx(
734
+ Block,
735
+ {
736
+ block: r,
737
+ context: e.context,
738
+ registeredComponents: e.registeredComponents
739
+ },
740
+ r.id
741
+ )) }) : null
767
742
  }
768
743
  );
769
744
  }
770
745
  function Columns(e) {
771
- var l;
772
- const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet", r = function(d) {
773
- var b;
774
- return ((b = n[d]) == null ? void 0 : b.width) || 100 / n.length;
775
- }, i = function(d) {
776
- const b = t * (n.length - 1) / n.length;
777
- return `calc(${r(d)}% - ${b}px)`;
746
+ var d;
747
+ const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet", r = function(l) {
748
+ var h;
749
+ return ((h = n[l]) == null ? void 0 : h.width) || 100 / n.length;
750
+ }, i = function(l) {
751
+ const h = t * (n.length - 1) / n.length;
752
+ return `calc(${r(l)}% - ${h}px)`;
778
753
  }, a = function({
779
- stackedStyle: d,
780
- desktopStyle: b
754
+ stackedStyle: l,
755
+ desktopStyle: h
781
756
  }) {
782
- return o === "tablet" ? d : b;
757
+ return o === "tablet" ? l : h;
783
758
  }, s = function({
784
- stackedStyle: d,
785
- desktopStyle: b
759
+ stackedStyle: l,
760
+ desktopStyle: h
786
761
  }) {
787
- return o === "never" ? b : d;
788
- }, c = e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column", m = function() {
762
+ return o === "never" ? h : l;
763
+ }, c = e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column", u = function() {
789
764
  return {
790
765
  "--flex-dir": c,
791
766
  "--flex-dir-tablet": a({
@@ -793,18 +768,18 @@ function Columns(e) {
793
768
  desktopStyle: "row"
794
769
  })
795
770
  };
796
- }, f = function(d) {
797
- const b = d === 0 ? 0 : t, y = i(d), h = `${b}px`, v = "100%", x = 0;
771
+ }, m = function(l) {
772
+ const h = l === 0 ? 0 : t, y = i(l), b = `${h}px`, v = "100%", x = 0;
798
773
  return {
799
774
  width: y,
800
- ["marginLeft"]: h,
775
+ ["marginLeft"]: b,
801
776
  "--column-width-mobile": s({
802
777
  stackedStyle: v,
803
778
  desktopStyle: y
804
779
  }),
805
780
  "--column-margin-left-mobile": s({
806
781
  stackedStyle: x,
807
- desktopStyle: h
782
+ desktopStyle: b
808
783
  }),
809
784
  "--column-width-tablet": a({
810
785
  stackedStyle: v,
@@ -812,17 +787,17 @@ function Columns(e) {
812
787
  }),
813
788
  "--column-margin-left-tablet": a({
814
789
  stackedStyle: x,
815
- desktopStyle: h
790
+ desktopStyle: b
816
791
  })
817
792
  };
818
- }, g = function(d) {
819
- var y, h;
793
+ }, p = function(l) {
794
+ var y, b;
820
795
  return getSizesForBreakpoints(
821
- ((h = (y = e.builderContext.content) == null ? void 0 : y.meta) == null ? void 0 : h.breakpoints) || {}
822
- )[d].max;
823
- }, p = function() {
796
+ ((b = (y = e.builderContext.content) == null ? void 0 : y.meta) == null ? void 0 : b.breakpoints) || {}
797
+ )[l].max;
798
+ }, g = function() {
824
799
  return `
825
- @media (max-width: ${g("medium")}px) {
800
+ @media (max-width: ${p("medium")}px) {
826
801
  .${e.builderBlock.id}-breakpoints {
827
802
  flex-direction: var(--flex-dir-tablet);
828
803
  align-items: stretch;
@@ -834,7 +809,7 @@ function Columns(e) {
834
809
  }
835
810
  }
836
811
 
837
- @media (max-width: ${g("small")}px) {
812
+ @media (max-width: ${p("small")}px) {
838
813
  .${e.builderBlock.id}-breakpoints {
839
814
  flex-direction: var(--flex-dir);
840
815
  align-items: stretch;
@@ -851,38 +826,38 @@ function Columns(e) {
851
826
  /* @__PURE__ */ jsxs(
852
827
  "div",
853
828
  {
854
- className: `builder-columns ${e.builderBlock.id}-breakpoints div-0d69fe26`,
855
- style: m(),
829
+ className: `builder-columns ${e.builderBlock.id}-breakpoints div-39daef82`,
830
+ style: u(),
856
831
  children: [
857
- /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: p() }) }),
858
- (l = e.columns) == null ? void 0 : l.map((u, d) => /* @__PURE__ */ createElement(
832
+ /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: g() }) }),
833
+ (d = e.columns) == null ? void 0 : d.map((f, l) => /* @__PURE__ */ createElement(
859
834
  "div",
860
835
  {
861
- className: "builder-column div-0d69fe26-2",
862
- style: f(d),
863
- key: d
836
+ className: "builder-column div-39daef82-2",
837
+ style: m(l),
838
+ key: l
864
839
  },
865
840
  /* @__PURE__ */ jsx(
866
841
  Blocks,
867
842
  {
868
- path: `component.options.columns.${d}.blocks`,
843
+ path: `component.options.columns.${l}.blocks`,
869
844
  parent: e.builderBlock.id,
870
845
  styleProp: {
871
846
  flexGrow: "1"
872
847
  },
873
848
  context: e.builderContext,
874
849
  registeredComponents: e.builderComponents,
875
- blocks: u.blocks
850
+ blocks: f.blocks
876
851
  }
877
852
  )
878
853
  ))
879
854
  ]
880
855
  }
881
856
  ),
882
- /* @__PURE__ */ jsx("style", { children: `.div-0d69fe26 {
857
+ /* @__PURE__ */ jsx("style", { children: `.div-39daef82 {
883
858
  display: flex;
884
859
  line-height: normal;
885
- }.div-0d69fe26-2 {
860
+ }.div-39daef82-2 {
886
861
  display: flex;
887
862
  flex-direction: column;
888
863
  align-items: stretch;
@@ -1362,15 +1337,15 @@ const getTopLevelDomain = (e) => {
1362
1337
  onChange: (e) => {
1363
1338
  e.delete("srcset"), e.delete("noWebp");
1364
1339
  function n(a, s = 6e4) {
1365
- return new Promise((c, m) => {
1366
- const f = document.createElement("img");
1367
- let g = !1;
1368
- f.onload = () => {
1369
- g = !0, c(f);
1370
- }, f.addEventListener("error", (p) => {
1371
- console.warn("Image load failed", p.error), m(p.error);
1372
- }), f.src = a, setTimeout(() => {
1373
- g || m(new Error("Image load timed out"));
1340
+ return new Promise((c, u) => {
1341
+ const m = document.createElement("img");
1342
+ let p = !1;
1343
+ m.onload = () => {
1344
+ p = !0, c(m);
1345
+ }, m.addEventListener("error", (g) => {
1346
+ console.warn("Image load failed", g.error), u(g.error);
1347
+ }), m.src = a, setTimeout(() => {
1348
+ p || u(new Error("Image load timed out"));
1374
1349
  }, s);
1375
1350
  });
1376
1351
  }
@@ -1877,43 +1852,43 @@ const DEFAULT_API_VERSION = "v3", BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUIL
1877
1852
  apiKey: a,
1878
1853
  includeRefs: s = !0,
1879
1854
  enrich: c,
1880
- locale: m,
1881
- apiVersion: f = DEFAULT_API_VERSION,
1882
- fields: g,
1883
- omit: p,
1884
- offset: l,
1885
- cacheSeconds: u,
1886
- staleCacheSeconds: d,
1887
- sort: b,
1855
+ locale: u,
1856
+ apiVersion: m = DEFAULT_API_VERSION,
1857
+ fields: p,
1858
+ omit: g,
1859
+ offset: d,
1860
+ cacheSeconds: f,
1861
+ staleCacheSeconds: l,
1862
+ sort: h,
1888
1863
  includeUnpublished: y
1889
1864
  } = e;
1890
1865
  if (!a)
1891
1866
  throw new Error("Missing API key");
1892
- if (!["v2", "v3"].includes(f))
1893
- throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${f}'`);
1867
+ if (!["v2", "v3"].includes(m))
1868
+ throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${m}'`);
1894
1869
  (e.limit === void 0 || e.limit > 1) && !("noTraverse" in e) && (t = !0);
1895
- const h = new URL(`https://cdn.builder.io/api/${f}/content/${i}?apiKey=${a}&limit=${n}&noTraverse=${t}&includeRefs=${s}${m ? `&locale=${m}` : ""}${c ? `&enrich=${c}` : ""}`);
1896
- if (h.searchParams.set("omit", p || "meta.componentsUsed"), g && h.searchParams.set("fields", g), Number.isFinite(l) && l > -1 && h.searchParams.set("offset", String(Math.floor(l))), typeof y == "boolean" && h.searchParams.set("includeUnpublished", String(y)), u && isPositiveNumber(u) && h.searchParams.set("cacheSeconds", String(u)), d && isPositiveNumber(d) && h.searchParams.set("staleCacheSeconds", String(d)), b) {
1870
+ const b = new URL(`https://cdn.builder.io/api/${m}/content/${i}?apiKey=${a}&limit=${n}&noTraverse=${t}&includeRefs=${s}${u ? `&locale=${u}` : ""}${c ? `&enrich=${c}` : ""}`);
1871
+ if (b.searchParams.set("omit", g || "meta.componentsUsed"), p && b.searchParams.set("fields", p), Number.isFinite(d) && d > -1 && b.searchParams.set("offset", String(Math.floor(d))), typeof y == "boolean" && b.searchParams.set("includeUnpublished", String(y)), f && isPositiveNumber(f) && b.searchParams.set("cacheSeconds", String(f)), l && isPositiveNumber(l) && b.searchParams.set("staleCacheSeconds", String(l)), h) {
1897
1872
  const S = flatten({
1898
- sort: b
1873
+ sort: h
1899
1874
  });
1900
1875
  for (const C in S)
1901
- h.searchParams.set(C, JSON.stringify(S[C]));
1876
+ b.searchParams.set(C, JSON.stringify(S[C]));
1902
1877
  }
1903
1878
  const v = {
1904
1879
  ...getBuilderSearchParamsFromWindow(),
1905
1880
  ...normalizeSearchParams(e.options || {})
1906
1881
  }, x = flatten(v);
1907
1882
  for (const S in x)
1908
- h.searchParams.set(S, String(x[S]));
1909
- if (o && h.searchParams.set("userAttributes", JSON.stringify(o)), r) {
1883
+ b.searchParams.set(S, String(x[S]));
1884
+ if (o && b.searchParams.set("userAttributes", JSON.stringify(o)), r) {
1910
1885
  const S = flatten({
1911
1886
  query: r
1912
1887
  });
1913
1888
  for (const C in S)
1914
- h.searchParams.set(C, JSON.stringify(S[C]));
1889
+ b.searchParams.set(C, JSON.stringify(S[C]));
1915
1890
  }
1916
- return h;
1891
+ return b;
1917
1892
  }, checkContentHasResults = (e) => "results" in e;
1918
1893
  async function fetchOneEntry(e) {
1919
1894
  const t = await fetchEntries({
@@ -2150,7 +2125,7 @@ const findParentElement = (e, t, n = !0) => {
2150
2125
  builderElementIndex: n && o ? [].slice.call(document.getElementsByClassName(o)).indexOf(n) : void 0
2151
2126
  }
2152
2127
  };
2153
- }, SDK_VERSION = "0.11.2", registry = {};
2128
+ }, SDK_VERSION = "0.11.3", registry = {};
2154
2129
  function register(e, t) {
2155
2130
  let n = registry[e];
2156
2131
  if (n || (n = registry[e] = []), n.push(t), isBrowser()) {
@@ -2217,32 +2192,32 @@ const setupBrowserForEditing = (e = {}) => {
2217
2192
  if (o != null && o.type)
2218
2193
  switch (o.type) {
2219
2194
  case "builder.evaluate": {
2220
- const a = o.data.text, s = o.data.arguments || [], c = o.data.id, m = new Function(a);
2221
- let f, g = null;
2195
+ const a = o.data.text, s = o.data.arguments || [], c = o.data.id, u = new Function(a);
2196
+ let m, p = null;
2222
2197
  try {
2223
- f = m.apply(null, s);
2224
- } catch (p) {
2225
- g = p;
2198
+ m = u.apply(null, s);
2199
+ } catch (g) {
2200
+ p = g;
2226
2201
  }
2227
- g ? (r = window.parent) == null || r.postMessage({
2202
+ p ? (r = window.parent) == null || r.postMessage({
2228
2203
  type: "builder.evaluateError",
2229
2204
  data: {
2230
2205
  id: c,
2231
- error: g.message
2206
+ error: p.message
2232
2207
  }
2233
- }, "*") : f && typeof f.then == "function" ? f.then((p) => {
2234
- var l;
2235
- (l = window.parent) == null || l.postMessage({
2208
+ }, "*") : m && typeof m.then == "function" ? m.then((g) => {
2209
+ var d;
2210
+ (d = window.parent) == null || d.postMessage({
2236
2211
  type: "builder.evaluateResult",
2237
2212
  data: {
2238
2213
  id: c,
2239
- result: p
2214
+ result: g
2240
2215
  }
2241
2216
  }, "*");
2242
2217
  }).catch(console.error) : (i = window.parent) == null || i.postMessage({
2243
2218
  type: "builder.evaluateResult",
2244
2219
  data: {
2245
- result: f,
2220
+ result: m,
2246
2221
  id: c
2247
2222
  }
2248
2223
  }, "*");
@@ -2339,7 +2314,7 @@ const getContextStateInitialValue = ({
2339
2314
  meta: e == null ? void 0 : e.meta
2340
2315
  } : void 0;
2341
2316
  function ContentComponent(e) {
2342
- var r, i, a, s, c, m, f, g, p;
2317
+ var r, i, a, s, c, u, m, p, g;
2343
2318
  const t = getUpdateVariantVisibilityScript({
2344
2319
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
2345
2320
  variationId: (r = e.content) == null ? void 0 : r.testVariationId,
@@ -2355,11 +2330,11 @@ function ContentComponent(e) {
2355
2330
  ...components,
2356
2331
  ...e.customComponents || []
2357
2332
  ].reduce(
2358
- (l, { component: u, ...d }) => ({
2359
- ...l,
2360
- [d.name]: {
2361
- component: u,
2362
- ...serializeComponentInfo(d)
2333
+ (d, { component: f, ...l }) => ({
2334
+ ...d,
2335
+ [l.name]: {
2336
+ component: f,
2337
+ ...serializeComponentInfo(l)
2363
2338
  }
2364
2339
  }),
2365
2340
  {}
@@ -2388,9 +2363,9 @@ function ContentComponent(e) {
2388
2363
  ...components,
2389
2364
  ...e.customComponents || []
2390
2365
  ].reduce(
2391
- (l, { component: u, ...d }) => ({
2392
- ...l,
2393
- [d.name]: serializeComponentInfo(d)
2366
+ (d, { component: f, ...l }) => ({
2367
+ ...d,
2368
+ [l.name]: serializeComponentInfo(l)
2394
2369
  }),
2395
2370
  {}
2396
2371
  ),
@@ -2420,13 +2395,13 @@ function ContentComponent(e) {
2420
2395
  {
2421
2396
  contentId: (a = o.content) == null ? void 0 : a.id,
2422
2397
  cssCode: (c = (s = o.content) == null ? void 0 : s.data) == null ? void 0 : c.cssCode,
2423
- customFonts: (f = (m = o.content) == null ? void 0 : m.data) == null ? void 0 : f.customFonts
2398
+ customFonts: (m = (u = o.content) == null ? void 0 : u.data) == null ? void 0 : m.customFonts
2424
2399
  }
2425
2400
  ) }),
2426
2401
  /* @__PURE__ */ jsx(
2427
2402
  Blocks,
2428
2403
  {
2429
- blocks: (p = (g = o.content) == null ? void 0 : g.data) == null ? void 0 : p.blocks,
2404
+ blocks: (g = (p = o.content) == null ? void 0 : p.data) == null ? void 0 : g.blocks,
2430
2405
  context: o,
2431
2406
  registeredComponents: n
2432
2407
  }
@@ -2443,9 +2418,9 @@ function ContentVariants(e) {
2443
2418
  }), n = function() {
2444
2419
  var c;
2445
2420
  return getUpdateCookieAndStylesScript(
2446
- getVariants(e.content).map((m) => ({
2447
- id: m.testVariationId,
2448
- testRatio: m.testRatio
2421
+ getVariants(e.content).map((u) => ({
2422
+ id: u.testVariationId,
2423
+ testRatio: u.testRatio
2449
2424
  })),
2450
2425
  ((c = e.content) == null ? void 0 : c.id) || ""
2451
2426
  );
@@ -2542,12 +2517,12 @@ const fetchSymbolContent = async ({
2542
2517
  async function Symbol$1(e) {
2543
2518
  var o, r, i, a;
2544
2519
  const t = function() {
2545
- var c, m;
2520
+ var c, u;
2546
2521
  return [
2547
2522
  e.attributes.className,
2548
2523
  "builder-symbol",
2549
2524
  (c = e.symbol) != null && c.inline ? "builder-inline-symbol" : void 0,
2550
- (m = e.symbol) != null && m.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
2525
+ (u = e.symbol) != null && u.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
2551
2526
  ].filter(Boolean).join(" ");
2552
2527
  }, n = ((o = e.symbol) == null ? void 0 : o.content) || await fetchSymbolContent({
2553
2528
  symbol: e.symbol,