@builder.io/sdk-react-nextjs 0.14.17 → 0.14.19

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 (54) hide show
  1. package/lib/browser/USE_CLIENT_BUNDLE-a0af5379.cjs +21 -0
  2. package/lib/{node/USE_CLIENT_BUNDLE-8dadab11.js → browser/USE_CLIENT_BUNDLE-b63f19ab.js} +251 -247
  3. package/lib/{edge/USE_SERVER_BUNDLE-6b33cfd7.js → browser/USE_SERVER_BUNDLE-60e66f1c.js} +1 -1
  4. package/lib/{edge/USE_SERVER_BUNDLE-4035cf43.cjs → browser/USE_SERVER_BUNDLE-c0e4ee23.cjs} +1 -1
  5. package/lib/browser/bundle-9732e1d3.cjs +169 -0
  6. package/lib/browser/{bundle-974bbd75.js → bundle-edd2e835.js} +590 -578
  7. package/lib/browser/index.cjs +1 -1
  8. package/lib/browser/index.mjs +4 -4
  9. package/lib/edge/USE_CLIENT_BUNDLE-0a51f6af.cjs +21 -0
  10. package/lib/{browser/USE_CLIENT_BUNDLE-f685a480.js → edge/USE_CLIENT_BUNDLE-8bf08d5b.js} +251 -247
  11. package/lib/{node/USE_SERVER_BUNDLE-d847a064.cjs → edge/USE_SERVER_BUNDLE-7acc7eaf.cjs} +1 -1
  12. package/lib/{node/USE_SERVER_BUNDLE-d7d118c1.js → edge/USE_SERVER_BUNDLE-90c6ce15.js} +1 -1
  13. package/lib/edge/bundle-af88805d.cjs +189 -0
  14. package/lib/edge/{bundle-0e4ba4de.js → bundle-e86f8464.js} +1016 -1004
  15. package/lib/edge/index.cjs +1 -1
  16. package/lib/edge/index.mjs +4 -4
  17. package/lib/node/USE_CLIENT_BUNDLE-8a32af0d.cjs +21 -0
  18. package/lib/{edge/USE_CLIENT_BUNDLE-bf35f13e.js → node/USE_CLIENT_BUNDLE-e4c15aa7.js} +251 -247
  19. package/lib/{browser/USE_SERVER_BUNDLE-fbe70d66.js → node/USE_SERVER_BUNDLE-4fd50e3b.js} +1 -1
  20. package/lib/{browser/USE_SERVER_BUNDLE-1ee4e92a.cjs → node/USE_SERVER_BUNDLE-d6552b77.cjs} +1 -1
  21. package/lib/node/{bundle-a8217ddb.js → bundle-1280dc1a.js} +256 -242
  22. package/lib/node/{bundle-39fe7680.cjs → bundle-23855e1a.cjs} +18 -18
  23. package/lib/node/index.cjs +1 -1
  24. package/lib/node/index.mjs +4 -4
  25. package/package.json +1 -1
  26. package/types/cjs/blocks/columns/columns.types.d.ts +1 -1
  27. package/types/cjs/blocks/columns/helpers.d.ts +1 -0
  28. package/types/cjs/blocks/tabs/component-info.d.ts +2 -0
  29. package/types/cjs/blocks/tabs/index.d.ts +1 -0
  30. package/types/cjs/blocks/tabs/tabs.d.ts +4 -0
  31. package/types/cjs/blocks/tabs/tabs.types.d.ts +13 -0
  32. package/types/cjs/blocks/text/text.types.d.ts +2 -1
  33. package/types/cjs/components/block/block.helpers.d.ts +4 -2
  34. package/types/cjs/components/content/components/styles.helpers.d.ts +1 -0
  35. package/types/cjs/components/dynamic-div.d.ts +15 -0
  36. package/types/cjs/constants/sdk-version.d.ts +1 -1
  37. package/types/cjs/types/targets.d.ts +1 -1
  38. package/types/esm/blocks/columns/columns.types.d.ts +1 -1
  39. package/types/esm/blocks/columns/helpers.d.ts +1 -0
  40. package/types/esm/blocks/tabs/component-info.d.ts +2 -0
  41. package/types/esm/blocks/tabs/index.d.ts +1 -0
  42. package/types/esm/blocks/tabs/tabs.d.ts +4 -0
  43. package/types/esm/blocks/tabs/tabs.types.d.ts +13 -0
  44. package/types/esm/blocks/text/text.types.d.ts +2 -1
  45. package/types/esm/components/block/block.helpers.d.ts +4 -2
  46. package/types/esm/components/content/components/styles.helpers.d.ts +1 -0
  47. package/types/esm/components/dynamic-div.d.ts +15 -0
  48. package/types/esm/constants/sdk-version.d.ts +1 -1
  49. package/types/esm/types/targets.d.ts +1 -1
  50. package/lib/browser/USE_CLIENT_BUNDLE-f11159f6.cjs +0 -21
  51. package/lib/browser/bundle-e5f3c905.cjs +0 -169
  52. package/lib/edge/USE_CLIENT_BUNDLE-22f09854.cjs +0 -21
  53. package/lib/edge/bundle-15a88622.cjs +0 -189
  54. package/lib/node/USE_CLIENT_BUNDLE-e62d9c72.cjs +0 -21
@@ -1,7 +1,7 @@
1
1
  import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
2
  import "react";
3
- import { I as InteractiveElement, B as BlockWrapper, a as BlocksWrapper, D as DynamicRenderer, C as CustomCode, E as Embed, b as ImgComponent, V as Video, c as Button, F as FragmentComponent, d as Image, S as SectionComponent, e as EnableEditor } from "./USE_CLIENT_BUNDLE-8dadab11.js";
4
3
  import { LRUCache } from "lru-cache";
4
+ import { I as InteractiveElement, B as BlockWrapper, a as BlocksWrapper, D as DynamicRenderer, C as CustomCode, E as Embed, b as ImgComponent, V as Video, c as Button, F as FragmentComponent, d as Image, S as SectionComponent, e as EnableEditor } from "./USE_CLIENT_BUNDLE-e4c15aa7.js";
5
5
  import "next/navigation";
6
6
  const EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), isEmptyElement = (e) => typeof e == "string" && EMPTY_HTML_ELEMENTS.has(e.toLowerCase()), TARGET = "rsc", getClassPropName = () => {
7
7
  switch (TARGET) {
@@ -13,6 +13,7 @@ const EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col"
13
13
  case "vue":
14
14
  case "solid":
15
15
  case "qwik":
16
+ case "angular":
16
17
  return "class";
17
18
  }
18
19
  };
@@ -196,16 +197,16 @@ function theFunction() {
196
197
  ${e}
197
198
  }
198
199
 
199
- let output = theFunction()
200
+ const output = theFunction()
200
201
 
201
202
  if (typeof output === 'object' && output !== null) {
202
- output = JSON.stringify(output.copySync ? output.copySync() : output);
203
+ return JSON.stringify(output.copySync ? output.copySync() : output);
204
+ } else {
205
+ return output;
203
206
  }
204
-
205
- output;
206
207
  `;
207
208
  };
208
- let IVM_INSTANCE = null;
209
+ let IVM_INSTANCE = null, IVM_CONTEXT = null;
209
210
  const getIvm = () => {
210
211
  try {
211
212
  const e = safeDynamicRequire("isolated-vm");
@@ -222,12 +223,16 @@ const getIvm = () => {
222
223
 
223
224
  Please see the documentation for more information: https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments
224
225
  `);
225
- }, getIsolateContext = () => {
226
- const e = getIvm();
227
- return new e.Isolate({
228
- memoryLimit: 128
229
- }).createContextSync();
230
- }, runInNode = ({
226
+ };
227
+ function setIsolateContext(e = {
228
+ memoryLimit: 128
229
+ }) {
230
+ const t = getIvm(), o = new t.Isolate(e).createContextSync(), r = o.global;
231
+ return r.setSync("global", r.derefInto()), r.setSync("log", function(...i) {
232
+ console.log(...i);
233
+ }), r.setSync(INJECTED_IVM_GLOBAL, t), IVM_CONTEXT = o, o;
234
+ }
235
+ const getIsolateContext = () => IVM_CONTEXT || setIsolateContext(), runInNode = ({
231
236
  code: e,
232
237
  builder: t,
233
238
  context: n,
@@ -239,34 +244,32 @@ const getIvm = () => {
239
244
  const s = getIvm(), c = fastClone({
240
245
  ...a,
241
246
  ...r
242
- }), u = getFunctionArguments({
247
+ }), d = getFunctionArguments({
243
248
  builder: t,
244
249
  context: n,
245
250
  event: o,
246
251
  state: c
247
- }), g = getIsolateContext(), d = g.global;
248
- d.setSync("global", d.derefInto()), d.setSync("log", function(...m) {
249
- console.log(...m);
250
- }), d.setSync(BUILDER_SET_STATE_NAME, function(m, l) {
251
- set(a, m, l), i == null || i(a);
252
- }), u.forEach(([m, l]) => {
253
- const b = typeof l == "object" ? new s.Reference(
252
+ }), f = getIsolateContext(), l = f.global;
253
+ l.setSync(BUILDER_SET_STATE_NAME, function(b, p) {
254
+ set(a, b, p), i == null || i(a);
255
+ }), d.forEach(([b, p]) => {
256
+ const v = typeof p == "object" ? new s.Reference(
254
257
  // workaround: methods with default values for arguments is not being cloned over
255
- m === "builder" ? {
256
- ...l,
257
- getUserAttributes: () => l.getUserAttributes()
258
- } : l
258
+ b === "builder" ? {
259
+ ...p,
260
+ getUserAttributes: () => p.getUserAttributes()
261
+ } : p
259
262
  ) : null;
260
- d.setSync(getSyncValName(m), b);
261
- }), d.setSync(INJECTED_IVM_GLOBAL, s);
262
- const f = processCode({
263
+ l.setSync(getSyncValName(b), v);
264
+ });
265
+ const u = processCode({
263
266
  code: e,
264
- args: u
265
- }), h = g.evalSync(f);
267
+ args: d
268
+ }), g = f.evalClosureSync(u);
266
269
  try {
267
- return JSON.parse(h);
270
+ return JSON.parse(g);
268
271
  } catch {
269
- return h;
272
+ return g;
270
273
  }
271
274
  }, checkIsDefined = (e) => e != null;
272
275
  function isNodeRuntime() {
@@ -324,19 +327,19 @@ function evaluate({
324
327
  localState: n
325
328
  };
326
329
  if (s) {
327
- const u = EvalCache.getCacheKey(c), g = EvalCache.getCachedValue(u);
328
- if (g)
329
- return g.value;
330
+ const d = EvalCache.getCacheKey(c), f = EvalCache.getCachedValue(d);
331
+ if (f)
332
+ return f.value;
330
333
  }
331
334
  try {
332
- const u = chooseBrowserOrServerEval(c);
335
+ const d = chooseBrowserOrServerEval(c);
333
336
  if (s) {
334
- const g = EvalCache.getCacheKey(c);
335
- EvalCache.setCachedValue(g, u);
337
+ const f = EvalCache.getCacheKey(c);
338
+ EvalCache.setCachedValue(f, d);
336
339
  }
337
- return u;
338
- } catch (u) {
339
- logger.error("Failed code evaluation: " + u.message, {
340
+ return d;
341
+ } catch (d) {
342
+ logger.error("Failed code evaluation: " + d.message, {
340
343
  code: e
341
344
  });
342
345
  return;
@@ -364,7 +367,7 @@ const evaluateBindings = ({
364
367
  }
365
368
  };
366
369
  for (const s in e.bindings) {
367
- const c = e.bindings[s], u = evaluate({
370
+ const c = e.bindings[s], d = evaluate({
368
371
  code: c,
369
372
  localState: n,
370
373
  rootState: o,
@@ -372,7 +375,7 @@ const evaluateBindings = ({
372
375
  context: t,
373
376
  enableCache: !0
374
377
  });
375
- set(a, s, u);
378
+ set(a, s, d);
376
379
  }
377
380
  return a;
378
381
  };
@@ -427,6 +430,7 @@ function mapStyleObjToStrIfNeeded(e) {
427
430
  case "svelte":
428
431
  case "vue":
429
432
  case "solid":
433
+ case "angular":
430
434
  return convertStyleMapToCSSArray(e).join(" ");
431
435
  case "qwik":
432
436
  case "reactNative":
@@ -478,20 +482,20 @@ const getComponent = ({
478
482
  if (!Array.isArray(r))
479
483
  return;
480
484
  const i = n.collection.split(".").pop(), a = n.itemName || (i ? i + "Item" : "item");
481
- return r.map((c, u) => ({
485
+ return r.map((c, d) => ({
482
486
  context: {
483
487
  ...t,
484
488
  localState: {
485
489
  ...t.localState,
486
- $index: u,
490
+ $index: d,
487
491
  $item: c,
488
492
  [a]: c,
489
- [`$${a}Index`]: u
493
+ [`$${a}Index`]: d
490
494
  }
491
495
  },
492
496
  block: o
493
497
  }));
494
- }, SIZES = {
498
+ }, shouldPassLinkComponent = (e) => e && (e.isRSC || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(e.name)), shouldPassRegisteredComponents = (e) => e && (e.isRSC || ["Symbol", "Columns", "Form:Form", "Builder: Tabs"].includes(e.name)), SIZES = {
495
499
  small: {
496
500
  min: 320,
497
501
  default: 321,
@@ -596,7 +600,7 @@ function BlockStyles(e) {
596
600
  });
597
601
  return checkIsDefined(r.hide) ? !r.hide : checkIsDefined(r.show) ? r.show : !0;
598
602
  }, n = function() {
599
- var p, S, C;
603
+ var m, h, y;
600
604
  const r = getProcessedBlock({
601
605
  block: e.block,
602
606
  localState: e.context.localState,
@@ -605,47 +609,47 @@ function BlockStyles(e) {
605
609
  context: e.context.context,
606
610
  shouldEvaluateBindings: !0
607
611
  }), i = r.responsiveStyles, a = e.context.content, s = getSizesForBreakpoints(
608
- ((p = a == null ? void 0 : a.meta) == null ? void 0 : p.breakpoints) || {}
609
- ), c = i == null ? void 0 : i.large, u = i == null ? void 0 : i.medium, g = i == null ? void 0 : i.small, d = r.id;
610
- if (!d)
612
+ ((m = a == null ? void 0 : a.meta) == null ? void 0 : m.breakpoints) || {}
613
+ ), c = i == null ? void 0 : i.large, d = i == null ? void 0 : i.medium, f = i == null ? void 0 : i.small, l = r.id;
614
+ if (!l)
611
615
  return "";
612
- const f = c ? createCssClass({
613
- className: d,
616
+ const u = c ? createCssClass({
617
+ className: l,
614
618
  styles: c
615
- }) : "", h = u ? createCssClass({
616
- className: d,
617
- styles: u,
619
+ }) : "", g = d ? createCssClass({
620
+ className: l,
621
+ styles: d,
618
622
  mediaQuery: getMaxWidthQueryForSize(
619
623
  "medium",
620
624
  s
621
625
  )
622
- }) : "", m = g ? createCssClass({
623
- className: d,
624
- styles: g,
626
+ }) : "", b = f ? createCssClass({
627
+ className: l,
628
+ styles: f,
625
629
  mediaQuery: getMaxWidthQueryForSize(
626
630
  "small",
627
631
  s
628
632
  )
629
- }) : "", l = r.animations && r.animations.find((y) => y.trigger === "hover");
630
- let b = "";
631
- if (l) {
632
- const y = ((C = (S = l.steps) == null ? void 0 : S[1]) == null ? void 0 : C.styles) || {};
633
- b = createCssClass({
634
- className: `${d}:hover`,
633
+ }) : "", p = r.animations && r.animations.find((S) => S.trigger === "hover");
634
+ let v = "";
635
+ if (p) {
636
+ const S = ((y = (h = p.steps) == null ? void 0 : h[1]) == null ? void 0 : y.styles) || {};
637
+ v = createCssClass({
638
+ className: `${l}:hover`,
635
639
  styles: {
636
- ...y,
637
- transition: `all ${l.duration}s ${camelCaseToKebabCase(
638
- l.easing
640
+ ...S,
641
+ transition: `all ${p.duration}s ${camelCaseToKebabCase(
642
+ p.easing
639
643
  )}`,
640
- transitionDelay: l.delay ? `${l.delay}s` : "0s"
644
+ transitionDelay: p.delay ? `${p.delay}s` : "0s"
641
645
  }
642
646
  }) || "";
643
647
  }
644
648
  return [
645
- f,
646
- h,
647
- m,
648
- b
649
+ u,
650
+ g,
651
+ b,
652
+ v
649
653
  ].join(" ");
650
654
  };
651
655
  return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { id: "builderio-block", styles: n() }) }) : null });
@@ -784,7 +788,7 @@ function RepeatedBlock(e) {
784
788
  );
785
789
  }
786
790
  function Block(e) {
787
- var c, u, g;
791
+ var c, d, f;
788
792
  const t = function() {
789
793
  return getComponent({
790
794
  block: e.block,
@@ -797,8 +801,8 @@ function Block(e) {
797
801
  context: e.context
798
802
  });
799
803
  }, o = function() {
800
- var f;
801
- return (f = e.block.repeat) != null && f.collection ? e.block : getProcessedBlock({
804
+ var u;
805
+ return (u = e.block.repeat) != null && u.collection ? e.block : getProcessedBlock({
802
806
  block: e.block,
803
807
  localState: e.context.localState,
804
808
  rootState: e.context.rootState,
@@ -807,29 +811,29 @@ function Block(e) {
807
811
  shouldEvaluateBindings: !0
808
812
  });
809
813
  }, r = function() {
810
- var h;
811
- return e.block.tagName === "a" || ((h = o().properties) == null ? void 0 : h.href) || o().href ? e.linkComponent || "a" : e.block.tagName || "div";
814
+ var g;
815
+ return e.block.tagName === "a" || ((g = o().properties) == null ? void 0 : g.href) || o().href ? e.linkComponent || "a" : e.block.tagName || "div";
812
816
  }, i = function() {
813
- var m, l;
814
- if ((m = e.block.repeat) != null && m.collection)
815
- return !!((l = n()) != null && l.length);
816
- const f = "hide" in o() ? o().hide : !1;
817
- return ("show" in o() ? o().show : !0) && !f;
817
+ var b, p;
818
+ if ((b = e.block.repeat) != null && b.collection)
819
+ return !!((p = n()) != null && p.length);
820
+ const u = "hide" in o() ? o().hide : !1;
821
+ return ("show" in o() ? o().show : !0) && !u;
818
822
  }, a = function() {
819
- var h;
820
- return !((h = t()) != null && h.component) && !n() ? o().children ?? [] : [];
823
+ var g;
824
+ return !((g = t()) != null && g.component) && !n() ? o().children ?? [] : [];
821
825
  }, s = function() {
822
- var f, h, m, l, b, p, S, C, y, v;
826
+ var u, g, b;
823
827
  return {
824
828
  blockChildren: o().children ?? [],
825
- componentRef: (f = t()) == null ? void 0 : f.component,
829
+ componentRef: (u = t()) == null ? void 0 : u.component,
826
830
  componentOptions: {
827
831
  ...getBlockComponentOptions(o()),
828
832
  builderContext: e.context,
829
- ...((h = t()) == null ? void 0 : h.name) === "Core:Button" || ((m = t()) == null ? void 0 : m.name) === "Symbol" || ((l = t()) == null ? void 0 : l.name) === "Columns" || ((b = t()) == null ? void 0 : b.name) === "Form:Form" ? {
833
+ ...shouldPassLinkComponent(t()) ? {
830
834
  builderLinkComponent: e.linkComponent
831
835
  } : {},
832
- ...((p = t()) == null ? void 0 : p.name) === "Symbol" || ((S = t()) == null ? void 0 : S.name) === "Columns" || ((C = t()) == null ? void 0 : C.name) === "Form:Form" ? {
836
+ ...shouldPassRegisteredComponents(t()) ? {
833
837
  builderComponents: e.registeredComponents
834
838
  } : {}
835
839
  },
@@ -837,8 +841,8 @@ function Block(e) {
837
841
  linkComponent: e.linkComponent,
838
842
  registeredComponents: e.registeredComponents,
839
843
  builderBlock: o(),
840
- includeBlockProps: ((y = t()) == null ? void 0 : y.noWrap) === !0,
841
- isInteractive: !((v = t()) != null && v.isRSC)
844
+ includeBlockProps: ((g = t()) == null ? void 0 : g.noWrap) === !0,
845
+ isInteractive: !((b = t()) != null && b.isRSC)
842
846
  };
843
847
  };
844
848
  return /* @__PURE__ */ jsx(Fragment, { children: i() ? /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -856,15 +860,15 @@ function Block(e) {
856
860
  includeBlockProps: s().includeBlockProps,
857
861
  isInteractive: s().isInteractive
858
862
  }
859
- ) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (g = n()) == null ? void 0 : g.map((d, f) => /* @__PURE__ */ jsx(
863
+ ) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (f = n()) == null ? void 0 : f.map((l, u) => /* @__PURE__ */ jsx(
860
864
  RepeatedBlock,
861
865
  {
862
- repeatContext: d.context,
863
- block: d.block,
866
+ repeatContext: l.context,
867
+ block: l.block,
864
868
  registeredComponents: e.registeredComponents,
865
869
  linkComponent: e.linkComponent
866
870
  },
867
- f
871
+ u
868
872
  )) }) : /* @__PURE__ */ jsxs(
869
873
  BlockWrapper,
870
874
  {
@@ -887,15 +891,15 @@ function Block(e) {
887
891
  isInteractive: s().isInteractive
888
892
  }
889
893
  ),
890
- (u = a()) == null ? void 0 : u.map((d) => /* @__PURE__ */ jsx(
894
+ (d = a()) == null ? void 0 : d.map((l) => /* @__PURE__ */ jsx(
891
895
  Block,
892
896
  {
893
- block: d,
897
+ block: l,
894
898
  registeredComponents: e.registeredComponents,
895
899
  linkComponent: e.linkComponent,
896
900
  context: e.context
897
901
  },
898
- d.id
902
+ l.id
899
903
  ))
900
904
  ]
901
905
  }
@@ -926,67 +930,70 @@ function Blocks(e) {
926
930
  }
927
931
  );
928
932
  }
933
+ const getColumnsClass = (e) => `builder-columns ${e}-breakpoints`;
929
934
  function Columns(e) {
930
- var h;
931
- const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet", r = function(l) {
932
- var b;
933
- return ((b = n[l]) == null ? void 0 : b.width) || 100 / n.length;
934
- }, i = function(l) {
935
- const b = t * (n.length - 1) / n.length;
936
- return `calc(${r(l)}% - ${b}px)`;
937
- }, a = function({
938
- stackedStyle: l,
939
- desktopStyle: b
940
- }) {
941
- return o === "tablet" ? l : b;
935
+ var p, v;
936
+ const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet", r = function(h) {
937
+ return h.link ? e.builderLinkComponent || "a" : "div";
938
+ }, i = function(h) {
939
+ var y;
940
+ return ((y = n[h]) == null ? void 0 : y.width) || 100 / n.length;
941
+ }, a = function(h) {
942
+ const y = t * (n.length - 1) / n.length;
943
+ return `calc(${i(h)}% - ${y}px)`;
942
944
  }, s = function({
943
- stackedStyle: l,
944
- desktopStyle: b
945
+ stackedStyle: h,
946
+ desktopStyle: y
947
+ }) {
948
+ return o === "tablet" ? h : y;
949
+ }, c = function({
950
+ stackedStyle: h,
951
+ desktopStyle: y
945
952
  }) {
946
- return o === "never" ? b : l;
947
- }, c = e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column", u = function() {
953
+ return o === "never" ? y : h;
954
+ }, d = e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column", f = function() {
948
955
  return {
949
- "--flex-dir": c,
950
- "--flex-dir-tablet": a({
951
- stackedStyle: c,
956
+ "--flex-dir": d,
957
+ "--flex-dir-tablet": s({
958
+ stackedStyle: d,
952
959
  desktopStyle: "row"
953
960
  })
954
961
  };
955
- }, g = function(l) {
956
- const b = l === 0 ? 0 : t, p = i(l), S = `${b}px`, C = "100%", y = 0;
962
+ }, l = function(h) {
963
+ const y = h === 0 ? 0 : t, S = a(h), C = `${y}px`, I = "100%", x = 0;
957
964
  return {
958
965
  ...{
959
966
  display: "flex",
960
967
  flexDirection: "column",
961
968
  alignItems: "stretch"
962
969
  },
963
- width: p,
964
- ["marginLeft"]: S,
965
- "--column-width-mobile": s({
966
- stackedStyle: C,
967
- desktopStyle: p
968
- }),
969
- "--column-margin-left-mobile": s({
970
- stackedStyle: y,
970
+ width: S,
971
+ ["marginLeft"]: C,
972
+ "--column-width-mobile": c({
973
+ stackedStyle: I,
971
974
  desktopStyle: S
972
975
  }),
973
- "--column-width-tablet": a({
974
- stackedStyle: C,
975
- desktopStyle: p
976
+ "--column-margin-left-mobile": c({
977
+ stackedStyle: x,
978
+ desktopStyle: C
976
979
  }),
977
- "--column-margin-left-tablet": a({
978
- stackedStyle: y,
980
+ "--column-width-tablet": s({
981
+ stackedStyle: I,
979
982
  desktopStyle: S
983
+ }),
984
+ "--column-margin-left-tablet": s({
985
+ stackedStyle: x,
986
+ desktopStyle: C
980
987
  })
981
988
  };
982
- }, d = function(l) {
983
- var p, S;
989
+ }, u = function(h) {
990
+ var S, C;
984
991
  return getSizesForBreakpoints(
985
- ((S = (p = e.builderContext.content) == null ? void 0 : p.meta) == null ? void 0 : S.breakpoints) || {}
986
- )[l].max;
987
- }, f = function() {
992
+ ((C = (S = e.builderContext.content) == null ? void 0 : S.meta) == null ? void 0 : C.breakpoints) || {}
993
+ )[h].max;
994
+ }, g = function() {
988
995
  return `
989
- @media (max-width: ${d("medium")}px) {
996
+ @media (max-width: ${u("medium")}px) {
990
997
  .${e.builderBlock.id}-breakpoints {
991
998
  flex-direction: var(--flex-dir-tablet);
992
999
  align-items: stretch;
@@ -998,7 +1005,7 @@ function Columns(e) {
998
1005
  }
999
1006
  }
1000
1007
 
1001
- @media (max-width: ${d("small")}px) {
1008
+ @media (max-width: ${u("small")}px) {
1002
1009
  .${e.builderBlock.id}-breakpoints {
1003
1010
  flex-direction: var(--flex-dir);
1004
1011
  align-items: stretch;
@@ -1010,31 +1017,33 @@ function Columns(e) {
1010
1017
  }
1011
1018
  },
1012
1019
  `;
1020
+ }, b = function(h, y) {
1021
+ return {
1022
+ ...h.link ? {
1023
+ href: h.link
1024
+ } : {},
1025
+ [getClassPropName()]: "builder-column",
1026
+ style: mapStyleObjToStrIfNeeded(l(y))
1027
+ };
1013
1028
  };
1014
1029
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1015
1030
  /* @__PURE__ */ jsxs(
1016
1031
  "div",
1017
1032
  {
1018
- className: `builder-columns ${e.builderBlock.id}-breakpoints div-664216e4`,
1019
- style: u(),
1033
+ className: getColumnsClass((p = e.builderBlock) == null ? void 0 : p.id) + " div-2651dce4",
1034
+ style: f(),
1020
1035
  children: [
1021
- /* @__PURE__ */ jsx(InlinedStyles, { id: "builderio-columns", styles: f() }),
1022
- (h = e.columns) == null ? void 0 : h.map((m, l) => /* @__PURE__ */ jsx(
1036
+ /* @__PURE__ */ jsx(InlinedStyles, { id: "builderio-columns", styles: g() }),
1037
+ (v = e.columns) == null ? void 0 : v.map((m, h) => /* @__PURE__ */ jsx(
1023
1038
  DynamicRenderer,
1024
1039
  {
1025
- TagName: m.link ? e.builderLinkComponent || "a" : "div",
1040
+ TagName: r(m),
1026
1041
  actionAttributes: {},
1027
- attributes: {
1028
- ...m.link ? {
1029
- href: m.link
1030
- } : {},
1031
- [getClassPropName()]: "builder-column",
1032
- style: mapStyleObjToStrIfNeeded(g(l))
1033
- },
1042
+ attributes: b(m, h),
1034
1043
  children: /* @__PURE__ */ jsx(
1035
1044
  Blocks,
1036
1045
  {
1037
- path: `component.options.columns.${l}.blocks`,
1046
+ path: `component.options.columns.${h}.blocks`,
1038
1047
  parent: e.builderBlock.id,
1039
1048
  styleProp: {
1040
1049
  flexGrow: "1"
@@ -1046,12 +1055,12 @@ function Columns(e) {
1046
1055
  }
1047
1056
  )
1048
1057
  },
1049
- l
1058
+ h
1050
1059
  ))
1051
1060
  ]
1052
1061
  }
1053
1062
  ),
1054
- /* @__PURE__ */ jsx("style", { children: `.div-664216e4 {
1063
+ /* @__PURE__ */ jsx("style", { children: `.div-2651dce4 {
1055
1064
  display: flex;
1056
1065
  line-height: normal;
1057
1066
  }` })
@@ -1483,15 +1492,15 @@ const getTopLevelDomain = (e) => {
1483
1492
  onChange: (e) => {
1484
1493
  e.delete("srcset"), e.delete("noWebp");
1485
1494
  function n(a, s = 6e4) {
1486
- return new Promise((c, u) => {
1487
- const g = document.createElement("img");
1488
- let d = !1;
1489
- g.onload = () => {
1490
- d = !0, c(g);
1491
- }, g.addEventListener("error", (f) => {
1492
- console.warn("Image load failed", f.error), u(f.error);
1493
- }), g.src = a, setTimeout(() => {
1494
- d || u(new Error("Image load timed out"));
1495
+ return new Promise((c, d) => {
1496
+ const f = document.createElement("img");
1497
+ let l = !1;
1498
+ f.onload = () => {
1499
+ l = !0, c(f);
1500
+ }, f.addEventListener("error", (u) => {
1501
+ console.warn("Image load failed", u.error), d(u.error);
1502
+ }), f.src = a, setTimeout(() => {
1503
+ l || d(new Error("Image load timed out"));
1495
1504
  }, s);
1496
1505
  });
1497
1506
  }
@@ -2078,40 +2087,40 @@ const DEFAULT_API_VERSION = "v3", BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUIL
2078
2087
  enrich: a,
2079
2088
  locale: s,
2080
2089
  apiVersion: c = DEFAULT_API_VERSION,
2081
- fields: u,
2082
- omit: g,
2083
- offset: d,
2084
- cacheSeconds: f,
2085
- staleCacheSeconds: h,
2086
- sort: m,
2087
- includeUnpublished: l
2090
+ fields: d,
2091
+ omit: f,
2092
+ offset: l,
2093
+ cacheSeconds: u,
2094
+ staleCacheSeconds: g,
2095
+ sort: b,
2096
+ includeUnpublished: p
2088
2097
  } = e;
2089
2098
  if (!i)
2090
2099
  throw new Error("Missing API key");
2091
2100
  if (!["v3"].includes(c))
2092
2101
  throw new Error(`Invalid apiVersion: expected 'v3', received '${c}'`);
2093
- const b = t !== 1, p = new URL(`https://cdn.builder.io/api/${c}/content/${r}`);
2094
- if (p.searchParams.set("apiKey", i), p.searchParams.set("limit", String(t)), p.searchParams.set("noTraverse", String(b)), p.searchParams.set("includeRefs", String(!0)), s && p.searchParams.set("locale", s), a && p.searchParams.set("enrich", String(a)), p.searchParams.set("omit", g || "meta.componentsUsed"), u && p.searchParams.set("fields", u), Number.isFinite(d) && d > -1 && p.searchParams.set("offset", String(Math.floor(d))), typeof l == "boolean" && p.searchParams.set("includeUnpublished", String(l)), f && isPositiveNumber(f) && p.searchParams.set("cacheSeconds", String(f)), h && isPositiveNumber(h) && p.searchParams.set("staleCacheSeconds", String(h)), m) {
2095
- const y = flatten({
2096
- sort: m
2102
+ const v = t !== 1, m = new URL(`https://cdn.builder.io/api/${c}/content/${r}`);
2103
+ if (m.searchParams.set("apiKey", i), m.searchParams.set("limit", String(t)), m.searchParams.set("noTraverse", String(v)), m.searchParams.set("includeRefs", String(!0)), s && m.searchParams.set("locale", s), a && m.searchParams.set("enrich", String(a)), m.searchParams.set("omit", f || "meta.componentsUsed"), d && m.searchParams.set("fields", d), Number.isFinite(l) && l > -1 && m.searchParams.set("offset", String(Math.floor(l))), typeof p == "boolean" && m.searchParams.set("includeUnpublished", String(p)), u && isPositiveNumber(u) && m.searchParams.set("cacheSeconds", String(u)), g && isPositiveNumber(g) && m.searchParams.set("staleCacheSeconds", String(g)), b) {
2104
+ const S = flatten({
2105
+ sort: b
2097
2106
  });
2098
- for (const v in y)
2099
- p.searchParams.set(v, JSON.stringify(y[v]));
2107
+ for (const C in S)
2108
+ m.searchParams.set(C, JSON.stringify(S[C]));
2100
2109
  }
2101
- const S = {
2110
+ const h = {
2102
2111
  ...getBuilderSearchParamsFromWindow(),
2103
2112
  ...normalizeSearchParams(e.options || {})
2104
- }, C = flatten(S);
2105
- for (const y in C)
2106
- p.searchParams.set(y, String(C[y]));
2107
- if (n && p.searchParams.set("userAttributes", JSON.stringify(n)), o) {
2108
- const y = flatten({
2113
+ }, y = flatten(h);
2114
+ for (const S in y)
2115
+ m.searchParams.set(S, String(y[S]));
2116
+ if (n && m.searchParams.set("userAttributes", JSON.stringify(n)), o) {
2117
+ const S = flatten({
2109
2118
  query: o
2110
2119
  });
2111
- for (const v in y)
2112
- p.searchParams.set(v, JSON.stringify(y[v]));
2120
+ for (const C in S)
2121
+ m.searchParams.set(C, JSON.stringify(S[C]));
2113
2122
  }
2114
- return p;
2123
+ return m;
2115
2124
  }, checkContentHasResults = (e) => "results" in e;
2116
2125
  async function fetchOneEntry(e) {
2117
2126
  const t = await fetchEntries({
@@ -2353,7 +2362,7 @@ function isFromTrustedHost(e, t) {
2353
2362
  const n = new URL(t.origin), o = n.hostname;
2354
2363
  return (e || DEFAULT_TRUSTED_HOSTS).findIndex((r) => r.startsWith("*.") ? o.endsWith(r.slice(1)) : r === o) > -1;
2355
2364
  }
2356
- const SDK_VERSION = "0.14.17", registry = {};
2365
+ const SDK_VERSION = "0.14.19", registry = {};
2357
2366
  function register(e, t) {
2358
2367
  let n = registry[e];
2359
2368
  if (n || (n = registry[e] = []), n.push(t), isBrowser()) {
@@ -2423,33 +2432,33 @@ const setupBrowserForEditing = (e = {}) => {
2423
2432
  if (r != null && r.type)
2424
2433
  switch (r.type) {
2425
2434
  case "builder.evaluate": {
2426
- const s = r.data.text, c = r.data.arguments || [], u = r.data.id, g = new Function(s);
2427
- let d, f = null;
2435
+ const s = r.data.text, c = r.data.arguments || [], d = r.data.id, f = new Function(s);
2436
+ let l, u = null;
2428
2437
  try {
2429
- d = g.apply(null, c);
2430
- } catch (h) {
2431
- f = h;
2438
+ l = f.apply(null, c);
2439
+ } catch (g) {
2440
+ u = g;
2432
2441
  }
2433
- f ? (i = window.parent) == null || i.postMessage({
2442
+ u ? (i = window.parent) == null || i.postMessage({
2434
2443
  type: "builder.evaluateError",
2435
2444
  data: {
2436
- id: u,
2437
- error: f.message
2445
+ id: d,
2446
+ error: u.message
2438
2447
  }
2439
- }, "*") : d && typeof d.then == "function" ? d.then((h) => {
2440
- var m;
2441
- (m = window.parent) == null || m.postMessage({
2448
+ }, "*") : l && typeof l.then == "function" ? l.then((g) => {
2449
+ var b;
2450
+ (b = window.parent) == null || b.postMessage({
2442
2451
  type: "builder.evaluateResult",
2443
2452
  data: {
2444
- id: u,
2445
- result: h
2453
+ id: d,
2454
+ result: g
2446
2455
  }
2447
2456
  }, "*");
2448
2457
  }).catch(console.error) : (a = window.parent) == null || a.postMessage({
2449
2458
  type: "builder.evaluateResult",
2450
2459
  data: {
2451
- result: d,
2452
- id: u
2460
+ result: l,
2461
+ id: d
2453
2462
  }
2454
2463
  }, "*");
2455
2464
  break;
@@ -2552,7 +2561,7 @@ font-weight: ${a};
2552
2561
  text-align: inherit;
2553
2562
  font-family: inherit;
2554
2563
  }
2555
- `, getDefaultStyles = (e) => e ? "" : DEFAULT_STYLES;
2564
+ `, getDefaultStyles = (e) => e ? "" : DEFAULT_STYLES, getWrapperClassName = (e) => `variant-${e}`;
2556
2565
  function ContentStyles(e) {
2557
2566
  const t = `
2558
2567
  ${getCss({
@@ -2595,7 +2604,7 @@ const getRootStateInitialValue = ({
2595
2604
  meta: e == null ? void 0 : e.meta
2596
2605
  } : void 0;
2597
2606
  function ContentComponent(e) {
2598
- var r, i, a, s, c, u, g, d, f;
2607
+ var r, i, a, s, c, d, f, l, u;
2599
2608
  const t = getUpdateVariantVisibilityScript({
2600
2609
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
2601
2610
  variationId: (r = e.content) == null ? void 0 : r.testVariationId,
@@ -2605,11 +2614,11 @@ function ContentComponent(e) {
2605
2614
  ...getDefaultRegisteredComponents(),
2606
2615
  ...e.customComponents || []
2607
2616
  ].reduce(
2608
- (h, { component: m, ...l }) => ({
2609
- ...h,
2610
- [l.name]: {
2611
- component: m,
2612
- ...serializeComponentInfo(l)
2617
+ (g, { component: b, ...p }) => ({
2618
+ ...g,
2619
+ [p.name]: {
2620
+ component: b,
2621
+ ...serializeComponentInfo(p)
2613
2622
  }
2614
2623
  }),
2615
2624
  {}
@@ -2632,9 +2641,9 @@ function ContentComponent(e) {
2632
2641
  ...getDefaultRegisteredComponents(),
2633
2642
  ...e.customComponents || []
2634
2643
  ].reduce(
2635
- (h, { component: m, ...l }) => ({
2636
- ...h,
2637
- [l.name]: serializeComponentInfo(l)
2644
+ (g, { component: b, ...p }) => ({
2645
+ ...g,
2646
+ [p.name]: serializeComponentInfo(p)
2638
2647
  }),
2639
2648
  {}
2640
2649
  ),
@@ -2673,13 +2682,13 @@ function ContentComponent(e) {
2673
2682
  isNestedRender: e.isNestedRender,
2674
2683
  contentId: (a = o.content) == null ? void 0 : a.id,
2675
2684
  cssCode: (c = (s = o.content) == null ? void 0 : s.data) == null ? void 0 : c.cssCode,
2676
- customFonts: (g = (u = o.content) == null ? void 0 : u.data) == null ? void 0 : g.customFonts
2685
+ customFonts: (f = (d = o.content) == null ? void 0 : d.data) == null ? void 0 : f.customFonts
2677
2686
  }
2678
2687
  ),
2679
2688
  /* @__PURE__ */ jsx(
2680
2689
  Blocks,
2681
2690
  {
2682
- blocks: (f = (d = o.content) == null ? void 0 : d.data) == null ? void 0 : f.blocks,
2691
+ blocks: (u = (l = o.content) == null ? void 0 : l.data) == null ? void 0 : u.blocks,
2683
2692
  context: o,
2684
2693
  registeredComponents: n,
2685
2694
  linkComponent: e.linkComponent
@@ -2810,20 +2819,24 @@ const fetchSymbolContent = async ({
2810
2819
  });
2811
2820
  };
2812
2821
  async function Symbol$1(e) {
2813
- var o, r, i, a, s;
2822
+ var i, a, s, c, d;
2814
2823
  const t = function() {
2815
- var u, g;
2824
+ return "div";
2825
+ }, n = function() {
2826
+ return "div";
2827
+ }, o = function() {
2828
+ var l, u;
2816
2829
  return [
2817
2830
  e.attributes[getClassPropName()],
2818
2831
  "builder-symbol",
2819
- (u = e.symbol) != null && u.inline ? "builder-inline-symbol" : void 0,
2820
- (g = e.symbol) != null && g.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
2832
+ (l = e.symbol) != null && l.inline ? "builder-inline-symbol" : void 0,
2833
+ (u = e.symbol) != null && u.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
2821
2834
  ].filter(Boolean).join(" ");
2822
- }, n = ((o = e.symbol) == null ? void 0 : o.content) || await fetchSymbolContent({
2835
+ }, r = ((i = e.symbol) == null ? void 0 : i.content) || await fetchSymbolContent({
2823
2836
  symbol: e.symbol,
2824
2837
  builderContextValue: e.builderContext
2825
2838
  });
2826
- return /* @__PURE__ */ jsx("div", { ...e.attributes, className: t(), children: /* @__PURE__ */ jsx(
2839
+ return /* @__PURE__ */ jsx("div", { ...e.attributes, className: o(), children: /* @__PURE__ */ jsx(
2827
2840
  ContentVariants,
2828
2841
  {
2829
2842
  isNestedRender: !0,
@@ -2831,19 +2844,19 @@ async function Symbol$1(e) {
2831
2844
  apiKey: e.builderContext.apiKey,
2832
2845
  context: {
2833
2846
  ...e.builderContext.context,
2834
- symbolId: (r = e.builderBlock) == null ? void 0 : r.id
2847
+ symbolId: (a = e.builderBlock) == null ? void 0 : a.id
2835
2848
  },
2836
2849
  customComponents: Object.values(e.builderComponents),
2837
2850
  data: {
2838
- ...(i = e.symbol) == null ? void 0 : i.data,
2851
+ ...(s = e.symbol) == null ? void 0 : s.data,
2839
2852
  ...e.builderContext.localState,
2840
- ...(a = n == null ? void 0 : n.data) == null ? void 0 : a.state
2853
+ ...(c = r == null ? void 0 : r.data) == null ? void 0 : c.state
2841
2854
  },
2842
- model: (s = e.symbol) == null ? void 0 : s.model,
2843
- content: n,
2855
+ model: (d = e.symbol) == null ? void 0 : d.model,
2856
+ content: r,
2844
2857
  linkComponent: e.builderLinkComponent,
2845
- blocksWrapper: "div",
2846
- contentWrapper: "div"
2858
+ blocksWrapper: t(),
2859
+ contentWrapper: n()
2847
2860
  }
2848
2861
  ) });
2849
2862
  }
@@ -2879,13 +2892,14 @@ const fetchBuilderProps = async (e) => {
2879
2892
  };
2880
2893
  };
2881
2894
  export {
2882
- track as A,
2895
+ getBuilderSearchParams as A,
2883
2896
  Blocks as B,
2884
2897
  Columns as C,
2885
- subscribeToEditor as D,
2886
- fetchBuilderProps as E,
2887
- _processContentResult as F,
2888
- fetchEntries as G,
2898
+ track as D,
2899
+ subscribeToEditor as E,
2900
+ fetchBuilderProps as F,
2901
+ _processContentResult as G,
2902
+ fetchEntries as H,
2889
2903
  Symbol$1 as S,
2890
2904
  Text as T,
2891
2905
  _track as _,
@@ -2899,20 +2913,20 @@ export {
2899
2913
  getDefaultCanTrack as h,
2900
2914
  isEmptyElement as i,
2901
2915
  isPreviewing as j,
2902
- createEditorListener as k,
2916
+ getWrapperClassName as k,
2903
2917
  logger as l,
2904
- evaluate as m,
2905
- getInteractionPropertiesForEvent as n,
2906
- fetch$1 as o,
2907
- fastClone as p,
2908
- createRegisterComponentMessage as q,
2918
+ createEditorListener as m,
2919
+ evaluate as n,
2920
+ getInteractionPropertiesForEvent as o,
2921
+ fetch$1 as p,
2922
+ fastClone as q,
2909
2923
  registerInsertMenu as r,
2910
2924
  setupBrowserForEditing as s,
2911
2925
  triggerAnimation as t,
2912
- fetchOneEntry as u,
2913
- init as v,
2914
- ContentVariants as w,
2915
- register as x,
2916
- setEditorSettings as y,
2917
- getBuilderSearchParams as z
2926
+ createRegisterComponentMessage as u,
2927
+ fetchOneEntry as v,
2928
+ init as w,
2929
+ ContentVariants as x,
2930
+ register as y,
2931
+ setEditorSettings as z
2918
2932
  };