@builder.io/sdk-react 0.11.5 → 0.12.1
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 +22 -22
- package/lib/browser/index.mjs +324 -281
- package/lib/edge/index.cjs +33 -33
- package/lib/edge/index.mjs +483 -440
- package/lib/node/index.cjs +11 -11
- package/lib/node/index.mjs +194 -151
- package/package.json +1 -1
- package/types/blocks/slot/component-info.d.ts +2 -0
- package/types/blocks/slot/slot.d.ts +11 -0
- package/types/constants/sdk-version.d.ts +1 -1
package/lib/node/index.mjs
CHANGED
|
@@ -82,13 +82,13 @@ const getFunctionArguments = ({
|
|
|
82
82
|
rootSetState: a,
|
|
83
83
|
rootState: r
|
|
84
84
|
}) => {
|
|
85
|
-
const
|
|
85
|
+
const c = getFunctionArguments({
|
|
86
86
|
builder: t,
|
|
87
87
|
context: n,
|
|
88
88
|
event: i,
|
|
89
89
|
state: flattenState(r, o, a)
|
|
90
90
|
});
|
|
91
|
-
return new Function(...
|
|
91
|
+
return new Function(...c.map(([l]) => l), e)(...c.map(([, l]) => l));
|
|
92
92
|
};
|
|
93
93
|
function flattenState(e, t, n) {
|
|
94
94
|
if (e === t)
|
|
@@ -175,20 +175,20 @@ output;
|
|
|
175
175
|
rootSetState: a,
|
|
176
176
|
rootState: r
|
|
177
177
|
}) => {
|
|
178
|
-
const
|
|
178
|
+
const c = fastClone({
|
|
179
179
|
...r,
|
|
180
180
|
...o
|
|
181
|
-
}),
|
|
181
|
+
}), l = getFunctionArguments({
|
|
182
182
|
builder: t,
|
|
183
183
|
context: n,
|
|
184
184
|
event: i,
|
|
185
|
-
state:
|
|
185
|
+
state: c
|
|
186
186
|
}), s = getIsolateContext(), d = s.global;
|
|
187
187
|
d.setSync("global", d.derefInto()), d.setSync("log", function(...f) {
|
|
188
188
|
console.log(...f);
|
|
189
189
|
}), d.setSync(BUILDER_SET_STATE_NAME, function(f, S) {
|
|
190
190
|
set(r, f, S), a == null || a(r);
|
|
191
|
-
}),
|
|
191
|
+
}), l.forEach(([f, S]) => {
|
|
192
192
|
const y = typeof S == "object" ? new ivm.Reference(
|
|
193
193
|
// workaround: methods with default values for arguments is not being cloned over
|
|
194
194
|
f === "builder" ? {
|
|
@@ -200,7 +200,7 @@ output;
|
|
|
200
200
|
}), d.setSync(INJECTED_IVM_GLOBAL, ivm);
|
|
201
201
|
const g = processCode({
|
|
202
202
|
code: e,
|
|
203
|
-
args:
|
|
203
|
+
args: l
|
|
204
204
|
}), x = s.evalSync(g);
|
|
205
205
|
try {
|
|
206
206
|
return JSON.parse(x);
|
|
@@ -221,7 +221,7 @@ function evaluate({
|
|
|
221
221
|
logger.warn("Skipping evaluation of empty code block.");
|
|
222
222
|
return;
|
|
223
223
|
}
|
|
224
|
-
const
|
|
224
|
+
const c = {
|
|
225
225
|
code: parseCode(e, {
|
|
226
226
|
isExpression: r
|
|
227
227
|
}),
|
|
@@ -233,9 +233,9 @@ function evaluate({
|
|
|
233
233
|
localState: n
|
|
234
234
|
};
|
|
235
235
|
try {
|
|
236
|
-
return chooseBrowserOrServerEval(
|
|
237
|
-
} catch (
|
|
238
|
-
logger.error("Failed code evaluation: " +
|
|
236
|
+
return chooseBrowserOrServerEval(c);
|
|
237
|
+
} catch (l) {
|
|
238
|
+
logger.error("Failed code evaluation: " + l.message, {
|
|
239
239
|
code: e
|
|
240
240
|
});
|
|
241
241
|
return;
|
|
@@ -262,15 +262,15 @@ const evaluateBindings = ({
|
|
|
262
262
|
...a.actions
|
|
263
263
|
}
|
|
264
264
|
};
|
|
265
|
-
for (const
|
|
266
|
-
const
|
|
267
|
-
code:
|
|
265
|
+
for (const c in e.bindings) {
|
|
266
|
+
const l = e.bindings[c], s = evaluate({
|
|
267
|
+
code: l,
|
|
268
268
|
localState: n,
|
|
269
269
|
rootState: i,
|
|
270
270
|
rootSetState: o,
|
|
271
271
|
context: t
|
|
272
272
|
});
|
|
273
|
-
set(r,
|
|
273
|
+
set(r, c, s);
|
|
274
274
|
}
|
|
275
275
|
return r;
|
|
276
276
|
};
|
|
@@ -333,14 +333,14 @@ const EMPTY_HTML_ELEMENTS = ["area", "base", "br", "col", "embed", "hr", "img",
|
|
|
333
333
|
if (!Array.isArray(o))
|
|
334
334
|
return;
|
|
335
335
|
const a = n.collection.split(".").pop(), r = n.itemName || (a ? a + "Item" : "item");
|
|
336
|
-
return o.map((
|
|
336
|
+
return o.map((l, s) => ({
|
|
337
337
|
context: {
|
|
338
338
|
...t,
|
|
339
339
|
localState: {
|
|
340
340
|
...t.localState,
|
|
341
341
|
$index: s,
|
|
342
|
-
$item:
|
|
343
|
-
[r]:
|
|
342
|
+
$item: l,
|
|
343
|
+
[r]: l,
|
|
344
344
|
[`$${r}Index`]: s
|
|
345
345
|
}
|
|
346
346
|
},
|
|
@@ -430,15 +430,15 @@ function BlockStyles(e) {
|
|
|
430
430
|
shouldEvaluateBindings: !0
|
|
431
431
|
}), o = i.responsiveStyles, a = e.context.content, r = getSizesForBreakpoints(
|
|
432
432
|
((S = a == null ? void 0 : a.meta) == null ? void 0 : S.breakpoints) || {}
|
|
433
|
-
),
|
|
433
|
+
), c = o == null ? void 0 : o.large, l = o == null ? void 0 : o.medium, s = o == null ? void 0 : o.small, d = i.id;
|
|
434
434
|
if (!d)
|
|
435
435
|
return "";
|
|
436
|
-
const g =
|
|
436
|
+
const g = c ? createCssClass({
|
|
437
437
|
className: d,
|
|
438
|
-
styles:
|
|
439
|
-
}) : "", x =
|
|
438
|
+
styles: c
|
|
439
|
+
}) : "", x = l ? createCssClass({
|
|
440
440
|
className: d,
|
|
441
|
-
styles:
|
|
441
|
+
styles: l,
|
|
442
442
|
mediaQuery: getMaxWidthQueryForSize(
|
|
443
443
|
"medium",
|
|
444
444
|
r
|
|
@@ -602,7 +602,7 @@ const getWrapperProps = ({
|
|
|
602
602
|
isInteractive: a,
|
|
603
603
|
contextValue: r
|
|
604
604
|
}) => {
|
|
605
|
-
const
|
|
605
|
+
const c = {
|
|
606
606
|
...e,
|
|
607
607
|
/**
|
|
608
608
|
* If `noWrap` is set to `true`, then the block's props/attributes are provided to the
|
|
@@ -621,7 +621,7 @@ const getWrapperProps = ({
|
|
|
621
621
|
context: n,
|
|
622
622
|
wrapperProps: e,
|
|
623
623
|
includeBlockProps: o
|
|
624
|
-
} :
|
|
624
|
+
} : c;
|
|
625
625
|
};
|
|
626
626
|
function ComponentRef(e) {
|
|
627
627
|
var i;
|
|
@@ -703,7 +703,7 @@ function Block(e) {
|
|
|
703
703
|
var S, y;
|
|
704
704
|
return !((S = t == null ? void 0 : t()) != null && S.component) && !n() ? (y = i().children) != null ? y : [] : [];
|
|
705
705
|
}
|
|
706
|
-
function
|
|
706
|
+
function c() {
|
|
707
707
|
var f, S, y, I, E, v;
|
|
708
708
|
return {
|
|
709
709
|
blockChildren: (f = i().children) != null ? f : [],
|
|
@@ -715,27 +715,27 @@ function Block(e) {
|
|
|
715
715
|
builderComponents: e.registeredComponents
|
|
716
716
|
} : {}
|
|
717
717
|
},
|
|
718
|
-
context:
|
|
718
|
+
context: l,
|
|
719
719
|
registeredComponents: e.registeredComponents,
|
|
720
720
|
builderBlock: i(),
|
|
721
721
|
includeBlockProps: ((E = t == null ? void 0 : t()) == null ? void 0 : E.noWrap) === !0,
|
|
722
722
|
isInteractive: !((v = t == null ? void 0 : t()) != null && v.isRSC)
|
|
723
723
|
};
|
|
724
724
|
}
|
|
725
|
-
const [
|
|
725
|
+
const [l, s] = useState(() => e.context);
|
|
726
726
|
return /* @__PURE__ */ jsx(Fragment, { children: a() ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
727
727
|
/* @__PURE__ */ jsx(BlockStyles, { block: e.block, context: e.context }),
|
|
728
728
|
(d = t == null ? void 0 : t()) != null && d.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
729
729
|
ComponentRef,
|
|
730
730
|
{
|
|
731
|
-
componentRef:
|
|
732
|
-
componentOptions:
|
|
733
|
-
blockChildren:
|
|
734
|
-
context:
|
|
735
|
-
registeredComponents:
|
|
736
|
-
builderBlock:
|
|
737
|
-
includeBlockProps:
|
|
738
|
-
isInteractive:
|
|
731
|
+
componentRef: c().componentRef,
|
|
732
|
+
componentOptions: c().componentOptions,
|
|
733
|
+
blockChildren: c().blockChildren,
|
|
734
|
+
context: c().context,
|
|
735
|
+
registeredComponents: c().registeredComponents,
|
|
736
|
+
builderBlock: c().builderBlock,
|
|
737
|
+
includeBlockProps: c().includeBlockProps,
|
|
738
|
+
isInteractive: c().isInteractive
|
|
739
739
|
}
|
|
740
740
|
) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
741
741
|
isEmptyHtmlElement(o()) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
@@ -767,21 +767,21 @@ function Block(e) {
|
|
|
767
767
|
/* @__PURE__ */ jsx(
|
|
768
768
|
ComponentRef,
|
|
769
769
|
{
|
|
770
|
-
componentRef:
|
|
771
|
-
componentOptions:
|
|
772
|
-
blockChildren:
|
|
773
|
-
context:
|
|
774
|
-
registeredComponents:
|
|
775
|
-
builderBlock:
|
|
776
|
-
includeBlockProps:
|
|
777
|
-
isInteractive:
|
|
770
|
+
componentRef: c().componentRef,
|
|
771
|
+
componentOptions: c().componentOptions,
|
|
772
|
+
blockChildren: c().blockChildren,
|
|
773
|
+
context: c().context,
|
|
774
|
+
registeredComponents: c().registeredComponents,
|
|
775
|
+
builderBlock: c().builderBlock,
|
|
776
|
+
includeBlockProps: c().includeBlockProps,
|
|
777
|
+
isInteractive: c().isInteractive
|
|
778
778
|
}
|
|
779
779
|
),
|
|
780
780
|
(x = r()) == null ? void 0 : x.map((f) => /* @__PURE__ */ jsx(
|
|
781
781
|
Block,
|
|
782
782
|
{
|
|
783
783
|
block: f,
|
|
784
|
-
context:
|
|
784
|
+
context: l,
|
|
785
785
|
registeredComponents: e.registeredComponents
|
|
786
786
|
},
|
|
787
787
|
f.id
|
|
@@ -876,13 +876,13 @@ function Columns(e) {
|
|
|
876
876
|
), [i, o] = useState(() => e.columns || []), [a, r] = useState(
|
|
877
877
|
() => e.stackColumnsAt || "tablet"
|
|
878
878
|
);
|
|
879
|
-
function
|
|
879
|
+
function c(v) {
|
|
880
880
|
var C;
|
|
881
881
|
return ((C = i[v]) == null ? void 0 : C.width) || 100 / i.length;
|
|
882
882
|
}
|
|
883
|
-
function
|
|
883
|
+
function l(v) {
|
|
884
884
|
const C = t * (i.length - 1) / i.length;
|
|
885
|
-
return `calc(${
|
|
885
|
+
return `calc(${c(v)}% - ${C}px)`;
|
|
886
886
|
}
|
|
887
887
|
function s({
|
|
888
888
|
stackedStyle: v,
|
|
@@ -909,32 +909,32 @@ function Columns(e) {
|
|
|
909
909
|
};
|
|
910
910
|
}
|
|
911
911
|
function S(v) {
|
|
912
|
-
const C = v === 0 ? 0 : t,
|
|
912
|
+
const C = v === 0 ? 0 : t, w = l(v), T = `${C}px`, R = "100%", j = 0;
|
|
913
913
|
return {
|
|
914
|
-
width:
|
|
915
|
-
["marginLeft"]:
|
|
914
|
+
width: w,
|
|
915
|
+
["marginLeft"]: T,
|
|
916
916
|
"--column-width-mobile": d({
|
|
917
917
|
stackedStyle: R,
|
|
918
|
-
desktopStyle:
|
|
918
|
+
desktopStyle: w
|
|
919
919
|
}),
|
|
920
920
|
"--column-margin-left-mobile": d({
|
|
921
921
|
stackedStyle: j,
|
|
922
|
-
desktopStyle:
|
|
922
|
+
desktopStyle: T
|
|
923
923
|
}),
|
|
924
924
|
"--column-width-tablet": s({
|
|
925
925
|
stackedStyle: R,
|
|
926
|
-
desktopStyle:
|
|
926
|
+
desktopStyle: w
|
|
927
927
|
}),
|
|
928
928
|
"--column-margin-left-tablet": s({
|
|
929
929
|
stackedStyle: j,
|
|
930
|
-
desktopStyle:
|
|
930
|
+
desktopStyle: T
|
|
931
931
|
})
|
|
932
932
|
};
|
|
933
933
|
}
|
|
934
934
|
function y(v) {
|
|
935
|
-
var
|
|
935
|
+
var w, T;
|
|
936
936
|
return getSizesForBreakpoints(
|
|
937
|
-
((
|
|
937
|
+
((T = (w = e.builderContext.content) == null ? void 0 : w.meta) == null ? void 0 : T.breakpoints) || {}
|
|
938
938
|
)[v].max;
|
|
939
939
|
}
|
|
940
940
|
function I() {
|
|
@@ -1040,7 +1040,7 @@ function getSrcSet(e) {
|
|
|
1040
1040
|
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;
|
|
1041
1041
|
}
|
|
1042
1042
|
function Image(e) {
|
|
1043
|
-
var o, a, r,
|
|
1043
|
+
var o, a, r, c;
|
|
1044
1044
|
function t() {
|
|
1045
1045
|
var d;
|
|
1046
1046
|
const s = e.image || e.src;
|
|
@@ -1056,18 +1056,18 @@ function Image(e) {
|
|
|
1056
1056
|
return getSrcSet(s);
|
|
1057
1057
|
}
|
|
1058
1058
|
function n() {
|
|
1059
|
-
var
|
|
1060
|
-
return (
|
|
1059
|
+
var l;
|
|
1060
|
+
return (l = t == null ? void 0 : t()) != null && l.match(/builder\.io/) && !e.noWebp ? t().replace(/\?/g, "?format=webp&") : "";
|
|
1061
1061
|
}
|
|
1062
1062
|
function i() {
|
|
1063
|
-
const
|
|
1063
|
+
const l = {
|
|
1064
1064
|
position: "absolute",
|
|
1065
1065
|
height: "100%",
|
|
1066
1066
|
width: "100%",
|
|
1067
1067
|
left: "0px",
|
|
1068
1068
|
top: "0px"
|
|
1069
1069
|
};
|
|
1070
|
-
return e.aspectRatio ?
|
|
1070
|
+
return e.aspectRatio ? l : void 0;
|
|
1071
1071
|
}
|
|
1072
1072
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1073
1073
|
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -1100,7 +1100,7 @@ function Image(e) {
|
|
|
1100
1100
|
}
|
|
1101
1101
|
}
|
|
1102
1102
|
) }) : null,
|
|
1103
|
-
(
|
|
1103
|
+
(c = (r = e.builderBlock) == null ? void 0 : r.children) != null && c.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: e.children }) : null,
|
|
1104
1104
|
!e.fitContent && e.children ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("div", { className: "div-40c70c9b-2", children: e.children }) }) : null
|
|
1105
1105
|
] }),
|
|
1106
1106
|
/* @__PURE__ */ jsx("style", { children: `.img-40c70c9b {
|
|
@@ -1143,7 +1143,7 @@ function SectionComponent(e) {
|
|
|
1143
1143
|
}
|
|
1144
1144
|
);
|
|
1145
1145
|
}
|
|
1146
|
-
const componentInfo$
|
|
1146
|
+
const componentInfo$b = {
|
|
1147
1147
|
name: "Core:Button",
|
|
1148
1148
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
|
|
1149
1149
|
defaultStyles: {
|
|
@@ -1176,7 +1176,7 @@ const componentInfo$a = {
|
|
|
1176
1176
|
}],
|
|
1177
1177
|
static: !0,
|
|
1178
1178
|
noWrap: !0
|
|
1179
|
-
}, componentInfo$
|
|
1179
|
+
}, componentInfo$a = {
|
|
1180
1180
|
// TODO: ways to statically preprocess JSON for references, functions, etc
|
|
1181
1181
|
name: "Columns",
|
|
1182
1182
|
isRSC: !0,
|
|
@@ -1355,7 +1355,7 @@ const componentInfo$a = {
|
|
|
1355
1355
|
});
|
|
1356
1356
|
}
|
|
1357
1357
|
const n = e.get("columns");
|
|
1358
|
-
Array.isArray(n) && n.find((o) => o.get("width")) && (n.find((a) => !a.get("width")) || n.reduce((
|
|
1358
|
+
Array.isArray(n) && n.find((o) => o.get("width")) && (n.find((a) => !a.get("width")) || n.reduce((c, l) => c + l.get("width"), 0) !== 100) && t();
|
|
1359
1359
|
}
|
|
1360
1360
|
}, {
|
|
1361
1361
|
name: "space",
|
|
@@ -1377,7 +1377,7 @@ const componentInfo$a = {
|
|
|
1377
1377
|
helperText: "When stacking columns for mobile devices, reverse the ordering",
|
|
1378
1378
|
advanced: !0
|
|
1379
1379
|
}]
|
|
1380
|
-
}, componentInfo$
|
|
1380
|
+
}, componentInfo$9 = {
|
|
1381
1381
|
name: "Custom Code",
|
|
1382
1382
|
static: !0,
|
|
1383
1383
|
requiredPermissions: ["editCode"],
|
|
@@ -1403,12 +1403,12 @@ const componentInfo$a = {
|
|
|
1403
1403
|
function CustomCode(e) {
|
|
1404
1404
|
const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []);
|
|
1405
1405
|
return useEffect(() => {
|
|
1406
|
-
var
|
|
1407
|
-
if (!((
|
|
1406
|
+
var c;
|
|
1407
|
+
if (!((c = t.current) != null && c.getElementsByTagName) || typeof window == "undefined")
|
|
1408
1408
|
return;
|
|
1409
1409
|
const r = t.current.getElementsByTagName("script");
|
|
1410
|
-
for (let
|
|
1411
|
-
const s = r[
|
|
1410
|
+
for (let l = 0; l < r.length; l++) {
|
|
1411
|
+
const s = r[l];
|
|
1412
1412
|
if (s.src) {
|
|
1413
1413
|
if (n.includes(s.src))
|
|
1414
1414
|
continue;
|
|
@@ -1438,7 +1438,7 @@ function CustomCode(e) {
|
|
|
1438
1438
|
}
|
|
1439
1439
|
);
|
|
1440
1440
|
}
|
|
1441
|
-
const componentInfo$
|
|
1441
|
+
const componentInfo$8 = {
|
|
1442
1442
|
name: "Embed",
|
|
1443
1443
|
static: !0,
|
|
1444
1444
|
inputs: [{
|
|
@@ -1465,8 +1465,8 @@ const componentInfo$7 = {
|
|
|
1465
1465
|
}]
|
|
1466
1466
|
}, SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"], isJsScript = (e) => SCRIPT_MIME_TYPES.includes(e.type);
|
|
1467
1467
|
function Embed(e) {
|
|
1468
|
-
const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []), [r,
|
|
1469
|
-
function
|
|
1468
|
+
const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []), [r, c] = useState(() => !1);
|
|
1469
|
+
function l() {
|
|
1470
1470
|
if (!t.current || !t.current.getElementsByTagName)
|
|
1471
1471
|
return;
|
|
1472
1472
|
const s = t.current.getElementsByTagName("script");
|
|
@@ -1485,7 +1485,7 @@ function Embed(e) {
|
|
|
1485
1485
|
}
|
|
1486
1486
|
}
|
|
1487
1487
|
return useEffect(() => {
|
|
1488
|
-
t.current && !r && (
|
|
1488
|
+
t.current && !r && (c(!0), l());
|
|
1489
1489
|
}, [t.current, r]), /* @__PURE__ */ jsx(
|
|
1490
1490
|
"div",
|
|
1491
1491
|
{
|
|
@@ -1495,13 +1495,13 @@ function Embed(e) {
|
|
|
1495
1495
|
}
|
|
1496
1496
|
);
|
|
1497
1497
|
}
|
|
1498
|
-
const componentInfo$
|
|
1498
|
+
const componentInfo$7 = {
|
|
1499
1499
|
name: "Fragment",
|
|
1500
1500
|
static: !0,
|
|
1501
1501
|
hidden: !0,
|
|
1502
1502
|
canHaveChildren: !0,
|
|
1503
1503
|
noWrap: !0
|
|
1504
|
-
}, componentInfo$
|
|
1504
|
+
}, componentInfo$6 = {
|
|
1505
1505
|
name: "Image",
|
|
1506
1506
|
static: !0,
|
|
1507
1507
|
image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
|
|
@@ -1521,17 +1521,17 @@ const componentInfo$6 = {
|
|
|
1521
1521
|
defaultValue: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",
|
|
1522
1522
|
onChange: (e) => {
|
|
1523
1523
|
e.delete("srcset"), e.delete("noWebp");
|
|
1524
|
-
function n(r,
|
|
1525
|
-
return new Promise((
|
|
1524
|
+
function n(r, c = 6e4) {
|
|
1525
|
+
return new Promise((l, s) => {
|
|
1526
1526
|
const d = document.createElement("img");
|
|
1527
1527
|
let g = !1;
|
|
1528
1528
|
d.onload = () => {
|
|
1529
|
-
g = !0,
|
|
1529
|
+
g = !0, l(d);
|
|
1530
1530
|
}, d.addEventListener("error", (x) => {
|
|
1531
1531
|
console.warn("Image load failed", x.error), s(x.error);
|
|
1532
1532
|
}), d.src = r, setTimeout(() => {
|
|
1533
1533
|
g || s(new Error("Image load timed out"));
|
|
1534
|
-
},
|
|
1534
|
+
}, c);
|
|
1535
1535
|
});
|
|
1536
1536
|
}
|
|
1537
1537
|
function i(r) {
|
|
@@ -1542,8 +1542,8 @@ const componentInfo$6 = {
|
|
|
1542
1542
|
r.type.includes("svg") && e.set("noWebp", !0);
|
|
1543
1543
|
}), o && (!a || a === 0.7041))
|
|
1544
1544
|
return n(o).then((r) => {
|
|
1545
|
-
const
|
|
1546
|
-
e.get("image") === o && (!
|
|
1545
|
+
const c = e.get("aspectRatio");
|
|
1546
|
+
e.get("image") === o && (!c || c === 0.7041) && r.width && r.height && (e.set("aspectRatio", i(r.height / r.width)), e.set("height", r.height), e.set("width", r.width));
|
|
1547
1547
|
});
|
|
1548
1548
|
}
|
|
1549
1549
|
}, {
|
|
@@ -1601,7 +1601,7 @@ const componentInfo$6 = {
|
|
|
1601
1601
|
advanced: !0,
|
|
1602
1602
|
defaultValue: 0.7041
|
|
1603
1603
|
}]
|
|
1604
|
-
}, componentInfo$
|
|
1604
|
+
}, componentInfo$5 = {
|
|
1605
1605
|
// friendlyName?
|
|
1606
1606
|
name: "Raw:Img",
|
|
1607
1607
|
hideFromInsertMenu: !0,
|
|
@@ -1631,7 +1631,7 @@ function ImgComponent(e) {
|
|
|
1631
1631
|
isEditing() && e.imgSrc || "default-key"
|
|
1632
1632
|
);
|
|
1633
1633
|
}
|
|
1634
|
-
const componentInfo$
|
|
1634
|
+
const componentInfo$4 = {
|
|
1635
1635
|
name: "Core:Section",
|
|
1636
1636
|
static: !0,
|
|
1637
1637
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -1670,7 +1670,44 @@ const componentInfo$3 = {
|
|
|
1670
1670
|
}
|
|
1671
1671
|
}
|
|
1672
1672
|
}]
|
|
1673
|
-
}, componentInfo$
|
|
1673
|
+
}, componentInfo$3 = {
|
|
1674
|
+
name: "Slot",
|
|
1675
|
+
isRSC: !0,
|
|
1676
|
+
description: "Allow child blocks to be inserted into this content when used as a Symbol",
|
|
1677
|
+
docsLink: "https://www.builder.io/c/docs/symbols-with-blocks",
|
|
1678
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",
|
|
1679
|
+
// Maybe wrap this for canHaveChildren so bind children to this hm
|
|
1680
|
+
inputs: [{
|
|
1681
|
+
name: "name",
|
|
1682
|
+
type: "string",
|
|
1683
|
+
required: !0,
|
|
1684
|
+
defaultValue: "children"
|
|
1685
|
+
}]
|
|
1686
|
+
};
|
|
1687
|
+
function Slot(e) {
|
|
1688
|
+
var t, n, i;
|
|
1689
|
+
return /* @__PURE__ */ jsx(
|
|
1690
|
+
"div",
|
|
1691
|
+
{
|
|
1692
|
+
style: {
|
|
1693
|
+
pointerEvents: "auto"
|
|
1694
|
+
},
|
|
1695
|
+
...!((t = e.builderContext.context) != null && t.symbolId) && {
|
|
1696
|
+
"builder-slot": e.name
|
|
1697
|
+
},
|
|
1698
|
+
children: /* @__PURE__ */ jsx(
|
|
1699
|
+
Blocks,
|
|
1700
|
+
{
|
|
1701
|
+
parent: (n = e.builderContext.context) == null ? void 0 : n.symbolId,
|
|
1702
|
+
path: `symbol.data.${e.name}`,
|
|
1703
|
+
context: e.builderContext,
|
|
1704
|
+
blocks: (i = e.builderContext.rootState) == null ? void 0 : i[e.name]
|
|
1705
|
+
}
|
|
1706
|
+
)
|
|
1707
|
+
}
|
|
1708
|
+
);
|
|
1709
|
+
}
|
|
1710
|
+
const componentInfo$2 = {
|
|
1674
1711
|
name: "Symbol",
|
|
1675
1712
|
noWrap: !0,
|
|
1676
1713
|
static: !0,
|
|
@@ -1818,7 +1855,7 @@ const componentInfo = {
|
|
|
1818
1855
|
}]
|
|
1819
1856
|
};
|
|
1820
1857
|
function Video(e) {
|
|
1821
|
-
var i, o, a, r,
|
|
1858
|
+
var i, o, a, r, c, l, s;
|
|
1822
1859
|
function t() {
|
|
1823
1860
|
return {
|
|
1824
1861
|
...e.autoPlay === !0 ? {
|
|
@@ -1886,7 +1923,7 @@ function Video(e) {
|
|
|
1886
1923
|
}
|
|
1887
1924
|
}
|
|
1888
1925
|
) }) : null,
|
|
1889
|
-
(
|
|
1926
|
+
(c = (r = e.builderBlock) == null ? void 0 : r.children) != null && c.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
1890
1927
|
"div",
|
|
1891
1928
|
{
|
|
1892
1929
|
style: {
|
|
@@ -1897,7 +1934,7 @@ function Video(e) {
|
|
|
1897
1934
|
children: e.children
|
|
1898
1935
|
}
|
|
1899
1936
|
) }) : null,
|
|
1900
|
-
(s = (
|
|
1937
|
+
(s = (l = e.builderBlock) == null ? void 0 : l.children) != null && s.length && !e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
1901
1938
|
"div",
|
|
1902
1939
|
{
|
|
1903
1940
|
style: {
|
|
@@ -1920,28 +1957,28 @@ function Video(e) {
|
|
|
1920
1957
|
}
|
|
1921
1958
|
const getDefaultRegisteredComponents = () => [{
|
|
1922
1959
|
component: Button,
|
|
1923
|
-
...componentInfo$
|
|
1960
|
+
...componentInfo$b
|
|
1924
1961
|
}, {
|
|
1925
1962
|
component: Columns,
|
|
1926
|
-
...componentInfo$
|
|
1963
|
+
...componentInfo$a
|
|
1927
1964
|
}, {
|
|
1928
1965
|
component: CustomCode,
|
|
1929
|
-
...componentInfo$
|
|
1966
|
+
...componentInfo$9
|
|
1930
1967
|
}, {
|
|
1931
1968
|
component: Embed,
|
|
1932
|
-
...componentInfo$
|
|
1969
|
+
...componentInfo$8
|
|
1933
1970
|
}, {
|
|
1934
1971
|
component: FragmentComponent,
|
|
1935
|
-
...componentInfo$
|
|
1972
|
+
...componentInfo$7
|
|
1936
1973
|
}, {
|
|
1937
1974
|
component: Image,
|
|
1938
|
-
...componentInfo$
|
|
1975
|
+
...componentInfo$6
|
|
1939
1976
|
}, {
|
|
1940
1977
|
component: ImgComponent,
|
|
1941
|
-
...componentInfo$
|
|
1978
|
+
...componentInfo$5
|
|
1942
1979
|
}, {
|
|
1943
1980
|
component: SectionComponent,
|
|
1944
|
-
...componentInfo$
|
|
1981
|
+
...componentInfo$4
|
|
1945
1982
|
}, {
|
|
1946
1983
|
component: Symbol$1,
|
|
1947
1984
|
...componentInfo$2
|
|
@@ -1951,6 +1988,9 @@ const getDefaultRegisteredComponents = () => [{
|
|
|
1951
1988
|
}, {
|
|
1952
1989
|
component: Video,
|
|
1953
1990
|
...componentInfo
|
|
1991
|
+
}, {
|
|
1992
|
+
component: Slot,
|
|
1993
|
+
...componentInfo$3
|
|
1954
1994
|
}], UPDATE_COOKIES_AND_STYLES_SCRIPT = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
1955
1995
|
function getAndSetVariantId() {
|
|
1956
1996
|
function setCookie(name, value, days) {
|
|
@@ -2111,7 +2151,7 @@ const findParentElement = (e, t, n = !0) => {
|
|
|
2111
2151
|
builderElementIndex: n && i ? [].slice.call(document.getElementsByClassName(i)).indexOf(n) : void 0
|
|
2112
2152
|
}
|
|
2113
2153
|
};
|
|
2114
|
-
}, SDK_VERSION = "0.
|
|
2154
|
+
}, SDK_VERSION = "0.12.1", registerInsertMenu = () => {
|
|
2115
2155
|
register("insertMenu", {
|
|
2116
2156
|
name: "_default",
|
|
2117
2157
|
default: !0,
|
|
@@ -2160,17 +2200,17 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2160
2200
|
if (i != null && i.type)
|
|
2161
2201
|
switch (i.type) {
|
|
2162
2202
|
case "builder.evaluate": {
|
|
2163
|
-
const r = i.data.text,
|
|
2203
|
+
const r = i.data.text, c = i.data.arguments || [], l = i.data.id, s = new Function(r);
|
|
2164
2204
|
let d, g = null;
|
|
2165
2205
|
try {
|
|
2166
|
-
d = s.apply(null,
|
|
2206
|
+
d = s.apply(null, c);
|
|
2167
2207
|
} catch (x) {
|
|
2168
2208
|
g = x;
|
|
2169
2209
|
}
|
|
2170
2210
|
g ? (o = window.parent) == null || o.postMessage({
|
|
2171
2211
|
type: "builder.evaluateError",
|
|
2172
2212
|
data: {
|
|
2173
|
-
id:
|
|
2213
|
+
id: l,
|
|
2174
2214
|
error: g.message
|
|
2175
2215
|
}
|
|
2176
2216
|
}, "*") : d && typeof d.then == "function" ? d.then((x) => {
|
|
@@ -2178,7 +2218,7 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2178
2218
|
(f = window.parent) == null || f.postMessage({
|
|
2179
2219
|
type: "builder.evaluateResult",
|
|
2180
2220
|
data: {
|
|
2181
|
-
id:
|
|
2221
|
+
id: l,
|
|
2182
2222
|
result: x
|
|
2183
2223
|
}
|
|
2184
2224
|
}, "*");
|
|
@@ -2186,7 +2226,7 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2186
2226
|
type: "builder.evaluateResult",
|
|
2187
2227
|
data: {
|
|
2188
2228
|
result: d,
|
|
2189
|
-
id:
|
|
2229
|
+
id: l
|
|
2190
2230
|
}
|
|
2191
2231
|
}, "*");
|
|
2192
2232
|
break;
|
|
@@ -2195,7 +2235,7 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2195
2235
|
})));
|
|
2196
2236
|
};
|
|
2197
2237
|
function EnableEditor(e) {
|
|
2198
|
-
var j, P, A, F,
|
|
2238
|
+
var j, P, A, F, V, _, $;
|
|
2199
2239
|
const t = useRef(null), [n, i] = useState(() => 0);
|
|
2200
2240
|
useState(() => !0);
|
|
2201
2241
|
function o(u) {
|
|
@@ -2224,15 +2264,15 @@ function EnableEditor(e) {
|
|
|
2224
2264
|
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)
|
|
2225
2265
|
}
|
|
2226
2266
|
};
|
|
2227
|
-
e.setBuilderContextSignal((
|
|
2228
|
-
|
|
2267
|
+
e.setBuilderContextSignal((W) => ({
|
|
2268
|
+
...W,
|
|
2229
2269
|
content: m
|
|
2230
2270
|
}));
|
|
2231
2271
|
}
|
|
2232
2272
|
useState(() => 0);
|
|
2233
|
-
const [r,
|
|
2273
|
+
const [r, c] = useState(
|
|
2234
2274
|
() => !1
|
|
2235
|
-
), [
|
|
2275
|
+
), [l, s] = useState(
|
|
2236
2276
|
() => e.contentWrapper || "div"
|
|
2237
2277
|
);
|
|
2238
2278
|
function d(u) {
|
|
@@ -2323,7 +2363,7 @@ function EnableEditor(e) {
|
|
|
2323
2363
|
}
|
|
2324
2364
|
});
|
|
2325
2365
|
}
|
|
2326
|
-
function
|
|
2366
|
+
function w() {
|
|
2327
2367
|
isEditing() && window.dispatchEvent(
|
|
2328
2368
|
new CustomEvent(
|
|
2329
2369
|
"builder:component:stateChange",
|
|
@@ -2338,7 +2378,7 @@ function EnableEditor(e) {
|
|
|
2338
2378
|
)
|
|
2339
2379
|
);
|
|
2340
2380
|
}
|
|
2341
|
-
function
|
|
2381
|
+
function T(u) {
|
|
2342
2382
|
i(n + 1), window.addEventListener("message", d), registerInsertMenu(), setupBrowserForEditing({
|
|
2343
2383
|
...e.locale ? {
|
|
2344
2384
|
locale: e.locale
|
|
@@ -2357,7 +2397,7 @@ function EnableEditor(e) {
|
|
|
2357
2397
|
(b = window.parent) == null || b.postMessage(h, "*");
|
|
2358
2398
|
}), window.addEventListener(
|
|
2359
2399
|
"builder:component:stateChangeListenerActivated",
|
|
2360
|
-
|
|
2400
|
+
w
|
|
2361
2401
|
);
|
|
2362
2402
|
}
|
|
2363
2403
|
function R(u) {
|
|
@@ -2376,12 +2416,12 @@ function EnableEditor(e) {
|
|
|
2376
2416
|
var u;
|
|
2377
2417
|
return (u = t.current) == null || u.addEventListener(
|
|
2378
2418
|
"initeditingbldr",
|
|
2379
|
-
|
|
2419
|
+
T
|
|
2380
2420
|
), () => {
|
|
2381
2421
|
var m;
|
|
2382
2422
|
return (m = t.current) == null ? void 0 : m.removeEventListener(
|
|
2383
2423
|
"initeditingbldr",
|
|
2384
|
-
|
|
2424
|
+
T
|
|
2385
2425
|
);
|
|
2386
2426
|
};
|
|
2387
2427
|
}, []), useEffect(() => {
|
|
@@ -2414,7 +2454,7 @@ function EnableEditor(e) {
|
|
|
2414
2454
|
}, []), useEffect(() => {
|
|
2415
2455
|
e.apiKey || logger.error(
|
|
2416
2456
|
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
2417
|
-
), g(), C(),
|
|
2457
|
+
), g(), C(), w();
|
|
2418
2458
|
}, []), useEffect(() => {
|
|
2419
2459
|
e.content && a(e.content);
|
|
2420
2460
|
}, [e.content]), useEffect(() => {
|
|
@@ -2426,7 +2466,7 @@ function EnableEditor(e) {
|
|
|
2426
2466
|
]), useEffect(() => {
|
|
2427
2467
|
C();
|
|
2428
2468
|
}, [(F = (A = e.builderContextSignal.content) == null ? void 0 : A.data) == null ? void 0 : F.httpRequests]), useEffect(() => {
|
|
2429
|
-
|
|
2469
|
+
w();
|
|
2430
2470
|
}, [e.builderContextSignal.rootState]), useEffect(() => {
|
|
2431
2471
|
e.data && o(e.data);
|
|
2432
2472
|
}, [e.data]), useEffect(() => {
|
|
@@ -2436,22 +2476,22 @@ function EnableEditor(e) {
|
|
|
2436
2476
|
}, [e.locale]), useEffect(() => () => {
|
|
2437
2477
|
isBrowser() && (window.removeEventListener("message", d), window.removeEventListener(
|
|
2438
2478
|
"builder:component:stateChangeListenerActivated",
|
|
2439
|
-
|
|
2479
|
+
w
|
|
2440
2480
|
));
|
|
2441
2481
|
}, []), /* @__PURE__ */ jsx(builderContext.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ createElement(
|
|
2442
|
-
|
|
2482
|
+
l,
|
|
2443
2483
|
{
|
|
2444
2484
|
key: n,
|
|
2445
2485
|
ref: t,
|
|
2446
2486
|
onClick: (u) => I(u),
|
|
2447
|
-
"builder-content-id": (
|
|
2487
|
+
"builder-content-id": (V = e.builderContextSignal.content) == null ? void 0 : V.id,
|
|
2448
2488
|
"builder-model": e.model,
|
|
2449
2489
|
...e.showContent ? {} : {
|
|
2450
2490
|
hidden: !0,
|
|
2451
2491
|
"aria-hidden": !0
|
|
2452
2492
|
},
|
|
2453
2493
|
...e.contentWrapperProps,
|
|
2454
|
-
className: `variant-${((
|
|
2494
|
+
className: `variant-${((_ = e.content) == null ? void 0 : _.testVariationId) || (($ = e.content) == null ? void 0 : $.id)}`
|
|
2455
2495
|
},
|
|
2456
2496
|
e.children
|
|
2457
2497
|
) }) : null });
|
|
@@ -2468,16 +2508,16 @@ font-display: fallback;
|
|
|
2468
2508
|
font-weight: 400;
|
|
2469
2509
|
}
|
|
2470
2510
|
`.trim()), e.files)
|
|
2471
|
-
for (const
|
|
2472
|
-
if (!(String(Number(
|
|
2511
|
+
for (const c in e.files) {
|
|
2512
|
+
if (!(String(Number(c)) === c))
|
|
2473
2513
|
continue;
|
|
2474
|
-
const s = e.files[
|
|
2514
|
+
const s = e.files[c];
|
|
2475
2515
|
s && s !== i && (o += `
|
|
2476
2516
|
@font-face {
|
|
2477
2517
|
font-family: "${t}";
|
|
2478
2518
|
src: url('${s}') format('woff2');
|
|
2479
2519
|
font-display: fallback;
|
|
2480
|
-
font-weight: ${
|
|
2520
|
+
font-weight: ${c};
|
|
2481
2521
|
}
|
|
2482
2522
|
`.trim());
|
|
2483
2523
|
}
|
|
@@ -2523,10 +2563,10 @@ const getRootStateInitialValue = ({
|
|
|
2523
2563
|
data: t,
|
|
2524
2564
|
locale: n
|
|
2525
2565
|
}) => {
|
|
2526
|
-
var a, r,
|
|
2566
|
+
var a, r, c;
|
|
2527
2567
|
const i = {}, o = ((a = e == null ? void 0 : e.data) == null ? void 0 : a.state) || {};
|
|
2528
|
-
return (
|
|
2529
|
-
|
|
2568
|
+
return (c = (r = e == null ? void 0 : e.data) == null ? void 0 : r.inputs) == null || c.forEach((l) => {
|
|
2569
|
+
l.name && l.defaultValue !== void 0 && (i[l.name] = l.defaultValue);
|
|
2530
2570
|
}), {
|
|
2531
2571
|
...i,
|
|
2532
2572
|
...o,
|
|
@@ -2547,7 +2587,7 @@ const getRootStateInitialValue = ({
|
|
|
2547
2587
|
meta: e == null ? void 0 : e.meta
|
|
2548
2588
|
} : void 0;
|
|
2549
2589
|
function ContentComponent(e) {
|
|
2550
|
-
var
|
|
2590
|
+
var l, s, d, g, x, f, S;
|
|
2551
2591
|
const [t, n] = useState(
|
|
2552
2592
|
() => {
|
|
2553
2593
|
var y, I;
|
|
@@ -2560,7 +2600,7 @@ function ContentComponent(e) {
|
|
|
2560
2600
|
}
|
|
2561
2601
|
);
|
|
2562
2602
|
function i(y) {
|
|
2563
|
-
|
|
2603
|
+
c((I) => ({
|
|
2564
2604
|
...I,
|
|
2565
2605
|
rootState: y
|
|
2566
2606
|
}));
|
|
@@ -2585,7 +2625,7 @@ function ContentComponent(e) {
|
|
|
2585
2625
|
}),
|
|
2586
2626
|
{}
|
|
2587
2627
|
)
|
|
2588
|
-
), [r,
|
|
2628
|
+
), [r, c] = useState(() => ({
|
|
2589
2629
|
content: getContentInitialValue({
|
|
2590
2630
|
content: e.content,
|
|
2591
2631
|
data: e.data
|
|
@@ -2642,13 +2682,13 @@ function ContentComponent(e) {
|
|
|
2642
2682
|
builderContextSignal: r,
|
|
2643
2683
|
contentWrapper: e.contentWrapper,
|
|
2644
2684
|
contentWrapperProps: e.contentWrapperProps,
|
|
2645
|
-
setBuilderContextSignal:
|
|
2685
|
+
setBuilderContextSignal: c,
|
|
2646
2686
|
children: [
|
|
2647
2687
|
e.isSsrAbTest ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedScript, { scriptStr: t }) }) : null,
|
|
2648
2688
|
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
2649
2689
|
ContentStyles,
|
|
2650
2690
|
{
|
|
2651
|
-
contentId: (
|
|
2691
|
+
contentId: (l = r.content) == null ? void 0 : l.id,
|
|
2652
2692
|
cssCode: (d = (s = r.content) == null ? void 0 : s.data) == null ? void 0 : d.cssCode,
|
|
2653
2693
|
customFonts: (x = (g = r.content) == null ? void 0 : g.data) == null ? void 0 : x.customFonts
|
|
2654
2694
|
}
|
|
@@ -2668,7 +2708,7 @@ function ContentComponent(e) {
|
|
|
2668
2708
|
);
|
|
2669
2709
|
}
|
|
2670
2710
|
function ContentVariants(e) {
|
|
2671
|
-
var r,
|
|
2711
|
+
var r, c;
|
|
2672
2712
|
const [t, n] = useState(
|
|
2673
2713
|
() => checkShouldRenderVariants({
|
|
2674
2714
|
canTrack: getDefaultCanTrack(e.canTrack),
|
|
@@ -2676,23 +2716,23 @@ function ContentVariants(e) {
|
|
|
2676
2716
|
})
|
|
2677
2717
|
);
|
|
2678
2718
|
function i() {
|
|
2679
|
-
var
|
|
2719
|
+
var l;
|
|
2680
2720
|
return getUpdateCookieAndStylesScript(
|
|
2681
2721
|
getVariants(e.content).map((s) => ({
|
|
2682
2722
|
id: s.testVariationId,
|
|
2683
2723
|
testRatio: s.testRatio
|
|
2684
2724
|
})),
|
|
2685
|
-
((
|
|
2725
|
+
((l = e.content) == null ? void 0 : l.id) || ""
|
|
2686
2726
|
);
|
|
2687
2727
|
}
|
|
2688
2728
|
function o() {
|
|
2689
|
-
return getVariants(e.content).map((
|
|
2729
|
+
return getVariants(e.content).map((l) => `.variant-${l.testVariationId} { display: none; } `).join("");
|
|
2690
2730
|
}
|
|
2691
2731
|
function a() {
|
|
2692
|
-
var
|
|
2732
|
+
var l;
|
|
2693
2733
|
return t ? {
|
|
2694
2734
|
...e.content,
|
|
2695
|
-
testVariationId: (
|
|
2735
|
+
testVariationId: (l = e.content) == null ? void 0 : l.id
|
|
2696
2736
|
} : handleABTestingSync({
|
|
2697
2737
|
item: e.content,
|
|
2698
2738
|
canTrack: getDefaultCanTrack(e.canTrack)
|
|
@@ -2710,10 +2750,10 @@ function ContentVariants(e) {
|
|
|
2710
2750
|
}
|
|
2711
2751
|
),
|
|
2712
2752
|
/* @__PURE__ */ jsx(InlinedScript, { scriptStr: i() }),
|
|
2713
|
-
(
|
|
2753
|
+
(c = getVariants(e.content)) == null ? void 0 : c.map((l) => /* @__PURE__ */ jsx(
|
|
2714
2754
|
ContentComponent,
|
|
2715
2755
|
{
|
|
2716
|
-
content:
|
|
2756
|
+
content: l,
|
|
2717
2757
|
showContent: !1,
|
|
2718
2758
|
model: e.model,
|
|
2719
2759
|
data: e.data,
|
|
@@ -2731,7 +2771,7 @@ function ContentVariants(e) {
|
|
|
2731
2771
|
contentWrapper: e.contentWrapper,
|
|
2732
2772
|
contentWrapperProps: e.contentWrapperProps
|
|
2733
2773
|
},
|
|
2734
|
-
|
|
2774
|
+
l.testVariationId
|
|
2735
2775
|
))
|
|
2736
2776
|
] }) : null,
|
|
2737
2777
|
/* @__PURE__ */ jsx(
|
|
@@ -2778,26 +2818,26 @@ const fetchSymbolContent = async ({
|
|
|
2778
2818
|
});
|
|
2779
2819
|
};
|
|
2780
2820
|
function Symbol$1(e) {
|
|
2781
|
-
var a, r, l;
|
|
2821
|
+
var a, r, c, l;
|
|
2782
2822
|
function t() {
|
|
2783
|
-
var
|
|
2823
|
+
var s, d;
|
|
2784
2824
|
return [
|
|
2785
2825
|
e.attributes.className,
|
|
2786
2826
|
"builder-symbol",
|
|
2787
|
-
(
|
|
2788
|
-
(
|
|
2827
|
+
(s = e.symbol) != null && s.inline ? "builder-inline-symbol" : void 0,
|
|
2828
|
+
(d = e.symbol) != null && d.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
2789
2829
|
].filter(Boolean).join(" ");
|
|
2790
2830
|
}
|
|
2791
2831
|
const [n, i] = useState(() => {
|
|
2792
|
-
var
|
|
2793
|
-
return (
|
|
2832
|
+
var s;
|
|
2833
|
+
return (s = e.symbol) == null ? void 0 : s.content;
|
|
2794
2834
|
});
|
|
2795
2835
|
function o() {
|
|
2796
2836
|
n || fetchSymbolContent({
|
|
2797
2837
|
symbol: e.symbol,
|
|
2798
2838
|
builderContextValue: e.builderContext
|
|
2799
|
-
}).then((
|
|
2800
|
-
|
|
2839
|
+
}).then((s) => {
|
|
2840
|
+
s && i(s);
|
|
2801
2841
|
});
|
|
2802
2842
|
}
|
|
2803
2843
|
return useEffect(() => {
|
|
@@ -2809,12 +2849,15 @@ function Symbol$1(e) {
|
|
|
2809
2849
|
__isNestedRender: !0,
|
|
2810
2850
|
apiVersion: e.builderContext.apiVersion,
|
|
2811
2851
|
apiKey: e.builderContext.apiKey,
|
|
2812
|
-
context:
|
|
2852
|
+
context: {
|
|
2853
|
+
...e.builderContext.context,
|
|
2854
|
+
symbolId: (a = e.builderBlock) == null ? void 0 : a.id
|
|
2855
|
+
},
|
|
2813
2856
|
customComponents: Object.values(e.builderComponents),
|
|
2814
2857
|
data: {
|
|
2815
|
-
...(
|
|
2858
|
+
...(r = e.symbol) == null ? void 0 : r.data,
|
|
2816
2859
|
...e.builderContext.localState,
|
|
2817
|
-
...(
|
|
2860
|
+
...(c = n == null ? void 0 : n.data) == null ? void 0 : c.state
|
|
2818
2861
|
},
|
|
2819
2862
|
model: (l = e.symbol) == null ? void 0 : l.model,
|
|
2820
2863
|
content: n
|