@builder.io/sdk-react 2.0.8 → 2.0.9
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 +16 -16
- package/lib/browser/blocks-exports.mjs +36 -36
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/init.cjs +1 -1
- package/lib/browser/init.mjs +1 -1
- package/lib/browser/{server-entry-ba3e0524.cjs → server-entry-16fc27fe.cjs} +2 -2
- package/lib/{node/server-entry-f6ee5d92.js → browser/server-entry-8bf52a55.js} +74 -73
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-ef5e6161.js → accordion-589b3ac8.js} +1 -1
- package/lib/edge/{accordion-88007399.cjs → accordion-afed3bd3.cjs} +1 -1
- package/lib/edge/{blocks-dc478c97.cjs → blocks-854f4022.cjs} +1 -1
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{blocks-90fd2fd8.js → blocks-fdb24842.js} +3 -3
- package/lib/edge/{button-8d307faf.js → button-08412b69.js} +2 -2
- package/lib/edge/{button-228f448d.cjs → button-26b76a4a.cjs} +1 -1
- package/lib/edge/{columns-77b7011a.js → columns-bd2a004b.js} +4 -4
- package/lib/edge/{columns-3547be8c.cjs → columns-ccdafcc7.cjs} +1 -1
- package/lib/edge/{content-variants-4f7cad1a.js → content-variants-dd7ea0f9.js} +11 -11
- package/lib/edge/{content-variants-f0edf280.cjs → content-variants-fc207487.cjs} +4 -4
- package/lib/edge/{evaluate-39c2c786.cjs → evaluate-3991fda5.cjs} +1 -1
- package/lib/edge/{evaluate-384a03ed.js → evaluate-e2f692df.js} +1 -1
- package/lib/edge/{form-c6da17f5.cjs → form-5eb85abf.cjs} +1 -1
- package/lib/edge/{form-d40e9eca.js → form-b9148162.js} +4 -4
- package/lib/edge/{get-class-prop-name-767dbeb0.js → get-class-prop-name-0c783f8c.js} +1 -1
- package/lib/edge/{get-class-prop-name-4f8743e9.cjs → get-class-prop-name-2fa91d70.cjs} +1 -1
- package/lib/edge/{img-c50b3839.cjs → img-2f30658b.cjs} +1 -1
- package/lib/edge/{img-d650b796.js → img-602f7d3a.js} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/init.cjs +1 -1
- package/lib/edge/init.mjs +1 -1
- package/lib/edge/{input-5646dcb2.js → input-4c791db9.js} +1 -1
- package/lib/edge/{input-aaba7df0.cjs → input-551362f3.cjs} +1 -1
- package/lib/edge/{select-d3905dcd.js → select-d1391d12.js} +1 -1
- package/lib/edge/{select-2e7bf7d0.cjs → select-eb26f837.cjs} +1 -1
- package/lib/edge/server-entry-7b4fa72f.cjs +2 -0
- package/lib/edge/{server-entry-29a170e3.js → server-entry-c537d834.js} +59 -58
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-82c0b340.js → slot-d375d5eb.js} +4 -4
- package/lib/edge/{slot-695259cf.cjs → slot-d723d000.cjs} +1 -1
- package/lib/edge/{symbol-5a6a783f.cjs → symbol-6c18ca90.cjs} +1 -1
- package/lib/edge/{symbol-91897bd4.js → symbol-8b3a6b98.js} +2 -2
- package/lib/edge/{tabs-a191e7b1.js → tabs-1e47cfd4.js} +4 -4
- package/lib/edge/{tabs-4c4a6b19.cjs → tabs-8296bce7.cjs} +1 -1
- package/lib/edge/{text-7a00e2f8.cjs → text-9eac9e4d.cjs} +1 -1
- package/lib/edge/{text-ca974245.js → text-d3c86634.js} +2 -2
- package/lib/node/blocks-exports.cjs +2 -2
- package/lib/node/blocks-exports.mjs +2 -2
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +2 -2
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +2 -2
- package/lib/node/{node-runtime-a6fb6ac7.cjs → node-runtime-c7c85f6c.cjs} +1 -1
- package/lib/node/{node-runtime-d8e6d827.js → node-runtime-e41e9eb6.js} +1 -1
- package/lib/node/{server-entry-ba3e0524.cjs → server-entry-16fc27fe.cjs} +2 -2
- package/lib/{browser/server-entry-f6ee5d92.js → node/server-entry-8bf52a55.js} +74 -73
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/package.json +1 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/functions/register-component.d.ts +1 -1
- package/lib/edge/server-entry-b0e7430b.cjs +0 -2
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
const v = "react",
|
|
1
|
+
const v = "react", Q = (t) => {
|
|
2
2
|
const e = {};
|
|
3
3
|
return t.forEach((n, r) => {
|
|
4
4
|
e[r] = n;
|
|
5
5
|
}), e;
|
|
6
|
-
}, L = (t) => t instanceof URLSearchParams ?
|
|
6
|
+
}, L = (t) => t instanceof URLSearchParams ? Q(t) : t, V = (t) => typeof t == "string" ? t : t instanceof URLSearchParams ? t.toString() : new URLSearchParams(t).toString();
|
|
7
7
|
function c() {
|
|
8
8
|
return typeof window != "undefined" && typeof document != "undefined";
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function Y() {
|
|
11
11
|
return c() && window.self !== window.top;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
return
|
|
13
|
+
function Z(t) {
|
|
14
|
+
return Y() && // accessing window.location.search is safe here because `isIframe()` is only `true` if we're in a browser.
|
|
15
15
|
V(t || window.location.search).indexOf("builder.frameEditing=") !== -1;
|
|
16
16
|
}
|
|
17
17
|
function _t(t) {
|
|
@@ -20,16 +20,17 @@ function _t(t) {
|
|
|
20
20
|
}
|
|
21
21
|
const $t = (t) => ({
|
|
22
22
|
type: "builder.registerComponent",
|
|
23
|
-
data:
|
|
24
|
-
}),
|
|
23
|
+
data: U(t)
|
|
24
|
+
}), tt = (t) => {
|
|
25
25
|
const e = t.toString().trim();
|
|
26
26
|
return `return (${!e.startsWith("function") && !e.startsWith("(") ? "function " : ""}${e}).apply(this, arguments)`;
|
|
27
27
|
};
|
|
28
|
-
function
|
|
29
|
-
return JSON.parse(JSON.stringify(t, (e, n) => typeof n == "function" ?
|
|
28
|
+
function U(t) {
|
|
29
|
+
return JSON.parse(JSON.stringify(t, (e, n) => typeof n == "function" ? tt(n) : n));
|
|
30
30
|
}
|
|
31
31
|
const x = {};
|
|
32
32
|
function et(t, e) {
|
|
33
|
+
t === "plugin" && (e = U(e));
|
|
33
34
|
let n = x[t];
|
|
34
35
|
if (n || (n = x[t] = []), n.push(e), c()) {
|
|
35
36
|
const r = {
|
|
@@ -57,7 +58,7 @@ function Gt(t) {
|
|
|
57
58
|
parent.postMessage(e, "*");
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
|
-
const T = "builder.", nt = "options.",
|
|
61
|
+
const T = "builder.", nt = "options.", M = (t) => {
|
|
61
62
|
if (!t)
|
|
62
63
|
return {};
|
|
63
64
|
const e = L(t), n = {};
|
|
@@ -71,7 +72,7 @@ const T = "builder.", nt = "options.", U = (t) => {
|
|
|
71
72
|
if (!c())
|
|
72
73
|
return {};
|
|
73
74
|
const t = new URLSearchParams(window.location.search);
|
|
74
|
-
return
|
|
75
|
+
return M(t);
|
|
75
76
|
}, b = "[Builder.io]: ", f = {
|
|
76
77
|
log: (...t) => console.log(b, ...t),
|
|
77
78
|
error: (...t) => console.error(b, ...t),
|
|
@@ -82,7 +83,7 @@ const T = "builder.", nt = "options.", U = (t) => {
|
|
|
82
83
|
return t;
|
|
83
84
|
const e = t.split(".");
|
|
84
85
|
return e.length > 2 ? e.slice(1).join(".") : t;
|
|
85
|
-
},
|
|
86
|
+
}, F = ({
|
|
86
87
|
name: t,
|
|
87
88
|
canTrack: e
|
|
88
89
|
}) => {
|
|
@@ -93,14 +94,14 @@ const T = "builder.", nt = "options.", U = (t) => {
|
|
|
93
94
|
f.warn("[COOKIE] GET error: ", (r == null ? void 0 : r.message) || r);
|
|
94
95
|
return;
|
|
95
96
|
}
|
|
96
|
-
}, N = async (t) =>
|
|
97
|
+
}, N = async (t) => F(t), st = (t) => t.map(([e, n]) => n ? `${e}=${n}` : e).filter(m).join("; "), it = [["secure", ""], ["SameSite", "None"]], at = ({
|
|
97
98
|
name: t,
|
|
98
99
|
value: e,
|
|
99
100
|
expires: n
|
|
100
101
|
}) => {
|
|
101
102
|
const o = (c() ? location.protocol === "https:" : !0) ? it : [[]], s = n ? [["expires", n.toUTCString()]] : [[]], a = [[t, e], ...s, ["path", "/"], ["domain", ot(window.location.hostname)], ...o];
|
|
102
103
|
return st(a);
|
|
103
|
-
},
|
|
104
|
+
}, j = async ({
|
|
104
105
|
name: t,
|
|
105
106
|
value: e,
|
|
106
107
|
expires: n,
|
|
@@ -125,16 +126,16 @@ function ct() {
|
|
|
125
126
|
return (t == "x" ? e : e & 3 | 8).toString(16);
|
|
126
127
|
});
|
|
127
128
|
}
|
|
128
|
-
function
|
|
129
|
+
function D() {
|
|
129
130
|
return ct().replace(/-/g, "");
|
|
130
131
|
}
|
|
131
|
-
const
|
|
132
|
+
const K = "builderSessionId", ut = async ({
|
|
132
133
|
canTrack: t
|
|
133
134
|
}) => {
|
|
134
135
|
if (!t)
|
|
135
136
|
return;
|
|
136
137
|
const e = await N({
|
|
137
|
-
name:
|
|
138
|
+
name: K,
|
|
138
139
|
canTrack: t
|
|
139
140
|
});
|
|
140
141
|
if (m(e))
|
|
@@ -146,20 +147,20 @@ const D = "builderSessionId", ut = async ({
|
|
|
146
147
|
canTrack: t
|
|
147
148
|
}), n;
|
|
148
149
|
}
|
|
149
|
-
}, dt = () =>
|
|
150
|
+
}, dt = () => D(), lt = ({
|
|
150
151
|
id: t,
|
|
151
152
|
canTrack: e
|
|
152
|
-
}) =>
|
|
153
|
-
name:
|
|
153
|
+
}) => j({
|
|
154
|
+
name: K,
|
|
154
155
|
value: t,
|
|
155
156
|
canTrack: e
|
|
156
|
-
}),
|
|
157
|
+
}), W = () => c() && typeof localStorage != "undefined" ? localStorage : void 0, ft = ({
|
|
157
158
|
key: t,
|
|
158
159
|
canTrack: e
|
|
159
160
|
}) => {
|
|
160
161
|
var n;
|
|
161
162
|
try {
|
|
162
|
-
return e ? (n =
|
|
163
|
+
return e ? (n = W()) == null ? void 0 : n.getItem(t) : void 0;
|
|
163
164
|
} catch (r) {
|
|
164
165
|
console.debug("[LocalStorage] GET error: ", r);
|
|
165
166
|
return;
|
|
@@ -171,17 +172,17 @@ const D = "builderSessionId", ut = async ({
|
|
|
171
172
|
}) => {
|
|
172
173
|
var r;
|
|
173
174
|
try {
|
|
174
|
-
e && ((r =
|
|
175
|
+
e && ((r = W()) == null || r.setItem(t, n));
|
|
175
176
|
} catch (o) {
|
|
176
177
|
console.debug("[LocalStorage] SET error: ", o);
|
|
177
178
|
}
|
|
178
|
-
},
|
|
179
|
+
}, _ = "builderVisitorId", gt = ({
|
|
179
180
|
canTrack: t
|
|
180
181
|
}) => {
|
|
181
182
|
if (!t)
|
|
182
183
|
return;
|
|
183
184
|
const e = ft({
|
|
184
|
-
key:
|
|
185
|
+
key: _,
|
|
185
186
|
canTrack: t
|
|
186
187
|
});
|
|
187
188
|
if (m(e))
|
|
@@ -193,11 +194,11 @@ const D = "builderSessionId", ut = async ({
|
|
|
193
194
|
canTrack: t
|
|
194
195
|
}), n;
|
|
195
196
|
}
|
|
196
|
-
}, pt = () =>
|
|
197
|
+
}, pt = () => D(), mt = ({
|
|
197
198
|
id: t,
|
|
198
199
|
canTrack: e
|
|
199
200
|
}) => ht({
|
|
200
|
-
key:
|
|
201
|
+
key: _,
|
|
201
202
|
value: t,
|
|
202
203
|
canTrack: e
|
|
203
204
|
}), yt = () => {
|
|
@@ -275,7 +276,7 @@ async function It(t) {
|
|
|
275
276
|
f.error("Missing API key for track call. Please provide your API key.");
|
|
276
277
|
return;
|
|
277
278
|
}
|
|
278
|
-
if (t.canTrack && !
|
|
279
|
+
if (t.canTrack && !Z() && (c() || v === "reactNative"))
|
|
279
280
|
return fetch("https://cdn.builder.io/api/v1/track", {
|
|
280
281
|
method: "POST",
|
|
281
282
|
body: JSON.stringify({
|
|
@@ -293,13 +294,13 @@ const Jt = (t) => It({
|
|
|
293
294
|
...t,
|
|
294
295
|
canTrack: !0
|
|
295
296
|
}), kt = ["*.beta.builder.io", "beta.builder.io", "builder.io", "localhost", "qa.builder.io"];
|
|
296
|
-
function
|
|
297
|
+
function $(t, e) {
|
|
297
298
|
if (!e.origin.startsWith("http") && !e.origin.startsWith("https"))
|
|
298
299
|
return !1;
|
|
299
300
|
const n = new URL(e.origin), r = n.hostname;
|
|
300
301
|
return (t || kt).findIndex((o) => o.startsWith("*.") ? r.endsWith(o.slice(1)) : o === r) > -1;
|
|
301
302
|
}
|
|
302
|
-
const Et = "2.0.
|
|
303
|
+
const Et = "2.0.9", zt = () => {
|
|
303
304
|
et("insertMenu", {
|
|
304
305
|
name: "_default",
|
|
305
306
|
default: !0,
|
|
@@ -343,7 +344,7 @@ const Pt = (t = {}) => {
|
|
|
343
344
|
}
|
|
344
345
|
}, "*"), window.addEventListener("message", (r) => {
|
|
345
346
|
var s, a;
|
|
346
|
-
if (
|
|
347
|
+
if (!$(t.trustedHosts, r))
|
|
347
348
|
return;
|
|
348
349
|
const {
|
|
349
350
|
data: o
|
|
@@ -389,7 +390,7 @@ const Pt = (t = {}) => {
|
|
|
389
390
|
trustedHosts: e,
|
|
390
391
|
callbacks: n
|
|
391
392
|
}) => (r) => {
|
|
392
|
-
if (
|
|
393
|
+
if (!$(e, r))
|
|
393
394
|
return;
|
|
394
395
|
const {
|
|
395
396
|
data: o
|
|
@@ -436,17 +437,17 @@ const Pt = (t = {}) => {
|
|
|
436
437
|
canTrack: !0
|
|
437
438
|
}), At = ({
|
|
438
439
|
contentId: t
|
|
439
|
-
}) =>
|
|
440
|
+
}) => F({
|
|
440
441
|
name: E(t),
|
|
441
442
|
canTrack: !0
|
|
442
443
|
}), Tt = ({
|
|
443
444
|
contentId: t,
|
|
444
445
|
value: e
|
|
445
|
-
}) =>
|
|
446
|
+
}) => j({
|
|
446
447
|
name: E(t),
|
|
447
448
|
value: e,
|
|
448
449
|
canTrack: !0
|
|
449
|
-
}),
|
|
450
|
+
}), G = (t) => m(t.id) && m(t.variations) && Object.keys(t.variations).length > 0, Rt = ({
|
|
450
451
|
id: t,
|
|
451
452
|
variations: e
|
|
452
453
|
}) => {
|
|
@@ -459,7 +460,7 @@ const Pt = (t = {}) => {
|
|
|
459
460
|
return s;
|
|
460
461
|
}
|
|
461
462
|
return t;
|
|
462
|
-
},
|
|
463
|
+
}, J = (t) => {
|
|
463
464
|
const e = Rt(t);
|
|
464
465
|
return Tt({
|
|
465
466
|
contentId: t.id,
|
|
@@ -467,7 +468,7 @@ const Pt = (t = {}) => {
|
|
|
467
468
|
}).catch((n) => {
|
|
468
469
|
f.error("could not store A/B test variation: ", n);
|
|
469
470
|
}), e;
|
|
470
|
-
},
|
|
471
|
+
}, z = ({
|
|
471
472
|
item: t,
|
|
472
473
|
testGroupId: e
|
|
473
474
|
}) => {
|
|
@@ -489,14 +490,14 @@ const Pt = (t = {}) => {
|
|
|
489
490
|
return t;
|
|
490
491
|
if (!t)
|
|
491
492
|
return;
|
|
492
|
-
if (
|
|
493
|
+
if (!G(t))
|
|
493
494
|
return t;
|
|
494
495
|
const n = At({
|
|
495
496
|
contentId: t.id
|
|
496
|
-
}) ||
|
|
497
|
+
}) || J({
|
|
497
498
|
variations: t.variations,
|
|
498
499
|
id: t.id
|
|
499
|
-
}), r =
|
|
500
|
+
}), r = z({
|
|
500
501
|
item: t,
|
|
501
502
|
testGroupId: n
|
|
502
503
|
});
|
|
@@ -508,14 +509,14 @@ const Pt = (t = {}) => {
|
|
|
508
509
|
item: t,
|
|
509
510
|
canTrack: e
|
|
510
511
|
}) => {
|
|
511
|
-
if (!e ||
|
|
512
|
+
if (!e || !G(t))
|
|
512
513
|
return t;
|
|
513
514
|
const r = await xt({
|
|
514
515
|
contentId: t.id
|
|
515
|
-
}) ||
|
|
516
|
+
}) || J({
|
|
516
517
|
variations: t.variations,
|
|
517
518
|
id: t.id
|
|
518
|
-
}), o =
|
|
519
|
+
}), o = z({
|
|
519
520
|
item: t,
|
|
520
521
|
testGroupId: r
|
|
521
522
|
});
|
|
@@ -547,14 +548,14 @@ function k(t, e = null, n = ".") {
|
|
|
547
548
|
};
|
|
548
549
|
}, {});
|
|
549
550
|
}
|
|
550
|
-
function
|
|
551
|
+
function H(t, e, n = {}) {
|
|
551
552
|
for (const r in t) {
|
|
552
553
|
const o = t[r], s = e ? e + "." + r : r;
|
|
553
|
-
o && typeof o == "object" && !Array.isArray(o) && !Object.keys(o).find((a) => a.startsWith("$")) ?
|
|
554
|
+
o && typeof o == "object" && !Array.isArray(o) && !Object.keys(o).find((a) => a.startsWith("$")) ? H(o, s, n) : n[s] = o;
|
|
554
555
|
}
|
|
555
556
|
return n;
|
|
556
557
|
}
|
|
557
|
-
const
|
|
558
|
+
const Ft = "v3", B = (t) => typeof t == "number" && !isNaN(t) && t >= 0, P = (t) => {
|
|
558
559
|
const {
|
|
559
560
|
limit: e = 30,
|
|
560
561
|
userAttributes: n,
|
|
@@ -563,7 +564,7 @@ const Nt = "v3", B = (t) => typeof t == "number" && !isNaN(t) && t >= 0, P = (t)
|
|
|
563
564
|
apiKey: s,
|
|
564
565
|
enrich: a,
|
|
565
566
|
locale: d,
|
|
566
|
-
apiVersion: y =
|
|
567
|
+
apiVersion: y = Ft,
|
|
567
568
|
fields: p,
|
|
568
569
|
omit: I,
|
|
569
570
|
offset: u,
|
|
@@ -576,29 +577,29 @@ const Nt = "v3", B = (t) => typeof t == "number" && !isNaN(t) && t >= 0, P = (t)
|
|
|
576
577
|
throw new Error("Missing API key");
|
|
577
578
|
if (!["v3"].includes(y))
|
|
578
579
|
throw new Error(`Invalid apiVersion: expected 'v3', received '${y}'`);
|
|
579
|
-
const
|
|
580
|
-
if (i.searchParams.set("apiKey", s), i.searchParams.set("limit", String(e)), i.searchParams.set("noTraverse", String(
|
|
580
|
+
const X = e !== 1, i = new URL(`https://cdn.builder.io/api/${y}/content/${o}`);
|
|
581
|
+
if (i.searchParams.set("apiKey", s), i.searchParams.set("limit", String(e)), i.searchParams.set("noTraverse", String(X)), i.searchParams.set("includeRefs", String(!0)), d && i.searchParams.set("locale", d), a && i.searchParams.set("enrich", String(a)), i.searchParams.set("omit", I || "meta.componentsUsed"), p && i.searchParams.set("fields", p), Number.isFinite(u) && u > -1 && i.searchParams.set("offset", String(Math.floor(u))), typeof O == "boolean" && i.searchParams.set("includeUnpublished", String(O)), h && B(h) && i.searchParams.set("cacheSeconds", String(h)), g && B(g) && i.searchParams.set("staleCacheSeconds", String(g)), w) {
|
|
581
582
|
const l = k({
|
|
582
583
|
sort: w
|
|
583
584
|
});
|
|
584
585
|
for (const S in l)
|
|
585
586
|
i.searchParams.set(S, JSON.stringify(l[S]));
|
|
586
587
|
}
|
|
587
|
-
const
|
|
588
|
+
const q = {
|
|
588
589
|
...rt(),
|
|
589
590
|
...L(t.options || {})
|
|
590
|
-
}, C = k(
|
|
591
|
+
}, C = k(q);
|
|
591
592
|
for (const l in C)
|
|
592
593
|
i.searchParams.set(l, String(C[l]));
|
|
593
594
|
if (n && i.searchParams.set("userAttributes", JSON.stringify(n)), r) {
|
|
594
|
-
const l =
|
|
595
|
+
const l = H({
|
|
595
596
|
query: r
|
|
596
597
|
});
|
|
597
598
|
for (const S in l)
|
|
598
599
|
i.searchParams.set(S, JSON.stringify(l[S]));
|
|
599
600
|
}
|
|
600
601
|
return i;
|
|
601
|
-
},
|
|
602
|
+
}, Nt = (t) => "results" in t;
|
|
602
603
|
async function jt(t) {
|
|
603
604
|
const e = await Wt({
|
|
604
605
|
...t,
|
|
@@ -630,7 +631,7 @@ const Dt = async (t) => {
|
|
|
630
631
|
async function Wt(t) {
|
|
631
632
|
try {
|
|
632
633
|
const e = P(t), n = await Dt(t);
|
|
633
|
-
return
|
|
634
|
+
return Nt(n) ? Kt(t, n) : (f.error("Error fetching data. ", {
|
|
634
635
|
url: e,
|
|
635
636
|
content: n,
|
|
636
637
|
options: t
|
|
@@ -651,7 +652,7 @@ const qt = async (t) => {
|
|
|
651
652
|
urlPath: e
|
|
652
653
|
} : {}
|
|
653
654
|
},
|
|
654
|
-
options:
|
|
655
|
+
options: M(t.searchParams || ((s = t.url) == null ? void 0 : s.searchParams) || t.options)
|
|
655
656
|
};
|
|
656
657
|
return {
|
|
657
658
|
apiKey: n.apiKey,
|
|
@@ -671,17 +672,17 @@ export {
|
|
|
671
672
|
qt as fetchBuilderProps,
|
|
672
673
|
Wt as fetchEntries,
|
|
673
674
|
jt as fetchOneEntry,
|
|
674
|
-
|
|
675
|
+
M as getBuilderSearchParams,
|
|
675
676
|
Lt as getDefaultCanTrack,
|
|
676
677
|
St as getUserAttributes,
|
|
677
678
|
Xt as handleABTestingSync,
|
|
678
679
|
c as isBrowser,
|
|
679
|
-
|
|
680
|
+
Z as isEditing,
|
|
680
681
|
_t as isPreviewing,
|
|
681
682
|
f as logger,
|
|
682
683
|
et as register,
|
|
683
684
|
zt as registerInsertMenu,
|
|
684
|
-
|
|
685
|
+
U as serializeIncludingFunctions,
|
|
685
686
|
Gt as setEditorSettings,
|
|
686
687
|
Pt as setupBrowserForEditing,
|
|
687
688
|
Ht as subscribeToEditor,
|
|
@@ -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-7b4fa72f.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-c537d834.js";
|
|
2
2
|
export {
|
|
3
3
|
r as _processContentResult,
|
|
4
4
|
s as createRegisterComponentMessage,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { Blocks as m } from "./blocks-
|
|
2
|
+
import { Blocks as m } from "./blocks-fdb24842.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "./blocks-exports.mjs";
|
|
5
|
-
import "./server-entry-
|
|
6
|
-
import "./evaluate-
|
|
7
|
-
import "./get-class-prop-name-
|
|
5
|
+
import "./server-entry-c537d834.js";
|
|
6
|
+
import "./evaluate-e2f692df.js";
|
|
7
|
+
import "./get-class-prop-name-0c783f8c.js";
|
|
8
8
|
import "./dynamic-renderer-8b343325.js";
|
|
9
9
|
function f(t) {
|
|
10
10
|
var e, o, i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),u=require("./blocks-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),u=require("./blocks-854f4022.cjs");require("react");require("./blocks-exports.cjs");require("./server-entry-7b4fa72f.cjs");require("./evaluate-3991fda5.cjs");require("./get-class-prop-name-2fa91d70.cjs");require("./dynamic-renderer-b29b45ca.cjs");function o(e){var t,r,n;return i.jsx("div",{style:{pointerEvents:"auto"},...!((t=e.builderContext.context)!=null&&t.symbolId)&&{"builder-slot":e.name},children:i.jsx(u.Blocks,{parent:(r=e.builderContext.context)==null?void 0:r.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,blocks:(n=e.builderContext.rootState)==null?void 0:n[e.name]})})}exports.default=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("react"),C=require("./blocks-exports.cjs"),v=require("./get-class-prop-name-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("react"),C=require("./blocks-exports.cjs"),v=require("./get-class-prop-name-2fa91d70.cjs"),m=require("./server-entry-7b4fa72f.cjs"),k=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return m.fetchOneEntry({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(r=>{m.logger.error("Could not fetch symbol content: ",r)})};function x(e){var c,a,d,u;function t(){return"div"}function r(){return"div"}function b(){var n,l;return[e.attributes[v.getClassPropName()],"builder-symbol",(n=e.symbol)!=null&&n.inline?"builder-inline-symbol":void 0,(l=e.symbol)!=null&&l.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")}const[i,y]=o.useState(()=>{var n;return(n=e.symbol)==null?void 0:n.content});function f(){i||k({symbol:e.symbol,builderContextValue:e.builderContext}).then(n=>{n&&y(n)})}return o.useEffect(()=>{},[]),o.useEffect(()=>{f()},[e.symbol]),s.jsx("div",{...e.attributes,className:b(),children:s.jsx(C.Content,{nonce:e.builderContext.nonce,isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(c=e.builderBlock)==null?void 0:c.id},customComponents:Object.values(e.builderComponents),data:{...(a=e.symbol)==null?void 0:a.data,...e.builderContext.localState,...(d=i==null?void 0:i.data)==null?void 0:d.state},canTrack:e.builderContext.canTrack,model:(u=e.symbol)==null?void 0:u.model,content:i,linkComponent:e.builderLinkComponent,blocksWrapper:t(),contentWrapper:r()})})}exports.default=x;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import { useState as s, useEffect as u } from "react";
|
|
3
3
|
import { Content as C } from "./blocks-exports.mjs";
|
|
4
|
-
import { getClassPropName as v } from "./get-class-prop-name-
|
|
5
|
-
import { fetchOneEntry as k, logger as h } from "./server-entry-
|
|
4
|
+
import { getClassPropName as v } from "./get-class-prop-name-0c783f8c.js";
|
|
5
|
+
import { fetchOneEntry as k, logger as h } from "./server-entry-c537d834.js";
|
|
6
6
|
const x = async ({
|
|
7
7
|
builderContextValue: e,
|
|
8
8
|
symbol: t
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as m, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { useState as u } from "react";
|
|
3
|
-
import { Blocks as c } from "./blocks-
|
|
3
|
+
import { Blocks as c } from "./blocks-fdb24842.js";
|
|
4
4
|
import "./blocks-exports.mjs";
|
|
5
|
-
import "./server-entry-
|
|
6
|
-
import "./evaluate-
|
|
7
|
-
import "./get-class-prop-name-
|
|
5
|
+
import "./server-entry-c537d834.js";
|
|
6
|
+
import "./evaluate-e2f692df.js";
|
|
7
|
+
import "./get-class-prop-name-0c783f8c.js";
|
|
8
8
|
import "./dynamic-renderer-8b343325.js";
|
|
9
9
|
function x(t) {
|
|
10
10
|
var b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),b=require("react"),r=require("./blocks-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),b=require("react"),r=require("./blocks-854f4022.cjs");require("./blocks-exports.cjs");require("./server-entry-7b4fa72f.cjs");require("./evaluate-3991fda5.cjs");require("./get-class-prop-name-2fa91d70.cjs");require("./dynamic-renderer-b29b45ca.cjs");function s(e){var c;const[t,a]=b.useState(()=>e.defaultActiveTab?e.defaultActiveTab-1:0);function o(n){return e.tabs&&e.tabs[n].content}function u(n){n===t&&e.collapsible?a(-1):a(n)}return i.jsxs("div",{children:[i.jsx("div",{className:"builder-tabs-wrap",style:{display:"flex",flexDirection:"row",justifyContent:e.tabHeaderLayout||"flex-start",overflow:"auto"},children:(c=e.tabs)==null?void 0:c.map((n,l)=>i.jsx("span",{className:`builder-tab-wrap ${t===l?"builder-tab-active":""}`,style:{...t===l?e.activeTabStyle:{}},onClick:d=>u(l),children:i.jsx(r.Blocks,{parent:e.builderBlock.id,path:`component.options.tabs.${l}.label`,blocks:n.label,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})},l))}),o(t)?i.jsx("div",{children:i.jsx(r.Blocks,{parent:e.builderBlock.id,path:`component.options.tabs.${t}.content`,blocks:o(t),context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]})}exports.default=s;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),s=require("./evaluate-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),s=require("./evaluate-3991fda5.cjs");require("./server-entry-7b4fa72f.cjs");function x(e){function n(){var t;const o=e.builderContext,{context:r,localState:a,rootState:c,rootSetState:l}=o;return String(((t=e.text)==null?void 0:t.toString())||"").replace(/{{([^}]+)}}/g,(d,u)=>s.evaluate({code:u,context:r,localState:a,rootState:c,rootSetState:l,enableCache:!1}))}return i.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:n()},style:{outline:"none"}})}exports.default=x;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { evaluate as s } from "./evaluate-
|
|
3
|
-
import "./server-entry-
|
|
2
|
+
import { evaluate as s } from "./evaluate-e2f692df.js";
|
|
3
|
+
import "./server-entry-c537d834.js";
|
|
4
4
|
function f(t) {
|
|
5
5
|
function o() {
|
|
6
6
|
var e;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";"use strict";var We=Object.defineProperty;var $e=(e,t,n)=>t in e?We(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Y=(e,t,n)=>($e(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),p=require("./server-entry-
|
|
1
|
+
"use client";"use strict";var We=Object.defineProperty;var $e=(e,t,n)=>t in e?We(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Y=(e,t,n)=>($e(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),p=require("./server-entry-16fc27fe.cjs"),h=require("react"),W=require("./node-runtime-c7c85f6c.cjs"),De=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),Le=e=>typeof e=="string"&&De.has(e.toLowerCase());function ie(e){return a.jsx(a.Fragment,{children:Le(e.TagName)?a.jsx(a.Fragment,{children:a.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):a.jsx(a.Fragment,{children:typeof e.TagName=="string"?a.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children}):a.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})}const U=()=>{switch(p.TARGET){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":case"angular":return"class"}};function fe(e){function t(){return{...e.attributes,[U()]:`${e.link?"":"builder-button"} ${e.attributes[U()]||""}`,...e.link?{href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"link"}:{role:"button"}}}return a.jsx(ie,{attributes:t(),TagName:e.link?e.builderLinkComponent||"a":"button",actionAttributes:{},children:e.text})}const _=h.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{},nonce:""}),he=h.createContext({registeredComponents:{}});function Oe(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options}}const Me=({code:e,builder:t,context:n,event:i,localState:o,rootSetState:s,rootState:r})=>{const l=W.getFunctionArguments({builder:t,context:n,event:i,state:ge({rootState:r,localState:o,rootSetState:s})});return new Function(...l.map(([c])=>c),e)(...l.map(([,c])=>c))};function ge({rootState:e,localState:t,rootSetState:n}){return new Proxy(e,{get:(i,o)=>{if(t&&o in t)return t[o];const s=i[o];return typeof s=="object"&&s!==null?ge({rootState:s,localState:void 0,rootSetState:n?r=>{i[o]=r,n(i)}:void 0}):s},set:(i,o,s)=>{if(t&&o in t)throw new Error("Writing to local state is not allowed as it is read-only.");return i[o]=s,n==null||n(i),!0}})}function Ue(){var e;return typeof process!="undefined"&&p.checkIsDefined((e=process==null?void 0:process.versions)==null?void 0:e.node)}const He=()=>{var i;if(!Ue())return!1;const e=process.arch==="arm64",t=process.version.startsWith("v20"),n=(i=process.env.NODE_OPTIONS)==null?void 0:i.includes("--no-node-snapshot");return e&&t&&!n?(p.logger.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "),!0):!1},qe=e=>p.isBrowser()||He()?Me(e):W.runInNode(e),N=class N{static getCacheKey(t){return JSON.stringify({...t,event:t.event?Math.random():void 0})}static getCachedValue(t){return N.cache.get(t)}static setCachedValue(t,n){N.cache.size>20&&N.cache.delete(N.cache.keys().next().value),N.cache.set(t,{value:n})}};Y(N,"cacheLimit",20),Y(N,"cache",new Map);let L=N;function O({code:e,context:t,localState:n,rootState:i,rootSetState:o,event:s,isExpression:r=!0,enableCache:l}){if(e==="")return;const c={code:W.parseCode(e,{isExpression:r}),builder:W.getBuilderGlobals(),context:t,event:s,rootSetState:o,rootState:i,localState:n};if(l){const d=L.getCacheKey(c),f=L.getCachedValue(d);if(f)return f.value}try{const d=qe(c);if(l){const f=L.getCacheKey(c);L.setCachedValue(f,d)}return d}catch(d){p.logger.error("Failed code evaluation: "+d.message,{code:e});return}}const Ke=({block:e,context:t,localState:n,rootState:i,rootSetState:o})=>{if(!e.bindings)return e;const s=W.fastClone(e),r={...s,properties:{...s.properties},actions:{...s.actions}};for(const l in e.bindings){const c=e.bindings[l],d=O({code:c,localState:n,rootState:i,rootSetState:o,context:t,enableCache:!0});W.set(r,l,d)}return r};function z({block:e,context:t,shouldEvaluateBindings:n,localState:i,rootState:o,rootSetState:s}){const r=e;return n?Ke({block:r,localState:i,rootState:o,rootSetState:s,context:t}):r}const J=e=>e?e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase():"";function ze(e,t,n={}){let i,o,s,r=null,l=0;const c=function(){l=n.leading===!1?0:Date.now(),r=null,s=e.apply(i,o),r||(i=o=null)};return function(){const d=Date.now();!l&&n.leading===!1&&(l=d);const f=t-(d-l);return i=this,o=arguments,f<=0||f>t?(r&&(clearTimeout(r),r=null),l=d,s=e.apply(i,o),r||(i=o=null)):!r&&n.trailing!==!1&&(r=setTimeout(c,f)),s}}function M(e,...t){const n=Object(e);for(let i=1;i<arguments.length;i++){const o=arguments[i];if(o!=null)for(const s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])}return n}function _e(e){for(const t of e)switch(t.trigger){case"pageLoad":pe(t);break;case"scrollInView":Ge(t);break}}function be(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function xe(e,t){const n=Je(e),i=getComputedStyle(t),o=e.steps[0].styles,s=e.steps[e.steps.length-1].styles,r=[o,s];for(const l of r)for(const c of n)c in l||(l[c]=i[c])}function Je(e){const t=[];for(const n of e.steps)for(const i in n.styles)t.indexOf(i)===-1&&t.push(i);return t}function pe(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){be(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{xe(e,n),n.style.transition="none",n.style.transitionDelay="0",M(n.style,e.steps[0].styles),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${J(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s"),M(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}function Ge(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){be(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{xe(e,n);let i=!1,o=!1;function s(){!i&&l(n)?(i=!0,o=!0,setTimeout(()=>{M(n.style,e.steps[1].styles),e.repeat||document.removeEventListener("scroll",r),setTimeout(()=>{o=!1,e.repeat||(n.style.transition="",n.style.transitionDelay="")},(e.duration+(e.delay||0))*1e3+100)})):e.repeat&&i&&!o&&!l(n)&&(i=!1,M(n.style,e.steps[0].styles))}const r=ze(s,200,{leading:!1});function l(f){const u=f.getBoundingClientRect(),m=window.innerHeight,S=(e.thresholdPercent||0)/100*m;return u.bottom>S&&u.top<m-S}const c=e.steps[0].styles;function d(){M(n.style,c)}d(),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${J(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s")}),document.addEventListener("scroll",r,{capture:!0,passive:!0}),s()})}const ye=e=>Object.entries(e).map(([n,i])=>{if(typeof i=="string")return`${J(n)}: ${i};`}).filter(p.checkIsDefined),Ye=e=>ye(e).join(`
|
|
2
2
|
`),q=({mediaQuery:e,className:t,styles:n})=>{const i=`.${t} {
|
|
3
3
|
${Ye(n)}
|
|
4
4
|
}`;return e?`${e} {
|
|
@@ -185,4 +185,4 @@ font-weight: ${l};
|
|
|
185
185
|
${hn({cssCode:e.cssCode,contentId:e.contentId})}
|
|
186
186
|
${fn({customFonts:e.customFonts})}
|
|
187
187
|
${bn(e.isNestedRender)}
|
|
188
|
-
`.trim());return a.jsx(G,{id:"builderio-content",styles:t,nonce:e.nonce})}const Sn=({content:e,data:t,locale:n})=>{var s,r,l;const i={},o=((s=e==null?void 0:e.data)==null?void 0:s.state)||{};return(l=(r=e==null?void 0:e.data)==null?void 0:r.inputs)==null||l.forEach(c=>{c.name&&c.defaultValue!==void 0&&(i[c.name]=c.defaultValue)}),{...i,...o,...t,...n?{locale:n}:{}}},vn=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function me(e){var c,d,f,u,m,b,S;const[t,n]=h.useState(()=>{var I,y;return sn({variationId:(I=e.content)==null?void 0:I.testVariationId,contentId:(y=e.content)==null?void 0:y.id})});function i(I){l(y=>({...y,rootState:I}))}const[o,s]=h.useState(()=>{var I;return[...ce(),...((I=e.customComponents)==null?void 0:I.filter(({models:y})=>!(y!=null&&y.length)||!e.model?!0:y.includes(e.model)))||[]].reduce((y,{component:j,...R})=>({...y,[R.name]:{component:j,...p.
|
|
188
|
+
`.trim());return a.jsx(G,{id:"builderio-content",styles:t,nonce:e.nonce})}const Sn=({content:e,data:t,locale:n})=>{var s,r,l;const i={},o=((s=e==null?void 0:e.data)==null?void 0:s.state)||{};return(l=(r=e==null?void 0:e.data)==null?void 0:r.inputs)==null||l.forEach(c=>{c.name&&c.defaultValue!==void 0&&(i[c.name]=c.defaultValue)}),{...i,...o,...t,...n?{locale:n}:{}}},vn=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function me(e){var c,d,f,u,m,b,S;const[t,n]=h.useState(()=>{var I,y;return sn({variationId:(I=e.content)==null?void 0:I.testVariationId,contentId:(y=e.content)==null?void 0:y.id})});function i(I){l(y=>({...y,rootState:I}))}const[o,s]=h.useState(()=>{var I;return[...ce(),...((I=e.customComponents)==null?void 0:I.filter(({models:y})=>!(y!=null&&y.length)||!e.model?!0:y.includes(e.model)))||[]].reduce((y,{component:j,...R})=>({...y,[R.name]:{component:j,...p.serializeIncludingFunctions(R)}}),{})}),[r,l]=h.useState(()=>{var I;return{content:vn({content:e.content,data:e.data}),localState:void 0,rootState:Sn({content:e.content,data:e.data,locale:e.locale}),rootSetState:i,context:e.context||{},canTrack:e.canTrack,apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...ce(),...((I=e.customComponents)==null?void 0:I.filter(({models:y})=>!(y!=null&&y.length)||!e.model?!0:y.includes(e.model)))||[]].reduce((y,{component:j,...R})=>({...y,[R.name]:p.serializeIncludingFunctions(R)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{},nonce:e.nonce||""}});return a.jsx(he.Provider,{value:{registeredComponents:o},children:a.jsxs(pn,{nonce:e.nonce,content:e.content,data:e.data,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,showContent:e.showContent,builderContextSignal:r,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts,setBuilderContextSignal:l,children:[e.isSsrAbTest?a.jsx(ne,{id:"builderio-variant-visibility",scriptStr:t,nonce:e.nonce||""}):null,a.jsx(yn,{nonce:e.nonce||"",isNestedRender:e.isNestedRender,contentId:(c=r.content)==null?void 0:c.id,cssCode:(f=(d=r.content)==null?void 0:d.data)==null?void 0:f.cssCode,customFonts:(m=(u=r.content)==null?void 0:u.data)==null?void 0:m.customFonts}),a.jsx(A,{blocks:(S=(b=r.content)==null?void 0:b.data)==null?void 0:S.blocks,context:r,registeredComponents:o,linkComponent:e.linkComponent})]})})}function Fe(e){var r;const[t,n]=h.useState(()=>on({canTrack:p.getDefaultCanTrack(e.canTrack),content:e.content}));function i(){var l;return ln(K(e.content).map(c=>({id:c.testVariationId,testRatio:c.testRatio})),((l=e.content)==null?void 0:l.id)||"")}function o(){return K(e.content).map(l=>`.variant-${l.testVariationId} { display: none; } `).join("")}function s(){var l;return t?{...e.content,testVariationId:(l=e.content)==null?void 0:l.id}:p.handleABTestingSync({item:e.content,canTrack:p.getDefaultCanTrack(e.canTrack)})}return h.useEffect(()=>{},[]),a.jsxs(a.Fragment,{children:[!e.isNestedRender&&p.TARGET!=="reactNative"?a.jsx(ne,{id:"builderio-init-variants-fns",scriptStr:rn(),nonce:e.nonce||""}):null,t?a.jsxs(a.Fragment,{children:[a.jsx(G,{id:"builderio-variants",styles:o(),nonce:e.nonce||""}),a.jsx(ne,{id:"builderio-variants-visibility",scriptStr:i(),nonce:e.nonce||""}),(r=K(e.content))==null?void 0:r.map(l=>a.jsx(me,{isNestedRender:e.isNestedRender,nonce:e.nonce,content:l,showContent:!1,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts},l.testVariationId))]}):null,a.jsx(me,{nonce:e.nonce,isNestedRender:e.isNestedRender,content:s(),showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts})]})}const kn=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return p.fetchOneEntry({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{p.logger.error("Could not fetch symbol content: ",n)})};function Ae(e){var l,c,d,f;function t(){return"div"}function n(){return"div"}function i(){var u,m;return[e.attributes[U()],"builder-symbol",(u=e.symbol)!=null&&u.inline?"builder-inline-symbol":void 0,(m=e.symbol)!=null&&m.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")}const[o,s]=h.useState(()=>{var u;return(u=e.symbol)==null?void 0:u.content});function r(){o||kn({symbol:e.symbol,builderContextValue:e.builderContext}).then(u=>{u&&s(u)})}return h.useEffect(()=>{},[]),h.useEffect(()=>{r()},[e.symbol]),a.jsx("div",{...e.attributes,className:i(),children:a.jsx(Fe,{nonce:e.builderContext.nonce,isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(l=e.builderBlock)==null?void 0:l.id},customComponents:Object.values(e.builderComponents),data:{...(c=e.symbol)==null?void 0:c.data,...e.builderContext.localState,...(d=o==null?void 0:o.data)==null?void 0:d.state},canTrack:e.builderContext.canTrack,model:(f=e.symbol)==null?void 0:f.model,content:o,linkComponent:e.builderLinkComponent,blocksWrapper:t(),contentWrapper:n()})})}exports.Blocks=A;exports.BuilderContext=_;exports.Button=fe;exports.Columns=Te;exports.Content=Fe;exports.Fragment=Ie;exports.Image=we;exports.Section=Ee;exports.Symbol=Ae;exports.Text=Re;exports.Video=je;
|
|
@@ -3,9 +3,9 @@ var He = Object.defineProperty;
|
|
|
3
3
|
var qe = (e, t, n) => t in e ? He(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
4
4
|
var ie = (e, t, n) => (qe(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
5
5
|
import { jsx as s, Fragment as R, jsxs as V } from "react/jsx-runtime";
|
|
6
|
-
import { TARGET as H, checkIsDefined as Y, logger as Z, isBrowser as G, isEditing as $, registerInsertMenu as Ke, setupBrowserForEditing as ze, createRegisterComponentMessage as _e, getDefaultCanTrack as Q, _track as he, isPreviewing as Je, fetchOneEntry as Ie, createEditorListener as Ye, fetch as Ge,
|
|
6
|
+
import { TARGET as H, checkIsDefined as Y, logger as Z, isBrowser as G, isEditing as $, registerInsertMenu as Ke, setupBrowserForEditing as ze, createRegisterComponentMessage as _e, getDefaultCanTrack as Q, _track as he, isPreviewing as Je, fetchOneEntry as Ie, createEditorListener as Ye, fetch as Ge, serializeIncludingFunctions as ge, handleABTestingSync as Qe } from "./server-entry-8bf52a55.js";
|
|
7
7
|
import { createContext as we, useState as T, useEffect as P, useContext as be, useRef as ee, createElement as Re } from "react";
|
|
8
|
-
import { getFunctionArguments as Xe, runInNode as Ze, parseCode as et, getBuilderGlobals as tt, fastClone as de, set as Ee } from "./node-runtime-
|
|
8
|
+
import { getFunctionArguments as Xe, runInNode as Ze, parseCode as et, getBuilderGlobals as tt, fastClone as de, set as Ee } from "./node-runtime-e41e9eb6.js";
|
|
9
9
|
const nt = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), it = (e) => typeof e == "string" && nt.has(e.toLowerCase());
|
|
10
10
|
function ue(e) {
|
|
11
11
|
return /* @__PURE__ */ s(R, { children: it(e.TagName) ? /* @__PURE__ */ s(R, { children: /* @__PURE__ */ s(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ s(R, { children: typeof e.TagName == "string" ? /* @__PURE__ */ s(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) : /* @__PURE__ */ s(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) });
|
package/lib/node/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-16fc27fe.cjs");require("react/jsx-runtime");require("react");require("./node-runtime-c7c85f6c.cjs");exports.Blocks=t.Blocks;exports.BuilderContext=t.BuilderContext;exports.Button=t.Button;exports.Columns=t.Columns;exports.Content=t.Content;exports.Fragment=t.Fragment;exports.Image=t.Image;exports.Section=t.Section;exports.Symbol=t.Symbol;exports.Text=t.Text;exports.Video=t.Video;exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
|
package/lib/node/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Blocks as s, BuilderContext as n, Button as m, Columns as c, Content as g, Fragment as a, Image as p, Section as d, Symbol as l, Text as u, Video as f } from "./blocks-exports.mjs";
|
|
2
|
-
import { _processContentResult as C, createRegisterComponentMessage as E, fetchBuilderProps as h, fetchEntries as x, fetchOneEntry as S, getBuilderSearchParams as b, isEditing as P, isPreviewing as k, register as y, setEditorSettings as R, subscribeToEditor as T, track as v } from "./server-entry-
|
|
2
|
+
import { _processContentResult as C, createRegisterComponentMessage as E, fetchBuilderProps as h, fetchEntries as x, fetchOneEntry as S, getBuilderSearchParams as b, isEditing as P, isPreviewing as k, register as y, setEditorSettings as R, subscribeToEditor as T, track as v } from "./server-entry-8bf52a55.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
|
-
import "./node-runtime-
|
|
5
|
+
import "./node-runtime-e41e9eb6.js";
|
|
6
6
|
export {
|
|
7
7
|
s as Blocks,
|
|
8
8
|
n as BuilderContext,
|
package/lib/node/init.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("isolated-vm"),n=require("./node-runtime-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("isolated-vm"),n=require("./node-runtime-c7c85f6c.cjs");require("./server-entry-16fc27fe.cjs");const o=e=>{const{ivmIsolateOptions:i}=e||{};n.setIvm(t,i)};exports.initializeNodeRuntime=o;
|
package/lib/node/init.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import t from "isolated-vm";
|
|
2
|
-
import { setIvm as m } from "./node-runtime-
|
|
3
|
-
import "./server-entry-
|
|
2
|
+
import { setIvm as m } from "./node-runtime-e41e9eb6.js";
|
|
3
|
+
import "./server-entry-8bf52a55.js";
|
|
4
4
|
const p = (i) => {
|
|
5
5
|
const {
|
|
6
6
|
ivmIsolateOptions: o
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const serverEntry=require("./server-entry-
|
|
1
|
+
"use strict";const serverEntry=require("./server-entry-16fc27fe.cjs"),getFunctionArguments=({builder:e,context:t,event:s,state:r})=>Object.entries({state:r,Builder:e,builder:e,context:t,event:s}),getBuilderGlobals=()=>({isEditing:serverEntry.isEditing(),isBrowser:serverEntry.isBrowser(),isServer:!serverEntry.isBrowser(),getUserAttributes:()=>serverEntry.getUserAttributes()}),parseCode=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,SDK_NAME_FOR_TARGET=(()=>{switch(serverEntry.TARGET){case"rsc":return"react-nextjs";case"reactNative":return"react-native";default:return serverEntry.TARGET}})(),SDK_NAME=`@builder.io/sdk-${SDK_NAME_FOR_TARGET}`,fastClone=e=>JSON.parse(JSON.stringify(e)),set=(e,t,s)=>{if(Object(e)!==e)return e;const r=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return r.slice(0,-1).reduce((n,o,c)=>Object(n[o])===n[o]?n[o]:n[o]=Math.abs(Number(r[c+1]))>>0===+r[c+1]?[]:{},e)[r[r.length-1]]=s,e},noop=()=>{};let safeDynamicRequire=noop;try{safeDynamicRequire=eval("require")}catch(e){}const getSyncValName=e=>`bldr_${e}_sync`,BUILDER_SET_STATE_NAME="BUILDER_SET_STATE",INJECTED_IVM_GLOBAL="BUILDER_IVM",REF_TO_PROXY_FN=`
|
|
2
2
|
var refToProxy = (obj) => {
|
|
3
3
|
if (typeof obj !== 'object' || obj === null) {
|
|
4
4
|
return obj;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isEditing, isBrowser, getUserAttributes, TARGET, logger, MSG_PREFIX } from "./server-entry-
|
|
1
|
+
import { isEditing, isBrowser, getUserAttributes, TARGET, logger, MSG_PREFIX } from "./server-entry-8bf52a55.js";
|
|
2
2
|
const getFunctionArguments = ({
|
|
3
3
|
builder: e,
|
|
4
4
|
context: t,
|