@builder.io/sdk-react-nextjs 0.14.16 → 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-f8067984.js → browser/USE_CLIENT_BUNDLE-b63f19ab.js} +251 -247
  3. package/lib/{edge/USE_SERVER_BUNDLE-0f9fd6f2.js → browser/USE_SERVER_BUNDLE-60e66f1c.js} +1 -1
  4. package/lib/{edge/USE_SERVER_BUNDLE-b3d619da.cjs → browser/USE_SERVER_BUNDLE-c0e4ee23.cjs} +1 -1
  5. package/lib/browser/bundle-9732e1d3.cjs +169 -0
  6. package/lib/browser/{bundle-5c0a9d7a.js → bundle-edd2e835.js} +591 -581
  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-30c6c6c1.js → edge/USE_CLIENT_BUNDLE-8bf08d5b.js} +251 -247
  11. package/lib/{node/USE_SERVER_BUNDLE-e1e73ba6.cjs → edge/USE_SERVER_BUNDLE-7acc7eaf.cjs} +1 -1
  12. package/lib/{node/USE_SERVER_BUNDLE-4b52a0c0.js → edge/USE_SERVER_BUNDLE-90c6ce15.js} +1 -1
  13. package/lib/edge/bundle-af88805d.cjs +189 -0
  14. package/lib/edge/{bundle-b24e7c9b.js → bundle-e86f8464.js} +998 -988
  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-5b0b3e9b.js → node/USE_CLIENT_BUNDLE-e4c15aa7.js} +251 -247
  19. package/lib/{browser/USE_SERVER_BUNDLE-685e6983.js → node/USE_SERVER_BUNDLE-4fd50e3b.js} +1 -1
  20. package/lib/{browser/USE_SERVER_BUNDLE-ce31724e.cjs → node/USE_SERVER_BUNDLE-d6552b77.cjs} +1 -1
  21. package/lib/node/{bundle-8d3cab60.js → bundle-1280dc1a.js} +257 -245
  22. package/lib/node/{bundle-0fc157c8.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-026b8026.cjs +0 -21
  51. package/lib/browser/bundle-9744b895.cjs +0 -169
  52. package/lib/edge/USE_CLIENT_BUNDLE-9b110136.cjs +0 -21
  53. package/lib/edge/bundle-f1760904.cjs +0 -189
  54. package/lib/node/USE_CLIENT_BUNDLE-f9ebade4.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-f8067984.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() {
@@ -310,10 +313,8 @@ function evaluate({
310
313
  isExpression: a = !0,
311
314
  enableCache: s
312
315
  }) {
313
- if (e === "") {
314
- logger.warn("Skipping evaluation of empty code block.");
316
+ if (e === "")
315
317
  return;
316
- }
317
318
  const c = {
318
319
  code: parseCode(e, {
319
320
  isExpression: a
@@ -326,19 +327,19 @@ function evaluate({
326
327
  localState: n
327
328
  };
328
329
  if (s) {
329
- const u = EvalCache.getCacheKey(c), g = EvalCache.getCachedValue(u);
330
- if (g)
331
- return g.value;
330
+ const d = EvalCache.getCacheKey(c), f = EvalCache.getCachedValue(d);
331
+ if (f)
332
+ return f.value;
332
333
  }
333
334
  try {
334
- const u = chooseBrowserOrServerEval(c);
335
+ const d = chooseBrowserOrServerEval(c);
335
336
  if (s) {
336
- const g = EvalCache.getCacheKey(c);
337
- EvalCache.setCachedValue(g, u);
337
+ const f = EvalCache.getCacheKey(c);
338
+ EvalCache.setCachedValue(f, d);
338
339
  }
339
- return u;
340
- } catch (u) {
341
- logger.error("Failed code evaluation: " + u.message, {
340
+ return d;
341
+ } catch (d) {
342
+ logger.error("Failed code evaluation: " + d.message, {
342
343
  code: e
343
344
  });
344
345
  return;
@@ -366,7 +367,7 @@ const evaluateBindings = ({
366
367
  }
367
368
  };
368
369
  for (const s in e.bindings) {
369
- const c = e.bindings[s], u = evaluate({
370
+ const c = e.bindings[s], d = evaluate({
370
371
  code: c,
371
372
  localState: n,
372
373
  rootState: o,
@@ -374,7 +375,7 @@ const evaluateBindings = ({
374
375
  context: t,
375
376
  enableCache: !0
376
377
  });
377
- set(a, s, u);
378
+ set(a, s, d);
378
379
  }
379
380
  return a;
380
381
  };
@@ -429,6 +430,7 @@ function mapStyleObjToStrIfNeeded(e) {
429
430
  case "svelte":
430
431
  case "vue":
431
432
  case "solid":
433
+ case "angular":
432
434
  return convertStyleMapToCSSArray(e).join(" ");
433
435
  case "qwik":
434
436
  case "reactNative":
@@ -480,20 +482,20 @@ const getComponent = ({
480
482
  if (!Array.isArray(r))
481
483
  return;
482
484
  const i = n.collection.split(".").pop(), a = n.itemName || (i ? i + "Item" : "item");
483
- return r.map((c, u) => ({
485
+ return r.map((c, d) => ({
484
486
  context: {
485
487
  ...t,
486
488
  localState: {
487
489
  ...t.localState,
488
- $index: u,
490
+ $index: d,
489
491
  $item: c,
490
492
  [a]: c,
491
- [`$${a}Index`]: u
493
+ [`$${a}Index`]: d
492
494
  }
493
495
  },
494
496
  block: o
495
497
  }));
496
- }, 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 = {
497
499
  small: {
498
500
  min: 320,
499
501
  default: 321,
@@ -598,7 +600,7 @@ function BlockStyles(e) {
598
600
  });
599
601
  return checkIsDefined(r.hide) ? !r.hide : checkIsDefined(r.show) ? r.show : !0;
600
602
  }, n = function() {
601
- var p, S, C;
603
+ var m, h, y;
602
604
  const r = getProcessedBlock({
603
605
  block: e.block,
604
606
  localState: e.context.localState,
@@ -607,47 +609,47 @@ function BlockStyles(e) {
607
609
  context: e.context.context,
608
610
  shouldEvaluateBindings: !0
609
611
  }), i = r.responsiveStyles, a = e.context.content, s = getSizesForBreakpoints(
610
- ((p = a == null ? void 0 : a.meta) == null ? void 0 : p.breakpoints) || {}
611
- ), c = i == null ? void 0 : i.large, u = i == null ? void 0 : i.medium, g = i == null ? void 0 : i.small, d = r.id;
612
- 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)
613
615
  return "";
614
- const f = c ? createCssClass({
615
- className: d,
616
+ const u = c ? createCssClass({
617
+ className: l,
616
618
  styles: c
617
- }) : "", h = u ? createCssClass({
618
- className: d,
619
- styles: u,
619
+ }) : "", g = d ? createCssClass({
620
+ className: l,
621
+ styles: d,
620
622
  mediaQuery: getMaxWidthQueryForSize(
621
623
  "medium",
622
624
  s
623
625
  )
624
- }) : "", m = g ? createCssClass({
625
- className: d,
626
- styles: g,
626
+ }) : "", b = f ? createCssClass({
627
+ className: l,
628
+ styles: f,
627
629
  mediaQuery: getMaxWidthQueryForSize(
628
630
  "small",
629
631
  s
630
632
  )
631
- }) : "", l = r.animations && r.animations.find((y) => y.trigger === "hover");
632
- let b = "";
633
- if (l) {
634
- const y = ((C = (S = l.steps) == null ? void 0 : S[1]) == null ? void 0 : C.styles) || {};
635
- b = createCssClass({
636
- 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`,
637
639
  styles: {
638
- ...y,
639
- transition: `all ${l.duration}s ${camelCaseToKebabCase(
640
- l.easing
640
+ ...S,
641
+ transition: `all ${p.duration}s ${camelCaseToKebabCase(
642
+ p.easing
641
643
  )}`,
642
- transitionDelay: l.delay ? `${l.delay}s` : "0s"
644
+ transitionDelay: p.delay ? `${p.delay}s` : "0s"
643
645
  }
644
646
  }) || "";
645
647
  }
646
648
  return [
647
- f,
648
- h,
649
- m,
650
- b
649
+ u,
650
+ g,
651
+ b,
652
+ v
651
653
  ].join(" ");
652
654
  };
653
655
  return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { id: "builderio-block", styles: n() }) }) : null });
@@ -786,7 +788,7 @@ function RepeatedBlock(e) {
786
788
  );
787
789
  }
788
790
  function Block(e) {
789
- var c, u, g;
791
+ var c, d, f;
790
792
  const t = function() {
791
793
  return getComponent({
792
794
  block: e.block,
@@ -799,8 +801,8 @@ function Block(e) {
799
801
  context: e.context
800
802
  });
801
803
  }, o = function() {
802
- var f;
803
- 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({
804
806
  block: e.block,
805
807
  localState: e.context.localState,
806
808
  rootState: e.context.rootState,
@@ -809,29 +811,29 @@ function Block(e) {
809
811
  shouldEvaluateBindings: !0
810
812
  });
811
813
  }, r = function() {
812
- var h;
813
- 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";
814
816
  }, i = function() {
815
- var m, l;
816
- if ((m = e.block.repeat) != null && m.collection)
817
- return !!((l = n()) != null && l.length);
818
- const f = "hide" in o() ? o().hide : !1;
819
- 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;
820
822
  }, a = function() {
821
- var h;
822
- return !((h = t()) != null && h.component) && !n() ? o().children ?? [] : [];
823
+ var g;
824
+ return !((g = t()) != null && g.component) && !n() ? o().children ?? [] : [];
823
825
  }, s = function() {
824
- var f, h, m, l, b, p, S, C, y, v;
826
+ var u, g, b;
825
827
  return {
826
828
  blockChildren: o().children ?? [],
827
- componentRef: (f = t()) == null ? void 0 : f.component,
829
+ componentRef: (u = t()) == null ? void 0 : u.component,
828
830
  componentOptions: {
829
831
  ...getBlockComponentOptions(o()),
830
832
  builderContext: e.context,
831
- ...((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()) ? {
832
834
  builderLinkComponent: e.linkComponent
833
835
  } : {},
834
- ...((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()) ? {
835
837
  builderComponents: e.registeredComponents
836
838
  } : {}
837
839
  },
@@ -839,8 +841,8 @@ function Block(e) {
839
841
  linkComponent: e.linkComponent,
840
842
  registeredComponents: e.registeredComponents,
841
843
  builderBlock: o(),
842
- includeBlockProps: ((y = t()) == null ? void 0 : y.noWrap) === !0,
843
- isInteractive: !((v = t()) != null && v.isRSC)
844
+ includeBlockProps: ((g = t()) == null ? void 0 : g.noWrap) === !0,
845
+ isInteractive: !((b = t()) != null && b.isRSC)
844
846
  };
845
847
  };
846
848
  return /* @__PURE__ */ jsx(Fragment, { children: i() ? /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -858,15 +860,15 @@ function Block(e) {
858
860
  includeBlockProps: s().includeBlockProps,
859
861
  isInteractive: s().isInteractive
860
862
  }
861
- ) }) : /* @__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(
862
864
  RepeatedBlock,
863
865
  {
864
- repeatContext: d.context,
865
- block: d.block,
866
+ repeatContext: l.context,
867
+ block: l.block,
866
868
  registeredComponents: e.registeredComponents,
867
869
  linkComponent: e.linkComponent
868
870
  },
869
- f
871
+ u
870
872
  )) }) : /* @__PURE__ */ jsxs(
871
873
  BlockWrapper,
872
874
  {
@@ -889,15 +891,15 @@ function Block(e) {
889
891
  isInteractive: s().isInteractive
890
892
  }
891
893
  ),
892
- (u = a()) == null ? void 0 : u.map((d) => /* @__PURE__ */ jsx(
894
+ (d = a()) == null ? void 0 : d.map((l) => /* @__PURE__ */ jsx(
893
895
  Block,
894
896
  {
895
- block: d,
897
+ block: l,
896
898
  registeredComponents: e.registeredComponents,
897
899
  linkComponent: e.linkComponent,
898
900
  context: e.context
899
901
  },
900
- d.id
902
+ l.id
901
903
  ))
902
904
  ]
903
905
  }
@@ -928,67 +930,70 @@ function Blocks(e) {
928
930
  }
929
931
  );
930
932
  }
933
+ const getColumnsClass = (e) => `builder-columns ${e}-breakpoints`;
931
934
  function Columns(e) {
932
- var h;
933
- const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet", r = function(l) {
934
- var b;
935
- return ((b = n[l]) == null ? void 0 : b.width) || 100 / n.length;
936
- }, i = function(l) {
937
- const b = t * (n.length - 1) / n.length;
938
- return `calc(${r(l)}% - ${b}px)`;
939
- }, a = function({
940
- stackedStyle: l,
941
- desktopStyle: b
942
- }) {
943
- 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)`;
944
944
  }, s = function({
945
- stackedStyle: l,
946
- desktopStyle: b
945
+ stackedStyle: h,
946
+ desktopStyle: y
947
+ }) {
948
+ return o === "tablet" ? h : y;
949
+ }, c = function({
950
+ stackedStyle: h,
951
+ desktopStyle: y
947
952
  }) {
948
- return o === "never" ? b : l;
949
- }, 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() {
950
955
  return {
951
- "--flex-dir": c,
952
- "--flex-dir-tablet": a({
953
- stackedStyle: c,
956
+ "--flex-dir": d,
957
+ "--flex-dir-tablet": s({
958
+ stackedStyle: d,
954
959
  desktopStyle: "row"
955
960
  })
956
961
  };
957
- }, g = function(l) {
958
- 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;
959
964
  return {
960
965
  ...{
961
966
  display: "flex",
962
967
  flexDirection: "column",
963
968
  alignItems: "stretch"
964
969
  },
965
- width: p,
966
- ["marginLeft"]: S,
967
- "--column-width-mobile": s({
968
- stackedStyle: C,
969
- desktopStyle: p
970
- }),
971
- "--column-margin-left-mobile": s({
972
- stackedStyle: y,
970
+ width: S,
971
+ ["marginLeft"]: C,
972
+ "--column-width-mobile": c({
973
+ stackedStyle: I,
973
974
  desktopStyle: S
974
975
  }),
975
- "--column-width-tablet": a({
976
- stackedStyle: C,
977
- desktopStyle: p
976
+ "--column-margin-left-mobile": c({
977
+ stackedStyle: x,
978
+ desktopStyle: C
978
979
  }),
979
- "--column-margin-left-tablet": a({
980
- stackedStyle: y,
980
+ "--column-width-tablet": s({
981
+ stackedStyle: I,
981
982
  desktopStyle: S
983
+ }),
984
+ "--column-margin-left-tablet": s({
985
+ stackedStyle: x,
986
+ desktopStyle: C
982
987
  })
983
988
  };
984
- }, d = function(l) {
985
- var p, S;
989
+ }, u = function(h) {
990
+ var S, C;
986
991
  return getSizesForBreakpoints(
987
- ((S = (p = e.builderContext.content) == null ? void 0 : p.meta) == null ? void 0 : S.breakpoints) || {}
988
- )[l].max;
989
- }, f = function() {
992
+ ((C = (S = e.builderContext.content) == null ? void 0 : S.meta) == null ? void 0 : C.breakpoints) || {}
993
+ )[h].max;
994
+ }, g = function() {
990
995
  return `
991
- @media (max-width: ${d("medium")}px) {
996
+ @media (max-width: ${u("medium")}px) {
992
997
  .${e.builderBlock.id}-breakpoints {
993
998
  flex-direction: var(--flex-dir-tablet);
994
999
  align-items: stretch;
@@ -1000,7 +1005,7 @@ function Columns(e) {
1000
1005
  }
1001
1006
  }
1002
1007
 
1003
- @media (max-width: ${d("small")}px) {
1008
+ @media (max-width: ${u("small")}px) {
1004
1009
  .${e.builderBlock.id}-breakpoints {
1005
1010
  flex-direction: var(--flex-dir);
1006
1011
  align-items: stretch;
@@ -1012,31 +1017,33 @@ function Columns(e) {
1012
1017
  }
1013
1018
  },
1014
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
+ };
1015
1028
  };
1016
1029
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1017
1030
  /* @__PURE__ */ jsxs(
1018
1031
  "div",
1019
1032
  {
1020
- className: `builder-columns ${e.builderBlock.id}-breakpoints div-664216e4`,
1021
- style: u(),
1033
+ className: getColumnsClass((p = e.builderBlock) == null ? void 0 : p.id) + " div-2651dce4",
1034
+ style: f(),
1022
1035
  children: [
1023
- /* @__PURE__ */ jsx(InlinedStyles, { id: "builderio-columns", styles: f() }),
1024
- (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(
1025
1038
  DynamicRenderer,
1026
1039
  {
1027
- TagName: m.link ? e.builderLinkComponent || "a" : "div",
1040
+ TagName: r(m),
1028
1041
  actionAttributes: {},
1029
- attributes: {
1030
- ...m.link ? {
1031
- href: m.link
1032
- } : {},
1033
- [getClassPropName()]: "builder-column",
1034
- style: mapStyleObjToStrIfNeeded(g(l))
1035
- },
1042
+ attributes: b(m, h),
1036
1043
  children: /* @__PURE__ */ jsx(
1037
1044
  Blocks,
1038
1045
  {
1039
- path: `component.options.columns.${l}.blocks`,
1046
+ path: `component.options.columns.${h}.blocks`,
1040
1047
  parent: e.builderBlock.id,
1041
1048
  styleProp: {
1042
1049
  flexGrow: "1"
@@ -1048,12 +1055,12 @@ function Columns(e) {
1048
1055
  }
1049
1056
  )
1050
1057
  },
1051
- l
1058
+ h
1052
1059
  ))
1053
1060
  ]
1054
1061
  }
1055
1062
  ),
1056
- /* @__PURE__ */ jsx("style", { children: `.div-664216e4 {
1063
+ /* @__PURE__ */ jsx("style", { children: `.div-2651dce4 {
1057
1064
  display: flex;
1058
1065
  line-height: normal;
1059
1066
  }` })
@@ -1485,15 +1492,15 @@ const getTopLevelDomain = (e) => {
1485
1492
  onChange: (e) => {
1486
1493
  e.delete("srcset"), e.delete("noWebp");
1487
1494
  function n(a, s = 6e4) {
1488
- return new Promise((c, u) => {
1489
- const g = document.createElement("img");
1490
- let d = !1;
1491
- g.onload = () => {
1492
- d = !0, c(g);
1493
- }, g.addEventListener("error", (f) => {
1494
- console.warn("Image load failed", f.error), u(f.error);
1495
- }), g.src = a, setTimeout(() => {
1496
- 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"));
1497
1504
  }, s);
1498
1505
  });
1499
1506
  }
@@ -2080,40 +2087,40 @@ const DEFAULT_API_VERSION = "v3", BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUIL
2080
2087
  enrich: a,
2081
2088
  locale: s,
2082
2089
  apiVersion: c = DEFAULT_API_VERSION,
2083
- fields: u,
2084
- omit: g,
2085
- offset: d,
2086
- cacheSeconds: f,
2087
- staleCacheSeconds: h,
2088
- sort: m,
2089
- includeUnpublished: l
2090
+ fields: d,
2091
+ omit: f,
2092
+ offset: l,
2093
+ cacheSeconds: u,
2094
+ staleCacheSeconds: g,
2095
+ sort: b,
2096
+ includeUnpublished: p
2090
2097
  } = e;
2091
2098
  if (!i)
2092
2099
  throw new Error("Missing API key");
2093
2100
  if (!["v3"].includes(c))
2094
2101
  throw new Error(`Invalid apiVersion: expected 'v3', received '${c}'`);
2095
- const b = t !== 1, p = new URL(`https://cdn.builder.io/api/${c}/content/${r}`);
2096
- 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) {
2097
- const y = flatten({
2098
- 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
2099
2106
  });
2100
- for (const v in y)
2101
- p.searchParams.set(v, JSON.stringify(y[v]));
2107
+ for (const C in S)
2108
+ m.searchParams.set(C, JSON.stringify(S[C]));
2102
2109
  }
2103
- const S = {
2110
+ const h = {
2104
2111
  ...getBuilderSearchParamsFromWindow(),
2105
2112
  ...normalizeSearchParams(e.options || {})
2106
- }, C = flatten(S);
2107
- for (const y in C)
2108
- p.searchParams.set(y, String(C[y]));
2109
- if (n && p.searchParams.set("userAttributes", JSON.stringify(n)), o) {
2110
- 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({
2111
2118
  query: o
2112
2119
  });
2113
- for (const v in y)
2114
- p.searchParams.set(v, JSON.stringify(y[v]));
2120
+ for (const C in S)
2121
+ m.searchParams.set(C, JSON.stringify(S[C]));
2115
2122
  }
2116
- return p;
2123
+ return m;
2117
2124
  }, checkContentHasResults = (e) => "results" in e;
2118
2125
  async function fetchOneEntry(e) {
2119
2126
  const t = await fetchEntries({
@@ -2355,7 +2362,7 @@ function isFromTrustedHost(e, t) {
2355
2362
  const n = new URL(t.origin), o = n.hostname;
2356
2363
  return (e || DEFAULT_TRUSTED_HOSTS).findIndex((r) => r.startsWith("*.") ? o.endsWith(r.slice(1)) : r === o) > -1;
2357
2364
  }
2358
- const SDK_VERSION = "0.14.16", registry = {};
2365
+ const SDK_VERSION = "0.14.19", registry = {};
2359
2366
  function register(e, t) {
2360
2367
  let n = registry[e];
2361
2368
  if (n || (n = registry[e] = []), n.push(t), isBrowser()) {
@@ -2425,33 +2432,33 @@ const setupBrowserForEditing = (e = {}) => {
2425
2432
  if (r != null && r.type)
2426
2433
  switch (r.type) {
2427
2434
  case "builder.evaluate": {
2428
- const s = r.data.text, c = r.data.arguments || [], u = r.data.id, g = new Function(s);
2429
- 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;
2430
2437
  try {
2431
- d = g.apply(null, c);
2432
- } catch (h) {
2433
- f = h;
2438
+ l = f.apply(null, c);
2439
+ } catch (g) {
2440
+ u = g;
2434
2441
  }
2435
- f ? (i = window.parent) == null || i.postMessage({
2442
+ u ? (i = window.parent) == null || i.postMessage({
2436
2443
  type: "builder.evaluateError",
2437
2444
  data: {
2438
- id: u,
2439
- error: f.message
2445
+ id: d,
2446
+ error: u.message
2440
2447
  }
2441
- }, "*") : d && typeof d.then == "function" ? d.then((h) => {
2442
- var m;
2443
- (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({
2444
2451
  type: "builder.evaluateResult",
2445
2452
  data: {
2446
- id: u,
2447
- result: h
2453
+ id: d,
2454
+ result: g
2448
2455
  }
2449
2456
  }, "*");
2450
2457
  }).catch(console.error) : (a = window.parent) == null || a.postMessage({
2451
2458
  type: "builder.evaluateResult",
2452
2459
  data: {
2453
- result: d,
2454
- id: u
2460
+ result: l,
2461
+ id: d
2455
2462
  }
2456
2463
  }, "*");
2457
2464
  break;
@@ -2554,7 +2561,7 @@ font-weight: ${a};
2554
2561
  text-align: inherit;
2555
2562
  font-family: inherit;
2556
2563
  }
2557
- `, getDefaultStyles = (e) => e ? "" : DEFAULT_STYLES;
2564
+ `, getDefaultStyles = (e) => e ? "" : DEFAULT_STYLES, getWrapperClassName = (e) => `variant-${e}`;
2558
2565
  function ContentStyles(e) {
2559
2566
  const t = `
2560
2567
  ${getCss({
@@ -2597,7 +2604,7 @@ const getRootStateInitialValue = ({
2597
2604
  meta: e == null ? void 0 : e.meta
2598
2605
  } : void 0;
2599
2606
  function ContentComponent(e) {
2600
- var r, i, a, s, c, u, g, d, f;
2607
+ var r, i, a, s, c, d, f, l, u;
2601
2608
  const t = getUpdateVariantVisibilityScript({
2602
2609
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
2603
2610
  variationId: (r = e.content) == null ? void 0 : r.testVariationId,
@@ -2607,11 +2614,11 @@ function ContentComponent(e) {
2607
2614
  ...getDefaultRegisteredComponents(),
2608
2615
  ...e.customComponents || []
2609
2616
  ].reduce(
2610
- (h, { component: m, ...l }) => ({
2611
- ...h,
2612
- [l.name]: {
2613
- component: m,
2614
- ...serializeComponentInfo(l)
2617
+ (g, { component: b, ...p }) => ({
2618
+ ...g,
2619
+ [p.name]: {
2620
+ component: b,
2621
+ ...serializeComponentInfo(p)
2615
2622
  }
2616
2623
  }),
2617
2624
  {}
@@ -2634,9 +2641,9 @@ function ContentComponent(e) {
2634
2641
  ...getDefaultRegisteredComponents(),
2635
2642
  ...e.customComponents || []
2636
2643
  ].reduce(
2637
- (h, { component: m, ...l }) => ({
2638
- ...h,
2639
- [l.name]: serializeComponentInfo(l)
2644
+ (g, { component: b, ...p }) => ({
2645
+ ...g,
2646
+ [p.name]: serializeComponentInfo(p)
2640
2647
  }),
2641
2648
  {}
2642
2649
  ),
@@ -2675,13 +2682,13 @@ function ContentComponent(e) {
2675
2682
  isNestedRender: e.isNestedRender,
2676
2683
  contentId: (a = o.content) == null ? void 0 : a.id,
2677
2684
  cssCode: (c = (s = o.content) == null ? void 0 : s.data) == null ? void 0 : c.cssCode,
2678
- 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
2679
2686
  }
2680
2687
  ),
2681
2688
  /* @__PURE__ */ jsx(
2682
2689
  Blocks,
2683
2690
  {
2684
- 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,
2685
2692
  context: o,
2686
2693
  registeredComponents: n,
2687
2694
  linkComponent: e.linkComponent
@@ -2812,20 +2819,24 @@ const fetchSymbolContent = async ({
2812
2819
  });
2813
2820
  };
2814
2821
  async function Symbol$1(e) {
2815
- var o, r, i, a, s;
2822
+ var i, a, s, c, d;
2816
2823
  const t = function() {
2817
- var u, g;
2824
+ return "div";
2825
+ }, n = function() {
2826
+ return "div";
2827
+ }, o = function() {
2828
+ var l, u;
2818
2829
  return [
2819
2830
  e.attributes[getClassPropName()],
2820
2831
  "builder-symbol",
2821
- (u = e.symbol) != null && u.inline ? "builder-inline-symbol" : void 0,
2822
- (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
2823
2834
  ].filter(Boolean).join(" ");
2824
- }, n = ((o = e.symbol) == null ? void 0 : o.content) || await fetchSymbolContent({
2835
+ }, r = ((i = e.symbol) == null ? void 0 : i.content) || await fetchSymbolContent({
2825
2836
  symbol: e.symbol,
2826
2837
  builderContextValue: e.builderContext
2827
2838
  });
2828
- return /* @__PURE__ */ jsx("div", { ...e.attributes, className: t(), children: /* @__PURE__ */ jsx(
2839
+ return /* @__PURE__ */ jsx("div", { ...e.attributes, className: o(), children: /* @__PURE__ */ jsx(
2829
2840
  ContentVariants,
2830
2841
  {
2831
2842
  isNestedRender: !0,
@@ -2833,19 +2844,19 @@ async function Symbol$1(e) {
2833
2844
  apiKey: e.builderContext.apiKey,
2834
2845
  context: {
2835
2846
  ...e.builderContext.context,
2836
- symbolId: (r = e.builderBlock) == null ? void 0 : r.id
2847
+ symbolId: (a = e.builderBlock) == null ? void 0 : a.id
2837
2848
  },
2838
2849
  customComponents: Object.values(e.builderComponents),
2839
2850
  data: {
2840
- ...(i = e.symbol) == null ? void 0 : i.data,
2851
+ ...(s = e.symbol) == null ? void 0 : s.data,
2841
2852
  ...e.builderContext.localState,
2842
- ...(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
2843
2854
  },
2844
- model: (s = e.symbol) == null ? void 0 : s.model,
2845
- content: n,
2855
+ model: (d = e.symbol) == null ? void 0 : d.model,
2856
+ content: r,
2846
2857
  linkComponent: e.builderLinkComponent,
2847
- blocksWrapper: "div",
2848
- contentWrapper: "div"
2858
+ blocksWrapper: t(),
2859
+ contentWrapper: n()
2849
2860
  }
2850
2861
  ) });
2851
2862
  }
@@ -2881,13 +2892,14 @@ const fetchBuilderProps = async (e) => {
2881
2892
  };
2882
2893
  };
2883
2894
  export {
2884
- track as A,
2895
+ getBuilderSearchParams as A,
2885
2896
  Blocks as B,
2886
2897
  Columns as C,
2887
- subscribeToEditor as D,
2888
- fetchBuilderProps as E,
2889
- _processContentResult as F,
2890
- fetchEntries as G,
2898
+ track as D,
2899
+ subscribeToEditor as E,
2900
+ fetchBuilderProps as F,
2901
+ _processContentResult as G,
2902
+ fetchEntries as H,
2891
2903
  Symbol$1 as S,
2892
2904
  Text as T,
2893
2905
  _track as _,
@@ -2901,20 +2913,20 @@ export {
2901
2913
  getDefaultCanTrack as h,
2902
2914
  isEmptyElement as i,
2903
2915
  isPreviewing as j,
2904
- createEditorListener as k,
2916
+ getWrapperClassName as k,
2905
2917
  logger as l,
2906
- evaluate as m,
2907
- getInteractionPropertiesForEvent as n,
2908
- fetch$1 as o,
2909
- fastClone as p,
2910
- createRegisterComponentMessage as q,
2918
+ createEditorListener as m,
2919
+ evaluate as n,
2920
+ getInteractionPropertiesForEvent as o,
2921
+ fetch$1 as p,
2922
+ fastClone as q,
2911
2923
  registerInsertMenu as r,
2912
2924
  setupBrowserForEditing as s,
2913
2925
  triggerAnimation as t,
2914
- fetchOneEntry as u,
2915
- init as v,
2916
- ContentVariants as w,
2917
- register as x,
2918
- setEditorSettings as y,
2919
- 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
2920
2932
  };