@builder.io/sdk-react-nextjs 0.7.4 → 0.7.6
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/{node/USE_CLIENT_BUNDLE-539be307.cjs → browser/USE_CLIENT_BUNDLE-0a0cc62f.cjs} +1 -1
- package/lib/browser/{USE_CLIENT_BUNDLE-6b3887b7.js → USE_CLIENT_BUNDLE-a7787106.js} +2 -2
- package/lib/{edge/USE_SERVER_BUNDLE-2c9d1a5d.js → browser/USE_SERVER_BUNDLE-05ea12e2.js} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-e5ab43ec.cjs → browser/USE_SERVER_BUNDLE-73128060.cjs} +1 -1
- package/lib/browser/{bundle-fc3e7377.js → bundle-bf220619.js} +140 -140
- package/lib/browser/{bundle-df55c296.cjs → bundle-d14f38c0.cjs} +13 -13
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +3 -3
- package/lib/{browser/USE_CLIENT_BUNDLE-f95a196a.cjs → edge/USE_CLIENT_BUNDLE-2b470811.cjs} +1 -1
- package/lib/{node/USE_CLIENT_BUNDLE-a5c6399c.js → edge/USE_CLIENT_BUNDLE-b3aaa944.js} +2 -2
- package/lib/{node/USE_SERVER_BUNDLE-7f4ba7e9.cjs → edge/USE_SERVER_BUNDLE-b3b4afa9.cjs} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-21bf3ffc.js → edge/USE_SERVER_BUNDLE-f39207f2.js} +1 -1
- package/lib/edge/{bundle-38f08fa1.cjs → bundle-2a7da030.cjs} +14 -14
- package/lib/edge/{bundle-bef73246.js → bundle-bca2cd58.js} +262 -262
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +3 -3
- package/lib/{edge/USE_CLIENT_BUNDLE-a32e462e.js → node/USE_CLIENT_BUNDLE-955f9345.js} +2 -2
- package/lib/{edge/USE_CLIENT_BUNDLE-44225d7a.cjs → node/USE_CLIENT_BUNDLE-a8082119.cjs} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-eed7792a.cjs → node/USE_SERVER_BUNDLE-136e4ed6.cjs} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-b314d0f7.js → node/USE_SERVER_BUNDLE-ac2a6bf7.js} +1 -1
- package/lib/node/{bundle-74479d5d.js → bundle-b06f63f6.js} +80 -80
- package/lib/node/{bundle-f7863fb3.cjs → bundle-f16e2dbd.cjs} +8 -8
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/package.json +1 -1
- package/types/cjs/components/content/content.helpers.d.ts +1 -1
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/esm/components/content/content.helpers.d.ts +1 -1
- package/types/esm/constants/sdk-version.d.ts +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LRUCache as Be } from "lru-cache";
|
|
2
|
-
import { jsx as l, Fragment as
|
|
2
|
+
import { jsx as l, Fragment as y, jsxs as w } from "react/jsx-runtime";
|
|
3
3
|
import { createElement as Pe } from "react";
|
|
4
|
-
import { I as $e, B as Y, a as Oe, b as Fe, C as We, E as Ne, F as _e, c as Le, d as Ue, S as Me, V as De, e as je } from "./USE_CLIENT_BUNDLE-
|
|
4
|
+
import { I as $e, B as Y, a as Oe, b as Fe, C as We, E as Ne, F as _e, c as Le, d as Ue, S as Me, V as De, e as je } from "./USE_CLIENT_BUNDLE-a7787106.js";
|
|
5
5
|
import "next/navigation";
|
|
6
6
|
function Ke(e) {
|
|
7
7
|
var t;
|
|
@@ -20,18 +20,18 @@ const V = "[Builder.io]: ", k = {
|
|
|
20
20
|
warn: (...e) => console.warn(V, ...e),
|
|
21
21
|
debug: (...e) => console.debug(V, ...e)
|
|
22
22
|
};
|
|
23
|
-
function
|
|
23
|
+
function S() {
|
|
24
24
|
return typeof window < "u" && typeof document < "u";
|
|
25
25
|
}
|
|
26
26
|
const T = "rsc";
|
|
27
27
|
function He() {
|
|
28
|
-
return
|
|
28
|
+
return S() && window.self !== window.top;
|
|
29
29
|
}
|
|
30
30
|
function D() {
|
|
31
31
|
return He() && window.location.search.indexOf("builder.frameEditing=") !== -1;
|
|
32
32
|
}
|
|
33
33
|
const ze = () => {
|
|
34
|
-
if (
|
|
34
|
+
if (S()) {
|
|
35
35
|
const e = new URL(location.href);
|
|
36
36
|
return e.pathname === "" && (e.pathname = "/"), e;
|
|
37
37
|
} else
|
|
@@ -76,8 +76,8 @@ const ze = () => {
|
|
|
76
76
|
event: n
|
|
77
77
|
}), Ye = () => ({
|
|
78
78
|
isEditing: D(),
|
|
79
|
-
isBrowser:
|
|
80
|
-
isServer: !
|
|
79
|
+
isBrowser: S(),
|
|
80
|
+
isServer: !S(),
|
|
81
81
|
getUserAttributes: () => de()
|
|
82
82
|
}), Je = (e, {
|
|
83
83
|
isExpression: t = !0
|
|
@@ -110,7 +110,7 @@ function Qe(e, t, n) {
|
|
|
110
110
|
}
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
|
-
const Xe = (e) => (
|
|
113
|
+
const Xe = (e) => (S(), J(e));
|
|
114
114
|
function j({
|
|
115
115
|
code: e,
|
|
116
116
|
context: t,
|
|
@@ -169,14 +169,14 @@ const et = ({
|
|
|
169
169
|
}
|
|
170
170
|
};
|
|
171
171
|
for (const s in e.bindings) {
|
|
172
|
-
const c = e.bindings[s],
|
|
172
|
+
const c = e.bindings[s], m = j({
|
|
173
173
|
code: c,
|
|
174
174
|
localState: n,
|
|
175
175
|
rootState: o,
|
|
176
176
|
rootSetState: i,
|
|
177
177
|
context: t
|
|
178
178
|
});
|
|
179
|
-
Ze(r, s,
|
|
179
|
+
Ze(r, s, m);
|
|
180
180
|
}
|
|
181
181
|
return r;
|
|
182
182
|
};
|
|
@@ -239,15 +239,15 @@ const tt = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen"
|
|
|
239
239
|
if (!Array.isArray(i))
|
|
240
240
|
return;
|
|
241
241
|
const a = n.collection.split(".").pop(), r = n.itemName || (a ? a + "Item" : "item");
|
|
242
|
-
return i.map((c,
|
|
242
|
+
return i.map((c, m) => ({
|
|
243
243
|
context: {
|
|
244
244
|
...t,
|
|
245
245
|
localState: {
|
|
246
246
|
...t.localState,
|
|
247
|
-
$index:
|
|
247
|
+
$index: m,
|
|
248
248
|
$item: c,
|
|
249
249
|
[r]: c,
|
|
250
|
-
[`$${r}Index`]:
|
|
250
|
+
[`$${r}Index`]: m
|
|
251
251
|
}
|
|
252
252
|
},
|
|
253
253
|
block: o
|
|
@@ -335,30 +335,30 @@ function K(e) {
|
|
|
335
335
|
shouldEvaluateBindings: !0
|
|
336
336
|
}), a = i.responsiveStyles, r = e.context.content, s = me(
|
|
337
337
|
((d = r == null ? void 0 : r.meta) == null ? void 0 : d.breakpoints) || {}
|
|
338
|
-
), c = a == null ? void 0 : a.large,
|
|
338
|
+
), c = a == null ? void 0 : a.large, m = a == null ? void 0 : a.medium, h = a == null ? void 0 : a.small, g = i.id;
|
|
339
339
|
if (!g)
|
|
340
340
|
return "";
|
|
341
|
-
const
|
|
341
|
+
const v = c ? _({
|
|
342
342
|
className: g,
|
|
343
343
|
styles: c
|
|
344
|
-
}) : "",
|
|
344
|
+
}) : "", u = m ? _({
|
|
345
345
|
className: g,
|
|
346
|
-
styles:
|
|
346
|
+
styles: m,
|
|
347
347
|
mediaQuery: Q(
|
|
348
348
|
"medium",
|
|
349
349
|
s
|
|
350
350
|
)
|
|
351
|
-
}) : "",
|
|
351
|
+
}) : "", f = h ? _({
|
|
352
352
|
className: g,
|
|
353
|
-
styles:
|
|
353
|
+
styles: h,
|
|
354
354
|
mediaQuery: Q(
|
|
355
355
|
"small",
|
|
356
356
|
s
|
|
357
357
|
)
|
|
358
358
|
}) : "";
|
|
359
|
-
return [
|
|
359
|
+
return [v, u, f].join(" ");
|
|
360
360
|
};
|
|
361
|
-
return /* @__PURE__ */ l(
|
|
361
|
+
return /* @__PURE__ */ l(y, { children: n() && t() ? /* @__PURE__ */ l(y, { children: /* @__PURE__ */ l(F, { styles: n() }) }) : null });
|
|
362
362
|
}
|
|
363
363
|
function rt(e) {
|
|
364
364
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
@@ -456,7 +456,7 @@ const ft = ({
|
|
|
456
456
|
function X(e) {
|
|
457
457
|
var n, o;
|
|
458
458
|
const t = e.isInteractive ? $e : e.componentRef;
|
|
459
|
-
return /* @__PURE__ */ l(
|
|
459
|
+
return /* @__PURE__ */ l(y, { children: e.componentRef ? /* @__PURE__ */ l(y, { children: /* @__PURE__ */ w(
|
|
460
460
|
t,
|
|
461
461
|
{
|
|
462
462
|
...ft({
|
|
@@ -502,7 +502,7 @@ function ht(e) {
|
|
|
502
502
|
);
|
|
503
503
|
}
|
|
504
504
|
function W(e) {
|
|
505
|
-
var
|
|
505
|
+
var m, h, g, v;
|
|
506
506
|
const t = function() {
|
|
507
507
|
return nt({
|
|
508
508
|
block: e.block,
|
|
@@ -515,7 +515,8 @@ function W(e) {
|
|
|
515
515
|
context: e.context
|
|
516
516
|
});
|
|
517
517
|
}, o = function() {
|
|
518
|
-
|
|
518
|
+
var f;
|
|
519
|
+
return (f = e.block.repeat) != null && f.collection ? e.block : $({
|
|
519
520
|
block: e.block,
|
|
520
521
|
localState: e.context.localState,
|
|
521
522
|
rootState: e.context.rootState,
|
|
@@ -526,30 +527,34 @@ function W(e) {
|
|
|
526
527
|
}, i = function() {
|
|
527
528
|
return e.block.tagName || "div";
|
|
528
529
|
}, a = function() {
|
|
529
|
-
|
|
530
|
+
var b, x;
|
|
531
|
+
if ((b = e.block.repeat) != null && b.collection)
|
|
532
|
+
return !!((x = n()) != null && x.length);
|
|
533
|
+
const f = "hide" in o() ? o().hide : !1;
|
|
534
|
+
return ("show" in o() ? o().show : !0) && !f;
|
|
530
535
|
}, r = function() {
|
|
531
536
|
var d;
|
|
532
537
|
return !((d = t()) != null && d.component) && !n() ? o().children ?? [] : [];
|
|
533
538
|
}, s = function() {
|
|
534
|
-
var
|
|
539
|
+
var f, d, b, x, p;
|
|
535
540
|
return {
|
|
536
541
|
blockChildren: o().children ?? [],
|
|
537
|
-
componentRef: (
|
|
542
|
+
componentRef: (f = t()) == null ? void 0 : f.component,
|
|
538
543
|
componentOptions: {
|
|
539
544
|
...Ke(o()),
|
|
540
545
|
builderContext: e.context,
|
|
541
|
-
...((d = t()) == null ? void 0 : d.name) === "Symbol" || ((
|
|
546
|
+
...((d = t()) == null ? void 0 : d.name) === "Symbol" || ((b = t()) == null ? void 0 : b.name) === "Columns" ? {
|
|
542
547
|
builderComponents: e.registeredComponents
|
|
543
548
|
} : {}
|
|
544
549
|
},
|
|
545
550
|
context: c,
|
|
546
551
|
registeredComponents: e.registeredComponents,
|
|
547
552
|
builderBlock: o(),
|
|
548
|
-
includeBlockProps: ((
|
|
553
|
+
includeBlockProps: ((x = t()) == null ? void 0 : x.noWrap) === !0,
|
|
549
554
|
isInteractive: !((p = t()) != null && p.isRSC)
|
|
550
555
|
};
|
|
551
556
|
}, c = e.context;
|
|
552
|
-
return /* @__PURE__ */ l(
|
|
557
|
+
return /* @__PURE__ */ l(y, { children: a() ? /* @__PURE__ */ l(y, { children: (m = t()) != null && m.noWrap ? /* @__PURE__ */ l(y, { children: /* @__PURE__ */ l(
|
|
553
558
|
X,
|
|
554
559
|
{
|
|
555
560
|
componentRef: s().componentRef,
|
|
@@ -561,8 +566,8 @@ function W(e) {
|
|
|
561
566
|
includeBlockProps: s().includeBlockProps,
|
|
562
567
|
isInteractive: s().isInteractive
|
|
563
568
|
}
|
|
564
|
-
) }) : /* @__PURE__ */ w(
|
|
565
|
-
N(i()) ? /* @__PURE__ */ l(
|
|
569
|
+
) }) : /* @__PURE__ */ w(y, { children: [
|
|
570
|
+
N(i()) ? /* @__PURE__ */ l(y, { children: /* @__PURE__ */ l(
|
|
566
571
|
Y,
|
|
567
572
|
{
|
|
568
573
|
Wrapper: i(),
|
|
@@ -571,16 +576,16 @@ function W(e) {
|
|
|
571
576
|
hasChildren: !1
|
|
572
577
|
}
|
|
573
578
|
) }) : null,
|
|
574
|
-
!N(i()) && n() ? /* @__PURE__ */ l(
|
|
579
|
+
!N(i()) && n() ? /* @__PURE__ */ l(y, { children: (h = n()) == null ? void 0 : h.map((u, f) => /* @__PURE__ */ l(
|
|
575
580
|
ht,
|
|
576
581
|
{
|
|
577
|
-
repeatContext:
|
|
578
|
-
block:
|
|
582
|
+
repeatContext: u.context,
|
|
583
|
+
block: u.block,
|
|
579
584
|
registeredComponents: e.registeredComponents
|
|
580
585
|
},
|
|
581
|
-
|
|
586
|
+
f
|
|
582
587
|
)) }) : null,
|
|
583
|
-
!N(i()) && !n() ? /* @__PURE__ */ l(
|
|
588
|
+
!N(i()) && !n() ? /* @__PURE__ */ l(y, { children: /* @__PURE__ */ w(
|
|
584
589
|
Y,
|
|
585
590
|
{
|
|
586
591
|
Wrapper: i(),
|
|
@@ -601,22 +606,22 @@ function W(e) {
|
|
|
601
606
|
isInteractive: s().isInteractive
|
|
602
607
|
}
|
|
603
608
|
),
|
|
604
|
-
(g = r()) == null ? void 0 : g.map((
|
|
609
|
+
(g = r()) == null ? void 0 : g.map((u) => /* @__PURE__ */ l(
|
|
605
610
|
W,
|
|
606
611
|
{
|
|
607
|
-
block:
|
|
612
|
+
block: u,
|
|
608
613
|
context: c,
|
|
609
614
|
registeredComponents: e.registeredComponents
|
|
610
615
|
},
|
|
611
|
-
"block-" +
|
|
616
|
+
"block-" + u.id
|
|
612
617
|
)),
|
|
613
|
-
(
|
|
618
|
+
(v = r()) == null ? void 0 : v.map((u) => /* @__PURE__ */ l(
|
|
614
619
|
K,
|
|
615
620
|
{
|
|
616
|
-
block:
|
|
621
|
+
block: u,
|
|
617
622
|
context: c
|
|
618
623
|
},
|
|
619
|
-
"block-style-" +
|
|
624
|
+
"block-style-" + u.id
|
|
620
625
|
))
|
|
621
626
|
]
|
|
622
627
|
}
|
|
@@ -633,7 +638,7 @@ function H(e) {
|
|
|
633
638
|
path: e.path,
|
|
634
639
|
styleProp: e.styleProp,
|
|
635
640
|
children: [
|
|
636
|
-
e.blocks ? /* @__PURE__ */ l(
|
|
641
|
+
e.blocks ? /* @__PURE__ */ l(y, { children: (t = e.blocks) == null ? void 0 : t.map((o) => /* @__PURE__ */ l(
|
|
637
642
|
W,
|
|
638
643
|
{
|
|
639
644
|
block: o,
|
|
@@ -642,7 +647,7 @@ function H(e) {
|
|
|
642
647
|
},
|
|
643
648
|
"render-block-" + o.id
|
|
644
649
|
)) }) : null,
|
|
645
|
-
e.blocks ? /* @__PURE__ */ l(
|
|
650
|
+
e.blocks ? /* @__PURE__ */ l(y, { children: (n = e.blocks) == null ? void 0 : n.map((o) => /* @__PURE__ */ l(
|
|
646
651
|
K,
|
|
647
652
|
{
|
|
648
653
|
block: o,
|
|
@@ -655,24 +660,24 @@ function H(e) {
|
|
|
655
660
|
);
|
|
656
661
|
}
|
|
657
662
|
function gt(e) {
|
|
658
|
-
var
|
|
663
|
+
var u;
|
|
659
664
|
const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet", i = function(d) {
|
|
660
|
-
var
|
|
661
|
-
return ((
|
|
665
|
+
var b;
|
|
666
|
+
return ((b = n[d]) == null ? void 0 : b.width) || 100 / n.length;
|
|
662
667
|
}, a = function(d) {
|
|
663
|
-
const
|
|
664
|
-
return `calc(${i(d)}% - ${
|
|
668
|
+
const b = t * (n.length - 1) / n.length;
|
|
669
|
+
return `calc(${i(d)}% - ${b}px)`;
|
|
665
670
|
}, r = function({
|
|
666
671
|
stackedStyle: d,
|
|
667
|
-
desktopStyle:
|
|
672
|
+
desktopStyle: b
|
|
668
673
|
}) {
|
|
669
|
-
return o === "tablet" ? d :
|
|
674
|
+
return o === "tablet" ? d : b;
|
|
670
675
|
}, s = function({
|
|
671
676
|
stackedStyle: d,
|
|
672
|
-
desktopStyle:
|
|
677
|
+
desktopStyle: b
|
|
673
678
|
}) {
|
|
674
|
-
return o === "never" ?
|
|
675
|
-
}, c = e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column",
|
|
679
|
+
return o === "never" ? b : d;
|
|
680
|
+
}, c = e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column", m = function() {
|
|
676
681
|
return {
|
|
677
682
|
"--flex-dir": c,
|
|
678
683
|
"--flex-dir-tablet": r({
|
|
@@ -680,14 +685,14 @@ function gt(e) {
|
|
|
680
685
|
desktopStyle: "row"
|
|
681
686
|
})
|
|
682
687
|
};
|
|
683
|
-
},
|
|
684
|
-
const
|
|
688
|
+
}, h = function(d) {
|
|
689
|
+
const b = d === 0 ? 0 : t, x = a(d), p = `${b}px`, A = "100%", E = 0;
|
|
685
690
|
return {
|
|
686
|
-
width:
|
|
691
|
+
width: x,
|
|
687
692
|
["marginLeft"]: p,
|
|
688
693
|
"--column-width-mobile": s({
|
|
689
694
|
stackedStyle: A,
|
|
690
|
-
desktopStyle:
|
|
695
|
+
desktopStyle: x
|
|
691
696
|
}),
|
|
692
697
|
"--column-margin-left-mobile": s({
|
|
693
698
|
stackedStyle: E,
|
|
@@ -695,7 +700,7 @@ function gt(e) {
|
|
|
695
700
|
}),
|
|
696
701
|
"--column-width-tablet": r({
|
|
697
702
|
stackedStyle: A,
|
|
698
|
-
desktopStyle:
|
|
703
|
+
desktopStyle: x
|
|
699
704
|
}),
|
|
700
705
|
"--column-margin-left-tablet": r({
|
|
701
706
|
stackedStyle: E,
|
|
@@ -703,11 +708,11 @@ function gt(e) {
|
|
|
703
708
|
})
|
|
704
709
|
};
|
|
705
710
|
}, g = function(d) {
|
|
706
|
-
var
|
|
711
|
+
var x, p;
|
|
707
712
|
return me(
|
|
708
|
-
((p = (
|
|
713
|
+
((p = (x = e.builderContext.content) == null ? void 0 : x.meta) == null ? void 0 : p.breakpoints) || {}
|
|
709
714
|
)[d].max;
|
|
710
|
-
},
|
|
715
|
+
}, v = function() {
|
|
711
716
|
return `
|
|
712
717
|
@media (max-width: ${g("medium")}px) {
|
|
713
718
|
.${e.builderBlock.id}-breakpoints {
|
|
@@ -734,19 +739,19 @@ function gt(e) {
|
|
|
734
739
|
},
|
|
735
740
|
`;
|
|
736
741
|
};
|
|
737
|
-
return /* @__PURE__ */ w(
|
|
742
|
+
return /* @__PURE__ */ w(y, { children: [
|
|
738
743
|
/* @__PURE__ */ w(
|
|
739
744
|
"div",
|
|
740
745
|
{
|
|
741
746
|
className: `builder-columns ${e.builderBlock.id}-breakpoints div-0d69fe26`,
|
|
742
|
-
style:
|
|
747
|
+
style: m(),
|
|
743
748
|
children: [
|
|
744
|
-
/* @__PURE__ */ l(
|
|
745
|
-
(
|
|
749
|
+
/* @__PURE__ */ l(y, { children: /* @__PURE__ */ l(F, { styles: v() }) }),
|
|
750
|
+
(u = e.columns) == null ? void 0 : u.map((f, d) => /* @__PURE__ */ Pe(
|
|
746
751
|
"div",
|
|
747
752
|
{
|
|
748
753
|
className: "builder-column div-0d69fe26-2",
|
|
749
|
-
style:
|
|
754
|
+
style: h(d),
|
|
750
755
|
key: d
|
|
751
756
|
},
|
|
752
757
|
/* @__PURE__ */ l(
|
|
@@ -759,7 +764,7 @@ function gt(e) {
|
|
|
759
764
|
},
|
|
760
765
|
context: e.builderContext,
|
|
761
766
|
registeredComponents: e.builderComponents,
|
|
762
|
-
blocks:
|
|
767
|
+
blocks: f.blocks
|
|
763
768
|
}
|
|
764
769
|
)
|
|
765
770
|
))
|
|
@@ -827,7 +832,7 @@ const yt = (e) => {
|
|
|
827
832
|
value: t,
|
|
828
833
|
expires: n
|
|
829
834
|
}) => {
|
|
830
|
-
const i = (
|
|
835
|
+
const i = (S() ? location.protocol === "https:" : !0) ? xt : [[]], a = n ? [["expires", n.toUTCString()]] : [[]], r = [[e, t], ...a, ["path", "/"], ["domain", yt(window.location.hostname)], ...i];
|
|
831
836
|
return vt(r);
|
|
832
837
|
}, pe = async ({
|
|
833
838
|
name: e,
|
|
@@ -1249,15 +1254,15 @@ const yt = (e) => {
|
|
|
1249
1254
|
onChange: (e) => {
|
|
1250
1255
|
e.delete("srcset"), e.delete("noWebp");
|
|
1251
1256
|
function n(r, s = 6e4) {
|
|
1252
|
-
return new Promise((c,
|
|
1253
|
-
const
|
|
1257
|
+
return new Promise((c, m) => {
|
|
1258
|
+
const h = document.createElement("img");
|
|
1254
1259
|
let g = !1;
|
|
1255
|
-
|
|
1256
|
-
g = !0, c(
|
|
1257
|
-
},
|
|
1258
|
-
console.warn("Image load failed",
|
|
1259
|
-
}),
|
|
1260
|
-
g ||
|
|
1260
|
+
h.onload = () => {
|
|
1261
|
+
g = !0, c(h);
|
|
1262
|
+
}, h.addEventListener("error", (v) => {
|
|
1263
|
+
console.warn("Image load failed", v.error), m(v.error);
|
|
1264
|
+
}), h.src = r, setTimeout(() => {
|
|
1265
|
+
g || m(new Error("Image load timed out"));
|
|
1261
1266
|
}, s);
|
|
1262
1267
|
});
|
|
1263
1268
|
}
|
|
@@ -1672,7 +1677,7 @@ const Mt = {
|
|
|
1672
1677
|
})), zt = ({
|
|
1673
1678
|
canTrack: e,
|
|
1674
1679
|
content: t
|
|
1675
|
-
}) => !(!(B(t).length > 0) || !e ||
|
|
1680
|
+
}) => !(!(B(t).length > 0) || !e || S()), qt = (e) => e === "react" || e === "reactNative", ke = qt(T), Gt = () => `
|
|
1676
1681
|
window.${xe} = ${Kt}
|
|
1677
1682
|
window.${Se} = ${Ht}
|
|
1678
1683
|
`, Yt = (e, t) => `
|
|
@@ -1748,7 +1753,7 @@ const on = "v3", ne = "builder.", an = "options.", rn = (e) => {
|
|
|
1748
1753
|
}
|
|
1749
1754
|
}), n;
|
|
1750
1755
|
}, sn = () => {
|
|
1751
|
-
if (!
|
|
1756
|
+
if (!S())
|
|
1752
1757
|
return {};
|
|
1753
1758
|
const e = new URLSearchParams(window.location.search);
|
|
1754
1759
|
return Ce(e);
|
|
@@ -1764,25 +1769,25 @@ const on = "v3", ne = "builder.", an = "options.", rn = (e) => {
|
|
|
1764
1769
|
apiKey: r,
|
|
1765
1770
|
includeRefs: s = !0,
|
|
1766
1771
|
enrich: c,
|
|
1767
|
-
locale:
|
|
1768
|
-
apiVersion:
|
|
1772
|
+
locale: m,
|
|
1773
|
+
apiVersion: h = on,
|
|
1769
1774
|
fields: g,
|
|
1770
|
-
omit:
|
|
1771
|
-
offset:
|
|
1772
|
-
cacheSeconds:
|
|
1775
|
+
omit: v,
|
|
1776
|
+
offset: u,
|
|
1777
|
+
cacheSeconds: f,
|
|
1773
1778
|
staleCacheSeconds: d,
|
|
1774
|
-
sort:
|
|
1775
|
-
includeUnpublished:
|
|
1779
|
+
sort: b,
|
|
1780
|
+
includeUnpublished: x
|
|
1776
1781
|
} = e;
|
|
1777
1782
|
if (!r)
|
|
1778
1783
|
throw new Error("Missing API key");
|
|
1779
|
-
if (!["v2", "v3"].includes(
|
|
1780
|
-
throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${
|
|
1784
|
+
if (!["v2", "v3"].includes(h))
|
|
1785
|
+
throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${h}'`);
|
|
1781
1786
|
(e.limit === void 0 || e.limit > 1) && !("noTraverse" in e) && (t = !0);
|
|
1782
|
-
const p = new URL(`https://cdn.builder.io/api/${
|
|
1783
|
-
if (p.searchParams.set("omit",
|
|
1787
|
+
const p = new URL(`https://cdn.builder.io/api/${h}/content/${a}?apiKey=${r}&limit=${n}&noTraverse=${t}&includeRefs=${s}${m ? `&locale=${m}` : ""}${c ? `&enrich=${c}` : ""}`);
|
|
1788
|
+
if (p.searchParams.set("omit", v || "meta.componentsUsed"), g && p.searchParams.set("fields", g), Number.isFinite(u) && u > -1 && p.searchParams.set("offset", String(Math.floor(u))), typeof x == "boolean" && p.searchParams.set("includeUnpublished", String(x)), f && oe(f) && p.searchParams.set("cacheSeconds", String(f)), d && oe(d) && p.searchParams.set("staleCacheSeconds", String(d)), b) {
|
|
1784
1789
|
const C = P({
|
|
1785
|
-
sort:
|
|
1790
|
+
sort: b
|
|
1786
1791
|
});
|
|
1787
1792
|
for (const R in C)
|
|
1788
1793
|
p.searchParams.set(R, JSON.stringify(C[R]));
|
|
@@ -1822,7 +1827,7 @@ const Kn = G, ln = async (e) => {
|
|
|
1822
1827
|
}
|
|
1823
1828
|
t.results = a;
|
|
1824
1829
|
}
|
|
1825
|
-
if (!o || !(
|
|
1830
|
+
if (!o || !(S() || T === "reactNative"))
|
|
1826
1831
|
return t;
|
|
1827
1832
|
try {
|
|
1828
1833
|
const a = [];
|
|
@@ -1851,7 +1856,7 @@ async function Ie(e) {
|
|
|
1851
1856
|
}
|
|
1852
1857
|
const Hn = Ie;
|
|
1853
1858
|
function zn() {
|
|
1854
|
-
return !
|
|
1859
|
+
return !S() || D() ? !1 : location.search.indexOf("builder.preview=") !== -1;
|
|
1855
1860
|
}
|
|
1856
1861
|
function un() {
|
|
1857
1862
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
@@ -1887,7 +1892,7 @@ const Ee = "builderSessionId", mn = async ({
|
|
|
1887
1892
|
name: Ee,
|
|
1888
1893
|
value: e,
|
|
1889
1894
|
canTrack: t
|
|
1890
|
-
}), Re = () =>
|
|
1895
|
+
}), Re = () => S() && typeof localStorage < "u" ? localStorage : void 0, gn = ({
|
|
1891
1896
|
key: e,
|
|
1892
1897
|
canTrack: t
|
|
1893
1898
|
}) => {
|
|
@@ -1977,7 +1982,7 @@ async function kn(e) {
|
|
|
1977
1982
|
k.error("Missing API key for track call. Please provide your API key.");
|
|
1978
1983
|
return;
|
|
1979
1984
|
}
|
|
1980
|
-
if (e.canTrack && !D() && (
|
|
1985
|
+
if (e.canTrack && !D() && (S() || T === "reactNative"))
|
|
1981
1986
|
return fetch("https://cdn.builder.io/api/v1/track", {
|
|
1982
1987
|
method: "POST",
|
|
1983
1988
|
body: JSON.stringify({
|
|
@@ -2037,10 +2042,10 @@ const Cn = (e, t, n = !0) => {
|
|
|
2037
2042
|
builderElementIndex: n && o ? [].slice.call(document.getElementsByClassName(o)).indexOf(n) : void 0
|
|
2038
2043
|
}
|
|
2039
2044
|
};
|
|
2040
|
-
}, In = "0.7.
|
|
2045
|
+
}, In = "0.7.6", re = {};
|
|
2041
2046
|
function Tn(e, t) {
|
|
2042
2047
|
let n = re[e];
|
|
2043
|
-
if (n || (n = re[e] = []), n.push(t),
|
|
2048
|
+
if (n || (n = re[e] = []), n.push(t), S()) {
|
|
2044
2049
|
const o = {
|
|
2045
2050
|
type: "builder.register",
|
|
2046
2051
|
data: {
|
|
@@ -2081,7 +2086,7 @@ const Yn = () => {
|
|
|
2081
2086
|
let se = !1;
|
|
2082
2087
|
const Jn = (e = {}) => {
|
|
2083
2088
|
var t, n;
|
|
2084
|
-
se || (se = !0,
|
|
2089
|
+
se || (se = !0, S() && ((t = window.parent) == null || t.postMessage({
|
|
2085
2090
|
type: "builder.sdkInfo",
|
|
2086
2091
|
data: {
|
|
2087
2092
|
target: T,
|
|
@@ -2104,12 +2109,12 @@ const Jn = (e = {}) => {
|
|
|
2104
2109
|
if (o != null && o.type)
|
|
2105
2110
|
switch (o.type) {
|
|
2106
2111
|
case "builder.evaluate": {
|
|
2107
|
-
const r = o.data.text, s = o.data.arguments || [], c = o.data.id,
|
|
2108
|
-
let
|
|
2112
|
+
const r = o.data.text, s = o.data.arguments || [], c = o.data.id, m = new Function(r);
|
|
2113
|
+
let h, g = null;
|
|
2109
2114
|
try {
|
|
2110
|
-
|
|
2111
|
-
} catch (
|
|
2112
|
-
g =
|
|
2115
|
+
h = m.apply(null, s);
|
|
2116
|
+
} catch (v) {
|
|
2117
|
+
g = v;
|
|
2113
2118
|
}
|
|
2114
2119
|
g ? (i = window.parent) == null || i.postMessage({
|
|
2115
2120
|
type: "builder.evaluateError",
|
|
@@ -2117,19 +2122,19 @@ const Jn = (e = {}) => {
|
|
|
2117
2122
|
id: c,
|
|
2118
2123
|
error: g.message
|
|
2119
2124
|
}
|
|
2120
|
-
}, "*") :
|
|
2121
|
-
var
|
|
2122
|
-
(
|
|
2125
|
+
}, "*") : h && typeof h.then == "function" ? h.then((v) => {
|
|
2126
|
+
var u;
|
|
2127
|
+
(u = window.parent) == null || u.postMessage({
|
|
2123
2128
|
type: "builder.evaluateResult",
|
|
2124
2129
|
data: {
|
|
2125
2130
|
id: c,
|
|
2126
|
-
result:
|
|
2131
|
+
result: v
|
|
2127
2132
|
}
|
|
2128
2133
|
}, "*");
|
|
2129
2134
|
}).catch(console.error) : (a = window.parent) == null || a.postMessage({
|
|
2130
2135
|
type: "builder.evaluateResult",
|
|
2131
2136
|
data: {
|
|
2132
|
-
result:
|
|
2137
|
+
result: h,
|
|
2133
2138
|
id: c
|
|
2134
2139
|
}
|
|
2135
2140
|
}, "*");
|
|
@@ -2203,22 +2208,17 @@ const Bn = ({
|
|
|
2203
2208
|
locale: n
|
|
2204
2209
|
}) => {
|
|
2205
2210
|
var a, r, s;
|
|
2206
|
-
const o = {};
|
|
2207
|
-
(
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
...(s = e == null ? void 0 : e.data) == null ? void 0 : s.state,
|
|
2211
|
+
const o = {}, i = ((a = e == null ? void 0 : e.data) == null ? void 0 : a.state) || {};
|
|
2212
|
+
return (s = (r = e == null ? void 0 : e.data) == null ? void 0 : r.inputs) == null || s.forEach((c) => {
|
|
2213
|
+
c.name && c.defaultValue !== void 0 && (o[c.name] = c.defaultValue);
|
|
2214
|
+
}), {
|
|
2215
|
+
...o,
|
|
2216
|
+
...i,
|
|
2213
2217
|
...t,
|
|
2214
2218
|
...n ? {
|
|
2215
2219
|
locale: n
|
|
2216
2220
|
} : {}
|
|
2217
2221
|
};
|
|
2218
|
-
return {
|
|
2219
|
-
...o,
|
|
2220
|
-
...i
|
|
2221
|
-
};
|
|
2222
2222
|
}, Pn = ({
|
|
2223
2223
|
content: e,
|
|
2224
2224
|
data: t
|
|
@@ -2231,7 +2231,7 @@ const Bn = ({
|
|
|
2231
2231
|
meta: e == null ? void 0 : e.meta
|
|
2232
2232
|
} : void 0;
|
|
2233
2233
|
function ce(e) {
|
|
2234
|
-
var i, a, r, s, c,
|
|
2234
|
+
var i, a, r, s, c, m, h, g, v;
|
|
2235
2235
|
const t = Jt({
|
|
2236
2236
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2237
2237
|
variationId: (i = e.content) == null ? void 0 : i.testVariationId,
|
|
@@ -2247,10 +2247,10 @@ function ce(e) {
|
|
|
2247
2247
|
...te,
|
|
2248
2248
|
...e.customComponents || []
|
|
2249
2249
|
].reduce(
|
|
2250
|
-
(
|
|
2251
|
-
...
|
|
2250
|
+
(u, { component: f, ...d }) => ({
|
|
2251
|
+
...u,
|
|
2252
2252
|
[d.name]: {
|
|
2253
|
-
component:
|
|
2253
|
+
component: f,
|
|
2254
2254
|
...U(d)
|
|
2255
2255
|
}
|
|
2256
2256
|
}),
|
|
@@ -2280,8 +2280,8 @@ function ce(e) {
|
|
|
2280
2280
|
...te,
|
|
2281
2281
|
...e.customComponents || []
|
|
2282
2282
|
].reduce(
|
|
2283
|
-
(
|
|
2284
|
-
...
|
|
2283
|
+
(u, { component: f, ...d }) => ({
|
|
2284
|
+
...u,
|
|
2285
2285
|
[d.name]: U(d)
|
|
2286
2286
|
}),
|
|
2287
2287
|
{}
|
|
@@ -2302,19 +2302,19 @@ function ce(e) {
|
|
|
2302
2302
|
showContent: e.showContent,
|
|
2303
2303
|
builderContextSignal: o,
|
|
2304
2304
|
children: [
|
|
2305
|
-
e.isSsrAbTest ? /* @__PURE__ */ l(
|
|
2306
|
-
/* @__PURE__ */ l(
|
|
2305
|
+
e.isSsrAbTest ? /* @__PURE__ */ l(y, { children: /* @__PURE__ */ l(M, { scriptStr: t }) }) : null,
|
|
2306
|
+
/* @__PURE__ */ l(y, { children: /* @__PURE__ */ l(
|
|
2307
2307
|
Vn,
|
|
2308
2308
|
{
|
|
2309
2309
|
contentId: (r = o.content) == null ? void 0 : r.id,
|
|
2310
2310
|
cssCode: (c = (s = o.content) == null ? void 0 : s.data) == null ? void 0 : c.cssCode,
|
|
2311
|
-
customFonts: (
|
|
2311
|
+
customFonts: (h = (m = o.content) == null ? void 0 : m.data) == null ? void 0 : h.customFonts
|
|
2312
2312
|
}
|
|
2313
2313
|
) }),
|
|
2314
2314
|
/* @__PURE__ */ l(
|
|
2315
2315
|
H,
|
|
2316
2316
|
{
|
|
2317
|
-
blocks: (
|
|
2317
|
+
blocks: (v = (g = o.content) == null ? void 0 : g.data) == null ? void 0 : v.blocks,
|
|
2318
2318
|
context: o,
|
|
2319
2319
|
registeredComponents: n
|
|
2320
2320
|
}
|
|
@@ -2331,9 +2331,9 @@ function Ve(e) {
|
|
|
2331
2331
|
}), n = function() {
|
|
2332
2332
|
var c;
|
|
2333
2333
|
return Yt(
|
|
2334
|
-
B(e.content).map((
|
|
2335
|
-
id:
|
|
2336
|
-
testRatio:
|
|
2334
|
+
B(e.content).map((m) => ({
|
|
2335
|
+
id: m.testVariationId,
|
|
2336
|
+
testRatio: m.testRatio
|
|
2337
2337
|
})),
|
|
2338
2338
|
((c = e.content) == null ? void 0 : c.id) || ""
|
|
2339
2339
|
);
|
|
@@ -2349,9 +2349,9 @@ function Ve(e) {
|
|
|
2349
2349
|
canTrack: L(e.canTrack)
|
|
2350
2350
|
});
|
|
2351
2351
|
};
|
|
2352
|
-
return /* @__PURE__ */ w(
|
|
2353
|
-
!e.__isNestedRender && T !== "reactNative" ? /* @__PURE__ */ l(
|
|
2354
|
-
t ? /* @__PURE__ */ w(
|
|
2352
|
+
return /* @__PURE__ */ w(y, { children: [
|
|
2353
|
+
!e.__isNestedRender && T !== "reactNative" ? /* @__PURE__ */ l(y, { children: /* @__PURE__ */ l(M, { scriptStr: Gt() }) }) : null,
|
|
2354
|
+
t ? /* @__PURE__ */ w(y, { children: [
|
|
2355
2355
|
/* @__PURE__ */ l(
|
|
2356
2356
|
F,
|
|
2357
2357
|
{
|
|
@@ -2422,12 +2422,12 @@ const $n = async ({
|
|
|
2422
2422
|
async function On(e) {
|
|
2423
2423
|
var o, i, a, r;
|
|
2424
2424
|
const t = function() {
|
|
2425
|
-
var c,
|
|
2425
|
+
var c, m;
|
|
2426
2426
|
return [
|
|
2427
2427
|
e.attributes.className,
|
|
2428
2428
|
"builder-symbol",
|
|
2429
2429
|
(c = e.symbol) != null && c.inline ? "builder-inline-symbol" : void 0,
|
|
2430
|
-
(
|
|
2430
|
+
(m = e.symbol) != null && m.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
2431
2431
|
].filter(Boolean).join(" ");
|
|
2432
2432
|
}, n = ((o = e.symbol) == null ? void 0 : o.content) || await $n({
|
|
2433
2433
|
symbol: e.symbol,
|
|
@@ -2453,7 +2453,7 @@ async function On(e) {
|
|
|
2453
2453
|
}
|
|
2454
2454
|
const Qn = H, Xn = Ve, le = {};
|
|
2455
2455
|
function Zn(e) {
|
|
2456
|
-
if (
|
|
2456
|
+
if (S()) {
|
|
2457
2457
|
Object.assign(le, e);
|
|
2458
2458
|
const t = {
|
|
2459
2459
|
type: "builder.settingsChange",
|
|
@@ -2495,7 +2495,7 @@ export {
|
|
|
2495
2495
|
Un as a,
|
|
2496
2496
|
Mn as b,
|
|
2497
2497
|
Dn as c,
|
|
2498
|
-
|
|
2498
|
+
S as d,
|
|
2499
2499
|
L as e,
|
|
2500
2500
|
zn as f,
|
|
2501
2501
|
ut as g,
|