@builder.io/sdk-react 4.2.0 → 4.2.1
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 +8 -8
- package/lib/browser/blocks-exports.mjs +100 -98
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +6 -5
- package/lib/browser/server-entry-4cf669a1.cjs +2 -0
- package/lib/browser/{server-entry-065ec411.js → server-entry-5e98a993.js} +24 -13
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +7 -6
- package/lib/edge/{accordion-c239771d.cjs → accordion-4bab42b1.cjs} +1 -1
- package/lib/edge/{accordion-79f6d62c.js → accordion-a8a363e4.js} +1 -1
- package/lib/edge/{blocks-56f79850.cjs → blocks-d07d0261.cjs} +1 -1
- package/lib/edge/{blocks-3cb3a9cd.js → blocks-e1f5b0d0.js} +2 -2
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-759b43fb.cjs → button-6734c0bb.cjs} +1 -1
- package/lib/edge/{button-6dee05c9.js → button-bbcadacf.js} +2 -2
- package/lib/edge/{columns-a29ec0ac.cjs → columns-821cba14.cjs} +1 -1
- package/lib/edge/{columns-2743498a.js → columns-cf3081c6.js} +3 -3
- package/lib/edge/{content-variants-4d5a1e3c.js → content-variants-a704e35c.js} +12 -12
- package/lib/edge/{content-variants-bdf1748b.cjs → content-variants-ec180883.cjs} +2 -2
- package/lib/edge/{custom-code-6129bd8c.cjs → custom-code-8fcaa31e.cjs} +1 -1
- package/lib/edge/{custom-code-8034fac0.js → custom-code-f6c30129.js} +1 -1
- package/lib/edge/{embed-f5b10eeb.js → embed-3c0b5564.js} +1 -1
- package/lib/edge/{embed-b2ea5150.cjs → embed-666d3cc4.cjs} +1 -1
- package/lib/edge/form-51f639ab.cjs +1 -0
- package/lib/edge/{form-14942d4f.js → form-8b068721.js} +9 -7
- package/lib/edge/{get-class-prop-name-7e739c9f.cjs → get-class-prop-name-2869a960.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-f6a63f4a.js → get-class-prop-name-d6d821d6.js} +1 -1
- package/lib/edge/{img-f33a2e42.cjs → img-b04b9b6d.cjs} +1 -1
- package/lib/edge/{img-ba2ef9ee.js → img-dfbd4080.js} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +4 -3
- package/lib/edge/{input-7089e95f.js → input-665ef328.js} +1 -1
- package/lib/edge/{input-c2f95825.cjs → input-d31d6451.cjs} +1 -1
- package/lib/edge/{personalization-container-794b3939.cjs → personalization-container-d12566e8.cjs} +1 -1
- package/lib/edge/{personalization-container-eb1ecef2.js → personalization-container-e784836e.js} +4 -4
- package/lib/edge/{select-8f01592a.js → select-5fe49bd4.js} +1 -1
- package/lib/edge/{select-af0bb9fe.cjs → select-c3085265.cjs} +1 -1
- package/lib/edge/server-entry-acf5ce7d.cjs +2 -0
- package/lib/edge/{server-entry-7c65c9a8.js → server-entry-c9d5300f.js} +22 -11
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +7 -6
- package/lib/edge/{slot-2638fd6d.js → slot-a17ee2d7.js} +3 -3
- package/lib/edge/{slot-db37860e.cjs → slot-cbbbb02e.cjs} +1 -1
- package/lib/edge/{symbol-7faca118.js → symbol-9f960685.js} +2 -2
- package/lib/edge/{symbol-630b9a57.cjs → symbol-b56b5675.cjs} +1 -1
- package/lib/edge/{tabs-2eee6422.js → tabs-26ac5b2f.js} +3 -3
- package/lib/edge/{tabs-502123df.cjs → tabs-bf6643d7.cjs} +1 -1
- package/lib/node/blocks-exports.cjs +8 -8
- package/lib/node/blocks-exports.mjs +102 -100
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +6 -5
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +3 -3
- package/lib/node/{server-entry-581dd491.js → server-entry-48724189.js} +24 -13
- package/lib/node/server-entry-562c0663.cjs +2 -0
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +7 -6
- package/lib/node/{setIvm-2eb44b9d.cjs → setIvm-3b6199a0.cjs} +1 -1
- package/lib/node/{setIvm-8d02dc72.js → setIvm-a7aba6d2.js} +1 -1
- package/lib/node/setIvm.cjs +1 -1
- package/lib/node/setIvm.mjs +2 -2
- package/lib/node/{should-force-browser-runtime-in-node-ed3fa1f9.cjs → should-force-browser-runtime-in-node-cbe0ef14.cjs} +1 -1
- package/lib/node/{should-force-browser-runtime-in-node-f461467e.js → should-force-browser-runtime-in-node-fdc70f22.js} +1 -1
- package/package.json +1 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/functions/register.d.ts +18 -0
- package/types/server-index.d.ts +1 -1
- package/lib/browser/server-entry-09953757.cjs +0 -2
- package/lib/edge/form-26c3a03e.cjs +0 -1
- package/lib/edge/server-entry-142a50e9.cjs +0 -2
- package/lib/node/server-entry-375d06e8.cjs +0 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { TARGET as F, isBrowser as K, logger as Z, checkIsDefined as ge, isPreviewing as le, isEditing as _, userAttributesService as Ce, getDefaultCanTrack as X, logFetch as Fe, setupBrowserForEditing as lt, createRegisterComponentMessage as st, getCookieSync as ct, _track as Te, fetchOneEntry as Oe, createEditorListener as ut, serializeIncludingFunctions as Ie, handleABTestingSync as dt } from "./server-entry-
|
|
3
|
-
import { setClientUserAttributes as Mi } from "./server-entry-
|
|
2
|
+
import { TARGET as F, isBrowser as K, logger as Z, checkIsDefined as ge, isPreviewing as le, isEditing as _, userAttributesService as Ce, getDefaultCanTrack as X, logFetch as Fe, setupBrowserForEditing as lt, createRegisterComponentMessage as st, getCookieSync as ct, _track as Te, fetchOneEntry as Oe, createEditorListener as ut, serializeIncludingFunctions as Ie, handleABTestingSync as dt } from "./server-entry-48724189.js";
|
|
3
|
+
import { setClientUserAttributes as Mi } from "./server-entry-48724189.js";
|
|
4
4
|
import { jsx as s, Fragment as R, jsxs as W } from "react/jsx-runtime";
|
|
5
5
|
import * as mt from "react";
|
|
6
6
|
import { createContext as Le, useEffect as V, useState as C, useRef as H, useContext as we, createElement as _e } from "react";
|
|
7
|
-
import { getFunctionArguments as ft, flattenState as ht, runInNode as gt, parseCode as bt, getBuilderGlobals as yt, set as Ue, fastClone as ye } from "./setIvm-
|
|
8
|
-
import { shouldForceBrowserRuntimeInNode as pt } from "./should-force-browser-runtime-in-node-
|
|
7
|
+
import { getFunctionArguments as ft, flattenState as ht, runInNode as gt, parseCode as bt, getBuilderGlobals as yt, set as Ue, fastClone as ye } from "./setIvm-a7aba6d2.js";
|
|
8
|
+
import { shouldForceBrowserRuntimeInNode as pt } from "./should-force-browser-runtime-in-node-fdc70f22.js";
|
|
9
9
|
const vt = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), xt = (e) => typeof e == "string" && vt.has(e.toLowerCase());
|
|
10
10
|
function pe(e) {
|
|
11
11
|
return /* @__PURE__ */ s(R, { children: xt(e.TagName) ? /* @__PURE__ */ s(R, { children: /* @__PURE__ */ s(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ s(R, { children: typeof e.TagName == "string" ? /* @__PURE__ */ s(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) : /* @__PURE__ */ s(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) });
|
|
@@ -562,7 +562,7 @@ function Qt(e) {
|
|
|
562
562
|
return ge(i.hide) ? !i.hide : ge(i.show) ? i.show : !0;
|
|
563
563
|
}
|
|
564
564
|
function n() {
|
|
565
|
-
var k, A, T, w,
|
|
565
|
+
var k, A, T, w, h;
|
|
566
566
|
const i = e.block, r = i.responsiveStyles, o = e.context.content, a = Xe(
|
|
567
567
|
((k = o == null ? void 0 : o.meta) == null ? void 0 : k.breakpoints) || {}
|
|
568
568
|
), l = !!((T = (A = o == null ? void 0 : o.meta) == null ? void 0 : A.breakpoints) != null && T.xsmall), c = r == null ? void 0 : r.large, u = r == null ? void 0 : r.medium, f = r == null ? void 0 : r.small, b = r == null ? void 0 : r.xsmall, m = i.id;
|
|
@@ -578,7 +578,7 @@ function Qt(e) {
|
|
|
578
578
|
"medium",
|
|
579
579
|
a
|
|
580
580
|
)
|
|
581
|
-
}) : "",
|
|
581
|
+
}) : "", g = f ? Q({
|
|
582
582
|
className: m,
|
|
583
583
|
styles: f,
|
|
584
584
|
mediaQuery: ue(
|
|
@@ -595,7 +595,7 @@ function Qt(e) {
|
|
|
595
595
|
}) : "", y = i.animations && i.animations.find((x) => x.trigger === "hover");
|
|
596
596
|
let S = "";
|
|
597
597
|
if (y) {
|
|
598
|
-
const x = ((
|
|
598
|
+
const x = ((h = (w = y.steps) == null ? void 0 : w[1]) == null ? void 0 : h.styles) || {};
|
|
599
599
|
S = Q({
|
|
600
600
|
className: `${m}:hover`,
|
|
601
601
|
styles: {
|
|
@@ -610,7 +610,7 @@ function Qt(e) {
|
|
|
610
610
|
return [
|
|
611
611
|
v,
|
|
612
612
|
d,
|
|
613
|
-
|
|
613
|
+
g,
|
|
614
614
|
p,
|
|
615
615
|
S
|
|
616
616
|
].join(" ");
|
|
@@ -834,10 +834,10 @@ function ce(e) {
|
|
|
834
834
|
update: !1
|
|
835
835
|
}));
|
|
836
836
|
function r() {
|
|
837
|
-
var
|
|
837
|
+
var g;
|
|
838
838
|
if (n.value && !n.update && !le())
|
|
839
839
|
return n.value;
|
|
840
|
-
const d = (
|
|
840
|
+
const d = (g = e.block.repeat) != null && g.collection ? e.block : Dt({
|
|
841
841
|
block: e.block,
|
|
842
842
|
localState: e.context.localState,
|
|
843
843
|
rootState: e.context.rootState,
|
|
@@ -854,8 +854,8 @@ function ce(e) {
|
|
|
854
854
|
});
|
|
855
855
|
}
|
|
856
856
|
function a() {
|
|
857
|
-
var
|
|
858
|
-
return e.block.tagName === "a" || ((
|
|
857
|
+
var g;
|
|
858
|
+
return e.block.tagName === "a" || ((g = r().properties) == null ? void 0 : g.href) || r().href ? e.linkComponent || "a" : e.block.tagName || "div";
|
|
859
859
|
}
|
|
860
860
|
function l() {
|
|
861
861
|
var p, y;
|
|
@@ -865,14 +865,14 @@ function ce(e) {
|
|
|
865
865
|
return ("show" in r() ? r().show : !0) && !d;
|
|
866
866
|
}
|
|
867
867
|
function c() {
|
|
868
|
-
var
|
|
869
|
-
return !((
|
|
868
|
+
var g, p;
|
|
869
|
+
return !((g = o == null ? void 0 : o()) != null && g.component) && !t() ? (p = r().children) != null ? p : [] : [];
|
|
870
870
|
}
|
|
871
871
|
function u() {
|
|
872
|
-
var d,
|
|
872
|
+
var d, g, p, y;
|
|
873
873
|
return {
|
|
874
874
|
blockChildren: (d = r().children) != null ? d : [],
|
|
875
|
-
componentRef: (
|
|
875
|
+
componentRef: (g = o == null ? void 0 : o()) == null ? void 0 : g.component,
|
|
876
876
|
componentOptions: {
|
|
877
877
|
...Et(r(), e.context),
|
|
878
878
|
...Jt(o(), r()),
|
|
@@ -893,9 +893,9 @@ function ce(e) {
|
|
|
893
893
|
};
|
|
894
894
|
}
|
|
895
895
|
return V(() => {
|
|
896
|
-
const d = r().id,
|
|
897
|
-
|
|
898
|
-
|
|
896
|
+
const d = r().id, g = r().animations;
|
|
897
|
+
g && d && Ot(
|
|
898
|
+
g.map((p) => ({
|
|
899
899
|
...p,
|
|
900
900
|
elementId: d
|
|
901
901
|
}))
|
|
@@ -904,7 +904,7 @@ function ce(e) {
|
|
|
904
904
|
n.update = !0;
|
|
905
905
|
}), /* @__PURE__ */ s(R, { children: l() ? /* @__PURE__ */ W(R, { children: [
|
|
906
906
|
/* @__PURE__ */ s(Qt, { block: r(), context: e.context }),
|
|
907
|
-
(f = o == null ? void 0 : o()) != null && f.noWrap ? t() ? /* @__PURE__ */ s(R, { children: (v = t()) == null ? void 0 : v.map((d,
|
|
907
|
+
(f = o == null ? void 0 : o()) != null && f.noWrap ? t() ? /* @__PURE__ */ s(R, { children: (v = t()) == null ? void 0 : v.map((d, g) => /* @__PURE__ */ s(
|
|
908
908
|
Pe,
|
|
909
909
|
{
|
|
910
910
|
repeatContext: d.context,
|
|
@@ -912,7 +912,7 @@ function ce(e) {
|
|
|
912
912
|
registeredComponents: e.registeredComponents,
|
|
913
913
|
linkComponent: e.linkComponent
|
|
914
914
|
},
|
|
915
|
-
Ee(
|
|
915
|
+
Ee(g)
|
|
916
916
|
)) }) : /* @__PURE__ */ s(
|
|
917
917
|
Re,
|
|
918
918
|
{
|
|
@@ -926,7 +926,7 @@ function ce(e) {
|
|
|
926
926
|
includeBlockProps: u().includeBlockProps,
|
|
927
927
|
isInteractive: u().isInteractive
|
|
928
928
|
}
|
|
929
|
-
) : /* @__PURE__ */ s(R, { children: t() ? /* @__PURE__ */ s(R, { children: (m = t()) == null ? void 0 : m.map((d,
|
|
929
|
+
) : /* @__PURE__ */ s(R, { children: t() ? /* @__PURE__ */ s(R, { children: (m = t()) == null ? void 0 : m.map((d, g) => /* @__PURE__ */ s(
|
|
930
930
|
Pe,
|
|
931
931
|
{
|
|
932
932
|
repeatContext: d.context,
|
|
@@ -934,7 +934,7 @@ function ce(e) {
|
|
|
934
934
|
registeredComponents: e.registeredComponents,
|
|
935
935
|
linkComponent: e.linkComponent
|
|
936
936
|
},
|
|
937
|
-
Ee(
|
|
937
|
+
Ee(g)
|
|
938
938
|
)) }) : /* @__PURE__ */ W(
|
|
939
939
|
nn,
|
|
940
940
|
{
|
|
@@ -1070,7 +1070,7 @@ function U(e) {
|
|
|
1070
1070
|
}
|
|
1071
1071
|
const sn = (e) => `builder-columns ${e}-breakpoints`;
|
|
1072
1072
|
function cn(e) {
|
|
1073
|
-
var
|
|
1073
|
+
var g, p;
|
|
1074
1074
|
function t() {
|
|
1075
1075
|
return typeof e.space == "number" ? e.space || 0 : 20;
|
|
1076
1076
|
}
|
|
@@ -1195,7 +1195,7 @@ function cn(e) {
|
|
|
1195
1195
|
/* @__PURE__ */ W(
|
|
1196
1196
|
"div",
|
|
1197
1197
|
{
|
|
1198
|
-
className: sn((
|
|
1198
|
+
className: sn((g = e.builderBlock) == null ? void 0 : g.id) + " div-0369db37",
|
|
1199
1199
|
style: f(),
|
|
1200
1200
|
children: [
|
|
1201
1201
|
/* @__PURE__ */ s(
|
|
@@ -1399,28 +1399,28 @@ function gn(e, t, n, i) {
|
|
|
1399
1399
|
operator: v,
|
|
1400
1400
|
value: p
|
|
1401
1401
|
}));
|
|
1402
|
-
const
|
|
1403
|
-
if (Array.isArray(
|
|
1404
|
-
return
|
|
1402
|
+
const g = u[m];
|
|
1403
|
+
if (Array.isArray(g))
|
|
1404
|
+
return g.includes(d);
|
|
1405
1405
|
switch (v) {
|
|
1406
1406
|
case "is":
|
|
1407
|
-
return
|
|
1407
|
+
return g === d;
|
|
1408
1408
|
case "isNot":
|
|
1409
|
-
return
|
|
1409
|
+
return g !== d;
|
|
1410
1410
|
case "contains":
|
|
1411
|
-
return (r(
|
|
1411
|
+
return (r(g) || Array.isArray(g)) && g.includes(String(d));
|
|
1412
1412
|
case "startsWith":
|
|
1413
|
-
return r(
|
|
1413
|
+
return r(g) && g.startsWith(String(d));
|
|
1414
1414
|
case "endsWith":
|
|
1415
|
-
return r(
|
|
1415
|
+
return r(g) && g.endsWith(String(d));
|
|
1416
1416
|
case "greaterThan":
|
|
1417
|
-
return o(
|
|
1417
|
+
return o(g) && o(d) && g > d;
|
|
1418
1418
|
case "lessThan":
|
|
1419
|
-
return o(
|
|
1419
|
+
return o(g) && o(d) && g < d;
|
|
1420
1420
|
case "greaterThanOrEqualTo":
|
|
1421
|
-
return o(
|
|
1421
|
+
return o(g) && o(d) && g >= d;
|
|
1422
1422
|
case "lessThanOrEqualTo":
|
|
1423
|
-
return o(
|
|
1423
|
+
return o(g) && o(d) && g <= d;
|
|
1424
1424
|
default:
|
|
1425
1425
|
return !1;
|
|
1426
1426
|
}
|
|
@@ -1794,7 +1794,7 @@ function wn(e) {
|
|
|
1794
1794
|
cursor: "pointer"
|
|
1795
1795
|
};
|
|
1796
1796
|
return Object.fromEntries(
|
|
1797
|
-
Object.entries(v).filter(([d,
|
|
1797
|
+
Object.entries(v).filter(([d, g]) => g !== void 0)
|
|
1798
1798
|
);
|
|
1799
1799
|
}
|
|
1800
1800
|
function a(m) {
|
|
@@ -2300,7 +2300,7 @@ function q(e) {
|
|
|
2300
2300
|
);
|
|
2301
2301
|
}
|
|
2302
2302
|
function Nn(e) {
|
|
2303
|
-
var S, k, A, T, w,
|
|
2303
|
+
var S, k, A, T, w, h, x, E, N, O, L, P, D;
|
|
2304
2304
|
const t = H(null), [n, i] = C(
|
|
2305
2305
|
() => Ce.getUserAttributes()
|
|
2306
2306
|
), [r, o] = C(
|
|
@@ -2336,7 +2336,7 @@ function Nn(e) {
|
|
|
2336
2336
|
[j()]: `builder-personalization-container ${e.attributes[j()] || ""}`
|
|
2337
2337
|
};
|
|
2338
2338
|
}
|
|
2339
|
-
function
|
|
2339
|
+
function g() {
|
|
2340
2340
|
return (e.variants || []).filter((I) => {
|
|
2341
2341
|
var B, $, z, M;
|
|
2342
2342
|
return gn(
|
|
@@ -2358,7 +2358,7 @@ function Nn(e) {
|
|
|
2358
2358
|
variants: e.variants,
|
|
2359
2359
|
fallbackBlocks: (I = e.builderBlock) == null ? void 0 : I.children,
|
|
2360
2360
|
isHydrated: m,
|
|
2361
|
-
filteredVariants:
|
|
2361
|
+
filteredVariants: g(),
|
|
2362
2362
|
previewingIndex: e.previewingIndex
|
|
2363
2363
|
});
|
|
2364
2364
|
}
|
|
@@ -2382,7 +2382,7 @@ function Nn(e) {
|
|
|
2382
2382
|
}
|
|
2383
2383
|
);
|
|
2384
2384
|
if (!(_() || le())) {
|
|
2385
|
-
const $ =
|
|
2385
|
+
const $ = g()[0];
|
|
2386
2386
|
t.current && (t.current.dispatchEvent(
|
|
2387
2387
|
new CustomEvent("builder.variantLoaded", {
|
|
2388
2388
|
detail: {
|
|
@@ -2437,7 +2437,7 @@ function Nn(e) {
|
|
|
2437
2437
|
/* @__PURE__ */ s(
|
|
2438
2438
|
q,
|
|
2439
2439
|
{
|
|
2440
|
-
nonce: ((
|
|
2440
|
+
nonce: ((h = e.builderContext) == null ? void 0 : h.nonce) || "",
|
|
2441
2441
|
scriptStr: a,
|
|
2442
2442
|
id: `variants-visibility-script-${(x = e.builderBlock) == null ? void 0 : x.id}`
|
|
2443
2443
|
}
|
|
@@ -3231,63 +3231,65 @@ function Yn(e) {
|
|
|
3231
3231
|
return;
|
|
3232
3232
|
}
|
|
3233
3233
|
b.preventDefault();
|
|
3234
|
-
const d = b.currentTarget || b.target,
|
|
3234
|
+
const d = b.currentTarget || b.target, g = e.customHeaders || {};
|
|
3235
3235
|
let p;
|
|
3236
|
-
const y = new FormData(d), S = Array.from(d.querySelectorAll("input,select,textarea")).filter((
|
|
3236
|
+
const y = new FormData(d), S = Array.from(d.querySelectorAll("input,select,textarea")).filter((h) => !!h.name).filter(
|
|
3237
|
+
(h) => !!h.name && (h.type !== "radio" || h.checked)
|
|
3238
|
+
).map((h) => {
|
|
3237
3239
|
let x;
|
|
3238
|
-
const E =
|
|
3239
|
-
if (
|
|
3240
|
-
if (
|
|
3241
|
-
if (
|
|
3242
|
-
return x =
|
|
3240
|
+
const E = h.name;
|
|
3241
|
+
if (h instanceof HTMLInputElement)
|
|
3242
|
+
if (h.type === "radio") {
|
|
3243
|
+
if (h.checked)
|
|
3244
|
+
return x = h.value, {
|
|
3243
3245
|
key: E,
|
|
3244
3246
|
value: x
|
|
3245
3247
|
};
|
|
3246
|
-
} else if (
|
|
3247
|
-
x =
|
|
3248
|
-
else if (
|
|
3249
|
-
const N =
|
|
3248
|
+
} else if (h.type === "checkbox")
|
|
3249
|
+
x = h.checked;
|
|
3250
|
+
else if (h.type === "number" || h.type === "range") {
|
|
3251
|
+
const N = h.valueAsNumber;
|
|
3250
3252
|
isNaN(N) || (x = N);
|
|
3251
3253
|
} else
|
|
3252
|
-
|
|
3254
|
+
h.type === "file" ? x = h.files : x = h.value;
|
|
3253
3255
|
else
|
|
3254
|
-
x =
|
|
3256
|
+
x = h.value;
|
|
3255
3257
|
return {
|
|
3256
3258
|
key: E,
|
|
3257
3259
|
value: x
|
|
3258
3260
|
};
|
|
3259
3261
|
});
|
|
3260
3262
|
let k = e.contentType;
|
|
3261
|
-
if (e.sendSubmissionsTo === "email" && (k = "multipart/form-data"), Array.from(S).forEach(({ value:
|
|
3262
|
-
(
|
|
3263
|
+
if (e.sendSubmissionsTo === "email" && (k = "multipart/form-data"), Array.from(S).forEach(({ value: h }) => {
|
|
3264
|
+
(h instanceof File || Array.isArray(h) && h[0] instanceof File || h instanceof FileList) && (k = "multipart/form-data");
|
|
3263
3265
|
}), k !== "application/json")
|
|
3264
3266
|
p = y;
|
|
3265
3267
|
else {
|
|
3266
|
-
const
|
|
3268
|
+
const h = {};
|
|
3267
3269
|
Array.from(S).forEach(({ value: x, key: E }) => {
|
|
3268
|
-
Ue(
|
|
3269
|
-
}), p = JSON.stringify(
|
|
3270
|
+
Ue(h, E, x);
|
|
3271
|
+
}), p = JSON.stringify(h);
|
|
3270
3272
|
}
|
|
3271
|
-
k && k !== "multipart/form-data" && (m && ((v = e.action) != null && v.includes("zapier.com")) || (
|
|
3273
|
+
k && k !== "multipart/form-data" && (m && ((v = e.action) != null && v.includes("zapier.com")) || (g["content-type"] = k));
|
|
3272
3274
|
const A = new CustomEvent("presubmit", { detail: { body: p } });
|
|
3273
3275
|
if (t.current && (t.current.dispatchEvent(A), A.defaultPrevented))
|
|
3274
3276
|
return;
|
|
3275
3277
|
if (i("sending"), e.sendSubmissionsTo === "email" && (e.sendSubmissionsToEmail === "your@email.com" || !e.sendSubmissionsToEmail)) {
|
|
3276
|
-
const
|
|
3277
|
-
console.error(
|
|
3278
|
+
const h = "SubmissionsToEmail is required when sendSubmissionsTo is set to email";
|
|
3279
|
+
console.error(h), i("error"), c({ formErrorMessage: h });
|
|
3278
3280
|
return;
|
|
3279
3281
|
}
|
|
3280
3282
|
const T = `${Qn() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(
|
|
3281
3283
|
e.sendSubmissionsToEmail || ""
|
|
3282
3284
|
)}&name=${encodeURIComponent(e.name || "")}`, w = e.sendSubmissionsTo === "email" ? T : e.action;
|
|
3283
|
-
Fe(w), fetch(w, { body: p, headers:
|
|
3284
|
-
async (
|
|
3285
|
+
Fe(w), fetch(w, { body: p, headers: g, method: e.method || "post" }).then(
|
|
3286
|
+
async (h) => {
|
|
3285
3287
|
var N, O;
|
|
3286
3288
|
let x;
|
|
3287
|
-
const E =
|
|
3288
|
-
if (E && E.indexOf("application/json") !== -1 ? x = await
|
|
3289
|
+
const E = h.headers.get("content-type");
|
|
3290
|
+
if (E && E.indexOf("application/json") !== -1 ? x = await h.json() : x = await h.text(), !h.ok) {
|
|
3289
3291
|
const L = new CustomEvent("submit:error", {
|
|
3290
|
-
detail: { error: x, status:
|
|
3292
|
+
detail: { error: x, status: h.status }
|
|
3291
3293
|
});
|
|
3292
3294
|
if ((N = t.current) != null && N.nativeElement && ((O = t.current) == null || O.nativeElement.dispatchEvent(L), L.defaultPrevented))
|
|
3293
3295
|
return;
|
|
@@ -3296,9 +3298,9 @@ function Yn(e) {
|
|
|
3296
3298
|
typeof P != "string" && (P = JSON.stringify(P)), l(P), c({ formErrorMessage: P });
|
|
3297
3299
|
return;
|
|
3298
3300
|
}
|
|
3299
|
-
if (o(x), i(
|
|
3301
|
+
if (o(x), i(h.ok ? "success" : "error"), h.ok) {
|
|
3300
3302
|
const L = new CustomEvent("submit:success", {
|
|
3301
|
-
detail: { res:
|
|
3303
|
+
detail: { res: h, body: x }
|
|
3302
3304
|
});
|
|
3303
3305
|
if (t.current) {
|
|
3304
3306
|
if (t.current.dispatchEvent(L), L.defaultPrevented)
|
|
@@ -3315,18 +3317,18 @@ function Yn(e) {
|
|
|
3315
3317
|
location.href = e.successUrl;
|
|
3316
3318
|
}
|
|
3317
3319
|
},
|
|
3318
|
-
(
|
|
3320
|
+
(h) => {
|
|
3319
3321
|
const x = new CustomEvent("submit:error", {
|
|
3320
|
-
detail: { error:
|
|
3322
|
+
detail: { error: h }
|
|
3321
3323
|
});
|
|
3322
|
-
t.current && (t.current.dispatchEvent(x), x.defaultPrevented) || (o(
|
|
3324
|
+
t.current && (t.current.dispatchEvent(x), x.defaultPrevented) || (o(h), i("error"));
|
|
3323
3325
|
}
|
|
3324
3326
|
);
|
|
3325
3327
|
}
|
|
3326
3328
|
}
|
|
3327
3329
|
return /* @__PURE__ */ W(R, { children: [
|
|
3328
3330
|
" ",
|
|
3329
|
-
/* @__PURE__ */ s("style", { children: ".pre-
|
|
3331
|
+
/* @__PURE__ */ s("style", { children: ".pre-26f6d56a { padding: 10px; color: red; text-align: center; }" }),
|
|
3330
3332
|
" ",
|
|
3331
3333
|
/* @__PURE__ */ W(
|
|
3332
3334
|
"form",
|
|
@@ -3356,7 +3358,7 @@ function Yn(e) {
|
|
|
3356
3358
|
context: e.builderContext
|
|
3357
3359
|
}
|
|
3358
3360
|
) : null,
|
|
3359
|
-
u() === "error" && r ? /* @__PURE__ */ s("pre", { className: "builder-form-error-text pre-
|
|
3361
|
+
u() === "error" && r ? /* @__PURE__ */ s("pre", { className: "builder-form-error-text pre-26f6d56a", children: JSON.stringify(r, null, 2) }) : null,
|
|
3360
3362
|
u() === "success" ? /* @__PURE__ */ s(
|
|
3361
3363
|
U,
|
|
3362
3364
|
{
|
|
@@ -3729,10 +3731,10 @@ function ci(e) {
|
|
|
3729
3731
|
return V(() => {
|
|
3730
3732
|
if (e.lazyLoad) {
|
|
3731
3733
|
const v = new IntersectionObserver(function(d) {
|
|
3732
|
-
d.forEach(function(
|
|
3733
|
-
if (!
|
|
3734
|
+
d.forEach(function(g) {
|
|
3735
|
+
if (!g.isIntersecting)
|
|
3734
3736
|
return;
|
|
3735
|
-
const p =
|
|
3737
|
+
const p = g.target;
|
|
3736
3738
|
try {
|
|
3737
3739
|
Array.from(p.children).filter(
|
|
3738
3740
|
(y) => y instanceof HTMLElement && y.tagName === "SOURCE"
|
|
@@ -4104,23 +4106,23 @@ function Pi(e) {
|
|
|
4104
4106
|
const t = H(null);
|
|
4105
4107
|
C(() => !1);
|
|
4106
4108
|
function n(T) {
|
|
4107
|
-
var
|
|
4109
|
+
var h, x;
|
|
4108
4110
|
const w = {
|
|
4109
4111
|
...e.builderContextSignal.rootState,
|
|
4110
4112
|
...T
|
|
4111
4113
|
};
|
|
4112
|
-
e.builderContextSignal.rootSetState ? (x = (
|
|
4114
|
+
e.builderContextSignal.rootSetState ? (x = (h = e.builderContextSignal).rootSetState) == null || x.call(h, w) : e.setBuilderContextSignal((E) => ({
|
|
4113
4115
|
...E,
|
|
4114
4116
|
rootState: w
|
|
4115
4117
|
}));
|
|
4116
4118
|
}
|
|
4117
4119
|
function i(T) {
|
|
4118
|
-
var
|
|
4120
|
+
var h, x, E, N, O;
|
|
4119
4121
|
const w = {
|
|
4120
4122
|
...e.builderContextSignal.content,
|
|
4121
4123
|
...T,
|
|
4122
4124
|
data: {
|
|
4123
|
-
...(
|
|
4125
|
+
...(h = e.builderContextSignal.content) == null ? void 0 : h.data,
|
|
4124
4126
|
...T == null ? void 0 : T.data
|
|
4125
4127
|
},
|
|
4126
4128
|
meta: {
|
|
@@ -4150,10 +4152,10 @@ function Pi(e) {
|
|
|
4150
4152
|
callbacks: {
|
|
4151
4153
|
configureSdk: (w) => {
|
|
4152
4154
|
var E;
|
|
4153
|
-
const { breakpoints:
|
|
4154
|
-
!x || x !== ((E = e.builderContextSignal.content) == null ? void 0 : E.id) ||
|
|
4155
|
+
const { breakpoints: h, contentId: x } = w;
|
|
4156
|
+
!x || x !== ((E = e.builderContextSignal.content) == null ? void 0 : E.id) || h && i({
|
|
4155
4157
|
meta: {
|
|
4156
|
-
breakpoints:
|
|
4158
|
+
breakpoints: h
|
|
4157
4159
|
}
|
|
4158
4160
|
});
|
|
4159
4161
|
},
|
|
@@ -4171,9 +4173,9 @@ function Pi(e) {
|
|
|
4171
4173
|
}
|
|
4172
4174
|
const [c, u] = C(() => ({})), [f, b] = C(() => ({})), [m, v] = C(() => !1);
|
|
4173
4175
|
function d(T) {
|
|
4174
|
-
var w,
|
|
4176
|
+
var w, h;
|
|
4175
4177
|
if (e.builderContextSignal.content) {
|
|
4176
|
-
const x = (w = e.builderContextSignal.content) == null ? void 0 : w.testVariationId, E = (
|
|
4178
|
+
const x = (w = e.builderContextSignal.content) == null ? void 0 : w.testVariationId, E = (h = e.builderContextSignal.content) == null ? void 0 : h.id;
|
|
4177
4179
|
Te({
|
|
4178
4180
|
apiHost: e.apiHost,
|
|
4179
4181
|
type: "click",
|
|
@@ -4187,9 +4189,9 @@ function Pi(e) {
|
|
|
4187
4189
|
}
|
|
4188
4190
|
m || v(!0);
|
|
4189
4191
|
}
|
|
4190
|
-
function
|
|
4191
|
-
var w,
|
|
4192
|
-
const T = (x = (
|
|
4192
|
+
function g() {
|
|
4193
|
+
var w, h, x;
|
|
4194
|
+
const T = (x = (h = (w = e.builderContextSignal.content) == null ? void 0 : w.data) == null ? void 0 : h.httpRequests) != null ? x : {};
|
|
4193
4195
|
Object.entries(T).forEach(
|
|
4194
4196
|
([E, N]) => {
|
|
4195
4197
|
if (!N)
|
|
@@ -4255,8 +4257,8 @@ function Pi(e) {
|
|
|
4255
4257
|
);
|
|
4256
4258
|
}
|
|
4257
4259
|
const y = H(!1);
|
|
4258
|
-
return y.current || (
|
|
4259
|
-
var T, w,
|
|
4260
|
+
return y.current || (g(), p(), y.current = !0), V(() => {
|
|
4261
|
+
var T, w, h, x, E;
|
|
4260
4262
|
if (K()) {
|
|
4261
4263
|
_() && !e.isNestedRender && (window.addEventListener("message", l), lt({
|
|
4262
4264
|
...e.locale ? {
|
|
@@ -4285,7 +4287,7 @@ function Pi(e) {
|
|
|
4285
4287
|
const N = e.builderContextSignal.content && X(e.canTrack), O = ct({
|
|
4286
4288
|
name: `builder.tests.${(w = e.builderContextSignal.content) == null ? void 0 : w.id}`,
|
|
4287
4289
|
canTrack: !0
|
|
4288
|
-
}), L = (
|
|
4290
|
+
}), L = (h = e.builderContextSignal.content) == null ? void 0 : h.testVariationId;
|
|
4289
4291
|
if (N && L === O) {
|
|
4290
4292
|
const P = (x = e.builderContextSignal.content) == null ? void 0 : x.id, D = e.apiKey;
|
|
4291
4293
|
Te({
|
|
@@ -4400,7 +4402,7 @@ const Ai = ({
|
|
|
4400
4402
|
meta: e == null ? void 0 : e.meta
|
|
4401
4403
|
} : void 0;
|
|
4402
4404
|
function De(e) {
|
|
4403
|
-
var u, f, b, m, v, d,
|
|
4405
|
+
var u, f, b, m, v, d, g, p, y;
|
|
4404
4406
|
const [t, n] = C(
|
|
4405
4407
|
() => {
|
|
4406
4408
|
var S, k;
|
|
@@ -4522,7 +4524,7 @@ function De(e) {
|
|
|
4522
4524
|
isNestedRender: e.isNestedRender,
|
|
4523
4525
|
contentId: (b = a.content) == null ? void 0 : b.id,
|
|
4524
4526
|
cssCode: (v = (m = a.content) == null ? void 0 : m.data) == null ? void 0 : v.cssCode,
|
|
4525
|
-
customFonts: (
|
|
4527
|
+
customFonts: (g = (d = a.content) == null ? void 0 : d.data) == null ? void 0 : g.customFonts
|
|
4526
4528
|
}
|
|
4527
4529
|
),
|
|
4528
4530
|
/* @__PURE__ */ s(
|
|
@@ -4692,12 +4694,12 @@ function Wi(e) {
|
|
|
4692
4694
|
return "div";
|
|
4693
4695
|
}
|
|
4694
4696
|
function i() {
|
|
4695
|
-
var d,
|
|
4697
|
+
var d, g;
|
|
4696
4698
|
return [
|
|
4697
4699
|
e.attributes[j()],
|
|
4698
4700
|
"builder-symbol",
|
|
4699
4701
|
(d = e.symbol) != null && d.inline ? "builder-inline-symbol" : void 0,
|
|
4700
|
-
(
|
|
4702
|
+
(g = e.symbol) != null && g.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
4701
4703
|
].filter(Boolean).join(" ");
|
|
4702
4704
|
}
|
|
4703
4705
|
const [r, o] = C(() => {
|
|
@@ -4712,9 +4714,9 @@ function Wi(e) {
|
|
|
4712
4714
|
r && a === ((d = e.symbol) == null ? void 0 : d.entry) || $i({
|
|
4713
4715
|
symbol: e.symbol,
|
|
4714
4716
|
builderContextValue: e.builderContext
|
|
4715
|
-
}).then((
|
|
4717
|
+
}).then((g) => {
|
|
4716
4718
|
var p;
|
|
4717
|
-
|
|
4719
|
+
g && (o(g), l((p = e.symbol) == null ? void 0 : p.entry));
|
|
4718
4720
|
});
|
|
4719
4721
|
}
|
|
4720
4722
|
return V(() => {
|
package/lib/node/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./blocks-exports.cjs"),e=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./blocks-exports.cjs"),e=require("./server-entry-562c0663.cjs");require("react/jsx-runtime");require("react");require("./setIvm-3b6199a0.cjs");require("./should-force-browser-runtime-in-node-cbe0ef14.cjs");exports.Blocks=t.Blocks;exports.BuilderContext=t.BuilderContext;exports.Button=t.Button;exports.Columns=t.Columns;exports.Content=t.Content;exports.Fragment=t.Fragment;exports.Image=t.Image;exports.Section=t.Section;exports.Symbol=t.Symbol;exports.Text=t.Text;exports.Video=t.Video;exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.registerAction=e.registerAction;exports.setClientUserAttributes=e.setClientUserAttributes;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
|
package/lib/node/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Blocks as n, BuilderContext as m, Button as c, Columns as g, Content as p, Fragment as a, Image as l, Section as u, Symbol as d, Text as C, Video as f } from "./blocks-exports.mjs";
|
|
2
|
-
import { _processContentResult as E, createRegisterComponentMessage as b, fetchBuilderProps as h, fetchEntries as x, fetchOneEntry as S, getBuilderSearchParams as P, isEditing as k, isPreviewing as y, register as R, setClientUserAttributes as T, setEditorSettings as v, subscribeToEditor as w, track as
|
|
2
|
+
import { _processContentResult as E, createRegisterComponentMessage as b, fetchBuilderProps as h, fetchEntries as x, fetchOneEntry as S, getBuilderSearchParams as P, isEditing as k, isPreviewing as y, register as A, registerAction as R, setClientUserAttributes as T, setEditorSettings as v, subscribeToEditor as w, track as F } from "./server-entry-48724189.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
|
-
import "./setIvm-
|
|
6
|
-
import "./should-force-browser-runtime-in-node-
|
|
5
|
+
import "./setIvm-a7aba6d2.js";
|
|
6
|
+
import "./should-force-browser-runtime-in-node-fdc70f22.js";
|
|
7
7
|
export {
|
|
8
8
|
n as Blocks,
|
|
9
9
|
m as BuilderContext,
|
|
@@ -24,9 +24,10 @@ export {
|
|
|
24
24
|
P as getBuilderSearchParams,
|
|
25
25
|
k as isEditing,
|
|
26
26
|
y as isPreviewing,
|
|
27
|
-
|
|
27
|
+
A as register,
|
|
28
|
+
R as registerAction,
|
|
28
29
|
T as setClientUserAttributes,
|
|
29
30
|
v as setEditorSettings,
|
|
30
31
|
w as subscribeToEditor,
|
|
31
|
-
|
|
32
|
+
F as track
|
|
32
33
|
};
|
package/lib/node/init.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./should-force-browser-runtime-in-node-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./should-force-browser-runtime-in-node-cbe0ef14.cjs"),t=require("isolated-vm"),r=require("./setIvm-3b6199a0.cjs");require("./server-entry-562c0663.cjs");const n=e=>{if(o.shouldForceBrowserRuntimeInNode({shouldLogWarning:!0}))return;const{ivmIsolateOptions:i}=e||{};r.setIvm(t,i)};exports.initializeNodeRuntime=n;
|
package/lib/node/init.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { shouldForceBrowserRuntimeInNode as r } from "./should-force-browser-runtime-in-node-
|
|
1
|
+
import { shouldForceBrowserRuntimeInNode as r } from "./should-force-browser-runtime-in-node-fdc70f22.js";
|
|
2
2
|
import t from "isolated-vm";
|
|
3
|
-
import { setIvm as e } from "./setIvm-
|
|
4
|
-
import "./server-entry-
|
|
3
|
+
import { setIvm as e } from "./setIvm-a7aba6d2.js";
|
|
4
|
+
import "./server-entry-48724189.js";
|
|
5
5
|
const u = (o) => {
|
|
6
6
|
if (r({
|
|
7
7
|
shouldLogWarning: !0
|