@builder.io/sdk-react-nextjs 0.12.1 → 0.12.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/USE_CLIENT_BUNDLE-64b6ec10.cjs +21 -0
- package/lib/browser/USE_CLIENT_BUNDLE-e89d3175.js +713 -0
- package/lib/{edge/USE_SERVER_BUNDLE-231b55dd.js → browser/USE_SERVER_BUNDLE-d6bec4ec.js} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-24df6623.cjs → browser/USE_SERVER_BUNDLE-f34c0814.cjs} +1 -1
- package/lib/browser/bundle-50ff23eb.cjs +172 -0
- package/lib/browser/{bundle-7e2a44d9.js → bundle-f3e8cd29.js} +576 -573
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +17 -17
- package/lib/edge/USE_CLIENT_BUNDLE-2aed408a.cjs +21 -0
- package/lib/edge/USE_CLIENT_BUNDLE-a3258a60.js +713 -0
- package/lib/{node/USE_SERVER_BUNDLE-33c309df.js → edge/USE_SERVER_BUNDLE-4e9af8f5.js} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-93366161.cjs → edge/USE_SERVER_BUNDLE-e79e6b55.cjs} +1 -1
- package/lib/edge/{bundle-44392f6d.js → bundle-cb191300.js} +811 -808
- package/lib/edge/{bundle-6d55a6a7.cjs → bundle-d4f509a3.cjs} +37 -33
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +17 -17
- package/lib/node/USE_CLIENT_BUNDLE-98a4fbf4.js +713 -0
- package/lib/node/USE_CLIENT_BUNDLE-990b655a.cjs +21 -0
- package/lib/{browser/USE_SERVER_BUNDLE-153f7d4b.js → node/USE_SERVER_BUNDLE-b231d861.js} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-a0bf6d8f.cjs → node/USE_SERVER_BUNDLE-c86a1fb8.cjs} +1 -1
- package/lib/node/{bundle-217b5738.js → bundle-11daeaca.js} +166 -163
- package/lib/node/{bundle-b9af39ec.cjs → bundle-b2d68b60.cjs} +11 -7
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +17 -17
- package/package.json +1 -1
- package/types/cjs/components/block/block.helpers.d.ts +0 -1
- package/types/cjs/components/block/components/block-wrapper.d.ts +2 -6
- package/types/cjs/components/content-variants/content-variants.types.d.ts +4 -0
- package/types/cjs/components/dynamic-renderer/dynamic-renderer.d.ts +8 -0
- package/types/cjs/components/dynamic-renderer/dynamic-renderer.helpers.d.ts +1 -0
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/functions/is-from-trusted-host.d.ts +3 -0
- package/types/cjs/scripts/init-editing.d.ts +1 -0
- package/types/esm/components/block/block.helpers.d.ts +0 -1
- package/types/esm/components/block/components/block-wrapper.d.ts +2 -6
- package/types/esm/components/content-variants/content-variants.types.d.ts +4 -0
- package/types/esm/components/dynamic-renderer/dynamic-renderer.d.ts +8 -0
- package/types/esm/components/dynamic-renderer/dynamic-renderer.helpers.d.ts +1 -0
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/functions/is-from-trusted-host.d.ts +3 -0
- package/types/esm/scripts/init-editing.d.ts +1 -0
- package/lib/browser/USE_CLIENT_BUNDLE-5457b97e.cjs +0 -23
- package/lib/browser/USE_CLIENT_BUNDLE-ac9ba054.js +0 -732
- package/lib/browser/bundle-6435b7fb.cjs +0 -168
- package/lib/edge/USE_CLIENT_BUNDLE-3049fd56.js +0 -732
- package/lib/edge/USE_CLIENT_BUNDLE-8922846d.cjs +0 -23
- package/lib/node/USE_CLIENT_BUNDLE-09122ff1.cjs +0 -23
- package/lib/node/USE_CLIENT_BUNDLE-f4804af3.js +0 -732
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LRUCache } from "lru-cache";
|
|
2
2
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { createElement } from "react";
|
|
4
|
-
import { I as InteractiveElement, B as BlockWrapper, a as BlocksWrapper, b as Button, C as CustomCode, E as Embed, F as FragmentComponent, c as Image, d as ImgComponent, S as SectionComponent, V as Video, e as EnableEditor } from "./USE_CLIENT_BUNDLE-
|
|
4
|
+
import { I as InteractiveElement, B as BlockWrapper, a as BlocksWrapper, b as Button, C as CustomCode, E as Embed, F as FragmentComponent, c as Image, d as ImgComponent, S as SectionComponent, V as Video, e as EnableEditor } from "./USE_CLIENT_BUNDLE-98a4fbf4.js";
|
|
5
5
|
import "next/navigation";
|
|
6
6
|
function getBlockComponentOptions(e) {
|
|
7
7
|
var t;
|
|
@@ -187,21 +187,21 @@ output;
|
|
|
187
187
|
context: n,
|
|
188
188
|
event: o,
|
|
189
189
|
state: s
|
|
190
|
-
}), m = getIsolateContext(),
|
|
191
|
-
|
|
192
|
-
console.log(...
|
|
193
|
-
}),
|
|
194
|
-
set(a,
|
|
195
|
-
}), c.forEach(([
|
|
196
|
-
const l = typeof
|
|
190
|
+
}), m = getIsolateContext(), f = m.global;
|
|
191
|
+
f.setSync("global", f.derefInto()), f.setSync("log", function(...d) {
|
|
192
|
+
console.log(...d);
|
|
193
|
+
}), f.setSync(BUILDER_SET_STATE_NAME, function(d, u) {
|
|
194
|
+
set(a, d, u), i == null || i(a);
|
|
195
|
+
}), c.forEach(([d, u]) => {
|
|
196
|
+
const l = typeof u == "object" ? new ivm.Reference(
|
|
197
197
|
// workaround: methods with default values for arguments is not being cloned over
|
|
198
|
-
|
|
199
|
-
...
|
|
200
|
-
getUserAttributes: () =>
|
|
201
|
-
} :
|
|
198
|
+
d === "builder" ? {
|
|
199
|
+
...u,
|
|
200
|
+
getUserAttributes: () => u.getUserAttributes()
|
|
201
|
+
} : u
|
|
202
202
|
) : null;
|
|
203
|
-
|
|
204
|
-
}),
|
|
203
|
+
f.setSync(getSyncValName(d), l);
|
|
204
|
+
}), f.setSync(INJECTED_IVM_GLOBAL, ivm);
|
|
205
205
|
const p = processCode({
|
|
206
206
|
code: e,
|
|
207
207
|
args: c
|
|
@@ -295,7 +295,7 @@ function getProcessedBlock({
|
|
|
295
295
|
context: t
|
|
296
296
|
}) : a;
|
|
297
297
|
}
|
|
298
|
-
const
|
|
298
|
+
const getComponent = ({
|
|
299
299
|
block: e,
|
|
300
300
|
context: t,
|
|
301
301
|
registeredComponents: n
|
|
@@ -433,28 +433,28 @@ function BlockStyles(e) {
|
|
|
433
433
|
shouldEvaluateBindings: !0
|
|
434
434
|
}), i = r.responsiveStyles, a = e.context.content, s = getSizesForBreakpoints(
|
|
435
435
|
((l = a == null ? void 0 : a.meta) == null ? void 0 : l.breakpoints) || {}
|
|
436
|
-
), c = i == null ? void 0 : i.large, m = i == null ? void 0 : i.medium,
|
|
436
|
+
), c = i == null ? void 0 : i.large, m = i == null ? void 0 : i.medium, f = i == null ? void 0 : i.small, p = r.id;
|
|
437
437
|
if (!p)
|
|
438
438
|
return "";
|
|
439
439
|
const g = c ? createCssClass({
|
|
440
440
|
className: p,
|
|
441
441
|
styles: c
|
|
442
|
-
}) : "",
|
|
442
|
+
}) : "", d = m ? createCssClass({
|
|
443
443
|
className: p,
|
|
444
444
|
styles: m,
|
|
445
445
|
mediaQuery: getMaxWidthQueryForSize(
|
|
446
446
|
"medium",
|
|
447
447
|
s
|
|
448
448
|
)
|
|
449
|
-
}) : "",
|
|
449
|
+
}) : "", u = f ? createCssClass({
|
|
450
450
|
className: p,
|
|
451
|
-
styles:
|
|
451
|
+
styles: f,
|
|
452
452
|
mediaQuery: getMaxWidthQueryForSize(
|
|
453
453
|
"small",
|
|
454
454
|
s
|
|
455
455
|
)
|
|
456
456
|
}) : "";
|
|
457
|
-
return [g,
|
|
457
|
+
return [g, d, u].join(" ");
|
|
458
458
|
};
|
|
459
459
|
return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: n() }) }) : null });
|
|
460
460
|
}
|
|
@@ -529,7 +529,7 @@ function getStyleAttribute(e) {
|
|
|
529
529
|
return e;
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
|
-
const getWrapperProps = ({
|
|
532
|
+
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()), getWrapperProps = ({
|
|
533
533
|
componentOptions: e,
|
|
534
534
|
builderBlock: t,
|
|
535
535
|
context: n,
|
|
@@ -598,7 +598,7 @@ function RepeatedBlock(e) {
|
|
|
598
598
|
);
|
|
599
599
|
}
|
|
600
600
|
function Block(e) {
|
|
601
|
-
var m,
|
|
601
|
+
var m, f, p;
|
|
602
602
|
const t = function() {
|
|
603
603
|
return getComponent({
|
|
604
604
|
block: e.block,
|
|
@@ -611,8 +611,8 @@ function Block(e) {
|
|
|
611
611
|
context: e.context
|
|
612
612
|
});
|
|
613
613
|
}, o = function() {
|
|
614
|
-
var
|
|
615
|
-
return (
|
|
614
|
+
var d;
|
|
615
|
+
return (d = e.block.repeat) != null && d.collection ? e.block : getProcessedBlock({
|
|
616
616
|
block: e.block,
|
|
617
617
|
localState: e.context.localState,
|
|
618
618
|
rootState: e.context.rootState,
|
|
@@ -626,20 +626,20 @@ function Block(e) {
|
|
|
626
626
|
var l, h;
|
|
627
627
|
if ((l = e.block.repeat) != null && l.collection)
|
|
628
628
|
return !!((h = n()) != null && h.length);
|
|
629
|
-
const
|
|
630
|
-
return ("show" in o() ? o().show : !0) && !
|
|
629
|
+
const d = "hide" in o() ? o().hide : !1;
|
|
630
|
+
return ("show" in o() ? o().show : !0) && !d;
|
|
631
631
|
}, a = function() {
|
|
632
|
-
var
|
|
633
|
-
return !((
|
|
632
|
+
var u;
|
|
633
|
+
return !((u = t()) != null && u.component) && !n() ? o().children ?? [] : [];
|
|
634
634
|
}, s = function() {
|
|
635
|
-
var
|
|
635
|
+
var d, u, l, h, y;
|
|
636
636
|
return {
|
|
637
637
|
blockChildren: o().children ?? [],
|
|
638
|
-
componentRef: (
|
|
638
|
+
componentRef: (d = t()) == null ? void 0 : d.component,
|
|
639
639
|
componentOptions: {
|
|
640
640
|
...getBlockComponentOptions(o()),
|
|
641
641
|
builderContext: e.context,
|
|
642
|
-
...((
|
|
642
|
+
...((u = t()) == null ? void 0 : u.name) === "Symbol" || ((l = t()) == null ? void 0 : l.name) === "Columns" ? {
|
|
643
643
|
builderComponents: e.registeredComponents
|
|
644
644
|
} : {}
|
|
645
645
|
},
|
|
@@ -664,59 +664,46 @@ function Block(e) {
|
|
|
664
664
|
includeBlockProps: s().includeBlockProps,
|
|
665
665
|
isInteractive: s().isInteractive
|
|
666
666
|
}
|
|
667
|
-
) }) : /* @__PURE__ */
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
(p = a()) == null ? void 0 : p.map((g) => /* @__PURE__ */ jsx(
|
|
708
|
-
Block,
|
|
709
|
-
{
|
|
710
|
-
block: g,
|
|
711
|
-
context: c,
|
|
712
|
-
registeredComponents: e.registeredComponents
|
|
713
|
-
},
|
|
714
|
-
g.id
|
|
715
|
-
))
|
|
716
|
-
]
|
|
717
|
-
}
|
|
718
|
-
) }) : null
|
|
719
|
-
] })
|
|
667
|
+
) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (p = n()) == null ? void 0 : p.map((g, d) => /* @__PURE__ */ jsx(
|
|
668
|
+
RepeatedBlock,
|
|
669
|
+
{
|
|
670
|
+
repeatContext: g.context,
|
|
671
|
+
block: g.block,
|
|
672
|
+
registeredComponents: e.registeredComponents
|
|
673
|
+
},
|
|
674
|
+
d
|
|
675
|
+
)) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
676
|
+
BlockWrapper,
|
|
677
|
+
{
|
|
678
|
+
Wrapper: r(),
|
|
679
|
+
block: o(),
|
|
680
|
+
context: e.context,
|
|
681
|
+
children: [
|
|
682
|
+
/* @__PURE__ */ jsx(
|
|
683
|
+
ComponentRef,
|
|
684
|
+
{
|
|
685
|
+
componentRef: s().componentRef,
|
|
686
|
+
componentOptions: s().componentOptions,
|
|
687
|
+
blockChildren: s().blockChildren,
|
|
688
|
+
context: s().context,
|
|
689
|
+
registeredComponents: s().registeredComponents,
|
|
690
|
+
builderBlock: s().builderBlock,
|
|
691
|
+
includeBlockProps: s().includeBlockProps,
|
|
692
|
+
isInteractive: s().isInteractive
|
|
693
|
+
}
|
|
694
|
+
),
|
|
695
|
+
(f = a()) == null ? void 0 : f.map((g) => /* @__PURE__ */ jsx(
|
|
696
|
+
Block,
|
|
697
|
+
{
|
|
698
|
+
block: g,
|
|
699
|
+
context: c,
|
|
700
|
+
registeredComponents: e.registeredComponents
|
|
701
|
+
},
|
|
702
|
+
g.id
|
|
703
|
+
))
|
|
704
|
+
]
|
|
705
|
+
}
|
|
706
|
+
) }) })
|
|
720
707
|
] }) : null });
|
|
721
708
|
}
|
|
722
709
|
function Blocks(e) {
|
|
@@ -743,7 +730,7 @@ function Blocks(e) {
|
|
|
743
730
|
);
|
|
744
731
|
}
|
|
745
732
|
function Columns(e) {
|
|
746
|
-
var
|
|
733
|
+
var d;
|
|
747
734
|
const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet", r = function(l) {
|
|
748
735
|
var h;
|
|
749
736
|
return ((h = n[l]) == null ? void 0 : h.width) || 100 / n.length;
|
|
@@ -768,13 +755,13 @@ function Columns(e) {
|
|
|
768
755
|
desktopStyle: "row"
|
|
769
756
|
})
|
|
770
757
|
};
|
|
771
|
-
},
|
|
772
|
-
const h = l === 0 ? 0 : t, y = i(l), b = `${h}px`,
|
|
758
|
+
}, f = function(l) {
|
|
759
|
+
const h = l === 0 ? 0 : t, y = i(l), b = `${h}px`, I = "100%", x = 0;
|
|
773
760
|
return {
|
|
774
761
|
width: y,
|
|
775
762
|
["marginLeft"]: b,
|
|
776
763
|
"--column-width-mobile": s({
|
|
777
|
-
stackedStyle:
|
|
764
|
+
stackedStyle: I,
|
|
778
765
|
desktopStyle: y
|
|
779
766
|
}),
|
|
780
767
|
"--column-margin-left-mobile": s({
|
|
@@ -782,7 +769,7 @@ function Columns(e) {
|
|
|
782
769
|
desktopStyle: b
|
|
783
770
|
}),
|
|
784
771
|
"--column-width-tablet": a({
|
|
785
|
-
stackedStyle:
|
|
772
|
+
stackedStyle: I,
|
|
786
773
|
desktopStyle: y
|
|
787
774
|
}),
|
|
788
775
|
"--column-margin-left-tablet": a({
|
|
@@ -830,11 +817,11 @@ function Columns(e) {
|
|
|
830
817
|
style: m(),
|
|
831
818
|
children: [
|
|
832
819
|
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: g() }) }),
|
|
833
|
-
(
|
|
820
|
+
(d = e.columns) == null ? void 0 : d.map((u, l) => /* @__PURE__ */ createElement(
|
|
834
821
|
"div",
|
|
835
822
|
{
|
|
836
823
|
className: "builder-column div-39daef82-2",
|
|
837
|
-
style:
|
|
824
|
+
style: f(l),
|
|
838
825
|
key: l
|
|
839
826
|
},
|
|
840
827
|
/* @__PURE__ */ jsx(
|
|
@@ -847,7 +834,7 @@ function Columns(e) {
|
|
|
847
834
|
},
|
|
848
835
|
context: e.builderContext,
|
|
849
836
|
registeredComponents: e.builderComponents,
|
|
850
|
-
blocks:
|
|
837
|
+
blocks: u.blocks
|
|
851
838
|
}
|
|
852
839
|
)
|
|
853
840
|
))
|
|
@@ -1338,13 +1325,13 @@ const getTopLevelDomain = (e) => {
|
|
|
1338
1325
|
e.delete("srcset"), e.delete("noWebp");
|
|
1339
1326
|
function n(a, s = 6e4) {
|
|
1340
1327
|
return new Promise((c, m) => {
|
|
1341
|
-
const
|
|
1328
|
+
const f = document.createElement("img");
|
|
1342
1329
|
let p = !1;
|
|
1343
|
-
|
|
1344
|
-
p = !0, c(
|
|
1345
|
-
},
|
|
1330
|
+
f.onload = () => {
|
|
1331
|
+
p = !0, c(f);
|
|
1332
|
+
}, f.addEventListener("error", (g) => {
|
|
1346
1333
|
console.warn("Image load failed", g.error), m(g.error);
|
|
1347
|
-
}),
|
|
1334
|
+
}), f.src = a, setTimeout(() => {
|
|
1348
1335
|
p || m(new Error("Image load timed out"));
|
|
1349
1336
|
}, s);
|
|
1350
1337
|
});
|
|
@@ -1893,32 +1880,32 @@ const DEFAULT_API_VERSION = "v3", BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUIL
|
|
|
1893
1880
|
includeRefs: s = !0,
|
|
1894
1881
|
enrich: c,
|
|
1895
1882
|
locale: m,
|
|
1896
|
-
apiVersion:
|
|
1883
|
+
apiVersion: f = DEFAULT_API_VERSION,
|
|
1897
1884
|
fields: p,
|
|
1898
1885
|
omit: g,
|
|
1899
|
-
offset:
|
|
1900
|
-
cacheSeconds:
|
|
1886
|
+
offset: d,
|
|
1887
|
+
cacheSeconds: u,
|
|
1901
1888
|
staleCacheSeconds: l,
|
|
1902
1889
|
sort: h,
|
|
1903
1890
|
includeUnpublished: y
|
|
1904
1891
|
} = e;
|
|
1905
1892
|
if (!a)
|
|
1906
1893
|
throw new Error("Missing API key");
|
|
1907
|
-
if (!["v2", "v3"].includes(
|
|
1908
|
-
throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${
|
|
1894
|
+
if (!["v2", "v3"].includes(f))
|
|
1895
|
+
throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${f}'`);
|
|
1909
1896
|
(e.limit === void 0 || e.limit > 1) && !("noTraverse" in e) && (t = !0);
|
|
1910
|
-
const b = new URL(`https://cdn.builder.io/api/${
|
|
1911
|
-
if (b.searchParams.set("omit", g || "meta.componentsUsed"), p && b.searchParams.set("fields", p), Number.isFinite(
|
|
1897
|
+
const b = new URL(`https://cdn.builder.io/api/${f}/content/${i}?apiKey=${a}&limit=${n}&noTraverse=${t}&includeRefs=${s}${m ? `&locale=${m}` : ""}${c ? `&enrich=${c}` : ""}`);
|
|
1898
|
+
if (b.searchParams.set("omit", g || "meta.componentsUsed"), p && b.searchParams.set("fields", p), Number.isFinite(d) && d > -1 && b.searchParams.set("offset", String(Math.floor(d))), typeof y == "boolean" && b.searchParams.set("includeUnpublished", String(y)), u && isPositiveNumber(u) && b.searchParams.set("cacheSeconds", String(u)), l && isPositiveNumber(l) && b.searchParams.set("staleCacheSeconds", String(l)), h) {
|
|
1912
1899
|
const S = flatten({
|
|
1913
1900
|
sort: h
|
|
1914
1901
|
});
|
|
1915
1902
|
for (const C in S)
|
|
1916
1903
|
b.searchParams.set(C, JSON.stringify(S[C]));
|
|
1917
1904
|
}
|
|
1918
|
-
const
|
|
1905
|
+
const I = {
|
|
1919
1906
|
...getBuilderSearchParamsFromWindow(),
|
|
1920
1907
|
...normalizeSearchParams(e.options || {})
|
|
1921
|
-
}, x = flatten(
|
|
1908
|
+
}, x = flatten(I);
|
|
1922
1909
|
for (const S in x)
|
|
1923
1910
|
b.searchParams.set(S, String(x[S]));
|
|
1924
1911
|
if (o && b.searchParams.set("userAttributes", JSON.stringify(o)), r) {
|
|
@@ -1977,7 +1964,11 @@ async function fetchEntries(e) {
|
|
|
1977
1964
|
return logger.error("Error fetching data. ", t), null;
|
|
1978
1965
|
}
|
|
1979
1966
|
}
|
|
1980
|
-
const getAllContent = fetchEntries;
|
|
1967
|
+
const getAllContent = fetchEntries, DEFAULT_TRUSTED_HOSTS = ["*.beta.builder.io", "beta.builder.io", "builder.io", "localhost", "qa.builder.io"];
|
|
1968
|
+
function isFromTrustedHost(e, t) {
|
|
1969
|
+
const n = new URL(t.origin), o = n.hostname;
|
|
1970
|
+
return (e || DEFAULT_TRUSTED_HOSTS).findIndex((r) => r.startsWith("*.") ? o.endsWith(r.slice(1)) : r === o) > -1;
|
|
1971
|
+
}
|
|
1981
1972
|
function isPreviewing() {
|
|
1982
1973
|
return !isBrowser() || isEditing() ? !1 : location.search.indexOf("builder.preview=") !== -1;
|
|
1983
1974
|
}
|
|
@@ -2165,7 +2156,7 @@ const findParentElement = (e, t, n = !0) => {
|
|
|
2165
2156
|
builderElementIndex: n && o ? [].slice.call(document.getElementsByClassName(o)).indexOf(n) : void 0
|
|
2166
2157
|
}
|
|
2167
2158
|
};
|
|
2168
|
-
}, SDK_VERSION = "0.12.
|
|
2159
|
+
}, SDK_VERSION = "0.12.3", registry = {};
|
|
2169
2160
|
function register(e, t) {
|
|
2170
2161
|
let n = registry[e];
|
|
2171
2162
|
if (n || (n = registry[e] = []), n.push(t), isBrowser()) {
|
|
@@ -2225,40 +2216,43 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2225
2216
|
data: {
|
|
2226
2217
|
options: e
|
|
2227
2218
|
}
|
|
2228
|
-
}, "*"), window.addEventListener("message", ({
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2219
|
+
}, "*"), window.addEventListener("message", (o) => {
|
|
2220
|
+
var i, a;
|
|
2221
|
+
if (!isFromTrustedHost(e.trustedHosts, o))
|
|
2222
|
+
return;
|
|
2223
|
+
const {
|
|
2224
|
+
data: r
|
|
2225
|
+
} = o;
|
|
2226
|
+
if (r != null && r.type)
|
|
2227
|
+
switch (r.type) {
|
|
2234
2228
|
case "builder.evaluate": {
|
|
2235
|
-
const
|
|
2236
|
-
let
|
|
2229
|
+
const s = r.data.text, c = r.data.arguments || [], m = r.data.id, f = new Function(s);
|
|
2230
|
+
let p, g = null;
|
|
2237
2231
|
try {
|
|
2238
|
-
|
|
2239
|
-
} catch (
|
|
2240
|
-
|
|
2232
|
+
p = f.apply(null, c);
|
|
2233
|
+
} catch (d) {
|
|
2234
|
+
g = d;
|
|
2241
2235
|
}
|
|
2242
|
-
|
|
2236
|
+
g ? (i = window.parent) == null || i.postMessage({
|
|
2243
2237
|
type: "builder.evaluateError",
|
|
2244
2238
|
data: {
|
|
2245
|
-
id:
|
|
2246
|
-
error:
|
|
2239
|
+
id: m,
|
|
2240
|
+
error: g.message
|
|
2247
2241
|
}
|
|
2248
|
-
}, "*") :
|
|
2242
|
+
}, "*") : p && typeof p.then == "function" ? p.then((d) => {
|
|
2249
2243
|
var u;
|
|
2250
2244
|
(u = window.parent) == null || u.postMessage({
|
|
2251
2245
|
type: "builder.evaluateResult",
|
|
2252
2246
|
data: {
|
|
2253
|
-
id:
|
|
2254
|
-
result:
|
|
2247
|
+
id: m,
|
|
2248
|
+
result: d
|
|
2255
2249
|
}
|
|
2256
2250
|
}, "*");
|
|
2257
|
-
}).catch(console.error) : (
|
|
2251
|
+
}).catch(console.error) : (a = window.parent) == null || a.postMessage({
|
|
2258
2252
|
type: "builder.evaluateResult",
|
|
2259
2253
|
data: {
|
|
2260
|
-
result:
|
|
2261
|
-
id:
|
|
2254
|
+
result: p,
|
|
2255
|
+
id: m
|
|
2262
2256
|
}
|
|
2263
2257
|
}, "*");
|
|
2264
2258
|
break;
|
|
@@ -2310,6 +2304,10 @@ ${getFontCss({
|
|
|
2310
2304
|
customFonts: e.customFonts
|
|
2311
2305
|
})}
|
|
2312
2306
|
|
|
2307
|
+
.builder-button {
|
|
2308
|
+
all: unset;
|
|
2309
|
+
}
|
|
2310
|
+
|
|
2313
2311
|
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
2314
2312
|
margin: 0;
|
|
2315
2313
|
}
|
|
@@ -2354,7 +2352,7 @@ const getRootStateInitialValue = ({
|
|
|
2354
2352
|
meta: e == null ? void 0 : e.meta
|
|
2355
2353
|
} : void 0;
|
|
2356
2354
|
function ContentComponent(e) {
|
|
2357
|
-
var r, i, a, s, c, m,
|
|
2355
|
+
var r, i, a, s, c, m, f, p, g;
|
|
2358
2356
|
const t = getUpdateVariantVisibilityScript({
|
|
2359
2357
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2360
2358
|
variationId: (r = e.content) == null ? void 0 : r.testVariationId,
|
|
@@ -2370,10 +2368,10 @@ function ContentComponent(e) {
|
|
|
2370
2368
|
...components,
|
|
2371
2369
|
...e.customComponents || []
|
|
2372
2370
|
].reduce(
|
|
2373
|
-
(
|
|
2374
|
-
...
|
|
2371
|
+
(d, { component: u, ...l }) => ({
|
|
2372
|
+
...d,
|
|
2375
2373
|
[l.name]: {
|
|
2376
|
-
component:
|
|
2374
|
+
component: u,
|
|
2377
2375
|
...serializeComponentInfo(l)
|
|
2378
2376
|
}
|
|
2379
2377
|
}),
|
|
@@ -2403,8 +2401,8 @@ function ContentComponent(e) {
|
|
|
2403
2401
|
...components,
|
|
2404
2402
|
...e.customComponents || []
|
|
2405
2403
|
].reduce(
|
|
2406
|
-
(
|
|
2407
|
-
...
|
|
2404
|
+
(d, { component: u, ...l }) => ({
|
|
2405
|
+
...d,
|
|
2408
2406
|
[l.name]: serializeComponentInfo(l)
|
|
2409
2407
|
}),
|
|
2410
2408
|
{}
|
|
@@ -2429,6 +2427,7 @@ function ContentComponent(e) {
|
|
|
2429
2427
|
builderContextSignal: o,
|
|
2430
2428
|
contentWrapper: e.contentWrapper,
|
|
2431
2429
|
contentWrapperProps: e.contentWrapperProps,
|
|
2430
|
+
trustedHosts: e.trustedHosts,
|
|
2432
2431
|
children: [
|
|
2433
2432
|
e.isSsrAbTest ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedScript, { scriptStr: t }) }) : null,
|
|
2434
2433
|
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
@@ -2436,7 +2435,7 @@ function ContentComponent(e) {
|
|
|
2436
2435
|
{
|
|
2437
2436
|
contentId: (a = o.content) == null ? void 0 : a.id,
|
|
2438
2437
|
cssCode: (c = (s = o.content) == null ? void 0 : s.data) == null ? void 0 : c.cssCode,
|
|
2439
|
-
customFonts: (
|
|
2438
|
+
customFonts: (f = (m = o.content) == null ? void 0 : m.data) == null ? void 0 : f.customFonts
|
|
2440
2439
|
}
|
|
2441
2440
|
) }),
|
|
2442
2441
|
/* @__PURE__ */ jsx(
|
|
@@ -2507,7 +2506,8 @@ function ContentVariants(e) {
|
|
|
2507
2506
|
blocksWrapper: e.blocksWrapper,
|
|
2508
2507
|
blocksWrapperProps: e.blocksWrapperProps,
|
|
2509
2508
|
contentWrapper: e.contentWrapper,
|
|
2510
|
-
contentWrapperProps: e.contentWrapperProps
|
|
2509
|
+
contentWrapperProps: e.contentWrapperProps,
|
|
2510
|
+
trustedHosts: e.trustedHosts
|
|
2511
2511
|
},
|
|
2512
2512
|
s.testVariationId
|
|
2513
2513
|
))
|
|
@@ -2531,7 +2531,8 @@ function ContentVariants(e) {
|
|
|
2531
2531
|
blocksWrapper: e.blocksWrapper,
|
|
2532
2532
|
blocksWrapperProps: e.blocksWrapperProps,
|
|
2533
2533
|
contentWrapper: e.contentWrapper,
|
|
2534
|
-
contentWrapperProps: e.contentWrapperProps
|
|
2534
|
+
contentWrapperProps: e.contentWrapperProps,
|
|
2535
|
+
trustedHosts: e.trustedHosts
|
|
2535
2536
|
}
|
|
2536
2537
|
)
|
|
2537
2538
|
] });
|
|
@@ -2558,12 +2559,12 @@ const fetchSymbolContent = async ({
|
|
|
2558
2559
|
async function Symbol$1(e) {
|
|
2559
2560
|
var o, r, i, a, s;
|
|
2560
2561
|
const t = function() {
|
|
2561
|
-
var m,
|
|
2562
|
+
var m, f;
|
|
2562
2563
|
return [
|
|
2563
2564
|
e.attributes.className,
|
|
2564
2565
|
"builder-symbol",
|
|
2565
2566
|
(m = e.symbol) != null && m.inline ? "builder-inline-symbol" : void 0,
|
|
2566
|
-
(
|
|
2567
|
+
(f = e.symbol) != null && f.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
2567
2568
|
].filter(Boolean).join(" ");
|
|
2568
2569
|
}, n = ((o = e.symbol) == null ? void 0 : o.content) || await fetchSymbolContent({
|
|
2569
2570
|
symbol: e.symbol,
|
|
@@ -2622,39 +2623,41 @@ const fetchBuilderProps = async (e) => {
|
|
|
2622
2623
|
};
|
|
2623
2624
|
};
|
|
2624
2625
|
export {
|
|
2625
|
-
|
|
2626
|
+
getAllContent as A,
|
|
2626
2627
|
Blocks as B,
|
|
2627
2628
|
ContentVariants as C,
|
|
2628
|
-
|
|
2629
|
-
|
|
2629
|
+
getContent as D,
|
|
2630
|
+
getBuilderSearchParams as E,
|
|
2631
|
+
track as F,
|
|
2632
|
+
fetchBuilderProps as G,
|
|
2630
2633
|
RenderBlocks as R,
|
|
2631
2634
|
Symbol$1 as S,
|
|
2632
2635
|
Text as T,
|
|
2633
2636
|
_track as _,
|
|
2634
2637
|
getBlockActions as a,
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2638
|
+
isEditing as b,
|
|
2639
|
+
getSrcSet as c,
|
|
2640
|
+
isJsScript as d,
|
|
2641
|
+
isBrowser as e,
|
|
2642
|
+
getDefaultCanTrack as f,
|
|
2640
2643
|
getBlockProperties as g,
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2644
|
+
isPreviewing as h,
|
|
2645
|
+
isEmptyElement as i,
|
|
2646
|
+
isFromTrustedHost as j,
|
|
2647
|
+
evaluate as k,
|
|
2645
2648
|
logger as l,
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2649
|
+
getInteractionPropertiesForEvent as m,
|
|
2650
|
+
fastClone as n,
|
|
2651
|
+
createRegisterComponentMessage as o,
|
|
2652
|
+
fetchOneEntry as p,
|
|
2653
|
+
fetch$1 as q,
|
|
2651
2654
|
registerInsertMenu as r,
|
|
2652
2655
|
setupBrowserForEditing as s,
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2656
|
+
init as t,
|
|
2657
|
+
RenderContent as u,
|
|
2658
|
+
Columns as v,
|
|
2659
|
+
register as w,
|
|
2660
|
+
setEditorSettings as x,
|
|
2661
|
+
_processContentResult as y,
|
|
2662
|
+
fetchEntries as z
|
|
2660
2663
|
};
|