@builder.io/sdk-react 0.8.1 → 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 +26 -26
- package/lib/browser/index.mjs +657 -630
- 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 +26 -26
- package/lib/edge/index.mjs +1003 -976
- 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 +16 -16
- package/lib/node/index.mjs +311 -284
- 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/components/blocks/blocks-wrapper.d.ts +8 -0
- package/types/components/blocks/blocks.d.ts +1 -1
- package/types/components/content/components/enable-editor.d.ts +1 -1
- package/types/components/content-variants/content-variants.types.d.ts +16 -0
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/context/types.d.ts +2 -1
- package/types/functions/get-content/index.d.ts +2 -2
- package/types/functions/transform-block-properties.d.ts +5 -1
- package/types/types/enforced-partials.d.ts +7 -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/types/functions/get-react-native-block-styles.d.ts +0 -7
- package/types/functions/sanitize-react-native-block-styles.d.ts +0 -3
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
|
|
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: [
|
|
@@ -39,7 +39,9 @@ const builderContext = createContext({
|
|
|
39
39
|
apiKey: null,
|
|
40
40
|
apiVersion: void 0,
|
|
41
41
|
componentInfos: {},
|
|
42
|
-
inheritedStyles: {}
|
|
42
|
+
inheritedStyles: {},
|
|
43
|
+
BlocksWrapper: "div",
|
|
44
|
+
BlocksWrapperProps: {}
|
|
43
45
|
}), ComponentsContext = createContext({ registeredComponents: {} });
|
|
44
46
|
function getBlockComponentOptions(e) {
|
|
45
47
|
var t;
|
|
@@ -80,13 +82,13 @@ const getFunctionArguments = ({
|
|
|
80
82
|
rootSetState: a,
|
|
81
83
|
rootState: r
|
|
82
84
|
}) => {
|
|
83
|
-
const
|
|
85
|
+
const c = getFunctionArguments({
|
|
84
86
|
builder: t,
|
|
85
87
|
context: n,
|
|
86
88
|
event: i,
|
|
87
89
|
state: flattenState(r, o, a)
|
|
88
90
|
});
|
|
89
|
-
return new Function(...
|
|
91
|
+
return new Function(...c.map(([l]) => l), e)(...c.map(([, l]) => l));
|
|
90
92
|
};
|
|
91
93
|
function flattenState(e, t, n) {
|
|
92
94
|
if (e === t)
|
|
@@ -173,37 +175,37 @@ output;
|
|
|
173
175
|
rootSetState: a,
|
|
174
176
|
rootState: r
|
|
175
177
|
}) => {
|
|
176
|
-
const
|
|
178
|
+
const c = fastClone({
|
|
177
179
|
...r,
|
|
178
180
|
...o
|
|
179
|
-
}),
|
|
181
|
+
}), l = getFunctionArguments({
|
|
180
182
|
builder: t,
|
|
181
183
|
context: n,
|
|
182
184
|
event: i,
|
|
183
|
-
state:
|
|
185
|
+
state: c
|
|
184
186
|
}), s = getIsolateContext(), d = s.global;
|
|
185
|
-
d.setSync("global", d.derefInto()), d.setSync("log", function(...
|
|
186
|
-
console.log(...
|
|
187
|
-
}), d.setSync(BUILDER_SET_STATE_NAME, function(
|
|
188
|
-
set(r,
|
|
189
|
-
}),
|
|
190
|
-
const
|
|
187
|
+
d.setSync("global", d.derefInto()), d.setSync("log", function(...S) {
|
|
188
|
+
console.log(...S);
|
|
189
|
+
}), d.setSync(BUILDER_SET_STATE_NAME, function(S, f) {
|
|
190
|
+
set(r, S, f), a == null || a(r);
|
|
191
|
+
}), l.forEach(([S, f]) => {
|
|
192
|
+
const p = typeof f == "object" ? new ivm.Reference(
|
|
191
193
|
// workaround: methods with default values for arguments is not being cloned over
|
|
192
|
-
|
|
194
|
+
S === "builder" ? {
|
|
193
195
|
...f,
|
|
194
196
|
getUserAttributes: () => f.getUserAttributes()
|
|
195
197
|
} : f
|
|
196
198
|
) : null;
|
|
197
|
-
d.setSync(getSyncValName(
|
|
199
|
+
d.setSync(getSyncValName(S), p);
|
|
198
200
|
}), d.setSync(INJECTED_IVM_GLOBAL, ivm);
|
|
199
201
|
const g = processCode({
|
|
200
202
|
code: e,
|
|
201
|
-
args:
|
|
202
|
-
}),
|
|
203
|
+
args: l
|
|
204
|
+
}), x = s.evalSync(g);
|
|
203
205
|
try {
|
|
204
|
-
return JSON.parse(
|
|
206
|
+
return JSON.parse(x);
|
|
205
207
|
} catch {
|
|
206
|
-
return
|
|
208
|
+
return x;
|
|
207
209
|
}
|
|
208
210
|
}, chooseBrowserOrServerEval = (e) => isBrowser() ? runInBrowser(e) : runInNode(e);
|
|
209
211
|
function evaluate({
|
|
@@ -219,7 +221,7 @@ function evaluate({
|
|
|
219
221
|
logger.warn("Skipping evaluation of empty code block.");
|
|
220
222
|
return;
|
|
221
223
|
}
|
|
222
|
-
const
|
|
224
|
+
const c = {
|
|
223
225
|
code: parseCode(e, {
|
|
224
226
|
isExpression: r
|
|
225
227
|
}),
|
|
@@ -231,9 +233,9 @@ function evaluate({
|
|
|
231
233
|
localState: n
|
|
232
234
|
};
|
|
233
235
|
try {
|
|
234
|
-
return chooseBrowserOrServerEval(
|
|
235
|
-
} catch (
|
|
236
|
-
logger.error("Failed code evaluation: " +
|
|
236
|
+
return chooseBrowserOrServerEval(c);
|
|
237
|
+
} catch (l) {
|
|
238
|
+
logger.error("Failed code evaluation: " + l.message, {
|
|
237
239
|
code: e
|
|
238
240
|
});
|
|
239
241
|
return;
|
|
@@ -260,15 +262,15 @@ const evaluateBindings = ({
|
|
|
260
262
|
...a.actions
|
|
261
263
|
}
|
|
262
264
|
};
|
|
263
|
-
for (const
|
|
264
|
-
const
|
|
265
|
-
code:
|
|
265
|
+
for (const c in e.bindings) {
|
|
266
|
+
const l = e.bindings[c], s = evaluate({
|
|
267
|
+
code: l,
|
|
266
268
|
localState: n,
|
|
267
269
|
rootState: i,
|
|
268
270
|
rootSetState: o,
|
|
269
271
|
context: t
|
|
270
272
|
});
|
|
271
|
-
set(r,
|
|
273
|
+
set(r, c, s);
|
|
272
274
|
}
|
|
273
275
|
return r;
|
|
274
276
|
};
|
|
@@ -331,14 +333,14 @@ const EMPTY_HTML_ELEMENTS = ["area", "base", "br", "col", "embed", "hr", "img",
|
|
|
331
333
|
if (!Array.isArray(o))
|
|
332
334
|
return;
|
|
333
335
|
const a = n.collection.split(".").pop(), r = n.itemName || (a ? a + "Item" : "item");
|
|
334
|
-
return o.map((
|
|
336
|
+
return o.map((l, s) => ({
|
|
335
337
|
context: {
|
|
336
338
|
...t,
|
|
337
339
|
localState: {
|
|
338
340
|
...t.localState,
|
|
339
341
|
$index: s,
|
|
340
|
-
$item:
|
|
341
|
-
[r]:
|
|
342
|
+
$item: l,
|
|
343
|
+
[r]: l,
|
|
342
344
|
[`$${r}Index`]: s
|
|
343
345
|
}
|
|
344
346
|
},
|
|
@@ -428,20 +430,20 @@ function BlockStyles(e) {
|
|
|
428
430
|
shouldEvaluateBindings: !0
|
|
429
431
|
}), o = i.responsiveStyles, a = e.context.content, r = getSizesForBreakpoints(
|
|
430
432
|
((f = a == null ? void 0 : a.meta) == null ? void 0 : f.breakpoints) || {}
|
|
431
|
-
),
|
|
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;
|
|
432
434
|
if (!d)
|
|
433
435
|
return "";
|
|
434
|
-
const g =
|
|
436
|
+
const g = c ? createCssClass({
|
|
435
437
|
className: d,
|
|
436
|
-
styles:
|
|
437
|
-
}) : "",
|
|
438
|
+
styles: c
|
|
439
|
+
}) : "", x = l ? createCssClass({
|
|
438
440
|
className: d,
|
|
439
|
-
styles:
|
|
441
|
+
styles: l,
|
|
440
442
|
mediaQuery: getMaxWidthQueryForSize(
|
|
441
443
|
"medium",
|
|
442
444
|
r
|
|
443
445
|
)
|
|
444
|
-
}) : "",
|
|
446
|
+
}) : "", S = s ? createCssClass({
|
|
445
447
|
className: d,
|
|
446
448
|
styles: s,
|
|
447
449
|
mediaQuery: getMaxWidthQueryForSize(
|
|
@@ -449,7 +451,7 @@ function BlockStyles(e) {
|
|
|
449
451
|
r
|
|
450
452
|
)
|
|
451
453
|
}) : "";
|
|
452
|
-
return [g,
|
|
454
|
+
return [g, x, S].join(" ");
|
|
453
455
|
}
|
|
454
456
|
return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: n() }) }) : null });
|
|
455
457
|
}
|
|
@@ -466,27 +468,30 @@ const getEventHandlerName = (e) => `on${capitalizeFirstLetter(e)}`, createEventH
|
|
|
466
468
|
isExpression: !1
|
|
467
469
|
});
|
|
468
470
|
function getBlockActions(e) {
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
471
|
+
var i;
|
|
472
|
+
const t = {}, n = (i = e.block.actions) != null ? i : {};
|
|
473
|
+
for (const o in n) {
|
|
474
|
+
if (!n.hasOwnProperty(o))
|
|
472
475
|
continue;
|
|
473
|
-
const
|
|
474
|
-
let
|
|
476
|
+
const a = n[o];
|
|
477
|
+
let r = getEventHandlerName(o);
|
|
475
478
|
if (e.stripPrefix)
|
|
476
479
|
switch (TARGET) {
|
|
477
480
|
case "vue2":
|
|
478
481
|
case "vue3":
|
|
479
|
-
|
|
482
|
+
r = r.replace("v-on:", "");
|
|
480
483
|
break;
|
|
481
484
|
case "svelte":
|
|
482
|
-
|
|
485
|
+
r = r.replace("on:", "");
|
|
483
486
|
break;
|
|
484
487
|
}
|
|
485
|
-
t[
|
|
488
|
+
t[r] = createEventHandler(a, e);
|
|
486
489
|
}
|
|
487
490
|
return t;
|
|
488
491
|
}
|
|
489
|
-
function transformBlockProperties(
|
|
492
|
+
function transformBlockProperties({
|
|
493
|
+
properties: e
|
|
494
|
+
}) {
|
|
490
495
|
return e.className = e.class, delete e.class, e;
|
|
491
496
|
}
|
|
492
497
|
const extractRelevantRootBlockProperties = (e) => ({
|
|
@@ -504,7 +509,11 @@ function getBlockProperties({
|
|
|
504
509
|
style: e.style ? getStyleAttribute(e.style) : void 0,
|
|
505
510
|
class: [e.id, "builder-block", e.class, (i = e.properties) == null ? void 0 : i.class].filter(Boolean).join(" ")
|
|
506
511
|
};
|
|
507
|
-
return transformBlockProperties(
|
|
512
|
+
return transformBlockProperties({
|
|
513
|
+
properties: n,
|
|
514
|
+
context: t,
|
|
515
|
+
block: e
|
|
516
|
+
});
|
|
508
517
|
}
|
|
509
518
|
function getStyleAttribute(e) {
|
|
510
519
|
switch (TARGET) {
|
|
@@ -663,7 +672,7 @@ function RepeatedBlock(e) {
|
|
|
663
672
|
) });
|
|
664
673
|
}
|
|
665
674
|
function Block(e) {
|
|
666
|
-
var d, g,
|
|
675
|
+
var d, g, x, S;
|
|
667
676
|
function t() {
|
|
668
677
|
return getComponent({
|
|
669
678
|
block: e.block,
|
|
@@ -692,47 +701,47 @@ function Block(e) {
|
|
|
692
701
|
return e.block.tagName || "div";
|
|
693
702
|
}
|
|
694
703
|
function a() {
|
|
695
|
-
var k,
|
|
704
|
+
var k, E;
|
|
696
705
|
if ((k = e.block.repeat) != null && k.collection)
|
|
697
|
-
return !!((
|
|
706
|
+
return !!((E = n == null ? void 0 : n()) != null && E.length);
|
|
698
707
|
const f = "hide" in i() ? i().hide : !1;
|
|
699
708
|
return ("show" in i() ? i().show : !0) && !f;
|
|
700
709
|
}
|
|
701
710
|
function r() {
|
|
702
|
-
var
|
|
703
|
-
return !((
|
|
711
|
+
var p, k;
|
|
712
|
+
return !((p = t == null ? void 0 : t()) != null && p.component) && !n() ? (k = i().children) != null ? k : [] : [];
|
|
704
713
|
}
|
|
705
|
-
function
|
|
706
|
-
var f,
|
|
714
|
+
function c() {
|
|
715
|
+
var f, p, k, E, C, y;
|
|
707
716
|
return {
|
|
708
|
-
blockChildren: i().children
|
|
709
|
-
componentRef: (
|
|
717
|
+
blockChildren: (f = i().children) != null ? f : [],
|
|
718
|
+
componentRef: (p = t == null ? void 0 : t()) == null ? void 0 : p.component,
|
|
710
719
|
componentOptions: {
|
|
711
720
|
...getBlockComponentOptions(i()),
|
|
712
721
|
builderContext: e.context,
|
|
713
|
-
...((
|
|
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" ? {
|
|
714
723
|
builderComponents: e.registeredComponents
|
|
715
724
|
} : {}
|
|
716
725
|
},
|
|
717
|
-
context:
|
|
726
|
+
context: l,
|
|
718
727
|
registeredComponents: e.registeredComponents,
|
|
719
728
|
builderBlock: i(),
|
|
720
729
|
includeBlockProps: ((C = t == null ? void 0 : t()) == null ? void 0 : C.noWrap) === !0,
|
|
721
|
-
isInteractive: !((
|
|
730
|
+
isInteractive: !((y = t == null ? void 0 : t()) != null && y.isRSC)
|
|
722
731
|
};
|
|
723
732
|
}
|
|
724
|
-
const [
|
|
733
|
+
const [l, s] = useState(() => e.context);
|
|
725
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(
|
|
726
735
|
ComponentRef,
|
|
727
736
|
{
|
|
728
|
-
componentRef:
|
|
729
|
-
componentOptions:
|
|
730
|
-
blockChildren:
|
|
731
|
-
context:
|
|
732
|
-
registeredComponents:
|
|
733
|
-
builderBlock:
|
|
734
|
-
includeBlockProps:
|
|
735
|
-
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
|
|
736
745
|
}
|
|
737
746
|
) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
738
747
|
isEmptyHtmlElement(o()) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
@@ -744,14 +753,14 @@ function Block(e) {
|
|
|
744
753
|
hasChildren: !1
|
|
745
754
|
}
|
|
746
755
|
) }) : null,
|
|
747
|
-
!isEmptyHtmlElement(o()) && n() ? /* @__PURE__ */ jsx(Fragment, { children: (g = n()) == null ? void 0 : g.map((f,
|
|
756
|
+
!isEmptyHtmlElement(o()) && n() ? /* @__PURE__ */ jsx(Fragment, { children: (g = n()) == null ? void 0 : g.map((f, p) => /* @__PURE__ */ jsx(
|
|
748
757
|
RepeatedBlock,
|
|
749
758
|
{
|
|
750
759
|
repeatContext: f.context,
|
|
751
760
|
block: f.block,
|
|
752
761
|
registeredComponents: e.registeredComponents
|
|
753
762
|
},
|
|
754
|
-
|
|
763
|
+
p
|
|
755
764
|
)) }) : null,
|
|
756
765
|
!isEmptyHtmlElement(o()) && !n() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
757
766
|
BlockWrapper,
|
|
@@ -764,30 +773,30 @@ function Block(e) {
|
|
|
764
773
|
/* @__PURE__ */ jsx(
|
|
765
774
|
ComponentRef,
|
|
766
775
|
{
|
|
767
|
-
componentRef:
|
|
768
|
-
componentOptions:
|
|
769
|
-
blockChildren:
|
|
770
|
-
context:
|
|
771
|
-
registeredComponents:
|
|
772
|
-
builderBlock:
|
|
773
|
-
includeBlockProps:
|
|
774
|
-
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
|
|
775
784
|
}
|
|
776
785
|
),
|
|
777
|
-
(
|
|
786
|
+
(x = r()) == null ? void 0 : x.map((f) => /* @__PURE__ */ jsx(
|
|
778
787
|
Block,
|
|
779
788
|
{
|
|
780
789
|
block: f,
|
|
781
|
-
context:
|
|
790
|
+
context: l,
|
|
782
791
|
registeredComponents: e.registeredComponents
|
|
783
792
|
},
|
|
784
793
|
"block-" + f.id
|
|
785
794
|
)),
|
|
786
|
-
(
|
|
795
|
+
(S = r()) == null ? void 0 : S.map((f) => /* @__PURE__ */ jsx(
|
|
787
796
|
BlockStyles,
|
|
788
797
|
{
|
|
789
798
|
block: f,
|
|
790
|
-
context:
|
|
799
|
+
context: l
|
|
791
800
|
},
|
|
792
801
|
"block-style-" + f.id
|
|
793
802
|
))
|
|
@@ -829,19 +838,20 @@ function BlocksWrapper(e) {
|
|
|
829
838
|
}
|
|
830
839
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
831
840
|
/* @__PURE__ */ jsx(
|
|
832
|
-
|
|
841
|
+
e.BlocksWrapper,
|
|
833
842
|
{
|
|
834
|
-
className: t() + "
|
|
843
|
+
className: t() + " props-blocks-wrapper-4f2c12d8",
|
|
835
844
|
"builder-path": e.path,
|
|
836
845
|
"builder-parent-id": e.parent,
|
|
837
846
|
style: e.styleProp,
|
|
838
847
|
onClick: (o) => n(),
|
|
839
848
|
onMouseEnter: (o) => i(),
|
|
840
849
|
onKeyPress: (o) => n(),
|
|
850
|
+
...e.BlocksWrapperProps,
|
|
841
851
|
children: e.children
|
|
842
852
|
}
|
|
843
853
|
),
|
|
844
|
-
/* @__PURE__ */ jsx("style", { children: `.
|
|
854
|
+
/* @__PURE__ */ jsx("style", { children: `.props-blocks-wrapper-4f2c12d8 {
|
|
845
855
|
display: flex;
|
|
846
856
|
flex-direction: column;
|
|
847
857
|
align-items: stretch;
|
|
@@ -849,7 +859,7 @@ function BlocksWrapper(e) {
|
|
|
849
859
|
] });
|
|
850
860
|
}
|
|
851
861
|
function Blocks(e) {
|
|
852
|
-
var i, o;
|
|
862
|
+
var i, o, a, r;
|
|
853
863
|
const t = useContext(builderContext), n = useContext(ComponentsContext);
|
|
854
864
|
return /* @__PURE__ */ jsxs(
|
|
855
865
|
BlocksWrapper,
|
|
@@ -858,59 +868,61 @@ function Blocks(e) {
|
|
|
858
868
|
parent: e.parent,
|
|
859
869
|
path: e.path,
|
|
860
870
|
styleProp: e.styleProp,
|
|
871
|
+
BlocksWrapper: (i = e.context) == null ? void 0 : i.BlocksWrapper,
|
|
872
|
+
BlocksWrapperProps: (o = e.context) == null ? void 0 : o.BlocksWrapperProps,
|
|
861
873
|
children: [
|
|
862
|
-
e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (
|
|
874
|
+
e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (a = e.blocks) == null ? void 0 : a.map((c) => /* @__PURE__ */ jsx(
|
|
863
875
|
Block,
|
|
864
876
|
{
|
|
865
|
-
block:
|
|
877
|
+
block: c,
|
|
866
878
|
context: e.context || t,
|
|
867
879
|
registeredComponents: e.registeredComponents || n.registeredComponents
|
|
868
880
|
},
|
|
869
|
-
"render-block-" +
|
|
881
|
+
"render-block-" + c.id
|
|
870
882
|
)) }) : null,
|
|
871
|
-
e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (
|
|
883
|
+
e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (r = e.blocks) == null ? void 0 : r.map((c) => /* @__PURE__ */ jsx(
|
|
872
884
|
BlockStyles,
|
|
873
885
|
{
|
|
874
|
-
block:
|
|
886
|
+
block: c,
|
|
875
887
|
context: e.context || t
|
|
876
888
|
},
|
|
877
|
-
"block-style-" +
|
|
889
|
+
"block-style-" + c.id
|
|
878
890
|
)) }) : null
|
|
879
891
|
]
|
|
880
892
|
}
|
|
881
893
|
);
|
|
882
894
|
}
|
|
883
895
|
function Columns(e) {
|
|
884
|
-
var
|
|
896
|
+
var E;
|
|
885
897
|
const [t, n] = useState(
|
|
886
898
|
() => typeof e.space == "number" ? e.space || 0 : 20
|
|
887
899
|
), [i, o] = useState(() => e.columns || []), [a, r] = useState(
|
|
888
900
|
() => e.stackColumnsAt || "tablet"
|
|
889
901
|
);
|
|
890
|
-
function
|
|
891
|
-
var
|
|
892
|
-
return ((
|
|
902
|
+
function c(C) {
|
|
903
|
+
var y;
|
|
904
|
+
return ((y = i[C]) == null ? void 0 : y.width) || 100 / i.length;
|
|
893
905
|
}
|
|
894
|
-
function
|
|
895
|
-
const
|
|
896
|
-
return `calc(${
|
|
906
|
+
function l(C) {
|
|
907
|
+
const y = t * (i.length - 1) / i.length;
|
|
908
|
+
return `calc(${c(C)}% - ${y}px)`;
|
|
897
909
|
}
|
|
898
910
|
function s({
|
|
899
|
-
stackedStyle:
|
|
900
|
-
desktopStyle:
|
|
911
|
+
stackedStyle: C,
|
|
912
|
+
desktopStyle: y
|
|
901
913
|
}) {
|
|
902
|
-
return a === "tablet" ?
|
|
914
|
+
return a === "tablet" ? C : y;
|
|
903
915
|
}
|
|
904
916
|
function d({
|
|
905
|
-
stackedStyle:
|
|
906
|
-
desktopStyle:
|
|
917
|
+
stackedStyle: C,
|
|
918
|
+
desktopStyle: y
|
|
907
919
|
}) {
|
|
908
|
-
return a === "never" ?
|
|
920
|
+
return a === "never" ? y : C;
|
|
909
921
|
}
|
|
910
|
-
const [g,
|
|
922
|
+
const [g, x] = useState(
|
|
911
923
|
() => e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column"
|
|
912
924
|
);
|
|
913
|
-
function
|
|
925
|
+
function S() {
|
|
914
926
|
return {
|
|
915
927
|
"--flex-dir": g,
|
|
916
928
|
"--flex-dir-tablet": s({
|
|
@@ -919,8 +931,8 @@ function Columns(e) {
|
|
|
919
931
|
})
|
|
920
932
|
};
|
|
921
933
|
}
|
|
922
|
-
function f(
|
|
923
|
-
const
|
|
934
|
+
function f(C) {
|
|
935
|
+
const y = C === 0 ? 0 : t, T = l(C), w = `${y}px`, R = "100%", j = 0;
|
|
924
936
|
return {
|
|
925
937
|
width: T,
|
|
926
938
|
["marginLeft"]: w,
|
|
@@ -942,15 +954,15 @@ function Columns(e) {
|
|
|
942
954
|
})
|
|
943
955
|
};
|
|
944
956
|
}
|
|
945
|
-
function
|
|
957
|
+
function p(C) {
|
|
946
958
|
var T, w;
|
|
947
959
|
return getSizesForBreakpoints(
|
|
948
960
|
((w = (T = e.builderContext.content) == null ? void 0 : T.meta) == null ? void 0 : w.breakpoints) || {}
|
|
949
|
-
)[
|
|
961
|
+
)[C].max;
|
|
950
962
|
}
|
|
951
963
|
function k() {
|
|
952
964
|
return `
|
|
953
|
-
@media (max-width: ${
|
|
965
|
+
@media (max-width: ${p("medium")}px) {
|
|
954
966
|
.${e.builderBlock.id}-breakpoints {
|
|
955
967
|
flex-direction: var(--flex-dir-tablet);
|
|
956
968
|
align-items: stretch;
|
|
@@ -962,7 +974,7 @@ function Columns(e) {
|
|
|
962
974
|
}
|
|
963
975
|
}
|
|
964
976
|
|
|
965
|
-
@media (max-width: ${
|
|
977
|
+
@media (max-width: ${p("small")}px) {
|
|
966
978
|
.${e.builderBlock.id}-breakpoints {
|
|
967
979
|
flex-direction: var(--flex-dir);
|
|
968
980
|
align-items: stretch;
|
|
@@ -980,27 +992,27 @@ function Columns(e) {
|
|
|
980
992
|
"div",
|
|
981
993
|
{
|
|
982
994
|
className: `builder-columns ${e.builderBlock.id}-breakpoints div-53636e90`,
|
|
983
|
-
style:
|
|
995
|
+
style: S(),
|
|
984
996
|
children: [
|
|
985
997
|
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: k() }) }),
|
|
986
|
-
(
|
|
998
|
+
(E = e.columns) == null ? void 0 : E.map((C, y) => /* @__PURE__ */ createElement(
|
|
987
999
|
"div",
|
|
988
1000
|
{
|
|
989
1001
|
className: "builder-column div-53636e90-2",
|
|
990
|
-
style: f(
|
|
991
|
-
key:
|
|
1002
|
+
style: f(y),
|
|
1003
|
+
key: y
|
|
992
1004
|
},
|
|
993
1005
|
/* @__PURE__ */ jsx(
|
|
994
1006
|
Blocks,
|
|
995
1007
|
{
|
|
996
|
-
path: `component.options.columns.${
|
|
1008
|
+
path: `component.options.columns.${y}.blocks`,
|
|
997
1009
|
parent: e.builderBlock.id,
|
|
998
1010
|
styleProp: {
|
|
999
1011
|
flexGrow: "1"
|
|
1000
1012
|
},
|
|
1001
1013
|
context: e.builderContext,
|
|
1002
1014
|
registeredComponents: e.builderComponents,
|
|
1003
|
-
blocks:
|
|
1015
|
+
blocks: C.blocks
|
|
1004
1016
|
}
|
|
1005
1017
|
)
|
|
1006
1018
|
))
|
|
@@ -1051,7 +1063,7 @@ function getSrcSet(e) {
|
|
|
1051
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;
|
|
1052
1064
|
}
|
|
1053
1065
|
function Image(e) {
|
|
1054
|
-
var o, a, r,
|
|
1066
|
+
var o, a, r, c;
|
|
1055
1067
|
function t() {
|
|
1056
1068
|
var d;
|
|
1057
1069
|
const s = e.image || e.src;
|
|
@@ -1067,18 +1079,18 @@ function Image(e) {
|
|
|
1067
1079
|
return getSrcSet(s);
|
|
1068
1080
|
}
|
|
1069
1081
|
function n() {
|
|
1070
|
-
var
|
|
1071
|
-
return (
|
|
1082
|
+
var l;
|
|
1083
|
+
return (l = t == null ? void 0 : t()) != null && l.match(/builder\.io/) && !e.noWebp ? t().replace(/\?/g, "?format=webp&") : "";
|
|
1072
1084
|
}
|
|
1073
1085
|
function i() {
|
|
1074
|
-
const
|
|
1086
|
+
const l = {
|
|
1075
1087
|
position: "absolute",
|
|
1076
1088
|
height: "100%",
|
|
1077
1089
|
width: "100%",
|
|
1078
1090
|
left: "0px",
|
|
1079
1091
|
top: "0px"
|
|
1080
1092
|
};
|
|
1081
|
-
return e.aspectRatio ?
|
|
1093
|
+
return e.aspectRatio ? l : void 0;
|
|
1082
1094
|
}
|
|
1083
1095
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1084
1096
|
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -1111,7 +1123,7 @@ function Image(e) {
|
|
|
1111
1123
|
}
|
|
1112
1124
|
}
|
|
1113
1125
|
) }) : null,
|
|
1114
|
-
(
|
|
1126
|
+
(c = (r = e.builderBlock) == null ? void 0 : r.children) != null && c.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: e.children }) : null,
|
|
1115
1127
|
!e.fitContent && e.children ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("div", { className: "div-dbab4030-2", children: e.children }) }) : null
|
|
1116
1128
|
] }),
|
|
1117
1129
|
/* @__PURE__ */ jsx("style", { children: `.img-dbab4030 {
|
|
@@ -1366,7 +1378,7 @@ const componentInfo$a = {
|
|
|
1366
1378
|
});
|
|
1367
1379
|
}
|
|
1368
1380
|
const n = e.get("columns");
|
|
1369
|
-
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();
|
|
1370
1382
|
}
|
|
1371
1383
|
}, {
|
|
1372
1384
|
name: "space",
|
|
@@ -1414,12 +1426,12 @@ const componentInfo$a = {
|
|
|
1414
1426
|
function CustomCode(e) {
|
|
1415
1427
|
const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []);
|
|
1416
1428
|
return useEffect(() => {
|
|
1417
|
-
var
|
|
1418
|
-
if (!((
|
|
1429
|
+
var c;
|
|
1430
|
+
if (!((c = t.current) != null && c.getElementsByTagName) || typeof window == "undefined")
|
|
1419
1431
|
return;
|
|
1420
1432
|
const r = t.current.getElementsByTagName("script");
|
|
1421
|
-
for (let
|
|
1422
|
-
const s = r[
|
|
1433
|
+
for (let l = 0; l < r.length; l++) {
|
|
1434
|
+
const s = r[l];
|
|
1423
1435
|
if (s.src) {
|
|
1424
1436
|
if (n.includes(s.src))
|
|
1425
1437
|
continue;
|
|
@@ -1476,8 +1488,8 @@ const componentInfo$7 = {
|
|
|
1476
1488
|
}]
|
|
1477
1489
|
}, SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"], isJsScript = (e) => SCRIPT_MIME_TYPES.includes(e.type);
|
|
1478
1490
|
function Embed(e) {
|
|
1479
|
-
const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []), [r,
|
|
1480
|
-
function
|
|
1491
|
+
const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []), [r, c] = useState(() => !1);
|
|
1492
|
+
function l() {
|
|
1481
1493
|
if (!t.current || !t.current.getElementsByTagName)
|
|
1482
1494
|
return;
|
|
1483
1495
|
const s = t.current.getElementsByTagName("script");
|
|
@@ -1485,18 +1497,18 @@ function Embed(e) {
|
|
|
1485
1497
|
const g = s[d];
|
|
1486
1498
|
if (g.src && !n.includes(g.src)) {
|
|
1487
1499
|
n.push(g.src);
|
|
1488
|
-
const
|
|
1489
|
-
|
|
1500
|
+
const x = document.createElement("script");
|
|
1501
|
+
x.async = !0, x.src = g.src, document.head.appendChild(x);
|
|
1490
1502
|
} else if (isJsScript(g) && !o.includes(g.innerText))
|
|
1491
1503
|
try {
|
|
1492
1504
|
o.push(g.innerText), new Function(g.innerText)();
|
|
1493
|
-
} catch (
|
|
1494
|
-
console.warn("`Embed`: Error running script:",
|
|
1505
|
+
} catch (x) {
|
|
1506
|
+
console.warn("`Embed`: Error running script:", x);
|
|
1495
1507
|
}
|
|
1496
1508
|
}
|
|
1497
1509
|
}
|
|
1498
1510
|
return useEffect(() => {
|
|
1499
|
-
t.current && !r && (
|
|
1511
|
+
t.current && !r && (c(!0), l());
|
|
1500
1512
|
}, [t.current, r]), /* @__PURE__ */ jsx(
|
|
1501
1513
|
"div",
|
|
1502
1514
|
{
|
|
@@ -1532,17 +1544,17 @@ const componentInfo$6 = {
|
|
|
1532
1544
|
defaultValue: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",
|
|
1533
1545
|
onChange: (e) => {
|
|
1534
1546
|
e.delete("srcset"), e.delete("noWebp");
|
|
1535
|
-
function n(r,
|
|
1536
|
-
return new Promise((
|
|
1547
|
+
function n(r, c = 6e4) {
|
|
1548
|
+
return new Promise((l, s) => {
|
|
1537
1549
|
const d = document.createElement("img");
|
|
1538
1550
|
let g = !1;
|
|
1539
1551
|
d.onload = () => {
|
|
1540
|
-
g = !0,
|
|
1541
|
-
}, d.addEventListener("error", (
|
|
1542
|
-
console.warn("Image load failed",
|
|
1552
|
+
g = !0, l(d);
|
|
1553
|
+
}, d.addEventListener("error", (x) => {
|
|
1554
|
+
console.warn("Image load failed", x.error), s(x.error);
|
|
1543
1555
|
}), d.src = r, setTimeout(() => {
|
|
1544
1556
|
g || s(new Error("Image load timed out"));
|
|
1545
|
-
},
|
|
1557
|
+
}, c);
|
|
1546
1558
|
});
|
|
1547
1559
|
}
|
|
1548
1560
|
function i(r) {
|
|
@@ -1553,8 +1565,8 @@ const componentInfo$6 = {
|
|
|
1553
1565
|
r.type.includes("svg") && e.set("noWebp", !0);
|
|
1554
1566
|
}), o && (!a || a === 0.7041))
|
|
1555
1567
|
return n(o).then((r) => {
|
|
1556
|
-
const
|
|
1557
|
-
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));
|
|
1558
1570
|
});
|
|
1559
1571
|
}
|
|
1560
1572
|
}, {
|
|
@@ -1829,7 +1841,7 @@ const componentInfo = {
|
|
|
1829
1841
|
}]
|
|
1830
1842
|
};
|
|
1831
1843
|
function Video(e) {
|
|
1832
|
-
var i, o, a, r,
|
|
1844
|
+
var i, o, a, r, c, l, s;
|
|
1833
1845
|
function t() {
|
|
1834
1846
|
return {
|
|
1835
1847
|
...e.autoPlay === !0 ? {
|
|
@@ -1897,7 +1909,7 @@ function Video(e) {
|
|
|
1897
1909
|
}
|
|
1898
1910
|
}
|
|
1899
1911
|
) }) : null,
|
|
1900
|
-
(
|
|
1912
|
+
(c = (r = e.builderBlock) == null ? void 0 : r.children) != null && c.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
1901
1913
|
"div",
|
|
1902
1914
|
{
|
|
1903
1915
|
style: {
|
|
@@ -1908,7 +1920,7 @@ function Video(e) {
|
|
|
1908
1920
|
children: e.children
|
|
1909
1921
|
}
|
|
1910
1922
|
) }) : null,
|
|
1911
|
-
(s = (
|
|
1923
|
+
(s = (l = e.builderBlock) == null ? void 0 : l.children) != null && s.length && !e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
1912
1924
|
"div",
|
|
1913
1925
|
{
|
|
1914
1926
|
style: {
|
|
@@ -2122,7 +2134,7 @@ const findParentElement = (e, t, n = !0) => {
|
|
|
2122
2134
|
builderElementIndex: n && i ? [].slice.call(document.getElementsByClassName(i)).indexOf(n) : void 0
|
|
2123
2135
|
}
|
|
2124
2136
|
};
|
|
2125
|
-
}, SDK_VERSION = "0.
|
|
2137
|
+
}, SDK_VERSION = "0.10.0", registerInsertMenu = () => {
|
|
2126
2138
|
register("insertMenu", {
|
|
2127
2139
|
name: "_default",
|
|
2128
2140
|
default: !0,
|
|
@@ -2171,33 +2183,33 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2171
2183
|
if (i != null && i.type)
|
|
2172
2184
|
switch (i.type) {
|
|
2173
2185
|
case "builder.evaluate": {
|
|
2174
|
-
const r = i.data.text,
|
|
2186
|
+
const r = i.data.text, c = i.data.arguments || [], l = i.data.id, s = new Function(r);
|
|
2175
2187
|
let d, g = null;
|
|
2176
2188
|
try {
|
|
2177
|
-
d = s.apply(null,
|
|
2178
|
-
} catch (
|
|
2179
|
-
g =
|
|
2189
|
+
d = s.apply(null, c);
|
|
2190
|
+
} catch (x) {
|
|
2191
|
+
g = x;
|
|
2180
2192
|
}
|
|
2181
2193
|
g ? (o = window.parent) == null || o.postMessage({
|
|
2182
2194
|
type: "builder.evaluateError",
|
|
2183
2195
|
data: {
|
|
2184
|
-
id:
|
|
2196
|
+
id: l,
|
|
2185
2197
|
error: g.message
|
|
2186
2198
|
}
|
|
2187
|
-
}, "*") : d && typeof d.then == "function" ? d.then((
|
|
2188
|
-
var
|
|
2189
|
-
(
|
|
2199
|
+
}, "*") : d && typeof d.then == "function" ? d.then((x) => {
|
|
2200
|
+
var S;
|
|
2201
|
+
(S = window.parent) == null || S.postMessage({
|
|
2190
2202
|
type: "builder.evaluateResult",
|
|
2191
2203
|
data: {
|
|
2192
|
-
id:
|
|
2193
|
-
result:
|
|
2204
|
+
id: l,
|
|
2205
|
+
result: x
|
|
2194
2206
|
}
|
|
2195
2207
|
}, "*");
|
|
2196
2208
|
}).catch(console.error) : (a = window.parent) == null || a.postMessage({
|
|
2197
2209
|
type: "builder.evaluateResult",
|
|
2198
2210
|
data: {
|
|
2199
2211
|
result: d,
|
|
2200
|
-
id:
|
|
2212
|
+
id: l
|
|
2201
2213
|
}
|
|
2202
2214
|
}, "*");
|
|
2203
2215
|
break;
|
|
@@ -2206,10 +2218,10 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2206
2218
|
})));
|
|
2207
2219
|
};
|
|
2208
2220
|
function EnableEditor(e) {
|
|
2209
|
-
var
|
|
2221
|
+
var R, j, P, A, F, _, V;
|
|
2210
2222
|
const t = useRef(null), [n, i] = useState(() => 0);
|
|
2211
2223
|
function o(u) {
|
|
2212
|
-
var h,
|
|
2224
|
+
var h, b, v, I, B;
|
|
2213
2225
|
const m = {
|
|
2214
2226
|
...e.builderContextSignal.content,
|
|
2215
2227
|
...u,
|
|
@@ -2218,44 +2230,46 @@ function EnableEditor(e) {
|
|
|
2218
2230
|
...u == null ? void 0 : u.data
|
|
2219
2231
|
},
|
|
2220
2232
|
meta: {
|
|
2221
|
-
...(
|
|
2233
|
+
...(b = e.builderContextSignal.content) == null ? void 0 : b.meta,
|
|
2222
2234
|
...u == null ? void 0 : u.meta,
|
|
2223
|
-
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)
|
|
2224
2236
|
}
|
|
2225
2237
|
};
|
|
2226
|
-
e.setBuilderContextSignal((
|
|
2227
|
-
...
|
|
2238
|
+
e.setBuilderContextSignal((W) => ({
|
|
2239
|
+
...W,
|
|
2228
2240
|
content: m
|
|
2229
2241
|
}));
|
|
2230
2242
|
}
|
|
2231
2243
|
useState(() => 0);
|
|
2232
2244
|
const [a, r] = useState(
|
|
2233
2245
|
() => !1
|
|
2246
|
+
), [c, l] = useState(
|
|
2247
|
+
() => e.contentWrapper || "div"
|
|
2234
2248
|
);
|
|
2235
|
-
function
|
|
2249
|
+
function s(u) {
|
|
2236
2250
|
var h;
|
|
2237
2251
|
const { data: m } = u;
|
|
2238
2252
|
if (m)
|
|
2239
2253
|
switch (m.type) {
|
|
2240
2254
|
case "builder.configureSdk": {
|
|
2241
|
-
const
|
|
2242
|
-
if (!
|
|
2255
|
+
const b = m.data, { breakpoints: v, contentId: I } = b;
|
|
2256
|
+
if (!I || I !== ((h = e.builderContextSignal.content) == null ? void 0 : h.id))
|
|
2243
2257
|
return;
|
|
2244
|
-
|
|
2258
|
+
v && o({
|
|
2245
2259
|
meta: {
|
|
2246
|
-
breakpoints:
|
|
2260
|
+
breakpoints: v
|
|
2247
2261
|
}
|
|
2248
2262
|
}), i(n + 1);
|
|
2249
2263
|
break;
|
|
2250
2264
|
}
|
|
2251
2265
|
case "builder.contentUpdate": {
|
|
2252
|
-
const
|
|
2253
|
-
|
|
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));
|
|
2254
2268
|
break;
|
|
2255
2269
|
}
|
|
2256
2270
|
}
|
|
2257
2271
|
}
|
|
2258
|
-
function
|
|
2272
|
+
function d() {
|
|
2259
2273
|
var m, h;
|
|
2260
2274
|
const u = (h = (m = e.builderContextSignal.content) == null ? void 0 : m.data) == null ? void 0 : h.jsCode;
|
|
2261
2275
|
u && evaluate({
|
|
@@ -2266,24 +2280,24 @@ function EnableEditor(e) {
|
|
|
2266
2280
|
rootSetState: e.builderContextSignal.rootSetState
|
|
2267
2281
|
});
|
|
2268
2282
|
}
|
|
2269
|
-
const [
|
|
2270
|
-
function
|
|
2283
|
+
const [g, x] = useState(() => ({})), [S, f] = useState(() => !1);
|
|
2284
|
+
function p(u) {
|
|
2271
2285
|
var m, h;
|
|
2272
2286
|
if (e.builderContextSignal.content) {
|
|
2273
|
-
const
|
|
2287
|
+
const b = (m = e.builderContextSignal.content) == null ? void 0 : m.testVariationId, v = (h = e.builderContextSignal.content) == null ? void 0 : h.id;
|
|
2274
2288
|
_track({
|
|
2275
2289
|
type: "click",
|
|
2276
2290
|
canTrack: getDefaultCanTrack(e.canTrack),
|
|
2277
|
-
contentId:
|
|
2291
|
+
contentId: v,
|
|
2278
2292
|
apiKey: e.apiKey,
|
|
2279
|
-
variationId:
|
|
2293
|
+
variationId: b !== v ? b : void 0,
|
|
2280
2294
|
...getInteractionPropertiesForEvent(u),
|
|
2281
|
-
unique: !
|
|
2295
|
+
unique: !S
|
|
2282
2296
|
});
|
|
2283
2297
|
}
|
|
2284
|
-
|
|
2298
|
+
S || f(!0);
|
|
2285
2299
|
}
|
|
2286
|
-
function
|
|
2300
|
+
function k(u) {
|
|
2287
2301
|
return u.replace(
|
|
2288
2302
|
/{{([^}]+)}}/g,
|
|
2289
2303
|
(m, h) => evaluate({
|
|
@@ -2295,32 +2309,32 @@ function EnableEditor(e) {
|
|
|
2295
2309
|
})
|
|
2296
2310
|
);
|
|
2297
2311
|
}
|
|
2298
|
-
function
|
|
2312
|
+
function E({ url: u, key: m }) {
|
|
2299
2313
|
fetch$1(u).then((h) => h.json()).then((h) => {
|
|
2300
|
-
var
|
|
2301
|
-
const
|
|
2314
|
+
var v, I;
|
|
2315
|
+
const b = {
|
|
2302
2316
|
...e.builderContextSignal.rootState,
|
|
2303
2317
|
[m]: h
|
|
2304
2318
|
};
|
|
2305
|
-
(
|
|
2319
|
+
(I = (v = e.builderContextSignal).rootSetState) == null || I.call(v, b), g[m] = !0;
|
|
2306
2320
|
}).catch((h) => {
|
|
2307
2321
|
console.error("error fetching dynamic data", u, h);
|
|
2308
2322
|
});
|
|
2309
2323
|
}
|
|
2310
|
-
function
|
|
2311
|
-
var m, h;
|
|
2312
|
-
const u = ((h = (m = e.builderContextSignal.content) == null ? void 0 : m.data) == null ? void 0 : h.httpRequests)
|
|
2313
|
-
Object.entries(u).forEach(([
|
|
2314
|
-
if (
|
|
2315
|
-
const
|
|
2316
|
-
|
|
2317
|
-
url:
|
|
2318
|
-
key:
|
|
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);
|
|
2330
|
+
E({
|
|
2331
|
+
url: B,
|
|
2332
|
+
key: v
|
|
2319
2333
|
});
|
|
2320
2334
|
}
|
|
2321
2335
|
});
|
|
2322
2336
|
}
|
|
2323
|
-
function
|
|
2337
|
+
function y() {
|
|
2324
2338
|
isEditing() && window.dispatchEvent(
|
|
2325
2339
|
new CustomEvent(
|
|
2326
2340
|
"builder:component:stateChange",
|
|
@@ -2335,8 +2349,8 @@ function EnableEditor(e) {
|
|
|
2335
2349
|
)
|
|
2336
2350
|
);
|
|
2337
2351
|
}
|
|
2338
|
-
function
|
|
2339
|
-
i(n + 1), window.addEventListener("message",
|
|
2352
|
+
function T(u) {
|
|
2353
|
+
i(n + 1), window.addEventListener("message", s), registerInsertMenu(), setupBrowserForEditing({
|
|
2340
2354
|
...e.locale ? {
|
|
2341
2355
|
locale: e.locale
|
|
2342
2356
|
} : {},
|
|
@@ -2349,61 +2363,61 @@ function EnableEditor(e) {
|
|
|
2349
2363
|
}), Object.values(
|
|
2350
2364
|
e.builderContextSignal.componentInfos
|
|
2351
2365
|
).forEach((m) => {
|
|
2352
|
-
var
|
|
2366
|
+
var b;
|
|
2353
2367
|
const h = createRegisterComponentMessage(m);
|
|
2354
|
-
(
|
|
2368
|
+
(b = window.parent) == null || b.postMessage(h, "*");
|
|
2355
2369
|
}), window.addEventListener(
|
|
2356
2370
|
"builder:component:stateChangeListenerActivated",
|
|
2357
|
-
|
|
2371
|
+
y
|
|
2358
2372
|
);
|
|
2359
2373
|
}
|
|
2360
|
-
function
|
|
2361
|
-
const m = new URL(location.href).searchParams, h = m.get("builder.preview"),
|
|
2374
|
+
function w(u) {
|
|
2375
|
+
const m = new URL(location.href).searchParams, h = m.get("builder.preview"), b = m.get(
|
|
2362
2376
|
`builder.preview.${h}`
|
|
2363
|
-
),
|
|
2364
|
-
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({
|
|
2365
2379
|
model: e.model,
|
|
2366
2380
|
apiKey: e.apiKey,
|
|
2367
2381
|
apiVersion: e.builderContextSignal.apiVersion
|
|
2368
|
-
}).then((
|
|
2369
|
-
|
|
2382
|
+
}).then((I) => {
|
|
2383
|
+
I && o(I);
|
|
2370
2384
|
});
|
|
2371
2385
|
}
|
|
2372
2386
|
return useEffect(() => {
|
|
2373
2387
|
var u;
|
|
2374
2388
|
return (u = t.current) == null || u.addEventListener(
|
|
2375
2389
|
"initeditingbldr",
|
|
2376
|
-
|
|
2390
|
+
T
|
|
2377
2391
|
), () => {
|
|
2378
2392
|
var m;
|
|
2379
2393
|
return (m = t.current) == null ? void 0 : m.removeEventListener(
|
|
2380
2394
|
"initeditingbldr",
|
|
2381
|
-
|
|
2395
|
+
T
|
|
2382
2396
|
);
|
|
2383
2397
|
};
|
|
2384
2398
|
}, []), useEffect(() => {
|
|
2385
2399
|
var u;
|
|
2386
2400
|
return (u = t.current) == null || u.addEventListener(
|
|
2387
2401
|
"initpreviewingbldr",
|
|
2388
|
-
|
|
2402
|
+
w
|
|
2389
2403
|
), () => {
|
|
2390
2404
|
var m;
|
|
2391
2405
|
return (m = t.current) == null ? void 0 : m.removeEventListener(
|
|
2392
2406
|
"initpreviewingbldr",
|
|
2393
|
-
|
|
2407
|
+
w
|
|
2394
2408
|
);
|
|
2395
2409
|
};
|
|
2396
2410
|
}, []), useEffect(() => {
|
|
2397
2411
|
var u, m;
|
|
2398
2412
|
if (isBrowser()) {
|
|
2399
2413
|
if (isEditing() && t.current && t.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && getDefaultCanTrack(e.canTrack)) {
|
|
2400
|
-
const
|
|
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;
|
|
2401
2415
|
_track({
|
|
2402
2416
|
type: "impression",
|
|
2403
2417
|
canTrack: !0,
|
|
2404
|
-
contentId:
|
|
2405
|
-
apiKey:
|
|
2406
|
-
variationId:
|
|
2418
|
+
contentId: v,
|
|
2419
|
+
apiKey: I,
|
|
2420
|
+
variationId: b !== v ? b : void 0
|
|
2407
2421
|
});
|
|
2408
2422
|
}
|
|
2409
2423
|
isPreviewing() && t.current && t.current.dispatchEvent(new CustomEvent("initpreviewingbldr"));
|
|
@@ -2411,44 +2425,45 @@ function EnableEditor(e) {
|
|
|
2411
2425
|
}, []), useEffect(() => {
|
|
2412
2426
|
e.apiKey || logger.error(
|
|
2413
2427
|
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
2414
|
-
),
|
|
2428
|
+
), d(), C(), y();
|
|
2415
2429
|
}, []), useEffect(() => {
|
|
2416
2430
|
e.content && o(e.content);
|
|
2417
2431
|
}, [e.content]), useEffect(() => {
|
|
2418
2432
|
}, [a]), useEffect(() => {
|
|
2419
|
-
|
|
2433
|
+
d();
|
|
2420
2434
|
}, [
|
|
2421
|
-
(
|
|
2435
|
+
(j = (R = e.builderContextSignal.content) == null ? void 0 : R.data) == null ? void 0 : j.jsCode,
|
|
2422
2436
|
e.builderContextSignal.rootState
|
|
2423
2437
|
]), useEffect(() => {
|
|
2424
|
-
k();
|
|
2425
|
-
}, [(j = (R = e.builderContextSignal.content) == null ? void 0 : R.data) == null ? void 0 : j.httpRequests]), useEffect(() => {
|
|
2426
2438
|
C();
|
|
2439
|
+
}, [(A = (P = e.builderContextSignal.content) == null ? void 0 : P.data) == null ? void 0 : A.httpRequests]), useEffect(() => {
|
|
2440
|
+
y();
|
|
2427
2441
|
}, [e.builderContextSignal.rootState]), useEffect(() => () => {
|
|
2428
|
-
isBrowser() && (window.removeEventListener("message",
|
|
2442
|
+
isBrowser() && (window.removeEventListener("message", s), window.removeEventListener(
|
|
2429
2443
|
"builder:component:stateChangeListenerActivated",
|
|
2430
|
-
|
|
2444
|
+
y
|
|
2431
2445
|
));
|
|
2432
2446
|
}, []), /* @__PURE__ */ jsx(builderContext.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ createElement(
|
|
2433
|
-
|
|
2447
|
+
c,
|
|
2434
2448
|
{
|
|
2435
2449
|
key: n,
|
|
2436
2450
|
ref: t,
|
|
2437
|
-
onClick: (u) =>
|
|
2438
|
-
"builder-content-id": (
|
|
2451
|
+
onClick: (u) => p(u),
|
|
2452
|
+
"builder-content-id": (F = e.builderContextSignal.content) == null ? void 0 : F.id,
|
|
2439
2453
|
"builder-model": e.model,
|
|
2440
2454
|
...e.showContent ? {} : {
|
|
2441
2455
|
hidden: !0,
|
|
2442
2456
|
"aria-hidden": !0
|
|
2443
2457
|
},
|
|
2444
|
-
|
|
2458
|
+
...e.contentWrapperProps,
|
|
2459
|
+
className: `variant-${((_ = e.content) == null ? void 0 : _.testVariationId) || ((V = e.content) == null ? void 0 : V.id)}`
|
|
2445
2460
|
},
|
|
2446
2461
|
e.children
|
|
2447
2462
|
) }) : null });
|
|
2448
2463
|
}
|
|
2449
2464
|
const getCssFromFont = (e) => {
|
|
2450
|
-
var a;
|
|
2451
|
-
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;
|
|
2452
2467
|
let o = "";
|
|
2453
2468
|
if (i && t && n && (o += `
|
|
2454
2469
|
@font-face {
|
|
@@ -2458,16 +2473,16 @@ font-display: fallback;
|
|
|
2458
2473
|
font-weight: 400;
|
|
2459
2474
|
}
|
|
2460
2475
|
`.trim()), e.files)
|
|
2461
|
-
for (const
|
|
2462
|
-
if (!(String(Number(
|
|
2476
|
+
for (const c in e.files) {
|
|
2477
|
+
if (!(String(Number(c)) === c))
|
|
2463
2478
|
continue;
|
|
2464
|
-
const
|
|
2465
|
-
|
|
2479
|
+
const s = e.files[c];
|
|
2480
|
+
s && s !== i && (o += `
|
|
2466
2481
|
@font-face {
|
|
2467
2482
|
font-family: "${t}";
|
|
2468
|
-
src: url('${
|
|
2483
|
+
src: url('${s}') format('woff2');
|
|
2469
2484
|
font-display: fallback;
|
|
2470
|
-
font-weight: ${
|
|
2485
|
+
font-weight: ${c};
|
|
2471
2486
|
}
|
|
2472
2487
|
`.trim());
|
|
2473
2488
|
}
|
|
@@ -2513,10 +2528,10 @@ const getContextStateInitialValue = ({
|
|
|
2513
2528
|
data: t,
|
|
2514
2529
|
locale: n
|
|
2515
2530
|
}) => {
|
|
2516
|
-
var a, r,
|
|
2531
|
+
var a, r, c;
|
|
2517
2532
|
const i = {}, o = ((a = e == null ? void 0 : e.data) == null ? void 0 : a.state) || {};
|
|
2518
|
-
return (
|
|
2519
|
-
|
|
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);
|
|
2520
2535
|
}), {
|
|
2521
2536
|
...i,
|
|
2522
2537
|
...o,
|
|
@@ -2537,22 +2552,22 @@ const getContextStateInitialValue = ({
|
|
|
2537
2552
|
meta: e == null ? void 0 : e.meta
|
|
2538
2553
|
} : void 0;
|
|
2539
2554
|
function ContentComponent(e) {
|
|
2540
|
-
var
|
|
2555
|
+
var l, s, d, g, x, S, f;
|
|
2541
2556
|
const [t, n] = useState(
|
|
2542
2557
|
() => {
|
|
2543
|
-
var
|
|
2558
|
+
var p, k;
|
|
2544
2559
|
return getUpdateVariantVisibilityScript({
|
|
2545
2560
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2546
|
-
variationId: (
|
|
2561
|
+
variationId: (p = e.content) == null ? void 0 : p.testVariationId,
|
|
2547
2562
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2548
2563
|
contentId: (k = e.content) == null ? void 0 : k.id
|
|
2549
2564
|
});
|
|
2550
2565
|
}
|
|
2551
2566
|
);
|
|
2552
|
-
function i(
|
|
2553
|
-
|
|
2567
|
+
function i(p) {
|
|
2568
|
+
c((k) => ({
|
|
2554
2569
|
...k,
|
|
2555
|
-
rootState:
|
|
2570
|
+
rootState: p
|
|
2556
2571
|
}));
|
|
2557
2572
|
}
|
|
2558
2573
|
const [o, a] = useState(
|
|
@@ -2566,16 +2581,16 @@ function ContentComponent(e) {
|
|
|
2566
2581
|
...components,
|
|
2567
2582
|
...e.customComponents || []
|
|
2568
2583
|
].reduce(
|
|
2569
|
-
(
|
|
2570
|
-
...
|
|
2571
|
-
[
|
|
2584
|
+
(p, { component: k, ...E }) => ({
|
|
2585
|
+
...p,
|
|
2586
|
+
[E.name]: {
|
|
2572
2587
|
component: k,
|
|
2573
|
-
...serializeComponentInfo(
|
|
2588
|
+
...serializeComponentInfo(E)
|
|
2574
2589
|
}
|
|
2575
2590
|
}),
|
|
2576
2591
|
{}
|
|
2577
2592
|
)
|
|
2578
|
-
), [r,
|
|
2593
|
+
), [r, c] = useState(() => ({
|
|
2579
2594
|
content: getContentInitialValue({
|
|
2580
2595
|
content: e.content,
|
|
2581
2596
|
data: e.data
|
|
@@ -2600,13 +2615,15 @@ function ContentComponent(e) {
|
|
|
2600
2615
|
...components,
|
|
2601
2616
|
...e.customComponents || []
|
|
2602
2617
|
].reduce(
|
|
2603
|
-
(
|
|
2604
|
-
...
|
|
2605
|
-
[
|
|
2618
|
+
(p, { component: k, ...E }) => ({
|
|
2619
|
+
...p,
|
|
2620
|
+
[E.name]: serializeComponentInfo(E)
|
|
2606
2621
|
}),
|
|
2607
2622
|
{}
|
|
2608
2623
|
),
|
|
2609
|
-
inheritedStyles: {}
|
|
2624
|
+
inheritedStyles: {},
|
|
2625
|
+
BlocksWrapper: e.blocksWrapper || "div",
|
|
2626
|
+
BlocksWrapperProps: e.blocksWrapperProps || {}
|
|
2610
2627
|
}));
|
|
2611
2628
|
return /* @__PURE__ */ jsx(
|
|
2612
2629
|
ComponentsContext.Provider,
|
|
@@ -2627,21 +2644,23 @@ function ContentComponent(e) {
|
|
|
2627
2644
|
enrich: e.enrich,
|
|
2628
2645
|
showContent: e.showContent,
|
|
2629
2646
|
builderContextSignal: r,
|
|
2630
|
-
|
|
2647
|
+
contentWrapper: e.contentWrapper,
|
|
2648
|
+
contentWrapperProps: e.contentWrapperProps,
|
|
2649
|
+
setBuilderContextSignal: c,
|
|
2631
2650
|
children: [
|
|
2632
2651
|
e.isSsrAbTest ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedScript, { scriptStr: t }) }) : null,
|
|
2633
2652
|
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
2634
2653
|
ContentStyles,
|
|
2635
2654
|
{
|
|
2636
|
-
contentId: (
|
|
2655
|
+
contentId: (l = r.content) == null ? void 0 : l.id,
|
|
2637
2656
|
cssCode: (d = (s = r.content) == null ? void 0 : s.data) == null ? void 0 : d.cssCode,
|
|
2638
|
-
customFonts: (
|
|
2657
|
+
customFonts: (x = (g = r.content) == null ? void 0 : g.data) == null ? void 0 : x.customFonts
|
|
2639
2658
|
}
|
|
2640
2659
|
) }),
|
|
2641
2660
|
/* @__PURE__ */ jsx(
|
|
2642
2661
|
Blocks,
|
|
2643
2662
|
{
|
|
2644
|
-
blocks: (f = (
|
|
2663
|
+
blocks: (f = (S = r.content) == null ? void 0 : S.data) == null ? void 0 : f.blocks,
|
|
2645
2664
|
context: r,
|
|
2646
2665
|
registeredComponents: o
|
|
2647
2666
|
}
|
|
@@ -2653,7 +2672,7 @@ function ContentComponent(e) {
|
|
|
2653
2672
|
);
|
|
2654
2673
|
}
|
|
2655
2674
|
function ContentVariants(e) {
|
|
2656
|
-
var r,
|
|
2675
|
+
var r, c;
|
|
2657
2676
|
const [t, n] = useState(
|
|
2658
2677
|
() => checkShouldRenderVariants({
|
|
2659
2678
|
canTrack: getDefaultCanTrack(e.canTrack),
|
|
@@ -2661,23 +2680,23 @@ function ContentVariants(e) {
|
|
|
2661
2680
|
})
|
|
2662
2681
|
);
|
|
2663
2682
|
function i() {
|
|
2664
|
-
var
|
|
2683
|
+
var l;
|
|
2665
2684
|
return getUpdateCookieAndStylesScript(
|
|
2666
2685
|
getVariants(e.content).map((s) => ({
|
|
2667
2686
|
id: s.testVariationId,
|
|
2668
2687
|
testRatio: s.testRatio
|
|
2669
2688
|
})),
|
|
2670
|
-
((
|
|
2689
|
+
((l = e.content) == null ? void 0 : l.id) || ""
|
|
2671
2690
|
);
|
|
2672
2691
|
}
|
|
2673
2692
|
function o() {
|
|
2674
|
-
return getVariants(e.content).map((
|
|
2693
|
+
return getVariants(e.content).map((l) => `.variant-${l.testVariationId} { display: none; } `).join("");
|
|
2675
2694
|
}
|
|
2676
2695
|
function a() {
|
|
2677
|
-
var
|
|
2696
|
+
var l;
|
|
2678
2697
|
return t ? {
|
|
2679
2698
|
...e.content,
|
|
2680
|
-
testVariationId: (
|
|
2699
|
+
testVariationId: (l = e.content) == null ? void 0 : l.id
|
|
2681
2700
|
} : handleABTestingSync({
|
|
2682
2701
|
item: e.content,
|
|
2683
2702
|
canTrack: getDefaultCanTrack(e.canTrack)
|
|
@@ -2695,10 +2714,10 @@ function ContentVariants(e) {
|
|
|
2695
2714
|
}
|
|
2696
2715
|
),
|
|
2697
2716
|
/* @__PURE__ */ jsx(InlinedScript, { scriptStr: i() }),
|
|
2698
|
-
(
|
|
2717
|
+
(c = getVariants(e.content)) == null ? void 0 : c.map((l) => /* @__PURE__ */ jsx(
|
|
2699
2718
|
ContentComponent,
|
|
2700
2719
|
{
|
|
2701
|
-
content:
|
|
2720
|
+
content: l,
|
|
2702
2721
|
showContent: !1,
|
|
2703
2722
|
model: e.model,
|
|
2704
2723
|
data: e.data,
|
|
@@ -2710,9 +2729,13 @@ function ContentVariants(e) {
|
|
|
2710
2729
|
locale: e.locale,
|
|
2711
2730
|
includeRefs: e.includeRefs,
|
|
2712
2731
|
enrich: e.enrich,
|
|
2713
|
-
isSsrAbTest: t
|
|
2732
|
+
isSsrAbTest: t,
|
|
2733
|
+
blocksWrapper: e.blocksWrapper,
|
|
2734
|
+
blocksWrapperProps: e.blocksWrapperProps,
|
|
2735
|
+
contentWrapper: e.contentWrapper,
|
|
2736
|
+
contentWrapperProps: e.contentWrapperProps
|
|
2714
2737
|
},
|
|
2715
|
-
|
|
2738
|
+
l.testVariationId
|
|
2716
2739
|
))
|
|
2717
2740
|
] }) : null,
|
|
2718
2741
|
/* @__PURE__ */ jsx(
|
|
@@ -2730,7 +2753,11 @@ function ContentVariants(e) {
|
|
|
2730
2753
|
locale: e.locale,
|
|
2731
2754
|
includeRefs: e.includeRefs,
|
|
2732
2755
|
enrich: e.enrich,
|
|
2733
|
-
isSsrAbTest: t
|
|
2756
|
+
isSsrAbTest: t,
|
|
2757
|
+
blocksWrapper: e.blocksWrapper,
|
|
2758
|
+
blocksWrapperProps: e.blocksWrapperProps,
|
|
2759
|
+
contentWrapper: e.contentWrapper,
|
|
2760
|
+
contentWrapperProps: e.contentWrapperProps
|
|
2734
2761
|
}
|
|
2735
2762
|
)
|
|
2736
2763
|
] });
|
|
@@ -2755,26 +2782,26 @@ const fetchSymbolContent = async ({
|
|
|
2755
2782
|
});
|
|
2756
2783
|
};
|
|
2757
2784
|
function Symbol$1(e) {
|
|
2758
|
-
var a, r,
|
|
2785
|
+
var a, r, c;
|
|
2759
2786
|
function t() {
|
|
2760
|
-
var
|
|
2787
|
+
var l, s;
|
|
2761
2788
|
return [
|
|
2762
2789
|
e.attributes.className,
|
|
2763
2790
|
"builder-symbol",
|
|
2764
|
-
(
|
|
2791
|
+
(l = e.symbol) != null && l.inline ? "builder-inline-symbol" : void 0,
|
|
2765
2792
|
(s = e.symbol) != null && s.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
2766
2793
|
].filter(Boolean).join(" ");
|
|
2767
2794
|
}
|
|
2768
2795
|
const [n, i] = useState(() => {
|
|
2769
|
-
var
|
|
2770
|
-
return (
|
|
2796
|
+
var l;
|
|
2797
|
+
return (l = e.symbol) == null ? void 0 : l.content;
|
|
2771
2798
|
});
|
|
2772
2799
|
function o() {
|
|
2773
2800
|
n || fetchSymbolContent({
|
|
2774
2801
|
symbol: e.symbol,
|
|
2775
2802
|
builderContextValue: e.builderContext
|
|
2776
|
-
}).then((
|
|
2777
|
-
|
|
2803
|
+
}).then((l) => {
|
|
2804
|
+
l && i(l);
|
|
2778
2805
|
});
|
|
2779
2806
|
}
|
|
2780
2807
|
return useEffect(() => {
|
|
@@ -2793,7 +2820,7 @@ function Symbol$1(e) {
|
|
|
2793
2820
|
...e.builderContext.localState,
|
|
2794
2821
|
...(r = n == null ? void 0 : n.data) == null ? void 0 : r.state
|
|
2795
2822
|
},
|
|
2796
|
-
model: (
|
|
2823
|
+
model: (c = e.symbol) == null ? void 0 : c.model,
|
|
2797
2824
|
content: n
|
|
2798
2825
|
}
|
|
2799
2826
|
) });
|
|
@@ -2812,17 +2839,17 @@ export {
|
|
|
2812
2839
|
Symbol$1 as Symbol,
|
|
2813
2840
|
Text,
|
|
2814
2841
|
Video,
|
|
2815
|
-
|
|
2842
|
+
U as _processContentResult,
|
|
2816
2843
|
createRegisterComponentMessage,
|
|
2817
|
-
|
|
2818
|
-
|
|
2844
|
+
H as fetchBuilderProps,
|
|
2845
|
+
K as fetchEntries,
|
|
2819
2846
|
fetchOneEntry,
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2847
|
+
z as getAllContent,
|
|
2848
|
+
q as getBuilderSearchParams,
|
|
2849
|
+
Y as getContent,
|
|
2823
2850
|
isEditing,
|
|
2824
2851
|
isPreviewing,
|
|
2825
2852
|
register,
|
|
2826
|
-
|
|
2827
|
-
|
|
2853
|
+
G as setEditorSettings,
|
|
2854
|
+
J as track
|
|
2828
2855
|
};
|