@builder.io/sdk-react 2.0.2 → 2.0.3
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 +25 -25
- package/lib/browser/blocks-exports.mjs +120 -119
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/init.cjs +1 -1
- package/lib/browser/init.mjs +1 -1
- package/lib/browser/server-entry-02cecfb7.cjs +2 -0
- package/lib/browser/server-entry-0687830a.js +688 -0
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-ca081054.js → accordion-0eca9b08.js} +1 -1
- package/lib/edge/{accordion-4f96554c.cjs → accordion-368a2cf8.cjs} +1 -1
- package/lib/edge/{blocks-f55c7d3e.js → blocks-db3cfcac.js} +130 -129
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{blocks-078044bc.cjs → blocks-f524a758.cjs} +13 -13
- package/lib/edge/{button-5d140f8e.cjs → button-3ed29654.cjs} +1 -1
- package/lib/edge/{button-41169061.js → button-e852700f.js} +2 -2
- package/lib/edge/columns-1f84e26e.cjs +28 -0
- package/lib/edge/{columns-f8916a18.js → columns-ee464f6c.js} +49 -48
- package/lib/edge/{content-variants-89a9389a.cjs → content-variants-42f2495b.cjs} +4 -4
- package/lib/edge/{content-variants-71ee0c76.js → content-variants-c0257a99.js} +23 -23
- package/lib/edge/{form-f2d2c2bf.cjs → form-4444faf2.cjs} +1 -1
- package/lib/edge/{form-ac2f2a0e.js → form-8191004e.js} +3 -3
- package/lib/edge/{get-class-prop-name-a9b4959e.cjs → get-class-prop-name-5fc98fcc.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-a677d7a5.js → get-class-prop-name-d18337d2.js} +1 -1
- package/lib/edge/{img-b91cb4fd.cjs → img-10ef20a5.cjs} +1 -1
- package/lib/edge/{img-8fc26395.js → img-a24ed75f.js} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/init.cjs +1 -1
- package/lib/edge/init.mjs +1 -1
- package/lib/edge/{input-549f090e.js → input-3876429d.js} +1 -1
- package/lib/edge/{input-ec7c695a.cjs → input-6325bfc0.cjs} +1 -1
- package/lib/edge/{select-3ffa9294.cjs → select-3f0f00f3.cjs} +1 -1
- package/lib/edge/{select-6a5a28ac.js → select-5dc1c7d1.js} +1 -1
- package/lib/edge/server-entry-805b9266.cjs +2 -0
- package/lib/edge/server-entry-ff728468.js +689 -0
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-40de071b.js → slot-20fe5e4f.js} +3 -3
- package/lib/edge/{slot-8b27e15e.cjs → slot-a64b535f.cjs} +1 -1
- package/lib/edge/{symbol-76e76298.cjs → symbol-5012ed02.cjs} +1 -1
- package/lib/edge/{symbol-e6515a5f.js → symbol-e95082e1.js} +2 -2
- package/lib/edge/{tabs-b75be82d.js → tabs-261e8cd4.js} +3 -3
- package/lib/edge/{tabs-9c5af0ec.cjs → tabs-d672f816.cjs} +1 -1
- package/lib/node/blocks-exports.cjs +11 -11
- package/lib/node/blocks-exports.mjs +74 -73
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +2 -2
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +2 -2
- package/lib/node/{node-runtime-0e37d6f7.cjs → node-runtime-160b6846.cjs} +2 -2
- package/lib/node/{node-runtime-0f3a5df1.js → node-runtime-405effc5.js} +3 -2
- package/lib/node/server-entry-02cecfb7.cjs +2 -0
- package/lib/node/server-entry-0687830a.js +688 -0
- 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/types/functions/register-component.d.ts +2 -2
- package/lib/browser/server-entry-419c051e.cjs +0 -2
- package/lib/browser/server-entry-825b4408.js +0 -695
- package/lib/edge/columns-354bf349.cjs +0 -28
- package/lib/edge/server-entry-966ac144.cjs +0 -2
- package/lib/edge/server-entry-d2020acf.js +0 -695
- package/lib/node/server-entry-5ebd1c9b.js +0 -695
- package/lib/node/server-entry-8002325b.cjs +0 -2
|
@@ -3,10 +3,10 @@ var qe = Object.defineProperty;
|
|
|
3
3
|
var Ke = (e, t, n) => t in e ? qe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
4
4
|
var ie = (e, t, n) => (Ke(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
5
5
|
import { jsx as s, Fragment as R, jsxs as P } from "react/jsx-runtime";
|
|
6
|
-
import { TARGET as z, isEditing as
|
|
6
|
+
import { TARGET as z, isEditing as F, isBrowser as M, getUserAttributes as ze, checkIsDefined as G, logger as Z, registerInsertMenu as _e, setupBrowserForEditing as Je, createRegisterComponentMessage as Ye, getDefaultCanTrack as Q, _track as he, isPreviewing as Ge, fetchOneEntry as we, createEditorListener as Qe, fetch as Xe, serializeComponentInfo as ge, handleABTestingSync as Ze } from "./server-entry-0687830a.js";
|
|
7
7
|
import { createContext as Re, useState as T, useEffect as V, useContext as be, useRef as ee, createElement as Ee } from "react";
|
|
8
8
|
const et = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), tt = (e) => typeof e == "string" && et.has(e.toLowerCase());
|
|
9
|
-
function
|
|
9
|
+
function de(e) {
|
|
10
10
|
return /* @__PURE__ */ s(R, { children: tt(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 }) }) });
|
|
11
11
|
}
|
|
12
12
|
const q = () => {
|
|
@@ -38,7 +38,7 @@ function nt(e) {
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
return /* @__PURE__ */ s(
|
|
41
|
-
|
|
41
|
+
de,
|
|
42
42
|
{
|
|
43
43
|
attributes: t(),
|
|
44
44
|
TagName: e.link ? e.builderLinkComponent || "a" : "button",
|
|
@@ -47,7 +47,7 @@ function nt(e) {
|
|
|
47
47
|
}
|
|
48
48
|
);
|
|
49
49
|
}
|
|
50
|
-
const
|
|
50
|
+
const ue = Re({
|
|
51
51
|
content: null,
|
|
52
52
|
context: {},
|
|
53
53
|
localState: void 0,
|
|
@@ -82,7 +82,7 @@ const ot = ({
|
|
|
82
82
|
context: t,
|
|
83
83
|
event: n
|
|
84
84
|
}), at = () => ({
|
|
85
|
-
isEditing:
|
|
85
|
+
isEditing: F(),
|
|
86
86
|
isBrowser: M(),
|
|
87
87
|
isServer: !M(),
|
|
88
88
|
getUserAttributes: () => ze()
|
|
@@ -206,7 +206,7 @@ function K({
|
|
|
206
206
|
return;
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
|
-
const Ve = (e, t, n) => {
|
|
209
|
+
const me = (e) => JSON.parse(JSON.stringify(e)), Ve = (e, t, n) => {
|
|
210
210
|
if (Object(e) !== e)
|
|
211
211
|
return e;
|
|
212
212
|
const i = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
|
|
@@ -221,7 +221,7 @@ const dt = ({
|
|
|
221
221
|
}) => {
|
|
222
222
|
if (!e.bindings)
|
|
223
223
|
return e;
|
|
224
|
-
const r =
|
|
224
|
+
const r = me(e), a = {
|
|
225
225
|
...r,
|
|
226
226
|
properties: {
|
|
227
227
|
...r.properties
|
|
@@ -359,10 +359,10 @@ function ht(e) {
|
|
|
359
359
|
}), r();
|
|
360
360
|
});
|
|
361
361
|
}
|
|
362
|
-
const
|
|
362
|
+
const $e = (e) => Object.entries(e).map(([n, i]) => {
|
|
363
363
|
if (typeof i == "string")
|
|
364
364
|
return `${te(n)}: ${i};`;
|
|
365
|
-
}).filter(G), gt = (e) =>
|
|
365
|
+
}).filter(G), gt = (e) => $e(e).join(`
|
|
366
366
|
`), J = ({
|
|
367
367
|
mediaQuery: e,
|
|
368
368
|
className: t,
|
|
@@ -383,18 +383,18 @@ function bt({
|
|
|
383
383
|
const pt = ({
|
|
384
384
|
block: e,
|
|
385
385
|
context: t
|
|
386
|
-
}) =>
|
|
386
|
+
}) => Fe(bt({
|
|
387
387
|
style: e.style || {},
|
|
388
388
|
context: t,
|
|
389
389
|
block: e
|
|
390
390
|
}));
|
|
391
|
-
function
|
|
391
|
+
function Fe(e) {
|
|
392
392
|
switch (z) {
|
|
393
393
|
case "svelte":
|
|
394
394
|
case "vue":
|
|
395
395
|
case "solid":
|
|
396
396
|
case "angular":
|
|
397
|
-
return
|
|
397
|
+
return $e(e).join(" ");
|
|
398
398
|
case "qwik":
|
|
399
399
|
case "reactNative":
|
|
400
400
|
case "react":
|
|
@@ -498,7 +498,7 @@ const yt = ({
|
|
|
498
498
|
small: e,
|
|
499
499
|
medium: t
|
|
500
500
|
}) => {
|
|
501
|
-
const n =
|
|
501
|
+
const n = me(De);
|
|
502
502
|
if (!e || !t)
|
|
503
503
|
return n;
|
|
504
504
|
const i = Math.floor(e / 2);
|
|
@@ -670,7 +670,7 @@ function fe({
|
|
|
670
670
|
}
|
|
671
671
|
function Pt(e) {
|
|
672
672
|
return /* @__PURE__ */ s(
|
|
673
|
-
|
|
673
|
+
de,
|
|
674
674
|
{
|
|
675
675
|
TagName: e.Wrapper,
|
|
676
676
|
attributes: fe({
|
|
@@ -770,7 +770,7 @@ function xe(e) {
|
|
|
770
770
|
}
|
|
771
771
|
function Nt(e) {
|
|
772
772
|
const [t, n] = T(() => e.repeatContext);
|
|
773
|
-
return /* @__PURE__ */ s(
|
|
773
|
+
return /* @__PURE__ */ s(ue.Provider, { value: t, children: /* @__PURE__ */ s(
|
|
774
774
|
_,
|
|
775
775
|
{
|
|
776
776
|
block: e.block,
|
|
@@ -919,7 +919,7 @@ function Wt(e) {
|
|
|
919
919
|
}
|
|
920
920
|
function n() {
|
|
921
921
|
var o, r;
|
|
922
|
-
|
|
922
|
+
F() && !((o = e.blocks) != null && o.length) && ((r = window.parent) == null || r.postMessage(
|
|
923
923
|
{
|
|
924
924
|
type: "builder.clickEmptyBlocks",
|
|
925
925
|
data: {
|
|
@@ -932,7 +932,7 @@ function Wt(e) {
|
|
|
932
932
|
}
|
|
933
933
|
function i() {
|
|
934
934
|
var o, r;
|
|
935
|
-
|
|
935
|
+
F() && !((o = e.blocks) != null && o.length) && ((r = window.parent) == null || r.postMessage(
|
|
936
936
|
{
|
|
937
937
|
type: "builder.hoverEmptyBlocks",
|
|
938
938
|
data: {
|
|
@@ -967,7 +967,7 @@ function Wt(e) {
|
|
|
967
967
|
}
|
|
968
968
|
function D(e) {
|
|
969
969
|
var i, o, r;
|
|
970
|
-
const t = be(
|
|
970
|
+
const t = be(ue), n = be(Be);
|
|
971
971
|
return /* @__PURE__ */ s(
|
|
972
972
|
Wt,
|
|
973
973
|
{
|
|
@@ -990,36 +990,36 @@ function D(e) {
|
|
|
990
990
|
}
|
|
991
991
|
);
|
|
992
992
|
}
|
|
993
|
-
const
|
|
994
|
-
function
|
|
993
|
+
const $t = (e) => `builder-columns ${e}-breakpoints`;
|
|
994
|
+
function Ft(e) {
|
|
995
995
|
var A, O;
|
|
996
996
|
const [t, n] = T(
|
|
997
997
|
() => typeof e.space == "number" ? e.space || 0 : 20
|
|
998
998
|
), [i, o] = T(() => e.columns || []), [r, a] = T(
|
|
999
999
|
() => e.stackColumnsAt || "tablet"
|
|
1000
1000
|
);
|
|
1001
|
-
function l(
|
|
1002
|
-
return
|
|
1001
|
+
function l(x) {
|
|
1002
|
+
return x.link ? e.builderLinkComponent || "a" : "div";
|
|
1003
1003
|
}
|
|
1004
|
-
function c(
|
|
1004
|
+
function c(x) {
|
|
1005
1005
|
var w;
|
|
1006
|
-
return ((w = i[
|
|
1006
|
+
return ((w = i[x]) == null ? void 0 : w.width) || 100 / i.length;
|
|
1007
1007
|
}
|
|
1008
|
-
function u(
|
|
1009
|
-
const w = c(
|
|
1008
|
+
function u(x) {
|
|
1009
|
+
const w = c(x), N = t * (i.length - 1) * (w / 100);
|
|
1010
1010
|
return `calc(${w}% - ${N}px)`;
|
|
1011
1011
|
}
|
|
1012
1012
|
function f({
|
|
1013
|
-
stackedStyle:
|
|
1013
|
+
stackedStyle: x,
|
|
1014
1014
|
desktopStyle: w
|
|
1015
1015
|
}) {
|
|
1016
|
-
return r === "tablet" ?
|
|
1016
|
+
return r === "tablet" ? x : w;
|
|
1017
1017
|
}
|
|
1018
1018
|
function d({
|
|
1019
|
-
stackedStyle:
|
|
1019
|
+
stackedStyle: x,
|
|
1020
1020
|
desktopStyle: w
|
|
1021
1021
|
}) {
|
|
1022
|
-
return r === "never" ? w :
|
|
1022
|
+
return r === "never" ? w : x;
|
|
1023
1023
|
}
|
|
1024
1024
|
const [m, g] = T(
|
|
1025
1025
|
() => e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column"
|
|
@@ -1033,8 +1033,8 @@ function $t(e) {
|
|
|
1033
1033
|
})
|
|
1034
1034
|
};
|
|
1035
1035
|
}
|
|
1036
|
-
function C(
|
|
1037
|
-
const w =
|
|
1036
|
+
function C(x) {
|
|
1037
|
+
const w = x === 0 ? 0 : t, N = u(x), b = `${w}px`, h = "100%", v = 0;
|
|
1038
1038
|
return {
|
|
1039
1039
|
...{
|
|
1040
1040
|
display: "flex",
|
|
@@ -1048,7 +1048,7 @@ function $t(e) {
|
|
|
1048
1048
|
desktopStyle: N
|
|
1049
1049
|
}),
|
|
1050
1050
|
"--column-margin-left-mobile": d({
|
|
1051
|
-
stackedStyle:
|
|
1051
|
+
stackedStyle: v,
|
|
1052
1052
|
desktopStyle: b
|
|
1053
1053
|
}),
|
|
1054
1054
|
"--column-width-tablet": f({
|
|
@@ -1056,18 +1056,19 @@ function $t(e) {
|
|
|
1056
1056
|
desktopStyle: N
|
|
1057
1057
|
}),
|
|
1058
1058
|
"--column-margin-left-tablet": f({
|
|
1059
|
-
stackedStyle:
|
|
1059
|
+
stackedStyle: v,
|
|
1060
1060
|
desktopStyle: b
|
|
1061
1061
|
})
|
|
1062
1062
|
};
|
|
1063
1063
|
}
|
|
1064
|
-
function p(
|
|
1064
|
+
function p(x) {
|
|
1065
1065
|
var N, b;
|
|
1066
1066
|
return Le(
|
|
1067
1067
|
((b = (N = e.builderContext.content) == null ? void 0 : N.meta) == null ? void 0 : b.breakpoints) || {}
|
|
1068
|
-
)[
|
|
1068
|
+
)[x].max;
|
|
1069
1069
|
}
|
|
1070
1070
|
function B() {
|
|
1071
|
+
const x = `.${e.builderBlock.id}-breakpoints > .builder-column`;
|
|
1071
1072
|
return `
|
|
1072
1073
|
@media (max-width: ${p("medium")}px) {
|
|
1073
1074
|
.${e.builderBlock.id}-breakpoints {
|
|
@@ -1075,7 +1076,7 @@ function $t(e) {
|
|
|
1075
1076
|
align-items: stretch;
|
|
1076
1077
|
}
|
|
1077
1078
|
|
|
1078
|
-
|
|
1079
|
+
${x} {
|
|
1079
1080
|
width: var(--column-width-tablet) !important;
|
|
1080
1081
|
margin-left: var(--column-margin-left-tablet) !important;
|
|
1081
1082
|
}
|
|
@@ -1087,27 +1088,27 @@ function $t(e) {
|
|
|
1087
1088
|
align-items: stretch;
|
|
1088
1089
|
}
|
|
1089
1090
|
|
|
1090
|
-
|
|
1091
|
+
${x} {
|
|
1091
1092
|
width: var(--column-width-mobile) !important;
|
|
1092
1093
|
margin-left: var(--column-margin-left-mobile) !important;
|
|
1093
1094
|
}
|
|
1094
1095
|
},
|
|
1095
1096
|
`;
|
|
1096
1097
|
}
|
|
1097
|
-
function E(
|
|
1098
|
+
function E(x, w) {
|
|
1098
1099
|
return {
|
|
1099
|
-
...
|
|
1100
|
-
href:
|
|
1100
|
+
...x.link ? {
|
|
1101
|
+
href: x.link
|
|
1101
1102
|
} : {},
|
|
1102
1103
|
[q()]: "builder-column",
|
|
1103
|
-
style:
|
|
1104
|
+
style: Fe(C(w))
|
|
1104
1105
|
};
|
|
1105
1106
|
}
|
|
1106
1107
|
return /* @__PURE__ */ P(R, { children: [
|
|
1107
1108
|
/* @__PURE__ */ P(
|
|
1108
1109
|
"div",
|
|
1109
1110
|
{
|
|
1110
|
-
className:
|
|
1111
|
+
className: $t((A = e.builderBlock) == null ? void 0 : A.id) + " div-34f576bb",
|
|
1111
1112
|
style: y(),
|
|
1112
1113
|
children: [
|
|
1113
1114
|
/* @__PURE__ */ s(
|
|
@@ -1118,12 +1119,12 @@ function $t(e) {
|
|
|
1118
1119
|
nonce: e.builderContext.nonce
|
|
1119
1120
|
}
|
|
1120
1121
|
),
|
|
1121
|
-
(O = e.columns) == null ? void 0 : O.map((
|
|
1122
|
-
|
|
1122
|
+
(O = e.columns) == null ? void 0 : O.map((x, w) => /* @__PURE__ */ s(
|
|
1123
|
+
de,
|
|
1123
1124
|
{
|
|
1124
|
-
TagName: l(
|
|
1125
|
+
TagName: l(x),
|
|
1125
1126
|
actionAttributes: {},
|
|
1126
|
-
attributes: E(
|
|
1127
|
+
attributes: E(x, w),
|
|
1127
1128
|
children: /* @__PURE__ */ s(
|
|
1128
1129
|
D,
|
|
1129
1130
|
{
|
|
@@ -1135,7 +1136,7 @@ function $t(e) {
|
|
|
1135
1136
|
context: e.builderContext,
|
|
1136
1137
|
registeredComponents: e.builderComponents,
|
|
1137
1138
|
linkComponent: e.builderLinkComponent,
|
|
1138
|
-
blocks:
|
|
1139
|
+
blocks: x.blocks
|
|
1139
1140
|
}
|
|
1140
1141
|
)
|
|
1141
1142
|
},
|
|
@@ -1144,7 +1145,7 @@ function $t(e) {
|
|
|
1144
1145
|
]
|
|
1145
1146
|
}
|
|
1146
1147
|
),
|
|
1147
|
-
/* @__PURE__ */ s("style", { children: `.div-
|
|
1148
|
+
/* @__PURE__ */ s("style", { children: `.div-34f576bb {
|
|
1148
1149
|
display: flex;
|
|
1149
1150
|
line-height: normal;
|
|
1150
1151
|
}` })
|
|
@@ -2613,7 +2614,7 @@ function fn(e) {
|
|
|
2613
2614
|
e.builderContext.rootSetState ? (p = (C = e.builderContext).rootSetState) == null || p.call(C, y) : e.builderContext.rootState = y;
|
|
2614
2615
|
}
|
|
2615
2616
|
function u() {
|
|
2616
|
-
return
|
|
2617
|
+
return F() && e.previewState || n;
|
|
2617
2618
|
}
|
|
2618
2619
|
function f(g) {
|
|
2619
2620
|
var C;
|
|
@@ -2630,40 +2631,40 @@ function fn(e) {
|
|
|
2630
2631
|
let E;
|
|
2631
2632
|
const A = new FormData(p), O = Array.from(p.querySelectorAll("input,select,textarea")).filter((b) => !!b.name).map((b) => {
|
|
2632
2633
|
let h;
|
|
2633
|
-
const
|
|
2634
|
+
const v = b.name;
|
|
2634
2635
|
if (b instanceof HTMLInputElement)
|
|
2635
2636
|
if (b.type === "radio") {
|
|
2636
2637
|
if (b.checked)
|
|
2637
2638
|
return h = b.name, {
|
|
2638
|
-
key:
|
|
2639
|
+
key: v,
|
|
2639
2640
|
value: h
|
|
2640
2641
|
};
|
|
2641
2642
|
} else if (b.type === "checkbox")
|
|
2642
2643
|
h = b.checked;
|
|
2643
2644
|
else if (b.type === "number" || b.type === "range") {
|
|
2644
|
-
const
|
|
2645
|
-
isNaN(
|
|
2645
|
+
const S = b.valueAsNumber;
|
|
2646
|
+
isNaN(S) || (h = S);
|
|
2646
2647
|
} else
|
|
2647
2648
|
b.type === "file" ? h = b.files : h = b.value;
|
|
2648
2649
|
else
|
|
2649
2650
|
h = b.value;
|
|
2650
2651
|
return {
|
|
2651
|
-
key:
|
|
2652
|
+
key: v,
|
|
2652
2653
|
value: h
|
|
2653
2654
|
};
|
|
2654
2655
|
});
|
|
2655
|
-
let
|
|
2656
|
-
if (e.sendSubmissionsTo === "email" && (
|
|
2657
|
-
(b instanceof File || Array.isArray(b) && b[0] instanceof File || b instanceof FileList) && (
|
|
2658
|
-
}),
|
|
2656
|
+
let x = e.contentType;
|
|
2657
|
+
if (e.sendSubmissionsTo === "email" && (x = "multipart/form-data"), Array.from(O).forEach(({ value: b }) => {
|
|
2658
|
+
(b instanceof File || Array.isArray(b) && b[0] instanceof File || b instanceof FileList) && (x = "multipart/form-data");
|
|
2659
|
+
}), x !== "application/json")
|
|
2659
2660
|
E = A;
|
|
2660
2661
|
else {
|
|
2661
2662
|
const b = {};
|
|
2662
|
-
Array.from(O).forEach(({ value: h, key:
|
|
2663
|
-
Ve(b,
|
|
2663
|
+
Array.from(O).forEach(({ value: h, key: v }) => {
|
|
2664
|
+
Ve(b, v, h);
|
|
2664
2665
|
}), E = JSON.stringify(b);
|
|
2665
2666
|
}
|
|
2666
|
-
|
|
2667
|
+
x && x !== "multipart/form-data" && (y && ((C = e.action) != null && C.includes("zapier.com")) || (B["content-type"] = x));
|
|
2667
2668
|
const w = new CustomEvent("presubmit", { detail: { body: E } });
|
|
2668
2669
|
if (t.current && (t.current.dispatchEvent(w), w.defaultPrevented))
|
|
2669
2670
|
return;
|
|
@@ -2677,17 +2678,17 @@ function fn(e) {
|
|
|
2677
2678
|
).then(
|
|
2678
2679
|
async (b) => {
|
|
2679
2680
|
let h;
|
|
2680
|
-
const
|
|
2681
|
-
if (
|
|
2682
|
-
let
|
|
2683
|
-
|
|
2681
|
+
const v = b.headers.get("content-type");
|
|
2682
|
+
if (v && v.indexOf("application/json") !== -1 ? h = await b.json() : h = await b.text(), !b.ok && e.errorMessagePath) {
|
|
2683
|
+
let S = mn(h, e.errorMessagePath);
|
|
2684
|
+
S && (typeof S != "string" && (S = JSON.stringify(S)), l(S), c({ formErrorMessage: S }));
|
|
2684
2685
|
}
|
|
2685
2686
|
if (r(h), i(b.ok ? "success" : "error"), b.ok) {
|
|
2686
|
-
const
|
|
2687
|
+
const S = new CustomEvent("submit:success", {
|
|
2687
2688
|
detail: { res: b, body: h }
|
|
2688
2689
|
});
|
|
2689
2690
|
if (t.current) {
|
|
2690
|
-
if (t.current.dispatchEvent(
|
|
2691
|
+
if (t.current.dispatchEvent(S), S.defaultPrevented)
|
|
2691
2692
|
return;
|
|
2692
2693
|
e.resetFormOnSubmit !== !1 && t.current.reset();
|
|
2693
2694
|
}
|
|
@@ -2823,7 +2824,7 @@ function gn(e) {
|
|
|
2823
2824
|
"input",
|
|
2824
2825
|
{
|
|
2825
2826
|
...e.attributes,
|
|
2826
|
-
key:
|
|
2827
|
+
key: F() && e.defaultValue ? e.defaultValue : "default-key",
|
|
2827
2828
|
placeholder: e.placeholder,
|
|
2828
2829
|
type: e.type,
|
|
2829
2830
|
name: e.name,
|
|
@@ -2883,7 +2884,7 @@ function pn(e) {
|
|
|
2883
2884
|
{
|
|
2884
2885
|
...e.attributes,
|
|
2885
2886
|
value: e.value,
|
|
2886
|
-
key:
|
|
2887
|
+
key: F() && e.defaultValue ? e.defaultValue : "default-key",
|
|
2887
2888
|
defaultValue: e.defaultValue,
|
|
2888
2889
|
name: e.name,
|
|
2889
2890
|
required: e.required
|
|
@@ -2997,7 +2998,7 @@ function Cn(e) {
|
|
|
2997
2998
|
src: e.imgSrc || e.image,
|
|
2998
2999
|
...e.attributes
|
|
2999
3000
|
},
|
|
3000
|
-
|
|
3001
|
+
F() && e.imgSrc || "default-key"
|
|
3001
3002
|
);
|
|
3002
3003
|
}
|
|
3003
3004
|
const Tn = {
|
|
@@ -3217,7 +3218,7 @@ const wn = () => [{
|
|
|
3217
3218
|
component: nt,
|
|
3218
3219
|
...qt
|
|
3219
3220
|
}, {
|
|
3220
|
-
component:
|
|
3221
|
+
component: Ft,
|
|
3221
3222
|
...Kt
|
|
3222
3223
|
}, {
|
|
3223
3224
|
component: Dt,
|
|
@@ -3376,7 +3377,7 @@ const Wn = (e, t, n = !0) => {
|
|
|
3376
3377
|
return i;
|
|
3377
3378
|
} while (i = i.parentElement);
|
|
3378
3379
|
return null;
|
|
3379
|
-
},
|
|
3380
|
+
}, $n = (e) => Wn(e, (t) => {
|
|
3380
3381
|
const n = t.getAttribute("builder-id") || t.id;
|
|
3381
3382
|
return (n == null ? void 0 : n.indexOf("builder-")) === 0;
|
|
3382
3383
|
}), Te = ({
|
|
@@ -3388,8 +3389,8 @@ const Wn = (e, t, n = !0) => {
|
|
|
3388
3389
|
x: r,
|
|
3389
3390
|
y: a
|
|
3390
3391
|
};
|
|
3391
|
-
},
|
|
3392
|
-
const t = e.target, n = t &&
|
|
3392
|
+
}, Fn = (e) => {
|
|
3393
|
+
const t = e.target, n = t && $n(t), i = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
|
|
3393
3394
|
return {
|
|
3394
3395
|
targetBuilderElement: i || void 0,
|
|
3395
3396
|
metadata: {
|
|
@@ -3457,26 +3458,26 @@ font-weight: ${l};
|
|
|
3457
3458
|
}
|
|
3458
3459
|
`, Un = (e) => e ? "" : jn, Mn = (e) => `variant-${e}`;
|
|
3459
3460
|
function Hn(e) {
|
|
3460
|
-
var E, A, O,
|
|
3461
|
+
var E, A, O, x, w, N, b;
|
|
3461
3462
|
const t = ee(null);
|
|
3462
3463
|
function n(h) {
|
|
3463
|
-
var
|
|
3464
|
-
const
|
|
3464
|
+
var S, k;
|
|
3465
|
+
const v = {
|
|
3465
3466
|
...e.builderContextSignal.rootState,
|
|
3466
3467
|
...h
|
|
3467
3468
|
};
|
|
3468
|
-
e.builderContextSignal.rootSetState ? (k = (
|
|
3469
|
+
e.builderContextSignal.rootSetState ? (k = (S = e.builderContextSignal).rootSetState) == null || k.call(S, v) : e.setBuilderContextSignal((I) => ({
|
|
3469
3470
|
...I,
|
|
3470
|
-
rootState:
|
|
3471
|
+
rootState: v
|
|
3471
3472
|
}));
|
|
3472
3473
|
}
|
|
3473
3474
|
function i(h) {
|
|
3474
|
-
var
|
|
3475
|
-
const
|
|
3475
|
+
var S, k, I, W, j;
|
|
3476
|
+
const v = {
|
|
3476
3477
|
...e.builderContextSignal.content,
|
|
3477
3478
|
...h,
|
|
3478
3479
|
data: {
|
|
3479
|
-
...(
|
|
3480
|
+
...(S = e.builderContextSignal.content) == null ? void 0 : S.data,
|
|
3480
3481
|
...h == null ? void 0 : h.data
|
|
3481
3482
|
},
|
|
3482
3483
|
meta: {
|
|
@@ -3485,9 +3486,9 @@ function Hn(e) {
|
|
|
3485
3486
|
breakpoints: ((I = h == null ? void 0 : h.meta) == null ? void 0 : I.breakpoints) || ((j = (W = e.builderContextSignal.content) == null ? void 0 : W.meta) == null ? void 0 : j.breakpoints)
|
|
3486
3487
|
}
|
|
3487
3488
|
};
|
|
3488
|
-
e.setBuilderContextSignal((
|
|
3489
|
-
|
|
3490
|
-
content:
|
|
3489
|
+
e.setBuilderContextSignal(($) => ({
|
|
3490
|
+
...$,
|
|
3491
|
+
content: v
|
|
3491
3492
|
}));
|
|
3492
3493
|
}
|
|
3493
3494
|
function o() {
|
|
@@ -3504,27 +3505,27 @@ function Hn(e) {
|
|
|
3504
3505
|
model: e.model,
|
|
3505
3506
|
trustedHosts: e.trustedHosts,
|
|
3506
3507
|
callbacks: {
|
|
3507
|
-
configureSdk: (
|
|
3508
|
+
configureSdk: (v) => {
|
|
3508
3509
|
var I;
|
|
3509
|
-
const { breakpoints:
|
|
3510
|
-
!k || k !== ((I = e.builderContextSignal.content) == null ? void 0 : I.id) ||
|
|
3510
|
+
const { breakpoints: S, contentId: k } = v;
|
|
3511
|
+
!k || k !== ((I = e.builderContextSignal.content) == null ? void 0 : I.id) || S && i({
|
|
3511
3512
|
meta: {
|
|
3512
|
-
breakpoints:
|
|
3513
|
+
breakpoints: S
|
|
3513
3514
|
}
|
|
3514
3515
|
});
|
|
3515
3516
|
},
|
|
3516
|
-
animation: (
|
|
3517
|
-
We(
|
|
3517
|
+
animation: (v) => {
|
|
3518
|
+
We(v);
|
|
3518
3519
|
},
|
|
3519
|
-
contentUpdate: (
|
|
3520
|
-
i(
|
|
3520
|
+
contentUpdate: (v) => {
|
|
3521
|
+
i(v);
|
|
3521
3522
|
}
|
|
3522
3523
|
}
|
|
3523
3524
|
})(h);
|
|
3524
3525
|
}
|
|
3525
3526
|
function c() {
|
|
3526
|
-
var
|
|
3527
|
-
const h = (
|
|
3527
|
+
var v, S;
|
|
3528
|
+
const h = (S = (v = e.builderContextSignal.content) == null ? void 0 : v.data) == null ? void 0 : S.jsCode;
|
|
3528
3529
|
h && K({
|
|
3529
3530
|
code: h,
|
|
3530
3531
|
context: e.context || {},
|
|
@@ -3539,31 +3540,31 @@ function Hn(e) {
|
|
|
3539
3540
|
}
|
|
3540
3541
|
const [u, f] = T(() => ({})), [d, m] = T(() => ({})), [g, y] = T(() => !1);
|
|
3541
3542
|
function C(h) {
|
|
3542
|
-
var
|
|
3543
|
+
var v, S;
|
|
3543
3544
|
if (e.builderContextSignal.content) {
|
|
3544
|
-
const k = (
|
|
3545
|
+
const k = (v = e.builderContextSignal.content) == null ? void 0 : v.testVariationId, I = (S = e.builderContextSignal.content) == null ? void 0 : S.id;
|
|
3545
3546
|
he({
|
|
3546
3547
|
type: "click",
|
|
3547
3548
|
canTrack: Q(e.canTrack),
|
|
3548
3549
|
contentId: I,
|
|
3549
3550
|
apiKey: e.apiKey,
|
|
3550
3551
|
variationId: k !== I ? k : void 0,
|
|
3551
|
-
|
|
3552
|
+
...Fn(h),
|
|
3552
3553
|
unique: !g
|
|
3553
3554
|
});
|
|
3554
3555
|
}
|
|
3555
3556
|
g || y(!0);
|
|
3556
3557
|
}
|
|
3557
3558
|
function p() {
|
|
3558
|
-
var
|
|
3559
|
-
const h = (k = (
|
|
3559
|
+
var v, S, k;
|
|
3560
|
+
const h = (k = (S = (v = e.builderContextSignal.content) == null ? void 0 : v.data) == null ? void 0 : S.httpRequests) != null ? k : {};
|
|
3560
3561
|
Object.entries(h).forEach(([I, W]) => {
|
|
3561
|
-
if (!W || d[I] || u[I] &&
|
|
3562
|
+
if (!W || d[I] || u[I] && !F())
|
|
3562
3563
|
return;
|
|
3563
3564
|
d[I] = !0;
|
|
3564
3565
|
const j = W.replace(
|
|
3565
3566
|
/{{([^}]+)}}/g,
|
|
3566
|
-
(
|
|
3567
|
+
($, He) => String(
|
|
3567
3568
|
K({
|
|
3568
3569
|
code: He,
|
|
3569
3570
|
context: e.context || {},
|
|
@@ -3574,24 +3575,24 @@ function Hn(e) {
|
|
|
3574
3575
|
})
|
|
3575
3576
|
)
|
|
3576
3577
|
);
|
|
3577
|
-
Xe(j).then((
|
|
3578
|
+
Xe(j).then(($) => $.json()).then(($) => {
|
|
3578
3579
|
n({
|
|
3579
|
-
[I]:
|
|
3580
|
+
[I]: $
|
|
3580
3581
|
}), u[I] = !0;
|
|
3581
|
-
}).catch((
|
|
3582
|
-
console.error("error fetching dynamic data", W,
|
|
3582
|
+
}).catch(($) => {
|
|
3583
|
+
console.error("error fetching dynamic data", W, $);
|
|
3583
3584
|
}).finally(() => {
|
|
3584
3585
|
d[I] = !1;
|
|
3585
3586
|
});
|
|
3586
3587
|
});
|
|
3587
3588
|
}
|
|
3588
3589
|
function B() {
|
|
3589
|
-
|
|
3590
|
+
F() && window.dispatchEvent(
|
|
3590
3591
|
new CustomEvent(
|
|
3591
3592
|
"builder:component:stateChange",
|
|
3592
3593
|
{
|
|
3593
3594
|
detail: {
|
|
3594
|
-
state:
|
|
3595
|
+
state: me(e.builderContextSignal.rootState),
|
|
3595
3596
|
ref: {
|
|
3596
3597
|
name: e.model
|
|
3597
3598
|
}
|
|
@@ -3601,9 +3602,9 @@ function Hn(e) {
|
|
|
3601
3602
|
);
|
|
3602
3603
|
}
|
|
3603
3604
|
return V(() => {
|
|
3604
|
-
var h,
|
|
3605
|
+
var h, v;
|
|
3605
3606
|
if (M()) {
|
|
3606
|
-
if (
|
|
3607
|
+
if (F() && (window.addEventListener("message", l), _e(), Je({
|
|
3607
3608
|
...e.locale ? {
|
|
3608
3609
|
locale: e.locale
|
|
3609
3610
|
} : {},
|
|
@@ -3623,7 +3624,7 @@ function Hn(e) {
|
|
|
3623
3624
|
"builder:component:stateChangeListenerActivated",
|
|
3624
3625
|
B
|
|
3625
3626
|
)), e.builderContextSignal.content && Q(e.canTrack)) {
|
|
3626
|
-
const k = (h = e.builderContextSignal.content) == null ? void 0 : h.testVariationId, I = (
|
|
3627
|
+
const k = (h = e.builderContextSignal.content) == null ? void 0 : h.testVariationId, I = (v = e.builderContextSignal.content) == null ? void 0 : v.id, W = e.apiKey;
|
|
3627
3628
|
he({
|
|
3628
3629
|
type: "impression",
|
|
3629
3630
|
canTrack: !0,
|
|
@@ -3632,7 +3633,7 @@ function Hn(e) {
|
|
|
3632
3633
|
variationId: k !== I ? k : void 0
|
|
3633
3634
|
});
|
|
3634
3635
|
}
|
|
3635
|
-
if (Ge() &&
|
|
3636
|
+
if (Ge() && !F()) {
|
|
3636
3637
|
const k = new URL(location.href).searchParams, I = k.get("builder.preview"), W = k.get(
|
|
3637
3638
|
`builder.overrides.${I}`
|
|
3638
3639
|
), j = k.get("apiKey") || k.get("builder.space");
|
|
@@ -3640,8 +3641,8 @@ function Hn(e) {
|
|
|
3640
3641
|
model: e.model,
|
|
3641
3642
|
apiKey: e.apiKey,
|
|
3642
3643
|
apiVersion: e.builderContextSignal.apiVersion
|
|
3643
|
-
}).then((
|
|
3644
|
-
|
|
3644
|
+
}).then(($) => {
|
|
3645
|
+
$ && i($);
|
|
3645
3646
|
});
|
|
3646
3647
|
}
|
|
3647
3648
|
}
|
|
@@ -3655,7 +3656,7 @@ function Hn(e) {
|
|
|
3655
3656
|
c();
|
|
3656
3657
|
}, [(A = (E = e.builderContextSignal.content) == null ? void 0 : E.data) == null ? void 0 : A.jsCode]), V(() => {
|
|
3657
3658
|
p();
|
|
3658
|
-
}, [(
|
|
3659
|
+
}, [(x = (O = e.builderContextSignal.content) == null ? void 0 : O.data) == null ? void 0 : x.httpRequests]), V(() => {
|
|
3659
3660
|
B();
|
|
3660
3661
|
}, [e.builderContextSignal.rootState]), V(() => {
|
|
3661
3662
|
e.data && n(e.data);
|
|
@@ -3668,7 +3669,7 @@ function Hn(e) {
|
|
|
3668
3669
|
"builder:component:stateChangeListenerActivated",
|
|
3669
3670
|
B
|
|
3670
3671
|
));
|
|
3671
|
-
}, []), /* @__PURE__ */ s(
|
|
3672
|
+
}, []), /* @__PURE__ */ s(ue.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ s(
|
|
3672
3673
|
r,
|
|
3673
3674
|
{
|
|
3674
3675
|
ref: t,
|
|
@@ -4053,9 +4054,9 @@ function Yn(e) {
|
|
|
4053
4054
|
}
|
|
4054
4055
|
export {
|
|
4055
4056
|
D as Blocks,
|
|
4056
|
-
|
|
4057
|
+
ue as BuilderContext,
|
|
4057
4058
|
nt as Button,
|
|
4058
|
-
|
|
4059
|
+
Ft as Columns,
|
|
4059
4060
|
_n as Content,
|
|
4060
4061
|
Dt as Fragment,
|
|
4061
4062
|
jt as Image,
|
package/lib/browser/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-02cecfb7.cjs");require("react/jsx-runtime");require("react");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.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
|