@builder.io/sdk-react 1.0.13 → 1.0.14
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/blocks-exports.cjs +27 -27
- package/lib/browser/blocks-exports.mjs +777 -783
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/{server-entry-20402a85.cjs → server-entry-742c121c.cjs} +1 -1
- package/lib/browser/{server-entry-1a840bf8.js → server-entry-df552d27.js} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{blocks-ca61b343.cjs → blocks-75e914c4.cjs} +1 -1
- package/lib/edge/{blocks-fd4ab30c.js → blocks-dbf6f051.js} +2 -2
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-6d8b002c.cjs → button-4e7f9eff.cjs} +1 -1
- package/lib/edge/{button-45681a80.js → button-db8d78a4.js} +2 -2
- package/lib/edge/{columns-77e4f17d.cjs → columns-8399aa74.cjs} +1 -1
- package/lib/edge/{columns-61e1043d.js → columns-9765610b.js} +3 -3
- package/lib/edge/{content-variants-c085fa7f.js → content-variants-9a129944.js} +303 -309
- package/lib/edge/content-variants-ed22bfec.cjs +134 -0
- package/lib/edge/{form-4fae6192.js → form-7a73e99c.js} +3 -3
- package/lib/edge/{form-b996f9f9.cjs → form-bc7b5558.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-14e14eea.cjs → get-class-prop-name-3c370466.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-0e4b7b88.js → get-class-prop-name-83fffba1.js} +1 -1
- package/lib/edge/{img-c623011b.cjs → img-7d93925c.cjs} +1 -1
- package/lib/edge/{img-1259941e.js → img-c944597b.js} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-2c618b06.cjs → input-72be594b.cjs} +1 -1
- package/lib/edge/{input-02a1cd9f.js → input-d735cf41.js} +1 -1
- package/lib/edge/{select-3acbf5f6.cjs → select-3411462e.cjs} +1 -1
- package/lib/edge/{select-b1b6d0bf.js → select-5e67472b.js} +1 -1
- package/lib/edge/{server-entry-3f0061ea.js → server-entry-5e5c1898.js} +1 -1
- package/lib/edge/{server-entry-d8f950e0.cjs → server-entry-62fc8a1d.cjs} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-92eac261.cjs → slot-04d29096.cjs} +1 -1
- package/lib/edge/{slot-3cefe326.js → slot-495693a8.js} +3 -3
- package/lib/edge/{symbol-741f0aee.cjs → symbol-ad121694.cjs} +1 -1
- package/lib/edge/{symbol-e2a47b92.js → symbol-c29e2a25.js} +2 -2
- package/lib/node/blocks-exports.cjs +10 -10
- package/lib/node/blocks-exports.mjs +310 -316
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +1 -1
- package/lib/node/{server-entry-383e8da6.js → server-entry-3a79d01e.js} +1 -1
- package/lib/node/{server-entry-6d61d1cf.cjs → server-entry-f5a4cdfa.cjs} +1 -1
- 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/lib/edge/content-variants-c86fdb5a.cjs +0 -134
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
2
|
+
var N = Object.defineProperty;
|
|
3
|
+
var V = (e, t, n) => t in e ? N(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
4
|
+
var F = (e, t, n) => (V(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
5
5
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { TARGET, isEditing, isBrowser, getUserAttributes, fastClone, checkIsDefined, logger, registerInsertMenu, setupBrowserForEditing, createRegisterComponentMessage, getDefaultCanTrack, _track, isPreviewing, fetchOneEntry, createEditorListener, fetch as fetch$1, serializeComponentInfo, handleABTestingSync } from "./server-entry-
|
|
6
|
+
import { TARGET, isEditing, isBrowser, getUserAttributes, fastClone, checkIsDefined, logger, registerInsertMenu, setupBrowserForEditing, createRegisterComponentMessage, getDefaultCanTrack, _track, isPreviewing, fetchOneEntry, createEditorListener, fetch as fetch$1, serializeComponentInfo, handleABTestingSync } from "./server-entry-3a79d01e.js";
|
|
7
7
|
import { createContext, useState, useEffect, useContext, useRef, createElement } from "react";
|
|
8
8
|
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());
|
|
9
9
|
function DynamicRenderer(e) {
|
|
@@ -213,29 +213,29 @@ output;
|
|
|
213
213
|
context: n,
|
|
214
214
|
event: o,
|
|
215
215
|
state: c
|
|
216
|
-
}), d = getIsolateContext(),
|
|
217
|
-
|
|
218
|
-
console.log(...
|
|
219
|
-
}),
|
|
220
|
-
set(r,
|
|
221
|
-
}), l.forEach(([
|
|
222
|
-
const
|
|
216
|
+
}), d = getIsolateContext(), m = d.global;
|
|
217
|
+
m.setSync("global", m.derefInto()), m.setSync("log", function(...y) {
|
|
218
|
+
console.log(...y);
|
|
219
|
+
}), m.setSync(BUILDER_SET_STATE_NAME, function(y, S) {
|
|
220
|
+
set(r, y, S), a == null || a(r);
|
|
221
|
+
}), l.forEach(([y, S]) => {
|
|
222
|
+
const k = typeof S == "object" ? new s.Reference(
|
|
223
223
|
// workaround: methods with default values for arguments is not being cloned over
|
|
224
|
-
|
|
225
|
-
...
|
|
226
|
-
getUserAttributes: () =>
|
|
227
|
-
} :
|
|
224
|
+
y === "builder" ? {
|
|
225
|
+
...S,
|
|
226
|
+
getUserAttributes: () => S.getUserAttributes()
|
|
227
|
+
} : S
|
|
228
228
|
) : null;
|
|
229
|
-
|
|
230
|
-
}),
|
|
231
|
-
const
|
|
229
|
+
m.setSync(getSyncValName(y), k);
|
|
230
|
+
}), m.setSync(INJECTED_IVM_GLOBAL, s);
|
|
231
|
+
const g = processCode({
|
|
232
232
|
code: e,
|
|
233
233
|
args: l
|
|
234
|
-
}),
|
|
234
|
+
}), b = d.evalSync(g);
|
|
235
235
|
try {
|
|
236
|
-
return JSON.parse(
|
|
236
|
+
return JSON.parse(b);
|
|
237
237
|
} catch {
|
|
238
|
-
return
|
|
238
|
+
return b;
|
|
239
239
|
}
|
|
240
240
|
};
|
|
241
241
|
function isNodeRuntime() {
|
|
@@ -248,7 +248,7 @@ const shouldForceBrowserRuntimeInNode = () => {
|
|
|
248
248
|
return !1;
|
|
249
249
|
const e = process.arch === "arm64", t = process.version.startsWith("v20"), n = (o = process.env.NODE_OPTIONS) == null ? void 0 : o.includes("--no-node-snapshot");
|
|
250
250
|
return e && t && !n ? (logger.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "), !0) : !1;
|
|
251
|
-
}, chooseBrowserOrServerEval = (e) => isBrowser() || shouldForceBrowserRuntimeInNode() ? runInBrowser(e) : runInNode(e),
|
|
251
|
+
}, chooseBrowserOrServerEval = (e) => isBrowser() || shouldForceBrowserRuntimeInNode() ? runInBrowser(e) : runInNode(e), R = class R {
|
|
252
252
|
static getCacheKey(t) {
|
|
253
253
|
return JSON.stringify({
|
|
254
254
|
...t,
|
|
@@ -258,16 +258,16 @@ const shouldForceBrowserRuntimeInNode = () => {
|
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
260
|
static getCachedValue(t) {
|
|
261
|
-
return
|
|
261
|
+
return R.cache.get(t);
|
|
262
262
|
}
|
|
263
263
|
static setCachedValue(t, n) {
|
|
264
|
-
|
|
264
|
+
R.cache.size > 20 && R.cache.delete(R.cache.keys().next().value), R.cache.set(t, {
|
|
265
265
|
value: n
|
|
266
266
|
});
|
|
267
267
|
}
|
|
268
268
|
};
|
|
269
|
-
|
|
270
|
-
let EvalCache =
|
|
269
|
+
F(R, "cacheLimit", 20), F(R, "cache", /* @__PURE__ */ new Map());
|
|
270
|
+
let EvalCache = R;
|
|
271
271
|
function evaluate({
|
|
272
272
|
code: e,
|
|
273
273
|
context: t,
|
|
@@ -470,8 +470,8 @@ function bindScrollInViewAnimation(e) {
|
|
|
470
470
|
leading: !1
|
|
471
471
|
});
|
|
472
472
|
function s(d) {
|
|
473
|
-
const
|
|
474
|
-
return
|
|
473
|
+
const m = d.getBoundingClientRect(), g = window.innerHeight, y = (e.thresholdPercent || 0) / 100 * g;
|
|
474
|
+
return m.bottom > y && m.top < g - y;
|
|
475
475
|
}
|
|
476
476
|
const c = e.steps[0].styles;
|
|
477
477
|
function l() {
|
|
@@ -642,7 +642,7 @@ function BlockStyles(e) {
|
|
|
642
642
|
return checkIsDefined(o.hide) ? !o.hide : checkIsDefined(o.show) ? o.show : !0;
|
|
643
643
|
}
|
|
644
644
|
function n() {
|
|
645
|
-
var
|
|
645
|
+
var y;
|
|
646
646
|
const o = getProcessedBlock({
|
|
647
647
|
block: e.block,
|
|
648
648
|
localState: e.context.localState,
|
|
@@ -651,21 +651,21 @@ function BlockStyles(e) {
|
|
|
651
651
|
context: e.context.context,
|
|
652
652
|
shouldEvaluateBindings: !0
|
|
653
653
|
}), i = o.responsiveStyles, a = e.context.content, r = getSizesForBreakpoints(
|
|
654
|
-
((
|
|
654
|
+
((y = a == null ? void 0 : a.meta) == null ? void 0 : y.breakpoints) || {}
|
|
655
655
|
), s = i == null ? void 0 : i.large, c = i == null ? void 0 : i.medium, l = i == null ? void 0 : i.small, d = o.id;
|
|
656
656
|
if (!d)
|
|
657
657
|
return "";
|
|
658
|
-
const
|
|
658
|
+
const m = s ? createCssClass({
|
|
659
659
|
className: d,
|
|
660
660
|
styles: s
|
|
661
|
-
}) : "",
|
|
661
|
+
}) : "", g = c ? createCssClass({
|
|
662
662
|
className: d,
|
|
663
663
|
styles: c,
|
|
664
664
|
mediaQuery: getMaxWidthQueryForSize(
|
|
665
665
|
"medium",
|
|
666
666
|
r
|
|
667
667
|
)
|
|
668
|
-
}) : "",
|
|
668
|
+
}) : "", b = l ? createCssClass({
|
|
669
669
|
className: d,
|
|
670
670
|
styles: l,
|
|
671
671
|
mediaQuery: getMaxWidthQueryForSize(
|
|
@@ -673,7 +673,7 @@ function BlockStyles(e) {
|
|
|
673
673
|
r
|
|
674
674
|
)
|
|
675
675
|
}) : "";
|
|
676
|
-
return [
|
|
676
|
+
return [m, g, b].join(" ");
|
|
677
677
|
}
|
|
678
678
|
return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: n() }) }) : null });
|
|
679
679
|
}
|
|
@@ -872,8 +872,8 @@ function Block(e) {
|
|
|
872
872
|
});
|
|
873
873
|
}
|
|
874
874
|
function o() {
|
|
875
|
-
var
|
|
876
|
-
return (
|
|
875
|
+
var m;
|
|
876
|
+
return (m = e.block.repeat) != null && m.collection ? e.block : getProcessedBlock({
|
|
877
877
|
block: e.block,
|
|
878
878
|
localState: e.context.localState,
|
|
879
879
|
rootState: e.context.rootState,
|
|
@@ -883,32 +883,32 @@ function Block(e) {
|
|
|
883
883
|
});
|
|
884
884
|
}
|
|
885
885
|
function i() {
|
|
886
|
-
var
|
|
887
|
-
return e.block.tagName === "a" || ((
|
|
886
|
+
var g;
|
|
887
|
+
return e.block.tagName === "a" || ((g = o().properties) == null ? void 0 : g.href) || o().href ? e.linkComponent || "a" : e.block.tagName || "div";
|
|
888
888
|
}
|
|
889
889
|
function a() {
|
|
890
|
-
var
|
|
891
|
-
if ((
|
|
892
|
-
return !!((
|
|
893
|
-
const
|
|
894
|
-
return ("show" in o() ? o().show : !0) && !
|
|
890
|
+
var b, y;
|
|
891
|
+
if ((b = e.block.repeat) != null && b.collection)
|
|
892
|
+
return !!((y = n == null ? void 0 : n()) != null && y.length);
|
|
893
|
+
const m = "hide" in o() ? o().hide : !1;
|
|
894
|
+
return ("show" in o() ? o().show : !0) && !m;
|
|
895
895
|
}
|
|
896
896
|
function r() {
|
|
897
|
-
var
|
|
898
|
-
return !((
|
|
897
|
+
var g, b;
|
|
898
|
+
return !((g = t == null ? void 0 : t()) != null && g.component) && !n() ? (b = o().children) != null ? b : [] : [];
|
|
899
899
|
}
|
|
900
900
|
function s() {
|
|
901
|
-
var
|
|
901
|
+
var m, g, b, y, S, k, T, x, C, E, I;
|
|
902
902
|
return {
|
|
903
|
-
blockChildren: (
|
|
904
|
-
componentRef: (
|
|
903
|
+
blockChildren: (m = o().children) != null ? m : [],
|
|
904
|
+
componentRef: (g = t == null ? void 0 : t()) == null ? void 0 : g.component,
|
|
905
905
|
componentOptions: {
|
|
906
906
|
...getBlockComponentOptions(o()),
|
|
907
907
|
builderContext: e.context,
|
|
908
|
-
...((
|
|
908
|
+
...((b = t == null ? void 0 : t()) == null ? void 0 : b.name) === "Core:Button" || ((y = t == null ? void 0 : t()) == null ? void 0 : y.name) === "Symbol" || ((S = t == null ? void 0 : t()) == null ? void 0 : S.name) === "Columns" || ((k = t == null ? void 0 : t()) == null ? void 0 : k.name) === "Form:Form" ? {
|
|
909
909
|
builderLinkComponent: e.linkComponent
|
|
910
910
|
} : {},
|
|
911
|
-
...((
|
|
911
|
+
...((T = t == null ? void 0 : t()) == null ? void 0 : T.name) === "Symbol" || ((x = t == null ? void 0 : t()) == null ? void 0 : x.name) === "Columns" || ((C = t == null ? void 0 : t()) == null ? void 0 : C.name) === "Form:Form" ? {
|
|
912
912
|
builderComponents: e.registeredComponents
|
|
913
913
|
} : {}
|
|
914
914
|
},
|
|
@@ -916,16 +916,16 @@ function Block(e) {
|
|
|
916
916
|
linkComponent: e.linkComponent,
|
|
917
917
|
registeredComponents: e.registeredComponents,
|
|
918
918
|
builderBlock: o(),
|
|
919
|
-
includeBlockProps: ((
|
|
920
|
-
isInteractive: !((
|
|
919
|
+
includeBlockProps: ((E = t == null ? void 0 : t()) == null ? void 0 : E.noWrap) === !0,
|
|
920
|
+
isInteractive: !((I = t == null ? void 0 : t()) != null && I.isRSC)
|
|
921
921
|
};
|
|
922
922
|
}
|
|
923
923
|
return useEffect(() => {
|
|
924
|
-
const
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
...
|
|
928
|
-
elementId:
|
|
924
|
+
const m = o().id, g = o().animations;
|
|
925
|
+
g && m && bindAnimations(
|
|
926
|
+
g.filter((b) => b.trigger !== "hover").map((b) => ({
|
|
927
|
+
...b,
|
|
928
|
+
elementId: m
|
|
929
929
|
}))
|
|
930
930
|
);
|
|
931
931
|
}, []), /* @__PURE__ */ jsx(Fragment, { children: a() ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -943,15 +943,15 @@ function Block(e) {
|
|
|
943
943
|
includeBlockProps: s().includeBlockProps,
|
|
944
944
|
isInteractive: s().isInteractive
|
|
945
945
|
}
|
|
946
|
-
) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (d = n()) == null ? void 0 : d.map((
|
|
946
|
+
) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (d = n()) == null ? void 0 : d.map((m, g) => /* @__PURE__ */ jsx(
|
|
947
947
|
RepeatedBlock,
|
|
948
948
|
{
|
|
949
|
-
repeatContext:
|
|
950
|
-
block:
|
|
949
|
+
repeatContext: m.context,
|
|
950
|
+
block: m.block,
|
|
951
951
|
registeredComponents: e.registeredComponents,
|
|
952
952
|
linkComponent: e.linkComponent
|
|
953
953
|
},
|
|
954
|
-
|
|
954
|
+
g
|
|
955
955
|
)) }) : /* @__PURE__ */ jsxs(
|
|
956
956
|
BlockWrapper,
|
|
957
957
|
{
|
|
@@ -974,15 +974,15 @@ function Block(e) {
|
|
|
974
974
|
isInteractive: s().isInteractive
|
|
975
975
|
}
|
|
976
976
|
),
|
|
977
|
-
(l = r()) == null ? void 0 : l.map((
|
|
977
|
+
(l = r()) == null ? void 0 : l.map((m) => /* @__PURE__ */ jsx(
|
|
978
978
|
Block,
|
|
979
979
|
{
|
|
980
|
-
block:
|
|
980
|
+
block: m,
|
|
981
981
|
registeredComponents: e.registeredComponents,
|
|
982
982
|
linkComponent: e.linkComponent,
|
|
983
983
|
context: e.context
|
|
984
984
|
},
|
|
985
|
-
|
|
985
|
+
m.id
|
|
986
986
|
))
|
|
987
987
|
]
|
|
988
988
|
}
|
|
@@ -1068,81 +1068,81 @@ function Blocks(e) {
|
|
|
1068
1068
|
);
|
|
1069
1069
|
}
|
|
1070
1070
|
function Columns(e) {
|
|
1071
|
-
var
|
|
1071
|
+
var T;
|
|
1072
1072
|
const [t, n] = useState(
|
|
1073
1073
|
() => typeof e.space == "number" ? e.space || 0 : 20
|
|
1074
1074
|
), [o, i] = useState(() => e.columns || []), [a, r] = useState(
|
|
1075
1075
|
() => e.stackColumnsAt || "tablet"
|
|
1076
1076
|
);
|
|
1077
|
-
function s(
|
|
1077
|
+
function s(x) {
|
|
1078
1078
|
var C;
|
|
1079
|
-
return ((C = o[
|
|
1079
|
+
return ((C = o[x]) == null ? void 0 : C.width) || 100 / o.length;
|
|
1080
1080
|
}
|
|
1081
|
-
function c(
|
|
1081
|
+
function c(x) {
|
|
1082
1082
|
const C = t * (o.length - 1) / o.length;
|
|
1083
|
-
return `calc(${s(
|
|
1083
|
+
return `calc(${s(x)}% - ${C}px)`;
|
|
1084
1084
|
}
|
|
1085
1085
|
function l({
|
|
1086
|
-
stackedStyle:
|
|
1086
|
+
stackedStyle: x,
|
|
1087
1087
|
desktopStyle: C
|
|
1088
1088
|
}) {
|
|
1089
|
-
return a === "tablet" ?
|
|
1089
|
+
return a === "tablet" ? x : C;
|
|
1090
1090
|
}
|
|
1091
1091
|
function d({
|
|
1092
|
-
stackedStyle:
|
|
1092
|
+
stackedStyle: x,
|
|
1093
1093
|
desktopStyle: C
|
|
1094
1094
|
}) {
|
|
1095
|
-
return a === "never" ? C :
|
|
1095
|
+
return a === "never" ? C : x;
|
|
1096
1096
|
}
|
|
1097
|
-
const [
|
|
1097
|
+
const [m, g] = useState(
|
|
1098
1098
|
() => e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column"
|
|
1099
1099
|
);
|
|
1100
|
-
function
|
|
1100
|
+
function b() {
|
|
1101
1101
|
return {
|
|
1102
|
-
"--flex-dir":
|
|
1102
|
+
"--flex-dir": m,
|
|
1103
1103
|
"--flex-dir-tablet": l({
|
|
1104
|
-
stackedStyle:
|
|
1104
|
+
stackedStyle: m,
|
|
1105
1105
|
desktopStyle: "row"
|
|
1106
1106
|
})
|
|
1107
1107
|
};
|
|
1108
1108
|
}
|
|
1109
|
-
function
|
|
1110
|
-
const C =
|
|
1109
|
+
function y(x) {
|
|
1110
|
+
const C = x === 0 ? 0 : t, E = c(x), I = `${C}px`, P = "100%", B = 0;
|
|
1111
1111
|
return {
|
|
1112
1112
|
...{
|
|
1113
1113
|
display: "flex",
|
|
1114
1114
|
flexDirection: "column",
|
|
1115
1115
|
alignItems: "stretch"
|
|
1116
1116
|
},
|
|
1117
|
-
width:
|
|
1118
|
-
["marginLeft"]:
|
|
1117
|
+
width: E,
|
|
1118
|
+
["marginLeft"]: I,
|
|
1119
1119
|
"--column-width-mobile": d({
|
|
1120
|
-
stackedStyle:
|
|
1121
|
-
desktopStyle:
|
|
1120
|
+
stackedStyle: P,
|
|
1121
|
+
desktopStyle: E
|
|
1122
1122
|
}),
|
|
1123
1123
|
"--column-margin-left-mobile": d({
|
|
1124
|
-
stackedStyle:
|
|
1125
|
-
desktopStyle:
|
|
1124
|
+
stackedStyle: B,
|
|
1125
|
+
desktopStyle: I
|
|
1126
1126
|
}),
|
|
1127
1127
|
"--column-width-tablet": l({
|
|
1128
|
-
stackedStyle:
|
|
1129
|
-
desktopStyle:
|
|
1128
|
+
stackedStyle: P,
|
|
1129
|
+
desktopStyle: E
|
|
1130
1130
|
}),
|
|
1131
1131
|
"--column-margin-left-tablet": l({
|
|
1132
|
-
stackedStyle:
|
|
1133
|
-
desktopStyle:
|
|
1132
|
+
stackedStyle: B,
|
|
1133
|
+
desktopStyle: I
|
|
1134
1134
|
})
|
|
1135
1135
|
};
|
|
1136
1136
|
}
|
|
1137
|
-
function
|
|
1138
|
-
var
|
|
1137
|
+
function S(x) {
|
|
1138
|
+
var E, I;
|
|
1139
1139
|
return getSizesForBreakpoints(
|
|
1140
|
-
((
|
|
1141
|
-
)[
|
|
1140
|
+
((I = (E = e.builderContext.content) == null ? void 0 : E.meta) == null ? void 0 : I.breakpoints) || {}
|
|
1141
|
+
)[x].max;
|
|
1142
1142
|
}
|
|
1143
|
-
function
|
|
1143
|
+
function k() {
|
|
1144
1144
|
return `
|
|
1145
|
-
@media (max-width: ${
|
|
1145
|
+
@media (max-width: ${S("medium")}px) {
|
|
1146
1146
|
.${e.builderBlock.id}-breakpoints {
|
|
1147
1147
|
flex-direction: var(--flex-dir-tablet);
|
|
1148
1148
|
align-items: stretch;
|
|
@@ -1154,7 +1154,7 @@ function Columns(e) {
|
|
|
1154
1154
|
}
|
|
1155
1155
|
}
|
|
1156
1156
|
|
|
1157
|
-
@media (max-width: ${
|
|
1157
|
+
@media (max-width: ${S("small")}px) {
|
|
1158
1158
|
.${e.builderBlock.id}-breakpoints {
|
|
1159
1159
|
flex-direction: var(--flex-dir);
|
|
1160
1160
|
align-items: stretch;
|
|
@@ -1172,20 +1172,20 @@ function Columns(e) {
|
|
|
1172
1172
|
"div",
|
|
1173
1173
|
{
|
|
1174
1174
|
className: `builder-columns ${e.builderBlock.id}-breakpoints div-5e636bea`,
|
|
1175
|
-
style:
|
|
1175
|
+
style: b(),
|
|
1176
1176
|
children: [
|
|
1177
|
-
/* @__PURE__ */ jsx(InlinedStyles, { styles:
|
|
1178
|
-
(
|
|
1177
|
+
/* @__PURE__ */ jsx(InlinedStyles, { styles: k() }),
|
|
1178
|
+
(T = e.columns) == null ? void 0 : T.map((x, C) => /* @__PURE__ */ jsx(
|
|
1179
1179
|
DynamicRenderer,
|
|
1180
1180
|
{
|
|
1181
|
-
TagName:
|
|
1181
|
+
TagName: x.link ? e.builderLinkComponent || "a" : "div",
|
|
1182
1182
|
actionAttributes: {},
|
|
1183
1183
|
attributes: {
|
|
1184
|
-
...
|
|
1185
|
-
href:
|
|
1184
|
+
...x.link ? {
|
|
1185
|
+
href: x.link
|
|
1186
1186
|
} : {},
|
|
1187
1187
|
[getClassPropName()]: "builder-column",
|
|
1188
|
-
style: mapStyleObjToStrIfNeeded(
|
|
1188
|
+
style: mapStyleObjToStrIfNeeded(y(C))
|
|
1189
1189
|
},
|
|
1190
1190
|
children: /* @__PURE__ */ jsx(
|
|
1191
1191
|
Blocks,
|
|
@@ -1198,7 +1198,7 @@ function Columns(e) {
|
|
|
1198
1198
|
context: e.builderContext,
|
|
1199
1199
|
registeredComponents: e.builderComponents,
|
|
1200
1200
|
linkComponent: e.builderLinkComponent,
|
|
1201
|
-
blocks:
|
|
1201
|
+
blocks: x.blocks
|
|
1202
1202
|
}
|
|
1203
1203
|
)
|
|
1204
1204
|
},
|
|
@@ -1613,13 +1613,13 @@ const componentInfo$f = {
|
|
|
1613
1613
|
function n(r, s = 6e4) {
|
|
1614
1614
|
return new Promise((c, l) => {
|
|
1615
1615
|
const d = document.createElement("img");
|
|
1616
|
-
let
|
|
1616
|
+
let m = !1;
|
|
1617
1617
|
d.onload = () => {
|
|
1618
|
-
|
|
1619
|
-
}, d.addEventListener("error", (
|
|
1620
|
-
console.warn("Image load failed",
|
|
1618
|
+
m = !0, c(d);
|
|
1619
|
+
}, d.addEventListener("error", (g) => {
|
|
1620
|
+
console.warn("Image load failed", g.error), l(g.error);
|
|
1621
1621
|
}), d.src = r, setTimeout(() => {
|
|
1622
|
-
|
|
1622
|
+
m || l(new Error("Image load timed out"));
|
|
1623
1623
|
}, s);
|
|
1624
1624
|
});
|
|
1625
1625
|
}
|
|
@@ -1925,16 +1925,16 @@ function Embed(e) {
|
|
|
1925
1925
|
return;
|
|
1926
1926
|
const l = t.current.getElementsByTagName("script");
|
|
1927
1927
|
for (let d = 0; d < l.length; d++) {
|
|
1928
|
-
const
|
|
1929
|
-
if (
|
|
1930
|
-
n.push(
|
|
1931
|
-
const
|
|
1932
|
-
|
|
1933
|
-
} else if (isJsScript(
|
|
1928
|
+
const m = l[d];
|
|
1929
|
+
if (m.src && !n.includes(m.src)) {
|
|
1930
|
+
n.push(m.src);
|
|
1931
|
+
const g = document.createElement("script");
|
|
1932
|
+
g.async = !0, g.src = m.src, document.head.appendChild(g);
|
|
1933
|
+
} else if (isJsScript(m) && !i.includes(m.innerText))
|
|
1934
1934
|
try {
|
|
1935
|
-
i.push(
|
|
1936
|
-
} catch (
|
|
1937
|
-
console.warn("`Embed`: Error running script:",
|
|
1935
|
+
i.push(m.innerText), new Function(m.innerText)();
|
|
1936
|
+
} catch (g) {
|
|
1937
|
+
console.warn("`Embed`: Error running script:", g);
|
|
1938
1938
|
}
|
|
1939
1939
|
}
|
|
1940
1940
|
}
|
|
@@ -2188,112 +2188,112 @@ const componentInfo$5 = {
|
|
|
2188
2188
|
return o === void 0 || o === e ? n : o;
|
|
2189
2189
|
};
|
|
2190
2190
|
function FormComponent(e) {
|
|
2191
|
-
var
|
|
2191
|
+
var m, g;
|
|
2192
2192
|
const t = useRef(null), [n, o] = useState(() => "unsubmitted"), [i, a] = useState(() => null), [r, s] = useState(() => "");
|
|
2193
|
-
function c(
|
|
2194
|
-
var
|
|
2195
|
-
const
|
|
2193
|
+
function c(b) {
|
|
2194
|
+
var S, k;
|
|
2195
|
+
const y = {
|
|
2196
2196
|
...e.builderContext.rootState,
|
|
2197
|
-
...
|
|
2197
|
+
...b
|
|
2198
2198
|
};
|
|
2199
|
-
e.builderContext.rootSetState ? (
|
|
2199
|
+
e.builderContext.rootSetState ? (k = (S = e.builderContext).rootSetState) == null || k.call(S, y) : e.builderContext.rootState = y;
|
|
2200
2200
|
}
|
|
2201
2201
|
function l() {
|
|
2202
2202
|
return isEditing() && e.previewState || n;
|
|
2203
2203
|
}
|
|
2204
|
-
function d(
|
|
2205
|
-
var
|
|
2206
|
-
const
|
|
2204
|
+
function d(b) {
|
|
2205
|
+
var S;
|
|
2206
|
+
const y = e.sendWithJs || e.sendSubmissionsTo === "email";
|
|
2207
2207
|
if (e.sendSubmissionsTo === "zapier")
|
|
2208
|
-
|
|
2209
|
-
else if (
|
|
2208
|
+
b.preventDefault();
|
|
2209
|
+
else if (y) {
|
|
2210
2210
|
if (!(e.action || e.sendSubmissionsTo === "email")) {
|
|
2211
|
-
|
|
2211
|
+
b.preventDefault();
|
|
2212
2212
|
return;
|
|
2213
2213
|
}
|
|
2214
|
-
|
|
2215
|
-
const
|
|
2216
|
-
let
|
|
2217
|
-
const C = new FormData(
|
|
2218
|
-
|
|
2219
|
-
).filter((
|
|
2220
|
-
let
|
|
2221
|
-
const
|
|
2222
|
-
if (
|
|
2223
|
-
if (
|
|
2224
|
-
if (
|
|
2225
|
-
return
|
|
2226
|
-
key:
|
|
2227
|
-
value:
|
|
2214
|
+
b.preventDefault();
|
|
2215
|
+
const k = b.currentTarget, T = e.customHeaders || {};
|
|
2216
|
+
let x;
|
|
2217
|
+
const C = new FormData(k), E = Array.from(
|
|
2218
|
+
b.currentTarget.querySelectorAll("input,select,textarea")
|
|
2219
|
+
).filter((u) => !!u.name).map((u) => {
|
|
2220
|
+
let f;
|
|
2221
|
+
const p = u.name;
|
|
2222
|
+
if (u instanceof HTMLInputElement)
|
|
2223
|
+
if (u.type === "radio") {
|
|
2224
|
+
if (u.checked)
|
|
2225
|
+
return f = u.name, {
|
|
2226
|
+
key: p,
|
|
2227
|
+
value: f
|
|
2228
2228
|
};
|
|
2229
|
-
} else if (
|
|
2230
|
-
|
|
2231
|
-
else if (
|
|
2232
|
-
const
|
|
2233
|
-
isNaN(
|
|
2229
|
+
} else if (u.type === "checkbox")
|
|
2230
|
+
f = u.checked;
|
|
2231
|
+
else if (u.type === "number" || u.type === "range") {
|
|
2232
|
+
const h = u.valueAsNumber;
|
|
2233
|
+
isNaN(h) || (f = h);
|
|
2234
2234
|
} else
|
|
2235
|
-
|
|
2235
|
+
u.type === "file" ? f = u.files : f = u.value;
|
|
2236
2236
|
else
|
|
2237
|
-
|
|
2237
|
+
f = u.value;
|
|
2238
2238
|
return {
|
|
2239
|
-
key:
|
|
2240
|
-
value:
|
|
2239
|
+
key: p,
|
|
2240
|
+
value: f
|
|
2241
2241
|
};
|
|
2242
2242
|
});
|
|
2243
|
-
let
|
|
2244
|
-
if (e.sendSubmissionsTo === "email" && (
|
|
2245
|
-
(
|
|
2246
|
-
}),
|
|
2247
|
-
|
|
2243
|
+
let I = e.contentType;
|
|
2244
|
+
if (e.sendSubmissionsTo === "email" && (I = "multipart/form-data"), Array.from(E).forEach(({ value: u }) => {
|
|
2245
|
+
(u instanceof File || Array.isArray(u) && u[0] instanceof File || u instanceof FileList) && (I = "multipart/form-data");
|
|
2246
|
+
}), I !== "application/json")
|
|
2247
|
+
x = C;
|
|
2248
2248
|
else {
|
|
2249
|
-
const
|
|
2250
|
-
Array.from(
|
|
2251
|
-
set(
|
|
2252
|
-
}),
|
|
2249
|
+
const u = {};
|
|
2250
|
+
Array.from(E).forEach(({ value: f, key: p }) => {
|
|
2251
|
+
set(u, p, f);
|
|
2252
|
+
}), x = JSON.stringify(u);
|
|
2253
2253
|
}
|
|
2254
|
-
|
|
2255
|
-
const
|
|
2256
|
-
if (t.current && (t.current.dispatchEvent(
|
|
2254
|
+
I && I !== "multipart/form-data" && (y && ((S = e.action) != null && S.includes("zapier.com")) || (T["content-type"] = I));
|
|
2255
|
+
const P = new CustomEvent("presubmit", { detail: { body: x } });
|
|
2256
|
+
if (t.current && (t.current.dispatchEvent(P), P.defaultPrevented))
|
|
2257
2257
|
return;
|
|
2258
2258
|
o("sending");
|
|
2259
|
-
const
|
|
2259
|
+
const B = `${getEnv() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(
|
|
2260
2260
|
e.sendSubmissionsToEmail || ""
|
|
2261
2261
|
)}&name=${encodeURIComponent(e.name || "")}`;
|
|
2262
2262
|
fetch(
|
|
2263
|
-
e.sendSubmissionsTo === "email" ?
|
|
2264
|
-
{ body:
|
|
2263
|
+
e.sendSubmissionsTo === "email" ? B : e.action,
|
|
2264
|
+
{ body: x, headers: T, method: e.method || "post" }
|
|
2265
2265
|
).then(
|
|
2266
|
-
async (
|
|
2267
|
-
let
|
|
2268
|
-
const
|
|
2269
|
-
if (
|
|
2270
|
-
let
|
|
2271
|
-
|
|
2266
|
+
async (u) => {
|
|
2267
|
+
let f;
|
|
2268
|
+
const p = u.headers.get("content-type");
|
|
2269
|
+
if (p && p.indexOf("application/json") !== -1 ? f = await u.json() : f = await u.text(), !u.ok && e.errorMessagePath) {
|
|
2270
|
+
let h = get(f, e.errorMessagePath);
|
|
2271
|
+
h && (typeof h != "string" && (h = JSON.stringify(h)), s(h), c({ formErrorMessage: h }));
|
|
2272
2272
|
}
|
|
2273
|
-
if (a(
|
|
2274
|
-
const
|
|
2275
|
-
detail: { res:
|
|
2273
|
+
if (a(f), o(u.ok ? "success" : "error"), u.ok) {
|
|
2274
|
+
const h = new CustomEvent("submit:success", {
|
|
2275
|
+
detail: { res: u, body: f }
|
|
2276
2276
|
});
|
|
2277
2277
|
if (t.current) {
|
|
2278
|
-
if (t.current.dispatchEvent(
|
|
2278
|
+
if (t.current.dispatchEvent(h), h.defaultPrevented)
|
|
2279
2279
|
return;
|
|
2280
2280
|
e.resetFormOnSubmit !== !1 && t.current.reset();
|
|
2281
2281
|
}
|
|
2282
2282
|
if (e.successUrl)
|
|
2283
2283
|
if (t.current) {
|
|
2284
|
-
const
|
|
2284
|
+
const v = new CustomEvent("route", {
|
|
2285
2285
|
detail: { url: e.successUrl }
|
|
2286
2286
|
});
|
|
2287
|
-
t.current.dispatchEvent(
|
|
2287
|
+
t.current.dispatchEvent(v), v.defaultPrevented || (location.href = e.successUrl);
|
|
2288
2288
|
} else
|
|
2289
2289
|
location.href = e.successUrl;
|
|
2290
2290
|
}
|
|
2291
2291
|
},
|
|
2292
|
-
(
|
|
2293
|
-
const
|
|
2294
|
-
detail: { error:
|
|
2292
|
+
(u) => {
|
|
2293
|
+
const f = new CustomEvent("submit:error", {
|
|
2294
|
+
detail: { error: u }
|
|
2295
2295
|
});
|
|
2296
|
-
t.current && (t.current.dispatchEvent(
|
|
2296
|
+
t.current && (t.current.dispatchEvent(f), f.defaultPrevented) || (a(u), o("error"));
|
|
2297
2297
|
}
|
|
2298
2298
|
);
|
|
2299
2299
|
}
|
|
@@ -2308,18 +2308,18 @@ function FormComponent(e) {
|
|
|
2308
2308
|
action: !e.sendWithJs && e.action,
|
|
2309
2309
|
method: e.method,
|
|
2310
2310
|
name: e.name,
|
|
2311
|
-
onSubmit: (
|
|
2311
|
+
onSubmit: (b) => d(b),
|
|
2312
2312
|
...e.attributes,
|
|
2313
2313
|
children: [
|
|
2314
|
-
e.builderBlock && e.builderBlock.children ? /* @__PURE__ */ jsx(Fragment, { children: (
|
|
2314
|
+
e.builderBlock && e.builderBlock.children ? /* @__PURE__ */ jsx(Fragment, { children: (g = (m = e.builderBlock) == null ? void 0 : m.children) == null ? void 0 : g.map((b, y) => /* @__PURE__ */ jsx(
|
|
2315
2315
|
Block,
|
|
2316
2316
|
{
|
|
2317
|
-
block:
|
|
2317
|
+
block: b,
|
|
2318
2318
|
context: e.builderContext,
|
|
2319
2319
|
registeredComponents: e.builderComponents,
|
|
2320
2320
|
linkComponent: e.builderLinkComponent
|
|
2321
2321
|
},
|
|
2322
|
-
`form-block-${
|
|
2322
|
+
`form-block-${y}`
|
|
2323
2323
|
)) }) : null,
|
|
2324
2324
|
l() === "error" ? /* @__PURE__ */ jsx(
|
|
2325
2325
|
Blocks,
|
|
@@ -2930,74 +2930,70 @@ const findParentElement = (e, t, n = !0) => {
|
|
|
2930
2930
|
};
|
|
2931
2931
|
};
|
|
2932
2932
|
function EnableEditor(e) {
|
|
2933
|
-
var
|
|
2934
|
-
const t = useRef(null)
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
const S = {
|
|
2933
|
+
var T, x, C, E, I, P, B;
|
|
2934
|
+
const t = useRef(null);
|
|
2935
|
+
function n(u) {
|
|
2936
|
+
var p, h;
|
|
2937
|
+
const f = {
|
|
2939
2938
|
...e.builderContextSignal.rootState,
|
|
2940
|
-
...
|
|
2939
|
+
...u
|
|
2941
2940
|
};
|
|
2942
|
-
e.builderContextSignal.rootSetState ? (
|
|
2943
|
-
...
|
|
2944
|
-
rootState:
|
|
2941
|
+
e.builderContextSignal.rootSetState ? (h = (p = e.builderContextSignal).rootSetState) == null || h.call(p, f) : e.setBuilderContextSignal((v) => ({
|
|
2942
|
+
...v,
|
|
2943
|
+
rootState: f
|
|
2945
2944
|
}));
|
|
2946
2945
|
}
|
|
2947
|
-
function
|
|
2948
|
-
var
|
|
2949
|
-
const
|
|
2946
|
+
function o(u) {
|
|
2947
|
+
var p, h, v, w, j;
|
|
2948
|
+
const f = {
|
|
2950
2949
|
...e.builderContextSignal.content,
|
|
2951
|
-
...
|
|
2950
|
+
...u,
|
|
2952
2951
|
data: {
|
|
2953
|
-
...(
|
|
2954
|
-
...
|
|
2952
|
+
...(p = e.builderContextSignal.content) == null ? void 0 : p.data,
|
|
2953
|
+
...u == null ? void 0 : u.data
|
|
2955
2954
|
},
|
|
2956
2955
|
meta: {
|
|
2957
|
-
...(
|
|
2958
|
-
...
|
|
2959
|
-
breakpoints: ((
|
|
2956
|
+
...(h = e.builderContextSignal.content) == null ? void 0 : h.meta,
|
|
2957
|
+
...u == null ? void 0 : u.meta,
|
|
2958
|
+
breakpoints: ((v = u == null ? void 0 : u.meta) == null ? void 0 : v.breakpoints) || ((j = (w = e.builderContextSignal.content) == null ? void 0 : w.meta) == null ? void 0 : j.breakpoints)
|
|
2960
2959
|
}
|
|
2961
2960
|
};
|
|
2962
|
-
e.setBuilderContextSignal((
|
|
2963
|
-
|
|
2964
|
-
content:
|
|
2961
|
+
e.setBuilderContextSignal((A) => ({
|
|
2962
|
+
...A,
|
|
2963
|
+
content: f
|
|
2965
2964
|
}));
|
|
2966
2965
|
}
|
|
2967
|
-
useState(
|
|
2968
|
-
const [r, s] = useState(
|
|
2969
|
-
() => !1
|
|
2970
|
-
), [c, l] = useState(
|
|
2966
|
+
const [i, a] = useState(
|
|
2971
2967
|
() => e.contentWrapper || "div"
|
|
2972
2968
|
);
|
|
2973
|
-
function
|
|
2969
|
+
function r(u) {
|
|
2974
2970
|
return createEditorListener({
|
|
2975
2971
|
model: e.model,
|
|
2976
2972
|
trustedHosts: e.trustedHosts,
|
|
2977
2973
|
callbacks: {
|
|
2978
|
-
configureSdk: (
|
|
2979
|
-
var
|
|
2980
|
-
const { breakpoints:
|
|
2981
|
-
!
|
|
2974
|
+
configureSdk: (f) => {
|
|
2975
|
+
var v;
|
|
2976
|
+
const { breakpoints: p, contentId: h } = f;
|
|
2977
|
+
!h || h !== ((v = e.builderContextSignal.content) == null ? void 0 : v.id) || p && o({
|
|
2982
2978
|
meta: {
|
|
2983
|
-
breakpoints:
|
|
2979
|
+
breakpoints: p
|
|
2984
2980
|
}
|
|
2985
|
-
})
|
|
2981
|
+
});
|
|
2986
2982
|
},
|
|
2987
|
-
animation: (
|
|
2988
|
-
triggerAnimation(
|
|
2983
|
+
animation: (f) => {
|
|
2984
|
+
triggerAnimation(f);
|
|
2989
2985
|
},
|
|
2990
|
-
contentUpdate: (
|
|
2991
|
-
|
|
2986
|
+
contentUpdate: (f) => {
|
|
2987
|
+
o(f);
|
|
2992
2988
|
}
|
|
2993
2989
|
}
|
|
2994
|
-
})(
|
|
2990
|
+
})(u);
|
|
2995
2991
|
}
|
|
2996
|
-
function
|
|
2997
|
-
var
|
|
2998
|
-
const
|
|
2999
|
-
|
|
3000
|
-
code:
|
|
2992
|
+
function s() {
|
|
2993
|
+
var f, p;
|
|
2994
|
+
const u = (p = (f = e.builderContextSignal.content) == null ? void 0 : f.data) == null ? void 0 : p.jsCode;
|
|
2995
|
+
u && evaluate({
|
|
2996
|
+
code: u,
|
|
3001
2997
|
context: e.context || {},
|
|
3002
2998
|
localState: void 0,
|
|
3003
2999
|
rootState: e.builderContextSignal.rootState,
|
|
@@ -3008,29 +3004,29 @@ function EnableEditor(e) {
|
|
|
3008
3004
|
enableCache: !1
|
|
3009
3005
|
});
|
|
3010
3006
|
}
|
|
3011
|
-
const [
|
|
3012
|
-
function
|
|
3013
|
-
var
|
|
3007
|
+
const [c, l] = useState(() => ({})), [d, m] = useState(() => !1);
|
|
3008
|
+
function g(u) {
|
|
3009
|
+
var f, p;
|
|
3014
3010
|
if (e.builderContextSignal.content) {
|
|
3015
|
-
const
|
|
3011
|
+
const h = (f = e.builderContextSignal.content) == null ? void 0 : f.testVariationId, v = (p = e.builderContextSignal.content) == null ? void 0 : p.id;
|
|
3016
3012
|
_track({
|
|
3017
3013
|
type: "click",
|
|
3018
3014
|
canTrack: getDefaultCanTrack(e.canTrack),
|
|
3019
|
-
contentId:
|
|
3015
|
+
contentId: v,
|
|
3020
3016
|
apiKey: e.apiKey,
|
|
3021
|
-
variationId:
|
|
3022
|
-
...getInteractionPropertiesForEvent(
|
|
3023
|
-
unique: !
|
|
3017
|
+
variationId: h !== v ? h : void 0,
|
|
3018
|
+
...getInteractionPropertiesForEvent(u),
|
|
3019
|
+
unique: !d
|
|
3024
3020
|
});
|
|
3025
3021
|
}
|
|
3026
|
-
|
|
3022
|
+
d || m(!0);
|
|
3027
3023
|
}
|
|
3028
|
-
function
|
|
3029
|
-
return
|
|
3024
|
+
function b(u) {
|
|
3025
|
+
return u.replace(
|
|
3030
3026
|
/{{([^}]+)}}/g,
|
|
3031
|
-
(
|
|
3027
|
+
(f, p) => String(
|
|
3032
3028
|
evaluate({
|
|
3033
|
-
code:
|
|
3029
|
+
code: p,
|
|
3034
3030
|
context: e.context || {},
|
|
3035
3031
|
localState: void 0,
|
|
3036
3032
|
rootState: e.builderContextSignal.rootState,
|
|
@@ -3040,32 +3036,32 @@ function EnableEditor(e) {
|
|
|
3040
3036
|
)
|
|
3041
3037
|
);
|
|
3042
3038
|
}
|
|
3043
|
-
function
|
|
3044
|
-
fetch$1(
|
|
3045
|
-
var
|
|
3046
|
-
const
|
|
3039
|
+
function y({ url: u, key: f }) {
|
|
3040
|
+
fetch$1(u).then((p) => p.json()).then((p) => {
|
|
3041
|
+
var v, w;
|
|
3042
|
+
const h = {
|
|
3047
3043
|
...e.builderContextSignal.rootState,
|
|
3048
|
-
[
|
|
3044
|
+
[f]: p
|
|
3049
3045
|
};
|
|
3050
|
-
(
|
|
3051
|
-
}).catch((
|
|
3052
|
-
console.error("error fetching dynamic data",
|
|
3046
|
+
(w = (v = e.builderContextSignal).rootSetState) == null || w.call(v, h), c[f] = !0;
|
|
3047
|
+
}).catch((p) => {
|
|
3048
|
+
console.error("error fetching dynamic data", u, p);
|
|
3053
3049
|
});
|
|
3054
3050
|
}
|
|
3055
|
-
function
|
|
3056
|
-
var
|
|
3057
|
-
const
|
|
3058
|
-
Object.entries(
|
|
3059
|
-
if (
|
|
3060
|
-
const
|
|
3061
|
-
|
|
3062
|
-
url:
|
|
3063
|
-
key:
|
|
3051
|
+
function S() {
|
|
3052
|
+
var f, p, h;
|
|
3053
|
+
const u = (h = (p = (f = e.builderContextSignal.content) == null ? void 0 : f.data) == null ? void 0 : p.httpRequests) != null ? h : {};
|
|
3054
|
+
Object.entries(u).forEach(([v, w]) => {
|
|
3055
|
+
if (w && (!c[v] || isEditing())) {
|
|
3056
|
+
const j = b(w);
|
|
3057
|
+
y({
|
|
3058
|
+
url: j,
|
|
3059
|
+
key: v
|
|
3064
3060
|
});
|
|
3065
3061
|
}
|
|
3066
3062
|
});
|
|
3067
3063
|
}
|
|
3068
|
-
function
|
|
3064
|
+
function k() {
|
|
3069
3065
|
isEditing() && window.dispatchEvent(
|
|
3070
3066
|
new CustomEvent(
|
|
3071
3067
|
"builder:component:stateChange",
|
|
@@ -3081,9 +3077,9 @@ function EnableEditor(e) {
|
|
|
3081
3077
|
);
|
|
3082
3078
|
}
|
|
3083
3079
|
return useEffect(() => {
|
|
3084
|
-
var
|
|
3080
|
+
var u, f;
|
|
3085
3081
|
if (isBrowser()) {
|
|
3086
|
-
if (isEditing() && (
|
|
3082
|
+
if (isEditing() && (window.addEventListener("message", r), registerInsertMenu(), setupBrowserForEditing({
|
|
3087
3083
|
...e.locale ? {
|
|
3088
3084
|
locale: e.locale
|
|
3089
3085
|
} : {},
|
|
@@ -3095,66 +3091,64 @@ function EnableEditor(e) {
|
|
|
3095
3091
|
} : {}
|
|
3096
3092
|
}), Object.values(
|
|
3097
3093
|
e.builderContextSignal.componentInfos
|
|
3098
|
-
).forEach((
|
|
3099
|
-
var
|
|
3100
|
-
const
|
|
3101
|
-
(
|
|
3094
|
+
).forEach((h) => {
|
|
3095
|
+
var w;
|
|
3096
|
+
const v = createRegisterComponentMessage(h);
|
|
3097
|
+
(w = window.parent) == null || w.postMessage(v, "*");
|
|
3102
3098
|
}), window.addEventListener(
|
|
3103
3099
|
"builder:component:stateChangeListenerActivated",
|
|
3104
|
-
|
|
3100
|
+
k
|
|
3105
3101
|
)), e.builderContextSignal.content && getDefaultCanTrack(e.canTrack)) {
|
|
3106
|
-
const
|
|
3102
|
+
const h = (u = e.builderContextSignal.content) == null ? void 0 : u.testVariationId, v = (f = e.builderContextSignal.content) == null ? void 0 : f.id, w = e.apiKey;
|
|
3107
3103
|
_track({
|
|
3108
3104
|
type: "impression",
|
|
3109
3105
|
canTrack: !0,
|
|
3110
|
-
contentId:
|
|
3111
|
-
apiKey:
|
|
3112
|
-
variationId:
|
|
3106
|
+
contentId: v,
|
|
3107
|
+
apiKey: w,
|
|
3108
|
+
variationId: h !== v ? h : void 0
|
|
3113
3109
|
});
|
|
3114
3110
|
}
|
|
3115
3111
|
if (isPreviewing()) {
|
|
3116
|
-
const
|
|
3117
|
-
`builder.preview.${
|
|
3118
|
-
),
|
|
3119
|
-
|
|
3112
|
+
const h = new URL(location.href).searchParams, v = h.get("builder.preview"), w = h.get(
|
|
3113
|
+
`builder.preview.${v}`
|
|
3114
|
+
), j = h.get("apiKey") || h.get("builder.space");
|
|
3115
|
+
v === e.model && j === e.apiKey && (!e.content || w === e.content.id) && fetchOneEntry({
|
|
3120
3116
|
model: e.model,
|
|
3121
3117
|
apiKey: e.apiKey,
|
|
3122
3118
|
apiVersion: e.builderContextSignal.apiVersion
|
|
3123
|
-
}).then((
|
|
3124
|
-
|
|
3119
|
+
}).then((A) => {
|
|
3120
|
+
A && o(A);
|
|
3125
3121
|
});
|
|
3126
3122
|
}
|
|
3127
3123
|
}
|
|
3128
3124
|
}, []), useEffect(() => {
|
|
3129
3125
|
e.apiKey || logger.error(
|
|
3130
3126
|
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
3131
|
-
),
|
|
3127
|
+
), s(), S(), k();
|
|
3132
3128
|
}, []), useEffect(() => {
|
|
3133
|
-
e.content &&
|
|
3129
|
+
e.content && o(e.content);
|
|
3134
3130
|
}, [e.content]), useEffect(() => {
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
w();
|
|
3131
|
+
s();
|
|
3132
|
+
}, [(x = (T = e.builderContextSignal.content) == null ? void 0 : T.data) == null ? void 0 : x.jsCode]), useEffect(() => {
|
|
3133
|
+
S();
|
|
3134
|
+
}, [(E = (C = e.builderContextSignal.content) == null ? void 0 : C.data) == null ? void 0 : E.httpRequests]), useEffect(() => {
|
|
3135
|
+
k();
|
|
3141
3136
|
}, [e.builderContextSignal.rootState]), useEffect(() => {
|
|
3142
|
-
e.data &&
|
|
3137
|
+
e.data && n(e.data);
|
|
3143
3138
|
}, [e.data]), useEffect(() => {
|
|
3144
|
-
e.locale &&
|
|
3139
|
+
e.locale && n({
|
|
3145
3140
|
locale: e.locale
|
|
3146
3141
|
});
|
|
3147
3142
|
}, [e.locale]), useEffect(() => () => {
|
|
3148
|
-
isBrowser() && (window.removeEventListener("message",
|
|
3143
|
+
isBrowser() && (window.removeEventListener("message", r), window.removeEventListener(
|
|
3149
3144
|
"builder:component:stateChangeListenerActivated",
|
|
3150
|
-
|
|
3145
|
+
k
|
|
3151
3146
|
));
|
|
3152
|
-
}, []), /* @__PURE__ */ jsx(builderContext.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */
|
|
3153
|
-
|
|
3147
|
+
}, []), /* @__PURE__ */ jsx(builderContext.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ jsx(
|
|
3148
|
+
i,
|
|
3154
3149
|
{
|
|
3155
|
-
key: n,
|
|
3156
3150
|
ref: t,
|
|
3157
|
-
onClick: (
|
|
3151
|
+
onClick: (u) => g(u),
|
|
3158
3152
|
"builder-content-id": (I = e.builderContextSignal.content) == null ? void 0 : I.id,
|
|
3159
3153
|
"builder-model": e.model,
|
|
3160
3154
|
...e.showContent ? {} : {
|
|
@@ -3162,9 +3156,9 @@ function EnableEditor(e) {
|
|
|
3162
3156
|
"aria-hidden": !0
|
|
3163
3157
|
},
|
|
3164
3158
|
...e.contentWrapperProps,
|
|
3165
|
-
className: `variant-${((
|
|
3166
|
-
|
|
3167
|
-
|
|
3159
|
+
className: `variant-${((P = e.content) == null ? void 0 : P.testVariationId) || ((B = e.content) == null ? void 0 : B.id)}`,
|
|
3160
|
+
children: e.children
|
|
3161
|
+
}
|
|
3168
3162
|
) : null });
|
|
3169
3163
|
}
|
|
3170
3164
|
const getCssFromFont = (e) => {
|
|
@@ -3263,22 +3257,22 @@ const getRootStateInitialValue = ({
|
|
|
3263
3257
|
meta: e == null ? void 0 : e.meta
|
|
3264
3258
|
} : void 0;
|
|
3265
3259
|
function ContentComponent(e) {
|
|
3266
|
-
var c, l, d,
|
|
3260
|
+
var c, l, d, m, g, b, y;
|
|
3267
3261
|
const [t, n] = useState(
|
|
3268
3262
|
() => {
|
|
3269
|
-
var
|
|
3263
|
+
var S, k;
|
|
3270
3264
|
return getUpdateVariantVisibilityScript({
|
|
3271
3265
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
3272
|
-
variationId: (
|
|
3266
|
+
variationId: (S = e.content) == null ? void 0 : S.testVariationId,
|
|
3273
3267
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
3274
|
-
contentId: (
|
|
3268
|
+
contentId: (k = e.content) == null ? void 0 : k.id
|
|
3275
3269
|
});
|
|
3276
3270
|
}
|
|
3277
3271
|
);
|
|
3278
|
-
function o(
|
|
3279
|
-
s((
|
|
3280
|
-
...
|
|
3281
|
-
rootState:
|
|
3272
|
+
function o(S) {
|
|
3273
|
+
s((k) => ({
|
|
3274
|
+
...k,
|
|
3275
|
+
rootState: S
|
|
3282
3276
|
}));
|
|
3283
3277
|
}
|
|
3284
3278
|
const [i, a] = useState(
|
|
@@ -3286,11 +3280,11 @@ function ContentComponent(e) {
|
|
|
3286
3280
|
...getDefaultRegisteredComponents(),
|
|
3287
3281
|
...e.customComponents || []
|
|
3288
3282
|
].reduce(
|
|
3289
|
-
(
|
|
3290
|
-
...
|
|
3291
|
-
[
|
|
3292
|
-
component:
|
|
3293
|
-
...serializeComponentInfo(
|
|
3283
|
+
(S, { component: k, ...T }) => ({
|
|
3284
|
+
...S,
|
|
3285
|
+
[T.name]: {
|
|
3286
|
+
component: k,
|
|
3287
|
+
...serializeComponentInfo(T)
|
|
3294
3288
|
}
|
|
3295
3289
|
}),
|
|
3296
3290
|
{}
|
|
@@ -3314,9 +3308,9 @@ function ContentComponent(e) {
|
|
|
3314
3308
|
...getDefaultRegisteredComponents(),
|
|
3315
3309
|
...e.customComponents || []
|
|
3316
3310
|
].reduce(
|
|
3317
|
-
(
|
|
3318
|
-
...
|
|
3319
|
-
[
|
|
3311
|
+
(S, { component: k, ...T }) => ({
|
|
3312
|
+
...S,
|
|
3313
|
+
[T.name]: serializeComponentInfo(T)
|
|
3320
3314
|
}),
|
|
3321
3315
|
{}
|
|
3322
3316
|
),
|
|
@@ -3356,13 +3350,13 @@ function ContentComponent(e) {
|
|
|
3356
3350
|
isNestedRender: e.isNestedRender,
|
|
3357
3351
|
contentId: (c = r.content) == null ? void 0 : c.id,
|
|
3358
3352
|
cssCode: (d = (l = r.content) == null ? void 0 : l.data) == null ? void 0 : d.cssCode,
|
|
3359
|
-
customFonts: (
|
|
3353
|
+
customFonts: (g = (m = r.content) == null ? void 0 : m.data) == null ? void 0 : g.customFonts
|
|
3360
3354
|
}
|
|
3361
3355
|
),
|
|
3362
3356
|
/* @__PURE__ */ jsx(
|
|
3363
3357
|
Blocks,
|
|
3364
3358
|
{
|
|
3365
|
-
blocks: (
|
|
3359
|
+
blocks: (y = (b = r.content) == null ? void 0 : b.data) == null ? void 0 : y.blocks,
|
|
3366
3360
|
context: r,
|
|
3367
3361
|
registeredComponents: i,
|
|
3368
3362
|
linkComponent: e.linkComponent
|