@builder.io/sdk-react 0.9.0 → 0.10.0
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 +17 -17
- package/lib/browser/index.mjs +363 -362
- package/lib/browser/server-entry-df9eba5d.cjs +2 -0
- package/lib/browser/{server-entry-0aebe4be.js → server-entry-f978b3a5.js} +7 -7
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/index.cjs +20 -20
- package/lib/edge/index.mjs +239 -238
- package/lib/edge/server-entry-df9eba5d.cjs +2 -0
- package/lib/edge/{server-entry-0aebe4be.js → server-entry-f978b3a5.js} +7 -7
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/node/index.cjs +14 -14
- package/lib/node/index.mjs +200 -199
- package/lib/node/{server-entry-e4cd1e05.js → server-entry-46908b1b.js} +7 -7
- package/lib/node/server-entry-df9eba5d.cjs +2 -0
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/package.json +1 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/functions/get-content/index.d.ts +2 -2
- package/lib/browser/server-entry-a5d2c777.cjs +0 -2
- package/lib/edge/server-entry-a5d2c777.cjs +0 -2
- package/lib/node/server-entry-a5d2c777.cjs +0 -2
package/lib/node/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, useState, useContext, createElement, useRef, useEffect } from "react";
|
|
4
|
-
import { i as isEditing, j as isBrowser, k as getUserAttributes, l as fastClone, m as logger, n as checkIsDefined, T as TARGET, r as register, o as getDefaultCanTrack, p as _track, a as isPreviewing, c as createRegisterComponentMessage, b as fetchOneEntry, q as fetch$1, u as components, v as serializeComponentInfo, w as handleABTestingSync } from "./server-entry-
|
|
5
|
-
import { _ as U, h as H, f as K, g as z, e as q, d as Y, s as G, t as J } from "./server-entry-
|
|
4
|
+
import { i as isEditing, j as isBrowser, k as getUserAttributes, l as fastClone, m as logger, n as checkIsDefined, T as TARGET, r as register, o as getDefaultCanTrack, p as _track, a as isPreviewing, c as createRegisterComponentMessage, b as fetchOneEntry, q as fetch$1, u as components, v as serializeComponentInfo, w as handleABTestingSync } from "./server-entry-46908b1b.js";
|
|
5
|
+
import { _ as U, h as H, f as K, g as z, e as q, d as Y, s as G, t as J } from "./server-entry-46908b1b.js";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
7
7
|
function Button(e) {
|
|
8
8
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -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(...S) {
|
|
188
188
|
console.log(...S);
|
|
189
189
|
}), d.setSync(BUILDER_SET_STATE_NAME, function(S, f) {
|
|
190
190
|
set(r, S, f), a == null || a(r);
|
|
191
|
-
}),
|
|
191
|
+
}), l.forEach(([S, f]) => {
|
|
192
192
|
const p = typeof f == "object" ? new ivm.Reference(
|
|
193
193
|
// workaround: methods with default values for arguments is not being cloned over
|
|
194
194
|
S === "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
|
((f = a == null ? void 0 : a.meta) == null ? void 0 : f.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
|
|
@@ -468,23 +468,24 @@ const getEventHandlerName = (e) => `on${capitalizeFirstLetter(e)}`, createEventH
|
|
|
468
468
|
isExpression: !1
|
|
469
469
|
});
|
|
470
470
|
function getBlockActions(e) {
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
471
|
+
var i;
|
|
472
|
+
const t = {}, n = (i = e.block.actions) != null ? i : {};
|
|
473
|
+
for (const o in n) {
|
|
474
|
+
if (!n.hasOwnProperty(o))
|
|
474
475
|
continue;
|
|
475
|
-
const
|
|
476
|
-
let
|
|
476
|
+
const a = n[o];
|
|
477
|
+
let r = getEventHandlerName(o);
|
|
477
478
|
if (e.stripPrefix)
|
|
478
479
|
switch (TARGET) {
|
|
479
480
|
case "vue2":
|
|
480
481
|
case "vue3":
|
|
481
|
-
|
|
482
|
+
r = r.replace("v-on:", "");
|
|
482
483
|
break;
|
|
483
484
|
case "svelte":
|
|
484
|
-
|
|
485
|
+
r = r.replace("on:", "");
|
|
485
486
|
break;
|
|
486
487
|
}
|
|
487
|
-
t[
|
|
488
|
+
t[r] = createEventHandler(a, e);
|
|
488
489
|
}
|
|
489
490
|
return t;
|
|
490
491
|
}
|
|
@@ -700,47 +701,47 @@ function Block(e) {
|
|
|
700
701
|
return e.block.tagName || "div";
|
|
701
702
|
}
|
|
702
703
|
function a() {
|
|
703
|
-
var
|
|
704
|
-
if ((
|
|
704
|
+
var k, E;
|
|
705
|
+
if ((k = e.block.repeat) != null && k.collection)
|
|
705
706
|
return !!((E = n == null ? void 0 : n()) != null && E.length);
|
|
706
707
|
const f = "hide" in i() ? i().hide : !1;
|
|
707
708
|
return ("show" in i() ? i().show : !0) && !f;
|
|
708
709
|
}
|
|
709
710
|
function r() {
|
|
710
|
-
var p;
|
|
711
|
-
return !((p = t == null ? void 0 : t()) != null && p.component) && !n() ? i().children
|
|
711
|
+
var p, k;
|
|
712
|
+
return !((p = t == null ? void 0 : t()) != null && p.component) && !n() ? (k = i().children) != null ? k : [] : [];
|
|
712
713
|
}
|
|
713
|
-
function
|
|
714
|
-
var f, p,
|
|
714
|
+
function c() {
|
|
715
|
+
var f, p, k, E, C, y;
|
|
715
716
|
return {
|
|
716
|
-
blockChildren: i().children
|
|
717
|
-
componentRef: (
|
|
717
|
+
blockChildren: (f = i().children) != null ? f : [],
|
|
718
|
+
componentRef: (p = t == null ? void 0 : t()) == null ? void 0 : p.component,
|
|
718
719
|
componentOptions: {
|
|
719
720
|
...getBlockComponentOptions(i()),
|
|
720
721
|
builderContext: e.context,
|
|
721
|
-
...((
|
|
722
|
+
...((k = t == null ? void 0 : t()) == null ? void 0 : k.name) === "Symbol" || ((E = t == null ? void 0 : t()) == null ? void 0 : E.name) === "Columns" ? {
|
|
722
723
|
builderComponents: e.registeredComponents
|
|
723
724
|
} : {}
|
|
724
725
|
},
|
|
725
|
-
context:
|
|
726
|
+
context: l,
|
|
726
727
|
registeredComponents: e.registeredComponents,
|
|
727
728
|
builderBlock: i(),
|
|
728
|
-
includeBlockProps: ((
|
|
729
|
-
isInteractive: !((
|
|
729
|
+
includeBlockProps: ((C = t == null ? void 0 : t()) == null ? void 0 : C.noWrap) === !0,
|
|
730
|
+
isInteractive: !((y = t == null ? void 0 : t()) != null && y.isRSC)
|
|
730
731
|
};
|
|
731
732
|
}
|
|
732
|
-
const [
|
|
733
|
+
const [l, s] = useState(() => e.context);
|
|
733
734
|
return /* @__PURE__ */ jsx(Fragment, { children: a() ? /* @__PURE__ */ jsx(Fragment, { children: (d = t == null ? void 0 : t()) != null && d.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
734
735
|
ComponentRef,
|
|
735
736
|
{
|
|
736
|
-
componentRef:
|
|
737
|
-
componentOptions:
|
|
738
|
-
blockChildren:
|
|
739
|
-
context:
|
|
740
|
-
registeredComponents:
|
|
741
|
-
builderBlock:
|
|
742
|
-
includeBlockProps:
|
|
743
|
-
isInteractive:
|
|
737
|
+
componentRef: c().componentRef,
|
|
738
|
+
componentOptions: c().componentOptions,
|
|
739
|
+
blockChildren: c().blockChildren,
|
|
740
|
+
context: c().context,
|
|
741
|
+
registeredComponents: c().registeredComponents,
|
|
742
|
+
builderBlock: c().builderBlock,
|
|
743
|
+
includeBlockProps: c().includeBlockProps,
|
|
744
|
+
isInteractive: c().isInteractive
|
|
744
745
|
}
|
|
745
746
|
) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
746
747
|
isEmptyHtmlElement(o()) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
@@ -772,21 +773,21 @@ function Block(e) {
|
|
|
772
773
|
/* @__PURE__ */ jsx(
|
|
773
774
|
ComponentRef,
|
|
774
775
|
{
|
|
775
|
-
componentRef:
|
|
776
|
-
componentOptions:
|
|
777
|
-
blockChildren:
|
|
778
|
-
context:
|
|
779
|
-
registeredComponents:
|
|
780
|
-
builderBlock:
|
|
781
|
-
includeBlockProps:
|
|
782
|
-
isInteractive:
|
|
776
|
+
componentRef: c().componentRef,
|
|
777
|
+
componentOptions: c().componentOptions,
|
|
778
|
+
blockChildren: c().blockChildren,
|
|
779
|
+
context: c().context,
|
|
780
|
+
registeredComponents: c().registeredComponents,
|
|
781
|
+
builderBlock: c().builderBlock,
|
|
782
|
+
includeBlockProps: c().includeBlockProps,
|
|
783
|
+
isInteractive: c().isInteractive
|
|
783
784
|
}
|
|
784
785
|
),
|
|
785
786
|
(x = r()) == null ? void 0 : x.map((f) => /* @__PURE__ */ jsx(
|
|
786
787
|
Block,
|
|
787
788
|
{
|
|
788
789
|
block: f,
|
|
789
|
-
context:
|
|
790
|
+
context: l,
|
|
790
791
|
registeredComponents: e.registeredComponents
|
|
791
792
|
},
|
|
792
793
|
"block-" + f.id
|
|
@@ -795,7 +796,7 @@ function Block(e) {
|
|
|
795
796
|
BlockStyles,
|
|
796
797
|
{
|
|
797
798
|
block: f,
|
|
798
|
-
context:
|
|
799
|
+
context: l
|
|
799
800
|
},
|
|
800
801
|
"block-style-" + f.id
|
|
801
802
|
))
|
|
@@ -870,22 +871,22 @@ function Blocks(e) {
|
|
|
870
871
|
BlocksWrapper: (i = e.context) == null ? void 0 : i.BlocksWrapper,
|
|
871
872
|
BlocksWrapperProps: (o = e.context) == null ? void 0 : o.BlocksWrapperProps,
|
|
872
873
|
children: [
|
|
873
|
-
e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (a = e.blocks) == null ? void 0 : a.map((
|
|
874
|
+
e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (a = e.blocks) == null ? void 0 : a.map((c) => /* @__PURE__ */ jsx(
|
|
874
875
|
Block,
|
|
875
876
|
{
|
|
876
|
-
block:
|
|
877
|
+
block: c,
|
|
877
878
|
context: e.context || t,
|
|
878
879
|
registeredComponents: e.registeredComponents || n.registeredComponents
|
|
879
880
|
},
|
|
880
|
-
"render-block-" +
|
|
881
|
+
"render-block-" + c.id
|
|
881
882
|
)) }) : null,
|
|
882
|
-
e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (r = e.blocks) == null ? void 0 : r.map((
|
|
883
|
+
e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (r = e.blocks) == null ? void 0 : r.map((c) => /* @__PURE__ */ jsx(
|
|
883
884
|
BlockStyles,
|
|
884
885
|
{
|
|
885
|
-
block:
|
|
886
|
+
block: c,
|
|
886
887
|
context: e.context || t
|
|
887
888
|
},
|
|
888
|
-
"block-style-" +
|
|
889
|
+
"block-style-" + c.id
|
|
889
890
|
)) }) : null
|
|
890
891
|
]
|
|
891
892
|
}
|
|
@@ -898,25 +899,25 @@ function Columns(e) {
|
|
|
898
899
|
), [i, o] = useState(() => e.columns || []), [a, r] = useState(
|
|
899
900
|
() => e.stackColumnsAt || "tablet"
|
|
900
901
|
);
|
|
901
|
-
function
|
|
902
|
-
var
|
|
903
|
-
return ((
|
|
902
|
+
function c(C) {
|
|
903
|
+
var y;
|
|
904
|
+
return ((y = i[C]) == null ? void 0 : y.width) || 100 / i.length;
|
|
904
905
|
}
|
|
905
|
-
function
|
|
906
|
-
const
|
|
907
|
-
return `calc(${
|
|
906
|
+
function l(C) {
|
|
907
|
+
const y = t * (i.length - 1) / i.length;
|
|
908
|
+
return `calc(${c(C)}% - ${y}px)`;
|
|
908
909
|
}
|
|
909
910
|
function s({
|
|
910
|
-
stackedStyle:
|
|
911
|
-
desktopStyle:
|
|
911
|
+
stackedStyle: C,
|
|
912
|
+
desktopStyle: y
|
|
912
913
|
}) {
|
|
913
|
-
return a === "tablet" ?
|
|
914
|
+
return a === "tablet" ? C : y;
|
|
914
915
|
}
|
|
915
916
|
function d({
|
|
916
|
-
stackedStyle:
|
|
917
|
-
desktopStyle:
|
|
917
|
+
stackedStyle: C,
|
|
918
|
+
desktopStyle: y
|
|
918
919
|
}) {
|
|
919
|
-
return a === "never" ?
|
|
920
|
+
return a === "never" ? y : C;
|
|
920
921
|
}
|
|
921
922
|
const [g, x] = useState(
|
|
922
923
|
() => e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column"
|
|
@@ -930,8 +931,8 @@ function Columns(e) {
|
|
|
930
931
|
})
|
|
931
932
|
};
|
|
932
933
|
}
|
|
933
|
-
function f(
|
|
934
|
-
const
|
|
934
|
+
function f(C) {
|
|
935
|
+
const y = C === 0 ? 0 : t, T = l(C), w = `${y}px`, R = "100%", j = 0;
|
|
935
936
|
return {
|
|
936
937
|
width: T,
|
|
937
938
|
["marginLeft"]: w,
|
|
@@ -953,13 +954,13 @@ function Columns(e) {
|
|
|
953
954
|
})
|
|
954
955
|
};
|
|
955
956
|
}
|
|
956
|
-
function p(
|
|
957
|
+
function p(C) {
|
|
957
958
|
var T, w;
|
|
958
959
|
return getSizesForBreakpoints(
|
|
959
960
|
((w = (T = e.builderContext.content) == null ? void 0 : T.meta) == null ? void 0 : w.breakpoints) || {}
|
|
960
|
-
)[
|
|
961
|
+
)[C].max;
|
|
961
962
|
}
|
|
962
|
-
function
|
|
963
|
+
function k() {
|
|
963
964
|
return `
|
|
964
965
|
@media (max-width: ${p("medium")}px) {
|
|
965
966
|
.${e.builderBlock.id}-breakpoints {
|
|
@@ -993,25 +994,25 @@ function Columns(e) {
|
|
|
993
994
|
className: `builder-columns ${e.builderBlock.id}-breakpoints div-53636e90`,
|
|
994
995
|
style: S(),
|
|
995
996
|
children: [
|
|
996
|
-
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles:
|
|
997
|
-
(E = e.columns) == null ? void 0 : E.map((
|
|
997
|
+
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: k() }) }),
|
|
998
|
+
(E = e.columns) == null ? void 0 : E.map((C, y) => /* @__PURE__ */ createElement(
|
|
998
999
|
"div",
|
|
999
1000
|
{
|
|
1000
1001
|
className: "builder-column div-53636e90-2",
|
|
1001
|
-
style: f(
|
|
1002
|
-
key:
|
|
1002
|
+
style: f(y),
|
|
1003
|
+
key: y
|
|
1003
1004
|
},
|
|
1004
1005
|
/* @__PURE__ */ jsx(
|
|
1005
1006
|
Blocks,
|
|
1006
1007
|
{
|
|
1007
|
-
path: `component.options.columns.${
|
|
1008
|
+
path: `component.options.columns.${y}.blocks`,
|
|
1008
1009
|
parent: e.builderBlock.id,
|
|
1009
1010
|
styleProp: {
|
|
1010
1011
|
flexGrow: "1"
|
|
1011
1012
|
},
|
|
1012
1013
|
context: e.builderContext,
|
|
1013
1014
|
registeredComponents: e.builderComponents,
|
|
1014
|
-
blocks:
|
|
1015
|
+
blocks: C.blocks
|
|
1015
1016
|
}
|
|
1016
1017
|
)
|
|
1017
1018
|
))
|
|
@@ -1062,7 +1063,7 @@ function getSrcSet(e) {
|
|
|
1062
1063
|
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;
|
|
1063
1064
|
}
|
|
1064
1065
|
function Image(e) {
|
|
1065
|
-
var o, a, r,
|
|
1066
|
+
var o, a, r, c;
|
|
1066
1067
|
function t() {
|
|
1067
1068
|
var d;
|
|
1068
1069
|
const s = e.image || e.src;
|
|
@@ -1078,18 +1079,18 @@ function Image(e) {
|
|
|
1078
1079
|
return getSrcSet(s);
|
|
1079
1080
|
}
|
|
1080
1081
|
function n() {
|
|
1081
|
-
var
|
|
1082
|
-
return (
|
|
1082
|
+
var l;
|
|
1083
|
+
return (l = t == null ? void 0 : t()) != null && l.match(/builder\.io/) && !e.noWebp ? t().replace(/\?/g, "?format=webp&") : "";
|
|
1083
1084
|
}
|
|
1084
1085
|
function i() {
|
|
1085
|
-
const
|
|
1086
|
+
const l = {
|
|
1086
1087
|
position: "absolute",
|
|
1087
1088
|
height: "100%",
|
|
1088
1089
|
width: "100%",
|
|
1089
1090
|
left: "0px",
|
|
1090
1091
|
top: "0px"
|
|
1091
1092
|
};
|
|
1092
|
-
return e.aspectRatio ?
|
|
1093
|
+
return e.aspectRatio ? l : void 0;
|
|
1093
1094
|
}
|
|
1094
1095
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1095
1096
|
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -1122,7 +1123,7 @@ function Image(e) {
|
|
|
1122
1123
|
}
|
|
1123
1124
|
}
|
|
1124
1125
|
) }) : null,
|
|
1125
|
-
(
|
|
1126
|
+
(c = (r = e.builderBlock) == null ? void 0 : r.children) != null && c.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: e.children }) : null,
|
|
1126
1127
|
!e.fitContent && e.children ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("div", { className: "div-dbab4030-2", children: e.children }) }) : null
|
|
1127
1128
|
] }),
|
|
1128
1129
|
/* @__PURE__ */ jsx("style", { children: `.img-dbab4030 {
|
|
@@ -1377,7 +1378,7 @@ const componentInfo$a = {
|
|
|
1377
1378
|
});
|
|
1378
1379
|
}
|
|
1379
1380
|
const n = e.get("columns");
|
|
1380
|
-
Array.isArray(n) && n.find((o) => o.get("width")) && (n.find((a) => !a.get("width")) || n.reduce((
|
|
1381
|
+
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();
|
|
1381
1382
|
}
|
|
1382
1383
|
}, {
|
|
1383
1384
|
name: "space",
|
|
@@ -1425,12 +1426,12 @@ const componentInfo$a = {
|
|
|
1425
1426
|
function CustomCode(e) {
|
|
1426
1427
|
const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []);
|
|
1427
1428
|
return useEffect(() => {
|
|
1428
|
-
var
|
|
1429
|
-
if (!((
|
|
1429
|
+
var c;
|
|
1430
|
+
if (!((c = t.current) != null && c.getElementsByTagName) || typeof window == "undefined")
|
|
1430
1431
|
return;
|
|
1431
1432
|
const r = t.current.getElementsByTagName("script");
|
|
1432
|
-
for (let
|
|
1433
|
-
const s = r[
|
|
1433
|
+
for (let l = 0; l < r.length; l++) {
|
|
1434
|
+
const s = r[l];
|
|
1434
1435
|
if (s.src) {
|
|
1435
1436
|
if (n.includes(s.src))
|
|
1436
1437
|
continue;
|
|
@@ -1487,8 +1488,8 @@ const componentInfo$7 = {
|
|
|
1487
1488
|
}]
|
|
1488
1489
|
}, SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"], isJsScript = (e) => SCRIPT_MIME_TYPES.includes(e.type);
|
|
1489
1490
|
function Embed(e) {
|
|
1490
|
-
const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []), [r,
|
|
1491
|
-
function
|
|
1491
|
+
const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []), [r, c] = useState(() => !1);
|
|
1492
|
+
function l() {
|
|
1492
1493
|
if (!t.current || !t.current.getElementsByTagName)
|
|
1493
1494
|
return;
|
|
1494
1495
|
const s = t.current.getElementsByTagName("script");
|
|
@@ -1507,7 +1508,7 @@ function Embed(e) {
|
|
|
1507
1508
|
}
|
|
1508
1509
|
}
|
|
1509
1510
|
return useEffect(() => {
|
|
1510
|
-
t.current && !r && (
|
|
1511
|
+
t.current && !r && (c(!0), l());
|
|
1511
1512
|
}, [t.current, r]), /* @__PURE__ */ jsx(
|
|
1512
1513
|
"div",
|
|
1513
1514
|
{
|
|
@@ -1543,17 +1544,17 @@ const componentInfo$6 = {
|
|
|
1543
1544
|
defaultValue: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",
|
|
1544
1545
|
onChange: (e) => {
|
|
1545
1546
|
e.delete("srcset"), e.delete("noWebp");
|
|
1546
|
-
function n(r,
|
|
1547
|
-
return new Promise((
|
|
1547
|
+
function n(r, c = 6e4) {
|
|
1548
|
+
return new Promise((l, s) => {
|
|
1548
1549
|
const d = document.createElement("img");
|
|
1549
1550
|
let g = !1;
|
|
1550
1551
|
d.onload = () => {
|
|
1551
|
-
g = !0,
|
|
1552
|
+
g = !0, l(d);
|
|
1552
1553
|
}, d.addEventListener("error", (x) => {
|
|
1553
1554
|
console.warn("Image load failed", x.error), s(x.error);
|
|
1554
1555
|
}), d.src = r, setTimeout(() => {
|
|
1555
1556
|
g || s(new Error("Image load timed out"));
|
|
1556
|
-
},
|
|
1557
|
+
}, c);
|
|
1557
1558
|
});
|
|
1558
1559
|
}
|
|
1559
1560
|
function i(r) {
|
|
@@ -1564,8 +1565,8 @@ const componentInfo$6 = {
|
|
|
1564
1565
|
r.type.includes("svg") && e.set("noWebp", !0);
|
|
1565
1566
|
}), o && (!a || a === 0.7041))
|
|
1566
1567
|
return n(o).then((r) => {
|
|
1567
|
-
const
|
|
1568
|
-
e.get("image") === o && (!
|
|
1568
|
+
const c = e.get("aspectRatio");
|
|
1569
|
+
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));
|
|
1569
1570
|
});
|
|
1570
1571
|
}
|
|
1571
1572
|
}, {
|
|
@@ -1840,7 +1841,7 @@ const componentInfo = {
|
|
|
1840
1841
|
}]
|
|
1841
1842
|
};
|
|
1842
1843
|
function Video(e) {
|
|
1843
|
-
var i, o, a, r,
|
|
1844
|
+
var i, o, a, r, c, l, s;
|
|
1844
1845
|
function t() {
|
|
1845
1846
|
return {
|
|
1846
1847
|
...e.autoPlay === !0 ? {
|
|
@@ -1908,7 +1909,7 @@ function Video(e) {
|
|
|
1908
1909
|
}
|
|
1909
1910
|
}
|
|
1910
1911
|
) }) : null,
|
|
1911
|
-
(
|
|
1912
|
+
(c = (r = e.builderBlock) == null ? void 0 : r.children) != null && c.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
1912
1913
|
"div",
|
|
1913
1914
|
{
|
|
1914
1915
|
style: {
|
|
@@ -1919,7 +1920,7 @@ function Video(e) {
|
|
|
1919
1920
|
children: e.children
|
|
1920
1921
|
}
|
|
1921
1922
|
) }) : null,
|
|
1922
|
-
(s = (
|
|
1923
|
+
(s = (l = e.builderBlock) == null ? void 0 : l.children) != null && s.length && !e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
1923
1924
|
"div",
|
|
1924
1925
|
{
|
|
1925
1926
|
style: {
|
|
@@ -2133,7 +2134,7 @@ const findParentElement = (e, t, n = !0) => {
|
|
|
2133
2134
|
builderElementIndex: n && i ? [].slice.call(document.getElementsByClassName(i)).indexOf(n) : void 0
|
|
2134
2135
|
}
|
|
2135
2136
|
};
|
|
2136
|
-
}, SDK_VERSION = "0.
|
|
2137
|
+
}, SDK_VERSION = "0.10.0", registerInsertMenu = () => {
|
|
2137
2138
|
register("insertMenu", {
|
|
2138
2139
|
name: "_default",
|
|
2139
2140
|
default: !0,
|
|
@@ -2182,17 +2183,17 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2182
2183
|
if (i != null && i.type)
|
|
2183
2184
|
switch (i.type) {
|
|
2184
2185
|
case "builder.evaluate": {
|
|
2185
|
-
const r = i.data.text,
|
|
2186
|
+
const r = i.data.text, c = i.data.arguments || [], l = i.data.id, s = new Function(r);
|
|
2186
2187
|
let d, g = null;
|
|
2187
2188
|
try {
|
|
2188
|
-
d = s.apply(null,
|
|
2189
|
+
d = s.apply(null, c);
|
|
2189
2190
|
} catch (x) {
|
|
2190
2191
|
g = x;
|
|
2191
2192
|
}
|
|
2192
2193
|
g ? (o = window.parent) == null || o.postMessage({
|
|
2193
2194
|
type: "builder.evaluateError",
|
|
2194
2195
|
data: {
|
|
2195
|
-
id:
|
|
2196
|
+
id: l,
|
|
2196
2197
|
error: g.message
|
|
2197
2198
|
}
|
|
2198
2199
|
}, "*") : d && typeof d.then == "function" ? d.then((x) => {
|
|
@@ -2200,7 +2201,7 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2200
2201
|
(S = window.parent) == null || S.postMessage({
|
|
2201
2202
|
type: "builder.evaluateResult",
|
|
2202
2203
|
data: {
|
|
2203
|
-
id:
|
|
2204
|
+
id: l,
|
|
2204
2205
|
result: x
|
|
2205
2206
|
}
|
|
2206
2207
|
}, "*");
|
|
@@ -2208,7 +2209,7 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2208
2209
|
type: "builder.evaluateResult",
|
|
2209
2210
|
data: {
|
|
2210
2211
|
result: d,
|
|
2211
|
-
id:
|
|
2212
|
+
id: l
|
|
2212
2213
|
}
|
|
2213
2214
|
}, "*");
|
|
2214
2215
|
break;
|
|
@@ -2217,10 +2218,10 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2217
2218
|
})));
|
|
2218
2219
|
};
|
|
2219
2220
|
function EnableEditor(e) {
|
|
2220
|
-
var R, j,
|
|
2221
|
+
var R, j, P, A, F, _, V;
|
|
2221
2222
|
const t = useRef(null), [n, i] = useState(() => 0);
|
|
2222
2223
|
function o(u) {
|
|
2223
|
-
var h, b,
|
|
2224
|
+
var h, b, v, I, B;
|
|
2224
2225
|
const m = {
|
|
2225
2226
|
...e.builderContextSignal.content,
|
|
2226
2227
|
...u,
|
|
@@ -2231,7 +2232,7 @@ function EnableEditor(e) {
|
|
|
2231
2232
|
meta: {
|
|
2232
2233
|
...(b = e.builderContextSignal.content) == null ? void 0 : b.meta,
|
|
2233
2234
|
...u == null ? void 0 : u.meta,
|
|
2234
|
-
breakpoints: ((
|
|
2235
|
+
breakpoints: ((v = u == null ? void 0 : u.meta) == null ? void 0 : v.breakpoints) || ((B = (I = e.builderContextSignal.content) == null ? void 0 : I.meta) == null ? void 0 : B.breakpoints)
|
|
2235
2236
|
}
|
|
2236
2237
|
};
|
|
2237
2238
|
e.setBuilderContextSignal((W) => ({
|
|
@@ -2242,7 +2243,7 @@ function EnableEditor(e) {
|
|
|
2242
2243
|
useState(() => 0);
|
|
2243
2244
|
const [a, r] = useState(
|
|
2244
2245
|
() => !1
|
|
2245
|
-
), [
|
|
2246
|
+
), [c, l] = useState(
|
|
2246
2247
|
() => e.contentWrapper || "div"
|
|
2247
2248
|
);
|
|
2248
2249
|
function s(u) {
|
|
@@ -2251,19 +2252,19 @@ function EnableEditor(e) {
|
|
|
2251
2252
|
if (m)
|
|
2252
2253
|
switch (m.type) {
|
|
2253
2254
|
case "builder.configureSdk": {
|
|
2254
|
-
const b = m.data, { breakpoints:
|
|
2255
|
+
const b = m.data, { breakpoints: v, contentId: I } = b;
|
|
2255
2256
|
if (!I || I !== ((h = e.builderContextSignal.content) == null ? void 0 : h.id))
|
|
2256
2257
|
return;
|
|
2257
|
-
|
|
2258
|
+
v && o({
|
|
2258
2259
|
meta: {
|
|
2259
|
-
breakpoints:
|
|
2260
|
+
breakpoints: v
|
|
2260
2261
|
}
|
|
2261
2262
|
}), i(n + 1);
|
|
2262
2263
|
break;
|
|
2263
2264
|
}
|
|
2264
2265
|
case "builder.contentUpdate": {
|
|
2265
|
-
const b = m.data,
|
|
2266
|
-
|
|
2266
|
+
const b = m.data, v = b.key || b.alias || b.entry || b.modelName, I = b.data;
|
|
2267
|
+
v === e.model && (o(I), i(n + 1));
|
|
2267
2268
|
break;
|
|
2268
2269
|
}
|
|
2269
2270
|
}
|
|
@@ -2283,20 +2284,20 @@ function EnableEditor(e) {
|
|
|
2283
2284
|
function p(u) {
|
|
2284
2285
|
var m, h;
|
|
2285
2286
|
if (e.builderContextSignal.content) {
|
|
2286
|
-
const b = (m = e.builderContextSignal.content) == null ? void 0 : m.testVariationId,
|
|
2287
|
+
const b = (m = e.builderContextSignal.content) == null ? void 0 : m.testVariationId, v = (h = e.builderContextSignal.content) == null ? void 0 : h.id;
|
|
2287
2288
|
_track({
|
|
2288
2289
|
type: "click",
|
|
2289
2290
|
canTrack: getDefaultCanTrack(e.canTrack),
|
|
2290
|
-
contentId:
|
|
2291
|
+
contentId: v,
|
|
2291
2292
|
apiKey: e.apiKey,
|
|
2292
|
-
variationId: b !==
|
|
2293
|
+
variationId: b !== v ? b : void 0,
|
|
2293
2294
|
...getInteractionPropertiesForEvent(u),
|
|
2294
2295
|
unique: !S
|
|
2295
2296
|
});
|
|
2296
2297
|
}
|
|
2297
2298
|
S || f(!0);
|
|
2298
2299
|
}
|
|
2299
|
-
function
|
|
2300
|
+
function k(u) {
|
|
2300
2301
|
return u.replace(
|
|
2301
2302
|
/{{([^}]+)}}/g,
|
|
2302
2303
|
(m, h) => evaluate({
|
|
@@ -2310,30 +2311,30 @@ function EnableEditor(e) {
|
|
|
2310
2311
|
}
|
|
2311
2312
|
function E({ url: u, key: m }) {
|
|
2312
2313
|
fetch$1(u).then((h) => h.json()).then((h) => {
|
|
2313
|
-
var
|
|
2314
|
+
var v, I;
|
|
2314
2315
|
const b = {
|
|
2315
2316
|
...e.builderContextSignal.rootState,
|
|
2316
2317
|
[m]: h
|
|
2317
2318
|
};
|
|
2318
|
-
(I = (
|
|
2319
|
+
(I = (v = e.builderContextSignal).rootSetState) == null || I.call(v, b), g[m] = !0;
|
|
2319
2320
|
}).catch((h) => {
|
|
2320
2321
|
console.error("error fetching dynamic data", u, h);
|
|
2321
2322
|
});
|
|
2322
2323
|
}
|
|
2323
|
-
function
|
|
2324
|
-
var m, h;
|
|
2325
|
-
const u = ((h = (m = e.builderContextSignal.content) == null ? void 0 : m.data) == null ? void 0 : h.httpRequests)
|
|
2326
|
-
Object.entries(u).forEach(([
|
|
2327
|
-
if (
|
|
2328
|
-
const
|
|
2324
|
+
function C() {
|
|
2325
|
+
var m, h, b;
|
|
2326
|
+
const u = (b = (h = (m = e.builderContextSignal.content) == null ? void 0 : m.data) == null ? void 0 : h.httpRequests) != null ? b : {};
|
|
2327
|
+
Object.entries(u).forEach(([v, I]) => {
|
|
2328
|
+
if (I && (!g[v] || isEditing())) {
|
|
2329
|
+
const B = k(I);
|
|
2329
2330
|
E({
|
|
2330
|
-
url:
|
|
2331
|
-
key:
|
|
2331
|
+
url: B,
|
|
2332
|
+
key: v
|
|
2332
2333
|
});
|
|
2333
2334
|
}
|
|
2334
2335
|
});
|
|
2335
2336
|
}
|
|
2336
|
-
function
|
|
2337
|
+
function y() {
|
|
2337
2338
|
isEditing() && window.dispatchEvent(
|
|
2338
2339
|
new CustomEvent(
|
|
2339
2340
|
"builder:component:stateChange",
|
|
@@ -2367,14 +2368,14 @@ function EnableEditor(e) {
|
|
|
2367
2368
|
(b = window.parent) == null || b.postMessage(h, "*");
|
|
2368
2369
|
}), window.addEventListener(
|
|
2369
2370
|
"builder:component:stateChangeListenerActivated",
|
|
2370
|
-
|
|
2371
|
+
y
|
|
2371
2372
|
);
|
|
2372
2373
|
}
|
|
2373
2374
|
function w(u) {
|
|
2374
2375
|
const m = new URL(location.href).searchParams, h = m.get("builder.preview"), b = m.get(
|
|
2375
2376
|
`builder.preview.${h}`
|
|
2376
|
-
),
|
|
2377
|
-
h === e.model &&
|
|
2377
|
+
), v = m.get("apiKey") || m.get("builder.space");
|
|
2378
|
+
h === e.model && v === e.apiKey && (!e.content || b === e.content.id) && fetchOneEntry({
|
|
2378
2379
|
model: e.model,
|
|
2379
2380
|
apiKey: e.apiKey,
|
|
2380
2381
|
apiVersion: e.builderContextSignal.apiVersion
|
|
@@ -2410,13 +2411,13 @@ function EnableEditor(e) {
|
|
|
2410
2411
|
var u, m;
|
|
2411
2412
|
if (isBrowser()) {
|
|
2412
2413
|
if (isEditing() && t.current && t.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && getDefaultCanTrack(e.canTrack)) {
|
|
2413
|
-
const b = (u = e.builderContextSignal.content) == null ? void 0 : u.testVariationId,
|
|
2414
|
+
const b = (u = e.builderContextSignal.content) == null ? void 0 : u.testVariationId, v = (m = e.builderContextSignal.content) == null ? void 0 : m.id, I = e.apiKey;
|
|
2414
2415
|
_track({
|
|
2415
2416
|
type: "impression",
|
|
2416
2417
|
canTrack: !0,
|
|
2417
|
-
contentId:
|
|
2418
|
+
contentId: v,
|
|
2418
2419
|
apiKey: I,
|
|
2419
|
-
variationId: b !==
|
|
2420
|
+
variationId: b !== v ? b : void 0
|
|
2420
2421
|
});
|
|
2421
2422
|
}
|
|
2422
2423
|
isPreviewing() && t.current && t.current.dispatchEvent(new CustomEvent("initpreviewingbldr"));
|
|
@@ -2424,7 +2425,7 @@ function EnableEditor(e) {
|
|
|
2424
2425
|
}, []), useEffect(() => {
|
|
2425
2426
|
e.apiKey || logger.error(
|
|
2426
2427
|
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
2427
|
-
), d(),
|
|
2428
|
+
), d(), C(), y();
|
|
2428
2429
|
}, []), useEffect(() => {
|
|
2429
2430
|
e.content && o(e.content);
|
|
2430
2431
|
}, [e.content]), useEffect(() => {
|
|
@@ -2434,35 +2435,35 @@ function EnableEditor(e) {
|
|
|
2434
2435
|
(j = (R = e.builderContextSignal.content) == null ? void 0 : R.data) == null ? void 0 : j.jsCode,
|
|
2435
2436
|
e.builderContextSignal.rootState
|
|
2436
2437
|
]), useEffect(() => {
|
|
2437
|
-
|
|
2438
|
-
}, [(
|
|
2439
|
-
|
|
2438
|
+
C();
|
|
2439
|
+
}, [(A = (P = e.builderContextSignal.content) == null ? void 0 : P.data) == null ? void 0 : A.httpRequests]), useEffect(() => {
|
|
2440
|
+
y();
|
|
2440
2441
|
}, [e.builderContextSignal.rootState]), useEffect(() => () => {
|
|
2441
2442
|
isBrowser() && (window.removeEventListener("message", s), window.removeEventListener(
|
|
2442
2443
|
"builder:component:stateChangeListenerActivated",
|
|
2443
|
-
|
|
2444
|
+
y
|
|
2444
2445
|
));
|
|
2445
2446
|
}, []), /* @__PURE__ */ jsx(builderContext.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ createElement(
|
|
2446
|
-
|
|
2447
|
+
c,
|
|
2447
2448
|
{
|
|
2448
2449
|
key: n,
|
|
2449
2450
|
ref: t,
|
|
2450
2451
|
onClick: (u) => p(u),
|
|
2451
|
-
"builder-content-id": (
|
|
2452
|
+
"builder-content-id": (F = e.builderContextSignal.content) == null ? void 0 : F.id,
|
|
2452
2453
|
"builder-model": e.model,
|
|
2453
2454
|
...e.showContent ? {} : {
|
|
2454
2455
|
hidden: !0,
|
|
2455
2456
|
"aria-hidden": !0
|
|
2456
2457
|
},
|
|
2457
2458
|
...e.contentWrapperProps,
|
|
2458
|
-
className: `variant-${((
|
|
2459
|
+
className: `variant-${((_ = e.content) == null ? void 0 : _.testVariationId) || ((V = e.content) == null ? void 0 : V.id)}`
|
|
2459
2460
|
},
|
|
2460
2461
|
e.children
|
|
2461
2462
|
) }) : null });
|
|
2462
2463
|
}
|
|
2463
2464
|
const getCssFromFont = (e) => {
|
|
2464
|
-
var a;
|
|
2465
|
-
const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], i = e.fileUrl
|
|
2465
|
+
var a, r;
|
|
2466
|
+
const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], i = (r = e.fileUrl) != null ? r : (a = e == null ? void 0 : e.files) == null ? void 0 : a.regular;
|
|
2466
2467
|
let o = "";
|
|
2467
2468
|
if (i && t && n && (o += `
|
|
2468
2469
|
@font-face {
|
|
@@ -2472,16 +2473,16 @@ font-display: fallback;
|
|
|
2472
2473
|
font-weight: 400;
|
|
2473
2474
|
}
|
|
2474
2475
|
`.trim()), e.files)
|
|
2475
|
-
for (const
|
|
2476
|
-
if (!(String(Number(
|
|
2476
|
+
for (const c in e.files) {
|
|
2477
|
+
if (!(String(Number(c)) === c))
|
|
2477
2478
|
continue;
|
|
2478
|
-
const
|
|
2479
|
-
|
|
2479
|
+
const s = e.files[c];
|
|
2480
|
+
s && s !== i && (o += `
|
|
2480
2481
|
@font-face {
|
|
2481
2482
|
font-family: "${t}";
|
|
2482
|
-
src: url('${
|
|
2483
|
+
src: url('${s}') format('woff2');
|
|
2483
2484
|
font-display: fallback;
|
|
2484
|
-
font-weight: ${
|
|
2485
|
+
font-weight: ${c};
|
|
2485
2486
|
}
|
|
2486
2487
|
`.trim());
|
|
2487
2488
|
}
|
|
@@ -2527,10 +2528,10 @@ const getContextStateInitialValue = ({
|
|
|
2527
2528
|
data: t,
|
|
2528
2529
|
locale: n
|
|
2529
2530
|
}) => {
|
|
2530
|
-
var a, r,
|
|
2531
|
+
var a, r, c;
|
|
2531
2532
|
const i = {}, o = ((a = e == null ? void 0 : e.data) == null ? void 0 : a.state) || {};
|
|
2532
|
-
return (
|
|
2533
|
-
|
|
2533
|
+
return (c = (r = e == null ? void 0 : e.data) == null ? void 0 : r.inputs) == null || c.forEach((l) => {
|
|
2534
|
+
l.name && l.defaultValue !== void 0 && (i[l.name] = l.defaultValue);
|
|
2534
2535
|
}), {
|
|
2535
2536
|
...i,
|
|
2536
2537
|
...o,
|
|
@@ -2551,21 +2552,21 @@ const getContextStateInitialValue = ({
|
|
|
2551
2552
|
meta: e == null ? void 0 : e.meta
|
|
2552
2553
|
} : void 0;
|
|
2553
2554
|
function ContentComponent(e) {
|
|
2554
|
-
var
|
|
2555
|
+
var l, s, d, g, x, S, f;
|
|
2555
2556
|
const [t, n] = useState(
|
|
2556
2557
|
() => {
|
|
2557
|
-
var p,
|
|
2558
|
+
var p, k;
|
|
2558
2559
|
return getUpdateVariantVisibilityScript({
|
|
2559
2560
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2560
2561
|
variationId: (p = e.content) == null ? void 0 : p.testVariationId,
|
|
2561
2562
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2562
|
-
contentId: (
|
|
2563
|
+
contentId: (k = e.content) == null ? void 0 : k.id
|
|
2563
2564
|
});
|
|
2564
2565
|
}
|
|
2565
2566
|
);
|
|
2566
2567
|
function i(p) {
|
|
2567
|
-
|
|
2568
|
-
...
|
|
2568
|
+
c((k) => ({
|
|
2569
|
+
...k,
|
|
2569
2570
|
rootState: p
|
|
2570
2571
|
}));
|
|
2571
2572
|
}
|
|
@@ -2580,16 +2581,16 @@ function ContentComponent(e) {
|
|
|
2580
2581
|
...components,
|
|
2581
2582
|
...e.customComponents || []
|
|
2582
2583
|
].reduce(
|
|
2583
|
-
(p, { component:
|
|
2584
|
+
(p, { component: k, ...E }) => ({
|
|
2584
2585
|
...p,
|
|
2585
2586
|
[E.name]: {
|
|
2586
|
-
component:
|
|
2587
|
+
component: k,
|
|
2587
2588
|
...serializeComponentInfo(E)
|
|
2588
2589
|
}
|
|
2589
2590
|
}),
|
|
2590
2591
|
{}
|
|
2591
2592
|
)
|
|
2592
|
-
), [r,
|
|
2593
|
+
), [r, c] = useState(() => ({
|
|
2593
2594
|
content: getContentInitialValue({
|
|
2594
2595
|
content: e.content,
|
|
2595
2596
|
data: e.data
|
|
@@ -2614,7 +2615,7 @@ function ContentComponent(e) {
|
|
|
2614
2615
|
...components,
|
|
2615
2616
|
...e.customComponents || []
|
|
2616
2617
|
].reduce(
|
|
2617
|
-
(p, { component:
|
|
2618
|
+
(p, { component: k, ...E }) => ({
|
|
2618
2619
|
...p,
|
|
2619
2620
|
[E.name]: serializeComponentInfo(E)
|
|
2620
2621
|
}),
|
|
@@ -2645,13 +2646,13 @@ function ContentComponent(e) {
|
|
|
2645
2646
|
builderContextSignal: r,
|
|
2646
2647
|
contentWrapper: e.contentWrapper,
|
|
2647
2648
|
contentWrapperProps: e.contentWrapperProps,
|
|
2648
|
-
setBuilderContextSignal:
|
|
2649
|
+
setBuilderContextSignal: c,
|
|
2649
2650
|
children: [
|
|
2650
2651
|
e.isSsrAbTest ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedScript, { scriptStr: t }) }) : null,
|
|
2651
2652
|
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
2652
2653
|
ContentStyles,
|
|
2653
2654
|
{
|
|
2654
|
-
contentId: (
|
|
2655
|
+
contentId: (l = r.content) == null ? void 0 : l.id,
|
|
2655
2656
|
cssCode: (d = (s = r.content) == null ? void 0 : s.data) == null ? void 0 : d.cssCode,
|
|
2656
2657
|
customFonts: (x = (g = r.content) == null ? void 0 : g.data) == null ? void 0 : x.customFonts
|
|
2657
2658
|
}
|
|
@@ -2671,7 +2672,7 @@ function ContentComponent(e) {
|
|
|
2671
2672
|
);
|
|
2672
2673
|
}
|
|
2673
2674
|
function ContentVariants(e) {
|
|
2674
|
-
var r,
|
|
2675
|
+
var r, c;
|
|
2675
2676
|
const [t, n] = useState(
|
|
2676
2677
|
() => checkShouldRenderVariants({
|
|
2677
2678
|
canTrack: getDefaultCanTrack(e.canTrack),
|
|
@@ -2679,23 +2680,23 @@ function ContentVariants(e) {
|
|
|
2679
2680
|
})
|
|
2680
2681
|
);
|
|
2681
2682
|
function i() {
|
|
2682
|
-
var
|
|
2683
|
+
var l;
|
|
2683
2684
|
return getUpdateCookieAndStylesScript(
|
|
2684
2685
|
getVariants(e.content).map((s) => ({
|
|
2685
2686
|
id: s.testVariationId,
|
|
2686
2687
|
testRatio: s.testRatio
|
|
2687
2688
|
})),
|
|
2688
|
-
((
|
|
2689
|
+
((l = e.content) == null ? void 0 : l.id) || ""
|
|
2689
2690
|
);
|
|
2690
2691
|
}
|
|
2691
2692
|
function o() {
|
|
2692
|
-
return getVariants(e.content).map((
|
|
2693
|
+
return getVariants(e.content).map((l) => `.variant-${l.testVariationId} { display: none; } `).join("");
|
|
2693
2694
|
}
|
|
2694
2695
|
function a() {
|
|
2695
|
-
var
|
|
2696
|
+
var l;
|
|
2696
2697
|
return t ? {
|
|
2697
2698
|
...e.content,
|
|
2698
|
-
testVariationId: (
|
|
2699
|
+
testVariationId: (l = e.content) == null ? void 0 : l.id
|
|
2699
2700
|
} : handleABTestingSync({
|
|
2700
2701
|
item: e.content,
|
|
2701
2702
|
canTrack: getDefaultCanTrack(e.canTrack)
|
|
@@ -2713,10 +2714,10 @@ function ContentVariants(e) {
|
|
|
2713
2714
|
}
|
|
2714
2715
|
),
|
|
2715
2716
|
/* @__PURE__ */ jsx(InlinedScript, { scriptStr: i() }),
|
|
2716
|
-
(
|
|
2717
|
+
(c = getVariants(e.content)) == null ? void 0 : c.map((l) => /* @__PURE__ */ jsx(
|
|
2717
2718
|
ContentComponent,
|
|
2718
2719
|
{
|
|
2719
|
-
content:
|
|
2720
|
+
content: l,
|
|
2720
2721
|
showContent: !1,
|
|
2721
2722
|
model: e.model,
|
|
2722
2723
|
data: e.data,
|
|
@@ -2734,7 +2735,7 @@ function ContentVariants(e) {
|
|
|
2734
2735
|
contentWrapper: e.contentWrapper,
|
|
2735
2736
|
contentWrapperProps: e.contentWrapperProps
|
|
2736
2737
|
},
|
|
2737
|
-
|
|
2738
|
+
l.testVariationId
|
|
2738
2739
|
))
|
|
2739
2740
|
] }) : null,
|
|
2740
2741
|
/* @__PURE__ */ jsx(
|
|
@@ -2781,26 +2782,26 @@ const fetchSymbolContent = async ({
|
|
|
2781
2782
|
});
|
|
2782
2783
|
};
|
|
2783
2784
|
function Symbol$1(e) {
|
|
2784
|
-
var a, r,
|
|
2785
|
+
var a, r, c;
|
|
2785
2786
|
function t() {
|
|
2786
|
-
var
|
|
2787
|
+
var l, s;
|
|
2787
2788
|
return [
|
|
2788
2789
|
e.attributes.className,
|
|
2789
2790
|
"builder-symbol",
|
|
2790
|
-
(
|
|
2791
|
+
(l = e.symbol) != null && l.inline ? "builder-inline-symbol" : void 0,
|
|
2791
2792
|
(s = e.symbol) != null && s.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
2792
2793
|
].filter(Boolean).join(" ");
|
|
2793
2794
|
}
|
|
2794
2795
|
const [n, i] = useState(() => {
|
|
2795
|
-
var
|
|
2796
|
-
return (
|
|
2796
|
+
var l;
|
|
2797
|
+
return (l = e.symbol) == null ? void 0 : l.content;
|
|
2797
2798
|
});
|
|
2798
2799
|
function o() {
|
|
2799
2800
|
n || fetchSymbolContent({
|
|
2800
2801
|
symbol: e.symbol,
|
|
2801
2802
|
builderContextValue: e.builderContext
|
|
2802
|
-
}).then((
|
|
2803
|
-
|
|
2803
|
+
}).then((l) => {
|
|
2804
|
+
l && i(l);
|
|
2804
2805
|
});
|
|
2805
2806
|
}
|
|
2806
2807
|
return useEffect(() => {
|
|
@@ -2819,7 +2820,7 @@ function Symbol$1(e) {
|
|
|
2819
2820
|
...e.builderContext.localState,
|
|
2820
2821
|
...(r = n == null ? void 0 : n.data) == null ? void 0 : r.state
|
|
2821
2822
|
},
|
|
2822
|
-
model: (
|
|
2823
|
+
model: (c = e.symbol) == null ? void 0 : c.model,
|
|
2823
2824
|
content: n
|
|
2824
2825
|
}
|
|
2825
2826
|
) });
|