@builder.io/sdk-react 4.0.2 → 4.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/blocks-exports.cjs +30 -27
- package/lib/browser/blocks-exports.mjs +468 -457
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/{server-entry-9e5daeda.cjs → server-entry-c40e781d.cjs} +1 -1
- package/lib/browser/{server-entry-25e49efc.js → server-entry-e6ae7704.js} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-f5e5687b.cjs → accordion-8934ef4b.cjs} +1 -1
- package/lib/edge/{accordion-5063d748.js → accordion-e657c96d.js} +1 -1
- package/lib/edge/{blocks-f3b2fbd5.js → blocks-513223a7.js} +2 -2
- package/lib/edge/{blocks-d690074d.cjs → blocks-a6ffbf92.cjs} +1 -1
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-0d0430e9.js → button-3522aac2.js} +2 -2
- package/lib/edge/{button-7cac2c65.cjs → button-49563e3b.cjs} +1 -1
- package/lib/edge/{columns-87b82f2f.cjs → columns-092b6fac.cjs} +1 -1
- package/lib/edge/{columns-19b22772.js → columns-ea0b3b30.js} +3 -3
- package/lib/edge/{content-variants-0f0a71cb.js → content-variants-6c1e3b13.js} +95 -92
- package/lib/edge/{content-variants-80fc28d8.cjs → content-variants-75ff40ca.cjs} +16 -13
- package/lib/edge/custom-code-1a43bbd7.js +52 -0
- package/lib/edge/custom-code-ae3262be.cjs +1 -0
- package/lib/edge/embed-106f0066.js +38 -0
- package/lib/edge/embed-8d302933.cjs +1 -0
- package/lib/edge/{form-b8f74b68.js → form-0c0d5bf5.js} +3 -3
- package/lib/edge/{form-0b5bd2e3.cjs → form-46e4d997.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-6ef08339.cjs → get-class-prop-name-dad1ee7e.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-f3ce6ca4.js → get-class-prop-name-e44df0c8.js} +1 -1
- package/lib/edge/{img-4becc0d4.js → img-8bdeb666.js} +1 -1
- package/lib/edge/{img-20126279.cjs → img-e49acb58.cjs} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-6884ec2d.cjs → input-92aaa4f2.cjs} +1 -1
- package/lib/edge/{input-768a5984.js → input-d6338de6.js} +1 -1
- package/lib/edge/{personalization-container-b581d0f6.js → personalization-container-1307218b.js} +4 -4
- package/lib/edge/{personalization-container-8b32ce9d.cjs → personalization-container-965bec51.cjs} +1 -1
- package/lib/edge/{select-e54dc6bc.js → select-1538b41a.js} +1 -1
- package/lib/edge/{select-ac5b39d8.cjs → select-5ce728b4.cjs} +1 -1
- package/lib/edge/{server-entry-818ae9c6.js → server-entry-2e94ad2c.js} +1 -1
- package/lib/edge/{server-entry-a60fb569.cjs → server-entry-46e686b9.cjs} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-5dba6213.cjs → slot-3b6aa7ec.cjs} +1 -1
- package/lib/edge/{slot-05218273.js → slot-516f176d.js} +3 -3
- package/lib/edge/{symbol-9f247918.js → symbol-3b2e7ebf.js} +2 -2
- package/lib/edge/{symbol-f4b09828.cjs → symbol-cd10b6f0.cjs} +1 -1
- package/lib/edge/{tabs-02960a8c.cjs → tabs-cec51291.cjs} +1 -1
- package/lib/edge/{tabs-a0b38dde.js → tabs-f0945019.js} +3 -3
- package/lib/node/blocks-exports.cjs +30 -27
- package/lib/node/blocks-exports.mjs +477 -466
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +3 -3
- package/lib/node/{server-entry-2a2cad4a.cjs → server-entry-6b05381c.cjs} +1 -1
- package/lib/node/{server-entry-702b1a29.js → server-entry-c1000f54.js} +1 -1
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/lib/node/{setIvm-0a6b0788.js → setIvm-011d6eb2.js} +1 -1
- package/lib/node/{setIvm-9cddfc1a.cjs → setIvm-4ae0308c.cjs} +1 -1
- package/lib/node/setIvm.cjs +1 -1
- package/lib/node/setIvm.mjs +2 -2
- package/lib/node/{should-force-browser-runtime-in-node-d6c9e985.cjs → should-force-browser-runtime-in-node-5d513614.cjs} +1 -1
- package/lib/node/{should-force-browser-runtime-in-node-dfff7f8f.js → should-force-browser-runtime-in-node-abf8d0a7.js} +1 -1
- package/package.json +1 -1
- package/types/components/content-variants/inlined-fns.d.ts +1 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/lib/edge/custom-code-7786788e.js +0 -43
- package/lib/edge/custom-code-8119ea3f.cjs +0 -1
- package/lib/edge/embed-32bdd007.cjs +0 -1
- package/lib/edge/embed-5c1bbe12.js +0 -37
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as h, jsxs as
|
|
2
|
-
import { lazy as y, useRef as
|
|
3
|
-
import { isBrowser as
|
|
1
|
+
import { jsx as h, jsxs as O, Fragment as Q } from "react/jsx-runtime";
|
|
2
|
+
import { lazy as y, useRef as M, useState as T, useEffect as E } from "react";
|
|
3
|
+
import { isBrowser as z, TARGET as N, isEditing as A, isPreviewing as oe, registerInsertMenu as ce, setupBrowserForEditing as me, createRegisterComponentMessage as pe, getDefaultCanTrack as L, getCookieSync as fe, _track as X, fetchOneEntry as ge, createEditorListener as he, logFetch as be, serializeIncludingFunctions as Z, logger as ye, handleABTestingSync as xe } from "./server-entry-2e94ad2c.js";
|
|
4
4
|
import { Video as ve, Button as Se, Columns as Te, Fragment as Ie, Image as ke, Section as Ce, Symbol as we, Text as Ve, BuilderContext as Re } from "./blocks-exports.mjs";
|
|
5
|
-
import { triggerAnimation as Ee, evaluate as re, fastClone as Fe, InlinedStyles as le, ComponentsContext as Pe, Blocks as
|
|
6
|
-
const
|
|
5
|
+
import { triggerAnimation as Ee, evaluate as re, fastClone as Fe, InlinedStyles as le, ComponentsContext as Pe, Blocks as Ae } from "./blocks-513223a7.js";
|
|
6
|
+
const $ = {
|
|
7
7
|
"@type": "@builder.io/sdk:Element",
|
|
8
8
|
layerName: "Accordion item title",
|
|
9
9
|
responsiveStyles: {
|
|
@@ -32,7 +32,7 @@ const q = {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
}]
|
|
35
|
-
},
|
|
35
|
+
}, _ = {
|
|
36
36
|
"@type": "@builder.io/sdk:Element",
|
|
37
37
|
layerName: "Accordion item detail",
|
|
38
38
|
responsiveStyles: {
|
|
@@ -63,7 +63,7 @@ const q = {
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
}]
|
|
66
|
-
},
|
|
66
|
+
}, We = {
|
|
67
67
|
name: "Builder:Accordion",
|
|
68
68
|
canHaveChildren: !0,
|
|
69
69
|
image: "https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",
|
|
@@ -80,19 +80,19 @@ const q = {
|
|
|
80
80
|
name: "title",
|
|
81
81
|
type: "uiBlocks",
|
|
82
82
|
hideFromUI: !0,
|
|
83
|
-
defaultValue: [
|
|
83
|
+
defaultValue: [$]
|
|
84
84
|
}, {
|
|
85
85
|
name: "detail",
|
|
86
86
|
type: "uiBlocks",
|
|
87
87
|
hideFromUI: !0,
|
|
88
|
-
defaultValue: [
|
|
88
|
+
defaultValue: [_]
|
|
89
89
|
}],
|
|
90
90
|
defaultValue: [{
|
|
91
|
-
title: [
|
|
92
|
-
detail: [
|
|
91
|
+
title: [$],
|
|
92
|
+
detail: [_]
|
|
93
93
|
}, {
|
|
94
|
-
title: [
|
|
95
|
-
detail: [
|
|
94
|
+
title: [$],
|
|
95
|
+
detail: [_]
|
|
96
96
|
}],
|
|
97
97
|
showIf: (e) => !e.get("useChildrenForItems")
|
|
98
98
|
}, {
|
|
@@ -127,7 +127,7 @@ const q = {
|
|
|
127
127
|
builderComponents: !0,
|
|
128
128
|
builderLinkComponent: !0
|
|
129
129
|
}
|
|
130
|
-
}, Be = y(() => import("./accordion-
|
|
130
|
+
}, Be = y(() => import("./accordion-e657c96d.js")), De = {
|
|
131
131
|
name: "Core:Button",
|
|
132
132
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
|
|
133
133
|
defaultStyles: {
|
|
@@ -519,7 +519,7 @@ const q = {
|
|
|
519
519
|
defaultValue: []
|
|
520
520
|
}]
|
|
521
521
|
}]
|
|
522
|
-
}, $e = y(() => import("./personalization-container-
|
|
522
|
+
}, $e = y(() => import("./personalization-container-1307218b.js")), _e = {
|
|
523
523
|
name: "Core:Section",
|
|
524
524
|
static: !0,
|
|
525
525
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -558,7 +558,7 @@ const q = {
|
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
560
|
}]
|
|
561
|
-
},
|
|
561
|
+
}, Ke = {
|
|
562
562
|
name: "Slot",
|
|
563
563
|
isRSC: !0,
|
|
564
564
|
description: "Allow child blocks to be inserted into this content when used as a Symbol",
|
|
@@ -575,7 +575,7 @@ const q = {
|
|
|
575
575
|
builderContext: !0,
|
|
576
576
|
builderComponents: !0
|
|
577
577
|
}
|
|
578
|
-
},
|
|
578
|
+
}, je = y(() => import("./slot-516f176d.js")), Oe = {
|
|
579
579
|
name: "Symbol",
|
|
580
580
|
noWrap: !0,
|
|
581
581
|
static: !0,
|
|
@@ -614,7 +614,7 @@ const q = {
|
|
|
614
614
|
builderComponents: !0,
|
|
615
615
|
builderLinkComponent: !0
|
|
616
616
|
}
|
|
617
|
-
},
|
|
617
|
+
}, K = {
|
|
618
618
|
"@type": "@builder.io/sdk:Element",
|
|
619
619
|
responsiveStyles: {
|
|
620
620
|
large: {
|
|
@@ -662,7 +662,7 @@ const q = {
|
|
|
662
662
|
name: "label",
|
|
663
663
|
type: "uiBlocks",
|
|
664
664
|
hideFromUI: !0,
|
|
665
|
-
defaultValue: [
|
|
665
|
+
defaultValue: [K]
|
|
666
666
|
}, {
|
|
667
667
|
name: "content",
|
|
668
668
|
type: "uiBlocks",
|
|
@@ -671,7 +671,7 @@ const q = {
|
|
|
671
671
|
}],
|
|
672
672
|
defaultValue: [{
|
|
673
673
|
label: [{
|
|
674
|
-
...
|
|
674
|
+
...K,
|
|
675
675
|
component: {
|
|
676
676
|
name: "Text",
|
|
677
677
|
options: {
|
|
@@ -690,7 +690,7 @@ const q = {
|
|
|
690
690
|
}]
|
|
691
691
|
}, {
|
|
692
692
|
label: [{
|
|
693
|
-
...
|
|
693
|
+
...K,
|
|
694
694
|
component: {
|
|
695
695
|
name: "Text",
|
|
696
696
|
options: {
|
|
@@ -755,7 +755,7 @@ const q = {
|
|
|
755
755
|
builderComponents: !0,
|
|
756
756
|
builderLinkComponent: !0
|
|
757
757
|
}
|
|
758
|
-
}, ze = y(() => import("./tabs-
|
|
758
|
+
}, ze = y(() => import("./tabs-f0945019.js")), Je = {
|
|
759
759
|
shouldReceiveBuilderProps: {
|
|
760
760
|
builderBlock: !1,
|
|
761
761
|
builderContext: !0
|
|
@@ -799,7 +799,7 @@ const q = {
|
|
|
799
799
|
helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
|
|
800
800
|
advanced: !0
|
|
801
801
|
}]
|
|
802
|
-
}, Ge = y(() => import("./custom-code-
|
|
802
|
+
}, Ge = y(() => import("./custom-code-1a43bbd7.js")), Qe = {
|
|
803
803
|
name: "Embed",
|
|
804
804
|
static: !0,
|
|
805
805
|
inputs: [{
|
|
@@ -814,7 +814,7 @@ const q = {
|
|
|
814
814
|
defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
|
|
815
815
|
hideFromUI: !0
|
|
816
816
|
}]
|
|
817
|
-
}, Xe = y(() => import("./embed-
|
|
817
|
+
}, Xe = y(() => import("./embed-106f0066.js")), Ze = {
|
|
818
818
|
name: "Form:Form",
|
|
819
819
|
// editableTags: ['builder-form-error']
|
|
820
820
|
defaults: {
|
|
@@ -1051,7 +1051,7 @@ const q = {
|
|
|
1051
1051
|
builderComponents: !0,
|
|
1052
1052
|
builderLinkComponent: !0
|
|
1053
1053
|
}
|
|
1054
|
-
}, et = y(() => import("./form-
|
|
1054
|
+
}, et = y(() => import("./form-0c0d5bf5.js")), tt = {
|
|
1055
1055
|
name: "Form:Input",
|
|
1056
1056
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
1057
1057
|
inputs: [
|
|
@@ -1102,7 +1102,7 @@ const q = {
|
|
|
1102
1102
|
borderStyle: "solid",
|
|
1103
1103
|
borderColor: "#ccc"
|
|
1104
1104
|
}
|
|
1105
|
-
}, nt = y(() => import("./input-
|
|
1105
|
+
}, nt = y(() => import("./input-d6338de6.js")), at = {
|
|
1106
1106
|
name: "Form:Select",
|
|
1107
1107
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
1108
1108
|
defaultStyles: {
|
|
@@ -1144,7 +1144,7 @@ const q = {
|
|
|
1144
1144
|
}],
|
|
1145
1145
|
static: !0,
|
|
1146
1146
|
noWrap: !0
|
|
1147
|
-
}, it = y(() => import("./select-
|
|
1147
|
+
}, it = y(() => import("./select-1538b41a.js")), ot = {
|
|
1148
1148
|
name: "Form:SubmitButton",
|
|
1149
1149
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
1150
1150
|
defaultStyles: {
|
|
@@ -1219,7 +1219,7 @@ const q = {
|
|
|
1219
1219
|
}],
|
|
1220
1220
|
noWrap: !0,
|
|
1221
1221
|
static: !0
|
|
1222
|
-
}, ut = y(() => import("./img-
|
|
1222
|
+
}, ut = y(() => import("./img-8bdeb666.js")), ct = {
|
|
1223
1223
|
name: "Video",
|
|
1224
1224
|
canHaveChildren: !0,
|
|
1225
1225
|
defaultStyles: {
|
|
@@ -1346,8 +1346,8 @@ const q = {
|
|
|
1346
1346
|
component: Ce,
|
|
1347
1347
|
..._e
|
|
1348
1348
|
}, {
|
|
1349
|
-
component:
|
|
1350
|
-
...
|
|
1349
|
+
component: je,
|
|
1350
|
+
...Ke
|
|
1351
1351
|
}, {
|
|
1352
1352
|
component: we,
|
|
1353
1353
|
...Oe
|
|
@@ -1362,8 +1362,8 @@ const q = {
|
|
|
1362
1362
|
...Me
|
|
1363
1363
|
}, {
|
|
1364
1364
|
component: Be,
|
|
1365
|
-
...
|
|
1366
|
-
}, ...mt()], pt = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
1365
|
+
...We
|
|
1366
|
+
}, ...mt()], pt = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget, isAngularSDK) {
|
|
1367
1367
|
function getAndSetVariantId() {
|
|
1368
1368
|
function setCookie(name, value, days) {
|
|
1369
1369
|
let expires = '';
|
|
@@ -1405,7 +1405,10 @@ const q = {
|
|
|
1405
1405
|
return contentId;
|
|
1406
1406
|
}
|
|
1407
1407
|
const winningVariantId = getAndSetVariantId();
|
|
1408
|
-
|
|
1408
|
+
let styleEl = document.currentScript?.previousElementSibling;
|
|
1409
|
+
if (isAngularSDK) {
|
|
1410
|
+
styleEl = document.currentScript?.parentElement?.previousElementSibling?.querySelector('style');
|
|
1411
|
+
}
|
|
1409
1412
|
if (isHydrationTarget) {
|
|
1410
1413
|
styleEl.remove();
|
|
1411
1414
|
const thisScriptEl = document.currentScript;
|
|
@@ -1460,19 +1463,19 @@ const q = {
|
|
|
1460
1463
|
})), gt = ({
|
|
1461
1464
|
canTrack: e,
|
|
1462
1465
|
content: t
|
|
1463
|
-
}) => !(!(H(t).length > 0) || !e ||
|
|
1466
|
+
}) => !(!(H(t).length > 0) || !e || z()), ht = (e) => e === "react" || e === "reactNative", bt = N === "angular", ue = ht(N), yt = () => `
|
|
1464
1467
|
window.${se} = ${pt}
|
|
1465
1468
|
window.${de} = ${ft}
|
|
1466
|
-
`,
|
|
1469
|
+
`, xt = (e, t) => `
|
|
1467
1470
|
window.${se}(
|
|
1468
|
-
"${t}",${JSON.stringify(e)}, ${ue}
|
|
1469
|
-
)`,
|
|
1471
|
+
"${t}",${JSON.stringify(e)}, ${ue}, ${bt}
|
|
1472
|
+
)`, vt = ({
|
|
1470
1473
|
contentId: e,
|
|
1471
1474
|
variationId: t
|
|
1472
1475
|
}) => `window.${de}(
|
|
1473
1476
|
"${t}", "${e}", ${ue}
|
|
1474
1477
|
)`;
|
|
1475
|
-
function
|
|
1478
|
+
function J(e) {
|
|
1476
1479
|
return /* @__PURE__ */ h(
|
|
1477
1480
|
"script",
|
|
1478
1481
|
{
|
|
@@ -1485,7 +1488,7 @@ function z(e) {
|
|
|
1485
1488
|
function te(e) {
|
|
1486
1489
|
return Math.round(e * 1e3) / 1e3;
|
|
1487
1490
|
}
|
|
1488
|
-
const
|
|
1491
|
+
const St = (e, t, n = !0) => {
|
|
1489
1492
|
if (!(e instanceof HTMLElement))
|
|
1490
1493
|
return null;
|
|
1491
1494
|
let i = n ? e : e.parentElement;
|
|
@@ -1496,7 +1499,7 @@ const vt = (e, t, n = !0) => {
|
|
|
1496
1499
|
return i;
|
|
1497
1500
|
} while (i = i.parentElement);
|
|
1498
1501
|
return null;
|
|
1499
|
-
},
|
|
1502
|
+
}, Tt = (e) => St(e, (t) => {
|
|
1500
1503
|
const n = t.getAttribute("builder-id") || t.id;
|
|
1501
1504
|
return (n == null ? void 0 : n.indexOf("builder-")) === 0;
|
|
1502
1505
|
}), ne = ({
|
|
@@ -1508,8 +1511,8 @@ const vt = (e, t, n = !0) => {
|
|
|
1508
1511
|
x: u,
|
|
1509
1512
|
y: a
|
|
1510
1513
|
};
|
|
1511
|
-
},
|
|
1512
|
-
const t = e.target, n = t &&
|
|
1514
|
+
}, It = (e) => {
|
|
1515
|
+
const t = e.target, n = t && Tt(t), i = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
|
|
1513
1516
|
return {
|
|
1514
1517
|
targetBuilderElement: i || void 0,
|
|
1515
1518
|
metadata: {
|
|
@@ -1524,7 +1527,7 @@ const vt = (e, t, n = !0) => {
|
|
|
1524
1527
|
builderElementIndex: n && i ? [].slice.call(document.getElementsByClassName(i)).indexOf(n) : void 0
|
|
1525
1528
|
}
|
|
1526
1529
|
};
|
|
1527
|
-
},
|
|
1530
|
+
}, kt = ["svelte", "qwik", "vue"], ae = () => kt.includes(N) && (A() || oe()), Ct = (e) => {
|
|
1528
1531
|
var u, a;
|
|
1529
1532
|
const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], i = (a = e.fileUrl) != null ? a : (u = e == null ? void 0 : e.files) == null ? void 0 : u.regular;
|
|
1530
1533
|
let r = "";
|
|
@@ -1550,15 +1553,15 @@ font-weight: ${o};
|
|
|
1550
1553
|
`.trim());
|
|
1551
1554
|
}
|
|
1552
1555
|
return r;
|
|
1553
|
-
},
|
|
1556
|
+
}, wt = ({
|
|
1554
1557
|
customFonts: e
|
|
1555
1558
|
}) => {
|
|
1556
1559
|
var t;
|
|
1557
|
-
return ((t = e == null ? void 0 : e.map((n) =>
|
|
1558
|
-
},
|
|
1560
|
+
return ((t = e == null ? void 0 : e.map((n) => Ct(n))) == null ? void 0 : t.join(" ")) || "";
|
|
1561
|
+
}, Vt = ({
|
|
1559
1562
|
cssCode: e,
|
|
1560
1563
|
contentId: t
|
|
1561
|
-
}) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "",
|
|
1564
|
+
}) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "", Rt = `
|
|
1562
1565
|
.builder-button {
|
|
1563
1566
|
all: unset;
|
|
1564
1567
|
}
|
|
@@ -1575,10 +1578,10 @@ font-weight: ${o};
|
|
|
1575
1578
|
text-align: inherit;
|
|
1576
1579
|
font-family: inherit;
|
|
1577
1580
|
}
|
|
1578
|
-
`,
|
|
1579
|
-
function
|
|
1581
|
+
`, Et = (e) => e ? "" : Rt, Ft = (e) => `variant-${e}`;
|
|
1582
|
+
function Pt(e) {
|
|
1580
1583
|
var f, b, w;
|
|
1581
|
-
const t =
|
|
1584
|
+
const t = M(null);
|
|
1582
1585
|
T(() => !1);
|
|
1583
1586
|
function n(l) {
|
|
1584
1587
|
var m, p;
|
|
@@ -1646,7 +1649,7 @@ function Ft(e) {
|
|
|
1646
1649
|
}
|
|
1647
1650
|
})(l);
|
|
1648
1651
|
}
|
|
1649
|
-
const [c, v] = T(() => ({})), [x, F] = T(() => ({})), [C,
|
|
1652
|
+
const [c, v] = T(() => ({})), [x, F] = T(() => ({})), [C, W] = T(() => !1);
|
|
1650
1653
|
function B(l) {
|
|
1651
1654
|
var s, m;
|
|
1652
1655
|
if (e.builderContextSignal.content) {
|
|
@@ -1658,17 +1661,17 @@ function Ft(e) {
|
|
|
1658
1661
|
contentId: d,
|
|
1659
1662
|
apiKey: e.apiKey,
|
|
1660
1663
|
variationId: p !== d ? p : void 0,
|
|
1661
|
-
...
|
|
1664
|
+
...It(l),
|
|
1662
1665
|
unique: !C
|
|
1663
1666
|
});
|
|
1664
1667
|
}
|
|
1665
|
-
C ||
|
|
1668
|
+
C || W(!0);
|
|
1666
1669
|
}
|
|
1667
1670
|
function D() {
|
|
1668
1671
|
var s, m, p;
|
|
1669
1672
|
const l = (p = (m = (s = e.builderContextSignal.content) == null ? void 0 : s.data) == null ? void 0 : m.httpRequests) != null ? p : {};
|
|
1670
1673
|
Object.entries(l).forEach(([d, V]) => {
|
|
1671
|
-
if (!V || x[d] || c[d] && !
|
|
1674
|
+
if (!V || x[d] || c[d] && !A())
|
|
1672
1675
|
return;
|
|
1673
1676
|
x[d] = !0;
|
|
1674
1677
|
const I = V.replace(
|
|
@@ -1695,7 +1698,7 @@ function Ft(e) {
|
|
|
1695
1698
|
});
|
|
1696
1699
|
}
|
|
1697
1700
|
function R() {
|
|
1698
|
-
|
|
1701
|
+
A() && window.dispatchEvent(
|
|
1699
1702
|
new CustomEvent(
|
|
1700
1703
|
"builder:component:stateChange",
|
|
1701
1704
|
{
|
|
@@ -1709,11 +1712,11 @@ function Ft(e) {
|
|
|
1709
1712
|
)
|
|
1710
1713
|
);
|
|
1711
1714
|
}
|
|
1712
|
-
const P =
|
|
1715
|
+
const P = M(!1);
|
|
1713
1716
|
return P.current || (D(), R(), P.current = !0), E(() => {
|
|
1714
1717
|
var l, s, m, p, d;
|
|
1715
|
-
if (
|
|
1716
|
-
|
|
1718
|
+
if (z()) {
|
|
1719
|
+
A() && !e.isNestedRender && (window.addEventListener("message", o), ce(), me({
|
|
1717
1720
|
...e.locale ? {
|
|
1718
1721
|
locale: e.locale
|
|
1719
1722
|
} : {},
|
|
@@ -1730,8 +1733,8 @@ function Ft(e) {
|
|
|
1730
1733
|
).forEach((g) => {
|
|
1731
1734
|
var k, U;
|
|
1732
1735
|
if (!((k = g.models) != null && k.length) || g.models.includes(e.model)) {
|
|
1733
|
-
const
|
|
1734
|
-
(U = window.parent) == null || U.postMessage(
|
|
1736
|
+
const q = pe(g);
|
|
1737
|
+
(U = window.parent) == null || U.postMessage(q, "*");
|
|
1735
1738
|
}
|
|
1736
1739
|
}), window.addEventListener(
|
|
1737
1740
|
"builder:component:stateChangeListenerActivated",
|
|
@@ -1752,11 +1755,11 @@ function Ft(e) {
|
|
|
1752
1755
|
variationId: I !== g ? I : void 0
|
|
1753
1756
|
});
|
|
1754
1757
|
}
|
|
1755
|
-
if (oe() && !
|
|
1758
|
+
if (oe() && !A()) {
|
|
1756
1759
|
const g = new URL(location.href).searchParams, k = g.get("builder.preview"), U = g.get(
|
|
1757
1760
|
`builder.overrides.${k}`
|
|
1758
|
-
),
|
|
1759
|
-
(k === "BUILDER_STUDIO" || k === e.model &&
|
|
1761
|
+
), q = g.get("apiKey") || g.get("builder.space");
|
|
1762
|
+
(k === "BUILDER_STUDIO" || k === e.model && q === e.apiKey && (!e.content || U === e.content.id)) && ge({
|
|
1760
1763
|
model: e.model,
|
|
1761
1764
|
apiKey: e.apiKey,
|
|
1762
1765
|
apiVersion: e.builderContextSignal.apiVersion,
|
|
@@ -1781,7 +1784,7 @@ function Ft(e) {
|
|
|
1781
1784
|
locale: e.locale
|
|
1782
1785
|
});
|
|
1783
1786
|
}, [e.locale]), E(() => () => {
|
|
1784
|
-
|
|
1787
|
+
z() && (window.removeEventListener("message", o), window.removeEventListener(
|
|
1785
1788
|
"builder:component:stateChangeListenerActivated",
|
|
1786
1789
|
R
|
|
1787
1790
|
));
|
|
@@ -1792,7 +1795,7 @@ function Ft(e) {
|
|
|
1792
1795
|
onClick: (l) => B(l),
|
|
1793
1796
|
"builder-content-id": (f = e.builderContextSignal.content) == null ? void 0 : f.id,
|
|
1794
1797
|
"builder-model": e.model,
|
|
1795
|
-
className:
|
|
1798
|
+
className: Ft(
|
|
1796
1799
|
((b = e.content) == null ? void 0 : b.testVariationId) || ((w = e.content) == null ? void 0 : w.id)
|
|
1797
1800
|
),
|
|
1798
1801
|
style: {
|
|
@@ -1804,17 +1807,17 @@ function Ft(e) {
|
|
|
1804
1807
|
}
|
|
1805
1808
|
) : null });
|
|
1806
1809
|
}
|
|
1807
|
-
function
|
|
1810
|
+
function At(e) {
|
|
1808
1811
|
const [t, n] = T(
|
|
1809
1812
|
() => `
|
|
1810
|
-
${
|
|
1813
|
+
${Vt({
|
|
1811
1814
|
cssCode: e.cssCode,
|
|
1812
1815
|
contentId: e.contentId
|
|
1813
1816
|
})}
|
|
1814
|
-
${
|
|
1817
|
+
${wt({
|
|
1815
1818
|
customFonts: e.customFonts
|
|
1816
1819
|
})}
|
|
1817
|
-
${
|
|
1820
|
+
${Et(e.isNestedRender)}
|
|
1818
1821
|
`.trim()
|
|
1819
1822
|
);
|
|
1820
1823
|
return /* @__PURE__ */ h(
|
|
@@ -1843,7 +1846,7 @@ const Wt = ({
|
|
|
1843
1846
|
locale: n
|
|
1844
1847
|
} : {}
|
|
1845
1848
|
};
|
|
1846
|
-
},
|
|
1849
|
+
}, Bt = ({
|
|
1847
1850
|
content: e,
|
|
1848
1851
|
data: t
|
|
1849
1852
|
}) => e ? {
|
|
@@ -1855,11 +1858,11 @@ const Wt = ({
|
|
|
1855
1858
|
meta: e == null ? void 0 : e.meta
|
|
1856
1859
|
} : void 0;
|
|
1857
1860
|
function ie(e) {
|
|
1858
|
-
var v, x, F, C,
|
|
1861
|
+
var v, x, F, C, W, B, D, R, P;
|
|
1859
1862
|
const [t, n] = T(
|
|
1860
1863
|
() => {
|
|
1861
1864
|
var f, b;
|
|
1862
|
-
return
|
|
1865
|
+
return vt({
|
|
1863
1866
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
1864
1867
|
variationId: (f = e.content) == null ? void 0 : f.testVariationId,
|
|
1865
1868
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
@@ -1888,7 +1891,7 @@ function ie(e) {
|
|
|
1888
1891
|
{}
|
|
1889
1892
|
)
|
|
1890
1893
|
), [a, o] = T(() => ({
|
|
1891
|
-
content:
|
|
1894
|
+
content: Bt({
|
|
1892
1895
|
content: e.content,
|
|
1893
1896
|
data: e.data
|
|
1894
1897
|
}),
|
|
@@ -1918,7 +1921,7 @@ function ie(e) {
|
|
|
1918
1921
|
BlocksWrapperProps: e.blocksWrapperProps || {},
|
|
1919
1922
|
nonce: e.nonce || "",
|
|
1920
1923
|
model: e.model
|
|
1921
|
-
})), c =
|
|
1924
|
+
})), c = M(!1);
|
|
1922
1925
|
if (!c.current) {
|
|
1923
1926
|
e.apiKey || ye.error(
|
|
1924
1927
|
"No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
@@ -1941,8 +1944,8 @@ function ie(e) {
|
|
|
1941
1944
|
value: {
|
|
1942
1945
|
registeredComponents: r
|
|
1943
1946
|
},
|
|
1944
|
-
children: /* @__PURE__ */
|
|
1945
|
-
|
|
1947
|
+
children: /* @__PURE__ */ O(
|
|
1948
|
+
Pt,
|
|
1946
1949
|
{
|
|
1947
1950
|
apiHost: e.apiHost,
|
|
1948
1951
|
nonce: e.nonce,
|
|
@@ -1963,7 +1966,7 @@ function ie(e) {
|
|
|
1963
1966
|
setBuilderContextSignal: o,
|
|
1964
1967
|
children: [
|
|
1965
1968
|
e.isSsrAbTest ? /* @__PURE__ */ h(
|
|
1966
|
-
|
|
1969
|
+
J,
|
|
1967
1970
|
{
|
|
1968
1971
|
id: "builderio-variant-visibility",
|
|
1969
1972
|
scriptStr: t,
|
|
@@ -1971,17 +1974,17 @@ function ie(e) {
|
|
|
1971
1974
|
}
|
|
1972
1975
|
) : null,
|
|
1973
1976
|
/* @__PURE__ */ h(
|
|
1974
|
-
|
|
1977
|
+
At,
|
|
1975
1978
|
{
|
|
1976
1979
|
nonce: e.nonce || "",
|
|
1977
1980
|
isNestedRender: e.isNestedRender,
|
|
1978
1981
|
contentId: (F = a.content) == null ? void 0 : F.id,
|
|
1979
|
-
cssCode: (
|
|
1982
|
+
cssCode: (W = (C = a.content) == null ? void 0 : C.data) == null ? void 0 : W.cssCode,
|
|
1980
1983
|
customFonts: (D = (B = a.content) == null ? void 0 : B.data) == null ? void 0 : D.customFonts
|
|
1981
1984
|
}
|
|
1982
1985
|
),
|
|
1983
1986
|
/* @__PURE__ */ h(
|
|
1984
|
-
|
|
1987
|
+
Ae,
|
|
1985
1988
|
{
|
|
1986
1989
|
blocks: (P = (R = a.content) == null ? void 0 : R.data) == null ? void 0 : P.blocks,
|
|
1987
1990
|
context: a,
|
|
@@ -1995,7 +1998,7 @@ function ie(e) {
|
|
|
1995
1998
|
}
|
|
1996
1999
|
);
|
|
1997
2000
|
}
|
|
1998
|
-
function
|
|
2001
|
+
function Dt(e) {
|
|
1999
2002
|
var a;
|
|
2000
2003
|
const [t, n] = T(
|
|
2001
2004
|
() => gt({
|
|
@@ -2005,7 +2008,7 @@ function Bt(e) {
|
|
|
2005
2008
|
);
|
|
2006
2009
|
function i() {
|
|
2007
2010
|
var o;
|
|
2008
|
-
return
|
|
2011
|
+
return xt(
|
|
2009
2012
|
H(e.content).map((c) => ({
|
|
2010
2013
|
id: c.testVariationId,
|
|
2011
2014
|
testRatio: c.testRatio
|
|
@@ -2027,16 +2030,16 @@ function Bt(e) {
|
|
|
2027
2030
|
});
|
|
2028
2031
|
}
|
|
2029
2032
|
return E(() => {
|
|
2030
|
-
}, []), /* @__PURE__ */
|
|
2031
|
-
!e.isNestedRender &&
|
|
2032
|
-
|
|
2033
|
+
}, []), /* @__PURE__ */ O(Q, { children: [
|
|
2034
|
+
!e.isNestedRender && N !== "reactNative" ? /* @__PURE__ */ h(
|
|
2035
|
+
J,
|
|
2033
2036
|
{
|
|
2034
2037
|
id: "builderio-init-variants-fns",
|
|
2035
|
-
scriptStr:
|
|
2038
|
+
scriptStr: yt(),
|
|
2036
2039
|
nonce: e.nonce || ""
|
|
2037
2040
|
}
|
|
2038
2041
|
) : null,
|
|
2039
|
-
t ? /* @__PURE__ */
|
|
2042
|
+
t ? /* @__PURE__ */ O(Q, { children: [
|
|
2040
2043
|
/* @__PURE__ */ h(
|
|
2041
2044
|
le,
|
|
2042
2045
|
{
|
|
@@ -2046,7 +2049,7 @@ function Bt(e) {
|
|
|
2046
2049
|
}
|
|
2047
2050
|
),
|
|
2048
2051
|
/* @__PURE__ */ h(
|
|
2049
|
-
|
|
2052
|
+
J,
|
|
2050
2053
|
{
|
|
2051
2054
|
id: "builderio-variants-visibility",
|
|
2052
2055
|
scriptStr: i(),
|
|
@@ -2109,11 +2112,11 @@ function Bt(e) {
|
|
|
2109
2112
|
)
|
|
2110
2113
|
] });
|
|
2111
2114
|
}
|
|
2112
|
-
const
|
|
2115
|
+
const $t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2113
2116
|
__proto__: null,
|
|
2114
|
-
default:
|
|
2117
|
+
default: Dt
|
|
2115
2118
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2116
2119
|
export {
|
|
2117
|
-
|
|
2118
|
-
|
|
2120
|
+
J as InlinedScript,
|
|
2121
|
+
$t as contentVariants
|
|
2119
2122
|
};
|