@builder.io/sdk-react 1.0.14 → 1.0.16
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 +5 -5
- package/lib/browser/blocks-exports.mjs +48 -24
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/server-entry-11e01841.cjs +2 -0
- package/lib/browser/{server-entry-df552d27.js → server-entry-afeff3cb.js} +16 -15
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{blocks-dbf6f051.js → blocks-8e5cc463.js} +10 -4
- package/lib/edge/{blocks-75e914c4.cjs → blocks-a0a9d452.cjs} +2 -2
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-4e7f9eff.cjs → button-66c46316.cjs} +1 -1
- package/lib/edge/{button-db8d78a4.js → button-764707c4.js} +2 -2
- package/lib/edge/{columns-8399aa74.cjs → columns-0a14db0e.cjs} +2 -2
- package/lib/edge/{columns-9765610b.js → columns-0bdc7586.js} +27 -27
- package/lib/edge/{content-variants-ed22bfec.cjs → content-variants-c03ec7a1.cjs} +8 -8
- package/lib/edge/{content-variants-9a129944.js → content-variants-db1e0281.js} +140 -122
- package/lib/edge/{form-7a73e99c.js → form-7a6f998f.js} +3 -3
- package/lib/edge/{form-bc7b5558.cjs → form-a5d18c89.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-83fffba1.js → get-class-prop-name-49cbb2c6.js} +1 -1
- package/lib/edge/{get-class-prop-name-3c370466.cjs → get-class-prop-name-bbc4d2f3.cjs} +1 -1
- package/lib/edge/{img-7d93925c.cjs → img-058cb6f0.cjs} +1 -1
- package/lib/edge/{img-c944597b.js → img-c9630f56.js} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-d735cf41.js → input-3de90790.js} +1 -1
- package/lib/edge/{input-72be594b.cjs → input-ceacd029.cjs} +1 -1
- package/lib/edge/{select-3411462e.cjs → select-df72f987.cjs} +1 -1
- package/lib/edge/{select-5e67472b.js → select-ee266e60.js} +1 -1
- package/lib/edge/{server-entry-5e5c1898.js → server-entry-2b1068fd.js} +17 -16
- package/lib/edge/{server-entry-62fc8a1d.cjs → server-entry-ef266884.cjs} +2 -2
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-04d29096.cjs → slot-83d735d6.cjs} +1 -1
- package/lib/edge/{slot-495693a8.js → slot-f246e67e.js} +3 -3
- package/lib/edge/{symbol-ad121694.cjs → symbol-991f09b3.cjs} +1 -1
- package/lib/edge/{symbol-c29e2a25.js → symbol-f68a7357.js} +2 -2
- package/lib/node/blocks-exports.cjs +9 -9
- package/lib/node/blocks-exports.mjs +257 -233
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +1 -1
- package/lib/node/server-entry-4ba58cf3.cjs +2 -0
- package/lib/node/{server-entry-3a79d01e.js → server-entry-a221fe66.js} +16 -15
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/package.json +1 -1
- package/types/components/content-variants/helpers.d.ts +1 -1
- package/types/components/inlined-script.d.ts +1 -1
- package/types/components/inlined-styles.d.ts +1 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/functions/get-content/types.d.ts +8 -0
- package/lib/browser/server-entry-742c121c.cjs +0 -2
- package/lib/node/server-entry-f5a4cdfa.cjs +0 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { lazy as k, useRef as te, useState as I, useEffect as
|
|
3
|
-
import { isBrowser as U, TARGET as Q, isEditing as A, registerInsertMenu as ne, setupBrowserForEditing as ae, createRegisterComponentMessage as ie, getDefaultCanTrack as W, _track as _, isPreviewing as oe, fetchOneEntry as re, logger as se, createEditorListener as le, fastClone as de, fetch as ce, serializeComponentInfo as B, handleABTestingSync as ue } from "./server-entry-
|
|
1
|
+
import { jsx as f, jsxs as P, Fragment as K } from "react/jsx-runtime";
|
|
2
|
+
import { lazy as k, useRef as te, useState as I, useEffect as v } from "react";
|
|
3
|
+
import { isBrowser as U, TARGET as Q, isEditing as A, registerInsertMenu as ne, setupBrowserForEditing as ae, createRegisterComponentMessage as ie, getDefaultCanTrack as W, _track as _, isPreviewing as oe, fetchOneEntry as re, logger as se, createEditorListener as le, fastClone as de, fetch as ce, serializeComponentInfo as B, handleABTestingSync as ue } from "./server-entry-2b1068fd.js";
|
|
4
4
|
import { Video as me, Button as pe, Columns as ge, Fragment as fe, Image as he, Section as be, Symbol as ye, Text as xe } from "./blocks-exports.mjs";
|
|
5
|
-
import { builderContext as
|
|
6
|
-
import "./get-class-prop-name-
|
|
5
|
+
import { builderContext as ve, triggerAnimation as Se, evaluate as M, InlinedStyles as G, ComponentsContext as Ie, Blocks as ke } from "./blocks-8e5cc463.js";
|
|
6
|
+
import "./get-class-prop-name-49cbb2c6.js";
|
|
7
7
|
import "./dynamic-renderer-8b343325.js";
|
|
8
8
|
const Te = {
|
|
9
9
|
name: "Core:Button",
|
|
@@ -217,7 +217,7 @@ const Te = {
|
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
219
|
const n = e.get("columns");
|
|
220
|
-
Array.isArray(n) && n.find((u) => u.get("width")) && (n.find((p) => !p.get("width")) || n.reduce((
|
|
220
|
+
Array.isArray(n) && n.find((u) => u.get("width")) && (n.find((p) => !p.get("width")) || n.reduce((o, m) => o + m.get("width"), 0) !== 100) && t();
|
|
221
221
|
}
|
|
222
222
|
}, {
|
|
223
223
|
name: "space",
|
|
@@ -265,17 +265,17 @@ const Te = {
|
|
|
265
265
|
defaultValue: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",
|
|
266
266
|
onChange: (e) => {
|
|
267
267
|
e.delete("srcset"), e.delete("noWebp");
|
|
268
|
-
function n(i,
|
|
269
|
-
return new Promise((
|
|
268
|
+
function n(i, o = 6e4) {
|
|
269
|
+
return new Promise((m, y) => {
|
|
270
270
|
const x = document.createElement("img");
|
|
271
271
|
let T = !1;
|
|
272
272
|
x.onload = () => {
|
|
273
|
-
T = !0,
|
|
273
|
+
T = !0, m(x);
|
|
274
274
|
}, x.addEventListener("error", (C) => {
|
|
275
|
-
console.warn("Image load failed", C.error),
|
|
275
|
+
console.warn("Image load failed", C.error), y(C.error);
|
|
276
276
|
}), x.src = i, setTimeout(() => {
|
|
277
|
-
T ||
|
|
278
|
-
},
|
|
277
|
+
T || y(new Error("Image load timed out"));
|
|
278
|
+
}, o);
|
|
279
279
|
});
|
|
280
280
|
}
|
|
281
281
|
function a(i) {
|
|
@@ -286,8 +286,8 @@ const Te = {
|
|
|
286
286
|
i.type.includes("svg") && e.set("noWebp", !0);
|
|
287
287
|
}), u && (!p || p === 0.7041))
|
|
288
288
|
return n(u).then((i) => {
|
|
289
|
-
const
|
|
290
|
-
e.get("image") === u && (!
|
|
289
|
+
const o = e.get("aspectRatio");
|
|
290
|
+
e.get("image") === u && (!o || o === 0.7041) && i.width && i.height && (e.set("aspectRatio", a(i.height / i.width)), e.set("height", i.height), e.set("width", i.width));
|
|
291
291
|
});
|
|
292
292
|
}
|
|
293
293
|
}, {
|
|
@@ -397,7 +397,7 @@ const Te = {
|
|
|
397
397
|
required: !0,
|
|
398
398
|
defaultValue: "children"
|
|
399
399
|
}]
|
|
400
|
-
}, Fe = k(() => import("./slot-
|
|
400
|
+
}, Fe = k(() => import("./slot-f246e67e.js")), We = {
|
|
401
401
|
name: "Symbol",
|
|
402
402
|
noWrap: !0,
|
|
403
403
|
static: !0,
|
|
@@ -726,7 +726,7 @@ const Te = {
|
|
|
726
726
|
}
|
|
727
727
|
}
|
|
728
728
|
}]
|
|
729
|
-
}, Le = k(() => import("./form-
|
|
729
|
+
}, Le = k(() => import("./form-7a6f998f.js")), Ne = {
|
|
730
730
|
name: "Form:Input",
|
|
731
731
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
732
732
|
inputs: [
|
|
@@ -777,7 +777,7 @@ const Te = {
|
|
|
777
777
|
borderStyle: "solid",
|
|
778
778
|
borderColor: "#ccc"
|
|
779
779
|
}
|
|
780
|
-
}, je = k(() => import("./input-
|
|
780
|
+
}, je = k(() => import("./input-3de90790.js")), qe = {
|
|
781
781
|
name: "Form:Select",
|
|
782
782
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
783
783
|
defaultStyles: {
|
|
@@ -819,7 +819,7 @@ const Te = {
|
|
|
819
819
|
}],
|
|
820
820
|
static: !0,
|
|
821
821
|
noWrap: !0
|
|
822
|
-
}, Ke = k(() => import("./select-
|
|
822
|
+
}, Ke = k(() => import("./select-ee266e60.js")), _e = {
|
|
823
823
|
name: "Form:SubmitButton",
|
|
824
824
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
825
825
|
defaultStyles: {
|
|
@@ -858,7 +858,7 @@ const Te = {
|
|
|
858
858
|
}],
|
|
859
859
|
noWrap: !0,
|
|
860
860
|
static: !0
|
|
861
|
-
}, Oe = k(() => import("./img-
|
|
861
|
+
}, Oe = k(() => import("./img-c9630f56.js")), ze = {
|
|
862
862
|
name: "Video",
|
|
863
863
|
canHaveChildren: !0,
|
|
864
864
|
defaultStyles: {
|
|
@@ -1097,11 +1097,11 @@ const Te = {
|
|
|
1097
1097
|
"${t}", "${e}", ${ee}
|
|
1098
1098
|
)`;
|
|
1099
1099
|
function $(e) {
|
|
1100
|
-
return /* @__PURE__ */
|
|
1100
|
+
return /* @__PURE__ */ f(
|
|
1101
1101
|
"script",
|
|
1102
1102
|
{
|
|
1103
1103
|
dangerouslySetInnerHTML: { __html: e.scriptStr },
|
|
1104
|
-
id: e.id
|
|
1104
|
+
"data-id": e.id
|
|
1105
1105
|
}
|
|
1106
1106
|
);
|
|
1107
1107
|
}
|
|
@@ -1149,32 +1149,32 @@ const nt = (e, t, n = !0) => {
|
|
|
1149
1149
|
};
|
|
1150
1150
|
};
|
|
1151
1151
|
function ot(e) {
|
|
1152
|
-
var
|
|
1152
|
+
var S, D, H, L, N, j, q;
|
|
1153
1153
|
const t = te(null);
|
|
1154
|
-
function n(
|
|
1154
|
+
function n(r) {
|
|
1155
1155
|
var l, d;
|
|
1156
1156
|
const s = {
|
|
1157
1157
|
...e.builderContextSignal.rootState,
|
|
1158
|
-
...
|
|
1158
|
+
...r
|
|
1159
1159
|
};
|
|
1160
1160
|
e.builderContextSignal.rootSetState ? (d = (l = e.builderContextSignal).rootSetState) == null || d.call(l, s) : e.setBuilderContextSignal((c) => ({
|
|
1161
1161
|
...c,
|
|
1162
1162
|
rootState: s
|
|
1163
1163
|
}));
|
|
1164
1164
|
}
|
|
1165
|
-
function a(
|
|
1165
|
+
function a(r) {
|
|
1166
1166
|
var l, d, c, g, w;
|
|
1167
1167
|
const s = {
|
|
1168
1168
|
...e.builderContextSignal.content,
|
|
1169
|
-
...
|
|
1169
|
+
...r,
|
|
1170
1170
|
data: {
|
|
1171
1171
|
...(l = e.builderContextSignal.content) == null ? void 0 : l.data,
|
|
1172
|
-
...
|
|
1172
|
+
...r == null ? void 0 : r.data
|
|
1173
1173
|
},
|
|
1174
1174
|
meta: {
|
|
1175
1175
|
...(d = e.builderContextSignal.content) == null ? void 0 : d.meta,
|
|
1176
|
-
...
|
|
1177
|
-
breakpoints: ((c =
|
|
1176
|
+
...r == null ? void 0 : r.meta,
|
|
1177
|
+
breakpoints: ((c = r == null ? void 0 : r.meta) == null ? void 0 : c.breakpoints) || ((w = (g = e.builderContextSignal.content) == null ? void 0 : g.meta) == null ? void 0 : w.breakpoints)
|
|
1178
1178
|
}
|
|
1179
1179
|
};
|
|
1180
1180
|
e.setBuilderContextSignal((E) => ({
|
|
@@ -1185,7 +1185,7 @@ function ot(e) {
|
|
|
1185
1185
|
const [u, p] = I(
|
|
1186
1186
|
() => e.contentWrapper || "div"
|
|
1187
1187
|
);
|
|
1188
|
-
function i(
|
|
1188
|
+
function i(r) {
|
|
1189
1189
|
return le({
|
|
1190
1190
|
model: e.model,
|
|
1191
1191
|
trustedHosts: e.trustedHosts,
|
|
@@ -1200,19 +1200,19 @@ function ot(e) {
|
|
|
1200
1200
|
});
|
|
1201
1201
|
},
|
|
1202
1202
|
animation: (s) => {
|
|
1203
|
-
|
|
1203
|
+
Se(s);
|
|
1204
1204
|
},
|
|
1205
1205
|
contentUpdate: (s) => {
|
|
1206
1206
|
a(s);
|
|
1207
1207
|
}
|
|
1208
1208
|
}
|
|
1209
|
-
})(
|
|
1209
|
+
})(r);
|
|
1210
1210
|
}
|
|
1211
|
-
function
|
|
1211
|
+
function o() {
|
|
1212
1212
|
var s, l;
|
|
1213
|
-
const
|
|
1214
|
-
|
|
1215
|
-
code:
|
|
1213
|
+
const r = (l = (s = e.builderContextSignal.content) == null ? void 0 : s.data) == null ? void 0 : l.jsCode;
|
|
1214
|
+
r && M({
|
|
1215
|
+
code: r,
|
|
1216
1216
|
context: e.context || {},
|
|
1217
1217
|
localState: void 0,
|
|
1218
1218
|
rootState: e.builderContextSignal.rootState,
|
|
@@ -1223,8 +1223,8 @@ function ot(e) {
|
|
|
1223
1223
|
enableCache: !1
|
|
1224
1224
|
});
|
|
1225
1225
|
}
|
|
1226
|
-
const [
|
|
1227
|
-
function C(
|
|
1226
|
+
const [m, y] = I(() => ({})), [x, T] = I(() => !1);
|
|
1227
|
+
function C(r) {
|
|
1228
1228
|
var s, l;
|
|
1229
1229
|
if (e.builderContextSignal.content) {
|
|
1230
1230
|
const d = (s = e.builderContextSignal.content) == null ? void 0 : s.testVariationId, c = (l = e.builderContextSignal.content) == null ? void 0 : l.id;
|
|
@@ -1234,14 +1234,14 @@ function ot(e) {
|
|
|
1234
1234
|
contentId: c,
|
|
1235
1235
|
apiKey: e.apiKey,
|
|
1236
1236
|
variationId: d !== c ? d : void 0,
|
|
1237
|
-
...it(
|
|
1237
|
+
...it(r),
|
|
1238
1238
|
unique: !x
|
|
1239
1239
|
});
|
|
1240
1240
|
}
|
|
1241
1241
|
x || T(!0);
|
|
1242
1242
|
}
|
|
1243
|
-
function V(
|
|
1244
|
-
return
|
|
1243
|
+
function V(r) {
|
|
1244
|
+
return r.replace(
|
|
1245
1245
|
/{{([^}]+)}}/g,
|
|
1246
1246
|
(s, l) => String(
|
|
1247
1247
|
M({
|
|
@@ -1255,23 +1255,23 @@ function ot(e) {
|
|
|
1255
1255
|
)
|
|
1256
1256
|
);
|
|
1257
1257
|
}
|
|
1258
|
-
function R({ url:
|
|
1259
|
-
ce(
|
|
1258
|
+
function R({ url: r, key: s }) {
|
|
1259
|
+
ce(r).then((l) => l.json()).then((l) => {
|
|
1260
1260
|
var c, g;
|
|
1261
1261
|
const d = {
|
|
1262
1262
|
...e.builderContextSignal.rootState,
|
|
1263
1263
|
[s]: l
|
|
1264
1264
|
};
|
|
1265
|
-
(g = (c = e.builderContextSignal).rootSetState) == null || g.call(c, d),
|
|
1265
|
+
(g = (c = e.builderContextSignal).rootSetState) == null || g.call(c, d), m[s] = !0;
|
|
1266
1266
|
}).catch((l) => {
|
|
1267
|
-
console.error("error fetching dynamic data",
|
|
1267
|
+
console.error("error fetching dynamic data", r, l);
|
|
1268
1268
|
});
|
|
1269
1269
|
}
|
|
1270
|
-
function
|
|
1270
|
+
function b() {
|
|
1271
1271
|
var s, l, d;
|
|
1272
|
-
const
|
|
1273
|
-
Object.entries(
|
|
1274
|
-
if (g && (!
|
|
1272
|
+
const r = (d = (l = (s = e.builderContextSignal.content) == null ? void 0 : s.data) == null ? void 0 : l.httpRequests) != null ? d : {};
|
|
1273
|
+
Object.entries(r).forEach(([c, g]) => {
|
|
1274
|
+
if (g && (!m[c] || A())) {
|
|
1275
1275
|
const w = V(g);
|
|
1276
1276
|
R({
|
|
1277
1277
|
url: w,
|
|
@@ -1280,7 +1280,7 @@ function ot(e) {
|
|
|
1280
1280
|
}
|
|
1281
1281
|
});
|
|
1282
1282
|
}
|
|
1283
|
-
function
|
|
1283
|
+
function h() {
|
|
1284
1284
|
A() && window.dispatchEvent(
|
|
1285
1285
|
new CustomEvent(
|
|
1286
1286
|
"builder:component:stateChange",
|
|
@@ -1295,8 +1295,8 @@ function ot(e) {
|
|
|
1295
1295
|
)
|
|
1296
1296
|
);
|
|
1297
1297
|
}
|
|
1298
|
-
return
|
|
1299
|
-
var
|
|
1298
|
+
return v(() => {
|
|
1299
|
+
var r, s;
|
|
1300
1300
|
if (U()) {
|
|
1301
1301
|
if (A() && (window.addEventListener("message", i), ne(), ae({
|
|
1302
1302
|
...e.locale ? {
|
|
@@ -1316,9 +1316,9 @@ function ot(e) {
|
|
|
1316
1316
|
(g = window.parent) == null || g.postMessage(c, "*");
|
|
1317
1317
|
}), window.addEventListener(
|
|
1318
1318
|
"builder:component:stateChangeListenerActivated",
|
|
1319
|
-
|
|
1319
|
+
h
|
|
1320
1320
|
)), e.builderContextSignal.content && W(e.canTrack)) {
|
|
1321
|
-
const d = (
|
|
1321
|
+
const d = (r = e.builderContextSignal.content) == null ? void 0 : r.testVariationId, c = (s = e.builderContextSignal.content) == null ? void 0 : s.id, g = e.apiKey;
|
|
1322
1322
|
_({
|
|
1323
1323
|
type: "impression",
|
|
1324
1324
|
canTrack: !0,
|
|
@@ -1340,34 +1340,34 @@ function ot(e) {
|
|
|
1340
1340
|
});
|
|
1341
1341
|
}
|
|
1342
1342
|
}
|
|
1343
|
-
}, []),
|
|
1343
|
+
}, []), v(() => {
|
|
1344
1344
|
e.apiKey || se.error(
|
|
1345
1345
|
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
1346
|
-
),
|
|
1347
|
-
}, []),
|
|
1346
|
+
), o(), b(), h();
|
|
1347
|
+
}, []), v(() => {
|
|
1348
1348
|
e.content && a(e.content);
|
|
1349
|
-
}, [e.content]),
|
|
1350
|
-
|
|
1351
|
-
}, [(D = (
|
|
1352
|
-
y();
|
|
1353
|
-
}, [(L = (H = e.builderContextSignal.content) == null ? void 0 : H.data) == null ? void 0 : L.httpRequests]), S(() => {
|
|
1349
|
+
}, [e.content]), v(() => {
|
|
1350
|
+
o();
|
|
1351
|
+
}, [(D = (S = e.builderContextSignal.content) == null ? void 0 : S.data) == null ? void 0 : D.jsCode]), v(() => {
|
|
1354
1352
|
b();
|
|
1355
|
-
}, [e.builderContextSignal.
|
|
1353
|
+
}, [(L = (H = e.builderContextSignal.content) == null ? void 0 : H.data) == null ? void 0 : L.httpRequests]), v(() => {
|
|
1354
|
+
h();
|
|
1355
|
+
}, [e.builderContextSignal.rootState]), v(() => {
|
|
1356
1356
|
e.data && n(e.data);
|
|
1357
|
-
}, [e.data]),
|
|
1357
|
+
}, [e.data]), v(() => {
|
|
1358
1358
|
e.locale && n({
|
|
1359
1359
|
locale: e.locale
|
|
1360
1360
|
});
|
|
1361
|
-
}, [e.locale]),
|
|
1361
|
+
}, [e.locale]), v(() => () => {
|
|
1362
1362
|
U() && (window.removeEventListener("message", i), window.removeEventListener(
|
|
1363
1363
|
"builder:component:stateChangeListenerActivated",
|
|
1364
|
-
|
|
1364
|
+
h
|
|
1365
1365
|
));
|
|
1366
|
-
}, []), /* @__PURE__ */
|
|
1366
|
+
}, []), /* @__PURE__ */ f(ve.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ f(
|
|
1367
1367
|
u,
|
|
1368
1368
|
{
|
|
1369
1369
|
ref: t,
|
|
1370
|
-
onClick: (
|
|
1370
|
+
onClick: (r) => C(r),
|
|
1371
1371
|
"builder-content-id": (N = e.builderContextSignal.content) == null ? void 0 : N.id,
|
|
1372
1372
|
"builder-model": e.model,
|
|
1373
1373
|
...e.showContent ? {} : {
|
|
@@ -1392,16 +1392,16 @@ font-display: fallback;
|
|
|
1392
1392
|
font-weight: 400;
|
|
1393
1393
|
}
|
|
1394
1394
|
`.trim()), e.files)
|
|
1395
|
-
for (const
|
|
1396
|
-
if (!(String(Number(
|
|
1395
|
+
for (const o in e.files) {
|
|
1396
|
+
if (!(String(Number(o)) === o))
|
|
1397
1397
|
continue;
|
|
1398
|
-
const
|
|
1399
|
-
|
|
1398
|
+
const y = e.files[o];
|
|
1399
|
+
y && y !== a && (u += `
|
|
1400
1400
|
@font-face {
|
|
1401
1401
|
font-family: "${t}";
|
|
1402
|
-
src: url('${
|
|
1402
|
+
src: url('${y}') format('woff2');
|
|
1403
1403
|
font-display: fallback;
|
|
1404
|
-
font-weight: ${
|
|
1404
|
+
font-weight: ${o};
|
|
1405
1405
|
}
|
|
1406
1406
|
`.trim());
|
|
1407
1407
|
}
|
|
@@ -1445,17 +1445,17 @@ ${st({
|
|
|
1445
1445
|
${ct(e.isNestedRender)}
|
|
1446
1446
|
`.trim()
|
|
1447
1447
|
);
|
|
1448
|
-
return /* @__PURE__ */
|
|
1448
|
+
return /* @__PURE__ */ f(G, { id: "builderio-content", styles: t });
|
|
1449
1449
|
}
|
|
1450
1450
|
const mt = ({
|
|
1451
1451
|
content: e,
|
|
1452
1452
|
data: t,
|
|
1453
1453
|
locale: n
|
|
1454
1454
|
}) => {
|
|
1455
|
-
var p, i,
|
|
1455
|
+
var p, i, o;
|
|
1456
1456
|
const a = {}, u = ((p = e == null ? void 0 : e.data) == null ? void 0 : p.state) || {};
|
|
1457
|
-
return (
|
|
1458
|
-
|
|
1457
|
+
return (o = (i = e == null ? void 0 : e.data) == null ? void 0 : i.inputs) == null || o.forEach((m) => {
|
|
1458
|
+
m.name && m.defaultValue !== void 0 && (a[m.name] = m.defaultValue);
|
|
1459
1459
|
}), {
|
|
1460
1460
|
...a,
|
|
1461
1461
|
...u,
|
|
@@ -1476,22 +1476,22 @@ const mt = ({
|
|
|
1476
1476
|
meta: e == null ? void 0 : e.meta
|
|
1477
1477
|
} : void 0;
|
|
1478
1478
|
function Y(e) {
|
|
1479
|
-
var
|
|
1479
|
+
var m, y, x, T, C, V, R;
|
|
1480
1480
|
const [t, n] = I(
|
|
1481
1481
|
() => {
|
|
1482
|
-
var
|
|
1482
|
+
var b, h;
|
|
1483
1483
|
return tt({
|
|
1484
1484
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
1485
|
-
variationId: (
|
|
1485
|
+
variationId: (b = e.content) == null ? void 0 : b.testVariationId,
|
|
1486
1486
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
1487
|
-
contentId: (
|
|
1487
|
+
contentId: (h = e.content) == null ? void 0 : h.id
|
|
1488
1488
|
});
|
|
1489
1489
|
}
|
|
1490
1490
|
);
|
|
1491
|
-
function a(
|
|
1492
|
-
|
|
1493
|
-
...
|
|
1494
|
-
rootState:
|
|
1491
|
+
function a(b) {
|
|
1492
|
+
o((h) => ({
|
|
1493
|
+
...h,
|
|
1494
|
+
rootState: b
|
|
1495
1495
|
}));
|
|
1496
1496
|
}
|
|
1497
1497
|
const [u, p] = I(
|
|
@@ -1499,16 +1499,16 @@ function Y(e) {
|
|
|
1499
1499
|
...O(),
|
|
1500
1500
|
...e.customComponents || []
|
|
1501
1501
|
].reduce(
|
|
1502
|
-
(
|
|
1503
|
-
...
|
|
1504
|
-
[
|
|
1505
|
-
component:
|
|
1506
|
-
...B(
|
|
1502
|
+
(b, { component: h, ...S }) => ({
|
|
1503
|
+
...b,
|
|
1504
|
+
[S.name]: {
|
|
1505
|
+
component: h,
|
|
1506
|
+
...B(S)
|
|
1507
1507
|
}
|
|
1508
1508
|
}),
|
|
1509
1509
|
{}
|
|
1510
1510
|
)
|
|
1511
|
-
), [i,
|
|
1511
|
+
), [i, o] = I(() => ({
|
|
1512
1512
|
content: pt({
|
|
1513
1513
|
content: e.content,
|
|
1514
1514
|
data: e.data
|
|
@@ -1527,9 +1527,9 @@ function Y(e) {
|
|
|
1527
1527
|
...O(),
|
|
1528
1528
|
...e.customComponents || []
|
|
1529
1529
|
].reduce(
|
|
1530
|
-
(
|
|
1531
|
-
...
|
|
1532
|
-
[
|
|
1530
|
+
(b, { component: h, ...S }) => ({
|
|
1531
|
+
...b,
|
|
1532
|
+
[S.name]: B(S)
|
|
1533
1533
|
}),
|
|
1534
1534
|
{}
|
|
1535
1535
|
),
|
|
@@ -1537,7 +1537,7 @@ function Y(e) {
|
|
|
1537
1537
|
BlocksWrapper: e.blocksWrapper || "div",
|
|
1538
1538
|
BlocksWrapperProps: e.blocksWrapperProps || {}
|
|
1539
1539
|
}));
|
|
1540
|
-
return /* @__PURE__ */
|
|
1540
|
+
return /* @__PURE__ */ f(
|
|
1541
1541
|
Ie.Provider,
|
|
1542
1542
|
{
|
|
1543
1543
|
value: {
|
|
@@ -1560,19 +1560,25 @@ function Y(e) {
|
|
|
1560
1560
|
contentWrapperProps: e.contentWrapperProps,
|
|
1561
1561
|
linkComponent: e.linkComponent,
|
|
1562
1562
|
trustedHosts: e.trustedHosts,
|
|
1563
|
-
setBuilderContextSignal:
|
|
1563
|
+
setBuilderContextSignal: o,
|
|
1564
1564
|
children: [
|
|
1565
|
-
e.isSsrAbTest ? /* @__PURE__ */
|
|
1566
|
-
|
|
1565
|
+
e.isSsrAbTest ? /* @__PURE__ */ f(
|
|
1566
|
+
$,
|
|
1567
|
+
{
|
|
1568
|
+
id: "builderio-variant-visibility",
|
|
1569
|
+
scriptStr: t
|
|
1570
|
+
}
|
|
1571
|
+
) : null,
|
|
1572
|
+
/* @__PURE__ */ f(
|
|
1567
1573
|
ut,
|
|
1568
1574
|
{
|
|
1569
1575
|
isNestedRender: e.isNestedRender,
|
|
1570
|
-
contentId: (
|
|
1571
|
-
cssCode: (x = (
|
|
1576
|
+
contentId: (m = i.content) == null ? void 0 : m.id,
|
|
1577
|
+
cssCode: (x = (y = i.content) == null ? void 0 : y.data) == null ? void 0 : x.cssCode,
|
|
1572
1578
|
customFonts: (C = (T = i.content) == null ? void 0 : T.data) == null ? void 0 : C.customFonts
|
|
1573
1579
|
}
|
|
1574
1580
|
),
|
|
1575
|
-
/* @__PURE__ */
|
|
1581
|
+
/* @__PURE__ */ f(
|
|
1576
1582
|
ke,
|
|
1577
1583
|
{
|
|
1578
1584
|
blocks: (R = (V = i.content) == null ? void 0 : V.data) == null ? void 0 : R.blocks,
|
|
@@ -1587,8 +1593,8 @@ function Y(e) {
|
|
|
1587
1593
|
}
|
|
1588
1594
|
);
|
|
1589
1595
|
}
|
|
1590
|
-
function
|
|
1591
|
-
var i
|
|
1596
|
+
function St(e) {
|
|
1597
|
+
var i;
|
|
1592
1598
|
const [t, n] = I(
|
|
1593
1599
|
() => Ge({
|
|
1594
1600
|
canTrack: W(e.canTrack),
|
|
@@ -1596,45 +1602,57 @@ function vt(e) {
|
|
|
1596
1602
|
})
|
|
1597
1603
|
);
|
|
1598
1604
|
function a() {
|
|
1599
|
-
var
|
|
1605
|
+
var o;
|
|
1600
1606
|
return et(
|
|
1601
|
-
F(e.content).map((
|
|
1602
|
-
id:
|
|
1603
|
-
testRatio:
|
|
1607
|
+
F(e.content).map((m) => ({
|
|
1608
|
+
id: m.testVariationId,
|
|
1609
|
+
testRatio: m.testRatio
|
|
1604
1610
|
})),
|
|
1605
|
-
((
|
|
1611
|
+
((o = e.content) == null ? void 0 : o.id) || ""
|
|
1606
1612
|
);
|
|
1607
1613
|
}
|
|
1608
1614
|
function u() {
|
|
1609
|
-
return F(e.content).map((
|
|
1615
|
+
return F(e.content).map((o) => `.variant-${o.testVariationId} { display: none; } `).join("");
|
|
1610
1616
|
}
|
|
1611
1617
|
function p() {
|
|
1612
|
-
var
|
|
1618
|
+
var o;
|
|
1613
1619
|
return t ? {
|
|
1614
1620
|
...e.content,
|
|
1615
|
-
testVariationId: (
|
|
1621
|
+
testVariationId: (o = e.content) == null ? void 0 : o.id
|
|
1616
1622
|
} : ue({
|
|
1617
1623
|
item: e.content,
|
|
1618
1624
|
canTrack: W(e.canTrack)
|
|
1619
1625
|
});
|
|
1620
1626
|
}
|
|
1621
|
-
return
|
|
1627
|
+
return v(() => {
|
|
1622
1628
|
}, []), /* @__PURE__ */ P(K, { children: [
|
|
1623
|
-
!e.isNestedRender && Q !== "reactNative" ? /* @__PURE__ */
|
|
1629
|
+
!e.isNestedRender && Q !== "reactNative" ? /* @__PURE__ */ f(
|
|
1630
|
+
$,
|
|
1631
|
+
{
|
|
1632
|
+
id: "builderio-init-variants-fns",
|
|
1633
|
+
scriptStr: Ze()
|
|
1634
|
+
}
|
|
1635
|
+
) : null,
|
|
1624
1636
|
t ? /* @__PURE__ */ P(K, { children: [
|
|
1625
|
-
/* @__PURE__ */
|
|
1637
|
+
/* @__PURE__ */ f(
|
|
1626
1638
|
G,
|
|
1627
1639
|
{
|
|
1628
|
-
id:
|
|
1640
|
+
id: "builderio-variants",
|
|
1629
1641
|
styles: u()
|
|
1630
1642
|
}
|
|
1631
1643
|
),
|
|
1632
|
-
/* @__PURE__ */
|
|
1633
|
-
|
|
1644
|
+
/* @__PURE__ */ f(
|
|
1645
|
+
$,
|
|
1646
|
+
{
|
|
1647
|
+
id: "builderio-variants-visibility",
|
|
1648
|
+
scriptStr: a()
|
|
1649
|
+
}
|
|
1650
|
+
),
|
|
1651
|
+
(i = F(e.content)) == null ? void 0 : i.map((o) => /* @__PURE__ */ f(
|
|
1634
1652
|
Y,
|
|
1635
1653
|
{
|
|
1636
1654
|
isNestedRender: e.isNestedRender,
|
|
1637
|
-
content:
|
|
1655
|
+
content: o,
|
|
1638
1656
|
showContent: !1,
|
|
1639
1657
|
model: e.model,
|
|
1640
1658
|
data: e.data,
|
|
@@ -1653,10 +1671,10 @@ function vt(e) {
|
|
|
1653
1671
|
contentWrapperProps: e.contentWrapperProps,
|
|
1654
1672
|
trustedHosts: e.trustedHosts
|
|
1655
1673
|
},
|
|
1656
|
-
|
|
1674
|
+
o.testVariationId
|
|
1657
1675
|
))
|
|
1658
1676
|
] }) : null,
|
|
1659
|
-
/* @__PURE__ */
|
|
1677
|
+
/* @__PURE__ */ f(
|
|
1660
1678
|
Y,
|
|
1661
1679
|
{
|
|
1662
1680
|
isNestedRender: e.isNestedRender,
|
|
@@ -1683,5 +1701,5 @@ function vt(e) {
|
|
|
1683
1701
|
] });
|
|
1684
1702
|
}
|
|
1685
1703
|
export {
|
|
1686
|
-
|
|
1704
|
+
St as default
|
|
1687
1705
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as N, Fragment as w, jsx as u } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as J, useState as y } from "react";
|
|
3
|
-
import { Block as O, Blocks as S, set as U } from "./blocks-
|
|
4
|
-
import { isEditing as j } from "./server-entry-
|
|
5
|
-
import "./get-class-prop-name-
|
|
3
|
+
import { Block as O, Blocks as S, set as U } from "./blocks-8e5cc463.js";
|
|
4
|
+
import { isEditing as j } from "./server-entry-2b1068fd.js";
|
|
5
|
+
import "./get-class-prop-name-49cbb2c6.js";
|
|
6
6
|
import "./dynamic-renderer-8b343325.js";
|
|
7
7
|
const R = ["production", "qa", "test", "development", "dev", "cdn-qa", "cloud", "fast", "cdn2", "cdn-prod"], $ = () => {
|
|
8
8
|
const e = process.env.NODE_ENV || "production";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),y=require("react"),m=require("./blocks-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),y=require("react"),m=require("./blocks-a0a9d452.cjs"),P=require("./server-entry-ef266884.cjs");require("./get-class-prop-name-bbc4d2f3.cjs");require("./dynamic-renderer-b29b45ca.cjs");const B=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],D=()=>{const e=process.env.NODE_ENV||"production";return B.includes(e)?e:"production"},A=(e,i,S)=>{const a=String.prototype.split.call(i,/[,[\].]+?/).filter(Boolean).reduce((c,b)=>c!=null?c[b]:c,e);return a===void 0||a===e?S:a};function O(e){var x,E;const i=y.useRef(null),[S,a]=y.useState(()=>"unsubmitted"),[c,b]=y.useState(()=>null),[J,T]=y.useState(()=>"");function F(s){var f,g;const u={...e.builderContext.rootState,...s};e.builderContext.rootSetState?(g=(f=e.builderContext).rootSetState)==null||g.call(f,u):e.builderContext.rootState=u}function h(){return P.isEditing()&&e.previewState||S}function N(s){var f;const u=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")s.preventDefault();else if(u){if(!(e.action||e.sendSubmissionsTo==="email")){s.preventDefault();return}s.preventDefault();const g=s.currentTarget,k=e.customHeaders||{};let v;const q=new FormData(g),C=Array.from(s.currentTarget.querySelectorAll("input,select,textarea")).filter(t=>!!t.name).map(t=>{let n;const l=t.name;if(t instanceof HTMLInputElement)if(t.type==="radio"){if(t.checked)return n=t.name,{key:l,value:n}}else if(t.type==="checkbox")n=t.checked;else if(t.type==="number"||t.type==="range"){const r=t.valueAsNumber;isNaN(r)||(n=r)}else t.type==="file"?n=t.files:n=t.value;else n=t.value;return{key:l,value:n}});let d=e.contentType;if(e.sendSubmissionsTo==="email"&&(d="multipart/form-data"),Array.from(C).forEach(({value:t})=>{(t instanceof File||Array.isArray(t)&&t[0]instanceof File||t instanceof FileList)&&(d="multipart/form-data")}),d!=="application/json")v=q;else{const t={};Array.from(C).forEach(({value:n,key:l})=>{m.set(t,l,n)}),v=JSON.stringify(t)}d&&d!=="multipart/form-data"&&(u&&((f=e.action)!=null&&f.includes("zapier.com"))||(k["content-type"]=d));const j=new CustomEvent("presubmit",{detail:{body:v}});if(i.current&&(i.current.dispatchEvent(j),j.defaultPrevented))return;a("sending");const w=`${D()==="dev"?"http://localhost:5000":"https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(e.sendSubmissionsToEmail||"")}&name=${encodeURIComponent(e.name||"")}`;fetch(e.sendSubmissionsTo==="email"?w:e.action,{body:v,headers:k,method:e.method||"post"}).then(async t=>{let n;const l=t.headers.get("content-type");if(l&&l.indexOf("application/json")!==-1?n=await t.json():n=await t.text(),!t.ok&&e.errorMessagePath){let r=A(n,e.errorMessagePath);r&&(typeof r!="string"&&(r=JSON.stringify(r)),T(r),F({formErrorMessage:r}))}if(b(n),a(t.ok?"success":"error"),t.ok){const r=new CustomEvent("submit:success",{detail:{res:t,body:n}});if(i.current){if(i.current.dispatchEvent(r),r.defaultPrevented)return;e.resetFormOnSubmit!==!1&&i.current.reset()}if(e.successUrl)if(i.current){const M=new CustomEvent("route",{detail:{url:e.successUrl}});i.current.dispatchEvent(M),M.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},t=>{const n=new CustomEvent("submit:error",{detail:{error:t}});i.current&&(i.current.dispatchEvent(n),n.defaultPrevented)||(b(t),a("error"))})}}return o.jsxs(o.Fragment,{children:[" ",o.jsxs("form",{validate:e.validate,ref:i,action:!e.sendWithJs&&e.action,method:e.method,name:e.name,onSubmit:s=>N(s),...e.attributes,children:[e.builderBlock&&e.builderBlock.children?o.jsx(o.Fragment,{children:(E=(x=e.builderBlock)==null?void 0:x.children)==null?void 0:E.map((s,u)=>o.jsx(m.Block,{block:s,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent},`form-block-${u}`))}):null,h()==="error"?o.jsx(m.Blocks,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext}):null,h()==="sending"?o.jsx(m.Blocks,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext}):null,h()==="error"&&c?o.jsx("pre",{className:"builder-form-error-text pre-31bf8a14",children:JSON.stringify(c,null,2)}):null,h()==="success"?o.jsx(m.Blocks,{path:"successMessage",blocks:e.successMessage,context:e.builderContext}):null]})," ",o.jsx("style",{children:".pre-31bf8a14 { padding: 10px; color: red; text-align: center; }"})," "]})}exports.default=O;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("./server-entry-
|
|
1
|
+
"use strict";const e=require("./server-entry-ef266884.cjs"),s=()=>{switch(e.TARGET){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":return"class"}};exports.getClassPropName=s;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("./server-entry-ef266884.cjs");function n(e){return t.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},i.isEditing()&&e.imgSrc||"default-key")}exports.default=n;
|
package/lib/edge/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-ef266884.cjs");require("react");exports.Blocks=t.Blocks;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;
|