@builder.io/sdk-react 4.0.10 → 4.1.0
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 +9 -9
- package/lib/browser/blocks-exports.mjs +51 -45
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/server-entry-9ed7eace.cjs +2 -0
- package/lib/browser/{server-entry-a97b474c.js → server-entry-cddec22e.js} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-f19408f1.cjs → accordion-59aed902.cjs} +1 -1
- package/lib/edge/{accordion-39aaa10f.js → accordion-88f5ca79.js} +1 -1
- package/lib/edge/{blocks-204bcb03.js → blocks-1bfa0619.js} +2 -2
- package/lib/edge/{blocks-bd4d19a4.cjs → blocks-e5610e53.cjs} +1 -1
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-eb4a1fce.js → button-cfcad5ee.js} +2 -2
- package/lib/edge/{button-39adadab.cjs → button-d4969c10.cjs} +1 -1
- package/lib/edge/{columns-3954e4e2.cjs → columns-4c22f5f9.cjs} +1 -1
- package/lib/edge/{columns-d3cef236.js → columns-840b77f4.js} +3 -3
- package/lib/edge/{content-variants-68bbb30c.js → content-variants-5b95a71c.js} +12 -12
- package/lib/edge/{content-variants-0c41aa3b.cjs → content-variants-9084d7cf.cjs} +2 -2
- package/lib/edge/{custom-code-f8374f7b.js → custom-code-c12691cc.js} +1 -1
- package/lib/edge/{custom-code-eded3b35.cjs → custom-code-f0f3bef1.cjs} +1 -1
- package/lib/edge/{embed-2b4ce9d5.js → embed-46acac57.js} +1 -1
- package/lib/edge/{embed-44dee332.cjs → embed-95c874d3.cjs} +1 -1
- package/lib/edge/{form-9faf63c9.js → form-49928227.js} +3 -3
- package/lib/edge/{form-1493caf1.cjs → form-e74d90ef.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-a9265175.cjs → get-class-prop-name-5d642918.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-cc48fc17.js → get-class-prop-name-de337a1b.js} +1 -1
- package/lib/edge/image-209835f4.js +94 -0
- package/lib/edge/image-87a4e006.cjs +17 -0
- package/lib/edge/image.helpers-3e926d47.js +33 -0
- package/lib/edge/image.helpers-dba8a869.cjs +1 -0
- package/lib/edge/img-0fe56811.cjs +1 -0
- package/lib/edge/img-a0115c68.js +27 -0
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-a7c01b3a.js → input-2a39a1a8.js} +1 -1
- package/lib/edge/{input-d988f887.cjs → input-4f2e451f.cjs} +1 -1
- package/lib/edge/{personalization-container-2f2bfa1b.cjs → personalization-container-9ddd7a55.cjs} +1 -1
- package/lib/edge/{personalization-container-9ae00624.js → personalization-container-d477347e.js} +4 -4
- package/lib/edge/{select-03b307f2.cjs → select-b5449eba.cjs} +1 -1
- package/lib/edge/{select-4f03decc.js → select-d1902b94.js} +1 -1
- package/lib/edge/{server-entry-0fe1fd76.js → server-entry-50618347.js} +1 -1
- package/lib/edge/{server-entry-e13b9b35.cjs → server-entry-a24928b8.cjs} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-125b0593.cjs → slot-e2f8c494.cjs} +1 -1
- package/lib/edge/{slot-ff90c844.js → slot-f37576fc.js} +3 -3
- package/lib/edge/{symbol-da3ec542.cjs → symbol-8424cd54.cjs} +1 -1
- package/lib/edge/{symbol-7558aa24.js → symbol-a34eea2a.js} +2 -2
- package/lib/edge/{tabs-a9e56d82.js → tabs-b97f9798.js} +3 -3
- package/lib/edge/{tabs-3cf7cfd3.cjs → tabs-e686d11f.cjs} +1 -1
- package/lib/node/blocks-exports.cjs +9 -9
- package/lib/node/blocks-exports.mjs +274 -268
- 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-23f9b44b.js → server-entry-1556528d.js} +1 -1
- package/lib/node/server-entry-ecee24b6.cjs +2 -0
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/lib/node/{setIvm-b29cbc40.js → setIvm-15c96eda.js} +1 -1
- package/lib/node/{setIvm-71bce8c3.cjs → setIvm-432010ba.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-e0147364.cjs → should-force-browser-runtime-in-node-4128d124.cjs} +1 -1
- package/lib/node/{should-force-browser-runtime-in-node-5a2ea9eb.js → should-force-browser-runtime-in-node-d0bca779.js} +1 -1
- package/package.json +1 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/lib/browser/server-entry-6a0d3985.cjs +0 -2
- package/lib/edge/image-cce92f6c.cjs +0 -17
- package/lib/edge/image-d87761af.js +0 -123
- package/lib/edge/img-58c08dd4.js +0 -20
- package/lib/edge/img-b8d85bad.cjs +0 -1
- package/lib/node/server-entry-ceef853b.cjs +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { TARGET as F, isEditing as L, isBrowser as M, getUserAttributes as ct, checkIsDefined as
|
|
3
|
-
import { setClientUserAttributes as Mi } from "./server-entry-
|
|
2
|
+
import { TARGET as F, isEditing as L, isBrowser as M, getUserAttributes as ct, checkIsDefined as ae, logger as J, isPreviewing as se, userAttributesService as Ce, getDefaultCanTrack as Z, logFetch as Oe, registerInsertMenu as ut, setupBrowserForEditing as dt, createRegisterComponentMessage as mt, getCookieSync as ft, _track as Te, fetchOneEntry as Le, createEditorListener as ht, serializeIncludingFunctions as Ie, handleABTestingSync as gt } from "./server-entry-cddec22e.js";
|
|
3
|
+
import { setClientUserAttributes as Mi } from "./server-entry-cddec22e.js";
|
|
4
4
|
import { jsx as s, Fragment as R, jsxs as W } from "react/jsx-runtime";
|
|
5
5
|
import * as bt from "react";
|
|
6
6
|
import { createContext as _e, useEffect as V, useState as C, useRef as H, useContext as we, createElement as Ue } from "react";
|
|
@@ -132,7 +132,7 @@ const Ee = ({
|
|
|
132
132
|
};
|
|
133
133
|
function Ct() {
|
|
134
134
|
var e;
|
|
135
|
-
return typeof process != "undefined" &&
|
|
135
|
+
return typeof process != "undefined" && ae((e = process == null ? void 0 : process.versions) == null ? void 0 : e.node);
|
|
136
136
|
}
|
|
137
137
|
const Tt = ({
|
|
138
138
|
shouldLogWarning: e
|
|
@@ -213,7 +213,7 @@ function At(e, ...t) {
|
|
|
213
213
|
delete n[i];
|
|
214
214
|
return n;
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function le(e, t, n = null, i = null, r = /* @__PURE__ */ new WeakSet()) {
|
|
217
217
|
if (e == null || typeof e != "object") {
|
|
218
218
|
t(e, (o) => {
|
|
219
219
|
n !== null && i !== null && (n[i] = o);
|
|
@@ -223,11 +223,11 @@ function ae(e, t, n = null, i = null, r = /* @__PURE__ */ new WeakSet()) {
|
|
|
223
223
|
r.has(e) || (r.add(e), Array.isArray(e) ? e.forEach((o, a) => {
|
|
224
224
|
t(o, (c) => {
|
|
225
225
|
e[a] = c;
|
|
226
|
-
}),
|
|
226
|
+
}), le(o, t, e, a, r);
|
|
227
227
|
}) : Object.entries(e).forEach(([o, a]) => {
|
|
228
228
|
t(a, (c) => {
|
|
229
229
|
e[o] = c;
|
|
230
|
-
}),
|
|
230
|
+
}), le(a, t, e, o, r);
|
|
231
231
|
}));
|
|
232
232
|
}
|
|
233
233
|
function je(e) {
|
|
@@ -237,7 +237,7 @@ function Bt(e) {
|
|
|
237
237
|
if (!e || !Object.getOwnPropertyNames(e).length)
|
|
238
238
|
return !1;
|
|
239
239
|
let t = !1;
|
|
240
|
-
return
|
|
240
|
+
return le(e, (n) => {
|
|
241
241
|
if (je(n)) {
|
|
242
242
|
t = !0;
|
|
243
243
|
return;
|
|
@@ -245,7 +245,7 @@ function Bt(e) {
|
|
|
245
245
|
}), t;
|
|
246
246
|
}
|
|
247
247
|
function Nt(e, t) {
|
|
248
|
-
return !e || !Object.getOwnPropertyNames(e).length ? {} : (
|
|
248
|
+
return !e || !Object.getOwnPropertyNames(e).length ? {} : (le(e, (n, i) => {
|
|
249
249
|
var r;
|
|
250
250
|
je(n) && i((r = n[t]) != null ? r : void 0);
|
|
251
251
|
}), e);
|
|
@@ -336,7 +336,7 @@ function Ot({
|
|
|
336
336
|
context: t
|
|
337
337
|
});
|
|
338
338
|
}
|
|
339
|
-
const
|
|
339
|
+
const ce = (e) => e ? e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase() : "";
|
|
340
340
|
function Lt(e, t, n = {}) {
|
|
341
341
|
let i, r, o, a = null, l = 0;
|
|
342
342
|
const c = function() {
|
|
@@ -394,7 +394,7 @@ function Ge(e) {
|
|
|
394
394
|
}
|
|
395
395
|
Array.from(t).forEach((n) => {
|
|
396
396
|
Je(e, n), n.style.transition = "none", n.style.transitionDelay = "0", X(n.style, e.steps[0].styles), setTimeout(() => {
|
|
397
|
-
n.style.transition = `all ${e.duration}s ${
|
|
397
|
+
n.style.transition = `all ${e.duration}s ${ce(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s"), X(n.style, e.steps[1].styles), setTimeout(() => {
|
|
398
398
|
n.style.transition = "", n.style.transitionDelay = "";
|
|
399
399
|
}, (e.delay || 0) * 1e3 + e.duration * 1e3 + 100);
|
|
400
400
|
});
|
|
@@ -428,7 +428,7 @@ function Ht(e) {
|
|
|
428
428
|
X(n.style, c);
|
|
429
429
|
}
|
|
430
430
|
u(), setTimeout(() => {
|
|
431
|
-
n.style.transition = `all ${e.duration}s ${
|
|
431
|
+
n.style.transition = `all ${e.duration}s ${ce(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s");
|
|
432
432
|
}), document.addEventListener("scroll", a, {
|
|
433
433
|
capture: !0,
|
|
434
434
|
passive: !0
|
|
@@ -437,8 +437,8 @@ function Ht(e) {
|
|
|
437
437
|
}
|
|
438
438
|
const Qe = (e) => Object.entries(e).map(([n, i]) => {
|
|
439
439
|
if (typeof i == "string")
|
|
440
|
-
return `${
|
|
441
|
-
}).filter(
|
|
440
|
+
return `${ce(n)}: ${i};`;
|
|
441
|
+
}).filter(ae), Mt = (e) => Qe(e).join(`
|
|
442
442
|
`), Y = ({
|
|
443
443
|
mediaQuery: e,
|
|
444
444
|
className: t,
|
|
@@ -569,7 +569,7 @@ const Xe = (e, t) => e ? t ? e.models && e.models.length > 0 && !e.models.includ
|
|
|
569
569
|
default: 991,
|
|
570
570
|
max: 1200
|
|
571
571
|
}
|
|
572
|
-
},
|
|
572
|
+
}, de = (e, t = Ze) => `@media (max-width: ${t[e].max}px)`, et = (e) => {
|
|
573
573
|
const t = ve(Ze);
|
|
574
574
|
if (!e)
|
|
575
575
|
return t;
|
|
@@ -621,7 +621,7 @@ function ee(e) {
|
|
|
621
621
|
function Xt(e) {
|
|
622
622
|
function t() {
|
|
623
623
|
const i = e.block;
|
|
624
|
-
return
|
|
624
|
+
return ae(i.hide) ? !i.hide : ae(i.show) ? i.show : !0;
|
|
625
625
|
}
|
|
626
626
|
function n() {
|
|
627
627
|
var k, A, T, I, g;
|
|
@@ -636,21 +636,21 @@ function Xt(e) {
|
|
|
636
636
|
}) : "", d = u ? Y({
|
|
637
637
|
className: m,
|
|
638
638
|
styles: u,
|
|
639
|
-
mediaQuery:
|
|
639
|
+
mediaQuery: de(
|
|
640
640
|
"medium",
|
|
641
641
|
a
|
|
642
642
|
)
|
|
643
643
|
}) : "", h = f ? Y({
|
|
644
644
|
className: m,
|
|
645
645
|
styles: f,
|
|
646
|
-
mediaQuery:
|
|
646
|
+
mediaQuery: de(
|
|
647
647
|
"small",
|
|
648
648
|
a
|
|
649
649
|
)
|
|
650
650
|
}) : "", p = b && l ? Y({
|
|
651
651
|
className: m,
|
|
652
652
|
styles: b,
|
|
653
|
-
mediaQuery:
|
|
653
|
+
mediaQuery: de(
|
|
654
654
|
"xsmall",
|
|
655
655
|
a
|
|
656
656
|
)
|
|
@@ -662,7 +662,7 @@ function Xt(e) {
|
|
|
662
662
|
className: `${m}:hover`,
|
|
663
663
|
styles: {
|
|
664
664
|
...x,
|
|
665
|
-
transition: `all ${y.duration}s ${
|
|
665
|
+
transition: `all ${y.duration}s ${ce(
|
|
666
666
|
y.easing
|
|
667
667
|
)}`,
|
|
668
668
|
transitionDelay: y.delay ? `${y.delay}s` : "0s"
|
|
@@ -857,7 +857,7 @@ function Pe(e) {
|
|
|
857
857
|
contextValue: e.context
|
|
858
858
|
}),
|
|
859
859
|
children: (i = e.blockChildren) == null ? void 0 : i.map((r) => /* @__PURE__ */ s(
|
|
860
|
-
|
|
860
|
+
ue,
|
|
861
861
|
{
|
|
862
862
|
block: r,
|
|
863
863
|
context: e.context,
|
|
@@ -874,7 +874,7 @@ function Ve(e) {
|
|
|
874
874
|
return V(() => {
|
|
875
875
|
n(e.repeatContext);
|
|
876
876
|
}, [e.repeatContext]), /* @__PURE__ */ s(pe.Provider, { value: t, children: /* @__PURE__ */ s(
|
|
877
|
-
|
|
877
|
+
ue,
|
|
878
878
|
{
|
|
879
879
|
block: e.block,
|
|
880
880
|
context: t,
|
|
@@ -883,7 +883,7 @@ function Ve(e) {
|
|
|
883
883
|
}
|
|
884
884
|
) });
|
|
885
885
|
}
|
|
886
|
-
function
|
|
886
|
+
function ue(e) {
|
|
887
887
|
var f, b, m, v;
|
|
888
888
|
function t() {
|
|
889
889
|
return Kt({
|
|
@@ -897,7 +897,7 @@ function ce(e) {
|
|
|
897
897
|
}));
|
|
898
898
|
function r() {
|
|
899
899
|
var h;
|
|
900
|
-
if (n.value && !n.update && !
|
|
900
|
+
if (n.value && !n.update && !se())
|
|
901
901
|
return n.value;
|
|
902
902
|
const d = (h = e.block.repeat) != null && h.collection ? e.block : Ot({
|
|
903
903
|
block: e.block,
|
|
@@ -1019,7 +1019,7 @@ function ce(e) {
|
|
|
1019
1019
|
}
|
|
1020
1020
|
),
|
|
1021
1021
|
(b = c()) == null ? void 0 : b.map((d) => /* @__PURE__ */ s(
|
|
1022
|
-
|
|
1022
|
+
ue,
|
|
1023
1023
|
{
|
|
1024
1024
|
block: d,
|
|
1025
1025
|
registeredComponents: e.registeredComponents,
|
|
@@ -1117,7 +1117,7 @@ function _(e) {
|
|
|
1117
1117
|
children: [
|
|
1118
1118
|
e.children,
|
|
1119
1119
|
e.blocks ? /* @__PURE__ */ s(R, { children: (o = e.blocks) == null ? void 0 : o.map((a) => /* @__PURE__ */ s(
|
|
1120
|
-
|
|
1120
|
+
ue,
|
|
1121
1121
|
{
|
|
1122
1122
|
block: a,
|
|
1123
1123
|
linkComponent: e.linkComponent,
|
|
@@ -1318,7 +1318,7 @@ function hn(e, t) {
|
|
|
1318
1318
|
}
|
|
1319
1319
|
return null;
|
|
1320
1320
|
}
|
|
1321
|
-
function
|
|
1321
|
+
function ne(e) {
|
|
1322
1322
|
if (!e)
|
|
1323
1323
|
return e;
|
|
1324
1324
|
const t = [100, 200, 400, 800, 1200, 1600, 2e3];
|
|
@@ -1341,10 +1341,10 @@ function gn(e) {
|
|
|
1341
1341
|
if (!e.noWebp) {
|
|
1342
1342
|
if (e.srcset && ((m = e.image) != null && m.includes("builder.io/api/v1/image"))) {
|
|
1343
1343
|
if (!e.srcset.includes(e.image.split("?")[0]))
|
|
1344
|
-
return console.debug("Removed given srcset"),
|
|
1344
|
+
return console.debug("Removed given srcset"), ne(b);
|
|
1345
1345
|
} else if (e.image && !e.srcset)
|
|
1346
|
-
return
|
|
1347
|
-
return
|
|
1346
|
+
return ne(b);
|
|
1347
|
+
return ne(b);
|
|
1348
1348
|
}
|
|
1349
1349
|
}
|
|
1350
1350
|
function n() {
|
|
@@ -1656,9 +1656,9 @@ const pn = `function getPersonalizedVariant(variants, blockId, isHydrationTarget
|
|
|
1656
1656
|
visibilityStylesEl.innerHTML = newStyleStr;
|
|
1657
1657
|
}
|
|
1658
1658
|
}
|
|
1659
|
-
}`,
|
|
1659
|
+
}`, ie = "default", Sn = "filterWithCustomTargeting", nt = "builderIoPersonalization", it = "updateVisibilityStylesScript", rt = ["react", "vue", "svelte", "qwik"], re = ["vue", "svelte", "qwik"];
|
|
1660
1660
|
function kn(e, t) {
|
|
1661
|
-
return !(e && e.length > 0) || !t ? !1 :
|
|
1661
|
+
return !(e && e.length > 0) || !t ? !1 : re.includes(F) ? !0 : !M();
|
|
1662
1662
|
}
|
|
1663
1663
|
function Cn({
|
|
1664
1664
|
variants: e,
|
|
@@ -1671,7 +1671,7 @@ function Cn({
|
|
|
1671
1671
|
const o = {
|
|
1672
1672
|
blocks: r != null ? r : [],
|
|
1673
1673
|
path: "this.children",
|
|
1674
|
-
index:
|
|
1674
|
+
index: ie
|
|
1675
1675
|
};
|
|
1676
1676
|
if (n && L()) {
|
|
1677
1677
|
if (typeof t == "number" && t < ((a = e == null ? void 0 : e.length) != null ? a : 0)) {
|
|
@@ -2443,12 +2443,12 @@ function $n(e) {
|
|
|
2443
2443
|
fireImmediately: F === "qwik"
|
|
2444
2444
|
}
|
|
2445
2445
|
);
|
|
2446
|
-
if (!(L() ||
|
|
2446
|
+
if (!(L() || se())) {
|
|
2447
2447
|
const N = h()[0];
|
|
2448
2448
|
t.current && (t.current.dispatchEvent(
|
|
2449
2449
|
new CustomEvent("builder.variantLoaded", {
|
|
2450
2450
|
detail: {
|
|
2451
|
-
variant: N ||
|
|
2451
|
+
variant: N || ie,
|
|
2452
2452
|
content: (B = e.builderContext) == null ? void 0 : B.content
|
|
2453
2453
|
},
|
|
2454
2454
|
bubbles: !0
|
|
@@ -2459,7 +2459,7 @@ function $n(e) {
|
|
|
2459
2459
|
te.isIntersecting && t.current && t.current.dispatchEvent(
|
|
2460
2460
|
new CustomEvent("builder.variantDisplayed", {
|
|
2461
2461
|
detail: {
|
|
2462
|
-
variant: N ||
|
|
2462
|
+
variant: N || ie,
|
|
2463
2463
|
content: (Q = e.builderContext) == null ? void 0 : Q.content
|
|
2464
2464
|
},
|
|
2465
2465
|
bubbles: !0
|
|
@@ -2472,7 +2472,7 @@ function $n(e) {
|
|
|
2472
2472
|
}, []), V(() => () => {
|
|
2473
2473
|
c.forEach((E) => E());
|
|
2474
2474
|
}, []), /* @__PURE__ */ W("div", { ref: t, ...d(), children: [
|
|
2475
|
-
m &&
|
|
2475
|
+
m && re.includes(F) ? /* @__PURE__ */ s(
|
|
2476
2476
|
_,
|
|
2477
2477
|
{
|
|
2478
2478
|
blocks: p().blocks,
|
|
@@ -2486,7 +2486,7 @@ function $n(e) {
|
|
|
2486
2486
|
}
|
|
2487
2487
|
}
|
|
2488
2488
|
) : null,
|
|
2489
|
-
!m &&
|
|
2489
|
+
!m && re.includes(F) || !re.includes(F) ? /* @__PURE__ */ W(R, { children: [
|
|
2490
2490
|
f ? /* @__PURE__ */ W(R, { children: [
|
|
2491
2491
|
/* @__PURE__ */ s(
|
|
2492
2492
|
ee,
|
|
@@ -2550,7 +2550,7 @@ function $n(e) {
|
|
|
2550
2550
|
{
|
|
2551
2551
|
nonce: ((P = e.builderContext) == null ? void 0 : P.nonce) || "",
|
|
2552
2552
|
scriptStr: r,
|
|
2553
|
-
id: `variants-script-${(U = e.builderBlock) == null ? void 0 : U.id}-${
|
|
2553
|
+
id: `variants-script-${(U = e.builderBlock) == null ? void 0 : U.id}-${ie}`
|
|
2554
2554
|
}
|
|
2555
2555
|
) : null
|
|
2556
2556
|
}
|
|
@@ -3653,6 +3653,11 @@ const si = {
|
|
|
3653
3653
|
static: !0
|
|
3654
3654
|
};
|
|
3655
3655
|
function ci(e) {
|
|
3656
|
+
function t() {
|
|
3657
|
+
const n = e.imgSrc || e.image;
|
|
3658
|
+
if (!(!n || typeof n != "string") && n.match(/builder\.io/))
|
|
3659
|
+
return ne(n);
|
|
3660
|
+
}
|
|
3656
3661
|
return /* @__PURE__ */ s(
|
|
3657
3662
|
"img",
|
|
3658
3663
|
{
|
|
@@ -3662,6 +3667,7 @@ function ci(e) {
|
|
|
3662
3667
|
},
|
|
3663
3668
|
alt: e.altText,
|
|
3664
3669
|
src: e.imgSrc || e.image,
|
|
3670
|
+
srcSet: t(),
|
|
3665
3671
|
...e.attributes
|
|
3666
3672
|
},
|
|
3667
3673
|
L() && e.imgSrc || "default-key"
|
|
@@ -4041,14 +4047,14 @@ const mi = () => [{
|
|
|
4041
4047
|
thisScriptEl?.remove();
|
|
4042
4048
|
}
|
|
4043
4049
|
return;
|
|
4044
|
-
}`, at = "builderIoAbTest", lt = "builderIoRenderContent",
|
|
4050
|
+
}`, at = "builderIoAbTest", lt = "builderIoRenderContent", oe = (e) => Object.values((e == null ? void 0 : e.variations) || {}).map((t) => ({
|
|
4045
4051
|
...t,
|
|
4046
4052
|
testVariationId: t.id,
|
|
4047
4053
|
id: e == null ? void 0 : e.id
|
|
4048
4054
|
})), gi = ({
|
|
4049
4055
|
canTrack: e,
|
|
4050
4056
|
content: t
|
|
4051
|
-
}) => !(!(
|
|
4057
|
+
}) => !(!(oe(t).length > 0) || !e || M()), bi = (e) => e === "react" || e === "reactNative", yi = F === "angular", st = bi(F), pi = () => `
|
|
4052
4058
|
window.${at} = ${fi}
|
|
4053
4059
|
window.${lt} = ${hi}
|
|
4054
4060
|
`, vi = (e, t) => `
|
|
@@ -4102,7 +4108,7 @@ const Si = (e, t, n = !0) => {
|
|
|
4102
4108
|
builderElementIndex: n && i ? [].slice.call(document.getElementsByClassName(i)).indexOf(n) : void 0
|
|
4103
4109
|
}
|
|
4104
4110
|
};
|
|
4105
|
-
}, Ti = ["svelte", "qwik", "vue"], De = () => Ti.includes(F) && (L() ||
|
|
4111
|
+
}, Ti = ["svelte", "qwik", "vue"], De = () => Ti.includes(F) && (L() || se()), Ii = (e) => {
|
|
4106
4112
|
var o, a;
|
|
4107
4113
|
const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], i = (a = e.fileUrl) != null ? a : (o = e == null ? void 0 : e.files) == null ? void 0 : o.regular;
|
|
4108
4114
|
let r = "";
|
|
@@ -4330,7 +4336,7 @@ function Ai(e) {
|
|
|
4330
4336
|
variationId: O !== P ? O : void 0
|
|
4331
4337
|
});
|
|
4332
4338
|
}
|
|
4333
|
-
if (
|
|
4339
|
+
if (se() && !L()) {
|
|
4334
4340
|
const P = new URL(location.href).searchParams, U = P.get("builder.preview"), E = P.get(
|
|
4335
4341
|
`builder.overrides.${U}`
|
|
4336
4342
|
), B = P.get("apiKey") || P.get("builder.space");
|
|
@@ -4584,7 +4590,7 @@ function $i(e) {
|
|
|
4584
4590
|
function i() {
|
|
4585
4591
|
var l;
|
|
4586
4592
|
return vi(
|
|
4587
|
-
|
|
4593
|
+
oe(e.content).map((c) => ({
|
|
4588
4594
|
id: c.testVariationId,
|
|
4589
4595
|
testRatio: c.testRatio
|
|
4590
4596
|
})),
|
|
@@ -4592,7 +4598,7 @@ function $i(e) {
|
|
|
4592
4598
|
);
|
|
4593
4599
|
}
|
|
4594
4600
|
function r() {
|
|
4595
|
-
return
|
|
4601
|
+
return oe(e.content).map((l) => `.variant-${l.testVariationId} { display: none; } `).join("");
|
|
4596
4602
|
}
|
|
4597
4603
|
function o() {
|
|
4598
4604
|
var l;
|
|
@@ -4641,7 +4647,7 @@ function $i(e) {
|
|
|
4641
4647
|
nonce: e.nonce || ""
|
|
4642
4648
|
}
|
|
4643
4649
|
),
|
|
4644
|
-
(a =
|
|
4650
|
+
(a = oe(e.content)) == null ? void 0 : a.map((l) => /* @__PURE__ */ s(
|
|
4645
4651
|
Fe,
|
|
4646
4652
|
{
|
|
4647
4653
|
apiHost: e.apiHost,
|
package/lib/browser/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./blocks-exports.cjs"),e=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./blocks-exports.cjs"),e=require("./server-entry-9ed7eace.cjs");require("react/jsx-runtime");require("react");exports.Blocks=t.Blocks;exports.BuilderContext=t.BuilderContext;exports.Button=t.Button;exports.Columns=t.Columns;exports.Content=t.Content;exports.Fragment=t.Fragment;exports.Image=t.Image;exports.Section=t.Section;exports.Symbol=t.Symbol;exports.Text=t.Text;exports.Video=t.Video;exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setClientUserAttributes=e.setClientUserAttributes;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
|
package/lib/browser/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Blocks as o, BuilderContext as s, Button as n, Columns as c, Content as m, Fragment as g, Image as a, Section as l, Symbol as u, Text as d, Video as p } from "./blocks-exports.mjs";
|
|
2
|
-
import { _processContentResult as f, createRegisterComponentMessage as B, fetchBuilderProps as E, fetchEntries as b, fetchOneEntry as h, getBuilderSearchParams as x, isEditing as S, isPreviewing as P, register as k, setClientUserAttributes as y, setEditorSettings as R, subscribeToEditor as T, track as v } from "./server-entry-
|
|
2
|
+
import { _processContentResult as f, createRegisterComponentMessage as B, fetchBuilderProps as E, fetchEntries as b, fetchOneEntry as h, getBuilderSearchParams as x, isEditing as S, isPreviewing as P, register as k, setClientUserAttributes as y, setEditorSettings as R, subscribeToEditor as T, track as v } from "./server-entry-cddec22e.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
export {
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const m="react",v="[Builder.io]: ",d={log:(...e)=>console.log(v,...e),error:(...e)=>console.error(v,...e),warn:(...e)=>console.warn(v,...e),debug:(...e)=>console.debug(v,...e)};function c(){return typeof window!="undefined"&&typeof document!="undefined"}const be=e=>{const t={};return e.forEach((n,r)=>{t[r]=n}),t},$=e=>e instanceof URLSearchParams?be(e):e,G=e=>typeof e=="string"?e:e instanceof URLSearchParams?e.toString():new URLSearchParams(e).toString();function ye(){return c()&&window.self!==window.top}function z(e){return ye()&&G(e||window.location.search).indexOf("builder.frameEditing=")!==-1}const we=()=>{if(c()){const e=new URL(location.href);return e.pathname===""&&(e.pathname="/"),e}else return console.warn("Cannot get location for tracking in non-browser environment"),null},Ee=()=>typeof navigator=="object"&&navigator.userAgent||"",J=()=>{const e=Ee(),t={Android(){return e.match(/Android/i)},BlackBerry(){return e.match(/BlackBerry/i)},iOS(){return e.match(/iPhone|iPod/i)},Opera(){return e.match(/Opera Mini/i)},Windows(){return e.match(/IEMobile/i)||e.match(/WPDesktop/i)},any(){return t.Android()||t.BlackBerry()||t.iOS()||t.Opera()||t.Windows()||m==="reactNative"}},n=e.match(/Tablet|iPad/i),r=we();return{urlPath:r==null?void 0:r.pathname,host:(r==null?void 0:r.host)||(r==null?void 0:r.hostname),device:n?"tablet":t.any()?"mobile":"desktop"}},p=e=>e!=null;function Ie(e){const t=e||(c()?window.location.search:void 0);return t?G(t).indexOf("builder.preview=")!==-1:!1}const ve=e=>({type:"builder.registerComponent",data:C(e)}),Ae=e=>{const t=e.toString().trim(),n=/^[a-zA-Z0-9_]+\s*=>/i.test(t);return`return (${!t.startsWith("function")&&!t.startsWith("async")&&!t.startsWith("(")&&!n?"function ":""}${t}).apply(this, arguments)`};function C(e){return JSON.parse(JSON.stringify(e,(t,n)=>typeof n=="function"?Ae(n):n))}const V={};function X(e,t){e==="plugin"&&(t=C(t));let n=V[e];if(n||(n=V[e]=[]),n.push(t),c()){const r={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(r,"*"),parent!==window&&window.postMessage(r,"*")}catch(s){console.debug("Could not postmessage",s)}}}const D={};function ke(e){if(c()){Object.assign(D,e);const t={type:"builder.settingsChange",data:D};parent.postMessage(t,"*")}}const F="builder.",Ue="options.",O=e=>{if(!e)return{};const t=$(e),n={};return Object.keys(t).forEach(r=>{if(r.startsWith(F)){const s=r.replace(F,"").replace(Ue,"");n[s]=t[r]}}),n},Te=()=>{if(!c())return{};const e=new URLSearchParams(window.location.search);return O(e)},H="4.1.0",Q=()=>({"X-Builder-SDK":m,"X-Builder-SDK-GEN":"2","X-Builder-SDK-Version":H}),Ce=e=>{if(e==="localhost"||e==="127.0.0.1")return e;const t=e.split(".");return t.length>2?t.slice(1).join("."):e},A=({name:e,canTrack:t})=>{var n;try{return t?(n=document.cookie.split("; ").find(r=>r.startsWith(`${e}=`)))==null?void 0:n.split("=")[1]:void 0}catch(r){d.warn("[COOKIE] GET error: ",(r==null?void 0:r.message)||r);return}},Y=async e=>A(e),Oe=e=>e.map(([t,n])=>n?`${t}=${n}`:t).filter(p).join("; "),Pe=[["secure",""],["SameSite","None"]],Re=({name:e,value:t,expires:n})=>{const s=(c()?location.protocol==="https:":!0)?Pe:[[]],o=n?[["expires",n.toUTCString()]]:[[]],i=[[e,t],...o,["path","/"],["domain",Ce(window.location.hostname)],...s];return Oe(i)},P=async({name:e,value:t,expires:n,canTrack:r})=>{try{if(!r)return;const s=Re({name:e,value:t,expires:n});document.cookie=s}catch(s){d.warn("[COOKIE] SET error: ",(s==null?void 0:s.message)||s)}};function Be(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}function Z(){return Be().replace(/-/g,"")}const q="builderSessionId",xe=async({canTrack:e})=>{if(!e)return;const t=await Y({name:q,canTrack:e});if(p(t))return t;{const n=_e();return Le({id:n,canTrack:e}),n}},_e=()=>Z(),Le=({id:e,canTrack:t})=>P({name:q,value:e,canTrack:t}),ee=()=>c()&&typeof localStorage!="undefined"?localStorage:void 0,Ne=({key:e,canTrack:t})=>{var n;try{return t?(n=ee())==null?void 0:n.getItem(e):void 0}catch(r){console.debug("[LocalStorage] GET error: ",r);return}},Ve=({key:e,canTrack:t,value:n})=>{var r;try{t&&((r=ee())==null||r.setItem(e,n))}catch(s){console.debug("[LocalStorage] SET error: ",s)}},te="builderVisitorId",De=({canTrack:e})=>{if(!e)return;const t=Ne({key:te,canTrack:e});if(p(t))return t;{const n=Fe();return Me({id:n,canTrack:e}),n}},Fe=()=>Z(),Me=({id:e,canTrack:t})=>Ve({key:te,value:e,canTrack:t});function ne(e){var t;typeof process!="undefined"&&((t=process.env)!=null&&t.DEBUG)&&String(process.env.DEBUG)=="true"&&d.log(e)}const Ke=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await xe({canTrack:e}),n=De({canTrack:e});return{sessionId:t,visitorId:n}},We=async({type:e,canTrack:t,apiKey:n,metadata:r,...s})=>({type:e,data:{...s,metadata:{url:location.href,...r},...await Ke({canTrack:t}),userAttributes:J(),ownerId:n}});async function re({apiHost:e,...t}){if(!t.apiKey){d.error("Missing API key for track call. Please provide your API key.");return}if(!t.canTrack||z()||!(c()||m==="reactNative"))return;const r=`${e||"https://cdn.builder.io"}/api/v1/track`;return ne(r),fetch(r,{method:"POST",body:JSON.stringify({events:[await We(t)]}),headers:{"content-type":"application/json",...Q()},mode:"cors"}).catch(s=>{console.error("Failed to track: ",s)})}const je=e=>re({...e,canTrack:!0}),$e=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function se(e,t){if(!t.origin.startsWith("http")&&!t.origin.startsWith("https"))return!1;const n=new URL(t.origin),r=n.hostname;return(e||$e).findIndex(s=>s.startsWith("*.")?r.endsWith(s.slice(1)):s===r)>-1}const Ge=()=>{X("insertMenu",{name:"_default",default:!0,items:[{name:"Box"},{name:"Text"},{name:"Image"},{name:"Columns"},{name:"Core:Section"},{name:"Core:Button"},{name:"Embed"},{name:"Custom Code"}]})};let M=!1;const oe=e=>{var t,n;M||(M=!0,c()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:m,version:H,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0,modelName:e.modelName,apiKey:e.apiKey,supportsXSmallBreakpoint:!0,blockLevelPersonalization:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",r=>{var o,i;if(!se(e.trustedHosts,r))return;const{data:s}=r;if(s!=null&&s.type)switch(s.type){case"builder.evaluate":{const u=s.data.text,y=s.data.arguments||[],S=s.data.id,w=new Function(u);let l,g=null;try{l=w.apply(null,y)}catch(h){g=h}g?(o=window.parent)==null||o.postMessage({type:"builder.evaluateError",data:{id:S,error:g.message}},"*"):l&&typeof l.then=="function"?l.then(h=>{var E;(E=window.parent)==null||E.postMessage({type:"builder.evaluateResult",data:{id:S,result:h}},"*")}).catch(console.error):(i=window.parent)==null||i.postMessage({type:"builder.evaluateResult",data:{result:l,id:S}},"*");break}}})))},ie=({model:e,trustedHosts:t,callbacks:n})=>r=>{if(!se(t,r))return;const{data:s}=r;if(s)switch(s.type){case"builder.configureSdk":{n.configureSdk(s.data);break}case"builder.triggerAnimation":{n.animation(s.data);break}case"builder.resetState":{const o=s.data,i=o.model,u=o==null?void 0:o.state;i===e&&u&&n.stateUpdate(u);break}case"builder.contentUpdate":{const o=s.data,i=o.key||o.alias||o.entry||o.modelName,u=o.data;i===e&&n.contentUpdate(u);break}}},ze=({model:e,apiKey:t,callback:n,trustedHosts:r})=>{if(!c)return d.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};oe({modelName:e,apiKey:t});const s=ie({callbacks:{contentUpdate:n,animation:()=>{},configureSdk:()=>{},stateUpdate:()=>{}},model:e,trustedHosts:r});return window.addEventListener("message",s),()=>{window.removeEventListener("message",s)}},Je="builder.tests",R=e=>`${Je}.${e}`,Xe=({contentId:e})=>Y({name:R(e),canTrack:!0}),He=({contentId:e})=>A({name:R(e),canTrack:!0}),Qe=({contentId:e,value:t})=>P({name:R(e),value:t,canTrack:!0}),ae=e=>p(e.id)&&p(e.variations)&&Object.keys(e.variations).length>0,Ye=({id:e,variations:t})=>{var s;let n=0;const r=Math.random();for(const o in t){const i=(s=t[o])==null?void 0:s.testRatio;if(n+=i,r<n)return o}return e},ce=e=>{const t=Ye(e);return Qe({contentId:e.id,value:t}).catch(n=>{d.error("could not store A/B test variation: ",n)}),t},ue=({item:e,testGroupId:t})=>{const n=e.variations[t];return t===e.id||!n?{testVariationId:e.id,testVariationName:"Default"}:{data:n.data,testVariationId:n.id,testVariationName:n.name||(n.id===e.id?"Default":"")}},Ze=({item:e,canTrack:t})=>{if(!t)return e;if(!e)return;if(!ae(e))return e;const n=He({contentId:e.id})||ce({variations:e.variations,id:e.id}),r=ue({item:e,testGroupId:n});return{...e,...r}},qe=async({item:e,canTrack:t})=>{if(!t||!ae(e))return e;const r=await Xe({contentId:e.id})||ce({variations:e.variations,id:e.id}),s=ue({item:e,testGroupId:r});return{...e,...s}};const K="builder.userAttributes";function W(){let e=!0;const t=new Set;return{setUserAttributes(n){if(!c())return;const r={...this.getUserAttributes(),...n};P({name:K,value:JSON.stringify(r),canTrack:e}),t.forEach(s=>s(r))},getUserAttributes(){return c()?JSON.parse(A({name:K,canTrack:e})||"{}"):{}},subscribeOnUserAttributesChange(n,{fireImmediately:r}={}){return t.add(n),r&&n(this.getUserAttributes()),function(){t.delete(n)}},setCanTrack(n){e=n}}}let U;c()&&m==="qwik"?(window.__BUILDER_USER_ATTRIBUTES_SERVICE__||(window.__BUILDER_USER_ATTRIBUTES_SERVICE__=W()),U=window.__BUILDER_USER_ATTRIBUTES_SERVICE__):U=W();const B=U,et=e=>{B.setUserAttributes(e)},le=e=>{const t=p(e)?e:!0;return B.setCanTrack(t),t};function tt(){return typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:globalThis}function nt(){const e=tt().fetch;if(typeof e=="undefined")throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
|
|
2
|
+
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`),new Error("Builder SDK could not find a global `fetch` function");return e}const rt=nt();function T(e,t=null,n="."){return Object.keys(e).reduce((r,s)=>{const o=e[s],i=[t,s].filter(Boolean).join(n);return[typeof o=="object",o!==null,!(Array.isArray(o)&&o.length===0)].every(Boolean)?{...r,...T(o,i,n)}:{...r,[i]:o}},{})}function de(e,t,n={}){for(const r in e){const s=e[r],o=t?t+"."+r:r;s&&typeof s=="object"&&!Array.isArray(s)&&!Object.keys(s).find(i=>i.startsWith("$"))?de(s,o,n):n[o]=s}return n}function st(e){const t={};for(const n in e){const r=n.split(".");let s=t;for(let o=0;o<r.length;o++){const i=r[o];o===r.length-1?s[i]=e[n]:(s[i]=s[i]||{},s=s[i])}}return t}const ot="v3",j=e=>typeof e=="number"&&!isNaN(e)&&e>=0,x=e=>{const{limit:t=30,userAttributes:n,query:r,model:s,apiKey:o,enrich:i,locale:u,apiVersion:y=ot,fields:S,omit:w,offset:l,cacheSeconds:g,staleCacheSeconds:h,sort:E,includeUnpublished:_,apiHost:pe}=e;if(!o)throw new Error("Missing API key");if(!["v3"].includes(y))throw new Error(`Invalid apiVersion: expected 'v3', received '${y}'`);const me=t!==1,Se=pe||"https://cdn.builder.io",a=new URL(`${Se}/api/${y}/content/${s}`);a.searchParams.set("apiKey",o),a.searchParams.set("limit",String(t)),a.searchParams.set("noTraverse",String(me)),a.searchParams.set("includeRefs",String(!0));const k=u||(n==null?void 0:n.locale);let b=n||{};if(k&&(a.searchParams.set("locale",k),b={locale:k,...b}),i&&a.searchParams.set("enrich",String(i)),a.searchParams.set("omit",w!=null?w:"meta.componentsUsed"),S&&a.searchParams.set("fields",S),Number.isFinite(l)&&l>-1&&a.searchParams.set("offset",String(Math.floor(l))),typeof _=="boolean"&&a.searchParams.set("includeUnpublished",String(_)),g&&j(g)&&a.searchParams.set("cacheSeconds",String(g)),h&&j(h)&&a.searchParams.set("staleCacheSeconds",String(h)),E){const f=T({sort:E});for(const I in f)a.searchParams.set(I,JSON.stringify(f[I]))}const L={...Te(),...$(e.options||{})};b={...b,...at(L)};const N=T(L);for(const f in N)a.searchParams.set(f,String(N[f]));if(Object.keys(b).length>0&&a.searchParams.set("userAttributes",JSON.stringify(b)),r){const f=de({query:r});for(const I in f)a.searchParams.set(I,JSON.stringify(f[I]))}return a},it=e=>{const t={};for(const n in e)n.startsWith("userAttributes.")&&(t[n]=e[n],delete e[n]);return t},at=e=>{if(c()&&e.preview==="BUILDER_STUDIO"){e["userAttributes.urlPath"]=window.location.pathname,e["userAttributes.host"]=window.location.host;const t=it(e),{userAttributes:n}=st(t);return n}return{}},ct=e=>"results"in e;async function fe(e){const t=await he({...e,limit:1});return t&&t[0]||null}const ut=async e=>{var i,u;const t=x(e),n=(i=e.fetch)!=null?i:rt,r={...e.fetchOptions,headers:{...(u=e.fetchOptions)==null?void 0:u.headers,...Q()}};return await(await n(t.href,r)).json()},ge=async(e,t,n=x(e))=>{const r=le(e.canTrack);if(n.search.includes("preview="),!r||!(c()||m==="reactNative"))return t.results;try{const s=[];for(const o of t.results)s.push(await qe({item:o,canTrack:r}));t.results=s}catch(s){d.error("Could not process A/B tests. ",s)}return t.results};async function he(e){const t=x(e),n=await ut(e);if(!ct(n))throw d.error("Error fetching data. ",{url:t,content:n,options:e}),n;return ge(e,n)}const lt=async e=>{var r,s,o;const t=e.path||((r=e.url)==null?void 0:r.pathname)||((s=e.userAttributes)==null?void 0:s.urlPath),n={...e,apiKey:e.apiKey,model:e.model||"page",userAttributes:{...e.userAttributes,...t?{urlPath:t}:{}},options:O(e.searchParams||((o=e.url)==null?void 0:o.searchParams)||e.options)};return{apiKey:n.apiKey,model:n.model,content:await fe(n)}};exports.TARGET=m;exports._processContentResult=ge;exports._track=re;exports.checkIsDefined=p;exports.createEditorListener=ie;exports.createRegisterComponentMessage=ve;exports.fetchBuilderProps=lt;exports.fetchEntries=he;exports.fetchOneEntry=fe;exports.getBuilderSearchParams=O;exports.getCookieSync=A;exports.getDefaultCanTrack=le;exports.getUserAttributes=J;exports.handleABTestingSync=Ze;exports.isBrowser=c;exports.isEditing=z;exports.isPreviewing=Ie;exports.logFetch=ne;exports.logger=d;exports.register=X;exports.registerInsertMenu=Ge;exports.serializeIncludingFunctions=C;exports.setClientUserAttributes=et;exports.setEditorSettings=ke;exports.setupBrowserForEditing=oe;exports.subscribeToEditor=ze;exports.track=je;exports.userAttributesService=B;
|
|
@@ -112,7 +112,7 @@ const N = "builder.", pt = "options.", $ = (t) => {
|
|
|
112
112
|
return {};
|
|
113
113
|
const t = new URLSearchParams(window.location.search);
|
|
114
114
|
return $(t);
|
|
115
|
-
}, G = "4.0
|
|
115
|
+
}, G = "4.1.0", J = () => ({
|
|
116
116
|
"X-Builder-SDK": y,
|
|
117
117
|
"X-Builder-SDK-GEN": "2",
|
|
118
118
|
"X-Builder-SDK-Version": G
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./server-entry-9ed7eace.cjs");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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _processContentResult as r, createRegisterComponentMessage as s, fetchBuilderProps as i, fetchEntries as n, fetchOneEntry as o, getBuilderSearchParams as c, isEditing as g, isPreviewing as a, register as d, setEditorSettings as E, subscribeToEditor as f, track as h } from "./server-entry-
|
|
1
|
+
import { _processContentResult as r, createRegisterComponentMessage as s, fetchBuilderProps as i, fetchEntries as n, fetchOneEntry as o, getBuilderSearchParams as c, isEditing as g, isPreviewing as a, register as d, setEditorSettings as E, subscribeToEditor as f, track as h } from "./server-entry-cddec22e.js";
|
|
2
2
|
export {
|
|
3
3
|
r as _processContentResult,
|
|
4
4
|
s as createRegisterComponentMessage,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),j=require("react"),g=require("./blocks-exports.cjs");require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),j=require("react"),g=require("./blocks-exports.cjs");require("./server-entry-a24928b8.cjs");function S(e){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(i,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}return i.default=e,Object.freeze(i)}const v=S(j),y=e=>e.toString();function p(e){var u;const[i,r]=j.useState(()=>[]);function s(){return!!(e.grid||e.oneAtATime)}function O(){return{display:"flex",alignItems:"stretch",flexDirection:"column",...e.grid&&{flexDirection:"row",alignItems:"flex-start",flexWrap:"wrap"}}}function C(){const n={...{display:"flex",flexDirection:"column"},alignItems:"stretch",cursor:"pointer"};return Object.fromEntries(Object.entries(n).filter(([l,a])=>a!==void 0))}function h(t){return`builder-accordion-title builder-accordion-title-${i.includes(t)?"open":"closed"}`}function k(t){return`builder-accordion-detail builder-accordion-detail-${i.includes(t)?"open":"closed"}`}function d(){let t=null;if(e.grid&&i.length&&document){const l=i[0];let o=document.querySelector(`.builder-accordion-title[data-index="${l}"]`);if(t=l,o){let m=o.getBoundingClientRect();for(;o=o&&o.nextElementSibling;)if(o){if(o.classList.contains("builder-accordion-detail"))continue;const f=o.getBoundingClientRect();if(f.left>m.left){const b=parseInt(o.getAttribute("data-index")||"",10);isNaN(b)||(m=f,t=b)}else break}}}return typeof t=="number"&&(t=t+1),t}function I(){const t={order:typeof d()=="number"?d():void 0,...e.grid&&{width:"100%"}};return Object.fromEntries(Object.entries(t).filter(([n,l])=>l!==void 0))}function x(t){i.includes(t)?r(s()?[]:i.filter(n=>n!==t)):r(s()?[t]:i.concat(t))}return c.jsx("div",{className:"builder-accordion",style:O(),children:(u=e.items)==null?void 0:u.map((t,n)=>c.jsxs(v.Fragment,{children:[c.jsx("div",{className:h(n),style:{...C(),...e.grid&&{width:e.gridRowWidth,order:d()!==null?y(n):y(n+1)}},"data-index":n,onClick:l=>x(n),children:c.jsx(g.Blocks,{blocks:t.title,path:`items.${n}.title`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}),i.includes(n)?c.jsx("div",{className:k(n),style:I(),children:c.jsx(g.Blocks,{blocks:t.detail,path:`items.${n}.detail`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]},n))})}exports.default=p;
|
|
@@ -2,7 +2,7 @@ import { jsx as l, jsxs as j } from "react/jsx-runtime";
|
|
|
2
2
|
import * as p from "react";
|
|
3
3
|
import { useState as x } from "react";
|
|
4
4
|
import { Blocks as g } from "./blocks-exports.mjs";
|
|
5
|
-
import "./server-entry-
|
|
5
|
+
import "./server-entry-50618347.js";
|
|
6
6
|
const y = (t) => t.toString();
|
|
7
7
|
function B(t) {
|
|
8
8
|
var a;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as P, Fragment as J, jsxs as it } from "react/jsx-runtime";
|
|
2
2
|
import { createContext as Cn, useEffect as pe, useState as Ce, useRef as On, useContext as Mr } from "react";
|
|
3
3
|
import { BuilderContext as Xr } from "./blocks-exports.mjs";
|
|
4
|
-
import { isEditing as Lt, isBrowser as Ft, getUserAttributes as jn, checkIsDefined as st, logger as Hr, TARGET as lt, isPreviewing as An } from "./server-entry-
|
|
5
|
-
import { getClassPropName as In } from "./get-class-prop-name-
|
|
4
|
+
import { isEditing as Lt, isBrowser as Ft, getUserAttributes as jn, checkIsDefined as st, logger as Hr, TARGET as lt, isPreviewing as An } from "./server-entry-50618347.js";
|
|
5
|
+
import { getClassPropName as In } from "./get-class-prop-name-de337a1b.js";
|
|
6
6
|
import { DynamicRenderer as Tn } from "./dynamic-renderer-8b343325.js";
|
|
7
7
|
const Pn = Cn({ registeredComponents: {} }), bn = (e, t, n) => {
|
|
8
8
|
const r = String.prototype.split.call(t, /[,[\].]+?/).filter(Boolean).reduce((o, s) => o != null ? o[s] : o, e);
|