@builder.io/sdk-react 0.12.7 → 0.12.8
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 +27 -27
- package/lib/browser/index.mjs +471 -566
- package/lib/browser/server-entry-564cbc17.cjs +2 -0
- package/lib/browser/server-entry-db4e2a47.js +690 -0
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +4 -3
- package/lib/edge/index.cjs +31 -31
- package/lib/edge/index.mjs +818 -913
- package/lib/edge/server-entry-064c255e.js +690 -0
- package/lib/edge/server-entry-564cbc17.cjs +2 -0
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +4 -3
- package/lib/node/index.cjs +10 -10
- package/lib/node/index.mjs +227 -322
- package/lib/node/server-entry-c063befa.cjs +2 -0
- package/lib/node/server-entry-d816840a.js +690 -0
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +4 -3
- package/package.json +1 -1
- package/types/components/content-variants/helpers.d.ts +1 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/helpers/subscribe-to-editor.d.ts +35 -0
- package/types/server-index.d.ts +18 -3
- package/lib/browser/server-entry-b9bdd327.js +0 -551
- package/lib/browser/server-entry-fc715776.cjs +0 -2
- package/lib/edge/server-entry-57d4ae22.js +0 -551
- package/lib/edge/server-entry-fc715776.cjs +0 -2
- package/lib/node/server-entry-0457c4c8.js +0 -551
- package/lib/node/server-entry-bcb725be.cjs +0 -2
package/lib/node/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, useState, useEffect, useContext, useRef, createElement } from "react";
|
|
4
|
-
import { T as TARGET, i as isEditing,
|
|
5
|
-
import { _ as H,
|
|
4
|
+
import { T as TARGET, i as isEditing, k as isBrowser, l as getUserAttributes, m as fastClone, n as checkIsDefined, o as logger, p as getDefaultCanTrack, q as _track, a as isPreviewing, u as createEditorListener, v as registerInsertMenu, w as setupBrowserForEditing, c as createRegisterComponentMessage, e as fetchOneEntry, x as fetch$1, y as components, z as serializeComponentInfo, A as handleABTestingSync } from "./server-entry-d816840a.js";
|
|
5
|
+
import { _ as H, f as K, d as z, h as q, g as Y, j as G, r as J, s as Q, b as X, t as Z } from "./server-entry-d816840a.js";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
7
7
|
const EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), isEmptyElement = (e) => typeof e == "string" && EMPTY_HTML_ELEMENTS.has(e.toLowerCase());
|
|
8
8
|
function DynamicRenderer(e) {
|
|
@@ -214,28 +214,28 @@ output;
|
|
|
214
214
|
event: i,
|
|
215
215
|
state: s
|
|
216
216
|
}), c = getIsolateContext(), d = c.global;
|
|
217
|
-
d.setSync("global", d.derefInto()), d.setSync("log", function(...
|
|
218
|
-
console.log(...
|
|
219
|
-
}), d.setSync(BUILDER_SET_STATE_NAME, function(
|
|
220
|
-
set(r,
|
|
221
|
-
}), l.forEach(([
|
|
222
|
-
const
|
|
217
|
+
d.setSync("global", d.derefInto()), d.setSync("log", function(...f) {
|
|
218
|
+
console.log(...f);
|
|
219
|
+
}), d.setSync(BUILDER_SET_STATE_NAME, function(f, g) {
|
|
220
|
+
set(r, f, g), a == null || a(r);
|
|
221
|
+
}), l.forEach(([f, g]) => {
|
|
222
|
+
const y = typeof g == "object" ? new ivm.Reference(
|
|
223
223
|
// workaround: methods with default values for arguments is not being cloned over
|
|
224
|
-
|
|
224
|
+
f === "builder" ? {
|
|
225
225
|
...g,
|
|
226
226
|
getUserAttributes: () => g.getUserAttributes()
|
|
227
227
|
} : g
|
|
228
228
|
) : null;
|
|
229
|
-
d.setSync(getSyncValName(
|
|
229
|
+
d.setSync(getSyncValName(f), y);
|
|
230
230
|
}), d.setSync(INJECTED_IVM_GLOBAL, ivm);
|
|
231
|
-
const
|
|
231
|
+
const b = processCode({
|
|
232
232
|
code: e,
|
|
233
233
|
args: l
|
|
234
|
-
}),
|
|
234
|
+
}), S = c.evalSync(b);
|
|
235
235
|
try {
|
|
236
|
-
return JSON.parse(
|
|
236
|
+
return JSON.parse(S);
|
|
237
237
|
} catch {
|
|
238
|
-
return
|
|
238
|
+
return S;
|
|
239
239
|
}
|
|
240
240
|
};
|
|
241
241
|
function isNodeRuntime() {
|
|
@@ -439,8 +439,8 @@ function bindScrollInViewAnimation(e) {
|
|
|
439
439
|
leading: !1
|
|
440
440
|
});
|
|
441
441
|
function s(d) {
|
|
442
|
-
const
|
|
443
|
-
return
|
|
442
|
+
const b = d.getBoundingClientRect(), S = window.innerHeight, g = (e.thresholdPercent || 0) / 100 * S;
|
|
443
|
+
return b.bottom > g && b.top < S - g;
|
|
444
444
|
}
|
|
445
445
|
const l = e.steps[0].styles;
|
|
446
446
|
function c() {
|
|
@@ -596,17 +596,17 @@ function BlockStyles(e) {
|
|
|
596
596
|
), s = o == null ? void 0 : o.large, l = o == null ? void 0 : o.medium, c = o == null ? void 0 : o.small, d = i.id;
|
|
597
597
|
if (!d)
|
|
598
598
|
return "";
|
|
599
|
-
const
|
|
599
|
+
const b = s ? createCssClass({
|
|
600
600
|
className: d,
|
|
601
601
|
styles: s
|
|
602
|
-
}) : "",
|
|
602
|
+
}) : "", S = l ? createCssClass({
|
|
603
603
|
className: d,
|
|
604
604
|
styles: l,
|
|
605
605
|
mediaQuery: getMaxWidthQueryForSize(
|
|
606
606
|
"medium",
|
|
607
607
|
r
|
|
608
608
|
)
|
|
609
|
-
}) : "",
|
|
609
|
+
}) : "", f = c ? createCssClass({
|
|
610
610
|
className: d,
|
|
611
611
|
styles: c,
|
|
612
612
|
mediaQuery: getMaxWidthQueryForSize(
|
|
@@ -614,7 +614,7 @@ function BlockStyles(e) {
|
|
|
614
614
|
r
|
|
615
615
|
)
|
|
616
616
|
}) : "";
|
|
617
|
-
return [
|
|
617
|
+
return [b, S, f].join(" ");
|
|
618
618
|
}
|
|
619
619
|
return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: n() }) }) : null });
|
|
620
620
|
}
|
|
@@ -823,7 +823,7 @@ function RepeatedBlock(e) {
|
|
|
823
823
|
) });
|
|
824
824
|
}
|
|
825
825
|
function Block(e) {
|
|
826
|
-
var d,
|
|
826
|
+
var d, b, S;
|
|
827
827
|
function t() {
|
|
828
828
|
return getComponent({
|
|
829
829
|
block: e.block,
|
|
@@ -838,8 +838,8 @@ function Block(e) {
|
|
|
838
838
|
});
|
|
839
839
|
}
|
|
840
840
|
function i() {
|
|
841
|
-
var
|
|
842
|
-
return (
|
|
841
|
+
var f;
|
|
842
|
+
return (f = e.block.repeat) != null && f.collection ? e.block : getProcessedBlock({
|
|
843
843
|
block: e.block,
|
|
844
844
|
localState: e.context.localState,
|
|
845
845
|
rootState: e.context.rootState,
|
|
@@ -853,28 +853,28 @@ function Block(e) {
|
|
|
853
853
|
return e.block.tagName === "a" || ((g = i().properties) == null ? void 0 : g.href) || i().href ? e.linkComponent || "a" : e.block.tagName || "div";
|
|
854
854
|
}
|
|
855
855
|
function a() {
|
|
856
|
-
var
|
|
857
|
-
if ((
|
|
858
|
-
return !!((
|
|
859
|
-
const
|
|
860
|
-
return ("show" in i() ? i().show : !0) && !
|
|
856
|
+
var y, k;
|
|
857
|
+
if ((y = e.block.repeat) != null && y.collection)
|
|
858
|
+
return !!((k = n == null ? void 0 : n()) != null && k.length);
|
|
859
|
+
const f = "hide" in i() ? i().hide : !1;
|
|
860
|
+
return ("show" in i() ? i().show : !0) && !f;
|
|
861
861
|
}
|
|
862
862
|
function r() {
|
|
863
|
-
var g,
|
|
864
|
-
return !((g = t == null ? void 0 : t()) != null && g.component) && !n() ? (
|
|
863
|
+
var g, y;
|
|
864
|
+
return !((g = t == null ? void 0 : t()) != null && g.component) && !n() ? (y = i().children) != null ? y : [] : [];
|
|
865
865
|
}
|
|
866
866
|
function s() {
|
|
867
|
-
var
|
|
867
|
+
var f, g, y, k, E, p, v, I, w;
|
|
868
868
|
return {
|
|
869
|
-
blockChildren: (
|
|
869
|
+
blockChildren: (f = i().children) != null ? f : [],
|
|
870
870
|
componentRef: (g = t == null ? void 0 : t()) == null ? void 0 : g.component,
|
|
871
871
|
componentOptions: {
|
|
872
872
|
...getBlockComponentOptions(i()),
|
|
873
873
|
builderContext: e.context,
|
|
874
|
-
...((
|
|
874
|
+
...((y = t == null ? void 0 : t()) == null ? void 0 : y.name) === "Core:Button" || ((k = t == null ? void 0 : t()) == null ? void 0 : k.name) === "Symbol" || ((E = t == null ? void 0 : t()) == null ? void 0 : E.name) === "Columns" ? {
|
|
875
875
|
builderLinkComponent: e.linkComponent
|
|
876
876
|
} : {},
|
|
877
|
-
...((
|
|
877
|
+
...((p = t == null ? void 0 : t()) == null ? void 0 : p.name) === "Symbol" || ((v = t == null ? void 0 : t()) == null ? void 0 : v.name) === "Columns" ? {
|
|
878
878
|
builderComponents: e.registeredComponents
|
|
879
879
|
} : {}
|
|
880
880
|
},
|
|
@@ -882,17 +882,17 @@ function Block(e) {
|
|
|
882
882
|
linkComponent: e.linkComponent,
|
|
883
883
|
registeredComponents: e.registeredComponents,
|
|
884
884
|
builderBlock: i(),
|
|
885
|
-
includeBlockProps: ((
|
|
885
|
+
includeBlockProps: ((I = t == null ? void 0 : t()) == null ? void 0 : I.noWrap) === !0,
|
|
886
886
|
isInteractive: !((w = t == null ? void 0 : t()) != null && w.isRSC)
|
|
887
887
|
};
|
|
888
888
|
}
|
|
889
889
|
const [l, c] = useState(() => e.context);
|
|
890
890
|
return useEffect(() => {
|
|
891
|
-
const
|
|
892
|
-
g &&
|
|
893
|
-
g.filter((
|
|
894
|
-
...
|
|
895
|
-
elementId:
|
|
891
|
+
const f = i().id, g = i().animations;
|
|
892
|
+
g && f && bindAnimations(
|
|
893
|
+
g.filter((y) => y.trigger !== "hover").map((y) => ({
|
|
894
|
+
...y,
|
|
895
|
+
elementId: f
|
|
896
896
|
}))
|
|
897
897
|
);
|
|
898
898
|
}, []), /* @__PURE__ */ jsx(Fragment, { children: a() ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -910,11 +910,11 @@ function Block(e) {
|
|
|
910
910
|
includeBlockProps: s().includeBlockProps,
|
|
911
911
|
isInteractive: s().isInteractive
|
|
912
912
|
}
|
|
913
|
-
) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (
|
|
913
|
+
) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (S = n()) == null ? void 0 : S.map((f, g) => /* @__PURE__ */ jsx(
|
|
914
914
|
RepeatedBlock,
|
|
915
915
|
{
|
|
916
|
-
repeatContext:
|
|
917
|
-
block:
|
|
916
|
+
repeatContext: f.context,
|
|
917
|
+
block: f.block,
|
|
918
918
|
registeredComponents: e.registeredComponents,
|
|
919
919
|
linkComponent: e.linkComponent
|
|
920
920
|
},
|
|
@@ -941,15 +941,15 @@ function Block(e) {
|
|
|
941
941
|
isInteractive: s().isInteractive
|
|
942
942
|
}
|
|
943
943
|
),
|
|
944
|
-
(
|
|
944
|
+
(b = r()) == null ? void 0 : b.map((f) => /* @__PURE__ */ jsx(
|
|
945
945
|
Block,
|
|
946
946
|
{
|
|
947
|
-
block:
|
|
947
|
+
block: f,
|
|
948
948
|
context: l,
|
|
949
949
|
registeredComponents: e.registeredComponents,
|
|
950
950
|
linkComponent: e.linkComponent
|
|
951
951
|
},
|
|
952
|
-
|
|
952
|
+
f.id
|
|
953
953
|
))
|
|
954
954
|
]
|
|
955
955
|
}
|
|
@@ -1041,75 +1041,75 @@ function Columns(e) {
|
|
|
1041
1041
|
), [i, o] = useState(() => e.columns || []), [a, r] = useState(
|
|
1042
1042
|
() => e.stackColumnsAt || "tablet"
|
|
1043
1043
|
);
|
|
1044
|
-
function s(
|
|
1045
|
-
var
|
|
1046
|
-
return ((
|
|
1044
|
+
function s(p) {
|
|
1045
|
+
var v;
|
|
1046
|
+
return ((v = i[p]) == null ? void 0 : v.width) || 100 / i.length;
|
|
1047
1047
|
}
|
|
1048
|
-
function l(
|
|
1049
|
-
const
|
|
1050
|
-
return `calc(${s(
|
|
1048
|
+
function l(p) {
|
|
1049
|
+
const v = t * (i.length - 1) / i.length;
|
|
1050
|
+
return `calc(${s(p)}% - ${v}px)`;
|
|
1051
1051
|
}
|
|
1052
1052
|
function c({
|
|
1053
|
-
stackedStyle:
|
|
1054
|
-
desktopStyle:
|
|
1053
|
+
stackedStyle: p,
|
|
1054
|
+
desktopStyle: v
|
|
1055
1055
|
}) {
|
|
1056
|
-
return a === "tablet" ?
|
|
1056
|
+
return a === "tablet" ? p : v;
|
|
1057
1057
|
}
|
|
1058
1058
|
function d({
|
|
1059
|
-
stackedStyle:
|
|
1060
|
-
desktopStyle:
|
|
1059
|
+
stackedStyle: p,
|
|
1060
|
+
desktopStyle: v
|
|
1061
1061
|
}) {
|
|
1062
|
-
return a === "never" ?
|
|
1062
|
+
return a === "never" ? v : p;
|
|
1063
1063
|
}
|
|
1064
|
-
const [
|
|
1064
|
+
const [b, S] = useState(
|
|
1065
1065
|
() => e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column"
|
|
1066
1066
|
);
|
|
1067
|
-
function
|
|
1067
|
+
function f() {
|
|
1068
1068
|
return {
|
|
1069
|
-
"--flex-dir":
|
|
1069
|
+
"--flex-dir": b,
|
|
1070
1070
|
"--flex-dir-tablet": c({
|
|
1071
|
-
stackedStyle:
|
|
1071
|
+
stackedStyle: b,
|
|
1072
1072
|
desktopStyle: "row"
|
|
1073
1073
|
})
|
|
1074
1074
|
};
|
|
1075
1075
|
}
|
|
1076
|
-
function g(
|
|
1077
|
-
const
|
|
1076
|
+
function g(p) {
|
|
1077
|
+
const v = p === 0 ? 0 : t, I = l(p), w = `${v}px`, R = "100%", j = 0;
|
|
1078
1078
|
return {
|
|
1079
1079
|
...{
|
|
1080
1080
|
display: "flex",
|
|
1081
1081
|
flexDirection: "column",
|
|
1082
1082
|
alignItems: "stretch"
|
|
1083
1083
|
},
|
|
1084
|
-
width:
|
|
1084
|
+
width: I,
|
|
1085
1085
|
["marginLeft"]: w,
|
|
1086
1086
|
"--column-width-mobile": d({
|
|
1087
1087
|
stackedStyle: R,
|
|
1088
|
-
desktopStyle:
|
|
1088
|
+
desktopStyle: I
|
|
1089
1089
|
}),
|
|
1090
1090
|
"--column-margin-left-mobile": d({
|
|
1091
|
-
stackedStyle:
|
|
1091
|
+
stackedStyle: j,
|
|
1092
1092
|
desktopStyle: w
|
|
1093
1093
|
}),
|
|
1094
1094
|
"--column-width-tablet": c({
|
|
1095
1095
|
stackedStyle: R,
|
|
1096
|
-
desktopStyle:
|
|
1096
|
+
desktopStyle: I
|
|
1097
1097
|
}),
|
|
1098
1098
|
"--column-margin-left-tablet": c({
|
|
1099
|
-
stackedStyle:
|
|
1099
|
+
stackedStyle: j,
|
|
1100
1100
|
desktopStyle: w
|
|
1101
1101
|
})
|
|
1102
1102
|
};
|
|
1103
1103
|
}
|
|
1104
|
-
function
|
|
1105
|
-
var
|
|
1104
|
+
function y(p) {
|
|
1105
|
+
var I, w;
|
|
1106
1106
|
return getSizesForBreakpoints(
|
|
1107
|
-
((w = (
|
|
1108
|
-
)[
|
|
1107
|
+
((w = (I = e.builderContext.content) == null ? void 0 : I.meta) == null ? void 0 : w.breakpoints) || {}
|
|
1108
|
+
)[p].max;
|
|
1109
1109
|
}
|
|
1110
|
-
function
|
|
1110
|
+
function k() {
|
|
1111
1111
|
return `
|
|
1112
|
-
@media (max-width: ${
|
|
1112
|
+
@media (max-width: ${y("medium")}px) {
|
|
1113
1113
|
.${e.builderBlock.id}-breakpoints {
|
|
1114
1114
|
flex-direction: var(--flex-dir-tablet);
|
|
1115
1115
|
align-items: stretch;
|
|
@@ -1121,7 +1121,7 @@ function Columns(e) {
|
|
|
1121
1121
|
}
|
|
1122
1122
|
}
|
|
1123
1123
|
|
|
1124
|
-
@media (max-width: ${
|
|
1124
|
+
@media (max-width: ${y("small")}px) {
|
|
1125
1125
|
.${e.builderBlock.id}-breakpoints {
|
|
1126
1126
|
flex-direction: var(--flex-dir);
|
|
1127
1127
|
align-items: stretch;
|
|
@@ -1139,25 +1139,25 @@ function Columns(e) {
|
|
|
1139
1139
|
"div",
|
|
1140
1140
|
{
|
|
1141
1141
|
className: `builder-columns ${e.builderBlock.id}-breakpoints div-6f826264`,
|
|
1142
|
-
style:
|
|
1142
|
+
style: f(),
|
|
1143
1143
|
children: [
|
|
1144
|
-
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles:
|
|
1145
|
-
(E = e.columns) == null ? void 0 : E.map((
|
|
1144
|
+
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: k() }) }),
|
|
1145
|
+
(E = e.columns) == null ? void 0 : E.map((p, v) => /* @__PURE__ */ jsx(
|
|
1146
1146
|
DynamicRenderer,
|
|
1147
1147
|
{
|
|
1148
|
-
TagName:
|
|
1148
|
+
TagName: p.link ? e.builderLinkComponent || "a" : "div",
|
|
1149
1149
|
actionAttributes: {},
|
|
1150
1150
|
attributes: {
|
|
1151
|
-
...
|
|
1152
|
-
href:
|
|
1151
|
+
...p.link ? {
|
|
1152
|
+
href: p.link
|
|
1153
1153
|
} : {},
|
|
1154
1154
|
[getClassPropName()]: "builder-column",
|
|
1155
|
-
style: mapStyleObjToStrIfNeeded(g(
|
|
1155
|
+
style: mapStyleObjToStrIfNeeded(g(v))
|
|
1156
1156
|
},
|
|
1157
1157
|
children: /* @__PURE__ */ jsx(
|
|
1158
1158
|
Blocks,
|
|
1159
1159
|
{
|
|
1160
|
-
path: `component.options.columns.${
|
|
1160
|
+
path: `component.options.columns.${v}.blocks`,
|
|
1161
1161
|
parent: e.builderBlock.id,
|
|
1162
1162
|
styleProp: {
|
|
1163
1163
|
flexGrow: "1"
|
|
@@ -1165,11 +1165,11 @@ function Columns(e) {
|
|
|
1165
1165
|
context: e.builderContext,
|
|
1166
1166
|
registeredComponents: e.builderComponents,
|
|
1167
1167
|
linkComponent: e.builderLinkComponent,
|
|
1168
|
-
blocks:
|
|
1168
|
+
blocks: p.blocks
|
|
1169
1169
|
}
|
|
1170
1170
|
)
|
|
1171
1171
|
},
|
|
1172
|
-
|
|
1172
|
+
v
|
|
1173
1173
|
))
|
|
1174
1174
|
]
|
|
1175
1175
|
}
|
|
@@ -1645,16 +1645,16 @@ function Embed(e) {
|
|
|
1645
1645
|
return;
|
|
1646
1646
|
const c = t.current.getElementsByTagName("script");
|
|
1647
1647
|
for (let d = 0; d < c.length; d++) {
|
|
1648
|
-
const
|
|
1649
|
-
if (
|
|
1650
|
-
n.push(
|
|
1651
|
-
const
|
|
1652
|
-
|
|
1653
|
-
} else if (isJsScript(
|
|
1648
|
+
const b = c[d];
|
|
1649
|
+
if (b.src && !n.includes(b.src)) {
|
|
1650
|
+
n.push(b.src);
|
|
1651
|
+
const S = document.createElement("script");
|
|
1652
|
+
S.async = !0, S.src = b.src, document.head.appendChild(S);
|
|
1653
|
+
} else if (isJsScript(b) && !o.includes(b.innerText))
|
|
1654
1654
|
try {
|
|
1655
|
-
o.push(
|
|
1656
|
-
} catch (
|
|
1657
|
-
console.warn("`Embed`: Error running script:",
|
|
1655
|
+
o.push(b.innerText), new Function(b.innerText)();
|
|
1656
|
+
} catch (S) {
|
|
1657
|
+
console.warn("`Embed`: Error running script:", S);
|
|
1658
1658
|
}
|
|
1659
1659
|
}
|
|
1660
1660
|
}
|
|
@@ -1698,13 +1698,13 @@ const componentInfo$7 = {
|
|
|
1698
1698
|
function n(r, s = 6e4) {
|
|
1699
1699
|
return new Promise((l, c) => {
|
|
1700
1700
|
const d = document.createElement("img");
|
|
1701
|
-
let
|
|
1701
|
+
let b = !1;
|
|
1702
1702
|
d.onload = () => {
|
|
1703
|
-
|
|
1704
|
-
}, d.addEventListener("error", (
|
|
1705
|
-
console.warn("Image load failed",
|
|
1703
|
+
b = !0, l(d);
|
|
1704
|
+
}, d.addEventListener("error", (S) => {
|
|
1705
|
+
console.warn("Image load failed", S.error), c(S.error);
|
|
1706
1706
|
}), d.src = r, setTimeout(() => {
|
|
1707
|
-
|
|
1707
|
+
b || c(new Error("Image load timed out"));
|
|
1708
1708
|
}, s);
|
|
1709
1709
|
});
|
|
1710
1710
|
}
|
|
@@ -2283,11 +2283,6 @@ function InlinedScript(e) {
|
|
|
2283
2283
|
}
|
|
2284
2284
|
);
|
|
2285
2285
|
}
|
|
2286
|
-
const DEFAULT_TRUSTED_HOSTS = ["*.beta.builder.io", "beta.builder.io", "builder.io", "localhost", "qa.builder.io"];
|
|
2287
|
-
function isFromTrustedHost(e, t) {
|
|
2288
|
-
const n = new URL(t.origin), i = n.hostname;
|
|
2289
|
-
return (e || DEFAULT_TRUSTED_HOSTS).findIndex((o) => o.startsWith("*.") ? i.endsWith(o.slice(1)) : o === i) > -1;
|
|
2290
|
-
}
|
|
2291
2286
|
function round(e) {
|
|
2292
2287
|
return Math.round(e * 1e3) / 1e3;
|
|
2293
2288
|
}
|
|
@@ -2330,125 +2325,40 @@ const findParentElement = (e, t, n = !0) => {
|
|
|
2330
2325
|
builderElementIndex: n && i ? [].slice.call(document.getElementsByClassName(i)).indexOf(n) : void 0
|
|
2331
2326
|
}
|
|
2332
2327
|
};
|
|
2333
|
-
}, SDK_VERSION = "0.12.7", registerInsertMenu = () => {
|
|
2334
|
-
register("insertMenu", {
|
|
2335
|
-
name: "_default",
|
|
2336
|
-
default: !0,
|
|
2337
|
-
items: [{
|
|
2338
|
-
name: "Box"
|
|
2339
|
-
}, {
|
|
2340
|
-
name: "Text"
|
|
2341
|
-
}, {
|
|
2342
|
-
name: "Image"
|
|
2343
|
-
}, {
|
|
2344
|
-
name: "Columns"
|
|
2345
|
-
}, {
|
|
2346
|
-
name: "Core:Section"
|
|
2347
|
-
}, {
|
|
2348
|
-
name: "Core:Button"
|
|
2349
|
-
}, {
|
|
2350
|
-
name: "Embed"
|
|
2351
|
-
}, {
|
|
2352
|
-
name: "Custom Code"
|
|
2353
|
-
}]
|
|
2354
|
-
});
|
|
2355
|
-
};
|
|
2356
|
-
let isSetupForEditing = !1;
|
|
2357
|
-
const setupBrowserForEditing = (e = {}) => {
|
|
2358
|
-
var t, n;
|
|
2359
|
-
isSetupForEditing || (isSetupForEditing = !0, isBrowser() && ((t = window.parent) == null || t.postMessage({
|
|
2360
|
-
type: "builder.sdkInfo",
|
|
2361
|
-
data: {
|
|
2362
|
-
target: TARGET,
|
|
2363
|
-
version: SDK_VERSION,
|
|
2364
|
-
supportsPatchUpdates: !1,
|
|
2365
|
-
// Supports builder-model="..." attribute which is needed to
|
|
2366
|
-
// scope our '+ add block' button styling
|
|
2367
|
-
supportsAddBlockScoping: !0,
|
|
2368
|
-
supportsCustomBreakpoints: !0
|
|
2369
|
-
}
|
|
2370
|
-
}, "*"), (n = window.parent) == null || n.postMessage({
|
|
2371
|
-
type: "builder.updateContent",
|
|
2372
|
-
data: {
|
|
2373
|
-
options: e
|
|
2374
|
-
}
|
|
2375
|
-
}, "*"), window.addEventListener("message", (i) => {
|
|
2376
|
-
var a, r;
|
|
2377
|
-
if (!isFromTrustedHost(e.trustedHosts, i))
|
|
2378
|
-
return;
|
|
2379
|
-
const {
|
|
2380
|
-
data: o
|
|
2381
|
-
} = i;
|
|
2382
|
-
if (o != null && o.type)
|
|
2383
|
-
switch (o.type) {
|
|
2384
|
-
case "builder.evaluate": {
|
|
2385
|
-
const s = o.data.text, l = o.data.arguments || [], c = o.data.id, d = new Function(s);
|
|
2386
|
-
let h, y = null;
|
|
2387
|
-
try {
|
|
2388
|
-
h = d.apply(null, l);
|
|
2389
|
-
} catch (u) {
|
|
2390
|
-
y = u;
|
|
2391
|
-
}
|
|
2392
|
-
y ? (a = window.parent) == null || a.postMessage({
|
|
2393
|
-
type: "builder.evaluateError",
|
|
2394
|
-
data: {
|
|
2395
|
-
id: c,
|
|
2396
|
-
error: y.message
|
|
2397
|
-
}
|
|
2398
|
-
}, "*") : h && typeof h.then == "function" ? h.then((u) => {
|
|
2399
|
-
var g;
|
|
2400
|
-
(g = window.parent) == null || g.postMessage({
|
|
2401
|
-
type: "builder.evaluateResult",
|
|
2402
|
-
data: {
|
|
2403
|
-
id: c,
|
|
2404
|
-
result: u
|
|
2405
|
-
}
|
|
2406
|
-
}, "*");
|
|
2407
|
-
}).catch(console.error) : (r = window.parent) == null || r.postMessage({
|
|
2408
|
-
type: "builder.evaluateResult",
|
|
2409
|
-
data: {
|
|
2410
|
-
result: h,
|
|
2411
|
-
id: c
|
|
2412
|
-
}
|
|
2413
|
-
}, "*");
|
|
2414
|
-
break;
|
|
2415
|
-
}
|
|
2416
|
-
}
|
|
2417
|
-
})));
|
|
2418
2328
|
};
|
|
2419
2329
|
function EnableEditor(e) {
|
|
2420
|
-
var
|
|
2330
|
+
var j, P, B, N, F, V, $;
|
|
2421
2331
|
const t = useRef(null), [n, i] = useState(() => 0);
|
|
2422
2332
|
useState(() => !0);
|
|
2423
|
-
function o(
|
|
2424
|
-
var
|
|
2425
|
-
const
|
|
2333
|
+
function o(u) {
|
|
2334
|
+
var h, x;
|
|
2335
|
+
const m = {
|
|
2426
2336
|
...e.builderContextSignal.rootState,
|
|
2427
|
-
...
|
|
2337
|
+
...u
|
|
2428
2338
|
};
|
|
2429
|
-
e.builderContextSignal.rootSetState ? (
|
|
2430
|
-
...
|
|
2431
|
-
rootState:
|
|
2339
|
+
e.builderContextSignal.rootSetState ? (x = (h = e.builderContextSignal).rootSetState) == null || x.call(h, m) : e.setBuilderContextSignal((C) => ({
|
|
2340
|
+
...C,
|
|
2341
|
+
rootState: m
|
|
2432
2342
|
}));
|
|
2433
2343
|
}
|
|
2434
|
-
function a(
|
|
2435
|
-
var
|
|
2436
|
-
const
|
|
2344
|
+
function a(u) {
|
|
2345
|
+
var h, x, C, T, A;
|
|
2346
|
+
const m = {
|
|
2437
2347
|
...e.builderContextSignal.content,
|
|
2438
|
-
...
|
|
2348
|
+
...u,
|
|
2439
2349
|
data: {
|
|
2440
|
-
...(
|
|
2441
|
-
...
|
|
2350
|
+
...(h = e.builderContextSignal.content) == null ? void 0 : h.data,
|
|
2351
|
+
...u == null ? void 0 : u.data
|
|
2442
2352
|
},
|
|
2443
2353
|
meta: {
|
|
2444
|
-
...(
|
|
2445
|
-
...
|
|
2446
|
-
breakpoints: ((
|
|
2354
|
+
...(x = e.builderContextSignal.content) == null ? void 0 : x.meta,
|
|
2355
|
+
...u == null ? void 0 : u.meta,
|
|
2356
|
+
breakpoints: ((C = u == null ? void 0 : u.meta) == null ? void 0 : C.breakpoints) || ((A = (T = e.builderContextSignal.content) == null ? void 0 : T.meta) == null ? void 0 : A.breakpoints)
|
|
2447
2357
|
}
|
|
2448
2358
|
};
|
|
2449
|
-
e.setBuilderContextSignal((
|
|
2450
|
-
|
|
2451
|
-
content:
|
|
2359
|
+
e.setBuilderContextSignal((_) => ({
|
|
2360
|
+
..._,
|
|
2361
|
+
content: m
|
|
2452
2362
|
}));
|
|
2453
2363
|
}
|
|
2454
2364
|
useState(() => 0);
|
|
@@ -2457,68 +2367,62 @@ function EnableEditor(e) {
|
|
|
2457
2367
|
), [l, c] = useState(
|
|
2458
2368
|
() => e.contentWrapper || "div"
|
|
2459
2369
|
);
|
|
2460
|
-
function d(
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
if (!k || k !== ((b = e.builderContextSignal.content) == null ? void 0 : b.id))
|
|
2470
|
-
return;
|
|
2471
|
-
p && a({
|
|
2370
|
+
function d(u) {
|
|
2371
|
+
return createEditorListener({
|
|
2372
|
+
model: e.model,
|
|
2373
|
+
trustedHosts: e.trustedHosts,
|
|
2374
|
+
callbacks: {
|
|
2375
|
+
configureSdk: (m) => {
|
|
2376
|
+
var C;
|
|
2377
|
+
const { breakpoints: h, contentId: x } = m;
|
|
2378
|
+
!x || x !== ((C = e.builderContextSignal.content) == null ? void 0 : C.id) || h && (a({
|
|
2472
2379
|
meta: {
|
|
2473
|
-
breakpoints:
|
|
2380
|
+
breakpoints: h
|
|
2474
2381
|
}
|
|
2475
|
-
}), i(n + 1);
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
case "builder.contentUpdate": {
|
|
2483
|
-
const S = f.data, p = S.key || S.alias || S.entry || S.modelName, k = S.data;
|
|
2484
|
-
p === e.model && (a(k), i(n + 1));
|
|
2485
|
-
break;
|
|
2382
|
+
}), i(n + 1));
|
|
2383
|
+
},
|
|
2384
|
+
animation: (m) => {
|
|
2385
|
+
triggerAnimation(m);
|
|
2386
|
+
},
|
|
2387
|
+
contentUpdate: (m) => {
|
|
2388
|
+
a(m), i(n + 1);
|
|
2486
2389
|
}
|
|
2487
2390
|
}
|
|
2391
|
+
})(u);
|
|
2488
2392
|
}
|
|
2489
|
-
function
|
|
2490
|
-
var
|
|
2491
|
-
const
|
|
2492
|
-
|
|
2493
|
-
code:
|
|
2393
|
+
function b() {
|
|
2394
|
+
var m, h;
|
|
2395
|
+
const u = (h = (m = e.builderContextSignal.content) == null ? void 0 : m.data) == null ? void 0 : h.jsCode;
|
|
2396
|
+
u && evaluate({
|
|
2397
|
+
code: u,
|
|
2494
2398
|
context: e.context || {},
|
|
2495
2399
|
localState: void 0,
|
|
2496
2400
|
rootState: e.builderContextSignal.rootState,
|
|
2497
2401
|
rootSetState: e.builderContextSignal.rootSetState
|
|
2498
2402
|
});
|
|
2499
2403
|
}
|
|
2500
|
-
const [
|
|
2501
|
-
function
|
|
2502
|
-
var
|
|
2404
|
+
const [S, f] = useState(() => ({})), [g, y] = useState(() => !1);
|
|
2405
|
+
function k(u) {
|
|
2406
|
+
var m, h;
|
|
2503
2407
|
if (e.builderContextSignal.content) {
|
|
2504
|
-
const
|
|
2408
|
+
const x = (m = e.builderContextSignal.content) == null ? void 0 : m.testVariationId, C = (h = e.builderContextSignal.content) == null ? void 0 : h.id;
|
|
2505
2409
|
_track({
|
|
2506
2410
|
type: "click",
|
|
2507
2411
|
canTrack: getDefaultCanTrack(e.canTrack),
|
|
2508
|
-
contentId:
|
|
2412
|
+
contentId: C,
|
|
2509
2413
|
apiKey: e.apiKey,
|
|
2510
|
-
variationId:
|
|
2511
|
-
...getInteractionPropertiesForEvent(
|
|
2414
|
+
variationId: x !== C ? x : void 0,
|
|
2415
|
+
...getInteractionPropertiesForEvent(u),
|
|
2512
2416
|
unique: !g
|
|
2513
2417
|
});
|
|
2514
2418
|
}
|
|
2515
|
-
g ||
|
|
2419
|
+
g || y(!0);
|
|
2516
2420
|
}
|
|
2517
|
-
function E(
|
|
2518
|
-
return
|
|
2421
|
+
function E(u) {
|
|
2422
|
+
return u.replace(
|
|
2519
2423
|
/{{([^}]+)}}/g,
|
|
2520
|
-
(
|
|
2521
|
-
code:
|
|
2424
|
+
(m, h) => evaluate({
|
|
2425
|
+
code: h,
|
|
2522
2426
|
context: e.context || {},
|
|
2523
2427
|
localState: void 0,
|
|
2524
2428
|
rootState: e.builderContextSignal.rootState,
|
|
@@ -2526,32 +2430,32 @@ function EnableEditor(e) {
|
|
|
2526
2430
|
})
|
|
2527
2431
|
);
|
|
2528
2432
|
}
|
|
2529
|
-
function
|
|
2530
|
-
fetch$1(
|
|
2531
|
-
var
|
|
2532
|
-
const
|
|
2433
|
+
function p({ url: u, key: m }) {
|
|
2434
|
+
fetch$1(u).then((h) => h.json()).then((h) => {
|
|
2435
|
+
var C, T;
|
|
2436
|
+
const x = {
|
|
2533
2437
|
...e.builderContextSignal.rootState,
|
|
2534
|
-
[
|
|
2438
|
+
[m]: h
|
|
2535
2439
|
};
|
|
2536
|
-
(
|
|
2537
|
-
}).catch((
|
|
2538
|
-
console.error("error fetching dynamic data",
|
|
2440
|
+
(T = (C = e.builderContextSignal).rootSetState) == null || T.call(C, x), S[m] = !0;
|
|
2441
|
+
}).catch((h) => {
|
|
2442
|
+
console.error("error fetching dynamic data", u, h);
|
|
2539
2443
|
});
|
|
2540
2444
|
}
|
|
2541
|
-
function
|
|
2542
|
-
var
|
|
2543
|
-
const
|
|
2544
|
-
Object.entries(
|
|
2545
|
-
if (
|
|
2546
|
-
const
|
|
2547
|
-
|
|
2548
|
-
url:
|
|
2549
|
-
key:
|
|
2445
|
+
function v() {
|
|
2446
|
+
var m, h, x;
|
|
2447
|
+
const u = (x = (h = (m = e.builderContextSignal.content) == null ? void 0 : m.data) == null ? void 0 : h.httpRequests) != null ? x : {};
|
|
2448
|
+
Object.entries(u).forEach(([C, T]) => {
|
|
2449
|
+
if (T && (!S[C] || isEditing())) {
|
|
2450
|
+
const A = E(T);
|
|
2451
|
+
p({
|
|
2452
|
+
url: A,
|
|
2453
|
+
key: C
|
|
2550
2454
|
});
|
|
2551
2455
|
}
|
|
2552
2456
|
});
|
|
2553
2457
|
}
|
|
2554
|
-
function
|
|
2458
|
+
function I() {
|
|
2555
2459
|
isEditing() && window.dispatchEvent(
|
|
2556
2460
|
new CustomEvent(
|
|
2557
2461
|
"builder:component:stateChange",
|
|
@@ -2566,7 +2470,7 @@ function EnableEditor(e) {
|
|
|
2566
2470
|
)
|
|
2567
2471
|
);
|
|
2568
2472
|
}
|
|
2569
|
-
function w(
|
|
2473
|
+
function w(u) {
|
|
2570
2474
|
i(n + 1), window.addEventListener("message", d), registerInsertMenu(), setupBrowserForEditing({
|
|
2571
2475
|
...e.locale ? {
|
|
2572
2476
|
locale: e.locale
|
|
@@ -2582,62 +2486,62 @@ function EnableEditor(e) {
|
|
|
2582
2486
|
} : {}
|
|
2583
2487
|
}), Object.values(
|
|
2584
2488
|
e.builderContextSignal.componentInfos
|
|
2585
|
-
).forEach((
|
|
2586
|
-
var
|
|
2587
|
-
const
|
|
2588
|
-
(
|
|
2489
|
+
).forEach((m) => {
|
|
2490
|
+
var x;
|
|
2491
|
+
const h = createRegisterComponentMessage(m);
|
|
2492
|
+
(x = window.parent) == null || x.postMessage(h, "*");
|
|
2589
2493
|
}), window.addEventListener(
|
|
2590
2494
|
"builder:component:stateChangeListenerActivated",
|
|
2591
|
-
|
|
2495
|
+
I
|
|
2592
2496
|
);
|
|
2593
2497
|
}
|
|
2594
|
-
function R(
|
|
2595
|
-
const
|
|
2596
|
-
`builder.preview.${
|
|
2597
|
-
),
|
|
2598
|
-
|
|
2498
|
+
function R(u) {
|
|
2499
|
+
const m = new URL(location.href).searchParams, h = m.get("builder.preview"), x = m.get(
|
|
2500
|
+
`builder.preview.${h}`
|
|
2501
|
+
), C = m.get("apiKey") || m.get("builder.space");
|
|
2502
|
+
h === e.model && C === e.apiKey && (!e.content || x === e.content.id) && fetchOneEntry({
|
|
2599
2503
|
model: e.model,
|
|
2600
2504
|
apiKey: e.apiKey,
|
|
2601
2505
|
apiVersion: e.builderContextSignal.apiVersion
|
|
2602
|
-
}).then((
|
|
2603
|
-
|
|
2506
|
+
}).then((T) => {
|
|
2507
|
+
T && a(T);
|
|
2604
2508
|
});
|
|
2605
2509
|
}
|
|
2606
2510
|
return useEffect(() => {
|
|
2607
|
-
var
|
|
2608
|
-
return (
|
|
2511
|
+
var u;
|
|
2512
|
+
return (u = t.current) == null || u.addEventListener(
|
|
2609
2513
|
"initeditingbldr",
|
|
2610
2514
|
w
|
|
2611
2515
|
), () => {
|
|
2612
|
-
var
|
|
2613
|
-
return (
|
|
2516
|
+
var m;
|
|
2517
|
+
return (m = t.current) == null ? void 0 : m.removeEventListener(
|
|
2614
2518
|
"initeditingbldr",
|
|
2615
2519
|
w
|
|
2616
2520
|
);
|
|
2617
2521
|
};
|
|
2618
2522
|
}, []), useEffect(() => {
|
|
2619
|
-
var
|
|
2620
|
-
return (
|
|
2523
|
+
var u;
|
|
2524
|
+
return (u = t.current) == null || u.addEventListener(
|
|
2621
2525
|
"initpreviewingbldr",
|
|
2622
2526
|
R
|
|
2623
2527
|
), () => {
|
|
2624
|
-
var
|
|
2625
|
-
return (
|
|
2528
|
+
var m;
|
|
2529
|
+
return (m = t.current) == null ? void 0 : m.removeEventListener(
|
|
2626
2530
|
"initpreviewingbldr",
|
|
2627
2531
|
R
|
|
2628
2532
|
);
|
|
2629
2533
|
};
|
|
2630
2534
|
}, []), useEffect(() => {
|
|
2631
|
-
var
|
|
2535
|
+
var u, m;
|
|
2632
2536
|
if (isBrowser()) {
|
|
2633
2537
|
if (isEditing() && t.current && t.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && getDefaultCanTrack(e.canTrack)) {
|
|
2634
|
-
const
|
|
2538
|
+
const x = (u = e.builderContextSignal.content) == null ? void 0 : u.testVariationId, C = (m = e.builderContextSignal.content) == null ? void 0 : m.id, T = e.apiKey;
|
|
2635
2539
|
_track({
|
|
2636
2540
|
type: "impression",
|
|
2637
2541
|
canTrack: !0,
|
|
2638
|
-
contentId:
|
|
2639
|
-
apiKey:
|
|
2640
|
-
variationId:
|
|
2542
|
+
contentId: C,
|
|
2543
|
+
apiKey: T,
|
|
2544
|
+
variationId: x !== C ? x : void 0
|
|
2641
2545
|
});
|
|
2642
2546
|
}
|
|
2643
2547
|
isPreviewing() && t.current && t.current.dispatchEvent(new CustomEvent("initpreviewingbldr"));
|
|
@@ -2645,16 +2549,16 @@ function EnableEditor(e) {
|
|
|
2645
2549
|
}, []), useEffect(() => {
|
|
2646
2550
|
e.apiKey || logger.error(
|
|
2647
2551
|
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
2648
|
-
),
|
|
2552
|
+
), b(), v(), I();
|
|
2649
2553
|
}, []), useEffect(() => {
|
|
2650
2554
|
e.content && a(e.content);
|
|
2651
2555
|
}, [e.content]), useEffect(() => {
|
|
2652
2556
|
}, [r]), useEffect(() => {
|
|
2653
|
-
|
|
2654
|
-
}, [(
|
|
2655
|
-
|
|
2656
|
-
}, [(N = (
|
|
2657
|
-
|
|
2557
|
+
b();
|
|
2558
|
+
}, [(P = (j = e.builderContextSignal.content) == null ? void 0 : j.data) == null ? void 0 : P.jsCode]), useEffect(() => {
|
|
2559
|
+
v();
|
|
2560
|
+
}, [(N = (B = e.builderContextSignal.content) == null ? void 0 : B.data) == null ? void 0 : N.httpRequests]), useEffect(() => {
|
|
2561
|
+
I();
|
|
2658
2562
|
}, [e.builderContextSignal.rootState]), useEffect(() => {
|
|
2659
2563
|
e.data && o(e.data);
|
|
2660
2564
|
}, [e.data]), useEffect(() => {
|
|
@@ -2664,14 +2568,14 @@ function EnableEditor(e) {
|
|
|
2664
2568
|
}, [e.locale]), useEffect(() => () => {
|
|
2665
2569
|
isBrowser() && (window.removeEventListener("message", d), window.removeEventListener(
|
|
2666
2570
|
"builder:component:stateChangeListenerActivated",
|
|
2667
|
-
|
|
2571
|
+
I
|
|
2668
2572
|
));
|
|
2669
2573
|
}, []), /* @__PURE__ */ jsx(builderContext.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ createElement(
|
|
2670
2574
|
l,
|
|
2671
2575
|
{
|
|
2672
2576
|
key: n,
|
|
2673
2577
|
ref: t,
|
|
2674
|
-
onClick: (
|
|
2578
|
+
onClick: (u) => k(u),
|
|
2675
2579
|
"builder-content-id": (F = e.builderContextSignal.content) == null ? void 0 : F.id,
|
|
2676
2580
|
"builder-model": e.model,
|
|
2677
2581
|
...e.showContent ? {} : {
|
|
@@ -2679,7 +2583,7 @@ function EnableEditor(e) {
|
|
|
2679
2583
|
"aria-hidden": !0
|
|
2680
2584
|
},
|
|
2681
2585
|
...e.contentWrapperProps,
|
|
2682
|
-
className: `variant-${((
|
|
2586
|
+
className: `variant-${((V = e.content) == null ? void 0 : V.testVariationId) || (($ = e.content) == null ? void 0 : $.id)}`
|
|
2683
2587
|
},
|
|
2684
2588
|
e.children
|
|
2685
2589
|
) }) : null });
|
|
@@ -2779,22 +2683,22 @@ const getRootStateInitialValue = ({
|
|
|
2779
2683
|
meta: e == null ? void 0 : e.meta
|
|
2780
2684
|
} : void 0;
|
|
2781
2685
|
function ContentComponent(e) {
|
|
2782
|
-
var l, c, d,
|
|
2686
|
+
var l, c, d, b, S, f, g;
|
|
2783
2687
|
const [t, n] = useState(
|
|
2784
2688
|
() => {
|
|
2785
|
-
var
|
|
2689
|
+
var y, k;
|
|
2786
2690
|
return getUpdateVariantVisibilityScript({
|
|
2787
2691
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2788
|
-
variationId: (
|
|
2692
|
+
variationId: (y = e.content) == null ? void 0 : y.testVariationId,
|
|
2789
2693
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2790
|
-
contentId: (
|
|
2694
|
+
contentId: (k = e.content) == null ? void 0 : k.id
|
|
2791
2695
|
});
|
|
2792
2696
|
}
|
|
2793
2697
|
);
|
|
2794
|
-
function i(
|
|
2795
|
-
s((
|
|
2796
|
-
...
|
|
2797
|
-
rootState:
|
|
2698
|
+
function i(y) {
|
|
2699
|
+
s((k) => ({
|
|
2700
|
+
...k,
|
|
2701
|
+
rootState: y
|
|
2798
2702
|
}));
|
|
2799
2703
|
}
|
|
2800
2704
|
const [o, a] = useState(
|
|
@@ -2808,10 +2712,10 @@ function ContentComponent(e) {
|
|
|
2808
2712
|
...components,
|
|
2809
2713
|
...e.customComponents || []
|
|
2810
2714
|
].reduce(
|
|
2811
|
-
(
|
|
2812
|
-
...
|
|
2715
|
+
(y, { component: k, ...E }) => ({
|
|
2716
|
+
...y,
|
|
2813
2717
|
[E.name]: {
|
|
2814
|
-
component:
|
|
2718
|
+
component: k,
|
|
2815
2719
|
...serializeComponentInfo(E)
|
|
2816
2720
|
}
|
|
2817
2721
|
}),
|
|
@@ -2842,8 +2746,8 @@ function ContentComponent(e) {
|
|
|
2842
2746
|
...components,
|
|
2843
2747
|
...e.customComponents || []
|
|
2844
2748
|
].reduce(
|
|
2845
|
-
(
|
|
2846
|
-
...
|
|
2749
|
+
(y, { component: k, ...E }) => ({
|
|
2750
|
+
...y,
|
|
2847
2751
|
[E.name]: serializeComponentInfo(E)
|
|
2848
2752
|
}),
|
|
2849
2753
|
{}
|
|
@@ -2884,13 +2788,13 @@ function ContentComponent(e) {
|
|
|
2884
2788
|
{
|
|
2885
2789
|
contentId: (l = r.content) == null ? void 0 : l.id,
|
|
2886
2790
|
cssCode: (d = (c = r.content) == null ? void 0 : c.data) == null ? void 0 : d.cssCode,
|
|
2887
|
-
customFonts: (
|
|
2791
|
+
customFonts: (S = (b = r.content) == null ? void 0 : b.data) == null ? void 0 : S.customFonts
|
|
2888
2792
|
}
|
|
2889
2793
|
) }),
|
|
2890
2794
|
/* @__PURE__ */ jsx(
|
|
2891
2795
|
Blocks,
|
|
2892
2796
|
{
|
|
2893
|
-
blocks: (g = (
|
|
2797
|
+
blocks: (g = (f = r.content) == null ? void 0 : f.data) == null ? void 0 : g.blocks,
|
|
2894
2798
|
context: r,
|
|
2895
2799
|
registeredComponents: o,
|
|
2896
2800
|
linkComponent: e.linkComponent
|
|
@@ -3088,7 +2992,8 @@ export {
|
|
|
3088
2992
|
G as getContent,
|
|
3089
2993
|
isEditing,
|
|
3090
2994
|
isPreviewing,
|
|
3091
|
-
register,
|
|
3092
|
-
|
|
3093
|
-
|
|
2995
|
+
J as register,
|
|
2996
|
+
Q as setEditorSettings,
|
|
2997
|
+
X as subscribeToEditor,
|
|
2998
|
+
Z as track
|
|
3094
2999
|
};
|