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