@builder.io/sdk-react 1.0.11 → 1.0.13
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 +32 -31
- package/lib/browser/blocks-exports.mjs +914 -877
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/{server-entry-acc5a9c8.js → server-entry-1a840bf8.js} +1 -1
- package/lib/browser/{server-entry-4829e1ce.cjs → server-entry-20402a85.cjs} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/blocks-ca61b343.cjs +32 -0
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{blocks-244199ab.js → blocks-fd4ab30c.js} +1003 -967
- package/lib/edge/{button-73916377.js → button-45681a80.js} +3 -3
- package/lib/edge/{button-8cd5d71a.cjs → button-6d8b002c.cjs} +1 -1
- package/lib/edge/{columns-c7d9b9f1.js → columns-61e1043d.js} +33 -33
- package/lib/edge/{columns-88c9df52.cjs → columns-77e4f17d.cjs} +2 -2
- package/lib/edge/{content-variants-d5455178.js → content-variants-c085fa7f.js} +135 -124
- package/lib/edge/{content-variants-1a65d814.cjs → content-variants-c86fdb5a.cjs} +13 -12
- package/lib/edge/dynamic-renderer-8b343325.js +8 -0
- package/lib/edge/{dynamic-renderer-1c9f24c0.cjs → dynamic-renderer-b29b45ca.cjs} +1 -1
- package/lib/edge/{form-ad532981.js → form-4fae6192.js} +56 -66
- package/lib/edge/form-b996f9f9.cjs +1 -0
- package/lib/edge/{get-class-prop-name-1178de8b.js → get-class-prop-name-0e4b7b88.js} +1 -1
- package/lib/edge/{get-class-prop-name-c082f4f3.cjs → get-class-prop-name-14e14eea.cjs} +1 -1
- package/lib/edge/{image-2cc909d9.js → image-0008c792.js} +25 -25
- package/lib/edge/image-ee3dd857.cjs +17 -0
- package/lib/edge/{img-749d10ed.js → img-1259941e.js} +1 -1
- package/lib/edge/{img-f61f7931.cjs → img-c623011b.cjs} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-ccec5aae.js → input-02a1cd9f.js} +1 -1
- package/lib/edge/{input-184da708.cjs → input-2c618b06.cjs} +1 -1
- package/lib/edge/{select-a5fc0333.cjs → select-3acbf5f6.cjs} +1 -1
- package/lib/edge/{select-50a6db92.js → select-b1b6d0bf.js} +1 -1
- package/lib/edge/{server-entry-1cbf5bef.js → server-entry-3f0061ea.js} +1 -1
- package/lib/edge/{server-entry-178f215d.cjs → server-entry-d8f950e0.cjs} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-dad01f2d.js → slot-3cefe326.js} +4 -4
- package/lib/edge/{slot-d3ff8e4d.cjs → slot-92eac261.cjs} +1 -1
- package/lib/edge/{symbol-31283b30.cjs → symbol-741f0aee.cjs} +1 -1
- package/lib/edge/{symbol-b6db0014.js → symbol-e2a47b92.js} +3 -3
- package/lib/edge/{video-d02ff89b.js → video-58c2cc8d.js} +15 -15
- package/lib/edge/video-e20dcbbc.cjs +1 -0
- package/lib/node/blocks-exports.cjs +22 -21
- package/lib/node/blocks-exports.mjs +492 -455
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +1 -1
- package/lib/node/{server-entry-09a75819.js → server-entry-383e8da6.js} +1 -1
- package/lib/node/{server-entry-856d379b.cjs → server-entry-6d61d1cf.cjs} +1 -1
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/package.json +1 -1
- package/types/components/block/block.helpers.d.ts +4 -0
- package/types/components/content/components/enable-editor.d.ts +1 -1
- package/types/components/content/components/styles.d.ts +1 -0
- package/types/components/content/components/styles.helpers.d.ts +1 -0
- package/types/components/content/contentProps.types.d.ts +6 -1
- package/types/components/content-variants/content-variants.d.ts +1 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/functions/evaluate/evaluate.d.ts +3 -1
- package/types/functions/evaluate/helpers.d.ts +1 -0
- package/lib/edge/blocks-a05f6af2.cjs +0 -32
- package/lib/edge/dynamic-renderer-96ba4e48.js +0 -8
- package/lib/edge/form-713c6da6.cjs +0 -1
- package/lib/edge/image-7e1361ce.cjs +0 -17
- package/lib/edge/video-64014cc4.cjs +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { lazy as C, useRef as oe, useState as
|
|
3
|
-
import { isBrowser as
|
|
1
|
+
import { jsx as b, jsxs as U, Fragment as M } from "react/jsx-runtime";
|
|
2
|
+
import { lazy as C, useRef as oe, useState as h, useEffect as y, createElement as re } from "react";
|
|
3
|
+
import { isBrowser as $, TARGET as Z, isEditing as P, registerInsertMenu as se, setupBrowserForEditing as le, createRegisterComponentMessage as de, getDefaultCanTrack as W, _track as O, isPreviewing as ce, fetchOneEntry as ue, logger as me, createEditorListener as pe, fastClone as ge, fetch as fe, serializeComponentInfo as z, handleABTestingSync as he } from "./server-entry-3f0061ea.js";
|
|
4
4
|
import { Video as be, Button as ye, Columns as xe, Fragment as Se, Image as ve, Section as ke, Symbol as Ie, Text as Ce } from "./blocks-exports.mjs";
|
|
5
|
-
import { builderContext as Te, triggerAnimation as we, evaluate as J, InlinedStyles as ee, ComponentsContext as Ve, Blocks as Re } from "./blocks-
|
|
6
|
-
import "./get-class-prop-name-
|
|
7
|
-
import "./dynamic-renderer-
|
|
5
|
+
import { builderContext as Te, triggerAnimation as we, evaluate as J, InlinedStyles as ee, ComponentsContext as Ve, Blocks as Re } from "./blocks-fd4ab30c.js";
|
|
6
|
+
import "./get-class-prop-name-0e4b7b88.js";
|
|
7
|
+
import "./dynamic-renderer-8b343325.js";
|
|
8
8
|
const Ee = {
|
|
9
9
|
name: "Core:Button",
|
|
10
10
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
|
|
@@ -397,7 +397,7 @@ const Ee = {
|
|
|
397
397
|
required: !0,
|
|
398
398
|
defaultValue: "children"
|
|
399
399
|
}]
|
|
400
|
-
}, $e = C(() => import("./slot-
|
|
400
|
+
}, $e = C(() => import("./slot-3cefe326.js")), De = {
|
|
401
401
|
name: "Symbol",
|
|
402
402
|
noWrap: !0,
|
|
403
403
|
static: !0,
|
|
@@ -430,7 +430,7 @@ const Ee = {
|
|
|
430
430
|
hideFromUI: !0,
|
|
431
431
|
type: "boolean"
|
|
432
432
|
}]
|
|
433
|
-
},
|
|
433
|
+
}, He = {
|
|
434
434
|
name: "Text",
|
|
435
435
|
static: !0,
|
|
436
436
|
isRSC: !0,
|
|
@@ -470,7 +470,7 @@ const Ee = {
|
|
|
470
470
|
helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
|
|
471
471
|
advanced: !0
|
|
472
472
|
}]
|
|
473
|
-
},
|
|
473
|
+
}, Ne = C(() => import("./custom-code-7786788e.js")), je = {
|
|
474
474
|
name: "Embed",
|
|
475
475
|
static: !0,
|
|
476
476
|
inputs: [{
|
|
@@ -495,7 +495,7 @@ const Ee = {
|
|
|
495
495
|
defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
|
|
496
496
|
hideFromUI: !0
|
|
497
497
|
}]
|
|
498
|
-
},
|
|
498
|
+
}, qe = C(() => import("./embed-5c1bbe12.js")), Ke = {
|
|
499
499
|
name: "Form:Form",
|
|
500
500
|
// editableTags: ['builder-form-error']
|
|
501
501
|
defaults: {
|
|
@@ -726,7 +726,7 @@ const Ee = {
|
|
|
726
726
|
}
|
|
727
727
|
}
|
|
728
728
|
}]
|
|
729
|
-
},
|
|
729
|
+
}, _e = C(() => import("./form-4fae6192.js")), Be = {
|
|
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 Ee = {
|
|
|
777
777
|
borderStyle: "solid",
|
|
778
778
|
borderColor: "#ccc"
|
|
779
779
|
}
|
|
780
|
-
},
|
|
780
|
+
}, Me = C(() => import("./input-02a1cd9f.js")), Oe = {
|
|
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 Ee = {
|
|
|
819
819
|
}],
|
|
820
820
|
static: !0,
|
|
821
821
|
noWrap: !0
|
|
822
|
-
}, ze = C(() => import("./select-
|
|
822
|
+
}, ze = C(() => import("./select-b1b6d0bf.js")), Je = {
|
|
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 Ee = {
|
|
|
858
858
|
}],
|
|
859
859
|
noWrap: !0,
|
|
860
860
|
static: !0
|
|
861
|
-
}, Ge = C(() => import("./img-
|
|
861
|
+
}, Ge = C(() => import("./img-1259941e.js")), Xe = {
|
|
862
862
|
name: "Video",
|
|
863
863
|
canHaveChildren: !0,
|
|
864
864
|
defaultStyles: {
|
|
@@ -940,17 +940,17 @@ const Ee = {
|
|
|
940
940
|
advanced: !0
|
|
941
941
|
}]
|
|
942
942
|
}, Ze = () => [{
|
|
943
|
-
component:
|
|
943
|
+
component: Ne,
|
|
944
944
|
...Le
|
|
945
945
|
}, {
|
|
946
|
-
component:
|
|
947
|
-
...
|
|
946
|
+
component: qe,
|
|
947
|
+
...je
|
|
948
948
|
}, {
|
|
949
|
-
component:
|
|
950
|
-
...
|
|
949
|
+
component: _e,
|
|
950
|
+
...Ke
|
|
951
951
|
}, {
|
|
952
|
-
component:
|
|
953
|
-
...
|
|
952
|
+
component: Me,
|
|
953
|
+
...Be
|
|
954
954
|
}, {
|
|
955
955
|
component: Ye,
|
|
956
956
|
...Je
|
|
@@ -983,10 +983,10 @@ const Ee = {
|
|
|
983
983
|
...Ue
|
|
984
984
|
}, {
|
|
985
985
|
component: Ie,
|
|
986
|
-
...
|
|
986
|
+
...De
|
|
987
987
|
}, {
|
|
988
988
|
component: Ce,
|
|
989
|
-
...
|
|
989
|
+
...He
|
|
990
990
|
}, ...Ze()], et = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
991
991
|
function getAndSetVariantId() {
|
|
992
992
|
function setCookie(name, value, days) {
|
|
@@ -1077,14 +1077,14 @@ const Ee = {
|
|
|
1077
1077
|
thisScriptEl?.remove();
|
|
1078
1078
|
}
|
|
1079
1079
|
return;
|
|
1080
|
-
}`, te = "builderIoAbTest", ne = "builderIoRenderContent",
|
|
1080
|
+
}`, te = "builderIoAbTest", ne = "builderIoRenderContent", F = (e) => Object.values((e == null ? void 0 : e.variations) || {}).map((t) => ({
|
|
1081
1081
|
...t,
|
|
1082
1082
|
testVariationId: t.id,
|
|
1083
1083
|
id: e == null ? void 0 : e.id
|
|
1084
1084
|
})), nt = ({
|
|
1085
1085
|
canTrack: e,
|
|
1086
1086
|
content: t
|
|
1087
|
-
}) => !(!(
|
|
1087
|
+
}) => !(!(F(t).length > 0) || !e || $()), at = (e) => e === "react" || e === "reactNative", ae = at(Z), it = () => `
|
|
1088
1088
|
window.${te} = ${et}
|
|
1089
1089
|
window.${ne} = ${tt}
|
|
1090
1090
|
`, ot = (e, t) => `
|
|
@@ -1097,7 +1097,7 @@ const Ee = {
|
|
|
1097
1097
|
"${t}", "${e}", ${ae}
|
|
1098
1098
|
)`;
|
|
1099
1099
|
function D(e) {
|
|
1100
|
-
return /* @__PURE__ */
|
|
1100
|
+
return /* @__PURE__ */ b(
|
|
1101
1101
|
"script",
|
|
1102
1102
|
{
|
|
1103
1103
|
dangerouslySetInnerHTML: { __html: e.scriptStr },
|
|
@@ -1149,9 +1149,9 @@ const st = (e, t, n = !0) => {
|
|
|
1149
1149
|
};
|
|
1150
1150
|
};
|
|
1151
1151
|
function ct(e) {
|
|
1152
|
-
var j, q, K, _, B
|
|
1153
|
-
const t = oe(null), [n, a] =
|
|
1154
|
-
|
|
1152
|
+
var L, N, j, q, K, _, B;
|
|
1153
|
+
const t = oe(null), [n, a] = h(() => 0);
|
|
1154
|
+
h(() => !0);
|
|
1155
1155
|
function c(o) {
|
|
1156
1156
|
var s, l;
|
|
1157
1157
|
const r = {
|
|
@@ -1164,7 +1164,7 @@ function ct(e) {
|
|
|
1164
1164
|
}));
|
|
1165
1165
|
}
|
|
1166
1166
|
function m(o) {
|
|
1167
|
-
var s, l, u,
|
|
1167
|
+
var s, l, u, g, w;
|
|
1168
1168
|
const r = {
|
|
1169
1169
|
...e.builderContextSignal.content,
|
|
1170
1170
|
...o,
|
|
@@ -1175,18 +1175,18 @@ function ct(e) {
|
|
|
1175
1175
|
meta: {
|
|
1176
1176
|
...(l = e.builderContextSignal.content) == null ? void 0 : l.meta,
|
|
1177
1177
|
...o == null ? void 0 : o.meta,
|
|
1178
|
-
breakpoints: ((u = o == null ? void 0 : o.meta) == null ? void 0 : u.breakpoints) || ((w = (
|
|
1178
|
+
breakpoints: ((u = o == null ? void 0 : o.meta) == null ? void 0 : u.breakpoints) || ((w = (g = e.builderContextSignal.content) == null ? void 0 : g.meta) == null ? void 0 : w.breakpoints)
|
|
1179
1179
|
}
|
|
1180
1180
|
};
|
|
1181
|
-
e.setBuilderContextSignal((
|
|
1182
|
-
...
|
|
1181
|
+
e.setBuilderContextSignal((E) => ({
|
|
1182
|
+
...E,
|
|
1183
1183
|
content: r
|
|
1184
1184
|
}));
|
|
1185
1185
|
}
|
|
1186
|
-
|
|
1187
|
-
const [i, p] =
|
|
1186
|
+
h(() => 0);
|
|
1187
|
+
const [i, p] = h(
|
|
1188
1188
|
() => !1
|
|
1189
|
-
), [d, f] =
|
|
1189
|
+
), [d, f] = h(
|
|
1190
1190
|
() => e.contentWrapper || "div"
|
|
1191
1191
|
);
|
|
1192
1192
|
function x(o) {
|
|
@@ -1220,56 +1220,63 @@ function ct(e) {
|
|
|
1220
1220
|
context: e.context || {},
|
|
1221
1221
|
localState: void 0,
|
|
1222
1222
|
rootState: e.builderContextSignal.rootState,
|
|
1223
|
-
rootSetState: e.builderContextSignal.rootSetState
|
|
1223
|
+
rootSetState: e.builderContextSignal.rootSetState,
|
|
1224
|
+
/**
|
|
1225
|
+
* We don't want to cache the result of the JS code, since it's arbitrary side effect code.
|
|
1226
|
+
*/
|
|
1227
|
+
enableCache: !1
|
|
1224
1228
|
});
|
|
1225
1229
|
}
|
|
1226
|
-
const [I,
|
|
1230
|
+
const [I, A] = h(() => ({})), [V, S] = h(() => !1);
|
|
1227
1231
|
function v(o) {
|
|
1228
1232
|
var r, s;
|
|
1229
1233
|
if (e.builderContextSignal.content) {
|
|
1230
1234
|
const l = (r = e.builderContextSignal.content) == null ? void 0 : r.testVariationId, u = (s = e.builderContextSignal.content) == null ? void 0 : s.id;
|
|
1231
1235
|
O({
|
|
1232
1236
|
type: "click",
|
|
1233
|
-
canTrack:
|
|
1237
|
+
canTrack: W(e.canTrack),
|
|
1234
1238
|
contentId: u,
|
|
1235
1239
|
apiKey: e.apiKey,
|
|
1236
1240
|
variationId: l !== u ? l : void 0,
|
|
1237
1241
|
...dt(o),
|
|
1238
|
-
unique: !
|
|
1242
|
+
unique: !V
|
|
1239
1243
|
});
|
|
1240
1244
|
}
|
|
1241
|
-
|
|
1245
|
+
V || S(!0);
|
|
1242
1246
|
}
|
|
1243
1247
|
function T(o) {
|
|
1244
1248
|
return o.replace(
|
|
1245
1249
|
/{{([^}]+)}}/g,
|
|
1246
|
-
(r, s) =>
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1250
|
+
(r, s) => String(
|
|
1251
|
+
J({
|
|
1252
|
+
code: s,
|
|
1253
|
+
context: e.context || {},
|
|
1254
|
+
localState: void 0,
|
|
1255
|
+
rootState: e.builderContextSignal.rootState,
|
|
1256
|
+
rootSetState: e.builderContextSignal.rootSetState,
|
|
1257
|
+
enableCache: !0
|
|
1258
|
+
})
|
|
1259
|
+
)
|
|
1253
1260
|
);
|
|
1254
1261
|
}
|
|
1255
1262
|
function ie({ url: o, key: r }) {
|
|
1256
|
-
|
|
1257
|
-
var u,
|
|
1263
|
+
fe(o).then((s) => s.json()).then((s) => {
|
|
1264
|
+
var u, g;
|
|
1258
1265
|
const l = {
|
|
1259
1266
|
...e.builderContextSignal.rootState,
|
|
1260
1267
|
[r]: s
|
|
1261
1268
|
};
|
|
1262
|
-
(
|
|
1269
|
+
(g = (u = e.builderContextSignal).rootSetState) == null || g.call(u, l), I[r] = !0;
|
|
1263
1270
|
}).catch((s) => {
|
|
1264
1271
|
console.error("error fetching dynamic data", o, s);
|
|
1265
1272
|
});
|
|
1266
1273
|
}
|
|
1267
|
-
function
|
|
1274
|
+
function H() {
|
|
1268
1275
|
var r, s, l;
|
|
1269
1276
|
const o = (l = (s = (r = e.builderContextSignal.content) == null ? void 0 : r.data) == null ? void 0 : s.httpRequests) != null ? l : {};
|
|
1270
|
-
Object.entries(o).forEach(([u,
|
|
1271
|
-
if (
|
|
1272
|
-
const w = T(
|
|
1277
|
+
Object.entries(o).forEach(([u, g]) => {
|
|
1278
|
+
if (g && (!I[u] || P())) {
|
|
1279
|
+
const w = T(g);
|
|
1273
1280
|
ie({
|
|
1274
1281
|
url: w,
|
|
1275
1282
|
key: u
|
|
@@ -1277,8 +1284,8 @@ function ct(e) {
|
|
|
1277
1284
|
}
|
|
1278
1285
|
});
|
|
1279
1286
|
}
|
|
1280
|
-
function
|
|
1281
|
-
|
|
1287
|
+
function R() {
|
|
1288
|
+
P() && window.dispatchEvent(
|
|
1282
1289
|
new CustomEvent(
|
|
1283
1290
|
"builder:component:stateChange",
|
|
1284
1291
|
{
|
|
@@ -1294,8 +1301,8 @@ function ct(e) {
|
|
|
1294
1301
|
}
|
|
1295
1302
|
return y(() => {
|
|
1296
1303
|
var o, r;
|
|
1297
|
-
if (
|
|
1298
|
-
if (
|
|
1304
|
+
if ($()) {
|
|
1305
|
+
if (P() && (a(n + 1), window.addEventListener("message", x), se(), le({
|
|
1299
1306
|
...e.locale ? {
|
|
1300
1307
|
locale: e.locale
|
|
1301
1308
|
} : {},
|
|
@@ -1308,48 +1315,48 @@ function ct(e) {
|
|
|
1308
1315
|
}), Object.values(
|
|
1309
1316
|
e.builderContextSignal.componentInfos
|
|
1310
1317
|
).forEach((l) => {
|
|
1311
|
-
var
|
|
1318
|
+
var g;
|
|
1312
1319
|
const u = de(l);
|
|
1313
|
-
(
|
|
1320
|
+
(g = window.parent) == null || g.postMessage(u, "*");
|
|
1314
1321
|
}), window.addEventListener(
|
|
1315
1322
|
"builder:component:stateChangeListenerActivated",
|
|
1316
|
-
|
|
1317
|
-
)), e.builderContextSignal.content &&
|
|
1318
|
-
const l = (o = e.builderContextSignal.content) == null ? void 0 : o.testVariationId, u = (r = e.builderContextSignal.content) == null ? void 0 : r.id,
|
|
1323
|
+
R
|
|
1324
|
+
)), e.builderContextSignal.content && W(e.canTrack)) {
|
|
1325
|
+
const l = (o = e.builderContextSignal.content) == null ? void 0 : o.testVariationId, u = (r = e.builderContextSignal.content) == null ? void 0 : r.id, g = e.apiKey;
|
|
1319
1326
|
O({
|
|
1320
1327
|
type: "impression",
|
|
1321
1328
|
canTrack: !0,
|
|
1322
1329
|
contentId: u,
|
|
1323
|
-
apiKey:
|
|
1330
|
+
apiKey: g,
|
|
1324
1331
|
variationId: l !== u ? l : void 0
|
|
1325
1332
|
});
|
|
1326
1333
|
}
|
|
1327
1334
|
if (ce()) {
|
|
1328
|
-
const l = new URL(location.href).searchParams, u = l.get("builder.preview"),
|
|
1335
|
+
const l = new URL(location.href).searchParams, u = l.get("builder.preview"), g = l.get(
|
|
1329
1336
|
`builder.preview.${u}`
|
|
1330
1337
|
), w = l.get("apiKey") || l.get("builder.space");
|
|
1331
|
-
u === e.model && w === e.apiKey && (!e.content ||
|
|
1338
|
+
u === e.model && w === e.apiKey && (!e.content || g === e.content.id) && ue({
|
|
1332
1339
|
model: e.model,
|
|
1333
1340
|
apiKey: e.apiKey,
|
|
1334
1341
|
apiVersion: e.builderContextSignal.apiVersion
|
|
1335
|
-
}).then((
|
|
1336
|
-
|
|
1342
|
+
}).then((E) => {
|
|
1343
|
+
E && m(E);
|
|
1337
1344
|
});
|
|
1338
1345
|
}
|
|
1339
1346
|
}
|
|
1340
1347
|
}, []), y(() => {
|
|
1341
1348
|
e.apiKey || me.error(
|
|
1342
1349
|
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
1343
|
-
), k(),
|
|
1350
|
+
), k(), H(), R();
|
|
1344
1351
|
}, []), y(() => {
|
|
1345
1352
|
e.content && m(e.content);
|
|
1346
1353
|
}, [e.content]), y(() => {
|
|
1347
1354
|
}, [i]), y(() => {
|
|
1348
1355
|
k();
|
|
1349
|
-
}, [(
|
|
1350
|
-
|
|
1351
|
-
}, [(
|
|
1352
|
-
|
|
1356
|
+
}, [(N = (L = e.builderContextSignal.content) == null ? void 0 : L.data) == null ? void 0 : N.jsCode]), y(() => {
|
|
1357
|
+
H();
|
|
1358
|
+
}, [(q = (j = e.builderContextSignal.content) == null ? void 0 : j.data) == null ? void 0 : q.httpRequests]), y(() => {
|
|
1359
|
+
R();
|
|
1353
1360
|
}, [e.builderContextSignal.rootState]), y(() => {
|
|
1354
1361
|
e.data && c(e.data);
|
|
1355
1362
|
}, [e.data]), y(() => {
|
|
@@ -1357,27 +1364,27 @@ function ct(e) {
|
|
|
1357
1364
|
locale: e.locale
|
|
1358
1365
|
});
|
|
1359
1366
|
}, [e.locale]), y(() => () => {
|
|
1360
|
-
|
|
1367
|
+
$() && (window.removeEventListener("message", x), window.removeEventListener(
|
|
1361
1368
|
"builder:component:stateChangeListenerActivated",
|
|
1362
|
-
|
|
1369
|
+
R
|
|
1363
1370
|
));
|
|
1364
|
-
}, []), /* @__PURE__ */
|
|
1371
|
+
}, []), /* @__PURE__ */ b(Te.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ re(
|
|
1365
1372
|
d,
|
|
1366
1373
|
{
|
|
1367
1374
|
key: n,
|
|
1368
1375
|
ref: t,
|
|
1369
1376
|
onClick: (o) => v(o),
|
|
1370
|
-
"builder-content-id": (
|
|
1377
|
+
"builder-content-id": (K = e.builderContextSignal.content) == null ? void 0 : K.id,
|
|
1371
1378
|
"builder-model": e.model,
|
|
1372
1379
|
...e.showContent ? {} : {
|
|
1373
1380
|
hidden: !0,
|
|
1374
1381
|
"aria-hidden": !0
|
|
1375
1382
|
},
|
|
1376
1383
|
...e.contentWrapperProps,
|
|
1377
|
-
className: `variant-${((
|
|
1384
|
+
className: `variant-${((_ = e.content) == null ? void 0 : _.testVariationId) || ((B = e.content) == null ? void 0 : B.id)}`
|
|
1378
1385
|
},
|
|
1379
1386
|
e.children
|
|
1380
|
-
)
|
|
1387
|
+
) : null });
|
|
1381
1388
|
}
|
|
1382
1389
|
const ut = (e) => {
|
|
1383
1390
|
var m, i;
|
|
@@ -1413,18 +1420,7 @@ font-weight: ${p};
|
|
|
1413
1420
|
}, pt = ({
|
|
1414
1421
|
cssCode: e,
|
|
1415
1422
|
contentId: t
|
|
1416
|
-
}) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : ""
|
|
1417
|
-
function gt(e) {
|
|
1418
|
-
const [t, n] = b(
|
|
1419
|
-
() => `
|
|
1420
|
-
${pt({
|
|
1421
|
-
cssCode: e.cssCode,
|
|
1422
|
-
contentId: e.contentId
|
|
1423
|
-
})}
|
|
1424
|
-
${mt({
|
|
1425
|
-
customFonts: e.customFonts
|
|
1426
|
-
})}
|
|
1427
|
-
|
|
1423
|
+
}) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "", gt = `
|
|
1428
1424
|
.builder-button {
|
|
1429
1425
|
all: unset;
|
|
1430
1426
|
}
|
|
@@ -1441,11 +1437,23 @@ ${mt({
|
|
|
1441
1437
|
text-align: inherit;
|
|
1442
1438
|
font-family: inherit;
|
|
1443
1439
|
}
|
|
1440
|
+
`, ft = (e) => e ? "" : gt;
|
|
1441
|
+
function ht(e) {
|
|
1442
|
+
const [t, n] = h(
|
|
1443
|
+
() => `
|
|
1444
|
+
${pt({
|
|
1445
|
+
cssCode: e.cssCode,
|
|
1446
|
+
contentId: e.contentId
|
|
1447
|
+
})}
|
|
1448
|
+
${mt({
|
|
1449
|
+
customFonts: e.customFonts
|
|
1450
|
+
})}
|
|
1451
|
+
${ft(e.isNestedRender)}
|
|
1444
1452
|
`.trim()
|
|
1445
1453
|
);
|
|
1446
|
-
return /* @__PURE__ */
|
|
1454
|
+
return /* @__PURE__ */ b(ee, { styles: t });
|
|
1447
1455
|
}
|
|
1448
|
-
const
|
|
1456
|
+
const bt = ({
|
|
1449
1457
|
content: e,
|
|
1450
1458
|
data: t,
|
|
1451
1459
|
locale: n
|
|
@@ -1462,7 +1470,7 @@ const ht = ({
|
|
|
1462
1470
|
locale: n
|
|
1463
1471
|
} : {}
|
|
1464
1472
|
};
|
|
1465
|
-
},
|
|
1473
|
+
}, yt = ({
|
|
1466
1474
|
content: e,
|
|
1467
1475
|
data: t
|
|
1468
1476
|
}) => e ? {
|
|
@@ -1474,8 +1482,8 @@ const ht = ({
|
|
|
1474
1482
|
meta: e == null ? void 0 : e.meta
|
|
1475
1483
|
} : void 0;
|
|
1476
1484
|
function X(e) {
|
|
1477
|
-
var d, f, x, k, I,
|
|
1478
|
-
const [t, n] =
|
|
1485
|
+
var d, f, x, k, I, A, V;
|
|
1486
|
+
const [t, n] = h(
|
|
1479
1487
|
() => {
|
|
1480
1488
|
var S, v;
|
|
1481
1489
|
return rt({
|
|
@@ -1492,7 +1500,7 @@ function X(e) {
|
|
|
1492
1500
|
rootState: S
|
|
1493
1501
|
}));
|
|
1494
1502
|
}
|
|
1495
|
-
const [c, m] =
|
|
1503
|
+
const [c, m] = h(
|
|
1496
1504
|
() => [
|
|
1497
1505
|
...Y(),
|
|
1498
1506
|
...e.customComponents || []
|
|
@@ -1506,13 +1514,13 @@ function X(e) {
|
|
|
1506
1514
|
}),
|
|
1507
1515
|
{}
|
|
1508
1516
|
)
|
|
1509
|
-
), [i, p] =
|
|
1510
|
-
content:
|
|
1517
|
+
), [i, p] = h(() => ({
|
|
1518
|
+
content: yt({
|
|
1511
1519
|
content: e.content,
|
|
1512
1520
|
data: e.data
|
|
1513
1521
|
}),
|
|
1514
1522
|
localState: void 0,
|
|
1515
|
-
rootState:
|
|
1523
|
+
rootState: bt({
|
|
1516
1524
|
content: e.content,
|
|
1517
1525
|
data: e.data,
|
|
1518
1526
|
locale: e.locale
|
|
@@ -1535,13 +1543,13 @@ function X(e) {
|
|
|
1535
1543
|
BlocksWrapper: e.blocksWrapper || "div",
|
|
1536
1544
|
BlocksWrapperProps: e.blocksWrapperProps || {}
|
|
1537
1545
|
}));
|
|
1538
|
-
return /* @__PURE__ */
|
|
1546
|
+
return /* @__PURE__ */ b(
|
|
1539
1547
|
Ve.Provider,
|
|
1540
1548
|
{
|
|
1541
1549
|
value: {
|
|
1542
1550
|
registeredComponents: c
|
|
1543
1551
|
},
|
|
1544
|
-
children: /* @__PURE__ */
|
|
1552
|
+
children: /* @__PURE__ */ U(
|
|
1545
1553
|
ct,
|
|
1546
1554
|
{
|
|
1547
1555
|
content: e.content,
|
|
@@ -1560,19 +1568,20 @@ function X(e) {
|
|
|
1560
1568
|
trustedHosts: e.trustedHosts,
|
|
1561
1569
|
setBuilderContextSignal: p,
|
|
1562
1570
|
children: [
|
|
1563
|
-
e.isSsrAbTest ? /* @__PURE__ */
|
|
1564
|
-
/* @__PURE__ */
|
|
1565
|
-
|
|
1571
|
+
e.isSsrAbTest ? /* @__PURE__ */ b(D, { scriptStr: t }) : null,
|
|
1572
|
+
/* @__PURE__ */ b(
|
|
1573
|
+
ht,
|
|
1566
1574
|
{
|
|
1575
|
+
isNestedRender: e.isNestedRender,
|
|
1567
1576
|
contentId: (d = i.content) == null ? void 0 : d.id,
|
|
1568
1577
|
cssCode: (x = (f = i.content) == null ? void 0 : f.data) == null ? void 0 : x.cssCode,
|
|
1569
1578
|
customFonts: (I = (k = i.content) == null ? void 0 : k.data) == null ? void 0 : I.customFonts
|
|
1570
1579
|
}
|
|
1571
|
-
)
|
|
1572
|
-
/* @__PURE__ */
|
|
1580
|
+
),
|
|
1581
|
+
/* @__PURE__ */ b(
|
|
1573
1582
|
Re,
|
|
1574
1583
|
{
|
|
1575
|
-
blocks: (
|
|
1584
|
+
blocks: (V = (A = i.content) == null ? void 0 : A.data) == null ? void 0 : V.blocks,
|
|
1576
1585
|
context: i,
|
|
1577
1586
|
registeredComponents: c,
|
|
1578
1587
|
linkComponent: e.linkComponent
|
|
@@ -1584,18 +1593,18 @@ function X(e) {
|
|
|
1584
1593
|
}
|
|
1585
1594
|
);
|
|
1586
1595
|
}
|
|
1587
|
-
function
|
|
1596
|
+
function wt(e) {
|
|
1588
1597
|
var i, p;
|
|
1589
|
-
const [t, n] =
|
|
1598
|
+
const [t, n] = h(
|
|
1590
1599
|
() => nt({
|
|
1591
|
-
canTrack:
|
|
1600
|
+
canTrack: W(e.canTrack),
|
|
1592
1601
|
content: e.content
|
|
1593
1602
|
})
|
|
1594
1603
|
);
|
|
1595
1604
|
function a() {
|
|
1596
1605
|
var d;
|
|
1597
1606
|
return ot(
|
|
1598
|
-
|
|
1607
|
+
F(e.content).map((f) => ({
|
|
1599
1608
|
id: f.testVariationId,
|
|
1600
1609
|
testRatio: f.testRatio
|
|
1601
1610
|
})),
|
|
@@ -1603,33 +1612,34 @@ function Ct(e) {
|
|
|
1603
1612
|
);
|
|
1604
1613
|
}
|
|
1605
1614
|
function c() {
|
|
1606
|
-
return
|
|
1615
|
+
return F(e.content).map((d) => `.variant-${d.testVariationId} { display: none; } `).join("");
|
|
1607
1616
|
}
|
|
1608
1617
|
function m() {
|
|
1609
1618
|
var d;
|
|
1610
1619
|
return t ? {
|
|
1611
1620
|
...e.content,
|
|
1612
1621
|
testVariationId: (d = e.content) == null ? void 0 : d.id
|
|
1613
|
-
} :
|
|
1622
|
+
} : he({
|
|
1614
1623
|
item: e.content,
|
|
1615
|
-
canTrack:
|
|
1624
|
+
canTrack: W(e.canTrack)
|
|
1616
1625
|
});
|
|
1617
1626
|
}
|
|
1618
1627
|
return y(() => {
|
|
1619
|
-
}, []), /* @__PURE__ */
|
|
1620
|
-
!e.
|
|
1621
|
-
t ? /* @__PURE__ */
|
|
1622
|
-
/* @__PURE__ */
|
|
1628
|
+
}, []), /* @__PURE__ */ U(M, { children: [
|
|
1629
|
+
!e.isNestedRender && Z !== "reactNative" ? /* @__PURE__ */ b(D, { scriptStr: it() }) : null,
|
|
1630
|
+
t ? /* @__PURE__ */ U(M, { children: [
|
|
1631
|
+
/* @__PURE__ */ b(
|
|
1623
1632
|
ee,
|
|
1624
1633
|
{
|
|
1625
1634
|
id: `variants-styles-${(i = e.content) == null ? void 0 : i.id}`,
|
|
1626
1635
|
styles: c()
|
|
1627
1636
|
}
|
|
1628
1637
|
),
|
|
1629
|
-
/* @__PURE__ */
|
|
1630
|
-
(p =
|
|
1638
|
+
/* @__PURE__ */ b(D, { scriptStr: a() }),
|
|
1639
|
+
(p = F(e.content)) == null ? void 0 : p.map((d) => /* @__PURE__ */ b(
|
|
1631
1640
|
X,
|
|
1632
1641
|
{
|
|
1642
|
+
isNestedRender: e.isNestedRender,
|
|
1633
1643
|
content: d,
|
|
1634
1644
|
showContent: !1,
|
|
1635
1645
|
model: e.model,
|
|
@@ -1652,9 +1662,10 @@ function Ct(e) {
|
|
|
1652
1662
|
d.testVariationId
|
|
1653
1663
|
))
|
|
1654
1664
|
] }) : null,
|
|
1655
|
-
/* @__PURE__ */
|
|
1665
|
+
/* @__PURE__ */ b(
|
|
1656
1666
|
X,
|
|
1657
1667
|
{
|
|
1668
|
+
isNestedRender: e.isNestedRender,
|
|
1658
1669
|
content: m(),
|
|
1659
1670
|
showContent: !0,
|
|
1660
1671
|
model: e.model,
|
|
@@ -1678,5 +1689,5 @@ function Ct(e) {
|
|
|
1678
1689
|
] });
|
|
1679
1690
|
}
|
|
1680
1691
|
export {
|
|
1681
|
-
|
|
1692
|
+
wt as default
|
|
1682
1693
|
};
|