@builder.io/sdk-react 1.0.35 → 1.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/blocks-exports.cjs +21 -21
- package/lib/browser/blocks-exports.mjs +228 -174
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/init.cjs +6 -6
- package/lib/browser/init.mjs +29 -19
- package/lib/browser/{server-entry-6bbf0d8e.cjs → server-entry-4168b816.cjs} +1 -1
- package/lib/browser/{server-entry-b3ba0c65.js → server-entry-b8f6be3b.js} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-5b4a3309.js → accordion-18fbb30e.js} +1 -1
- package/lib/edge/{accordion-5cca8f06.cjs → accordion-e40979bc.cjs} +1 -1
- package/lib/edge/{blocks-7855e195.cjs → blocks-48a9ac8c.cjs} +1 -1
- package/lib/edge/{blocks-30dbe829.js → blocks-9b142e90.js} +2 -2
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-94d3cdf8.js → button-be9403e7.js} +2 -2
- package/lib/edge/{button-1e80769d.cjs → button-c2ff97e9.cjs} +1 -1
- package/lib/edge/{columns-18e70134.cjs → columns-118e1fc1.cjs} +1 -1
- package/lib/edge/{columns-e5074ad9.js → columns-920ca800.js} +3 -3
- package/lib/edge/{content-variants-d6dca201.cjs → content-variants-1eb4aebc.cjs} +14 -14
- package/lib/edge/{content-variants-4450b25f.js → content-variants-ed1f803b.js} +139 -100
- package/lib/edge/{form-a08b5177.cjs → form-a9271b51.cjs} +1 -1
- package/lib/edge/{form-9ddabd0e.js → form-cbcf22d5.js} +3 -3
- package/lib/edge/{get-class-prop-name-d5155434.js → get-class-prop-name-90c8ac6c.js} +1 -1
- package/lib/edge/{get-class-prop-name-3a85a54d.cjs → get-class-prop-name-af6b922f.cjs} +1 -1
- package/lib/edge/{img-256419c6.js → img-1f1b4871.js} +1 -1
- package/lib/edge/{img-a38d9d0b.cjs → img-2deeb066.cjs} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/init.cjs +6 -6
- package/lib/edge/init.mjs +29 -19
- package/lib/edge/{input-76252038.cjs → input-4b3e5f88.cjs} +1 -1
- package/lib/edge/{input-e030821e.js → input-514915f8.js} +1 -1
- package/lib/edge/{select-92af3038.js → select-3925e227.js} +5 -4
- package/lib/edge/select-82d8052d.cjs +1 -0
- package/lib/edge/{server-entry-b8d1a7db.js → server-entry-57fedeba.js} +1 -1
- package/lib/edge/{server-entry-5b4426a1.cjs → server-entry-a00fcff8.cjs} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-27ff859a.cjs → slot-21fe373f.cjs} +1 -1
- package/lib/edge/{slot-27c3a577.js → slot-aa7280f8.js} +3 -3
- package/lib/edge/{symbol-3c1f8827.cjs → symbol-a0ab57ea.cjs} +1 -1
- package/lib/edge/{symbol-6c0f8a5c.js → symbol-ac48d2ec.js} +2 -2
- package/lib/edge/{tabs-5b4535f0.js → tabs-9b5261d0.js} +3 -3
- package/lib/edge/{tabs-770b1029.cjs → tabs-df436d1e.cjs} +1 -1
- package/lib/edge/textarea-56a875bc.cjs +1 -0
- package/lib/edge/textarea-d29025e9.js +17 -0
- package/lib/node/blocks-exports.cjs +23 -23
- package/lib/node/blocks-exports.mjs +202 -148
- 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-79df5f59.js → node-runtime-1b85663b.js} +51 -41
- package/lib/node/node-runtime-d59eb154.cjs +48 -0
- package/lib/node/{server-entry-ea775ab5.js → server-entry-8081c6b9.js} +1 -1
- package/lib/node/{server-entry-11bc96ae.cjs → server-entry-dc1afebd.cjs} +1 -1
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/package.json +1 -2
- package/types/blocks/form/select/select.d.ts +1 -0
- package/types/blocks/form/textarea/component-info.d.ts +2 -0
- package/types/blocks/{textarea → form/textarea}/textarea.d.ts +1 -0
- package/types/constants/sdk-name.d.ts +1 -0
- package/types/constants/sdk-version.d.ts +1 -1
- package/lib/edge/select-98849dc7.cjs +0 -1
- package/lib/node/node-runtime-80dbd8f2.cjs +0 -48
- package/types/blocks/textarea/component-info.d.ts +0 -2
- /package/types/blocks/{textarea → form/textarea}/index.d.ts +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as f, jsxs as $, Fragment as z } from "react/jsx-runtime";
|
|
2
|
-
import { lazy as
|
|
3
|
-
import { isBrowser as H, TARGET as te, isEditing as F, registerInsertMenu as se, setupBrowserForEditing as de, createRegisterComponentMessage as ce, getDefaultCanTrack as A, _track as J, isPreviewing as ue, fetchOneEntry as me, logger as pe, createEditorListener as ge, fetch as fe, fastClone as he, serializeComponentInfo as Y, handleABTestingSync as be } from "./server-entry-
|
|
2
|
+
import { lazy as y, useRef as le, useState as k, useEffect as T } from "react";
|
|
3
|
+
import { isBrowser as H, TARGET as te, isEditing as F, registerInsertMenu as se, setupBrowserForEditing as de, createRegisterComponentMessage as ce, getDefaultCanTrack as A, _track as J, isPreviewing as ue, fetchOneEntry as me, logger as pe, createEditorListener as ge, fetch as fe, fastClone as he, serializeComponentInfo as Y, handleABTestingSync as be } from "./server-entry-57fedeba.js";
|
|
4
4
|
import { Video as ye, Button as xe, Columns as ve, Fragment as Se, Image as Te, Section as Ie, Symbol as ke, Text as Ce, BuilderContext as we } from "./blocks-exports.mjs";
|
|
5
|
-
import { triggerAnimation as Ve, evaluate as Q, InlinedStyles as ne, ComponentsContext as Re, Blocks as Ee } from "./blocks-
|
|
6
|
-
import "./get-class-prop-name-
|
|
5
|
+
import { triggerAnimation as Ve, evaluate as Q, InlinedStyles as ne, ComponentsContext as Re, Blocks as Ee } from "./blocks-9b142e90.js";
|
|
6
|
+
import "./get-class-prop-name-90c8ac6c.js";
|
|
7
7
|
import "./dynamic-renderer-8b343325.js";
|
|
8
8
|
const P = {
|
|
9
9
|
"@type": "@builder.io/sdk:Element",
|
|
@@ -123,7 +123,7 @@ const P = {
|
|
|
123
123
|
e.get("useChildrenForItems") === !0 && e.set("items", []);
|
|
124
124
|
}
|
|
125
125
|
}]
|
|
126
|
-
}, We =
|
|
126
|
+
}, We = y(() => import("./accordion-18fbb30e.js")), Ae = {
|
|
127
127
|
name: "Core:Button",
|
|
128
128
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
|
|
129
129
|
defaultStyles: {
|
|
@@ -520,7 +520,7 @@ const P = {
|
|
|
520
520
|
required: !0,
|
|
521
521
|
defaultValue: "children"
|
|
522
522
|
}]
|
|
523
|
-
}, He =
|
|
523
|
+
}, He = y(() => import("./slot-aa7280f8.js")), Be = {
|
|
524
524
|
name: "Symbol",
|
|
525
525
|
noWrap: !0,
|
|
526
526
|
static: !0,
|
|
@@ -591,7 +591,7 @@ const P = {
|
|
|
591
591
|
text: "New tab content "
|
|
592
592
|
}
|
|
593
593
|
}
|
|
594
|
-
},
|
|
594
|
+
}, Ne = {
|
|
595
595
|
name: "Builder: Tabs",
|
|
596
596
|
inputs: [{
|
|
597
597
|
name: "tabs",
|
|
@@ -688,7 +688,7 @@ const P = {
|
|
|
688
688
|
value: "flex-end"
|
|
689
689
|
}]
|
|
690
690
|
}]
|
|
691
|
-
},
|
|
691
|
+
}, qe = y(() => import("./tabs-9b5261d0.js")), je = {
|
|
692
692
|
name: "Text",
|
|
693
693
|
static: !0,
|
|
694
694
|
isRSC: !0,
|
|
@@ -728,7 +728,7 @@ const P = {
|
|
|
728
728
|
helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
|
|
729
729
|
advanced: !0
|
|
730
730
|
}]
|
|
731
|
-
},
|
|
731
|
+
}, Me = y(() => import("./custom-code-7786788e.js")), _e = {
|
|
732
732
|
name: "Embed",
|
|
733
733
|
static: !0,
|
|
734
734
|
inputs: [{
|
|
@@ -756,7 +756,7 @@ const P = {
|
|
|
756
756
|
defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
|
|
757
757
|
hideFromUI: !0
|
|
758
758
|
}]
|
|
759
|
-
}, Oe =
|
|
759
|
+
}, Oe = y(() => import("./embed-5c1bbe12.js")), ze = {
|
|
760
760
|
name: "Form:Form",
|
|
761
761
|
// editableTags: ['builder-form-error']
|
|
762
762
|
defaults: {
|
|
@@ -987,7 +987,7 @@ const P = {
|
|
|
987
987
|
}
|
|
988
988
|
}
|
|
989
989
|
}]
|
|
990
|
-
}, Je =
|
|
990
|
+
}, Je = y(() => import("./form-cbcf22d5.js")), Ye = {
|
|
991
991
|
name: "Form:Input",
|
|
992
992
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
993
993
|
inputs: [
|
|
@@ -1038,7 +1038,7 @@ const P = {
|
|
|
1038
1038
|
borderStyle: "solid",
|
|
1039
1039
|
borderColor: "#ccc"
|
|
1040
1040
|
}
|
|
1041
|
-
}, Qe =
|
|
1041
|
+
}, Qe = y(() => import("./input-514915f8.js")), Ge = {
|
|
1042
1042
|
name: "Form:Select",
|
|
1043
1043
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
1044
1044
|
defaultStyles: {
|
|
@@ -1080,7 +1080,7 @@ const P = {
|
|
|
1080
1080
|
}],
|
|
1081
1081
|
static: !0,
|
|
1082
1082
|
noWrap: !0
|
|
1083
|
-
}, Xe =
|
|
1083
|
+
}, Xe = y(() => import("./select-3925e227.js")), Ze = {
|
|
1084
1084
|
name: "Form:SubmitButton",
|
|
1085
1085
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
1086
1086
|
defaultStyles: {
|
|
@@ -1105,7 +1105,43 @@ const P = {
|
|
|
1105
1105
|
// that only shows if advanced setting is flipped
|
|
1106
1106
|
// TODO: defaultChildren
|
|
1107
1107
|
// canHaveChildren: true,
|
|
1108
|
-
}, et =
|
|
1108
|
+
}, et = y(() => import("./submit-button-b48361a7.js")), tt = {
|
|
1109
|
+
name: "Form:TextArea",
|
|
1110
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
|
|
1111
|
+
inputs: [{
|
|
1112
|
+
advanced: !0,
|
|
1113
|
+
name: "value",
|
|
1114
|
+
type: "string"
|
|
1115
|
+
}, {
|
|
1116
|
+
name: "name",
|
|
1117
|
+
type: "string",
|
|
1118
|
+
required: !0,
|
|
1119
|
+
helperText: 'Every input in a form needs a unique name describing what it gets, e.g. "email"'
|
|
1120
|
+
}, {
|
|
1121
|
+
name: "defaultValue",
|
|
1122
|
+
type: "string"
|
|
1123
|
+
}, {
|
|
1124
|
+
name: "placeholder",
|
|
1125
|
+
type: "string",
|
|
1126
|
+
defaultValue: "Hello there"
|
|
1127
|
+
}, {
|
|
1128
|
+
name: "required",
|
|
1129
|
+
type: "boolean",
|
|
1130
|
+
defaultValue: !1
|
|
1131
|
+
}],
|
|
1132
|
+
defaultStyles: {
|
|
1133
|
+
paddingTop: "10px",
|
|
1134
|
+
paddingBottom: "10px",
|
|
1135
|
+
paddingLeft: "10px",
|
|
1136
|
+
paddingRight: "10px",
|
|
1137
|
+
borderRadius: "3px",
|
|
1138
|
+
borderWidth: "1px",
|
|
1139
|
+
borderStyle: "solid",
|
|
1140
|
+
borderColor: "#ccc"
|
|
1141
|
+
},
|
|
1142
|
+
static: !0,
|
|
1143
|
+
noWrap: !0
|
|
1144
|
+
}, nt = y(() => import("./textarea-d29025e9.js")), at = {
|
|
1109
1145
|
// friendlyName?
|
|
1110
1146
|
name: "Raw:Img",
|
|
1111
1147
|
hideFromInsertMenu: !0,
|
|
@@ -1119,7 +1155,7 @@ const P = {
|
|
|
1119
1155
|
}],
|
|
1120
1156
|
noWrap: !0,
|
|
1121
1157
|
static: !0
|
|
1122
|
-
},
|
|
1158
|
+
}, it = y(() => import("./img-1f1b4871.js")), ot = {
|
|
1123
1159
|
name: "Video",
|
|
1124
1160
|
canHaveChildren: !0,
|
|
1125
1161
|
defaultStyles: {
|
|
@@ -1200,12 +1236,12 @@ const P = {
|
|
|
1200
1236
|
defaultValue: !0,
|
|
1201
1237
|
advanced: !0
|
|
1202
1238
|
}]
|
|
1203
|
-
},
|
|
1204
|
-
component:
|
|
1239
|
+
}, rt = () => [{
|
|
1240
|
+
component: Me,
|
|
1205
1241
|
...Ke
|
|
1206
1242
|
}, {
|
|
1207
1243
|
component: Oe,
|
|
1208
|
-
...
|
|
1244
|
+
..._e
|
|
1209
1245
|
}, {
|
|
1210
1246
|
component: Je,
|
|
1211
1247
|
...ze
|
|
@@ -1222,8 +1258,11 @@ const P = {
|
|
|
1222
1258
|
component: nt,
|
|
1223
1259
|
...tt
|
|
1224
1260
|
}, {
|
|
1225
|
-
component:
|
|
1261
|
+
component: it,
|
|
1226
1262
|
...at
|
|
1263
|
+
}, {
|
|
1264
|
+
component: ye,
|
|
1265
|
+
...ot
|
|
1227
1266
|
}], G = () => [{
|
|
1228
1267
|
component: xe,
|
|
1229
1268
|
...Ae
|
|
@@ -1244,17 +1283,17 @@ const P = {
|
|
|
1244
1283
|
...$e
|
|
1245
1284
|
}, {
|
|
1246
1285
|
component: ke,
|
|
1247
|
-
...
|
|
1286
|
+
...Be
|
|
1248
1287
|
}, {
|
|
1249
1288
|
component: Ce,
|
|
1250
|
-
...
|
|
1289
|
+
...je
|
|
1251
1290
|
}, {
|
|
1252
|
-
component:
|
|
1253
|
-
...
|
|
1291
|
+
component: qe,
|
|
1292
|
+
...Ne
|
|
1254
1293
|
}, {
|
|
1255
1294
|
component: We,
|
|
1256
1295
|
...Fe
|
|
1257
|
-
}, ...
|
|
1296
|
+
}, ...rt()], lt = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
1258
1297
|
function getAndSetVariantId() {
|
|
1259
1298
|
function setCookie(name, value, days) {
|
|
1260
1299
|
let expires = '';
|
|
@@ -1310,7 +1349,7 @@ const P = {
|
|
|
1310
1349
|
}).join('');
|
|
1311
1350
|
styleEl.innerHTML = newStyleStr;
|
|
1312
1351
|
}
|
|
1313
|
-
}`,
|
|
1352
|
+
}`, st = `function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
|
|
1314
1353
|
if (!navigator.cookieEnabled) {
|
|
1315
1354
|
return;
|
|
1316
1355
|
}
|
|
@@ -1348,22 +1387,22 @@ const P = {
|
|
|
1348
1387
|
...t,
|
|
1349
1388
|
testVariationId: t.id,
|
|
1350
1389
|
id: e == null ? void 0 : e.id
|
|
1351
|
-
})),
|
|
1390
|
+
})), dt = ({
|
|
1352
1391
|
canTrack: e,
|
|
1353
1392
|
content: t
|
|
1354
|
-
}) => !(!(W(t).length > 0) || !e || H()),
|
|
1355
|
-
window.${ae} = ${
|
|
1356
|
-
window.${ie} = ${
|
|
1357
|
-
`,
|
|
1393
|
+
}) => !(!(W(t).length > 0) || !e || H()), ct = (e) => e === "react" || e === "reactNative", oe = ct(te), ut = () => `
|
|
1394
|
+
window.${ae} = ${lt}
|
|
1395
|
+
window.${ie} = ${st}
|
|
1396
|
+
`, mt = (e, t) => `
|
|
1358
1397
|
window.${ae}(
|
|
1359
1398
|
"${t}",${JSON.stringify(e)}, ${oe}
|
|
1360
|
-
)`,
|
|
1399
|
+
)`, pt = ({
|
|
1361
1400
|
contentId: e,
|
|
1362
1401
|
variationId: t
|
|
1363
1402
|
}) => `window.${ie}(
|
|
1364
1403
|
"${t}", "${e}", ${oe}
|
|
1365
1404
|
)`;
|
|
1366
|
-
function
|
|
1405
|
+
function B(e) {
|
|
1367
1406
|
return /* @__PURE__ */ f(
|
|
1368
1407
|
"script",
|
|
1369
1408
|
{
|
|
@@ -1375,7 +1414,7 @@ function N(e) {
|
|
|
1375
1414
|
function X(e) {
|
|
1376
1415
|
return Math.round(e * 1e3) / 1e3;
|
|
1377
1416
|
}
|
|
1378
|
-
const
|
|
1417
|
+
const gt = (e, t, n = !0) => {
|
|
1379
1418
|
if (!(e instanceof HTMLElement))
|
|
1380
1419
|
return null;
|
|
1381
1420
|
let a = n ? e : e.parentElement;
|
|
@@ -1386,7 +1425,7 @@ const mt = (e, t, n = !0) => {
|
|
|
1386
1425
|
return a;
|
|
1387
1426
|
} while (a = a.parentElement);
|
|
1388
1427
|
return null;
|
|
1389
|
-
},
|
|
1428
|
+
}, ft = (e) => gt(e, (t) => {
|
|
1390
1429
|
const n = t.getAttribute("builder-id") || t.id;
|
|
1391
1430
|
return (n == null ? void 0 : n.indexOf("builder-")) === 0;
|
|
1392
1431
|
}), Z = ({
|
|
@@ -1398,8 +1437,8 @@ const mt = (e, t, n = !0) => {
|
|
|
1398
1437
|
x: u,
|
|
1399
1438
|
y: i
|
|
1400
1439
|
};
|
|
1401
|
-
},
|
|
1402
|
-
const t = e.target, n = t &&
|
|
1440
|
+
}, ht = (e) => {
|
|
1441
|
+
const t = e.target, n = t && ft(t), a = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
|
|
1403
1442
|
return {
|
|
1404
1443
|
targetBuilderElement: a || void 0,
|
|
1405
1444
|
metadata: {
|
|
@@ -1414,7 +1453,7 @@ const mt = (e, t, n = !0) => {
|
|
|
1414
1453
|
builderElementIndex: n && a ? [].slice.call(document.getElementsByClassName(a)).indexOf(n) : void 0
|
|
1415
1454
|
}
|
|
1416
1455
|
};
|
|
1417
|
-
},
|
|
1456
|
+
}, bt = (e) => {
|
|
1418
1457
|
var u, i;
|
|
1419
1458
|
const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], a = (i = e.fileUrl) != null ? i : (u = e == null ? void 0 : e.files) == null ? void 0 : u.regular;
|
|
1420
1459
|
let d = "";
|
|
@@ -1440,15 +1479,15 @@ font-weight: ${o};
|
|
|
1440
1479
|
`.trim());
|
|
1441
1480
|
}
|
|
1442
1481
|
return d;
|
|
1443
|
-
},
|
|
1482
|
+
}, yt = ({
|
|
1444
1483
|
customFonts: e
|
|
1445
1484
|
}) => {
|
|
1446
1485
|
var t;
|
|
1447
|
-
return ((t = e == null ? void 0 : e.map((n) =>
|
|
1448
|
-
},
|
|
1486
|
+
return ((t = e == null ? void 0 : e.map((n) => bt(n))) == null ? void 0 : t.join(" ")) || "";
|
|
1487
|
+
}, xt = ({
|
|
1449
1488
|
cssCode: e,
|
|
1450
1489
|
contentId: t
|
|
1451
|
-
}) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "",
|
|
1490
|
+
}) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "", vt = `
|
|
1452
1491
|
.builder-button {
|
|
1453
1492
|
all: unset;
|
|
1454
1493
|
}
|
|
@@ -1465,9 +1504,9 @@ font-weight: ${o};
|
|
|
1465
1504
|
text-align: inherit;
|
|
1466
1505
|
font-family: inherit;
|
|
1467
1506
|
}
|
|
1468
|
-
`,
|
|
1469
|
-
function
|
|
1470
|
-
var
|
|
1507
|
+
`, St = (e) => e ? "" : vt, Tt = (e) => `variant-${e}`;
|
|
1508
|
+
function It(e) {
|
|
1509
|
+
var N, q, j, K, M, _, O;
|
|
1471
1510
|
const t = le(null);
|
|
1472
1511
|
function n(r) {
|
|
1473
1512
|
var p, s;
|
|
@@ -1548,7 +1587,7 @@ function St(e) {
|
|
|
1548
1587
|
});
|
|
1549
1588
|
}
|
|
1550
1589
|
const [h, C] = k(() => ({})), [I, w] = k(() => ({})), [R, E] = k(() => !1);
|
|
1551
|
-
function
|
|
1590
|
+
function x(r) {
|
|
1552
1591
|
var c, p;
|
|
1553
1592
|
if (e.builderContextSignal.content) {
|
|
1554
1593
|
const s = (c = e.builderContextSignal.content) == null ? void 0 : c.testVariationId, l = (p = e.builderContextSignal.content) == null ? void 0 : p.id;
|
|
@@ -1558,13 +1597,13 @@ function St(e) {
|
|
|
1558
1597
|
contentId: l,
|
|
1559
1598
|
apiKey: e.apiKey,
|
|
1560
1599
|
variationId: s !== l ? s : void 0,
|
|
1561
|
-
...
|
|
1600
|
+
...ht(r),
|
|
1562
1601
|
unique: !R
|
|
1563
1602
|
});
|
|
1564
1603
|
}
|
|
1565
1604
|
R || E(!0);
|
|
1566
1605
|
}
|
|
1567
|
-
function
|
|
1606
|
+
function v() {
|
|
1568
1607
|
var c, p, s;
|
|
1569
1608
|
const r = (s = (p = (c = e.builderContextSignal.content) == null ? void 0 : c.data) == null ? void 0 : p.httpRequests) != null ? s : {};
|
|
1570
1609
|
Object.entries(r).forEach(([l, g]) => {
|
|
@@ -1595,7 +1634,7 @@ function St(e) {
|
|
|
1595
1634
|
});
|
|
1596
1635
|
});
|
|
1597
1636
|
}
|
|
1598
|
-
function
|
|
1637
|
+
function S() {
|
|
1599
1638
|
F() && window.dispatchEvent(
|
|
1600
1639
|
new CustomEvent(
|
|
1601
1640
|
"builder:component:stateChange",
|
|
@@ -1610,7 +1649,7 @@ function St(e) {
|
|
|
1610
1649
|
)
|
|
1611
1650
|
);
|
|
1612
1651
|
}
|
|
1613
|
-
return
|
|
1652
|
+
return T(() => {
|
|
1614
1653
|
var r, c;
|
|
1615
1654
|
if (H()) {
|
|
1616
1655
|
if (F() && (window.addEventListener("message", o), se(), de({
|
|
@@ -1631,7 +1670,7 @@ function St(e) {
|
|
|
1631
1670
|
(g = window.parent) == null || g.postMessage(l, "*");
|
|
1632
1671
|
}), window.addEventListener(
|
|
1633
1672
|
"builder:component:stateChangeListenerActivated",
|
|
1634
|
-
|
|
1673
|
+
S
|
|
1635
1674
|
)), e.builderContextSignal.content && A(e.canTrack)) {
|
|
1636
1675
|
const s = (r = e.builderContextSignal.content) == null ? void 0 : r.testVariationId, l = (c = e.builderContextSignal.content) == null ? void 0 : c.id, g = e.apiKey;
|
|
1637
1676
|
J({
|
|
@@ -1655,61 +1694,61 @@ function St(e) {
|
|
|
1655
1694
|
});
|
|
1656
1695
|
}
|
|
1657
1696
|
}
|
|
1658
|
-
}, []),
|
|
1697
|
+
}, []), T(() => {
|
|
1659
1698
|
e.apiKey || pe.error(
|
|
1660
1699
|
"No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
1661
|
-
), m(),
|
|
1662
|
-
}, []),
|
|
1700
|
+
), m(), v(), S();
|
|
1701
|
+
}, []), T(() => {
|
|
1663
1702
|
e.content && a(e.content);
|
|
1664
|
-
}, [e.content]),
|
|
1703
|
+
}, [e.content]), T(() => {
|
|
1665
1704
|
m();
|
|
1666
|
-
}, [(
|
|
1667
|
-
x();
|
|
1668
|
-
}, [(K = (q = e.builderContextSignal.content) == null ? void 0 : q.data) == null ? void 0 : K.httpRequests]), S(() => {
|
|
1705
|
+
}, [(q = (N = e.builderContextSignal.content) == null ? void 0 : N.data) == null ? void 0 : q.jsCode]), T(() => {
|
|
1669
1706
|
v();
|
|
1670
|
-
}, [e.builderContextSignal.
|
|
1707
|
+
}, [(K = (j = e.builderContextSignal.content) == null ? void 0 : j.data) == null ? void 0 : K.httpRequests]), T(() => {
|
|
1708
|
+
S();
|
|
1709
|
+
}, [e.builderContextSignal.rootState]), T(() => {
|
|
1671
1710
|
e.data && n(e.data);
|
|
1672
|
-
}, [e.data]),
|
|
1711
|
+
}, [e.data]), T(() => {
|
|
1673
1712
|
e.locale && n({
|
|
1674
1713
|
locale: e.locale
|
|
1675
1714
|
});
|
|
1676
|
-
}, [e.locale]),
|
|
1715
|
+
}, [e.locale]), T(() => () => {
|
|
1677
1716
|
H() && (window.removeEventListener("message", o), window.removeEventListener(
|
|
1678
1717
|
"builder:component:stateChangeListenerActivated",
|
|
1679
|
-
|
|
1718
|
+
S
|
|
1680
1719
|
));
|
|
1681
1720
|
}, []), /* @__PURE__ */ f(we.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ f(
|
|
1682
1721
|
u,
|
|
1683
1722
|
{
|
|
1684
1723
|
ref: t,
|
|
1685
|
-
onClick: (r) =>
|
|
1686
|
-
"builder-content-id": (
|
|
1724
|
+
onClick: (r) => x(r),
|
|
1725
|
+
"builder-content-id": (M = e.builderContextSignal.content) == null ? void 0 : M.id,
|
|
1687
1726
|
"builder-model": e.model,
|
|
1688
1727
|
...d(),
|
|
1689
1728
|
...e.contentWrapperProps,
|
|
1690
|
-
className:
|
|
1691
|
-
((
|
|
1729
|
+
className: Tt(
|
|
1730
|
+
((_ = e.content) == null ? void 0 : _.testVariationId) || ((O = e.content) == null ? void 0 : O.id)
|
|
1692
1731
|
),
|
|
1693
1732
|
children: e.children
|
|
1694
1733
|
}
|
|
1695
1734
|
) : null });
|
|
1696
1735
|
}
|
|
1697
|
-
function
|
|
1736
|
+
function kt(e) {
|
|
1698
1737
|
const [t, n] = k(
|
|
1699
1738
|
() => `
|
|
1700
|
-
${
|
|
1739
|
+
${xt({
|
|
1701
1740
|
cssCode: e.cssCode,
|
|
1702
1741
|
contentId: e.contentId
|
|
1703
1742
|
})}
|
|
1704
|
-
${
|
|
1743
|
+
${yt({
|
|
1705
1744
|
customFonts: e.customFonts
|
|
1706
1745
|
})}
|
|
1707
|
-
${
|
|
1746
|
+
${St(e.isNestedRender)}
|
|
1708
1747
|
`.trim()
|
|
1709
1748
|
);
|
|
1710
1749
|
return /* @__PURE__ */ f(ne, { id: "builderio-content", styles: t });
|
|
1711
1750
|
}
|
|
1712
|
-
const
|
|
1751
|
+
const Ct = ({
|
|
1713
1752
|
content: e,
|
|
1714
1753
|
data: t,
|
|
1715
1754
|
locale: n
|
|
@@ -1726,7 +1765,7 @@ const It = ({
|
|
|
1726
1765
|
locale: n
|
|
1727
1766
|
} : {}
|
|
1728
1767
|
};
|
|
1729
|
-
},
|
|
1768
|
+
}, wt = ({
|
|
1730
1769
|
content: e,
|
|
1731
1770
|
data: t
|
|
1732
1771
|
}) => e ? {
|
|
@@ -1741,19 +1780,19 @@ function ee(e) {
|
|
|
1741
1780
|
var m, h, C, I, w, R, E;
|
|
1742
1781
|
const [t, n] = k(
|
|
1743
1782
|
() => {
|
|
1744
|
-
var
|
|
1745
|
-
return
|
|
1783
|
+
var x, v;
|
|
1784
|
+
return pt({
|
|
1746
1785
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
1747
|
-
variationId: (
|
|
1786
|
+
variationId: (x = e.content) == null ? void 0 : x.testVariationId,
|
|
1748
1787
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
1749
|
-
contentId: (
|
|
1788
|
+
contentId: (v = e.content) == null ? void 0 : v.id
|
|
1750
1789
|
});
|
|
1751
1790
|
}
|
|
1752
1791
|
);
|
|
1753
|
-
function a(
|
|
1754
|
-
o((
|
|
1755
|
-
...
|
|
1756
|
-
rootState:
|
|
1792
|
+
function a(x) {
|
|
1793
|
+
o((v) => ({
|
|
1794
|
+
...v,
|
|
1795
|
+
rootState: x
|
|
1757
1796
|
}));
|
|
1758
1797
|
}
|
|
1759
1798
|
const [d, u] = k(
|
|
@@ -1761,22 +1800,22 @@ function ee(e) {
|
|
|
1761
1800
|
...G(),
|
|
1762
1801
|
...e.customComponents || []
|
|
1763
1802
|
].reduce(
|
|
1764
|
-
(
|
|
1765
|
-
...
|
|
1766
|
-
[
|
|
1767
|
-
component:
|
|
1768
|
-
...Y(
|
|
1803
|
+
(x, { component: v, ...S }) => ({
|
|
1804
|
+
...x,
|
|
1805
|
+
[S.name]: {
|
|
1806
|
+
component: v,
|
|
1807
|
+
...Y(S)
|
|
1769
1808
|
}
|
|
1770
1809
|
}),
|
|
1771
1810
|
{}
|
|
1772
1811
|
)
|
|
1773
1812
|
), [i, o] = k(() => ({
|
|
1774
|
-
content:
|
|
1813
|
+
content: wt({
|
|
1775
1814
|
content: e.content,
|
|
1776
1815
|
data: e.data
|
|
1777
1816
|
}),
|
|
1778
1817
|
localState: void 0,
|
|
1779
|
-
rootState:
|
|
1818
|
+
rootState: Ct({
|
|
1780
1819
|
content: e.content,
|
|
1781
1820
|
data: e.data,
|
|
1782
1821
|
locale: e.locale
|
|
@@ -1790,9 +1829,9 @@ function ee(e) {
|
|
|
1790
1829
|
...G(),
|
|
1791
1830
|
...e.customComponents || []
|
|
1792
1831
|
].reduce(
|
|
1793
|
-
(
|
|
1794
|
-
...
|
|
1795
|
-
[
|
|
1832
|
+
(x, { component: v, ...S }) => ({
|
|
1833
|
+
...x,
|
|
1834
|
+
[S.name]: Y(S)
|
|
1796
1835
|
}),
|
|
1797
1836
|
{}
|
|
1798
1837
|
),
|
|
@@ -1807,7 +1846,7 @@ function ee(e) {
|
|
|
1807
1846
|
registeredComponents: d
|
|
1808
1847
|
},
|
|
1809
1848
|
children: /* @__PURE__ */ $(
|
|
1810
|
-
|
|
1849
|
+
It,
|
|
1811
1850
|
{
|
|
1812
1851
|
content: e.content,
|
|
1813
1852
|
data: e.data,
|
|
@@ -1825,14 +1864,14 @@ function ee(e) {
|
|
|
1825
1864
|
setBuilderContextSignal: o,
|
|
1826
1865
|
children: [
|
|
1827
1866
|
e.isSsrAbTest ? /* @__PURE__ */ f(
|
|
1828
|
-
|
|
1867
|
+
B,
|
|
1829
1868
|
{
|
|
1830
1869
|
id: "builderio-variant-visibility",
|
|
1831
1870
|
scriptStr: t
|
|
1832
1871
|
}
|
|
1833
1872
|
) : null,
|
|
1834
1873
|
/* @__PURE__ */ f(
|
|
1835
|
-
|
|
1874
|
+
kt,
|
|
1836
1875
|
{
|
|
1837
1876
|
isNestedRender: e.isNestedRender,
|
|
1838
1877
|
contentId: (m = i.content) == null ? void 0 : m.id,
|
|
@@ -1855,17 +1894,17 @@ function ee(e) {
|
|
|
1855
1894
|
}
|
|
1856
1895
|
);
|
|
1857
1896
|
}
|
|
1858
|
-
function
|
|
1897
|
+
function Dt(e) {
|
|
1859
1898
|
var i;
|
|
1860
1899
|
const [t, n] = k(
|
|
1861
|
-
() =>
|
|
1900
|
+
() => dt({
|
|
1862
1901
|
canTrack: A(e.canTrack),
|
|
1863
1902
|
content: e.content
|
|
1864
1903
|
})
|
|
1865
1904
|
);
|
|
1866
1905
|
function a() {
|
|
1867
1906
|
var o;
|
|
1868
|
-
return
|
|
1907
|
+
return mt(
|
|
1869
1908
|
W(e.content).map((m) => ({
|
|
1870
1909
|
id: m.testVariationId,
|
|
1871
1910
|
testRatio: m.testRatio
|
|
@@ -1886,13 +1925,13 @@ function At(e) {
|
|
|
1886
1925
|
canTrack: A(e.canTrack)
|
|
1887
1926
|
});
|
|
1888
1927
|
}
|
|
1889
|
-
return
|
|
1928
|
+
return T(() => {
|
|
1890
1929
|
}, []), /* @__PURE__ */ $(z, { children: [
|
|
1891
1930
|
!e.isNestedRender && te !== "reactNative" ? /* @__PURE__ */ f(
|
|
1892
|
-
|
|
1931
|
+
B,
|
|
1893
1932
|
{
|
|
1894
1933
|
id: "builderio-init-variants-fns",
|
|
1895
|
-
scriptStr:
|
|
1934
|
+
scriptStr: ut()
|
|
1896
1935
|
}
|
|
1897
1936
|
) : null,
|
|
1898
1937
|
t ? /* @__PURE__ */ $(z, { children: [
|
|
@@ -1904,7 +1943,7 @@ function At(e) {
|
|
|
1904
1943
|
}
|
|
1905
1944
|
),
|
|
1906
1945
|
/* @__PURE__ */ f(
|
|
1907
|
-
|
|
1946
|
+
B,
|
|
1908
1947
|
{
|
|
1909
1948
|
id: "builderio-variants-visibility",
|
|
1910
1949
|
scriptStr: a()
|
|
@@ -1963,5 +2002,5 @@ function At(e) {
|
|
|
1963
2002
|
] });
|
|
1964
2003
|
}
|
|
1965
2004
|
export {
|
|
1966
|
-
|
|
2005
|
+
Dt as default
|
|
1967
2006
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),y=require("react"),b=require("./blocks-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),y=require("react"),b=require("./blocks-48a9ac8c.cjs"),P=require("./server-entry-a00fcff8.cjs");require("./blocks-exports.cjs");require("./get-class-prop-name-af6b922f.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,h)=>c!=null?c[h]: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,h]=y.useState(()=>null),[J,T]=y.useState(()=>"");function q(s){var f,m;const u={...e.builderContext.rootState,...s};e.builderContext.rootSetState?(m=(f=e.builderContext).rootSetState)==null||m.call(f,u):e.builderContext.rootState=u}function g(){return P.isEditing()&&e.previewState||S}function F(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 m=s.currentTarget||s.target,k=e.customHeaders||{};let v;const N=new FormData(m),C=Array.from(m.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=N;else{const t={};Array.from(C).forEach(({value:n,key:l})=>{b.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),q({formErrorMessage:r}))}if(h(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)||(h(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=>F(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(b.Block,{block:s,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent},`form-block-${u}`))}):null,g()==="error"?o.jsx(b.Blocks,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext}):null,g()==="sending"?o.jsx(b.Blocks,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext}):null,g()==="error"&&c?o.jsx("pre",{className:"builder-form-error-text pre-3a20f614",children:JSON.stringify(c,null,2)}):null,g()==="success"?o.jsx(b.Blocks,{path:"successMessage",blocks:e.successMessage,context:e.builderContext}):null]})," ",o.jsx("style",{children:".pre-3a20f614 { padding: 10px; color: red; text-align: center; }"})," "]})}exports.default=O;
|
|
@@ -1,9 +1,9 @@
|
|
|
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-
|
|
3
|
+
import { Block as O, Blocks as S, set as U } from "./blocks-9b142e90.js";
|
|
4
|
+
import { isEditing as j } from "./server-entry-57fedeba.js";
|
|
5
5
|
import "./blocks-exports.mjs";
|
|
6
|
-
import "./get-class-prop-name-
|
|
6
|
+
import "./get-class-prop-name-90c8ac6c.js";
|
|
7
7
|
import "./dynamic-renderer-8b343325.js";
|
|
8
8
|
const R = ["production", "qa", "test", "development", "dev", "cdn-qa", "cloud", "fast", "cdn2", "cdn-prod"], $ = () => {
|
|
9
9
|
const e = process.env.NODE_ENV || "production";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("./server-entry-
|
|
1
|
+
"use strict";const e=require("./server-entry-a00fcff8.cjs"),s=()=>{switch(e.TARGET){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":case"angular":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-a00fcff8.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-a00fcff8.cjs");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;
|