@builder.io/sdk-react 0.12.2 → 0.12.4

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 (37) hide show
  1. package/lib/browser/index.cjs +31 -33
  2. package/lib/browser/index.mjs +707 -650
  3. package/lib/browser/{server-entry-f978b3a5.js → server-entry-0e4f0637.js} +1 -2
  4. package/lib/browser/{server-entry-df9eba5d.cjs → server-entry-bcb725be.cjs} +1 -1
  5. package/lib/browser/server-entry.cjs +1 -1
  6. package/lib/browser/server-entry.mjs +1 -1
  7. package/lib/edge/index.cjs +41 -43
  8. package/lib/edge/index.mjs +1293 -1236
  9. package/lib/edge/{server-entry-f978b3a5.js → server-entry-0e4f0637.js} +1 -2
  10. package/lib/{node/server-entry-df9eba5d.cjs → edge/server-entry-bcb725be.cjs} +1 -1
  11. package/lib/edge/server-entry.cjs +1 -1
  12. package/lib/edge/server-entry.mjs +1 -1
  13. package/lib/node/index.cjs +10 -12
  14. package/lib/node/index.mjs +369 -312
  15. package/lib/node/{server-entry-46908b1b.js → server-entry-9aa733e8.js} +1 -2
  16. package/lib/{edge/server-entry-df9eba5d.cjs → node/server-entry-bcb725be.cjs} +1 -1
  17. package/lib/node/server-entry.cjs +1 -1
  18. package/lib/node/server-entry.mjs +1 -1
  19. package/package.json +1 -1
  20. package/types/blocks/button/button.types.d.ts +2 -1
  21. package/types/blocks/columns/columns.types.d.ts +3 -3
  22. package/types/blocks/symbol/symbol.types.d.ts +2 -2
  23. package/types/components/block/block.d.ts +1 -0
  24. package/types/components/block/components/block-wrapper.d.ts +1 -0
  25. package/types/components/block/components/component-ref/component-ref.helpers.d.ts +4 -1
  26. package/types/components/block/components/repeated-block.d.ts +3 -5
  27. package/types/components/blocks/blocks.types.d.ts +1 -0
  28. package/types/components/content-variants/content-variants.types.d.ts +6 -2
  29. package/types/constants/sdk-version.d.ts +1 -1
  30. package/types/functions/get-block-properties.d.ts +5 -1
  31. package/types/functions/get-class-prop-name.d.ts +1 -0
  32. package/types/functions/get-style.d.ts +12 -0
  33. package/types/functions/transform-block-properties.d.ts +7 -5
  34. package/types/functions/transform-style-property.d.ts +7 -0
  35. package/types/helpers/omit.d.ts +1 -0
  36. package/types/types/builder-block.d.ts +1 -0
  37. package/types/types/builder-props.d.ts +3 -0
@@ -1,33 +1,46 @@
1
1
  "use client";
2
- import { jsxs, Fragment, jsx } from "react/jsx-runtime";
3
- import { createContext, useState, useContext, createElement, useRef, useEffect } from "react";
4
- import { i as isEditing, j as isBrowser, k as getUserAttributes, l as fastClone, m as logger, n as checkIsDefined, T as TARGET, r as register, o as getDefaultCanTrack, p as _track, a as isPreviewing, c as createRegisterComponentMessage, b as fetchOneEntry, q as fetch$1, u as components, v as serializeComponentInfo, w as handleABTestingSync } from "./server-entry-46908b1b.js";
5
- import { _ as H, h as K, f as z, g as q, e as Y, d as G, s as J, t as Q } from "./server-entry-46908b1b.js";
2
+ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
3
+ import { createContext, useState, useContext, useRef, useEffect, createElement } from "react";
4
+ import { T as TARGET, i as isEditing, j as isBrowser, k as getUserAttributes, l as fastClone, m as logger, n as checkIsDefined, r as register, o as getDefaultCanTrack, p as _track, a as isPreviewing, c as createRegisterComponentMessage, b as fetchOneEntry, q as fetch$1, u as components, v as serializeComponentInfo, w as handleABTestingSync } from "./server-entry-9aa733e8.js";
5
+ import { _ as H, h as K, f as z, g as q, e as Y, d as G, s as J, t as Q } from "./server-entry-9aa733e8.js";
6
6
  import { createRequire } from "node:module";
7
+ 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());
8
+ function DynamicRenderer(e) {
9
+ return /* @__PURE__ */ jsx(Fragment, { children: isEmptyElement(e.TagName) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ jsx(Fragment, { children: typeof e.TagName == "string" ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) }) });
10
+ }
11
+ const getClassPropName = () => {
12
+ switch (TARGET) {
13
+ case "react":
14
+ case "reactNative":
15
+ case "rsc":
16
+ return "className";
17
+ case "svelte":
18
+ case "vue":
19
+ case "solid":
20
+ case "qwik":
21
+ return "class";
22
+ }
23
+ };
7
24
  function Button(e) {
8
- return /* @__PURE__ */ jsxs(Fragment, { children: [
9
- e.link ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
10
- "a",
11
- {
12
- ...e.attributes,
13
- href: e.link,
14
- target: e.openLinkInNewTab ? "_blank" : void 0,
15
- role: "button",
16
- children: e.text
17
- }
18
- ) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
19
- "button",
20
- {
25
+ return /* @__PURE__ */ jsx(
26
+ DynamicRenderer,
27
+ {
28
+ TagName: e.link ? e.builderLinkComponent || "a" : "button",
29
+ attributes: {
21
30
  ...e.attributes,
22
- style: e.attributes.style,
23
- className: e.attributes.className + " button-fdf49de0",
24
- children: e.text
25
- }
26
- ) }),
27
- /* @__PURE__ */ jsx("style", { children: `.button-fdf49de0 {
28
- all: unset;
29
- }` })
30
- ] });
31
+ [getClassPropName()]: `${e.link ? "" : "builder-button"} ${e.attributes[getClassPropName()] || ""}`,
32
+ ...e.link ? {
33
+ href: e.link,
34
+ target: e.openLinkInNewTab ? "_blank" : void 0,
35
+ role: "link"
36
+ } : {
37
+ role: "button"
38
+ }
39
+ },
40
+ actionAttributes: {},
41
+ children: e.text
42
+ }
43
+ );
31
44
  }
32
45
  const builderContext = createContext({
33
46
  content: null,
@@ -82,13 +95,13 @@ const getFunctionArguments = ({
82
95
  rootSetState: r,
83
96
  rootState: a
84
97
  }) => {
85
- const c = getFunctionArguments({
98
+ const l = getFunctionArguments({
86
99
  builder: t,
87
100
  context: n,
88
101
  event: i,
89
102
  state: flattenState(a, o, r)
90
103
  });
91
- return new Function(...c.map(([s]) => s), e)(...c.map(([, s]) => s));
104
+ return new Function(...l.map(([c]) => c), e)(...l.map(([, c]) => c));
92
105
  };
93
106
  function flattenState(e, t, n) {
94
107
  if (e === t)
@@ -175,37 +188,37 @@ output;
175
188
  rootSetState: r,
176
189
  rootState: a
177
190
  }) => {
178
- const c = fastClone({
191
+ const l = fastClone({
179
192
  ...a,
180
193
  ...o
181
- }), s = getFunctionArguments({
194
+ }), c = getFunctionArguments({
182
195
  builder: t,
183
196
  context: n,
184
197
  event: i,
185
- state: c
186
- }), l = getIsolateContext(), d = l.global;
198
+ state: l
199
+ }), s = getIsolateContext(), d = s.global;
187
200
  d.setSync("global", d.derefInto()), d.setSync("log", function(...f) {
188
201
  console.log(...f);
189
- }), d.setSync(BUILDER_SET_STATE_NAME, function(f, b) {
190
- set(a, f, b), r == null || r(a);
191
- }), s.forEach(([f, b]) => {
192
- const y = typeof b == "object" ? new ivm.Reference(
202
+ }), d.setSync(BUILDER_SET_STATE_NAME, function(f, h) {
203
+ set(a, f, h), r == null || r(a);
204
+ }), c.forEach(([f, h]) => {
205
+ const y = typeof h == "object" ? new ivm.Reference(
193
206
  // workaround: methods with default values for arguments is not being cloned over
194
207
  f === "builder" ? {
195
- ...b,
196
- getUserAttributes: () => b.getUserAttributes()
197
- } : b
208
+ ...h,
209
+ getUserAttributes: () => h.getUserAttributes()
210
+ } : h
198
211
  ) : null;
199
212
  d.setSync(getSyncValName(f), y);
200
213
  }), d.setSync(INJECTED_IVM_GLOBAL, ivm);
201
214
  const g = processCode({
202
215
  code: e,
203
- args: s
204
- }), S = l.evalSync(g);
216
+ args: c
217
+ }), x = s.evalSync(g);
205
218
  try {
206
- return JSON.parse(S);
219
+ return JSON.parse(x);
207
220
  } catch {
208
- return S;
221
+ return x;
209
222
  }
210
223
  }, chooseBrowserOrServerEval = (e) => isBrowser() ? runInBrowser(e) : runInNode(e);
211
224
  function evaluate({
@@ -221,7 +234,7 @@ function evaluate({
221
234
  logger.warn("Skipping evaluation of empty code block.");
222
235
  return;
223
236
  }
224
- const c = {
237
+ const l = {
225
238
  code: parseCode(e, {
226
239
  isExpression: a
227
240
  }),
@@ -233,9 +246,9 @@ function evaluate({
233
246
  localState: n
234
247
  };
235
248
  try {
236
- return chooseBrowserOrServerEval(c);
237
- } catch (s) {
238
- logger.error("Failed code evaluation: " + s.message, {
249
+ return chooseBrowserOrServerEval(l);
250
+ } catch (c) {
251
+ logger.error("Failed code evaluation: " + c.message, {
239
252
  code: e
240
253
  });
241
254
  return;
@@ -262,15 +275,15 @@ const evaluateBindings = ({
262
275
  ...r.actions
263
276
  }
264
277
  };
265
- for (const c in e.bindings) {
266
- const s = e.bindings[c], l = evaluate({
267
- code: s,
278
+ for (const l in e.bindings) {
279
+ const c = e.bindings[l], s = evaluate({
280
+ code: c,
268
281
  localState: n,
269
282
  rootState: i,
270
283
  rootSetState: o,
271
284
  context: t
272
285
  });
273
- set(a, c, l);
286
+ set(a, l, s);
274
287
  }
275
288
  return a;
276
289
  };
@@ -333,15 +346,15 @@ const getComponent = ({
333
346
  if (!Array.isArray(o))
334
347
  return;
335
348
  const r = n.collection.split(".").pop(), a = n.itemName || (r ? r + "Item" : "item");
336
- return o.map((s, l) => ({
349
+ return o.map((c, s) => ({
337
350
  context: {
338
351
  ...t,
339
352
  localState: {
340
353
  ...t.localState,
341
- $index: l,
342
- $item: s,
343
- [a]: s,
344
- [`$${a}Index`]: l
354
+ $index: s,
355
+ $item: c,
356
+ [a]: c,
357
+ [`$${a}Index`]: s
345
358
  }
346
359
  },
347
360
  block: i
@@ -420,7 +433,7 @@ function BlockStyles(e) {
420
433
  return checkIsDefined(i.hide) ? !i.hide : checkIsDefined(i.show) ? i.show : !0;
421
434
  }
422
435
  function n() {
423
- var b;
436
+ var h;
424
437
  const i = getProcessedBlock({
425
438
  block: e.block,
426
439
  localState: e.context.localState,
@@ -429,29 +442,29 @@ function BlockStyles(e) {
429
442
  context: e.context.context,
430
443
  shouldEvaluateBindings: !0
431
444
  }), o = i.responsiveStyles, r = e.context.content, a = getSizesForBreakpoints(
432
- ((b = r == null ? void 0 : r.meta) == null ? void 0 : b.breakpoints) || {}
433
- ), c = o == null ? void 0 : o.large, s = o == null ? void 0 : o.medium, l = o == null ? void 0 : o.small, d = i.id;
445
+ ((h = r == null ? void 0 : r.meta) == null ? void 0 : h.breakpoints) || {}
446
+ ), l = o == null ? void 0 : o.large, c = o == null ? void 0 : o.medium, s = o == null ? void 0 : o.small, d = i.id;
434
447
  if (!d)
435
448
  return "";
436
- const g = c ? createCssClass({
449
+ const g = l ? createCssClass({
437
450
  className: d,
438
- styles: c
439
- }) : "", S = s ? createCssClass({
451
+ styles: l
452
+ }) : "", x = c ? createCssClass({
440
453
  className: d,
441
- styles: s,
454
+ styles: c,
442
455
  mediaQuery: getMaxWidthQueryForSize(
443
456
  "medium",
444
457
  a
445
458
  )
446
- }) : "", f = l ? createCssClass({
459
+ }) : "", f = s ? createCssClass({
447
460
  className: d,
448
- styles: l,
461
+ styles: s,
449
462
  mediaQuery: getMaxWidthQueryForSize(
450
463
  "small",
451
464
  a
452
465
  )
453
466
  }) : "";
454
- return [g, S, f].join(" ");
467
+ return [g, x, f].join(" ");
455
468
  }
456
469
  return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: n() }) }) : null });
457
470
  }
@@ -488,10 +501,36 @@ function getBlockActions(e) {
488
501
  }
489
502
  return t;
490
503
  }
504
+ function transformStyleProperty({
505
+ style: e
506
+ }) {
507
+ return e;
508
+ }
509
+ const getStyle = ({
510
+ block: e,
511
+ context: t
512
+ }) => mapStyleObjToStrIfNeeded(transformStyleProperty({
513
+ style: e.style || {},
514
+ context: t,
515
+ block: e
516
+ }));
517
+ function mapStyleObjToStrIfNeeded(e) {
518
+ switch (TARGET) {
519
+ case "svelte":
520
+ case "vue":
521
+ case "solid":
522
+ return convertStyleMapToCSSArray(e).join(" ");
523
+ case "qwik":
524
+ case "reactNative":
525
+ case "react":
526
+ case "rsc":
527
+ return e;
528
+ }
529
+ }
491
530
  function transformBlockProperties({
492
531
  properties: e
493
532
  }) {
494
- return e.className = e.class, delete e.class, e;
533
+ return e;
495
534
  }
496
535
  const extractRelevantRootBlockProperties = (e) => ({
497
536
  href: e.href
@@ -505,8 +544,11 @@ function getBlockProperties({
505
544
  ...extractRelevantRootBlockProperties(e),
506
545
  ...e.properties,
507
546
  "builder-id": e.id,
508
- style: e.style ? getStyleAttribute(e.style) : void 0,
509
- class: [e.id, "builder-block", e.class, (i = e.properties) == null ? void 0 : i.class].filter(Boolean).join(" ")
547
+ style: getStyle({
548
+ block: e,
549
+ context: t
550
+ }),
551
+ [getClassPropName()]: [e.id, "builder-block", e.class, (i = e.properties) == null ? void 0 : i.class].filter(Boolean).join(" ")
510
552
  };
511
553
  return transformBlockProperties({
512
554
  properties: n,
@@ -514,23 +556,6 @@ function getBlockProperties({
514
556
  block: e
515
557
  });
516
558
  }
517
- function getStyleAttribute(e) {
518
- switch (TARGET) {
519
- case "svelte":
520
- case "vue":
521
- case "solid":
522
- return convertStyleMapToCSSArray(e).join(" ");
523
- case "qwik":
524
- case "reactNative":
525
- case "react":
526
- case "rsc":
527
- return e;
528
- }
529
- }
530
- 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());
531
- function DynamicRenderer(e) {
532
- return /* @__PURE__ */ jsx(Fragment, { children: isEmptyElement(e.TagName) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ jsx(Fragment, { children: typeof e.TagName == "string" ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) }) });
533
- }
534
559
  function BlockWrapper(e) {
535
560
  return /* @__PURE__ */ jsx(
536
561
  DynamicRenderer,
@@ -583,7 +608,7 @@ const getWrapperProps = ({
583
608
  isInteractive: r,
584
609
  contextValue: a
585
610
  }) => {
586
- const c = {
611
+ const l = {
587
612
  ...e,
588
613
  /**
589
614
  * If `noWrap` is set to `true`, then the block's props/attributes are provided to the
@@ -602,7 +627,7 @@ const getWrapperProps = ({
602
627
  context: n,
603
628
  wrapperProps: e,
604
629
  includeBlockProps: o
605
- } : c;
630
+ } : l;
606
631
  };
607
632
  function ComponentRef(e) {
608
633
  var i;
@@ -617,6 +642,7 @@ function ComponentRef(e) {
617
642
  builderBlock: e.builderBlock,
618
643
  context: e.context,
619
644
  componentRef: e.componentRef,
645
+ linkComponent: e.linkComponent,
620
646
  includeBlockProps: e.includeBlockProps,
621
647
  isInteractive: e.isInteractive,
622
648
  contextValue: e.context
@@ -626,7 +652,8 @@ function ComponentRef(e) {
626
652
  {
627
653
  block: o,
628
654
  context: e.context,
629
- registeredComponents: e.registeredComponents
655
+ registeredComponents: e.registeredComponents,
656
+ linkComponent: e.linkComponent
630
657
  },
631
658
  o.id
632
659
  ))
@@ -640,12 +667,13 @@ function RepeatedBlock(e) {
640
667
  {
641
668
  block: e.block,
642
669
  context: t,
643
- registeredComponents: e.registeredComponents
670
+ registeredComponents: e.registeredComponents,
671
+ linkComponent: e.linkComponent
644
672
  }
645
673
  ) });
646
674
  }
647
675
  function Block(e) {
648
- var d, g, S;
676
+ var d, g, x;
649
677
  function t() {
650
678
  return getComponent({
651
679
  block: e.block,
@@ -671,7 +699,8 @@ function Block(e) {
671
699
  });
672
700
  }
673
701
  function o() {
674
- return e.block.tagName || "div";
702
+ var h;
703
+ return e.block.tagName === "a" || ((h = i().properties) == null ? void 0 : h.href) || i().href ? e.linkComponent || "a" : e.block.tagName || "div";
675
704
  }
676
705
  function r() {
677
706
  var y, I;
@@ -681,77 +710,86 @@ function Block(e) {
681
710
  return ("show" in i() ? i().show : !0) && !f;
682
711
  }
683
712
  function a() {
684
- var b, y;
685
- return !((b = t == null ? void 0 : t()) != null && b.component) && !n() ? (y = i().children) != null ? y : [] : [];
713
+ var h, y;
714
+ return !((h = t == null ? void 0 : t()) != null && h.component) && !n() ? (y = i().children) != null ? y : [] : [];
686
715
  }
687
- function c() {
688
- var f, b, y, I, E, v;
716
+ function l() {
717
+ var f, h, y, I, E, C, v, T, w;
689
718
  return {
690
719
  blockChildren: (f = i().children) != null ? f : [],
691
- componentRef: (b = t == null ? void 0 : t()) == null ? void 0 : b.component,
720
+ componentRef: (h = t == null ? void 0 : t()) == null ? void 0 : h.component,
692
721
  componentOptions: {
693
722
  ...getBlockComponentOptions(i()),
694
723
  builderContext: e.context,
695
- ...((y = t == null ? void 0 : t()) == null ? void 0 : y.name) === "Symbol" || ((I = t == null ? void 0 : t()) == null ? void 0 : I.name) === "Columns" ? {
724
+ ...((y = t == null ? void 0 : t()) == null ? void 0 : y.name) === "Core:Button" || ((I = t == null ? void 0 : t()) == null ? void 0 : I.name) === "Symbol" || ((E = t == null ? void 0 : t()) == null ? void 0 : E.name) === "Columns" ? {
725
+ builderLinkComponent: e.linkComponent
726
+ } : {},
727
+ ...((C = t == null ? void 0 : t()) == null ? void 0 : C.name) === "Symbol" || ((v = t == null ? void 0 : t()) == null ? void 0 : v.name) === "Columns" ? {
696
728
  builderComponents: e.registeredComponents
697
729
  } : {}
698
730
  },
699
- context: s,
731
+ context: c,
732
+ linkComponent: e.linkComponent,
700
733
  registeredComponents: e.registeredComponents,
701
734
  builderBlock: i(),
702
- includeBlockProps: ((E = t == null ? void 0 : t()) == null ? void 0 : E.noWrap) === !0,
703
- isInteractive: !((v = t == null ? void 0 : t()) != null && v.isRSC)
735
+ includeBlockProps: ((T = t == null ? void 0 : t()) == null ? void 0 : T.noWrap) === !0,
736
+ isInteractive: !((w = t == null ? void 0 : t()) != null && w.isRSC)
704
737
  };
705
738
  }
706
- const [s, l] = useState(() => e.context);
739
+ const [c, s] = useState(() => e.context);
707
740
  return /* @__PURE__ */ jsx(Fragment, { children: r() ? /* @__PURE__ */ jsxs(Fragment, { children: [
708
741
  /* @__PURE__ */ jsx(BlockStyles, { block: e.block, context: e.context }),
709
742
  (d = t == null ? void 0 : t()) != null && d.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
710
743
  ComponentRef,
711
744
  {
712
- componentRef: c().componentRef,
713
- componentOptions: c().componentOptions,
714
- blockChildren: c().blockChildren,
715
- context: c().context,
716
- registeredComponents: c().registeredComponents,
717
- builderBlock: c().builderBlock,
718
- includeBlockProps: c().includeBlockProps,
719
- isInteractive: c().isInteractive
745
+ componentRef: l().componentRef,
746
+ componentOptions: l().componentOptions,
747
+ blockChildren: l().blockChildren,
748
+ context: l().context,
749
+ registeredComponents: l().registeredComponents,
750
+ linkComponent: l().linkComponent,
751
+ builderBlock: l().builderBlock,
752
+ includeBlockProps: l().includeBlockProps,
753
+ isInteractive: l().isInteractive
720
754
  }
721
- ) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (S = n()) == null ? void 0 : S.map((f, b) => /* @__PURE__ */ jsx(
755
+ ) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (x = n()) == null ? void 0 : x.map((f, h) => /* @__PURE__ */ jsx(
722
756
  RepeatedBlock,
723
757
  {
724
758
  repeatContext: f.context,
725
759
  block: f.block,
726
- registeredComponents: e.registeredComponents
760
+ registeredComponents: e.registeredComponents,
761
+ linkComponent: e.linkComponent
727
762
  },
728
- b
763
+ h
729
764
  )) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
730
765
  BlockWrapper,
731
766
  {
732
767
  Wrapper: o(),
733
768
  block: i(),
734
769
  context: e.context,
770
+ linkComponent: e.linkComponent,
735
771
  children: [
736
772
  /* @__PURE__ */ jsx(
737
773
  ComponentRef,
738
774
  {
739
- componentRef: c().componentRef,
740
- componentOptions: c().componentOptions,
741
- blockChildren: c().blockChildren,
742
- context: c().context,
743
- registeredComponents: c().registeredComponents,
744
- builderBlock: c().builderBlock,
745
- includeBlockProps: c().includeBlockProps,
746
- isInteractive: c().isInteractive
775
+ componentRef: l().componentRef,
776
+ componentOptions: l().componentOptions,
777
+ blockChildren: l().blockChildren,
778
+ context: l().context,
779
+ registeredComponents: l().registeredComponents,
780
+ linkComponent: l().linkComponent,
781
+ builderBlock: l().builderBlock,
782
+ includeBlockProps: l().includeBlockProps,
783
+ isInteractive: l().isInteractive
747
784
  }
748
785
  ),
749
786
  (g = a()) == null ? void 0 : g.map((f) => /* @__PURE__ */ jsx(
750
787
  Block,
751
788
  {
752
789
  block: f,
753
- context: s,
754
- registeredComponents: e.registeredComponents
790
+ context: c,
791
+ registeredComponents: e.registeredComponents,
792
+ linkComponent: e.linkComponent
755
793
  },
756
794
  f.id
757
795
  ))
@@ -829,6 +867,7 @@ function Blocks(e) {
829
867
  Block,
830
868
  {
831
869
  block: a,
870
+ linkComponent: e.linkComponent,
832
871
  context: e.context || t,
833
872
  registeredComponents: e.registeredComponents || n.registeredComponents
834
873
  },
@@ -844,41 +883,46 @@ function Columns(e) {
844
883
  ), [i, o] = useState(() => e.columns || []), [r, a] = useState(
845
884
  () => e.stackColumnsAt || "tablet"
846
885
  );
847
- function c(v) {
848
- var C;
849
- return ((C = i[v]) == null ? void 0 : C.width) || 100 / i.length;
886
+ function l(C) {
887
+ var v;
888
+ return ((v = i[C]) == null ? void 0 : v.width) || 100 / i.length;
850
889
  }
851
- function s(v) {
852
- const C = t * (i.length - 1) / i.length;
853
- return `calc(${c(v)}% - ${C}px)`;
890
+ function c(C) {
891
+ const v = t * (i.length - 1) / i.length;
892
+ return `calc(${l(C)}% - ${v}px)`;
854
893
  }
855
- function l({
856
- stackedStyle: v,
857
- desktopStyle: C
894
+ function s({
895
+ stackedStyle: C,
896
+ desktopStyle: v
858
897
  }) {
859
- return r === "tablet" ? v : C;
898
+ return r === "tablet" ? C : v;
860
899
  }
861
900
  function d({
862
- stackedStyle: v,
863
- desktopStyle: C
901
+ stackedStyle: C,
902
+ desktopStyle: v
864
903
  }) {
865
- return r === "never" ? C : v;
904
+ return r === "never" ? v : C;
866
905
  }
867
- const [g, S] = useState(
906
+ const [g, x] = useState(
868
907
  () => e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column"
869
908
  );
870
909
  function f() {
871
910
  return {
872
911
  "--flex-dir": g,
873
- "--flex-dir-tablet": l({
912
+ "--flex-dir-tablet": s({
874
913
  stackedStyle: g,
875
914
  desktopStyle: "row"
876
915
  })
877
916
  };
878
917
  }
879
- function b(v) {
880
- const C = v === 0 ? 0 : t, T = s(v), w = `${C}px`, R = "100%", j = 0;
918
+ function h(C) {
919
+ const v = C === 0 ? 0 : t, T = c(C), w = `${v}px`, R = "100%", j = 0;
881
920
  return {
921
+ ...{
922
+ display: "flex",
923
+ flexDirection: "column",
924
+ alignItems: "stretch"
925
+ },
882
926
  width: T,
883
927
  ["marginLeft"]: w,
884
928
  "--column-width-mobile": d({
@@ -889,21 +933,21 @@ function Columns(e) {
889
933
  stackedStyle: j,
890
934
  desktopStyle: w
891
935
  }),
892
- "--column-width-tablet": l({
936
+ "--column-width-tablet": s({
893
937
  stackedStyle: R,
894
938
  desktopStyle: T
895
939
  }),
896
- "--column-margin-left-tablet": l({
940
+ "--column-margin-left-tablet": s({
897
941
  stackedStyle: j,
898
942
  desktopStyle: w
899
943
  })
900
944
  };
901
945
  }
902
- function y(v) {
946
+ function y(C) {
903
947
  var T, w;
904
948
  return getSizesForBreakpoints(
905
949
  ((w = (T = e.builderContext.content) == null ? void 0 : T.meta) == null ? void 0 : w.breakpoints) || {}
906
- )[v].max;
950
+ )[C].max;
907
951
  }
908
952
  function I() {
909
953
  return `
@@ -936,41 +980,45 @@ function Columns(e) {
936
980
  /* @__PURE__ */ jsxs(
937
981
  "div",
938
982
  {
939
- className: `builder-columns ${e.builderBlock.id}-breakpoints div-3c01d6ec`,
983
+ className: `builder-columns ${e.builderBlock.id}-breakpoints div-6f826264`,
940
984
  style: f(),
941
985
  children: [
942
986
  /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: I() }) }),
943
- (E = e.columns) == null ? void 0 : E.map((v, C) => /* @__PURE__ */ createElement(
944
- "div",
987
+ (E = e.columns) == null ? void 0 : E.map((C, v) => /* @__PURE__ */ jsx(
988
+ DynamicRenderer,
945
989
  {
946
- className: "builder-column div-3c01d6ec-2",
947
- style: b(C),
948
- key: C
990
+ TagName: C.link ? e.builderLinkComponent || "a" : "div",
991
+ actionAttributes: {},
992
+ attributes: {
993
+ ...C.link ? {
994
+ href: C.link
995
+ } : {},
996
+ [getClassPropName()]: "builder-column",
997
+ style: mapStyleObjToStrIfNeeded(h(v))
998
+ },
999
+ children: /* @__PURE__ */ jsx(
1000
+ Blocks,
1001
+ {
1002
+ path: `component.options.columns.${v}.blocks`,
1003
+ parent: e.builderBlock.id,
1004
+ styleProp: {
1005
+ flexGrow: "1"
1006
+ },
1007
+ context: e.builderContext,
1008
+ registeredComponents: e.builderComponents,
1009
+ linkComponent: e.builderLinkComponent,
1010
+ blocks: C.blocks
1011
+ }
1012
+ )
949
1013
  },
950
- /* @__PURE__ */ jsx(
951
- Blocks,
952
- {
953
- path: `component.options.columns.${C}.blocks`,
954
- parent: e.builderBlock.id,
955
- styleProp: {
956
- flexGrow: "1"
957
- },
958
- context: e.builderContext,
959
- registeredComponents: e.builderComponents,
960
- blocks: v.blocks
961
- }
962
- )
1014
+ v
963
1015
  ))
964
1016
  ]
965
1017
  }
966
1018
  ),
967
- /* @__PURE__ */ jsx("style", { children: `.div-3c01d6ec {
1019
+ /* @__PURE__ */ jsx("style", { children: `.div-6f826264 {
968
1020
  display: flex;
969
1021
  line-height: normal;
970
- }.div-3c01d6ec-2 {
971
- display: flex;
972
- flex-direction: column;
973
- align-items: stretch;
974
1022
  }` })
975
1023
  ] });
976
1024
  }
@@ -1008,34 +1056,34 @@ function getSrcSet(e) {
1008
1056
  return e.match(/cdn\.shopify\.com/) ? t.map((n) => [getShopifyImageUrl(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, i]) => `${n} ${i}w`).concat([e]).join(", ") : e;
1009
1057
  }
1010
1058
  function Image(e) {
1011
- var o, r, a, c;
1059
+ var o, r, a, l;
1012
1060
  function t() {
1013
1061
  var d;
1014
- const l = e.image || e.src;
1015
- if (!l || // We can auto add srcset for cdn.builder.io and shopify
1062
+ const s = e.image || e.src;
1063
+ if (!s || // We can auto add srcset for cdn.builder.io and shopify
1016
1064
  // images, otherwise you can supply this prop manually
1017
- !(l.match(/builder\.io/) || l.match(/cdn\.shopify\.com/)))
1065
+ !(s.match(/builder\.io/) || s.match(/cdn\.shopify\.com/)))
1018
1066
  return e.srcset;
1019
1067
  if (e.srcset && ((d = e.image) != null && d.includes("builder.io/api/v1/image"))) {
1020
1068
  if (!e.srcset.includes(e.image.split("?")[0]))
1021
- return console.debug("Removed given srcset"), getSrcSet(l);
1069
+ return console.debug("Removed given srcset"), getSrcSet(s);
1022
1070
  } else if (e.image && !e.srcset)
1023
- return getSrcSet(l);
1024
- return getSrcSet(l);
1071
+ return getSrcSet(s);
1072
+ return getSrcSet(s);
1025
1073
  }
1026
1074
  function n() {
1027
- var s;
1028
- return (s = t == null ? void 0 : t()) != null && s.match(/builder\.io/) && !e.noWebp ? t().replace(/\?/g, "?format=webp&") : "";
1075
+ var c;
1076
+ return (c = t == null ? void 0 : t()) != null && c.match(/builder\.io/) && !e.noWebp ? t().replace(/\?/g, "?format=webp&") : "";
1029
1077
  }
1030
1078
  function i() {
1031
- const s = {
1079
+ const c = {
1032
1080
  position: "absolute",
1033
1081
  height: "100%",
1034
1082
  width: "100%",
1035
1083
  left: "0px",
1036
1084
  top: "0px"
1037
1085
  };
1038
- return e.aspectRatio ? s : void 0;
1086
+ return e.aspectRatio ? c : void 0;
1039
1087
  }
1040
1088
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1041
1089
  /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -1068,7 +1116,7 @@ function Image(e) {
1068
1116
  }
1069
1117
  }
1070
1118
  ) }) : null,
1071
- (c = (a = e.builderBlock) == null ? void 0 : a.children) != null && c.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: e.children }) : null,
1119
+ (l = (a = e.builderBlock) == null ? void 0 : a.children) != null && l.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: e.children }) : null,
1072
1120
  !e.fitContent && e.children ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("div", { className: "div-40c70c9b-2", children: e.children }) }) : null
1073
1121
  ] }),
1074
1122
  /* @__PURE__ */ jsx("style", { children: `.img-40c70c9b {
@@ -1323,7 +1371,7 @@ const componentInfo$b = {
1323
1371
  });
1324
1372
  }
1325
1373
  const n = e.get("columns");
1326
- Array.isArray(n) && n.find((o) => o.get("width")) && (n.find((r) => !r.get("width")) || n.reduce((c, s) => c + s.get("width"), 0) !== 100) && t();
1374
+ Array.isArray(n) && n.find((o) => o.get("width")) && (n.find((r) => !r.get("width")) || n.reduce((l, c) => l + c.get("width"), 0) !== 100) && t();
1327
1375
  }
1328
1376
  }, {
1329
1377
  name: "space",
@@ -1371,27 +1419,27 @@ const componentInfo$b = {
1371
1419
  function CustomCode(e) {
1372
1420
  const t = useRef(null), [n, i] = useState(() => []), [o, r] = useState(() => []);
1373
1421
  return useEffect(() => {
1374
- var c;
1375
- if (!((c = t.current) != null && c.getElementsByTagName) || typeof window == "undefined")
1422
+ var l;
1423
+ if (!((l = t.current) != null && l.getElementsByTagName) || typeof window == "undefined")
1376
1424
  return;
1377
1425
  const a = t.current.getElementsByTagName("script");
1378
- for (let s = 0; s < a.length; s++) {
1379
- const l = a[s];
1380
- if (l.src) {
1381
- if (n.includes(l.src))
1426
+ for (let c = 0; c < a.length; c++) {
1427
+ const s = a[c];
1428
+ if (s.src) {
1429
+ if (n.includes(s.src))
1382
1430
  continue;
1383
- n.push(l.src);
1431
+ n.push(s.src);
1384
1432
  const d = document.createElement("script");
1385
- d.async = !0, d.src = l.src, document.head.appendChild(d);
1386
- } else if (!l.type || [
1433
+ d.async = !0, d.src = s.src, document.head.appendChild(d);
1434
+ } else if (!s.type || [
1387
1435
  "text/javascript",
1388
1436
  "application/javascript",
1389
1437
  "application/ecmascript"
1390
- ].includes(l.type)) {
1391
- if (o.includes(l.innerText))
1438
+ ].includes(s.type)) {
1439
+ if (o.includes(s.innerText))
1392
1440
  continue;
1393
1441
  try {
1394
- o.push(l.innerText), new Function(l.innerText)();
1442
+ o.push(s.innerText), new Function(s.innerText)();
1395
1443
  } catch (d) {
1396
1444
  console.warn("`CustomCode`: Error running script:", d);
1397
1445
  }
@@ -1433,27 +1481,27 @@ const componentInfo$8 = {
1433
1481
  }]
1434
1482
  }, SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"], isJsScript = (e) => SCRIPT_MIME_TYPES.includes(e.type);
1435
1483
  function Embed(e) {
1436
- const t = useRef(null), [n, i] = useState(() => []), [o, r] = useState(() => []), [a, c] = useState(() => !1);
1437
- function s() {
1484
+ const t = useRef(null), [n, i] = useState(() => []), [o, r] = useState(() => []), [a, l] = useState(() => !1);
1485
+ function c() {
1438
1486
  if (!t.current || !t.current.getElementsByTagName)
1439
1487
  return;
1440
- const l = t.current.getElementsByTagName("script");
1441
- for (let d = 0; d < l.length; d++) {
1442
- const g = l[d];
1488
+ const s = t.current.getElementsByTagName("script");
1489
+ for (let d = 0; d < s.length; d++) {
1490
+ const g = s[d];
1443
1491
  if (g.src && !n.includes(g.src)) {
1444
1492
  n.push(g.src);
1445
- const S = document.createElement("script");
1446
- S.async = !0, S.src = g.src, document.head.appendChild(S);
1493
+ const x = document.createElement("script");
1494
+ x.async = !0, x.src = g.src, document.head.appendChild(x);
1447
1495
  } else if (isJsScript(g) && !o.includes(g.innerText))
1448
1496
  try {
1449
1497
  o.push(g.innerText), new Function(g.innerText)();
1450
- } catch (S) {
1451
- console.warn("`Embed`: Error running script:", S);
1498
+ } catch (x) {
1499
+ console.warn("`Embed`: Error running script:", x);
1452
1500
  }
1453
1501
  }
1454
1502
  }
1455
1503
  return useEffect(() => {
1456
- t.current && !a && (c(!0), s());
1504
+ t.current && !a && (l(!0), c());
1457
1505
  }, [t.current, a]), /* @__PURE__ */ jsx(
1458
1506
  "div",
1459
1507
  {
@@ -1489,17 +1537,17 @@ const componentInfo$7 = {
1489
1537
  defaultValue: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",
1490
1538
  onChange: (e) => {
1491
1539
  e.delete("srcset"), e.delete("noWebp");
1492
- function n(a, c = 6e4) {
1493
- return new Promise((s, l) => {
1540
+ function n(a, l = 6e4) {
1541
+ return new Promise((c, s) => {
1494
1542
  const d = document.createElement("img");
1495
1543
  let g = !1;
1496
1544
  d.onload = () => {
1497
- g = !0, s(d);
1498
- }, d.addEventListener("error", (S) => {
1499
- console.warn("Image load failed", S.error), l(S.error);
1545
+ g = !0, c(d);
1546
+ }, d.addEventListener("error", (x) => {
1547
+ console.warn("Image load failed", x.error), s(x.error);
1500
1548
  }), d.src = a, setTimeout(() => {
1501
- g || l(new Error("Image load timed out"));
1502
- }, c);
1549
+ g || s(new Error("Image load timed out"));
1550
+ }, l);
1503
1551
  });
1504
1552
  }
1505
1553
  function i(a) {
@@ -1510,8 +1558,8 @@ const componentInfo$7 = {
1510
1558
  a.type.includes("svg") && e.set("noWebp", !0);
1511
1559
  }), o && (!r || r === 0.7041))
1512
1560
  return n(o).then((a) => {
1513
- const c = e.get("aspectRatio");
1514
- e.get("image") === o && (!c || c === 0.7041) && a.width && a.height && (e.set("aspectRatio", i(a.height / a.width)), e.set("height", a.height), e.set("width", a.width));
1561
+ const l = e.get("aspectRatio");
1562
+ e.get("image") === o && (!l || l === 0.7041) && a.width && a.height && (e.set("aspectRatio", i(a.height / a.width)), e.set("height", a.height), e.set("width", a.width));
1515
1563
  });
1516
1564
  }
1517
1565
  }, {
@@ -1823,7 +1871,7 @@ const componentInfo = {
1823
1871
  }]
1824
1872
  };
1825
1873
  function Video(e) {
1826
- var i, o, r, a, c, s, l;
1874
+ var i, o, r, a, l, c, s;
1827
1875
  function t() {
1828
1876
  return {
1829
1877
  ...e.autoPlay === !0 ? {
@@ -1891,7 +1939,7 @@ function Video(e) {
1891
1939
  }
1892
1940
  }
1893
1941
  ) }) : null,
1894
- (c = (a = e.builderBlock) == null ? void 0 : a.children) != null && c.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
1942
+ (l = (a = e.builderBlock) == null ? void 0 : a.children) != null && l.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
1895
1943
  "div",
1896
1944
  {
1897
1945
  style: {
@@ -1902,7 +1950,7 @@ function Video(e) {
1902
1950
  children: e.children
1903
1951
  }
1904
1952
  ) }) : null,
1905
- (l = (s = e.builderBlock) == null ? void 0 : s.children) != null && l.length && !e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
1953
+ (s = (c = e.builderBlock) == null ? void 0 : c.children) != null && s.length && !e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
1906
1954
  "div",
1907
1955
  {
1908
1956
  style: {
@@ -2124,7 +2172,7 @@ const findParentElement = (e, t, n = !0) => {
2124
2172
  builderElementIndex: n && i ? [].slice.call(document.getElementsByClassName(i)).indexOf(n) : void 0
2125
2173
  }
2126
2174
  };
2127
- }, SDK_VERSION = "0.12.2", registerInsertMenu = () => {
2175
+ }, SDK_VERSION = "0.12.4", registerInsertMenu = () => {
2128
2176
  register("insertMenu", {
2129
2177
  name: "_default",
2130
2178
  default: !0,
@@ -2176,25 +2224,25 @@ const setupBrowserForEditing = (e = {}) => {
2176
2224
  if (o != null && o.type)
2177
2225
  switch (o.type) {
2178
2226
  case "builder.evaluate": {
2179
- const c = o.data.text, s = o.data.arguments || [], l = o.data.id, d = new Function(c);
2180
- let g, S = null;
2227
+ const l = o.data.text, c = o.data.arguments || [], s = o.data.id, d = new Function(l);
2228
+ let g, x = null;
2181
2229
  try {
2182
- g = d.apply(null, s);
2230
+ g = d.apply(null, c);
2183
2231
  } catch (f) {
2184
- S = f;
2232
+ x = f;
2185
2233
  }
2186
- S ? (r = window.parent) == null || r.postMessage({
2234
+ x ? (r = window.parent) == null || r.postMessage({
2187
2235
  type: "builder.evaluateError",
2188
2236
  data: {
2189
- id: l,
2190
- error: S.message
2237
+ id: s,
2238
+ error: x.message
2191
2239
  }
2192
2240
  }, "*") : g && typeof g.then == "function" ? g.then((f) => {
2193
- var b;
2194
- (b = window.parent) == null || b.postMessage({
2241
+ var h;
2242
+ (h = window.parent) == null || h.postMessage({
2195
2243
  type: "builder.evaluateResult",
2196
2244
  data: {
2197
- id: l,
2245
+ id: s,
2198
2246
  result: f
2199
2247
  }
2200
2248
  }, "*");
@@ -2202,7 +2250,7 @@ const setupBrowserForEditing = (e = {}) => {
2202
2250
  type: "builder.evaluateResult",
2203
2251
  data: {
2204
2252
  result: g,
2205
- id: l
2253
+ id: s
2206
2254
  }
2207
2255
  }, "*");
2208
2256
  break;
@@ -2215,27 +2263,27 @@ function EnableEditor(e) {
2215
2263
  const t = useRef(null), [n, i] = useState(() => 0);
2216
2264
  useState(() => !0);
2217
2265
  function o(u) {
2218
- var h, x;
2266
+ var b, S;
2219
2267
  const m = {
2220
2268
  ...e.builderContextSignal.rootState,
2221
2269
  ...u
2222
2270
  };
2223
- e.builderContextSignal.rootSetState ? (x = (h = e.builderContextSignal).rootSetState) == null || x.call(h, m) : e.setBuilderContextSignal((p) => ({
2271
+ e.builderContextSignal.rootSetState ? (S = (b = e.builderContextSignal).rootSetState) == null || S.call(b, m) : e.setBuilderContextSignal((p) => ({
2224
2272
  ...p,
2225
2273
  rootState: m
2226
2274
  }));
2227
2275
  }
2228
2276
  function r(u) {
2229
- var h, x, p, k, B;
2277
+ var b, S, p, k, B;
2230
2278
  const m = {
2231
2279
  ...e.builderContextSignal.content,
2232
2280
  ...u,
2233
2281
  data: {
2234
- ...(h = e.builderContextSignal.content) == null ? void 0 : h.data,
2282
+ ...(b = e.builderContextSignal.content) == null ? void 0 : b.data,
2235
2283
  ...u == null ? void 0 : u.data
2236
2284
  },
2237
2285
  meta: {
2238
- ...(x = e.builderContextSignal.content) == null ? void 0 : x.meta,
2286
+ ...(S = e.builderContextSignal.content) == null ? void 0 : S.meta,
2239
2287
  ...u == null ? void 0 : u.meta,
2240
2288
  breakpoints: ((p = u == null ? void 0 : u.meta) == null ? void 0 : p.breakpoints) || ((B = (k = e.builderContextSignal.content) == null ? void 0 : k.meta) == null ? void 0 : B.breakpoints)
2241
2289
  }
@@ -2246,21 +2294,21 @@ function EnableEditor(e) {
2246
2294
  }));
2247
2295
  }
2248
2296
  useState(() => 0);
2249
- const [a, c] = useState(
2297
+ const [a, l] = useState(
2250
2298
  () => !1
2251
- ), [s, l] = useState(
2299
+ ), [c, s] = useState(
2252
2300
  () => e.contentWrapper || "div"
2253
2301
  );
2254
2302
  function d(u) {
2255
- var h;
2303
+ var b;
2256
2304
  if (!isFromTrustedHost(e.trustedHosts, u))
2257
2305
  return;
2258
2306
  const { data: m } = u;
2259
2307
  if (m)
2260
2308
  switch (m.type) {
2261
2309
  case "builder.configureSdk": {
2262
- const x = m.data, { breakpoints: p, contentId: k } = x;
2263
- if (!k || k !== ((h = e.builderContextSignal.content) == null ? void 0 : h.id))
2310
+ const S = m.data, { breakpoints: p, contentId: k } = S;
2311
+ if (!k || k !== ((b = e.builderContextSignal.content) == null ? void 0 : b.id))
2264
2312
  return;
2265
2313
  p && r({
2266
2314
  meta: {
@@ -2270,15 +2318,15 @@ function EnableEditor(e) {
2270
2318
  break;
2271
2319
  }
2272
2320
  case "builder.contentUpdate": {
2273
- const x = m.data, p = x.key || x.alias || x.entry || x.modelName, k = x.data;
2321
+ const S = m.data, p = S.key || S.alias || S.entry || S.modelName, k = S.data;
2274
2322
  p === e.model && (r(k), i(n + 1));
2275
2323
  break;
2276
2324
  }
2277
2325
  }
2278
2326
  }
2279
2327
  function g() {
2280
- var m, h;
2281
- const u = (h = (m = e.builderContextSignal.content) == null ? void 0 : m.data) == null ? void 0 : h.jsCode;
2328
+ var m, b;
2329
+ const u = (b = (m = e.builderContextSignal.content) == null ? void 0 : m.data) == null ? void 0 : b.jsCode;
2282
2330
  u && evaluate({
2283
2331
  code: u,
2284
2332
  context: e.context || {},
@@ -2287,28 +2335,28 @@ function EnableEditor(e) {
2287
2335
  rootSetState: e.builderContextSignal.rootSetState
2288
2336
  });
2289
2337
  }
2290
- const [S, f] = useState(() => ({})), [b, y] = useState(() => !1);
2338
+ const [x, f] = useState(() => ({})), [h, y] = useState(() => !1);
2291
2339
  function I(u) {
2292
- var m, h;
2340
+ var m, b;
2293
2341
  if (e.builderContextSignal.content) {
2294
- const x = (m = e.builderContextSignal.content) == null ? void 0 : m.testVariationId, p = (h = e.builderContextSignal.content) == null ? void 0 : h.id;
2342
+ const S = (m = e.builderContextSignal.content) == null ? void 0 : m.testVariationId, p = (b = e.builderContextSignal.content) == null ? void 0 : b.id;
2295
2343
  _track({
2296
2344
  type: "click",
2297
2345
  canTrack: getDefaultCanTrack(e.canTrack),
2298
2346
  contentId: p,
2299
2347
  apiKey: e.apiKey,
2300
- variationId: x !== p ? x : void 0,
2348
+ variationId: S !== p ? S : void 0,
2301
2349
  ...getInteractionPropertiesForEvent(u),
2302
- unique: !b
2350
+ unique: !h
2303
2351
  });
2304
2352
  }
2305
- b || y(!0);
2353
+ h || y(!0);
2306
2354
  }
2307
2355
  function E(u) {
2308
2356
  return u.replace(
2309
2357
  /{{([^}]+)}}/g,
2310
- (m, h) => evaluate({
2311
- code: h,
2358
+ (m, b) => evaluate({
2359
+ code: b,
2312
2360
  context: e.context || {},
2313
2361
  localState: void 0,
2314
2362
  rootState: e.builderContextSignal.rootState,
@@ -2316,25 +2364,25 @@ function EnableEditor(e) {
2316
2364
  })
2317
2365
  );
2318
2366
  }
2319
- function v({ url: u, key: m }) {
2320
- fetch$1(u).then((h) => h.json()).then((h) => {
2367
+ function C({ url: u, key: m }) {
2368
+ fetch$1(u).then((b) => b.json()).then((b) => {
2321
2369
  var p, k;
2322
- const x = {
2370
+ const S = {
2323
2371
  ...e.builderContextSignal.rootState,
2324
- [m]: h
2372
+ [m]: b
2325
2373
  };
2326
- (k = (p = e.builderContextSignal).rootSetState) == null || k.call(p, x), S[m] = !0;
2327
- }).catch((h) => {
2328
- console.error("error fetching dynamic data", u, h);
2374
+ (k = (p = e.builderContextSignal).rootSetState) == null || k.call(p, S), x[m] = !0;
2375
+ }).catch((b) => {
2376
+ console.error("error fetching dynamic data", u, b);
2329
2377
  });
2330
2378
  }
2331
- function C() {
2332
- var m, h, x;
2333
- const u = (x = (h = (m = e.builderContextSignal.content) == null ? void 0 : m.data) == null ? void 0 : h.httpRequests) != null ? x : {};
2379
+ function v() {
2380
+ var m, b, S;
2381
+ const u = (S = (b = (m = e.builderContextSignal.content) == null ? void 0 : m.data) == null ? void 0 : b.httpRequests) != null ? S : {};
2334
2382
  Object.entries(u).forEach(([p, k]) => {
2335
- if (k && (!S[p] || isEditing())) {
2383
+ if (k && (!x[p] || isEditing())) {
2336
2384
  const B = E(k);
2337
- v({
2385
+ C({
2338
2386
  url: B,
2339
2387
  key: p
2340
2388
  });
@@ -2373,19 +2421,19 @@ function EnableEditor(e) {
2373
2421
  }), Object.values(
2374
2422
  e.builderContextSignal.componentInfos
2375
2423
  ).forEach((m) => {
2376
- var x;
2377
- const h = createRegisterComponentMessage(m);
2378
- (x = window.parent) == null || x.postMessage(h, "*");
2424
+ var S;
2425
+ const b = createRegisterComponentMessage(m);
2426
+ (S = window.parent) == null || S.postMessage(b, "*");
2379
2427
  }), window.addEventListener(
2380
2428
  "builder:component:stateChangeListenerActivated",
2381
2429
  T
2382
2430
  );
2383
2431
  }
2384
2432
  function R(u) {
2385
- const m = new URL(location.href).searchParams, h = m.get("builder.preview"), x = m.get(
2386
- `builder.preview.${h}`
2433
+ const m = new URL(location.href).searchParams, b = m.get("builder.preview"), S = m.get(
2434
+ `builder.preview.${b}`
2387
2435
  ), p = m.get("apiKey") || m.get("builder.space");
2388
- h === e.model && p === e.apiKey && (!e.content || x === e.content.id) && fetchOneEntry({
2436
+ b === e.model && p === e.apiKey && (!e.content || S === e.content.id) && fetchOneEntry({
2389
2437
  model: e.model,
2390
2438
  apiKey: e.apiKey,
2391
2439
  apiVersion: e.builderContextSignal.apiVersion
@@ -2421,13 +2469,13 @@ function EnableEditor(e) {
2421
2469
  var u, m;
2422
2470
  if (isBrowser()) {
2423
2471
  if (isEditing() && t.current && t.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && getDefaultCanTrack(e.canTrack)) {
2424
- const x = (u = e.builderContextSignal.content) == null ? void 0 : u.testVariationId, p = (m = e.builderContextSignal.content) == null ? void 0 : m.id, k = e.apiKey;
2472
+ const S = (u = e.builderContextSignal.content) == null ? void 0 : u.testVariationId, p = (m = e.builderContextSignal.content) == null ? void 0 : m.id, k = e.apiKey;
2425
2473
  _track({
2426
2474
  type: "impression",
2427
2475
  canTrack: !0,
2428
2476
  contentId: p,
2429
2477
  apiKey: k,
2430
- variationId: x !== p ? x : void 0
2478
+ variationId: S !== p ? S : void 0
2431
2479
  });
2432
2480
  }
2433
2481
  isPreviewing() && t.current && t.current.dispatchEvent(new CustomEvent("initpreviewingbldr"));
@@ -2435,7 +2483,7 @@ function EnableEditor(e) {
2435
2483
  }, []), useEffect(() => {
2436
2484
  e.apiKey || logger.error(
2437
2485
  "No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
2438
- ), g(), C(), T();
2486
+ ), g(), v(), T();
2439
2487
  }, []), useEffect(() => {
2440
2488
  e.content && r(e.content);
2441
2489
  }, [e.content]), useEffect(() => {
@@ -2445,7 +2493,7 @@ function EnableEditor(e) {
2445
2493
  (P = (j = e.builderContextSignal.content) == null ? void 0 : j.data) == null ? void 0 : P.jsCode,
2446
2494
  e.builderContextSignal.rootState
2447
2495
  ]), useEffect(() => {
2448
- C();
2496
+ v();
2449
2497
  }, [(F = (A = e.builderContextSignal.content) == null ? void 0 : A.data) == null ? void 0 : F.httpRequests]), useEffect(() => {
2450
2498
  T();
2451
2499
  }, [e.builderContextSignal.rootState]), useEffect(() => {
@@ -2460,7 +2508,7 @@ function EnableEditor(e) {
2460
2508
  T
2461
2509
  ));
2462
2510
  }, []), /* @__PURE__ */ jsx(builderContext.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ createElement(
2463
- s,
2511
+ c,
2464
2512
  {
2465
2513
  key: n,
2466
2514
  ref: t,
@@ -2489,16 +2537,16 @@ font-display: fallback;
2489
2537
  font-weight: 400;
2490
2538
  }
2491
2539
  `.trim()), e.files)
2492
- for (const c in e.files) {
2493
- if (!(String(Number(c)) === c))
2540
+ for (const l in e.files) {
2541
+ if (!(String(Number(l)) === l))
2494
2542
  continue;
2495
- const l = e.files[c];
2496
- l && l !== i && (o += `
2543
+ const s = e.files[l];
2544
+ s && s !== i && (o += `
2497
2545
  @font-face {
2498
2546
  font-family: "${t}";
2499
- src: url('${l}') format('woff2');
2547
+ src: url('${s}') format('woff2');
2500
2548
  font-display: fallback;
2501
- font-weight: ${c};
2549
+ font-weight: ${l};
2502
2550
  }
2503
2551
  `.trim());
2504
2552
  }
@@ -2523,6 +2571,10 @@ ${getFontCss({
2523
2571
  customFonts: e.customFonts
2524
2572
  })}
2525
2573
 
2574
+ .builder-button {
2575
+ all: unset;
2576
+ }
2577
+
2526
2578
  .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
2527
2579
  margin: 0;
2528
2580
  }
@@ -2544,10 +2596,10 @@ const getRootStateInitialValue = ({
2544
2596
  data: t,
2545
2597
  locale: n
2546
2598
  }) => {
2547
- var r, a, c;
2599
+ var r, a, l;
2548
2600
  const i = {}, o = ((r = e == null ? void 0 : e.data) == null ? void 0 : r.state) || {};
2549
- return (c = (a = e == null ? void 0 : e.data) == null ? void 0 : a.inputs) == null || c.forEach((s) => {
2550
- s.name && s.defaultValue !== void 0 && (i[s.name] = s.defaultValue);
2601
+ return (l = (a = e == null ? void 0 : e.data) == null ? void 0 : a.inputs) == null || l.forEach((c) => {
2602
+ c.name && c.defaultValue !== void 0 && (i[c.name] = c.defaultValue);
2551
2603
  }), {
2552
2604
  ...i,
2553
2605
  ...o,
@@ -2568,7 +2620,7 @@ const getRootStateInitialValue = ({
2568
2620
  meta: e == null ? void 0 : e.meta
2569
2621
  } : void 0;
2570
2622
  function ContentComponent(e) {
2571
- var s, l, d, g, S, f, b;
2623
+ var c, s, d, g, x, f, h;
2572
2624
  const [t, n] = useState(
2573
2625
  () => {
2574
2626
  var y, I;
@@ -2581,7 +2633,7 @@ function ContentComponent(e) {
2581
2633
  }
2582
2634
  );
2583
2635
  function i(y) {
2584
- c((I) => ({
2636
+ l((I) => ({
2585
2637
  ...I,
2586
2638
  rootState: y
2587
2639
  }));
@@ -2606,7 +2658,7 @@ function ContentComponent(e) {
2606
2658
  }),
2607
2659
  {}
2608
2660
  )
2609
- ), [a, c] = useState(() => ({
2661
+ ), [a, l] = useState(() => ({
2610
2662
  content: getContentInitialValue({
2611
2663
  content: e.content,
2612
2664
  data: e.data
@@ -2663,24 +2715,26 @@ function ContentComponent(e) {
2663
2715
  builderContextSignal: a,
2664
2716
  contentWrapper: e.contentWrapper,
2665
2717
  contentWrapperProps: e.contentWrapperProps,
2718
+ linkComponent: e.linkComponent,
2666
2719
  trustedHosts: e.trustedHosts,
2667
- setBuilderContextSignal: c,
2720
+ setBuilderContextSignal: l,
2668
2721
  children: [
2669
2722
  e.isSsrAbTest ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedScript, { scriptStr: t }) }) : null,
2670
2723
  /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
2671
2724
  ContentStyles,
2672
2725
  {
2673
- contentId: (s = a.content) == null ? void 0 : s.id,
2674
- cssCode: (d = (l = a.content) == null ? void 0 : l.data) == null ? void 0 : d.cssCode,
2675
- customFonts: (S = (g = a.content) == null ? void 0 : g.data) == null ? void 0 : S.customFonts
2726
+ contentId: (c = a.content) == null ? void 0 : c.id,
2727
+ cssCode: (d = (s = a.content) == null ? void 0 : s.data) == null ? void 0 : d.cssCode,
2728
+ customFonts: (x = (g = a.content) == null ? void 0 : g.data) == null ? void 0 : x.customFonts
2676
2729
  }
2677
2730
  ) }),
2678
2731
  /* @__PURE__ */ jsx(
2679
2732
  Blocks,
2680
2733
  {
2681
- blocks: (b = (f = a.content) == null ? void 0 : f.data) == null ? void 0 : b.blocks,
2734
+ blocks: (h = (f = a.content) == null ? void 0 : f.data) == null ? void 0 : h.blocks,
2682
2735
  context: a,
2683
- registeredComponents: o
2736
+ registeredComponents: o,
2737
+ linkComponent: e.linkComponent
2684
2738
  }
2685
2739
  )
2686
2740
  ]
@@ -2690,7 +2744,7 @@ function ContentComponent(e) {
2690
2744
  );
2691
2745
  }
2692
2746
  function ContentVariants(e) {
2693
- var a, c;
2747
+ var a, l;
2694
2748
  const [t, n] = useState(
2695
2749
  () => checkShouldRenderVariants({
2696
2750
  canTrack: getDefaultCanTrack(e.canTrack),
@@ -2698,23 +2752,23 @@ function ContentVariants(e) {
2698
2752
  })
2699
2753
  );
2700
2754
  function i() {
2701
- var s;
2755
+ var c;
2702
2756
  return getUpdateCookieAndStylesScript(
2703
- getVariants(e.content).map((l) => ({
2704
- id: l.testVariationId,
2705
- testRatio: l.testRatio
2757
+ getVariants(e.content).map((s) => ({
2758
+ id: s.testVariationId,
2759
+ testRatio: s.testRatio
2706
2760
  })),
2707
- ((s = e.content) == null ? void 0 : s.id) || ""
2761
+ ((c = e.content) == null ? void 0 : c.id) || ""
2708
2762
  );
2709
2763
  }
2710
2764
  function o() {
2711
- return getVariants(e.content).map((s) => `.variant-${s.testVariationId} { display: none; } `).join("");
2765
+ return getVariants(e.content).map((c) => `.variant-${c.testVariationId} { display: none; } `).join("");
2712
2766
  }
2713
2767
  function r() {
2714
- var s;
2768
+ var c;
2715
2769
  return t ? {
2716
2770
  ...e.content,
2717
- testVariationId: (s = e.content) == null ? void 0 : s.id
2771
+ testVariationId: (c = e.content) == null ? void 0 : c.id
2718
2772
  } : handleABTestingSync({
2719
2773
  item: e.content,
2720
2774
  canTrack: getDefaultCanTrack(e.canTrack)
@@ -2732,10 +2786,10 @@ function ContentVariants(e) {
2732
2786
  }
2733
2787
  ),
2734
2788
  /* @__PURE__ */ jsx(InlinedScript, { scriptStr: i() }),
2735
- (c = getVariants(e.content)) == null ? void 0 : c.map((s) => /* @__PURE__ */ jsx(
2789
+ (l = getVariants(e.content)) == null ? void 0 : l.map((c) => /* @__PURE__ */ jsx(
2736
2790
  ContentComponent,
2737
2791
  {
2738
- content: s,
2792
+ content: c,
2739
2793
  showContent: !1,
2740
2794
  model: e.model,
2741
2795
  data: e.data,
@@ -2743,6 +2797,7 @@ function ContentVariants(e) {
2743
2797
  apiKey: e.apiKey,
2744
2798
  apiVersion: e.apiVersion,
2745
2799
  customComponents: e.customComponents,
2800
+ linkComponent: e.linkComponent,
2746
2801
  canTrack: e.canTrack,
2747
2802
  locale: e.locale,
2748
2803
  includeRefs: e.includeRefs,
@@ -2754,7 +2809,7 @@ function ContentVariants(e) {
2754
2809
  contentWrapperProps: e.contentWrapperProps,
2755
2810
  trustedHosts: e.trustedHosts
2756
2811
  },
2757
- s.testVariationId
2812
+ c.testVariationId
2758
2813
  ))
2759
2814
  ] }) : null,
2760
2815
  /* @__PURE__ */ jsx(
@@ -2768,6 +2823,7 @@ function ContentVariants(e) {
2768
2823
  apiKey: e.apiKey,
2769
2824
  apiVersion: e.apiVersion,
2770
2825
  customComponents: e.customComponents,
2826
+ linkComponent: e.linkComponent,
2771
2827
  canTrack: e.canTrack,
2772
2828
  locale: e.locale,
2773
2829
  includeRefs: e.includeRefs,
@@ -2802,26 +2858,26 @@ const fetchSymbolContent = async ({
2802
2858
  });
2803
2859
  };
2804
2860
  function Symbol$1(e) {
2805
- var r, a, c, s;
2861
+ var r, a, l, c;
2806
2862
  function t() {
2807
- var l, d;
2863
+ var s, d;
2808
2864
  return [
2809
- e.attributes.className,
2865
+ e.attributes[getClassPropName()],
2810
2866
  "builder-symbol",
2811
- (l = e.symbol) != null && l.inline ? "builder-inline-symbol" : void 0,
2867
+ (s = e.symbol) != null && s.inline ? "builder-inline-symbol" : void 0,
2812
2868
  (d = e.symbol) != null && d.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
2813
2869
  ].filter(Boolean).join(" ");
2814
2870
  }
2815
2871
  const [n, i] = useState(() => {
2816
- var l;
2817
- return (l = e.symbol) == null ? void 0 : l.content;
2872
+ var s;
2873
+ return (s = e.symbol) == null ? void 0 : s.content;
2818
2874
  });
2819
2875
  function o() {
2820
2876
  n || fetchSymbolContent({
2821
2877
  symbol: e.symbol,
2822
2878
  builderContextValue: e.builderContext
2823
- }).then((l) => {
2824
- l && i(l);
2879
+ }).then((s) => {
2880
+ s && i(s);
2825
2881
  });
2826
2882
  }
2827
2883
  return useEffect(() => {
@@ -2841,10 +2897,11 @@ function Symbol$1(e) {
2841
2897
  data: {
2842
2898
  ...(a = e.symbol) == null ? void 0 : a.data,
2843
2899
  ...e.builderContext.localState,
2844
- ...(c = n == null ? void 0 : n.data) == null ? void 0 : c.state
2900
+ ...(l = n == null ? void 0 : n.data) == null ? void 0 : l.state
2845
2901
  },
2846
- model: (s = e.symbol) == null ? void 0 : s.model,
2847
- content: n
2902
+ model: (c = e.symbol) == null ? void 0 : c.model,
2903
+ content: n,
2904
+ linkComponent: e.builderLinkComponent
2848
2905
  }
2849
2906
  ) });
2850
2907
  }