@builder.io/sdk-react 1.0.21 → 1.0.23
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 +22 -22
- package/lib/browser/blocks-exports.mjs +439 -445
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/{server-entry-166d8ec9.js → server-entry-4ca9f249.js} +81 -82
- package/lib/browser/server-entry-f69e2b2a.cjs +2 -0
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/blocks-5539f58f.cjs +32 -0
- package/lib/edge/{blocks-793a81d9.js → blocks-93608689.js} +751 -757
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-f62c1e15.cjs → button-7e98d8f3.cjs} +1 -1
- package/lib/edge/{button-659db379.js → button-8816ab35.js} +2 -2
- package/lib/edge/{columns-5fe66f05.cjs → columns-8db639b5.cjs} +1 -1
- package/lib/edge/{columns-07ef2925.js → columns-d065e3c4.js} +3 -3
- package/lib/edge/{content-variants-9aedb66d.cjs → content-variants-44d061f2.cjs} +4 -4
- package/lib/edge/{content-variants-fcba4b5b.js → content-variants-f416bff5.js} +21 -21
- package/lib/edge/{form-5c293cd8.cjs → form-44ceed15.cjs} +1 -1
- package/lib/edge/{form-82e6d435.js → form-8526db32.js} +3 -3
- package/lib/edge/{get-class-prop-name-c54d7ada.cjs → get-class-prop-name-7b951501.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-6242df6a.js → get-class-prop-name-e85bf7a3.js} +1 -1
- package/lib/edge/{img-11c91db6.js → img-5ef224a8.js} +1 -1
- package/lib/edge/{img-73cc7d69.cjs → img-a5802e2b.cjs} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-6b8ac645.js → input-3f85283b.js} +1 -1
- package/lib/edge/{input-9c7d1291.cjs → input-f1aa0191.cjs} +1 -1
- package/lib/edge/{select-f324140d.js → select-4fe889b6.js} +1 -1
- package/lib/edge/{select-42de6b22.cjs → select-d4c018c0.cjs} +1 -1
- package/lib/edge/server-entry-c4b7844d.cjs +2 -0
- package/lib/edge/{server-entry-396b1a7b.js → server-entry-e1e18fd2.js} +80 -81
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-746347ff.cjs → slot-2a11e808.cjs} +1 -1
- package/lib/edge/{slot-4e55a3d1.js → slot-97599025.js} +3 -3
- package/lib/edge/{symbol-e3905b86.js → symbol-a90a41a3.js} +2 -2
- package/lib/edge/{symbol-4b8cffaa.cjs → symbol-dbb5c95e.cjs} +1 -1
- package/lib/node/blocks-exports.cjs +23 -23
- package/lib/node/blocks-exports.mjs +431 -437
- 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-2a838da2.cjs → node-runtime-11a8cdfe.cjs} +1 -1
- package/lib/node/{node-runtime-eb3ca94b.js → node-runtime-8062cfb8.js} +1 -1
- package/lib/node/{server-entry-54c1491b.js → server-entry-3e54c767.js} +81 -82
- package/lib/node/server-entry-461bfaf9.cjs +2 -0
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/package.json +1 -1
- package/types/components/block/animator.d.ts +1 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/functions/is-previewing.d.ts +1 -1
- package/lib/browser/server-entry-c6e9a10a.cjs +0 -2
- package/lib/edge/blocks-c26b2ffc.cjs +0 -32
- package/lib/edge/server-entry-bc7f82dd.cjs +0 -2
- package/lib/node/server-entry-cb0df432.cjs +0 -2
|
@@ -1,35 +1,34 @@
|
|
|
1
|
-
const
|
|
1
|
+
const I = "react", q = (e) => {
|
|
2
2
|
const t = {};
|
|
3
3
|
return e.forEach((n, r) => {
|
|
4
4
|
t[r] = n;
|
|
5
5
|
}), t;
|
|
6
|
-
}, L = (e) => e instanceof URLSearchParams ?
|
|
6
|
+
}, L = (e) => e instanceof URLSearchParams ? q(e) : e, V = (e) => typeof e == "string" ? e : e instanceof URLSearchParams ? e.toString() : new URLSearchParams(e).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 Q(e) {
|
|
14
|
+
return Y() && // accessing window.location.search is safe here because `isIframe()` is only `true` if we're in a browser.
|
|
15
|
+
V(e || window.location.search).indexOf("builder.frameEditing=") !== -1;
|
|
15
16
|
}
|
|
16
17
|
function $e(e) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const t = V(e || window.location.search);
|
|
20
|
-
return U(t) ? !1 : t.indexOf("builder.preview=") !== -1;
|
|
18
|
+
const t = e || (c() ? window.location.search : void 0);
|
|
19
|
+
return t ? V(t).indexOf("builder.preview=") !== -1 : !1;
|
|
21
20
|
}
|
|
22
|
-
const
|
|
21
|
+
const U = (e) => JSON.parse(JSON.stringify(e)), Ge = (e) => ({
|
|
23
22
|
type: "builder.registerComponent",
|
|
24
23
|
data: te(e)
|
|
25
24
|
}), Z = (e) => {
|
|
26
25
|
const t = e.toString().trim();
|
|
27
26
|
return `return (${!t.startsWith("function") && !t.startsWith("(") ? "function " : ""}${t}).apply(this, arguments)`;
|
|
28
|
-
}, ee = (e) => typeof e == "function" ? Z(e) :
|
|
27
|
+
}, ee = (e) => typeof e == "function" ? Z(e) : U(e), te = ({
|
|
29
28
|
inputs: e,
|
|
30
29
|
...t
|
|
31
30
|
}) => ({
|
|
32
|
-
...
|
|
31
|
+
...U(t),
|
|
33
32
|
inputs: e == null ? void 0 : e.map((n) => Object.entries(n).reduce((r, [o, s]) => ({
|
|
34
33
|
...r,
|
|
35
34
|
[o]: ee(s)
|
|
@@ -53,7 +52,7 @@ function ne(e, t) {
|
|
|
53
52
|
}
|
|
54
53
|
}
|
|
55
54
|
const A = {};
|
|
56
|
-
function
|
|
55
|
+
function ze(e) {
|
|
57
56
|
if (c()) {
|
|
58
57
|
Object.assign(A, e);
|
|
59
58
|
const t = {
|
|
@@ -63,7 +62,7 @@ function Je(e) {
|
|
|
63
62
|
parent.postMessage(t, "*");
|
|
64
63
|
}
|
|
65
64
|
}
|
|
66
|
-
const T = "builder.", re = "options.",
|
|
65
|
+
const T = "builder.", re = "options.", M = (e) => {
|
|
67
66
|
if (!e)
|
|
68
67
|
return {};
|
|
69
68
|
const t = L(e), n = {};
|
|
@@ -77,7 +76,7 @@ const T = "builder.", re = "options.", N = (e) => {
|
|
|
77
76
|
if (!c())
|
|
78
77
|
return {};
|
|
79
78
|
const e = new URLSearchParams(window.location.search);
|
|
80
|
-
return
|
|
79
|
+
return M(e);
|
|
81
80
|
}, b = "[Builder.io]: ", f = {
|
|
82
81
|
log: (...e) => console.log(b, ...e),
|
|
83
82
|
error: (...e) => console.error(b, ...e),
|
|
@@ -88,7 +87,7 @@ const T = "builder.", re = "options.", N = (e) => {
|
|
|
88
87
|
return e;
|
|
89
88
|
const t = e.split(".");
|
|
90
89
|
return t.length > 2 ? t.slice(1).join(".") : e;
|
|
91
|
-
},
|
|
90
|
+
}, N = ({
|
|
92
91
|
name: e,
|
|
93
92
|
canTrack: t
|
|
94
93
|
}) => {
|
|
@@ -99,14 +98,14 @@ const T = "builder.", re = "options.", N = (e) => {
|
|
|
99
98
|
f.warn("[COOKIE] GET error: ", (r == null ? void 0 : r.message) || r);
|
|
100
99
|
return;
|
|
101
100
|
}
|
|
102
|
-
},
|
|
101
|
+
}, F = async (e) => N(e), ie = (e) => e.map(([t, n]) => n ? `${t}=${n}` : t).filter(m).join("; "), ae = [["secure", ""], ["SameSite", "None"]], ce = ({
|
|
103
102
|
name: e,
|
|
104
103
|
value: t,
|
|
105
104
|
expires: n
|
|
106
105
|
}) => {
|
|
107
106
|
const o = (c() ? location.protocol === "https:" : !0) ? ae : [[]], s = n ? [["expires", n.toUTCString()]] : [[]], a = [[e, t], ...s, ["path", "/"], ["domain", se(window.location.hostname)], ...o];
|
|
108
107
|
return ie(a);
|
|
109
|
-
},
|
|
108
|
+
}, j = async ({
|
|
110
109
|
name: e,
|
|
111
110
|
value: t,
|
|
112
111
|
expires: n,
|
|
@@ -131,16 +130,16 @@ function ue() {
|
|
|
131
130
|
return (e == "x" ? t : t & 3 | 8).toString(16);
|
|
132
131
|
});
|
|
133
132
|
}
|
|
134
|
-
function
|
|
133
|
+
function D() {
|
|
135
134
|
return ue().replace(/-/g, "");
|
|
136
135
|
}
|
|
137
|
-
const
|
|
136
|
+
const K = "builderSessionId", de = async ({
|
|
138
137
|
canTrack: e
|
|
139
138
|
}) => {
|
|
140
139
|
if (!e)
|
|
141
140
|
return;
|
|
142
|
-
const t = await
|
|
143
|
-
name:
|
|
141
|
+
const t = await F({
|
|
142
|
+
name: K,
|
|
144
143
|
canTrack: e
|
|
145
144
|
});
|
|
146
145
|
if (m(t))
|
|
@@ -152,20 +151,20 @@ const _ = "builderSessionId", de = async ({
|
|
|
152
151
|
canTrack: e
|
|
153
152
|
}), n;
|
|
154
153
|
}
|
|
155
|
-
}, le = () =>
|
|
154
|
+
}, le = () => D(), fe = ({
|
|
156
155
|
id: e,
|
|
157
156
|
canTrack: t
|
|
158
|
-
}) =>
|
|
159
|
-
name:
|
|
157
|
+
}) => j({
|
|
158
|
+
name: K,
|
|
160
159
|
value: e,
|
|
161
160
|
canTrack: t
|
|
162
|
-
}),
|
|
161
|
+
}), _ = () => c() && typeof localStorage != "undefined" ? localStorage : void 0, he = ({
|
|
163
162
|
key: e,
|
|
164
163
|
canTrack: t
|
|
165
164
|
}) => {
|
|
166
165
|
var n;
|
|
167
166
|
try {
|
|
168
|
-
return t ? (n =
|
|
167
|
+
return t ? (n = _()) == null ? void 0 : n.getItem(e) : void 0;
|
|
169
168
|
} catch (r) {
|
|
170
169
|
console.debug("[LocalStorage] GET error: ", r);
|
|
171
170
|
return;
|
|
@@ -177,17 +176,17 @@ const _ = "builderSessionId", de = async ({
|
|
|
177
176
|
}) => {
|
|
178
177
|
var r;
|
|
179
178
|
try {
|
|
180
|
-
t && ((r =
|
|
179
|
+
t && ((r = _()) == null || r.setItem(e, n));
|
|
181
180
|
} catch (o) {
|
|
182
181
|
console.debug("[LocalStorage] SET error: ", o);
|
|
183
182
|
}
|
|
184
|
-
},
|
|
183
|
+
}, W = "builderVisitorId", pe = ({
|
|
185
184
|
canTrack: e
|
|
186
185
|
}) => {
|
|
187
186
|
if (!e)
|
|
188
187
|
return;
|
|
189
188
|
const t = he({
|
|
190
|
-
key:
|
|
189
|
+
key: W,
|
|
191
190
|
canTrack: e
|
|
192
191
|
});
|
|
193
192
|
if (m(t))
|
|
@@ -199,21 +198,21 @@ const _ = "builderSessionId", de = async ({
|
|
|
199
198
|
canTrack: e
|
|
200
199
|
}), n;
|
|
201
200
|
}
|
|
202
|
-
}, me = () =>
|
|
201
|
+
}, me = () => D(), ye = ({
|
|
203
202
|
id: e,
|
|
204
203
|
canTrack: t
|
|
205
204
|
}) => ge({
|
|
206
|
-
key:
|
|
205
|
+
key: W,
|
|
207
206
|
value: e,
|
|
208
207
|
canTrack: t
|
|
209
|
-
}),
|
|
208
|
+
}), Se = () => {
|
|
210
209
|
if (c()) {
|
|
211
210
|
const e = new URL(location.href);
|
|
212
211
|
return e.pathname === "" && (e.pathname = "/"), e;
|
|
213
212
|
} else
|
|
214
213
|
return console.warn("Cannot get location for tracking in non-browser environment"), null;
|
|
215
|
-
},
|
|
216
|
-
const e =
|
|
214
|
+
}, we = () => typeof navigator == "object" && navigator.userAgent || "", be = () => {
|
|
215
|
+
const e = we(), t = {
|
|
217
216
|
Android() {
|
|
218
217
|
return e.match(/Android/i);
|
|
219
218
|
},
|
|
@@ -230,15 +229,15 @@ const _ = "builderSessionId", de = async ({
|
|
|
230
229
|
return e.match(/IEMobile/i) || e.match(/WPDesktop/i);
|
|
231
230
|
},
|
|
232
231
|
any() {
|
|
233
|
-
return t.Android() || t.BlackBerry() || t.iOS() || t.Opera() || t.Windows() ||
|
|
232
|
+
return t.Android() || t.BlackBerry() || t.iOS() || t.Opera() || t.Windows() || I === "reactNative";
|
|
234
233
|
}
|
|
235
|
-
}, n = e.match(/Tablet|iPad/i), r =
|
|
234
|
+
}, n = e.match(/Tablet|iPad/i), r = Se();
|
|
236
235
|
return {
|
|
237
236
|
urlPath: r == null ? void 0 : r.pathname,
|
|
238
237
|
host: (r == null ? void 0 : r.host) || (r == null ? void 0 : r.hostname),
|
|
239
238
|
device: n ? "tablet" : t.any() ? "mobile" : "desktop"
|
|
240
239
|
};
|
|
241
|
-
},
|
|
240
|
+
}, ve = async ({
|
|
242
241
|
canTrack: e
|
|
243
242
|
}) => {
|
|
244
243
|
if (!e)
|
|
@@ -255,7 +254,7 @@ const _ = "builderSessionId", de = async ({
|
|
|
255
254
|
sessionId: t,
|
|
256
255
|
visitorId: n
|
|
257
256
|
};
|
|
258
|
-
},
|
|
257
|
+
}, Ie = async ({
|
|
259
258
|
type: e,
|
|
260
259
|
canTrack: t,
|
|
261
260
|
apiKey: n,
|
|
@@ -269,7 +268,7 @@ const _ = "builderSessionId", de = async ({
|
|
|
269
268
|
url: location.href,
|
|
270
269
|
...r
|
|
271
270
|
},
|
|
272
|
-
...await
|
|
271
|
+
...await ve({
|
|
273
272
|
canTrack: t
|
|
274
273
|
}),
|
|
275
274
|
userAttributes: be(),
|
|
@@ -281,11 +280,11 @@ async function ke(e) {
|
|
|
281
280
|
f.error("Missing API key for track call. Please provide your API key.");
|
|
282
281
|
return;
|
|
283
282
|
}
|
|
284
|
-
if (e.canTrack && !
|
|
283
|
+
if (e.canTrack && !Q() && (c() || I === "reactNative"))
|
|
285
284
|
return fetch("https://cdn.builder.io/api/v1/track", {
|
|
286
285
|
method: "POST",
|
|
287
286
|
body: JSON.stringify({
|
|
288
|
-
events: [await
|
|
287
|
+
events: [await Ie(e)]
|
|
289
288
|
}),
|
|
290
289
|
headers: {
|
|
291
290
|
"content-type": "application/json"
|
|
@@ -295,15 +294,15 @@ async function ke(e) {
|
|
|
295
294
|
console.error("Failed to track: ", t);
|
|
296
295
|
});
|
|
297
296
|
}
|
|
298
|
-
const
|
|
297
|
+
const Je = (e) => ke({
|
|
299
298
|
...e,
|
|
300
299
|
canTrack: !0
|
|
301
300
|
}), Ee = ["*.beta.builder.io", "beta.builder.io", "builder.io", "localhost", "qa.builder.io"];
|
|
302
|
-
function
|
|
301
|
+
function $(e, t) {
|
|
303
302
|
const n = new URL(t.origin), r = n.hostname;
|
|
304
303
|
return (e || Ee).findIndex((o) => o.startsWith("*.") ? r.endsWith(o.slice(1)) : o === r) > -1;
|
|
305
304
|
}
|
|
306
|
-
const Pe = "1.0.
|
|
305
|
+
const Pe = "1.0.23", He = () => {
|
|
307
306
|
ne("insertMenu", {
|
|
308
307
|
name: "_default",
|
|
309
308
|
default: !0,
|
|
@@ -332,7 +331,7 @@ const Ce = (e = {}) => {
|
|
|
332
331
|
R || (R = !0, c() && ((t = window.parent) == null || t.postMessage({
|
|
333
332
|
type: "builder.sdkInfo",
|
|
334
333
|
data: {
|
|
335
|
-
target:
|
|
334
|
+
target: I,
|
|
336
335
|
version: Pe,
|
|
337
336
|
supportsPatchUpdates: !1,
|
|
338
337
|
// Supports builder-model="..." attribute which is needed to
|
|
@@ -347,7 +346,7 @@ const Ce = (e = {}) => {
|
|
|
347
346
|
}
|
|
348
347
|
}, "*"), window.addEventListener("message", (r) => {
|
|
349
348
|
var s, a;
|
|
350
|
-
if (
|
|
349
|
+
if (!$(e.trustedHosts, r))
|
|
351
350
|
return;
|
|
352
351
|
const {
|
|
353
352
|
data: o
|
|
@@ -369,8 +368,8 @@ const Ce = (e = {}) => {
|
|
|
369
368
|
error: h.message
|
|
370
369
|
}
|
|
371
370
|
}, "*") : u && typeof u.then == "function" ? u.then((g) => {
|
|
372
|
-
var
|
|
373
|
-
(
|
|
371
|
+
var S;
|
|
372
|
+
(S = window.parent) == null || S.postMessage({
|
|
374
373
|
type: "builder.evaluateResult",
|
|
375
374
|
data: {
|
|
376
375
|
id: p,
|
|
@@ -393,7 +392,7 @@ const Ce = (e = {}) => {
|
|
|
393
392
|
trustedHosts: t,
|
|
394
393
|
callbacks: n
|
|
395
394
|
}) => (r) => {
|
|
396
|
-
if (
|
|
395
|
+
if (!$(t, r))
|
|
397
396
|
return;
|
|
398
397
|
const {
|
|
399
398
|
data: o
|
|
@@ -435,22 +434,22 @@ const Ce = (e = {}) => {
|
|
|
435
434
|
};
|
|
436
435
|
}, xe = "builder.tests", E = (e) => `${xe}.${e}`, Ae = ({
|
|
437
436
|
contentId: e
|
|
438
|
-
}) =>
|
|
437
|
+
}) => F({
|
|
439
438
|
name: E(e),
|
|
440
439
|
canTrack: !0
|
|
441
440
|
}), Te = ({
|
|
442
441
|
contentId: e
|
|
443
|
-
}) =>
|
|
442
|
+
}) => N({
|
|
444
443
|
name: E(e),
|
|
445
444
|
canTrack: !0
|
|
446
445
|
}), Re = ({
|
|
447
446
|
contentId: e,
|
|
448
447
|
value: t
|
|
449
|
-
}) =>
|
|
448
|
+
}) => j({
|
|
450
449
|
name: E(e),
|
|
451
450
|
value: t,
|
|
452
451
|
canTrack: !0
|
|
453
|
-
}),
|
|
452
|
+
}), G = (e) => m(e.id) && m(e.variations) && Object.keys(e.variations).length > 0, Be = ({
|
|
454
453
|
id: e,
|
|
455
454
|
variations: t
|
|
456
455
|
}) => {
|
|
@@ -471,7 +470,7 @@ const Ce = (e = {}) => {
|
|
|
471
470
|
}).catch((n) => {
|
|
472
471
|
f.error("could not store A/B test variation: ", n);
|
|
473
472
|
}), t;
|
|
474
|
-
},
|
|
473
|
+
}, J = ({
|
|
475
474
|
item: e,
|
|
476
475
|
testGroupId: t
|
|
477
476
|
}) => {
|
|
@@ -493,14 +492,14 @@ const Ce = (e = {}) => {
|
|
|
493
492
|
return e;
|
|
494
493
|
if (!e)
|
|
495
494
|
return;
|
|
496
|
-
if (!
|
|
495
|
+
if (!G(e))
|
|
497
496
|
return e;
|
|
498
497
|
const n = Te({
|
|
499
498
|
contentId: e.id
|
|
500
499
|
}) || z({
|
|
501
500
|
variations: e.variations,
|
|
502
501
|
id: e.id
|
|
503
|
-
}), r =
|
|
502
|
+
}), r = J({
|
|
504
503
|
item: e,
|
|
505
504
|
testGroupId: n
|
|
506
505
|
});
|
|
@@ -512,14 +511,14 @@ const Ce = (e = {}) => {
|
|
|
512
511
|
item: e,
|
|
513
512
|
canTrack: t
|
|
514
513
|
}) => {
|
|
515
|
-
if (!t || !
|
|
514
|
+
if (!t || !G(e))
|
|
516
515
|
return e;
|
|
517
516
|
const r = await Ae({
|
|
518
517
|
contentId: e.id
|
|
519
518
|
}) || z({
|
|
520
519
|
variations: e.variations,
|
|
521
520
|
id: e.id
|
|
522
|
-
}), o =
|
|
521
|
+
}), o = J({
|
|
523
522
|
item: e,
|
|
524
523
|
testGroupId: r
|
|
525
524
|
});
|
|
@@ -539,12 +538,12 @@ function Me() {
|
|
|
539
538
|
return e;
|
|
540
539
|
}
|
|
541
540
|
const Ne = Me();
|
|
542
|
-
function
|
|
541
|
+
function v(e, t = null, n = ".") {
|
|
543
542
|
return Object.keys(e).reduce((r, o) => {
|
|
544
543
|
const s = e[o], a = [t, o].filter(Boolean).join(n);
|
|
545
544
|
return [typeof s == "object", s !== null, !(Array.isArray(s) && s.length === 0)].every(Boolean) ? {
|
|
546
545
|
...r,
|
|
547
|
-
...
|
|
546
|
+
...v(s, a, n)
|
|
548
547
|
} : {
|
|
549
548
|
...r,
|
|
550
549
|
[a]: s
|
|
@@ -566,33 +565,33 @@ const Fe = "v3", B = (e) => typeof e == "number" && !isNaN(e) && e >= 0, P = (e)
|
|
|
566
565
|
offset: u,
|
|
567
566
|
cacheSeconds: h,
|
|
568
567
|
staleCacheSeconds: g,
|
|
569
|
-
sort:
|
|
568
|
+
sort: S,
|
|
570
569
|
includeUnpublished: C
|
|
571
570
|
} = e;
|
|
572
571
|
if (!s)
|
|
573
572
|
throw new Error("Missing API key");
|
|
574
573
|
if (!["v3"].includes(y))
|
|
575
574
|
throw new Error(`Invalid apiVersion: expected 'v3', received '${y}'`);
|
|
576
|
-
const
|
|
577
|
-
if (i.searchParams.set("apiKey", s), i.searchParams.set("limit", String(t)), i.searchParams.set("noTraverse", String(
|
|
578
|
-
const l =
|
|
579
|
-
sort:
|
|
575
|
+
const H = t !== 1, i = new URL(`https://cdn.builder.io/api/${y}/content/${o}`);
|
|
576
|
+
if (i.searchParams.set("apiKey", s), i.searchParams.set("limit", String(t)), i.searchParams.set("noTraverse", String(H)), i.searchParams.set("includeRefs", String(!0)), d && i.searchParams.set("locale", d), a && i.searchParams.set("enrich", String(a)), i.searchParams.set("omit", k || "meta.componentsUsed"), p && i.searchParams.set("fields", p), Number.isFinite(u) && u > -1 && i.searchParams.set("offset", String(Math.floor(u))), typeof C == "boolean" && i.searchParams.set("includeUnpublished", String(C)), h && B(h) && i.searchParams.set("cacheSeconds", String(h)), g && B(g) && i.searchParams.set("staleCacheSeconds", String(g)), S) {
|
|
577
|
+
const l = v({
|
|
578
|
+
sort: S
|
|
580
579
|
});
|
|
581
|
-
for (const
|
|
582
|
-
i.searchParams.set(
|
|
580
|
+
for (const w in l)
|
|
581
|
+
i.searchParams.set(w, JSON.stringify(l[w]));
|
|
583
582
|
}
|
|
584
|
-
const
|
|
583
|
+
const X = {
|
|
585
584
|
...oe(),
|
|
586
585
|
...L(e.options || {})
|
|
587
|
-
}, O =
|
|
586
|
+
}, O = v(X);
|
|
588
587
|
for (const l in O)
|
|
589
588
|
i.searchParams.set(l, String(O[l]));
|
|
590
589
|
if (n && i.searchParams.set("userAttributes", JSON.stringify(n)), r) {
|
|
591
|
-
const l =
|
|
590
|
+
const l = v({
|
|
592
591
|
query: r
|
|
593
592
|
});
|
|
594
|
-
for (const
|
|
595
|
-
i.searchParams.set(
|
|
593
|
+
for (const w in l)
|
|
594
|
+
i.searchParams.set(w, JSON.stringify(l[w]));
|
|
596
595
|
}
|
|
597
596
|
return i;
|
|
598
597
|
}, je = (e) => "results" in e;
|
|
@@ -609,7 +608,7 @@ const Ke = async (e) => {
|
|
|
609
608
|
return await (await ((s = e.fetch) != null ? s : Ne)(t.href, e.fetchOptions)).json();
|
|
610
609
|
}, _e = async (e, t, n = P(e)) => {
|
|
611
610
|
const r = Ve(e.canTrack);
|
|
612
|
-
if (n.search.includes("preview="), !r || !(c() ||
|
|
611
|
+
if (n.search.includes("preview="), !r || !(c() || I === "reactNative"))
|
|
613
612
|
return t.results;
|
|
614
613
|
try {
|
|
615
614
|
const o = [];
|
|
@@ -648,7 +647,7 @@ const Ye = async (e) => {
|
|
|
648
647
|
urlPath: t
|
|
649
648
|
} : {}
|
|
650
649
|
},
|
|
651
|
-
options:
|
|
650
|
+
options: M(e.searchParams || ((s = e.url) == null ? void 0 : s.searchParams) || e.options)
|
|
652
651
|
};
|
|
653
652
|
return {
|
|
654
653
|
apiKey: n.apiKey,
|
|
@@ -657,30 +656,30 @@ const Ye = async (e) => {
|
|
|
657
656
|
};
|
|
658
657
|
};
|
|
659
658
|
export {
|
|
660
|
-
|
|
659
|
+
I as TARGET,
|
|
661
660
|
_e as _processContentResult,
|
|
662
661
|
ke as _track,
|
|
663
662
|
m as checkIsDefined,
|
|
664
663
|
Oe as createEditorListener,
|
|
665
664
|
Ge as createRegisterComponentMessage,
|
|
666
|
-
|
|
665
|
+
U as fastClone,
|
|
667
666
|
Ne as fetch,
|
|
668
667
|
Ye as fetchBuilderProps,
|
|
669
668
|
We as fetchEntries,
|
|
670
669
|
De as fetchOneEntry,
|
|
671
|
-
|
|
670
|
+
M as getBuilderSearchParams,
|
|
672
671
|
Ve as getDefaultCanTrack,
|
|
673
672
|
be as getUserAttributes,
|
|
674
673
|
qe as handleABTestingSync,
|
|
675
674
|
c as isBrowser,
|
|
676
|
-
|
|
675
|
+
Q as isEditing,
|
|
677
676
|
$e as isPreviewing,
|
|
678
677
|
f as logger,
|
|
679
678
|
ne as register,
|
|
680
679
|
He as registerInsertMenu,
|
|
681
680
|
te as serializeComponentInfo,
|
|
682
|
-
|
|
681
|
+
ze as setEditorSettings,
|
|
683
682
|
Ce as setupBrowserForEditing,
|
|
684
683
|
Xe as subscribeToEditor,
|
|
685
|
-
|
|
684
|
+
Je as track
|
|
686
685
|
};
|
|
@@ -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-c4b7844d.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-e1e18fd2.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 i=require("react/jsx-runtime"),o=require("./blocks-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),o=require("./blocks-5539f58f.cjs");require("react");require("./blocks-exports.cjs");require("./server-entry-c4b7844d.cjs");require("./get-class-prop-name-7b951501.cjs");require("./dynamic-renderer-b29b45ca.cjs");function u(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(o.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=u;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { Blocks as l } from "./blocks-
|
|
2
|
+
import { Blocks as l } from "./blocks-93608689.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "./blocks-exports.mjs";
|
|
5
|
-
import "./server-entry-
|
|
6
|
-
import "./get-class-prop-name-
|
|
5
|
+
import "./server-entry-e1e18fd2.js";
|
|
6
|
+
import "./get-class-prop-name-e85bf7a3.js";
|
|
7
7
|
import "./dynamic-renderer-8b343325.js";
|
|
8
8
|
function c(t) {
|
|
9
9
|
var e, o, n;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import { useState as y, useEffect as l } from "react";
|
|
3
3
|
import { Content as s } from "./blocks-exports.mjs";
|
|
4
|
-
import { getClassPropName as b } from "./get-class-prop-name-
|
|
5
|
-
import { fetchOneEntry as C, logger as v } from "./server-entry-
|
|
4
|
+
import { getClassPropName as b } from "./get-class-prop-name-e85bf7a3.js";
|
|
5
|
+
import { fetchOneEntry as C, logger as v } from "./server-entry-e1e18fd2.js";
|
|
6
6
|
const h = async ({
|
|
7
7
|
builderContextValue: t,
|
|
8
8
|
symbol: e
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),o=require("react"),b=require("./blocks-exports.cjs"),f=require("./get-class-prop-name-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),o=require("react"),b=require("./blocks-exports.cjs"),f=require("./get-class-prop-name-7b951501.cjs"),s=require("./server-entry-c4b7844d.cjs"),v=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return s.fetchOneEntry({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(i=>{s.logger.error("Could not fetch symbol content: ",i)})};function C(e){var r,c,a,d;function t(){var n,l;return[e.attributes[f.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,m]=o.useState(()=>{var n;return(n=e.symbol)==null?void 0:n.content});function y(){i||v({symbol:e.symbol,builderContextValue:e.builderContext}).then(n=>{n&&m(n)})}return o.useEffect(()=>{},[]),o.useEffect(()=>{y()},[e.symbol]),u.jsx("div",{...e.attributes,className:t(),children:u.jsx(b.Content,{isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(r=e.builderBlock)==null?void 0:r.id},customComponents:Object.values(e.builderComponents),data:{...(c=e.symbol)==null?void 0:c.data,...e.builderContext.localState,...(a=i==null?void 0:i.data)==null?void 0:a.state},model:(d=e.symbol)==null?void 0:d.model,content:i,linkComponent:e.builderLinkComponent,blocksWrapper:"div",contentWrapper:"div"})})}exports.default=C;
|