@builder.io/sdk-react 0.7.4 → 0.7.6
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.
- package/lib/browser/index.cjs +11 -11
- package/lib/browser/index.mjs +147 -147
- package/lib/edge/index.cjs +12 -12
- package/lib/edge/index.mjs +303 -303
- package/lib/node/index.cjs +9 -9
- package/lib/node/index.mjs +139 -139
- package/package.json +1 -1
- package/types/components/content/content.helpers.d.ts +1 -1
- package/types/constants/sdk-version.d.ts +1 -1
package/lib/browser/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { createContext as pe, useState as
|
|
2
|
+
import { jsxs as E, Fragment as f, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as pe, useState as v, useContext as le, createElement as ke, useRef as Z, useEffect as P } from "react";
|
|
4
4
|
import { i as $, j as N, k as $e, l as M, m as ee, n as G, T as L, r as Ne, o as U, p as ce, a as Fe, c as We, b as Ce, q as _e, u as se, v as de, w as Le } from "./server-entry-0aebe4be.mjs";
|
|
5
5
|
import { _ as sn, h as dn, f as un, g as mn, e as fn, d as hn, s as gn, t as bn } from "./server-entry-0aebe4be.mjs";
|
|
6
6
|
function je(e) {
|
|
7
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ E(f, { children: [
|
|
8
8
|
e.link ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */ r(
|
|
9
9
|
"a",
|
|
10
10
|
{
|
|
@@ -315,7 +315,7 @@ function ne(e) {
|
|
|
315
315
|
return G(i.hide) ? !i.hide : G(i.show) ? i.show : !0;
|
|
316
316
|
}
|
|
317
317
|
function n() {
|
|
318
|
-
var
|
|
318
|
+
var x;
|
|
319
319
|
const i = D({
|
|
320
320
|
block: e.block,
|
|
321
321
|
localState: e.context.localState,
|
|
@@ -324,14 +324,14 @@ function ne(e) {
|
|
|
324
324
|
context: e.context.context,
|
|
325
325
|
shouldEvaluateBindings: !0
|
|
326
326
|
}), a = i.responsiveStyles, o = e.context.content, l = Te(
|
|
327
|
-
((
|
|
327
|
+
((x = o == null ? void 0 : o.meta) == null ? void 0 : x.breakpoints) || {}
|
|
328
328
|
), s = a == null ? void 0 : a.large, c = a == null ? void 0 : a.medium, d = a == null ? void 0 : a.small, u = i.id;
|
|
329
329
|
if (!u)
|
|
330
330
|
return "";
|
|
331
331
|
const g = s ? Y({
|
|
332
332
|
className: u,
|
|
333
333
|
styles: s
|
|
334
|
-
}) : "",
|
|
334
|
+
}) : "", S = c ? Y({
|
|
335
335
|
className: u,
|
|
336
336
|
styles: c,
|
|
337
337
|
mediaQuery: me(
|
|
@@ -346,7 +346,7 @@ function ne(e) {
|
|
|
346
346
|
l
|
|
347
347
|
)
|
|
348
348
|
}) : "";
|
|
349
|
-
return [g,
|
|
349
|
+
return [g, S, V].join(" ");
|
|
350
350
|
}
|
|
351
351
|
return /* @__PURE__ */ r(f, { children: n() && t() ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */ r(K, { styles: n() }) }) : null });
|
|
352
352
|
}
|
|
@@ -418,9 +418,9 @@ function at(e) {
|
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
420
|
function fe(e) {
|
|
421
|
-
return /* @__PURE__ */
|
|
421
|
+
return /* @__PURE__ */ E(f, { children: [
|
|
422
422
|
" ",
|
|
423
|
-
e.hasChildren ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */
|
|
423
|
+
e.hasChildren ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */ E(
|
|
424
424
|
e.Wrapper,
|
|
425
425
|
{
|
|
426
426
|
...O({
|
|
@@ -511,10 +511,10 @@ const rt = ({
|
|
|
511
511
|
};
|
|
512
512
|
function he(e) {
|
|
513
513
|
var i, a;
|
|
514
|
-
const [t, n] =
|
|
514
|
+
const [t, n] = v(
|
|
515
515
|
() => e.isInteractive ? ot : e.componentRef
|
|
516
516
|
);
|
|
517
|
-
return /* @__PURE__ */ r(f, { children: e.componentRef ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */
|
|
517
|
+
return /* @__PURE__ */ r(f, { children: e.componentRef ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */ E(
|
|
518
518
|
t,
|
|
519
519
|
{
|
|
520
520
|
...rt({
|
|
@@ -549,7 +549,7 @@ function he(e) {
|
|
|
549
549
|
) }) : null });
|
|
550
550
|
}
|
|
551
551
|
function lt(e) {
|
|
552
|
-
const [t, n] =
|
|
552
|
+
const [t, n] = v(() => e.repeatContext);
|
|
553
553
|
return /* @__PURE__ */ r(te.Provider, { value: t, children: /* @__PURE__ */ r(
|
|
554
554
|
H,
|
|
555
555
|
{
|
|
@@ -560,7 +560,7 @@ function lt(e) {
|
|
|
560
560
|
) });
|
|
561
561
|
}
|
|
562
562
|
function H(e) {
|
|
563
|
-
var u, g,
|
|
563
|
+
var u, g, S, V;
|
|
564
564
|
function t() {
|
|
565
565
|
return Qe({
|
|
566
566
|
block: e.block,
|
|
@@ -575,7 +575,8 @@ function H(e) {
|
|
|
575
575
|
});
|
|
576
576
|
}
|
|
577
577
|
function i() {
|
|
578
|
-
|
|
578
|
+
var x;
|
|
579
|
+
return (x = e.block.repeat) != null && x.collection ? e.block : D({
|
|
579
580
|
block: e.block,
|
|
580
581
|
localState: e.context.localState,
|
|
581
582
|
rootState: e.context.rootState,
|
|
@@ -588,32 +589,36 @@ function H(e) {
|
|
|
588
589
|
return e.block.tagName || "div";
|
|
589
590
|
}
|
|
590
591
|
function o() {
|
|
591
|
-
|
|
592
|
+
var I, w;
|
|
593
|
+
if ((I = e.block.repeat) != null && I.collection)
|
|
594
|
+
return !!((w = n == null ? void 0 : n()) != null && w.length);
|
|
595
|
+
const x = "hide" in i() ? i().hide : !1;
|
|
596
|
+
return ("show" in i() ? i().show : !0) && !x;
|
|
592
597
|
}
|
|
593
598
|
function l() {
|
|
594
599
|
var p;
|
|
595
600
|
return !((p = t == null ? void 0 : t()) != null && p.component) && !n() ? i().children ?? [] : [];
|
|
596
601
|
}
|
|
597
602
|
function s() {
|
|
598
|
-
var
|
|
603
|
+
var x, p, I, w, C;
|
|
599
604
|
return {
|
|
600
605
|
blockChildren: i().children ?? [],
|
|
601
|
-
componentRef: (
|
|
606
|
+
componentRef: (x = t == null ? void 0 : t()) == null ? void 0 : x.component,
|
|
602
607
|
componentOptions: {
|
|
603
608
|
...Me(i()),
|
|
604
609
|
builderContext: e.context,
|
|
605
|
-
...((p = t == null ? void 0 : t()) == null ? void 0 : p.name) === "Symbol" || ((
|
|
610
|
+
...((p = t == null ? void 0 : t()) == null ? void 0 : p.name) === "Symbol" || ((I = t == null ? void 0 : t()) == null ? void 0 : I.name) === "Columns" ? {
|
|
606
611
|
builderComponents: e.registeredComponents
|
|
607
612
|
} : {}
|
|
608
613
|
},
|
|
609
614
|
context: c,
|
|
610
615
|
registeredComponents: e.registeredComponents,
|
|
611
616
|
builderBlock: i(),
|
|
612
|
-
includeBlockProps: ((
|
|
617
|
+
includeBlockProps: ((w = t == null ? void 0 : t()) == null ? void 0 : w.noWrap) === !0,
|
|
613
618
|
isInteractive: !((C = t == null ? void 0 : t()) != null && C.isRSC)
|
|
614
619
|
};
|
|
615
620
|
}
|
|
616
|
-
const [c, d] =
|
|
621
|
+
const [c, d] = v(() => e.context);
|
|
617
622
|
return /* @__PURE__ */ r(f, { children: o() ? /* @__PURE__ */ r(f, { children: (u = t == null ? void 0 : t()) != null && u.noWrap ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */ r(
|
|
618
623
|
he,
|
|
619
624
|
{
|
|
@@ -626,7 +631,7 @@ function H(e) {
|
|
|
626
631
|
includeBlockProps: s().includeBlockProps,
|
|
627
632
|
isInteractive: s().isInteractive
|
|
628
633
|
}
|
|
629
|
-
) }) : /* @__PURE__ */
|
|
634
|
+
) }) : /* @__PURE__ */ E(f, { children: [
|
|
630
635
|
q(a()) ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */ r(
|
|
631
636
|
fe,
|
|
632
637
|
{
|
|
@@ -636,16 +641,16 @@ function H(e) {
|
|
|
636
641
|
hasChildren: !1
|
|
637
642
|
}
|
|
638
643
|
) }) : null,
|
|
639
|
-
!q(a()) && n() ? /* @__PURE__ */ r(f, { children: (g = n()) == null ? void 0 : g.map((
|
|
644
|
+
!q(a()) && n() ? /* @__PURE__ */ r(f, { children: (g = n()) == null ? void 0 : g.map((x, p) => /* @__PURE__ */ r(
|
|
640
645
|
lt,
|
|
641
646
|
{
|
|
642
|
-
repeatContext:
|
|
643
|
-
block:
|
|
647
|
+
repeatContext: x.context,
|
|
648
|
+
block: x.block,
|
|
644
649
|
registeredComponents: e.registeredComponents
|
|
645
650
|
},
|
|
646
651
|
p
|
|
647
652
|
)) }) : null,
|
|
648
|
-
!q(a()) && !n() ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */
|
|
653
|
+
!q(a()) && !n() ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */ E(
|
|
649
654
|
fe,
|
|
650
655
|
{
|
|
651
656
|
Wrapper: a(),
|
|
@@ -666,22 +671,22 @@ function H(e) {
|
|
|
666
671
|
isInteractive: s().isInteractive
|
|
667
672
|
}
|
|
668
673
|
),
|
|
669
|
-
(
|
|
674
|
+
(S = l()) == null ? void 0 : S.map((x) => /* @__PURE__ */ r(
|
|
670
675
|
H,
|
|
671
676
|
{
|
|
672
|
-
block:
|
|
677
|
+
block: x,
|
|
673
678
|
context: c,
|
|
674
679
|
registeredComponents: e.registeredComponents
|
|
675
680
|
},
|
|
676
|
-
"block-" +
|
|
681
|
+
"block-" + x.id
|
|
677
682
|
)),
|
|
678
|
-
(V = l()) == null ? void 0 : V.map((
|
|
683
|
+
(V = l()) == null ? void 0 : V.map((x) => /* @__PURE__ */ r(
|
|
679
684
|
ne,
|
|
680
685
|
{
|
|
681
|
-
block:
|
|
686
|
+
block: x,
|
|
682
687
|
context: c
|
|
683
688
|
},
|
|
684
|
-
"block-style-" +
|
|
689
|
+
"block-style-" + x.id
|
|
685
690
|
))
|
|
686
691
|
]
|
|
687
692
|
}
|
|
@@ -719,7 +724,7 @@ function ct(e) {
|
|
|
719
724
|
"*"
|
|
720
725
|
));
|
|
721
726
|
}
|
|
722
|
-
return /* @__PURE__ */
|
|
727
|
+
return /* @__PURE__ */ E(f, { children: [
|
|
723
728
|
/* @__PURE__ */ r(
|
|
724
729
|
"div",
|
|
725
730
|
{
|
|
@@ -743,7 +748,7 @@ function ct(e) {
|
|
|
743
748
|
function ie(e) {
|
|
744
749
|
var i, a;
|
|
745
750
|
const t = le(te), n = le(we);
|
|
746
|
-
return /* @__PURE__ */
|
|
751
|
+
return /* @__PURE__ */ E(
|
|
747
752
|
ct,
|
|
748
753
|
{
|
|
749
754
|
blocks: e.blocks,
|
|
@@ -773,33 +778,33 @@ function ie(e) {
|
|
|
773
778
|
);
|
|
774
779
|
}
|
|
775
780
|
function st(e) {
|
|
776
|
-
var
|
|
777
|
-
const [t, n] =
|
|
781
|
+
var w;
|
|
782
|
+
const [t, n] = v(
|
|
778
783
|
() => typeof e.space == "number" ? e.space || 0 : 20
|
|
779
|
-
), [i, a] =
|
|
784
|
+
), [i, a] = v(() => e.columns || []), [o, l] = v(
|
|
780
785
|
() => e.stackColumnsAt || "tablet"
|
|
781
786
|
);
|
|
782
787
|
function s(C) {
|
|
783
|
-
var
|
|
784
|
-
return ((
|
|
788
|
+
var T;
|
|
789
|
+
return ((T = i[C]) == null ? void 0 : T.width) || 100 / i.length;
|
|
785
790
|
}
|
|
786
791
|
function c(C) {
|
|
787
|
-
const
|
|
788
|
-
return `calc(${s(C)}% - ${
|
|
792
|
+
const T = t * (i.length - 1) / i.length;
|
|
793
|
+
return `calc(${s(C)}% - ${T}px)`;
|
|
789
794
|
}
|
|
790
795
|
function d({
|
|
791
796
|
stackedStyle: C,
|
|
792
|
-
desktopStyle:
|
|
797
|
+
desktopStyle: T
|
|
793
798
|
}) {
|
|
794
|
-
return o === "tablet" ? C :
|
|
799
|
+
return o === "tablet" ? C : T;
|
|
795
800
|
}
|
|
796
801
|
function u({
|
|
797
802
|
stackedStyle: C,
|
|
798
|
-
desktopStyle:
|
|
803
|
+
desktopStyle: T
|
|
799
804
|
}) {
|
|
800
|
-
return o === "never" ?
|
|
805
|
+
return o === "never" ? T : C;
|
|
801
806
|
}
|
|
802
|
-
const [g,
|
|
807
|
+
const [g, S] = v(
|
|
803
808
|
() => e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column"
|
|
804
809
|
);
|
|
805
810
|
function V() {
|
|
@@ -811,8 +816,8 @@ function st(e) {
|
|
|
811
816
|
})
|
|
812
817
|
};
|
|
813
818
|
}
|
|
814
|
-
function
|
|
815
|
-
const
|
|
819
|
+
function x(C) {
|
|
820
|
+
const T = C === 0 ? 0 : t, A = c(C), B = `${T}px`, F = "100%", W = 0;
|
|
816
821
|
return {
|
|
817
822
|
width: A,
|
|
818
823
|
["marginLeft"]: B,
|
|
@@ -840,7 +845,7 @@ function st(e) {
|
|
|
840
845
|
((B = (A = e.builderContext.content) == null ? void 0 : A.meta) == null ? void 0 : B.breakpoints) || {}
|
|
841
846
|
)[C].max;
|
|
842
847
|
}
|
|
843
|
-
function
|
|
848
|
+
function I() {
|
|
844
849
|
return `
|
|
845
850
|
@media (max-width: ${p("medium")}px) {
|
|
846
851
|
.${e.builderBlock.id}-breakpoints {
|
|
@@ -867,25 +872,25 @@ function st(e) {
|
|
|
867
872
|
},
|
|
868
873
|
`;
|
|
869
874
|
}
|
|
870
|
-
return /* @__PURE__ */
|
|
871
|
-
/* @__PURE__ */
|
|
875
|
+
return /* @__PURE__ */ E(f, { children: [
|
|
876
|
+
/* @__PURE__ */ E(
|
|
872
877
|
"div",
|
|
873
878
|
{
|
|
874
879
|
className: `builder-columns ${e.builderBlock.id}-breakpoints div-53636e90`,
|
|
875
880
|
style: V(),
|
|
876
881
|
children: [
|
|
877
|
-
/* @__PURE__ */ r(f, { children: /* @__PURE__ */ r(K, { styles:
|
|
878
|
-
(
|
|
882
|
+
/* @__PURE__ */ r(f, { children: /* @__PURE__ */ r(K, { styles: I() }) }),
|
|
883
|
+
(w = e.columns) == null ? void 0 : w.map((C, T) => /* @__PURE__ */ ke(
|
|
879
884
|
"div",
|
|
880
885
|
{
|
|
881
886
|
className: "builder-column div-53636e90-2",
|
|
882
|
-
style:
|
|
883
|
-
key:
|
|
887
|
+
style: x(T),
|
|
888
|
+
key: T
|
|
884
889
|
},
|
|
885
890
|
/* @__PURE__ */ r(
|
|
886
891
|
ie,
|
|
887
892
|
{
|
|
888
|
-
path: `component.options.columns.${
|
|
893
|
+
path: `component.options.columns.${T}.blocks`,
|
|
889
894
|
parent: e.builderBlock.id,
|
|
890
895
|
styleProp: {
|
|
891
896
|
flexGrow: "1"
|
|
@@ -972,9 +977,9 @@ function ft(e) {
|
|
|
972
977
|
};
|
|
973
978
|
return e.aspectRatio ? c : void 0;
|
|
974
979
|
}
|
|
975
|
-
return /* @__PURE__ */
|
|
976
|
-
/* @__PURE__ */
|
|
977
|
-
/* @__PURE__ */
|
|
980
|
+
return /* @__PURE__ */ E(f, { children: [
|
|
981
|
+
/* @__PURE__ */ E(f, { children: [
|
|
982
|
+
/* @__PURE__ */ E("picture", { children: [
|
|
978
983
|
n() ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */ r("source", { type: "image/webp", srcSet: n() }) }) : null,
|
|
979
984
|
/* @__PURE__ */ r(
|
|
980
985
|
"img",
|
|
@@ -1304,7 +1309,7 @@ const gt = {
|
|
|
1304
1309
|
}]
|
|
1305
1310
|
};
|
|
1306
1311
|
function yt(e) {
|
|
1307
|
-
const t = Z(null), [n, i] =
|
|
1312
|
+
const t = Z(null), [n, i] = v(() => []), [a, o] = v(() => []);
|
|
1308
1313
|
return P(() => {
|
|
1309
1314
|
var s;
|
|
1310
1315
|
if (!((s = t.current) != null && s.getElementsByTagName) || typeof window > "u")
|
|
@@ -1368,7 +1373,7 @@ const St = {
|
|
|
1368
1373
|
}]
|
|
1369
1374
|
}, vt = ["text/javascript", "application/javascript", "application/ecmascript"], pt = (e) => vt.includes(e.type);
|
|
1370
1375
|
function kt(e) {
|
|
1371
|
-
const t = Z(null), [n, i] =
|
|
1376
|
+
const t = Z(null), [n, i] = v(() => []), [a, o] = v(() => []), [l, s] = v(() => !1);
|
|
1372
1377
|
function c() {
|
|
1373
1378
|
if (!t.current || !t.current.getElementsByTagName)
|
|
1374
1379
|
return;
|
|
@@ -1377,13 +1382,13 @@ function kt(e) {
|
|
|
1377
1382
|
const g = d[u];
|
|
1378
1383
|
if (g.src && !n.includes(g.src)) {
|
|
1379
1384
|
n.push(g.src);
|
|
1380
|
-
const
|
|
1381
|
-
|
|
1385
|
+
const S = document.createElement("script");
|
|
1386
|
+
S.async = !0, S.src = g.src, document.head.appendChild(S);
|
|
1382
1387
|
} else if (pt(g) && !a.includes(g.innerText))
|
|
1383
1388
|
try {
|
|
1384
1389
|
a.push(g.innerText), new Function(g.innerText)();
|
|
1385
|
-
} catch (
|
|
1386
|
-
console.warn("`Embed`: Error running script:",
|
|
1390
|
+
} catch (S) {
|
|
1391
|
+
console.warn("`Embed`: Error running script:", S);
|
|
1387
1392
|
}
|
|
1388
1393
|
}
|
|
1389
1394
|
}
|
|
@@ -1430,8 +1435,8 @@ const Ct = {
|
|
|
1430
1435
|
let g = !1;
|
|
1431
1436
|
u.onload = () => {
|
|
1432
1437
|
g = !0, c(u);
|
|
1433
|
-
}, u.addEventListener("error", (
|
|
1434
|
-
console.warn("Image load failed",
|
|
1438
|
+
}, u.addEventListener("error", (S) => {
|
|
1439
|
+
console.warn("Image load failed", S.error), d(S.error);
|
|
1435
1440
|
}), u.src = l, setTimeout(() => {
|
|
1436
1441
|
g || d(new Error("Image load timed out"));
|
|
1437
1442
|
}, s);
|
|
@@ -1746,7 +1751,7 @@ function Bt(e) {
|
|
|
1746
1751
|
...t()
|
|
1747
1752
|
};
|
|
1748
1753
|
}
|
|
1749
|
-
return /* @__PURE__ */
|
|
1754
|
+
return /* @__PURE__ */ E(
|
|
1750
1755
|
"div",
|
|
1751
1756
|
{
|
|
1752
1757
|
style: {
|
|
@@ -2014,7 +2019,7 @@ const Mt = (e, t, n = !0) => {
|
|
|
2014
2019
|
builderElementIndex: n && i ? [].slice.call(document.getElementsByClassName(i)).indexOf(n) : void 0
|
|
2015
2020
|
}
|
|
2016
2021
|
};
|
|
2017
|
-
}, Ot = "0.7.
|
|
2022
|
+
}, Ot = "0.7.6", Kt = () => {
|
|
2018
2023
|
Ne("insertMenu", {
|
|
2019
2024
|
name: "_default",
|
|
2020
2025
|
default: !0,
|
|
@@ -2067,8 +2072,8 @@ const Ht = (e = {}) => {
|
|
|
2067
2072
|
let u, g = null;
|
|
2068
2073
|
try {
|
|
2069
2074
|
u = d.apply(null, s);
|
|
2070
|
-
} catch (
|
|
2071
|
-
g =
|
|
2075
|
+
} catch (S) {
|
|
2076
|
+
g = S;
|
|
2072
2077
|
}
|
|
2073
2078
|
g ? (a = window.parent) == null || a.postMessage({
|
|
2074
2079
|
type: "builder.evaluateError",
|
|
@@ -2076,13 +2081,13 @@ const Ht = (e = {}) => {
|
|
|
2076
2081
|
id: c,
|
|
2077
2082
|
error: g.message
|
|
2078
2083
|
}
|
|
2079
|
-
}, "*") : u && typeof u.then == "function" ? u.then((
|
|
2084
|
+
}, "*") : u && typeof u.then == "function" ? u.then((S) => {
|
|
2080
2085
|
var V;
|
|
2081
2086
|
(V = window.parent) == null || V.postMessage({
|
|
2082
2087
|
type: "builder.evaluateResult",
|
|
2083
2088
|
data: {
|
|
2084
2089
|
id: c,
|
|
2085
|
-
result:
|
|
2090
|
+
result: S
|
|
2086
2091
|
}
|
|
2087
2092
|
}, "*");
|
|
2088
2093
|
}).catch(console.error) : (o = window.parent) == null || o.postMessage({
|
|
@@ -2099,9 +2104,9 @@ const Ht = (e = {}) => {
|
|
|
2099
2104
|
};
|
|
2100
2105
|
function zt(e) {
|
|
2101
2106
|
var A, B, F, W, z, ae, oe;
|
|
2102
|
-
const t = Z(null), [n, i] =
|
|
2107
|
+
const t = Z(null), [n, i] = v(() => 0);
|
|
2103
2108
|
function a(m) {
|
|
2104
|
-
var b,
|
|
2109
|
+
var b, y, k, R, re;
|
|
2105
2110
|
const h = {
|
|
2106
2111
|
...e.builderContextSignal.content,
|
|
2107
2112
|
...m,
|
|
@@ -2110,9 +2115,9 @@ function zt(e) {
|
|
|
2110
2115
|
...m == null ? void 0 : m.data
|
|
2111
2116
|
},
|
|
2112
2117
|
meta: {
|
|
2113
|
-
...(
|
|
2118
|
+
...(y = e.builderContextSignal.content) == null ? void 0 : y.meta,
|
|
2114
2119
|
...m == null ? void 0 : m.meta,
|
|
2115
|
-
breakpoints: ((k = m == null ? void 0 : m.meta) == null ? void 0 : k.breakpoints) || ((re = (
|
|
2120
|
+
breakpoints: ((k = m == null ? void 0 : m.meta) == null ? void 0 : k.breakpoints) || ((re = (R = e.builderContextSignal.content) == null ? void 0 : R.meta) == null ? void 0 : re.breakpoints)
|
|
2116
2121
|
}
|
|
2117
2122
|
};
|
|
2118
2123
|
e.setBuilderContextSignal((Be) => ({
|
|
@@ -2120,8 +2125,8 @@ function zt(e) {
|
|
|
2120
2125
|
content: h
|
|
2121
2126
|
}));
|
|
2122
2127
|
}
|
|
2123
|
-
|
|
2124
|
-
const [o, l] =
|
|
2128
|
+
v(() => 0);
|
|
2129
|
+
const [o, l] = v(
|
|
2125
2130
|
() => !1
|
|
2126
2131
|
);
|
|
2127
2132
|
function s(m) {
|
|
@@ -2130,8 +2135,8 @@ function zt(e) {
|
|
|
2130
2135
|
if (h)
|
|
2131
2136
|
switch (h.type) {
|
|
2132
2137
|
case "builder.configureSdk": {
|
|
2133
|
-
const
|
|
2134
|
-
if (!
|
|
2138
|
+
const y = h.data, { breakpoints: k, contentId: R } = y;
|
|
2139
|
+
if (!R || R !== ((b = e.builderContextSignal.content) == null ? void 0 : b.id))
|
|
2135
2140
|
return;
|
|
2136
2141
|
k && a({
|
|
2137
2142
|
meta: {
|
|
@@ -2141,8 +2146,8 @@ function zt(e) {
|
|
|
2141
2146
|
break;
|
|
2142
2147
|
}
|
|
2143
2148
|
case "builder.contentUpdate": {
|
|
2144
|
-
const
|
|
2145
|
-
k === e.model && (a(
|
|
2149
|
+
const y = h.data, k = y.key || y.alias || y.entry || y.modelName, R = y.data;
|
|
2150
|
+
k === e.model && (a(R), i(n + 1));
|
|
2146
2151
|
break;
|
|
2147
2152
|
}
|
|
2148
2153
|
}
|
|
@@ -2158,24 +2163,24 @@ function zt(e) {
|
|
|
2158
2163
|
rootSetState: e.builderContextSignal.rootSetState
|
|
2159
2164
|
});
|
|
2160
2165
|
}
|
|
2161
|
-
const [d, u] =
|
|
2166
|
+
const [d, u] = v(() => ({})), [g, S] = v(() => !1);
|
|
2162
2167
|
function V(m) {
|
|
2163
2168
|
var h, b;
|
|
2164
2169
|
if (e.builderContextSignal.content) {
|
|
2165
|
-
const
|
|
2170
|
+
const y = (h = e.builderContextSignal.content) == null ? void 0 : h.testVariationId, k = (b = e.builderContextSignal.content) == null ? void 0 : b.id;
|
|
2166
2171
|
ce({
|
|
2167
2172
|
type: "click",
|
|
2168
2173
|
canTrack: U(e.canTrack),
|
|
2169
2174
|
contentId: k,
|
|
2170
2175
|
apiKey: e.apiKey,
|
|
2171
|
-
variationId:
|
|
2176
|
+
variationId: y !== k ? y : void 0,
|
|
2172
2177
|
...Dt(m),
|
|
2173
2178
|
unique: !g
|
|
2174
2179
|
});
|
|
2175
2180
|
}
|
|
2176
|
-
g ||
|
|
2181
|
+
g || S(!0);
|
|
2177
2182
|
}
|
|
2178
|
-
function
|
|
2183
|
+
function x(m) {
|
|
2179
2184
|
return m.replace(
|
|
2180
2185
|
/{{([^}]+)}}/g,
|
|
2181
2186
|
(h, b) => _({
|
|
@@ -2189,30 +2194,30 @@ function zt(e) {
|
|
|
2189
2194
|
}
|
|
2190
2195
|
function p({ url: m, key: h }) {
|
|
2191
2196
|
_e(m).then((b) => b.json()).then((b) => {
|
|
2192
|
-
var k,
|
|
2193
|
-
const
|
|
2197
|
+
var k, R;
|
|
2198
|
+
const y = {
|
|
2194
2199
|
...e.builderContextSignal.rootState,
|
|
2195
2200
|
[h]: b
|
|
2196
2201
|
};
|
|
2197
|
-
(
|
|
2202
|
+
(R = (k = e.builderContextSignal).rootSetState) == null || R.call(k, y), d[h] = !0;
|
|
2198
2203
|
}).catch((b) => {
|
|
2199
2204
|
console.error("error fetching dynamic data", m, b);
|
|
2200
2205
|
});
|
|
2201
2206
|
}
|
|
2202
|
-
function
|
|
2207
|
+
function I() {
|
|
2203
2208
|
var h, b;
|
|
2204
2209
|
const m = ((b = (h = e.builderContextSignal.content) == null ? void 0 : h.data) == null ? void 0 : b.httpRequests) ?? {};
|
|
2205
|
-
Object.entries(m).forEach(([
|
|
2206
|
-
if (k && (!d[
|
|
2207
|
-
const
|
|
2210
|
+
Object.entries(m).forEach(([y, k]) => {
|
|
2211
|
+
if (k && (!d[y] || $())) {
|
|
2212
|
+
const R = x(k);
|
|
2208
2213
|
p({
|
|
2209
|
-
url:
|
|
2210
|
-
key:
|
|
2214
|
+
url: R,
|
|
2215
|
+
key: y
|
|
2211
2216
|
});
|
|
2212
2217
|
}
|
|
2213
2218
|
});
|
|
2214
2219
|
}
|
|
2215
|
-
function
|
|
2220
|
+
function w() {
|
|
2216
2221
|
$() && window.dispatchEvent(
|
|
2217
2222
|
new CustomEvent(
|
|
2218
2223
|
"builder:component:stateChange",
|
|
@@ -2241,24 +2246,24 @@ function zt(e) {
|
|
|
2241
2246
|
}), Object.values(
|
|
2242
2247
|
e.builderContextSignal.componentInfos
|
|
2243
2248
|
).forEach((h) => {
|
|
2244
|
-
var
|
|
2249
|
+
var y;
|
|
2245
2250
|
const b = We(h);
|
|
2246
|
-
(
|
|
2251
|
+
(y = window.parent) == null || y.postMessage(b, "*");
|
|
2247
2252
|
}), window.addEventListener(
|
|
2248
2253
|
"builder:component:stateChangeListenerActivated",
|
|
2249
|
-
|
|
2254
|
+
w
|
|
2250
2255
|
);
|
|
2251
2256
|
}
|
|
2252
|
-
function
|
|
2253
|
-
const h = new URL(location.href).searchParams, b = h.get("builder.preview"),
|
|
2257
|
+
function T(m) {
|
|
2258
|
+
const h = new URL(location.href).searchParams, b = h.get("builder.preview"), y = h.get(
|
|
2254
2259
|
`builder.preview.${b}`
|
|
2255
2260
|
), k = h.get("apiKey") || h.get("builder.space");
|
|
2256
|
-
b === e.model && k === e.apiKey && (!e.content ||
|
|
2261
|
+
b === e.model && k === e.apiKey && (!e.content || y === e.content.id) && Ce({
|
|
2257
2262
|
model: e.model,
|
|
2258
2263
|
apiKey: e.apiKey,
|
|
2259
2264
|
apiVersion: e.builderContextSignal.apiVersion
|
|
2260
|
-
}).then((
|
|
2261
|
-
|
|
2265
|
+
}).then((R) => {
|
|
2266
|
+
R && a(R);
|
|
2262
2267
|
});
|
|
2263
2268
|
}
|
|
2264
2269
|
return P(() => {
|
|
@@ -2277,25 +2282,25 @@ function zt(e) {
|
|
|
2277
2282
|
var m;
|
|
2278
2283
|
return (m = t.current) == null || m.addEventListener(
|
|
2279
2284
|
"initpreviewingbldr",
|
|
2280
|
-
|
|
2285
|
+
T
|
|
2281
2286
|
), () => {
|
|
2282
2287
|
var h;
|
|
2283
2288
|
return (h = t.current) == null ? void 0 : h.removeEventListener(
|
|
2284
2289
|
"initpreviewingbldr",
|
|
2285
|
-
|
|
2290
|
+
T
|
|
2286
2291
|
);
|
|
2287
2292
|
};
|
|
2288
2293
|
}, []), P(() => {
|
|
2289
2294
|
var m, h;
|
|
2290
2295
|
if (N()) {
|
|
2291
2296
|
if ($() && t.current && t.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && U(e.canTrack)) {
|
|
2292
|
-
const
|
|
2297
|
+
const y = (m = e.builderContextSignal.content) == null ? void 0 : m.testVariationId, k = (h = e.builderContextSignal.content) == null ? void 0 : h.id, R = e.apiKey;
|
|
2293
2298
|
ce({
|
|
2294
2299
|
type: "impression",
|
|
2295
2300
|
canTrack: !0,
|
|
2296
2301
|
contentId: k,
|
|
2297
|
-
apiKey:
|
|
2298
|
-
variationId:
|
|
2302
|
+
apiKey: R,
|
|
2303
|
+
variationId: y !== k ? y : void 0
|
|
2299
2304
|
});
|
|
2300
2305
|
}
|
|
2301
2306
|
Fe() && t.current && t.current.dispatchEvent(new CustomEvent("initpreviewingbldr"));
|
|
@@ -2303,7 +2308,7 @@ function zt(e) {
|
|
|
2303
2308
|
}, []), P(() => {
|
|
2304
2309
|
e.apiKey || M.error(
|
|
2305
2310
|
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
2306
|
-
), c(),
|
|
2311
|
+
), c(), I(), w();
|
|
2307
2312
|
}, []), P(() => {
|
|
2308
2313
|
e.content && a(e.content);
|
|
2309
2314
|
}, [e.content]), P(() => {
|
|
@@ -2313,13 +2318,13 @@ function zt(e) {
|
|
|
2313
2318
|
(B = (A = e.builderContextSignal.content) == null ? void 0 : A.data) == null ? void 0 : B.jsCode,
|
|
2314
2319
|
e.builderContextSignal.rootState
|
|
2315
2320
|
]), P(() => {
|
|
2316
|
-
|
|
2321
|
+
I();
|
|
2317
2322
|
}, [(W = (F = e.builderContextSignal.content) == null ? void 0 : F.data) == null ? void 0 : W.httpRequests]), P(() => {
|
|
2318
|
-
|
|
2323
|
+
w();
|
|
2319
2324
|
}, [e.builderContextSignal.rootState]), P(() => () => {
|
|
2320
2325
|
N() && (window.removeEventListener("message", s), window.removeEventListener(
|
|
2321
2326
|
"builder:component:stateChangeListenerActivated",
|
|
2322
|
-
|
|
2327
|
+
w
|
|
2323
2328
|
));
|
|
2324
2329
|
}, []), /* @__PURE__ */ r(te.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */ ke(
|
|
2325
2330
|
"div",
|
|
@@ -2374,7 +2379,7 @@ font-weight: ${l};
|
|
|
2374
2379
|
contentId: t
|
|
2375
2380
|
}) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "";
|
|
2376
2381
|
function Gt(e) {
|
|
2377
|
-
const [t, n] =
|
|
2382
|
+
const [t, n] = v(
|
|
2378
2383
|
() => `
|
|
2379
2384
|
${Qt({
|
|
2380
2385
|
cssCode: e.cssCode,
|
|
@@ -2406,22 +2411,17 @@ const Jt = ({
|
|
|
2406
2411
|
locale: n
|
|
2407
2412
|
}) => {
|
|
2408
2413
|
var o, l, s;
|
|
2409
|
-
const i = {};
|
|
2410
|
-
(
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
...(s = e == null ? void 0 : e.data) == null ? void 0 : s.state,
|
|
2414
|
+
const i = {}, a = ((o = e == null ? void 0 : e.data) == null ? void 0 : o.state) || {};
|
|
2415
|
+
return (s = (l = e == null ? void 0 : e.data) == null ? void 0 : l.inputs) == null || s.forEach((c) => {
|
|
2416
|
+
c.name && c.defaultValue !== void 0 && (i[c.name] = c.defaultValue);
|
|
2417
|
+
}), {
|
|
2418
|
+
...i,
|
|
2419
|
+
...a,
|
|
2416
2420
|
...t,
|
|
2417
2421
|
...n ? {
|
|
2418
2422
|
locale: n
|
|
2419
2423
|
} : {}
|
|
2420
2424
|
};
|
|
2421
|
-
return {
|
|
2422
|
-
...i,
|
|
2423
|
-
...a
|
|
2424
|
-
};
|
|
2425
2425
|
}, Xt = ({
|
|
2426
2426
|
content: e,
|
|
2427
2427
|
data: t
|
|
@@ -2434,25 +2434,25 @@ const Jt = ({
|
|
|
2434
2434
|
meta: e == null ? void 0 : e.meta
|
|
2435
2435
|
} : void 0;
|
|
2436
2436
|
function ve(e) {
|
|
2437
|
-
var c, d, u, g,
|
|
2438
|
-
const [t, n] =
|
|
2437
|
+
var c, d, u, g, S, V, x;
|
|
2438
|
+
const [t, n] = v(
|
|
2439
2439
|
() => {
|
|
2440
|
-
var p,
|
|
2440
|
+
var p, I;
|
|
2441
2441
|
return jt({
|
|
2442
2442
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2443
2443
|
variationId: (p = e.content) == null ? void 0 : p.testVariationId,
|
|
2444
2444
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2445
|
-
contentId: (
|
|
2445
|
+
contentId: (I = e.content) == null ? void 0 : I.id
|
|
2446
2446
|
});
|
|
2447
2447
|
}
|
|
2448
2448
|
);
|
|
2449
2449
|
function i(p) {
|
|
2450
|
-
s((
|
|
2451
|
-
...
|
|
2450
|
+
s((I) => ({
|
|
2451
|
+
...I,
|
|
2452
2452
|
rootState: p
|
|
2453
2453
|
}));
|
|
2454
2454
|
}
|
|
2455
|
-
const [a, o] =
|
|
2455
|
+
const [a, o] = v(
|
|
2456
2456
|
() => [
|
|
2457
2457
|
...be(),
|
|
2458
2458
|
// While this `components` object is deprecated, we must maintain support for it.
|
|
@@ -2463,16 +2463,16 @@ function ve(e) {
|
|
|
2463
2463
|
...se,
|
|
2464
2464
|
...e.customComponents || []
|
|
2465
2465
|
].reduce(
|
|
2466
|
-
(p, { component:
|
|
2466
|
+
(p, { component: I, ...w }) => ({
|
|
2467
2467
|
...p,
|
|
2468
|
-
[
|
|
2469
|
-
component:
|
|
2470
|
-
...de(
|
|
2468
|
+
[w.name]: {
|
|
2469
|
+
component: I,
|
|
2470
|
+
...de(w)
|
|
2471
2471
|
}
|
|
2472
2472
|
}),
|
|
2473
2473
|
{}
|
|
2474
2474
|
)
|
|
2475
|
-
), [l, s] =
|
|
2475
|
+
), [l, s] = v(() => ({
|
|
2476
2476
|
content: Xt({
|
|
2477
2477
|
content: e.content,
|
|
2478
2478
|
data: e.data
|
|
@@ -2497,9 +2497,9 @@ function ve(e) {
|
|
|
2497
2497
|
...se,
|
|
2498
2498
|
...e.customComponents || []
|
|
2499
2499
|
].reduce(
|
|
2500
|
-
(p, { component:
|
|
2500
|
+
(p, { component: I, ...w }) => ({
|
|
2501
2501
|
...p,
|
|
2502
|
-
[
|
|
2502
|
+
[w.name]: de(w)
|
|
2503
2503
|
}),
|
|
2504
2504
|
{}
|
|
2505
2505
|
),
|
|
@@ -2511,7 +2511,7 @@ function ve(e) {
|
|
|
2511
2511
|
value: {
|
|
2512
2512
|
registeredComponents: a
|
|
2513
2513
|
},
|
|
2514
|
-
children: /* @__PURE__ */
|
|
2514
|
+
children: /* @__PURE__ */ E(
|
|
2515
2515
|
zt,
|
|
2516
2516
|
{
|
|
2517
2517
|
content: e.content,
|
|
@@ -2532,13 +2532,13 @@ function ve(e) {
|
|
|
2532
2532
|
{
|
|
2533
2533
|
contentId: (c = l.content) == null ? void 0 : c.id,
|
|
2534
2534
|
cssCode: (u = (d = l.content) == null ? void 0 : d.data) == null ? void 0 : u.cssCode,
|
|
2535
|
-
customFonts: (
|
|
2535
|
+
customFonts: (S = (g = l.content) == null ? void 0 : g.data) == null ? void 0 : S.customFonts
|
|
2536
2536
|
}
|
|
2537
2537
|
) }),
|
|
2538
2538
|
/* @__PURE__ */ r(
|
|
2539
2539
|
ie,
|
|
2540
2540
|
{
|
|
2541
|
-
blocks: (
|
|
2541
|
+
blocks: (x = (V = l.content) == null ? void 0 : V.data) == null ? void 0 : x.blocks,
|
|
2542
2542
|
context: l,
|
|
2543
2543
|
registeredComponents: a
|
|
2544
2544
|
}
|
|
@@ -2551,7 +2551,7 @@ function ve(e) {
|
|
|
2551
2551
|
}
|
|
2552
2552
|
function Ae(e) {
|
|
2553
2553
|
var l, s;
|
|
2554
|
-
const [t, n] =
|
|
2554
|
+
const [t, n] = v(
|
|
2555
2555
|
() => Ft({
|
|
2556
2556
|
canTrack: U(e.canTrack),
|
|
2557
2557
|
content: e.content
|
|
@@ -2581,9 +2581,9 @@ function Ae(e) {
|
|
|
2581
2581
|
});
|
|
2582
2582
|
}
|
|
2583
2583
|
return P(() => {
|
|
2584
|
-
}, []), /* @__PURE__ */
|
|
2584
|
+
}, []), /* @__PURE__ */ E(f, { children: [
|
|
2585
2585
|
!e.__isNestedRender && L !== "reactNative" ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */ r(X, { scriptStr: _t() }) }) : null,
|
|
2586
|
-
t ? /* @__PURE__ */
|
|
2586
|
+
t ? /* @__PURE__ */ E(f, { children: [
|
|
2587
2587
|
/* @__PURE__ */ r(
|
|
2588
2588
|
K,
|
|
2589
2589
|
{
|
|
@@ -2662,7 +2662,7 @@ function en(e) {
|
|
|
2662
2662
|
(d = e.symbol) != null && d.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
2663
2663
|
].filter(Boolean).join(" ");
|
|
2664
2664
|
}
|
|
2665
|
-
const [n, i] =
|
|
2665
|
+
const [n, i] = v(() => {
|
|
2666
2666
|
var c;
|
|
2667
2667
|
return (c = e.symbol) == null ? void 0 : c.content;
|
|
2668
2668
|
});
|