@builder.io/sdk-react 1.0.16 → 1.0.17
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 +21 -21
- package/lib/browser/blocks-exports.mjs +497 -506
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/{server-entry-afeff3cb.js → server-entry-064a8b7f.js} +1 -1
- package/lib/browser/{server-entry-11e01841.cjs → server-entry-a7b75909.cjs} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{blocks-a0a9d452.cjs → blocks-1f59d1c0.cjs} +1 -1
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{blocks-8e5cc463.js → blocks-fe027bf7.js} +2 -2
- package/lib/edge/{button-66c46316.cjs → button-36ac5d97.cjs} +1 -1
- package/lib/edge/{button-764707c4.js → button-8fdd068a.js} +2 -2
- package/lib/edge/{columns-0a14db0e.cjs → columns-36bdc015.cjs} +1 -1
- package/lib/edge/{columns-0bdc7586.js → columns-4f789807.js} +3 -3
- package/lib/edge/content-variants-87f99284.cjs +134 -0
- package/lib/edge/{content-variants-db1e0281.js → content-variants-a26825d5.js} +229 -238
- package/lib/edge/{form-7a6f998f.js → form-004ab04e.js} +3 -3
- package/lib/edge/{form-a5d18c89.cjs → form-6b599bb9.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-bbc4d2f3.cjs → get-class-prop-name-522545c4.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-49cbb2c6.js → get-class-prop-name-ee5eac9d.js} +1 -1
- package/lib/edge/{img-c9630f56.js → img-5d36c59d.js} +1 -1
- package/lib/edge/{img-058cb6f0.cjs → img-d311451e.cjs} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-3de90790.js → input-211240f4.js} +1 -1
- package/lib/edge/{input-ceacd029.cjs → input-34a4e538.cjs} +1 -1
- package/lib/edge/{select-df72f987.cjs → select-a425b313.cjs} +1 -1
- package/lib/edge/{select-ee266e60.js → select-e592f42a.js} +1 -1
- package/lib/edge/{server-entry-ef266884.cjs → server-entry-04a076eb.cjs} +1 -1
- package/lib/edge/{server-entry-2b1068fd.js → server-entry-633c4fab.js} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-83d735d6.cjs → slot-1547b467.cjs} +1 -1
- package/lib/edge/{slot-f246e67e.js → slot-20e9bd0c.js} +3 -3
- package/lib/edge/{symbol-991f09b3.cjs → symbol-441a42f8.cjs} +1 -1
- package/lib/edge/{symbol-f68a7357.js → symbol-8aa6a69b.js} +2 -2
- package/lib/node/blocks-exports.cjs +10 -10
- package/lib/node/blocks-exports.mjs +240 -249
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +1 -1
- package/lib/node/{server-entry-a221fe66.js → server-entry-a2617044.js} +1 -1
- package/lib/node/{server-entry-4ba58cf3.cjs → server-entry-e66a06c7.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-c03ec7a1.cjs +0 -134
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var F = (e, t, n) => (
|
|
2
|
+
var N = Object.defineProperty;
|
|
3
|
+
var $ = (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) => ($(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-a2617044.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: i,
|
|
215
215
|
state: c
|
|
216
|
-
}),
|
|
216
|
+
}), u = getIsolateContext(), m = u.global;
|
|
217
217
|
m.setSync("global", m.derefInto()), m.setSync("log", function(...y) {
|
|
218
218
|
console.log(...y);
|
|
219
|
-
}), m.setSync(BUILDER_SET_STATE_NAME, function(y,
|
|
220
|
-
set(r, y,
|
|
221
|
-
}), l.forEach(([y,
|
|
222
|
-
const k = typeof
|
|
219
|
+
}), m.setSync(BUILDER_SET_STATE_NAME, function(y, p) {
|
|
220
|
+
set(r, y, p), a == null || a(r);
|
|
221
|
+
}), l.forEach(([y, p]) => {
|
|
222
|
+
const k = typeof p == "object" ? new s.Reference(
|
|
223
223
|
// workaround: methods with default values for arguments is not being cloned over
|
|
224
224
|
y === "builder" ? {
|
|
225
|
-
...
|
|
226
|
-
getUserAttributes: () =>
|
|
227
|
-
} :
|
|
225
|
+
...p,
|
|
226
|
+
getUserAttributes: () => p.getUserAttributes()
|
|
227
|
+
} : p
|
|
228
228
|
) : null;
|
|
229
229
|
m.setSync(getSyncValName(y), k);
|
|
230
230
|
}), m.setSync(INJECTED_IVM_GLOBAL, s);
|
|
231
231
|
const g = processCode({
|
|
232
232
|
code: e,
|
|
233
233
|
args: l
|
|
234
|
-
}),
|
|
234
|
+
}), h = u.evalSync(g);
|
|
235
235
|
try {
|
|
236
|
-
return JSON.parse(
|
|
236
|
+
return JSON.parse(h);
|
|
237
237
|
} catch {
|
|
238
|
-
return
|
|
238
|
+
return h;
|
|
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 = (i = process.env.NODE_OPTIONS) == null ? void 0 : i.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), P = class P {
|
|
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 P.cache.get(t);
|
|
262
262
|
}
|
|
263
263
|
static setCachedValue(t, n) {
|
|
264
|
-
|
|
264
|
+
P.cache.size > 20 && P.cache.delete(P.cache.keys().next().value), P.cache.set(t, {
|
|
265
265
|
value: n
|
|
266
266
|
});
|
|
267
267
|
}
|
|
268
268
|
};
|
|
269
|
-
F(
|
|
270
|
-
let EvalCache =
|
|
269
|
+
F(P, "cacheLimit", 20), F(P, "cache", /* @__PURE__ */ new Map());
|
|
270
|
+
let EvalCache = P;
|
|
271
271
|
function evaluate({
|
|
272
272
|
code: e,
|
|
273
273
|
context: t,
|
|
@@ -294,15 +294,15 @@ function evaluate({
|
|
|
294
294
|
localState: n
|
|
295
295
|
};
|
|
296
296
|
if (s) {
|
|
297
|
-
const l = EvalCache.getCacheKey(c),
|
|
298
|
-
if (
|
|
299
|
-
return
|
|
297
|
+
const l = EvalCache.getCacheKey(c), u = EvalCache.getCachedValue(l);
|
|
298
|
+
if (u)
|
|
299
|
+
return u.value;
|
|
300
300
|
}
|
|
301
301
|
try {
|
|
302
302
|
const l = chooseBrowserOrServerEval(c);
|
|
303
303
|
if (s) {
|
|
304
|
-
const
|
|
305
|
-
EvalCache.setCachedValue(
|
|
304
|
+
const u = EvalCache.getCacheKey(c);
|
|
305
|
+
EvalCache.setCachedValue(u, l);
|
|
306
306
|
}
|
|
307
307
|
return l;
|
|
308
308
|
} catch (l) {
|
|
@@ -371,8 +371,8 @@ function throttle(e, t, n = {}) {
|
|
|
371
371
|
return function() {
|
|
372
372
|
const l = Date.now();
|
|
373
373
|
!s && n.leading === !1 && (s = l);
|
|
374
|
-
const
|
|
375
|
-
return i = this, o = arguments,
|
|
374
|
+
const u = t - (l - s);
|
|
375
|
+
return i = this, o = arguments, u <= 0 || u > t ? (r && (clearTimeout(r), r = null), s = l, a = e.apply(i, o), r || (i = o = null)) : !r && n.trailing !== !1 && (r = setTimeout(c, u)), a;
|
|
376
376
|
};
|
|
377
377
|
}
|
|
378
378
|
function assign(e, ...t) {
|
|
@@ -469,8 +469,8 @@ function bindScrollInViewAnimation(e) {
|
|
|
469
469
|
const r = throttle(a, 200, {
|
|
470
470
|
leading: !1
|
|
471
471
|
});
|
|
472
|
-
function s(
|
|
473
|
-
const m =
|
|
472
|
+
function s(u) {
|
|
473
|
+
const m = u.getBoundingClientRect(), g = window.innerHeight, y = (e.thresholdPercent || 0) / 100 * g;
|
|
474
474
|
return m.bottom > y && m.top < g - y;
|
|
475
475
|
}
|
|
476
476
|
const c = e.steps[0].styles;
|
|
@@ -658,28 +658,28 @@ function BlockStyles(e) {
|
|
|
658
658
|
shouldEvaluateBindings: !0
|
|
659
659
|
}), o = i.responsiveStyles, a = e.context.content, r = getSizesForBreakpoints(
|
|
660
660
|
((y = a == null ? void 0 : a.meta) == null ? void 0 : y.breakpoints) || {}
|
|
661
|
-
), s = o == null ? void 0 : o.large, c = o == null ? void 0 : o.medium, l = o == null ? void 0 : o.small,
|
|
662
|
-
if (!
|
|
661
|
+
), s = o == null ? void 0 : o.large, c = o == null ? void 0 : o.medium, l = o == null ? void 0 : o.small, u = i.id;
|
|
662
|
+
if (!u)
|
|
663
663
|
return "";
|
|
664
664
|
const m = s ? createCssClass({
|
|
665
|
-
className:
|
|
665
|
+
className: u,
|
|
666
666
|
styles: s
|
|
667
667
|
}) : "", g = c ? createCssClass({
|
|
668
|
-
className:
|
|
668
|
+
className: u,
|
|
669
669
|
styles: c,
|
|
670
670
|
mediaQuery: getMaxWidthQueryForSize(
|
|
671
671
|
"medium",
|
|
672
672
|
r
|
|
673
673
|
)
|
|
674
|
-
}) : "",
|
|
675
|
-
className:
|
|
674
|
+
}) : "", h = l ? createCssClass({
|
|
675
|
+
className: u,
|
|
676
676
|
styles: l,
|
|
677
677
|
mediaQuery: getMaxWidthQueryForSize(
|
|
678
678
|
"small",
|
|
679
679
|
r
|
|
680
680
|
)
|
|
681
681
|
}) : "";
|
|
682
|
-
return [m, g,
|
|
682
|
+
return [m, g, h].join(" ");
|
|
683
683
|
}
|
|
684
684
|
return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { id: "builderio-block", styles: n() }) }) : null });
|
|
685
685
|
}
|
|
@@ -863,7 +863,7 @@ function RepeatedBlock(e) {
|
|
|
863
863
|
) });
|
|
864
864
|
}
|
|
865
865
|
function Block(e) {
|
|
866
|
-
var c, l,
|
|
866
|
+
var c, l, u;
|
|
867
867
|
function t() {
|
|
868
868
|
return getComponent({
|
|
869
869
|
block: e.block,
|
|
@@ -893,28 +893,28 @@ function Block(e) {
|
|
|
893
893
|
return e.block.tagName === "a" || ((g = i().properties) == null ? void 0 : g.href) || i().href ? e.linkComponent || "a" : e.block.tagName || "div";
|
|
894
894
|
}
|
|
895
895
|
function a() {
|
|
896
|
-
var
|
|
897
|
-
if ((
|
|
896
|
+
var h, y;
|
|
897
|
+
if ((h = e.block.repeat) != null && h.collection)
|
|
898
898
|
return !!((y = n == null ? void 0 : n()) != null && y.length);
|
|
899
899
|
const m = "hide" in i() ? i().hide : !1;
|
|
900
900
|
return ("show" in i() ? i().show : !0) && !m;
|
|
901
901
|
}
|
|
902
902
|
function r() {
|
|
903
|
-
var g,
|
|
904
|
-
return !((g = t == null ? void 0 : t()) != null && g.component) && !n() ? (
|
|
903
|
+
var g, h;
|
|
904
|
+
return !((g = t == null ? void 0 : t()) != null && g.component) && !n() ? (h = i().children) != null ? h : [] : [];
|
|
905
905
|
}
|
|
906
906
|
function s() {
|
|
907
|
-
var m, g,
|
|
907
|
+
var m, g, h, y, p, k, T, S, C, E, I;
|
|
908
908
|
return {
|
|
909
909
|
blockChildren: (m = i().children) != null ? m : [],
|
|
910
910
|
componentRef: (g = t == null ? void 0 : t()) == null ? void 0 : g.component,
|
|
911
911
|
componentOptions: {
|
|
912
912
|
...getBlockComponentOptions(i()),
|
|
913
913
|
builderContext: e.context,
|
|
914
|
-
...((
|
|
914
|
+
...((h = t == null ? void 0 : t()) == null ? void 0 : h.name) === "Core:Button" || ((y = t == null ? void 0 : t()) == null ? void 0 : y.name) === "Symbol" || ((p = t == null ? void 0 : t()) == null ? void 0 : p.name) === "Columns" || ((k = t == null ? void 0 : t()) == null ? void 0 : k.name) === "Form:Form" ? {
|
|
915
915
|
builderLinkComponent: e.linkComponent
|
|
916
916
|
} : {},
|
|
917
|
-
...((T = t == null ? void 0 : t()) == null ? void 0 : T.name) === "Symbol" || ((
|
|
917
|
+
...((T = t == null ? void 0 : t()) == null ? void 0 : T.name) === "Symbol" || ((S = t == null ? void 0 : t()) == null ? void 0 : S.name) === "Columns" || ((C = t == null ? void 0 : t()) == null ? void 0 : C.name) === "Form:Form" ? {
|
|
918
918
|
builderComponents: e.registeredComponents
|
|
919
919
|
} : {}
|
|
920
920
|
},
|
|
@@ -929,8 +929,8 @@ function Block(e) {
|
|
|
929
929
|
return useEffect(() => {
|
|
930
930
|
const m = i().id, g = i().animations;
|
|
931
931
|
g && m && bindAnimations(
|
|
932
|
-
g.filter((
|
|
933
|
-
...
|
|
932
|
+
g.filter((h) => h.trigger !== "hover").map((h) => ({
|
|
933
|
+
...h,
|
|
934
934
|
elementId: m
|
|
935
935
|
}))
|
|
936
936
|
);
|
|
@@ -949,7 +949,7 @@ function Block(e) {
|
|
|
949
949
|
includeBlockProps: s().includeBlockProps,
|
|
950
950
|
isInteractive: s().isInteractive
|
|
951
951
|
}
|
|
952
|
-
) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (
|
|
952
|
+
) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (u = n()) == null ? void 0 : u.map((m, g) => /* @__PURE__ */ jsx(
|
|
953
953
|
RepeatedBlock,
|
|
954
954
|
{
|
|
955
955
|
repeatContext: m.context,
|
|
@@ -1080,30 +1080,30 @@ function Columns(e) {
|
|
|
1080
1080
|
), [i, o] = useState(() => e.columns || []), [a, r] = useState(
|
|
1081
1081
|
() => e.stackColumnsAt || "tablet"
|
|
1082
1082
|
);
|
|
1083
|
-
function s(
|
|
1083
|
+
function s(S) {
|
|
1084
1084
|
var C;
|
|
1085
|
-
return ((C = i[
|
|
1085
|
+
return ((C = i[S]) == null ? void 0 : C.width) || 100 / i.length;
|
|
1086
1086
|
}
|
|
1087
|
-
function c(
|
|
1087
|
+
function c(S) {
|
|
1088
1088
|
const C = t * (i.length - 1) / i.length;
|
|
1089
|
-
return `calc(${s(
|
|
1089
|
+
return `calc(${s(S)}% - ${C}px)`;
|
|
1090
1090
|
}
|
|
1091
1091
|
function l({
|
|
1092
|
-
stackedStyle:
|
|
1092
|
+
stackedStyle: S,
|
|
1093
1093
|
desktopStyle: C
|
|
1094
1094
|
}) {
|
|
1095
|
-
return a === "tablet" ?
|
|
1095
|
+
return a === "tablet" ? S : C;
|
|
1096
1096
|
}
|
|
1097
|
-
function
|
|
1098
|
-
stackedStyle:
|
|
1097
|
+
function u({
|
|
1098
|
+
stackedStyle: S,
|
|
1099
1099
|
desktopStyle: C
|
|
1100
1100
|
}) {
|
|
1101
|
-
return a === "never" ? C :
|
|
1101
|
+
return a === "never" ? C : S;
|
|
1102
1102
|
}
|
|
1103
1103
|
const [m, g] = useState(
|
|
1104
1104
|
() => e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column"
|
|
1105
1105
|
);
|
|
1106
|
-
function
|
|
1106
|
+
function h() {
|
|
1107
1107
|
return {
|
|
1108
1108
|
"--flex-dir": m,
|
|
1109
1109
|
"--flex-dir-tablet": l({
|
|
@@ -1112,8 +1112,8 @@ function Columns(e) {
|
|
|
1112
1112
|
})
|
|
1113
1113
|
};
|
|
1114
1114
|
}
|
|
1115
|
-
function y(
|
|
1116
|
-
const C =
|
|
1115
|
+
function y(S) {
|
|
1116
|
+
const C = S === 0 ? 0 : t, E = c(S), I = `${C}px`, B = "100%", j = 0;
|
|
1117
1117
|
return {
|
|
1118
1118
|
...{
|
|
1119
1119
|
display: "flex",
|
|
@@ -1122,33 +1122,33 @@ function Columns(e) {
|
|
|
1122
1122
|
},
|
|
1123
1123
|
width: E,
|
|
1124
1124
|
["marginLeft"]: I,
|
|
1125
|
-
"--column-width-mobile":
|
|
1126
|
-
stackedStyle:
|
|
1125
|
+
"--column-width-mobile": u({
|
|
1126
|
+
stackedStyle: B,
|
|
1127
1127
|
desktopStyle: E
|
|
1128
1128
|
}),
|
|
1129
|
-
"--column-margin-left-mobile":
|
|
1130
|
-
stackedStyle:
|
|
1129
|
+
"--column-margin-left-mobile": u({
|
|
1130
|
+
stackedStyle: j,
|
|
1131
1131
|
desktopStyle: I
|
|
1132
1132
|
}),
|
|
1133
1133
|
"--column-width-tablet": l({
|
|
1134
|
-
stackedStyle:
|
|
1134
|
+
stackedStyle: B,
|
|
1135
1135
|
desktopStyle: E
|
|
1136
1136
|
}),
|
|
1137
1137
|
"--column-margin-left-tablet": l({
|
|
1138
|
-
stackedStyle:
|
|
1138
|
+
stackedStyle: j,
|
|
1139
1139
|
desktopStyle: I
|
|
1140
1140
|
})
|
|
1141
1141
|
};
|
|
1142
1142
|
}
|
|
1143
|
-
function S
|
|
1143
|
+
function p(S) {
|
|
1144
1144
|
var E, I;
|
|
1145
1145
|
return getSizesForBreakpoints(
|
|
1146
1146
|
((I = (E = e.builderContext.content) == null ? void 0 : E.meta) == null ? void 0 : I.breakpoints) || {}
|
|
1147
|
-
)[
|
|
1147
|
+
)[S].max;
|
|
1148
1148
|
}
|
|
1149
1149
|
function k() {
|
|
1150
1150
|
return `
|
|
1151
|
-
@media (max-width: ${
|
|
1151
|
+
@media (max-width: ${p("medium")}px) {
|
|
1152
1152
|
.${e.builderBlock.id}-breakpoints {
|
|
1153
1153
|
flex-direction: var(--flex-dir-tablet);
|
|
1154
1154
|
align-items: stretch;
|
|
@@ -1160,7 +1160,7 @@ function Columns(e) {
|
|
|
1160
1160
|
}
|
|
1161
1161
|
}
|
|
1162
1162
|
|
|
1163
|
-
@media (max-width: ${
|
|
1163
|
+
@media (max-width: ${p("small")}px) {
|
|
1164
1164
|
.${e.builderBlock.id}-breakpoints {
|
|
1165
1165
|
flex-direction: var(--flex-dir);
|
|
1166
1166
|
align-items: stretch;
|
|
@@ -1178,17 +1178,17 @@ function Columns(e) {
|
|
|
1178
1178
|
"div",
|
|
1179
1179
|
{
|
|
1180
1180
|
className: `builder-columns ${e.builderBlock.id}-breakpoints div-003f4b1c`,
|
|
1181
|
-
style:
|
|
1181
|
+
style: h(),
|
|
1182
1182
|
children: [
|
|
1183
1183
|
/* @__PURE__ */ jsx(InlinedStyles, { id: "builderio-columns", styles: k() }),
|
|
1184
|
-
(T = e.columns) == null ? void 0 : T.map((
|
|
1184
|
+
(T = e.columns) == null ? void 0 : T.map((S, C) => /* @__PURE__ */ jsx(
|
|
1185
1185
|
DynamicRenderer,
|
|
1186
1186
|
{
|
|
1187
|
-
TagName:
|
|
1187
|
+
TagName: S.link ? e.builderLinkComponent || "a" : "div",
|
|
1188
1188
|
actionAttributes: {},
|
|
1189
1189
|
attributes: {
|
|
1190
|
-
...
|
|
1191
|
-
href:
|
|
1190
|
+
...S.link ? {
|
|
1191
|
+
href: S.link
|
|
1192
1192
|
} : {},
|
|
1193
1193
|
[getClassPropName()]: "builder-column",
|
|
1194
1194
|
style: mapStyleObjToStrIfNeeded(y(C))
|
|
@@ -1204,7 +1204,7 @@ function Columns(e) {
|
|
|
1204
1204
|
context: e.builderContext,
|
|
1205
1205
|
registeredComponents: e.builderComponents,
|
|
1206
1206
|
linkComponent: e.builderLinkComponent,
|
|
1207
|
-
blocks:
|
|
1207
|
+
blocks: S.blocks
|
|
1208
1208
|
}
|
|
1209
1209
|
)
|
|
1210
1210
|
},
|
|
@@ -1255,13 +1255,13 @@ function getSrcSet(e) {
|
|
|
1255
1255
|
function Image(e) {
|
|
1256
1256
|
var o, a, r, s;
|
|
1257
1257
|
function t() {
|
|
1258
|
-
var
|
|
1258
|
+
var u;
|
|
1259
1259
|
const l = e.image || e.src;
|
|
1260
1260
|
if (!l || // We can auto add srcset for cdn.builder.io and shopify
|
|
1261
1261
|
// images, otherwise you can supply this prop manually
|
|
1262
1262
|
!(l.match(/builder\.io/) || l.match(/cdn\.shopify\.com/)))
|
|
1263
1263
|
return e.srcset;
|
|
1264
|
-
if (e.srcset && ((
|
|
1264
|
+
if (e.srcset && ((u = e.image) != null && u.includes("builder.io/api/v1/image"))) {
|
|
1265
1265
|
if (!e.srcset.includes(e.image.split("?")[0]))
|
|
1266
1266
|
return console.debug("Removed given srcset"), getSrcSet(l);
|
|
1267
1267
|
} else if (e.image && !e.srcset)
|
|
@@ -1618,13 +1618,13 @@ const componentInfo$f = {
|
|
|
1618
1618
|
e.delete("srcset"), e.delete("noWebp");
|
|
1619
1619
|
function n(r, s = 6e4) {
|
|
1620
1620
|
return new Promise((c, l) => {
|
|
1621
|
-
const
|
|
1621
|
+
const u = document.createElement("img");
|
|
1622
1622
|
let m = !1;
|
|
1623
|
-
|
|
1624
|
-
m = !0, c(
|
|
1625
|
-
},
|
|
1623
|
+
u.onload = () => {
|
|
1624
|
+
m = !0, c(u);
|
|
1625
|
+
}, u.addEventListener("error", (g) => {
|
|
1626
1626
|
console.warn("Image load failed", g.error), l(g.error);
|
|
1627
|
-
}),
|
|
1627
|
+
}), u.src = r, setTimeout(() => {
|
|
1628
1628
|
m || l(new Error("Image load timed out"));
|
|
1629
1629
|
}, s);
|
|
1630
1630
|
});
|
|
@@ -1873,8 +1873,8 @@ function CustomCode(e) {
|
|
|
1873
1873
|
if (n.includes(l.src))
|
|
1874
1874
|
continue;
|
|
1875
1875
|
n.push(l.src);
|
|
1876
|
-
const
|
|
1877
|
-
|
|
1876
|
+
const u = document.createElement("script");
|
|
1877
|
+
u.async = !0, u.src = l.src, document.head.appendChild(u);
|
|
1878
1878
|
} else if (!l.type || [
|
|
1879
1879
|
"text/javascript",
|
|
1880
1880
|
"application/javascript",
|
|
@@ -1884,8 +1884,8 @@ function CustomCode(e) {
|
|
|
1884
1884
|
continue;
|
|
1885
1885
|
try {
|
|
1886
1886
|
o.push(l.innerText), new Function(l.innerText)();
|
|
1887
|
-
} catch (
|
|
1888
|
-
console.warn("`CustomCode`: Error running script:",
|
|
1887
|
+
} catch (u) {
|
|
1888
|
+
console.warn("`CustomCode`: Error running script:", u);
|
|
1889
1889
|
}
|
|
1890
1890
|
}
|
|
1891
1891
|
}
|
|
@@ -1930,8 +1930,8 @@ function Embed(e) {
|
|
|
1930
1930
|
if (!t.current || !t.current.getElementsByTagName)
|
|
1931
1931
|
return;
|
|
1932
1932
|
const l = t.current.getElementsByTagName("script");
|
|
1933
|
-
for (let
|
|
1934
|
-
const m = l[
|
|
1933
|
+
for (let u = 0; u < l.length; u++) {
|
|
1934
|
+
const m = l[u];
|
|
1935
1935
|
if (m.src && !n.includes(m.src)) {
|
|
1936
1936
|
n.push(m.src);
|
|
1937
1937
|
const g = document.createElement("script");
|
|
@@ -2196,110 +2196,110 @@ const componentInfo$5 = {
|
|
|
2196
2196
|
function FormComponent(e) {
|
|
2197
2197
|
var m, g;
|
|
2198
2198
|
const t = useRef(null), [n, i] = useState(() => "unsubmitted"), [o, a] = useState(() => null), [r, s] = useState(() => "");
|
|
2199
|
-
function c(
|
|
2200
|
-
var
|
|
2199
|
+
function c(h) {
|
|
2200
|
+
var p, k;
|
|
2201
2201
|
const y = {
|
|
2202
2202
|
...e.builderContext.rootState,
|
|
2203
|
-
...
|
|
2203
|
+
...h
|
|
2204
2204
|
};
|
|
2205
|
-
e.builderContext.rootSetState ? (k = (
|
|
2205
|
+
e.builderContext.rootSetState ? (k = (p = e.builderContext).rootSetState) == null || k.call(p, y) : e.builderContext.rootState = y;
|
|
2206
2206
|
}
|
|
2207
2207
|
function l() {
|
|
2208
2208
|
return isEditing() && e.previewState || n;
|
|
2209
2209
|
}
|
|
2210
|
-
function
|
|
2211
|
-
var
|
|
2210
|
+
function u(h) {
|
|
2211
|
+
var p;
|
|
2212
2212
|
const y = e.sendWithJs || e.sendSubmissionsTo === "email";
|
|
2213
2213
|
if (e.sendSubmissionsTo === "zapier")
|
|
2214
|
-
|
|
2214
|
+
h.preventDefault();
|
|
2215
2215
|
else if (y) {
|
|
2216
2216
|
if (!(e.action || e.sendSubmissionsTo === "email")) {
|
|
2217
|
-
|
|
2217
|
+
h.preventDefault();
|
|
2218
2218
|
return;
|
|
2219
2219
|
}
|
|
2220
|
-
|
|
2221
|
-
const k =
|
|
2222
|
-
let
|
|
2220
|
+
h.preventDefault();
|
|
2221
|
+
const k = h.currentTarget, T = e.customHeaders || {};
|
|
2222
|
+
let S;
|
|
2223
2223
|
const C = new FormData(k), E = Array.from(
|
|
2224
|
-
|
|
2225
|
-
).filter((
|
|
2224
|
+
h.currentTarget.querySelectorAll("input,select,textarea")
|
|
2225
|
+
).filter((d) => !!d.name).map((d) => {
|
|
2226
2226
|
let f;
|
|
2227
|
-
const
|
|
2228
|
-
if (
|
|
2229
|
-
if (
|
|
2230
|
-
if (
|
|
2231
|
-
return f =
|
|
2232
|
-
key:
|
|
2227
|
+
const v = d.name;
|
|
2228
|
+
if (d instanceof HTMLInputElement)
|
|
2229
|
+
if (d.type === "radio") {
|
|
2230
|
+
if (d.checked)
|
|
2231
|
+
return f = d.name, {
|
|
2232
|
+
key: v,
|
|
2233
2233
|
value: f
|
|
2234
2234
|
};
|
|
2235
|
-
} else if (
|
|
2236
|
-
f =
|
|
2237
|
-
else if (
|
|
2238
|
-
const
|
|
2239
|
-
isNaN(
|
|
2235
|
+
} else if (d.type === "checkbox")
|
|
2236
|
+
f = d.checked;
|
|
2237
|
+
else if (d.type === "number" || d.type === "range") {
|
|
2238
|
+
const b = d.valueAsNumber;
|
|
2239
|
+
isNaN(b) || (f = b);
|
|
2240
2240
|
} else
|
|
2241
|
-
|
|
2241
|
+
d.type === "file" ? f = d.files : f = d.value;
|
|
2242
2242
|
else
|
|
2243
|
-
f =
|
|
2243
|
+
f = d.value;
|
|
2244
2244
|
return {
|
|
2245
|
-
key:
|
|
2245
|
+
key: v,
|
|
2246
2246
|
value: f
|
|
2247
2247
|
};
|
|
2248
2248
|
});
|
|
2249
2249
|
let I = e.contentType;
|
|
2250
|
-
if (e.sendSubmissionsTo === "email" && (I = "multipart/form-data"), Array.from(E).forEach(({ value:
|
|
2251
|
-
(
|
|
2250
|
+
if (e.sendSubmissionsTo === "email" && (I = "multipart/form-data"), Array.from(E).forEach(({ value: d }) => {
|
|
2251
|
+
(d instanceof File || Array.isArray(d) && d[0] instanceof File || d instanceof FileList) && (I = "multipart/form-data");
|
|
2252
2252
|
}), I !== "application/json")
|
|
2253
|
-
|
|
2253
|
+
S = C;
|
|
2254
2254
|
else {
|
|
2255
|
-
const
|
|
2256
|
-
Array.from(E).forEach(({ value: f, key:
|
|
2257
|
-
set(
|
|
2258
|
-
}),
|
|
2255
|
+
const d = {};
|
|
2256
|
+
Array.from(E).forEach(({ value: f, key: v }) => {
|
|
2257
|
+
set(d, v, f);
|
|
2258
|
+
}), S = JSON.stringify(d);
|
|
2259
2259
|
}
|
|
2260
|
-
I && I !== "multipart/form-data" && (y && ((
|
|
2261
|
-
const
|
|
2262
|
-
if (t.current && (t.current.dispatchEvent(
|
|
2260
|
+
I && I !== "multipart/form-data" && (y && ((p = e.action) != null && p.includes("zapier.com")) || (T["content-type"] = I));
|
|
2261
|
+
const B = new CustomEvent("presubmit", { detail: { body: S } });
|
|
2262
|
+
if (t.current && (t.current.dispatchEvent(B), B.defaultPrevented))
|
|
2263
2263
|
return;
|
|
2264
2264
|
i("sending");
|
|
2265
|
-
const
|
|
2265
|
+
const j = `${getEnv() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(
|
|
2266
2266
|
e.sendSubmissionsToEmail || ""
|
|
2267
2267
|
)}&name=${encodeURIComponent(e.name || "")}`;
|
|
2268
2268
|
fetch(
|
|
2269
|
-
e.sendSubmissionsTo === "email" ?
|
|
2270
|
-
{ body:
|
|
2269
|
+
e.sendSubmissionsTo === "email" ? j : e.action,
|
|
2270
|
+
{ body: S, headers: T, method: e.method || "post" }
|
|
2271
2271
|
).then(
|
|
2272
|
-
async (
|
|
2272
|
+
async (d) => {
|
|
2273
2273
|
let f;
|
|
2274
|
-
const
|
|
2275
|
-
if (
|
|
2276
|
-
let
|
|
2277
|
-
|
|
2274
|
+
const v = d.headers.get("content-type");
|
|
2275
|
+
if (v && v.indexOf("application/json") !== -1 ? f = await d.json() : f = await d.text(), !d.ok && e.errorMessagePath) {
|
|
2276
|
+
let b = get(f, e.errorMessagePath);
|
|
2277
|
+
b && (typeof b != "string" && (b = JSON.stringify(b)), s(b), c({ formErrorMessage: b }));
|
|
2278
2278
|
}
|
|
2279
|
-
if (a(f), i(
|
|
2280
|
-
const
|
|
2281
|
-
detail: { res:
|
|
2279
|
+
if (a(f), i(d.ok ? "success" : "error"), d.ok) {
|
|
2280
|
+
const b = new CustomEvent("submit:success", {
|
|
2281
|
+
detail: { res: d, body: f }
|
|
2282
2282
|
});
|
|
2283
2283
|
if (t.current) {
|
|
2284
|
-
if (t.current.dispatchEvent(
|
|
2284
|
+
if (t.current.dispatchEvent(b), b.defaultPrevented)
|
|
2285
2285
|
return;
|
|
2286
2286
|
e.resetFormOnSubmit !== !1 && t.current.reset();
|
|
2287
2287
|
}
|
|
2288
2288
|
if (e.successUrl)
|
|
2289
2289
|
if (t.current) {
|
|
2290
|
-
const
|
|
2290
|
+
const x = new CustomEvent("route", {
|
|
2291
2291
|
detail: { url: e.successUrl }
|
|
2292
2292
|
});
|
|
2293
|
-
t.current.dispatchEvent(
|
|
2293
|
+
t.current.dispatchEvent(x), x.defaultPrevented || (location.href = e.successUrl);
|
|
2294
2294
|
} else
|
|
2295
2295
|
location.href = e.successUrl;
|
|
2296
2296
|
}
|
|
2297
2297
|
},
|
|
2298
|
-
(
|
|
2298
|
+
(d) => {
|
|
2299
2299
|
const f = new CustomEvent("submit:error", {
|
|
2300
|
-
detail: { error:
|
|
2300
|
+
detail: { error: d }
|
|
2301
2301
|
});
|
|
2302
|
-
t.current && (t.current.dispatchEvent(f), f.defaultPrevented) || (a(
|
|
2302
|
+
t.current && (t.current.dispatchEvent(f), f.defaultPrevented) || (a(d), i("error"));
|
|
2303
2303
|
}
|
|
2304
2304
|
);
|
|
2305
2305
|
}
|
|
@@ -2314,13 +2314,13 @@ function FormComponent(e) {
|
|
|
2314
2314
|
action: !e.sendWithJs && e.action,
|
|
2315
2315
|
method: e.method,
|
|
2316
2316
|
name: e.name,
|
|
2317
|
-
onSubmit: (
|
|
2317
|
+
onSubmit: (h) => u(h),
|
|
2318
2318
|
...e.attributes,
|
|
2319
2319
|
children: [
|
|
2320
|
-
e.builderBlock && e.builderBlock.children ? /* @__PURE__ */ jsx(Fragment, { children: (g = (m = e.builderBlock) == null ? void 0 : m.children) == null ? void 0 : g.map((
|
|
2320
|
+
e.builderBlock && e.builderBlock.children ? /* @__PURE__ */ jsx(Fragment, { children: (g = (m = e.builderBlock) == null ? void 0 : m.children) == null ? void 0 : g.map((h, y) => /* @__PURE__ */ jsx(
|
|
2321
2321
|
Block,
|
|
2322
2322
|
{
|
|
2323
|
-
block:
|
|
2323
|
+
block: h,
|
|
2324
2324
|
context: e.builderContext,
|
|
2325
2325
|
registeredComponents: e.builderComponents,
|
|
2326
2326
|
linkComponent: e.builderLinkComponent
|
|
@@ -2936,53 +2936,53 @@ const findParentElement = (e, t, n = !0) => {
|
|
|
2936
2936
|
};
|
|
2937
2937
|
};
|
|
2938
2938
|
function EnableEditor(e) {
|
|
2939
|
-
var T,
|
|
2939
|
+
var T, S, C, E, I, B, j;
|
|
2940
2940
|
const t = useRef(null);
|
|
2941
|
-
function n(
|
|
2942
|
-
var
|
|
2941
|
+
function n(d) {
|
|
2942
|
+
var v, b;
|
|
2943
2943
|
const f = {
|
|
2944
2944
|
...e.builderContextSignal.rootState,
|
|
2945
|
-
...
|
|
2945
|
+
...d
|
|
2946
2946
|
};
|
|
2947
|
-
e.builderContextSignal.rootSetState ? (
|
|
2948
|
-
...
|
|
2947
|
+
e.builderContextSignal.rootSetState ? (b = (v = e.builderContextSignal).rootSetState) == null || b.call(v, f) : e.setBuilderContextSignal((x) => ({
|
|
2948
|
+
...x,
|
|
2949
2949
|
rootState: f
|
|
2950
2950
|
}));
|
|
2951
2951
|
}
|
|
2952
|
-
function i(
|
|
2953
|
-
var
|
|
2952
|
+
function i(d) {
|
|
2953
|
+
var v, b, x, w, A;
|
|
2954
2954
|
const f = {
|
|
2955
2955
|
...e.builderContextSignal.content,
|
|
2956
|
-
...
|
|
2956
|
+
...d,
|
|
2957
2957
|
data: {
|
|
2958
|
-
...(
|
|
2959
|
-
...
|
|
2958
|
+
...(v = e.builderContextSignal.content) == null ? void 0 : v.data,
|
|
2959
|
+
...d == null ? void 0 : d.data
|
|
2960
2960
|
},
|
|
2961
2961
|
meta: {
|
|
2962
|
-
...(
|
|
2963
|
-
...
|
|
2964
|
-
breakpoints: ((
|
|
2962
|
+
...(b = e.builderContextSignal.content) == null ? void 0 : b.meta,
|
|
2963
|
+
...d == null ? void 0 : d.meta,
|
|
2964
|
+
breakpoints: ((x = d == null ? void 0 : d.meta) == null ? void 0 : x.breakpoints) || ((A = (w = e.builderContextSignal.content) == null ? void 0 : w.meta) == null ? void 0 : A.breakpoints)
|
|
2965
2965
|
}
|
|
2966
2966
|
};
|
|
2967
|
-
e.setBuilderContextSignal((
|
|
2968
|
-
...
|
|
2967
|
+
e.setBuilderContextSignal((R) => ({
|
|
2968
|
+
...R,
|
|
2969
2969
|
content: f
|
|
2970
2970
|
}));
|
|
2971
2971
|
}
|
|
2972
2972
|
const [o, a] = useState(
|
|
2973
2973
|
() => e.contentWrapper || "div"
|
|
2974
2974
|
);
|
|
2975
|
-
function r(
|
|
2975
|
+
function r(d) {
|
|
2976
2976
|
return createEditorListener({
|
|
2977
2977
|
model: e.model,
|
|
2978
2978
|
trustedHosts: e.trustedHosts,
|
|
2979
2979
|
callbacks: {
|
|
2980
2980
|
configureSdk: (f) => {
|
|
2981
|
-
var
|
|
2982
|
-
const { breakpoints:
|
|
2983
|
-
!
|
|
2981
|
+
var x;
|
|
2982
|
+
const { breakpoints: v, contentId: b } = f;
|
|
2983
|
+
!b || b !== ((x = e.builderContextSignal.content) == null ? void 0 : x.id) || v && i({
|
|
2984
2984
|
meta: {
|
|
2985
|
-
breakpoints:
|
|
2985
|
+
breakpoints: v
|
|
2986
2986
|
}
|
|
2987
2987
|
});
|
|
2988
2988
|
},
|
|
@@ -2993,13 +2993,13 @@ function EnableEditor(e) {
|
|
|
2993
2993
|
i(f);
|
|
2994
2994
|
}
|
|
2995
2995
|
}
|
|
2996
|
-
})(
|
|
2996
|
+
})(d);
|
|
2997
2997
|
}
|
|
2998
2998
|
function s() {
|
|
2999
|
-
var f,
|
|
3000
|
-
const
|
|
3001
|
-
|
|
3002
|
-
code:
|
|
2999
|
+
var f, v;
|
|
3000
|
+
const d = (v = (f = e.builderContextSignal.content) == null ? void 0 : f.data) == null ? void 0 : v.jsCode;
|
|
3001
|
+
d && evaluate({
|
|
3002
|
+
code: d,
|
|
3003
3003
|
context: e.context || {},
|
|
3004
3004
|
localState: void 0,
|
|
3005
3005
|
rootState: e.builderContextSignal.rootState,
|
|
@@ -3010,61 +3010,52 @@ function EnableEditor(e) {
|
|
|
3010
3010
|
enableCache: !1
|
|
3011
3011
|
});
|
|
3012
3012
|
}
|
|
3013
|
-
const [c, l] = useState(() => ({})), [
|
|
3014
|
-
function
|
|
3015
|
-
var f,
|
|
3013
|
+
const [c, l] = useState(() => ({})), [u, m] = useState(() => ({})), [g, h] = useState(() => !1);
|
|
3014
|
+
function y(d) {
|
|
3015
|
+
var f, v;
|
|
3016
3016
|
if (e.builderContextSignal.content) {
|
|
3017
|
-
const
|
|
3017
|
+
const b = (f = e.builderContextSignal.content) == null ? void 0 : f.testVariationId, x = (v = e.builderContextSignal.content) == null ? void 0 : v.id;
|
|
3018
3018
|
_track({
|
|
3019
3019
|
type: "click",
|
|
3020
3020
|
canTrack: getDefaultCanTrack(e.canTrack),
|
|
3021
|
-
contentId:
|
|
3021
|
+
contentId: x,
|
|
3022
3022
|
apiKey: e.apiKey,
|
|
3023
|
-
variationId:
|
|
3024
|
-
...getInteractionPropertiesForEvent(
|
|
3025
|
-
unique: !
|
|
3023
|
+
variationId: b !== x ? b : void 0,
|
|
3024
|
+
...getInteractionPropertiesForEvent(d),
|
|
3025
|
+
unique: !g
|
|
3026
3026
|
});
|
|
3027
3027
|
}
|
|
3028
|
-
|
|
3029
|
-
}
|
|
3030
|
-
function b(u) {
|
|
3031
|
-
return u.replace(
|
|
3032
|
-
/{{([^}]+)}}/g,
|
|
3033
|
-
(f, p) => String(
|
|
3034
|
-
evaluate({
|
|
3035
|
-
code: p,
|
|
3036
|
-
context: e.context || {},
|
|
3037
|
-
localState: void 0,
|
|
3038
|
-
rootState: e.builderContextSignal.rootState,
|
|
3039
|
-
rootSetState: e.builderContextSignal.rootSetState,
|
|
3040
|
-
enableCache: !0
|
|
3041
|
-
})
|
|
3042
|
-
)
|
|
3043
|
-
);
|
|
3028
|
+
g || h(!0);
|
|
3044
3029
|
}
|
|
3045
|
-
function
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3030
|
+
function p() {
|
|
3031
|
+
var f, v, b;
|
|
3032
|
+
const d = (b = (v = (f = e.builderContextSignal.content) == null ? void 0 : f.data) == null ? void 0 : v.httpRequests) != null ? b : {};
|
|
3033
|
+
Object.entries(d).forEach(([x, w]) => {
|
|
3034
|
+
if (!w || u[x] || c[x] && !isEditing())
|
|
3035
|
+
return;
|
|
3036
|
+
u[x] = !0;
|
|
3037
|
+
const A = w.replace(
|
|
3038
|
+
/{{([^}]+)}}/g,
|
|
3039
|
+
(R, V) => String(
|
|
3040
|
+
evaluate({
|
|
3041
|
+
code: V,
|
|
3042
|
+
context: e.context || {},
|
|
3043
|
+
localState: void 0,
|
|
3044
|
+
rootState: e.builderContextSignal.rootState,
|
|
3045
|
+
rootSetState: e.builderContextSignal.rootSetState,
|
|
3046
|
+
enableCache: !0
|
|
3047
|
+
})
|
|
3048
|
+
)
|
|
3049
|
+
);
|
|
3050
|
+
fetch$1(A).then((R) => R.json()).then((R) => {
|
|
3051
|
+
n({
|
|
3052
|
+
[x]: R
|
|
3053
|
+
}), c[x] = !0;
|
|
3054
|
+
}).catch((R) => {
|
|
3055
|
+
console.error("error fetching dynamic data", w, R);
|
|
3056
|
+
}).finally(() => {
|
|
3057
|
+
u[x] = !1;
|
|
3058
|
+
});
|
|
3068
3059
|
});
|
|
3069
3060
|
}
|
|
3070
3061
|
function k() {
|
|
@@ -3083,7 +3074,7 @@ function EnableEditor(e) {
|
|
|
3083
3074
|
);
|
|
3084
3075
|
}
|
|
3085
3076
|
return useEffect(() => {
|
|
3086
|
-
var
|
|
3077
|
+
var d, f;
|
|
3087
3078
|
if (isBrowser()) {
|
|
3088
3079
|
if (isEditing() && (window.addEventListener("message", r), registerInsertMenu(), setupBrowserForEditing({
|
|
3089
3080
|
...e.locale ? {
|
|
@@ -3097,46 +3088,46 @@ function EnableEditor(e) {
|
|
|
3097
3088
|
} : {}
|
|
3098
3089
|
}), Object.values(
|
|
3099
3090
|
e.builderContextSignal.componentInfos
|
|
3100
|
-
).forEach((
|
|
3091
|
+
).forEach((b) => {
|
|
3101
3092
|
var w;
|
|
3102
|
-
const
|
|
3103
|
-
(w = window.parent) == null || w.postMessage(
|
|
3093
|
+
const x = createRegisterComponentMessage(b);
|
|
3094
|
+
(w = window.parent) == null || w.postMessage(x, "*");
|
|
3104
3095
|
}), window.addEventListener(
|
|
3105
3096
|
"builder:component:stateChangeListenerActivated",
|
|
3106
3097
|
k
|
|
3107
3098
|
)), e.builderContextSignal.content && getDefaultCanTrack(e.canTrack)) {
|
|
3108
|
-
const
|
|
3099
|
+
const b = (d = e.builderContextSignal.content) == null ? void 0 : d.testVariationId, x = (f = e.builderContextSignal.content) == null ? void 0 : f.id, w = e.apiKey;
|
|
3109
3100
|
_track({
|
|
3110
3101
|
type: "impression",
|
|
3111
3102
|
canTrack: !0,
|
|
3112
|
-
contentId:
|
|
3103
|
+
contentId: x,
|
|
3113
3104
|
apiKey: w,
|
|
3114
|
-
variationId:
|
|
3105
|
+
variationId: b !== x ? b : void 0
|
|
3115
3106
|
});
|
|
3116
3107
|
}
|
|
3117
3108
|
if (isPreviewing()) {
|
|
3118
|
-
const
|
|
3119
|
-
`builder.preview.${
|
|
3120
|
-
),
|
|
3121
|
-
|
|
3109
|
+
const b = new URL(location.href).searchParams, x = b.get("builder.preview"), w = b.get(
|
|
3110
|
+
`builder.preview.${x}`
|
|
3111
|
+
), A = b.get("apiKey") || b.get("builder.space");
|
|
3112
|
+
x === e.model && A === e.apiKey && (!e.content || w === e.content.id) && fetchOneEntry({
|
|
3122
3113
|
model: e.model,
|
|
3123
3114
|
apiKey: e.apiKey,
|
|
3124
3115
|
apiVersion: e.builderContextSignal.apiVersion
|
|
3125
|
-
}).then((
|
|
3126
|
-
|
|
3116
|
+
}).then((R) => {
|
|
3117
|
+
R && i(R);
|
|
3127
3118
|
});
|
|
3128
3119
|
}
|
|
3129
3120
|
}
|
|
3130
3121
|
}, []), useEffect(() => {
|
|
3131
3122
|
e.apiKey || logger.error(
|
|
3132
3123
|
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
3133
|
-
), s(),
|
|
3124
|
+
), s(), p(), k();
|
|
3134
3125
|
}, []), useEffect(() => {
|
|
3135
3126
|
e.content && i(e.content);
|
|
3136
3127
|
}, [e.content]), useEffect(() => {
|
|
3137
3128
|
s();
|
|
3138
|
-
}, [(
|
|
3139
|
-
|
|
3129
|
+
}, [(S = (T = e.builderContextSignal.content) == null ? void 0 : T.data) == null ? void 0 : S.jsCode]), useEffect(() => {
|
|
3130
|
+
p();
|
|
3140
3131
|
}, [(E = (C = e.builderContextSignal.content) == null ? void 0 : C.data) == null ? void 0 : E.httpRequests]), useEffect(() => {
|
|
3141
3132
|
k();
|
|
3142
3133
|
}, [e.builderContextSignal.rootState]), useEffect(() => {
|
|
@@ -3154,7 +3145,7 @@ function EnableEditor(e) {
|
|
|
3154
3145
|
o,
|
|
3155
3146
|
{
|
|
3156
3147
|
ref: t,
|
|
3157
|
-
onClick: (
|
|
3148
|
+
onClick: (d) => y(d),
|
|
3158
3149
|
"builder-content-id": (I = e.builderContextSignal.content) == null ? void 0 : I.id,
|
|
3159
3150
|
"builder-model": e.model,
|
|
3160
3151
|
...e.showContent ? {} : {
|
|
@@ -3162,7 +3153,7 @@ function EnableEditor(e) {
|
|
|
3162
3153
|
"aria-hidden": !0
|
|
3163
3154
|
},
|
|
3164
3155
|
...e.contentWrapperProps,
|
|
3165
|
-
className: `variant-${((
|
|
3156
|
+
className: `variant-${((B = e.content) == null ? void 0 : B.testVariationId) || ((j = e.content) == null ? void 0 : j.id)}`,
|
|
3166
3157
|
children: e.children
|
|
3167
3158
|
}
|
|
3168
3159
|
) : null });
|
|
@@ -3263,22 +3254,22 @@ const getRootStateInitialValue = ({
|
|
|
3263
3254
|
meta: e == null ? void 0 : e.meta
|
|
3264
3255
|
} : void 0;
|
|
3265
3256
|
function ContentComponent(e) {
|
|
3266
|
-
var c, l,
|
|
3257
|
+
var c, l, u, m, g, h, y;
|
|
3267
3258
|
const [t, n] = useState(
|
|
3268
3259
|
() => {
|
|
3269
|
-
var
|
|
3260
|
+
var p, k;
|
|
3270
3261
|
return getUpdateVariantVisibilityScript({
|
|
3271
3262
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
3272
|
-
variationId: (
|
|
3263
|
+
variationId: (p = e.content) == null ? void 0 : p.testVariationId,
|
|
3273
3264
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
3274
3265
|
contentId: (k = e.content) == null ? void 0 : k.id
|
|
3275
3266
|
});
|
|
3276
3267
|
}
|
|
3277
3268
|
);
|
|
3278
|
-
function i(
|
|
3269
|
+
function i(p) {
|
|
3279
3270
|
s((k) => ({
|
|
3280
3271
|
...k,
|
|
3281
|
-
rootState:
|
|
3272
|
+
rootState: p
|
|
3282
3273
|
}));
|
|
3283
3274
|
}
|
|
3284
3275
|
const [o, a] = useState(
|
|
@@ -3286,8 +3277,8 @@ function ContentComponent(e) {
|
|
|
3286
3277
|
...getDefaultRegisteredComponents(),
|
|
3287
3278
|
...e.customComponents || []
|
|
3288
3279
|
].reduce(
|
|
3289
|
-
(
|
|
3290
|
-
...
|
|
3280
|
+
(p, { component: k, ...T }) => ({
|
|
3281
|
+
...p,
|
|
3291
3282
|
[T.name]: {
|
|
3292
3283
|
component: k,
|
|
3293
3284
|
...serializeComponentInfo(T)
|
|
@@ -3314,8 +3305,8 @@ function ContentComponent(e) {
|
|
|
3314
3305
|
...getDefaultRegisteredComponents(),
|
|
3315
3306
|
...e.customComponents || []
|
|
3316
3307
|
].reduce(
|
|
3317
|
-
(
|
|
3318
|
-
...
|
|
3308
|
+
(p, { component: k, ...T }) => ({
|
|
3309
|
+
...p,
|
|
3319
3310
|
[T.name]: serializeComponentInfo(T)
|
|
3320
3311
|
}),
|
|
3321
3312
|
{}
|
|
@@ -3361,14 +3352,14 @@ function ContentComponent(e) {
|
|
|
3361
3352
|
{
|
|
3362
3353
|
isNestedRender: e.isNestedRender,
|
|
3363
3354
|
contentId: (c = r.content) == null ? void 0 : c.id,
|
|
3364
|
-
cssCode: (
|
|
3355
|
+
cssCode: (u = (l = r.content) == null ? void 0 : l.data) == null ? void 0 : u.cssCode,
|
|
3365
3356
|
customFonts: (g = (m = r.content) == null ? void 0 : m.data) == null ? void 0 : g.customFonts
|
|
3366
3357
|
}
|
|
3367
3358
|
),
|
|
3368
3359
|
/* @__PURE__ */ jsx(
|
|
3369
3360
|
Blocks,
|
|
3370
3361
|
{
|
|
3371
|
-
blocks: (y = (
|
|
3362
|
+
blocks: (y = (h = r.content) == null ? void 0 : h.data) == null ? void 0 : y.blocks,
|
|
3372
3363
|
context: r,
|
|
3373
3364
|
registeredComponents: o,
|
|
3374
3365
|
linkComponent: e.linkComponent
|
|
@@ -3509,12 +3500,12 @@ const fetchSymbolContent = async ({
|
|
|
3509
3500
|
function Symbol$1(e) {
|
|
3510
3501
|
var a, r, s, c;
|
|
3511
3502
|
function t() {
|
|
3512
|
-
var l,
|
|
3503
|
+
var l, u;
|
|
3513
3504
|
return [
|
|
3514
3505
|
e.attributes[getClassPropName()],
|
|
3515
3506
|
"builder-symbol",
|
|
3516
3507
|
(l = e.symbol) != null && l.inline ? "builder-inline-symbol" : void 0,
|
|
3517
|
-
(
|
|
3508
|
+
(u = e.symbol) != null && u.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
3518
3509
|
].filter(Boolean).join(" ");
|
|
3519
3510
|
}
|
|
3520
3511
|
const [n, i] = useState(() => {
|