@builder.io/sdk-react-nextjs 0.14.0 → 0.14.2
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/{USE_CLIENT_BUNDLE-3ca5290b.js → USE_CLIENT_BUNDLE-94a883d7.js} +3 -3
- package/lib/{node/USE_CLIENT_BUNDLE-293178d5.cjs → browser/USE_CLIENT_BUNDLE-cf5440d2.cjs} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-0b2f4389.cjs → browser/USE_SERVER_BUNDLE-6b047a24.cjs} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-4db772c9.js → browser/USE_SERVER_BUNDLE-e442261e.js} +1 -1
- package/lib/browser/{bundle-0f8e9b11.cjs → bundle-39f550e8.cjs} +3 -3
- package/lib/browser/{bundle-4016f64d.js → bundle-f2d068ae.js} +4 -4
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +3 -3
- package/lib/{node/USE_CLIENT_BUNDLE-3a1f710c.js → edge/USE_CLIENT_BUNDLE-13f738aa.js} +3 -3
- package/lib/{browser/USE_CLIENT_BUNDLE-ae2cf58a.cjs → edge/USE_CLIENT_BUNDLE-8efb20f9.cjs} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-86b87f1d.js → edge/USE_SERVER_BUNDLE-388cd47f.js} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-e487f694.cjs → edge/USE_SERVER_BUNDLE-fcb4cd3b.cjs} +1 -1
- package/lib/edge/{bundle-30e52741.js → bundle-25532fbf.js} +4 -4
- package/lib/edge/{bundle-972c668c.cjs → bundle-5e5bbc08.cjs} +3 -3
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +3 -3
- package/lib/{edge/USE_CLIENT_BUNDLE-e243b06f.cjs → node/USE_CLIENT_BUNDLE-15ffe053.cjs} +1 -1
- package/lib/{edge/USE_CLIENT_BUNDLE-eea569d0.js → node/USE_CLIENT_BUNDLE-8d3a2613.js} +3 -3
- package/lib/{browser/USE_SERVER_BUNDLE-44bff58a.cjs → node/USE_SERVER_BUNDLE-986afa12.cjs} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-87bb4fc8.js → node/USE_SERVER_BUNDLE-de637c59.js} +1 -1
- package/lib/node/{bundle-b908270e.cjs → bundle-7ffa568e.cjs} +10 -10
- package/lib/node/{bundle-3d5a7e60.js → bundle-9a2088df.js} +137 -134
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/package.json +1 -1
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/functions/get-content/types.d.ts +1 -1
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/functions/get-content/types.d.ts +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { I as InteractiveElement, B as BlockWrapper, a as BlocksWrapper, D as DynamicRenderer, C as CustomCode, E as Embed, b as ImgComponent, V as Video, c as Button, F as FragmentComponent, d as Image, S as SectionComponent, e as EnableEditor } from "./USE_CLIENT_BUNDLE-
|
|
3
|
+
import { I as InteractiveElement, B as BlockWrapper, a as BlocksWrapper, D as DynamicRenderer, C as CustomCode, E as Embed, b as ImgComponent, V as Video, c as Button, F as FragmentComponent, d as Image, S as SectionComponent, e as EnableEditor } from "./USE_CLIENT_BUNDLE-8d3a2613.js";
|
|
4
4
|
import { LRUCache } from "lru-cache";
|
|
5
5
|
import "next/navigation";
|
|
6
6
|
const EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), isEmptyElement = (e) => typeof e == "string" && EMPTY_HTML_ELEMENTS.has(e.toLowerCase()), TARGET = "rsc", getClassPropName = () => {
|
|
@@ -151,7 +151,7 @@ try {
|
|
|
151
151
|
safeDynamicRequire = eval("require");
|
|
152
152
|
} catch (e) {
|
|
153
153
|
}
|
|
154
|
-
const
|
|
154
|
+
const getSyncValName = (e) => `bldr_${e}_sync`, BUILDER_SET_STATE_NAME = "BUILDER_SET_STATE", INJECTED_IVM_GLOBAL = "BUILDER_IVM", REF_TO_PROXY_FN = `
|
|
155
155
|
var refToProxy = (obj) => {
|
|
156
156
|
if (typeof obj !== 'object' || obj === null) {
|
|
157
157
|
return obj;
|
|
@@ -197,9 +197,12 @@ if (typeof output === 'object' && output !== null) {
|
|
|
197
197
|
|
|
198
198
|
output;
|
|
199
199
|
`;
|
|
200
|
-
}, getIsolateContext = () =>
|
|
201
|
-
|
|
202
|
-
|
|
200
|
+
}, getIsolateContext = () => {
|
|
201
|
+
const e = safeDynamicRequire("isolated-vm");
|
|
202
|
+
return new e.Isolate({
|
|
203
|
+
memoryLimit: 128
|
|
204
|
+
}).createContextSync();
|
|
205
|
+
}, runInNode = ({
|
|
203
206
|
code: e,
|
|
204
207
|
builder: t,
|
|
205
208
|
context: n,
|
|
@@ -208,37 +211,37 @@ output;
|
|
|
208
211
|
rootSetState: i,
|
|
209
212
|
rootState: a
|
|
210
213
|
}) => {
|
|
211
|
-
const s = fastClone({
|
|
214
|
+
const s = safeDynamicRequire("isolated-vm"), c = fastClone({
|
|
212
215
|
...a,
|
|
213
216
|
...r
|
|
214
|
-
}),
|
|
217
|
+
}), u = getFunctionArguments({
|
|
215
218
|
builder: t,
|
|
216
219
|
context: n,
|
|
217
220
|
event: o,
|
|
218
|
-
state:
|
|
219
|
-
}),
|
|
220
|
-
|
|
221
|
-
console.log(...
|
|
222
|
-
}),
|
|
223
|
-
set(a,
|
|
224
|
-
}),
|
|
225
|
-
const
|
|
221
|
+
state: c
|
|
222
|
+
}), h = getIsolateContext(), m = h.global;
|
|
223
|
+
m.setSync("global", m.derefInto()), m.setSync("log", function(...l) {
|
|
224
|
+
console.log(...l);
|
|
225
|
+
}), m.setSync(BUILDER_SET_STATE_NAME, function(l, d) {
|
|
226
|
+
set(a, l, d), i == null || i(a);
|
|
227
|
+
}), u.forEach(([l, d]) => {
|
|
228
|
+
const b = typeof d == "object" ? new s.Reference(
|
|
226
229
|
// workaround: methods with default values for arguments is not being cloned over
|
|
227
|
-
|
|
228
|
-
...
|
|
229
|
-
getUserAttributes: () =>
|
|
230
|
-
} :
|
|
230
|
+
l === "builder" ? {
|
|
231
|
+
...d,
|
|
232
|
+
getUserAttributes: () => d.getUserAttributes()
|
|
233
|
+
} : d
|
|
231
234
|
) : null;
|
|
232
|
-
|
|
233
|
-
}),
|
|
234
|
-
const
|
|
235
|
+
m.setSync(getSyncValName(l), b);
|
|
236
|
+
}), m.setSync(INJECTED_IVM_GLOBAL, s);
|
|
237
|
+
const f = processCode({
|
|
235
238
|
code: e,
|
|
236
|
-
args:
|
|
237
|
-
}),
|
|
239
|
+
args: u
|
|
240
|
+
}), g = h.evalSync(f);
|
|
238
241
|
try {
|
|
239
|
-
return JSON.parse(
|
|
242
|
+
return JSON.parse(g);
|
|
240
243
|
} catch {
|
|
241
|
-
return
|
|
244
|
+
return g;
|
|
242
245
|
}
|
|
243
246
|
}, checkIsDefined = (e) => e != null;
|
|
244
247
|
function isNodeRuntime() {
|
|
@@ -307,14 +310,14 @@ const evaluateBindings = ({
|
|
|
307
310
|
}
|
|
308
311
|
};
|
|
309
312
|
for (const s in e.bindings) {
|
|
310
|
-
const c = e.bindings[s],
|
|
313
|
+
const c = e.bindings[s], u = evaluate({
|
|
311
314
|
code: c,
|
|
312
315
|
localState: n,
|
|
313
316
|
rootState: o,
|
|
314
317
|
rootSetState: r,
|
|
315
318
|
context: t
|
|
316
319
|
});
|
|
317
|
-
set(a, s,
|
|
320
|
+
set(a, s, u);
|
|
318
321
|
}
|
|
319
322
|
return a;
|
|
320
323
|
};
|
|
@@ -377,15 +380,15 @@ const getComponent = ({
|
|
|
377
380
|
if (!Array.isArray(r))
|
|
378
381
|
return;
|
|
379
382
|
const i = n.collection.split(".").pop(), a = n.itemName || (i ? i + "Item" : "item");
|
|
380
|
-
return r.map((c,
|
|
383
|
+
return r.map((c, u) => ({
|
|
381
384
|
context: {
|
|
382
385
|
...t,
|
|
383
386
|
localState: {
|
|
384
387
|
...t.localState,
|
|
385
|
-
$index:
|
|
388
|
+
$index: u,
|
|
386
389
|
$item: c,
|
|
387
390
|
[a]: c,
|
|
388
|
-
[`$${a}Index`]:
|
|
391
|
+
[`$${a}Index`]: u
|
|
389
392
|
}
|
|
390
393
|
},
|
|
391
394
|
block: o
|
|
@@ -463,7 +466,7 @@ function BlockStyles(e) {
|
|
|
463
466
|
});
|
|
464
467
|
return checkIsDefined(r.hide) ? !r.hide : checkIsDefined(r.show) ? r.show : !0;
|
|
465
468
|
}, n = function() {
|
|
466
|
-
var
|
|
469
|
+
var d;
|
|
467
470
|
const r = getProcessedBlock({
|
|
468
471
|
block: e.block,
|
|
469
472
|
localState: e.context.localState,
|
|
@@ -472,29 +475,29 @@ function BlockStyles(e) {
|
|
|
472
475
|
context: e.context.context,
|
|
473
476
|
shouldEvaluateBindings: !0
|
|
474
477
|
}), i = r.responsiveStyles, a = e.context.content, s = getSizesForBreakpoints(
|
|
475
|
-
((
|
|
476
|
-
), c = i == null ? void 0 : i.large,
|
|
477
|
-
if (!
|
|
478
|
+
((d = a == null ? void 0 : a.meta) == null ? void 0 : d.breakpoints) || {}
|
|
479
|
+
), c = i == null ? void 0 : i.large, u = i == null ? void 0 : i.medium, h = i == null ? void 0 : i.small, m = r.id;
|
|
480
|
+
if (!m)
|
|
478
481
|
return "";
|
|
479
482
|
const f = c ? createCssClass({
|
|
480
|
-
className:
|
|
483
|
+
className: m,
|
|
481
484
|
styles: c
|
|
482
|
-
}) : "",
|
|
483
|
-
className:
|
|
484
|
-
styles:
|
|
485
|
+
}) : "", g = u ? createCssClass({
|
|
486
|
+
className: m,
|
|
487
|
+
styles: u,
|
|
485
488
|
mediaQuery: getMaxWidthQueryForSize(
|
|
486
489
|
"medium",
|
|
487
490
|
s
|
|
488
491
|
)
|
|
489
|
-
}) : "", l =
|
|
490
|
-
className:
|
|
491
|
-
styles:
|
|
492
|
+
}) : "", l = h ? createCssClass({
|
|
493
|
+
className: m,
|
|
494
|
+
styles: h,
|
|
492
495
|
mediaQuery: getMaxWidthQueryForSize(
|
|
493
496
|
"small",
|
|
494
497
|
s
|
|
495
498
|
)
|
|
496
499
|
}) : "";
|
|
497
|
-
return [f,
|
|
500
|
+
return [f, g, l].join(" ");
|
|
498
501
|
};
|
|
499
502
|
return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: n() }) }) : null });
|
|
500
503
|
}
|
|
@@ -657,7 +660,7 @@ function RepeatedBlock(e) {
|
|
|
657
660
|
);
|
|
658
661
|
}
|
|
659
662
|
function Block(e) {
|
|
660
|
-
var
|
|
663
|
+
var u, h, m;
|
|
661
664
|
const t = function() {
|
|
662
665
|
return getComponent({
|
|
663
666
|
block: e.block,
|
|
@@ -670,8 +673,8 @@ function Block(e) {
|
|
|
670
673
|
context: e.context
|
|
671
674
|
});
|
|
672
675
|
}, o = function() {
|
|
673
|
-
var
|
|
674
|
-
return (
|
|
676
|
+
var g;
|
|
677
|
+
return (g = e.block.repeat) != null && g.collection ? e.block : getProcessedBlock({
|
|
675
678
|
block: e.block,
|
|
676
679
|
localState: e.context.localState,
|
|
677
680
|
rootState: e.context.rootState,
|
|
@@ -683,23 +686,23 @@ function Block(e) {
|
|
|
683
686
|
var l;
|
|
684
687
|
return e.block.tagName === "a" || ((l = o().properties) == null ? void 0 : l.href) || o().href ? e.linkComponent || "a" : e.block.tagName || "div";
|
|
685
688
|
}, i = function() {
|
|
686
|
-
var
|
|
687
|
-
if ((
|
|
689
|
+
var d, b;
|
|
690
|
+
if ((d = e.block.repeat) != null && d.collection)
|
|
688
691
|
return !!((b = n()) != null && b.length);
|
|
689
|
-
const
|
|
690
|
-
return ("show" in o() ? o().show : !0) && !
|
|
692
|
+
const g = "hide" in o() ? o().hide : !1;
|
|
693
|
+
return ("show" in o() ? o().show : !0) && !g;
|
|
691
694
|
}, a = function() {
|
|
692
695
|
var l;
|
|
693
696
|
return !((l = t()) != null && l.component) && !n() ? o().children ?? [] : [];
|
|
694
697
|
}, s = function() {
|
|
695
|
-
var
|
|
698
|
+
var g, l, d, b, p, S, k, y, C, x;
|
|
696
699
|
return {
|
|
697
700
|
blockChildren: o().children ?? [],
|
|
698
|
-
componentRef: (
|
|
701
|
+
componentRef: (g = t()) == null ? void 0 : g.component,
|
|
699
702
|
componentOptions: {
|
|
700
703
|
...getBlockComponentOptions(o()),
|
|
701
704
|
builderContext: e.context,
|
|
702
|
-
...((l = t()) == null ? void 0 : l.name) === "Core:Button" || ((
|
|
705
|
+
...((l = t()) == null ? void 0 : l.name) === "Core:Button" || ((d = t()) == null ? void 0 : d.name) === "Symbol" || ((b = t()) == null ? void 0 : b.name) === "Columns" || ((p = t()) == null ? void 0 : p.name) === "Form:Form" ? {
|
|
703
706
|
builderLinkComponent: e.linkComponent
|
|
704
707
|
} : {},
|
|
705
708
|
...((S = t()) == null ? void 0 : S.name) === "Symbol" || ((k = t()) == null ? void 0 : k.name) === "Columns" || ((y = t()) == null ? void 0 : y.name) === "Form:Form" ? {
|
|
@@ -716,7 +719,7 @@ function Block(e) {
|
|
|
716
719
|
}, c = e.context;
|
|
717
720
|
return /* @__PURE__ */ jsx(Fragment, { children: i() ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
718
721
|
/* @__PURE__ */ jsx(BlockStyles, { block: e.block, context: e.context }),
|
|
719
|
-
(
|
|
722
|
+
(u = t()) != null && u.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
720
723
|
ComponentRef,
|
|
721
724
|
{
|
|
722
725
|
componentRef: s().componentRef,
|
|
@@ -729,7 +732,7 @@ function Block(e) {
|
|
|
729
732
|
includeBlockProps: s().includeBlockProps,
|
|
730
733
|
isInteractive: s().isInteractive
|
|
731
734
|
}
|
|
732
|
-
) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (
|
|
735
|
+
) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (m = n()) == null ? void 0 : m.map((f, g) => /* @__PURE__ */ jsx(
|
|
733
736
|
RepeatedBlock,
|
|
734
737
|
{
|
|
735
738
|
repeatContext: f.context,
|
|
@@ -737,7 +740,7 @@ function Block(e) {
|
|
|
737
740
|
registeredComponents: e.registeredComponents,
|
|
738
741
|
linkComponent: e.linkComponent
|
|
739
742
|
},
|
|
740
|
-
|
|
743
|
+
g
|
|
741
744
|
)) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
742
745
|
BlockWrapper,
|
|
743
746
|
{
|
|
@@ -760,7 +763,7 @@ function Block(e) {
|
|
|
760
763
|
isInteractive: s().isInteractive
|
|
761
764
|
}
|
|
762
765
|
),
|
|
763
|
-
(
|
|
766
|
+
(h = a()) == null ? void 0 : h.map((f) => /* @__PURE__ */ jsx(
|
|
764
767
|
Block,
|
|
765
768
|
{
|
|
766
769
|
block: f,
|
|
@@ -800,24 +803,24 @@ function Blocks(e) {
|
|
|
800
803
|
);
|
|
801
804
|
}
|
|
802
805
|
function Columns(e) {
|
|
803
|
-
var
|
|
804
|
-
const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet", r = function(
|
|
806
|
+
var g;
|
|
807
|
+
const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet", r = function(d) {
|
|
805
808
|
var b;
|
|
806
|
-
return ((b = n[
|
|
807
|
-
}, i = function(
|
|
809
|
+
return ((b = n[d]) == null ? void 0 : b.width) || 100 / n.length;
|
|
810
|
+
}, i = function(d) {
|
|
808
811
|
const b = t * (n.length - 1) / n.length;
|
|
809
|
-
return `calc(${r(
|
|
812
|
+
return `calc(${r(d)}% - ${b}px)`;
|
|
810
813
|
}, a = function({
|
|
811
|
-
stackedStyle:
|
|
814
|
+
stackedStyle: d,
|
|
812
815
|
desktopStyle: b
|
|
813
816
|
}) {
|
|
814
|
-
return o === "tablet" ?
|
|
817
|
+
return o === "tablet" ? d : b;
|
|
815
818
|
}, s = function({
|
|
816
|
-
stackedStyle:
|
|
819
|
+
stackedStyle: d,
|
|
817
820
|
desktopStyle: b
|
|
818
821
|
}) {
|
|
819
|
-
return o === "never" ? b :
|
|
820
|
-
}, c = e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column",
|
|
822
|
+
return o === "never" ? b : d;
|
|
823
|
+
}, c = e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column", u = function() {
|
|
821
824
|
return {
|
|
822
825
|
"--flex-dir": c,
|
|
823
826
|
"--flex-dir-tablet": a({
|
|
@@ -825,19 +828,19 @@ function Columns(e) {
|
|
|
825
828
|
desktopStyle: "row"
|
|
826
829
|
})
|
|
827
830
|
};
|
|
828
|
-
},
|
|
829
|
-
const b =
|
|
831
|
+
}, h = function(d) {
|
|
832
|
+
const b = d === 0 ? 0 : t, p = i(d), S = `${b}px`, k = "100%", y = 0;
|
|
830
833
|
return {
|
|
831
834
|
...{
|
|
832
835
|
display: "flex",
|
|
833
836
|
flexDirection: "column",
|
|
834
837
|
alignItems: "stretch"
|
|
835
838
|
},
|
|
836
|
-
width:
|
|
839
|
+
width: p,
|
|
837
840
|
["marginLeft"]: S,
|
|
838
841
|
"--column-width-mobile": s({
|
|
839
842
|
stackedStyle: k,
|
|
840
|
-
desktopStyle:
|
|
843
|
+
desktopStyle: p
|
|
841
844
|
}),
|
|
842
845
|
"--column-margin-left-mobile": s({
|
|
843
846
|
stackedStyle: y,
|
|
@@ -845,21 +848,21 @@ function Columns(e) {
|
|
|
845
848
|
}),
|
|
846
849
|
"--column-width-tablet": a({
|
|
847
850
|
stackedStyle: k,
|
|
848
|
-
desktopStyle:
|
|
851
|
+
desktopStyle: p
|
|
849
852
|
}),
|
|
850
853
|
"--column-margin-left-tablet": a({
|
|
851
854
|
stackedStyle: y,
|
|
852
855
|
desktopStyle: S
|
|
853
856
|
})
|
|
854
857
|
};
|
|
855
|
-
},
|
|
856
|
-
var
|
|
858
|
+
}, m = function(d) {
|
|
859
|
+
var p, S;
|
|
857
860
|
return getSizesForBreakpoints(
|
|
858
|
-
((S = (
|
|
859
|
-
)[
|
|
861
|
+
((S = (p = e.builderContext.content) == null ? void 0 : p.meta) == null ? void 0 : S.breakpoints) || {}
|
|
862
|
+
)[d].max;
|
|
860
863
|
}, f = function() {
|
|
861
864
|
return `
|
|
862
|
-
@media (max-width: ${
|
|
865
|
+
@media (max-width: ${m("medium")}px) {
|
|
863
866
|
.${e.builderBlock.id}-breakpoints {
|
|
864
867
|
flex-direction: var(--flex-dir-tablet);
|
|
865
868
|
align-items: stretch;
|
|
@@ -871,7 +874,7 @@ function Columns(e) {
|
|
|
871
874
|
}
|
|
872
875
|
}
|
|
873
876
|
|
|
874
|
-
@media (max-width: ${
|
|
877
|
+
@media (max-width: ${m("small")}px) {
|
|
875
878
|
.${e.builderBlock.id}-breakpoints {
|
|
876
879
|
flex-direction: var(--flex-dir);
|
|
877
880
|
align-items: stretch;
|
|
@@ -888,11 +891,11 @@ function Columns(e) {
|
|
|
888
891
|
/* @__PURE__ */ jsxs(
|
|
889
892
|
"div",
|
|
890
893
|
{
|
|
891
|
-
className: `builder-columns ${e.builderBlock.id}-breakpoints div-
|
|
892
|
-
style:
|
|
894
|
+
className: `builder-columns ${e.builderBlock.id}-breakpoints div-1f78b21c`,
|
|
895
|
+
style: u(),
|
|
893
896
|
children: [
|
|
894
897
|
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: f() }) }),
|
|
895
|
-
(
|
|
898
|
+
(g = e.columns) == null ? void 0 : g.map((l, d) => /* @__PURE__ */ jsx(
|
|
896
899
|
DynamicRenderer,
|
|
897
900
|
{
|
|
898
901
|
TagName: l.link ? e.builderLinkComponent || "a" : "div",
|
|
@@ -902,12 +905,12 @@ function Columns(e) {
|
|
|
902
905
|
href: l.link
|
|
903
906
|
} : {},
|
|
904
907
|
[getClassPropName()]: "builder-column",
|
|
905
|
-
style: mapStyleObjToStrIfNeeded(
|
|
908
|
+
style: mapStyleObjToStrIfNeeded(h(d))
|
|
906
909
|
},
|
|
907
910
|
children: /* @__PURE__ */ jsx(
|
|
908
911
|
Blocks,
|
|
909
912
|
{
|
|
910
|
-
path: `component.options.columns.${
|
|
913
|
+
path: `component.options.columns.${d}.blocks`,
|
|
911
914
|
parent: e.builderBlock.id,
|
|
912
915
|
styleProp: {
|
|
913
916
|
flexGrow: "1"
|
|
@@ -919,12 +922,12 @@ function Columns(e) {
|
|
|
919
922
|
}
|
|
920
923
|
)
|
|
921
924
|
},
|
|
922
|
-
|
|
925
|
+
d
|
|
923
926
|
))
|
|
924
927
|
]
|
|
925
928
|
}
|
|
926
929
|
),
|
|
927
|
-
/* @__PURE__ */ jsx("style", { children: `.div-
|
|
930
|
+
/* @__PURE__ */ jsx("style", { children: `.div-1f78b21c {
|
|
928
931
|
display: flex;
|
|
929
932
|
line-height: normal;
|
|
930
933
|
}` })
|
|
@@ -1356,15 +1359,15 @@ const getTopLevelDomain = (e) => {
|
|
|
1356
1359
|
onChange: (e) => {
|
|
1357
1360
|
e.delete("srcset"), e.delete("noWebp");
|
|
1358
1361
|
function n(a, s = 6e4) {
|
|
1359
|
-
return new Promise((c,
|
|
1360
|
-
const
|
|
1361
|
-
let
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
},
|
|
1365
|
-
console.warn("Image load failed", f.error),
|
|
1366
|
-
}),
|
|
1367
|
-
|
|
1362
|
+
return new Promise((c, u) => {
|
|
1363
|
+
const h = document.createElement("img");
|
|
1364
|
+
let m = !1;
|
|
1365
|
+
h.onload = () => {
|
|
1366
|
+
m = !0, c(h);
|
|
1367
|
+
}, h.addEventListener("error", (f) => {
|
|
1368
|
+
console.warn("Image load failed", f.error), u(f.error);
|
|
1369
|
+
}), h.src = a, setTimeout(() => {
|
|
1370
|
+
m || u(new Error("Image load timed out"));
|
|
1368
1371
|
}, s);
|
|
1369
1372
|
});
|
|
1370
1373
|
}
|
|
@@ -1956,40 +1959,40 @@ const DEFAULT_API_VERSION = "v3", BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUIL
|
|
|
1956
1959
|
enrich: a,
|
|
1957
1960
|
locale: s,
|
|
1958
1961
|
apiVersion: c = DEFAULT_API_VERSION,
|
|
1959
|
-
fields:
|
|
1960
|
-
omit:
|
|
1961
|
-
offset:
|
|
1962
|
+
fields: u,
|
|
1963
|
+
omit: h,
|
|
1964
|
+
offset: m,
|
|
1962
1965
|
cacheSeconds: f,
|
|
1963
|
-
staleCacheSeconds:
|
|
1966
|
+
staleCacheSeconds: g,
|
|
1964
1967
|
sort: l,
|
|
1965
|
-
includeUnpublished:
|
|
1968
|
+
includeUnpublished: d
|
|
1966
1969
|
} = e;
|
|
1967
1970
|
if (!i)
|
|
1968
1971
|
throw new Error("Missing API key");
|
|
1969
1972
|
if (!["v3"].includes(c))
|
|
1970
1973
|
throw new Error(`Invalid apiVersion: expected 'v3', received '${c}'`);
|
|
1971
|
-
const b = t !== 1,
|
|
1972
|
-
if (
|
|
1974
|
+
const b = t !== 1, p = new URL(`https://cdn.builder.io/api/${c}/content/${r}`);
|
|
1975
|
+
if (p.searchParams.set("apiKey", i), p.searchParams.set("limit", String(t)), p.searchParams.set("noTraverse", String(b)), p.searchParams.set("includeRefs", String(!0)), s && p.searchParams.set("locale", s), a && p.searchParams.set("enrich", String(a)), p.searchParams.set("omit", h || "meta.componentsUsed"), u && p.searchParams.set("fields", u), Number.isFinite(m) && m > -1 && p.searchParams.set("offset", String(Math.floor(m))), typeof d == "boolean" && p.searchParams.set("includeUnpublished", String(d)), f && isPositiveNumber(f) && p.searchParams.set("cacheSeconds", String(f)), g && isPositiveNumber(g) && p.searchParams.set("staleCacheSeconds", String(g)), l) {
|
|
1973
1976
|
const y = flatten({
|
|
1974
1977
|
sort: l
|
|
1975
1978
|
});
|
|
1976
1979
|
for (const C in y)
|
|
1977
|
-
|
|
1980
|
+
p.searchParams.set(C, JSON.stringify(y[C]));
|
|
1978
1981
|
}
|
|
1979
1982
|
const S = {
|
|
1980
1983
|
...getBuilderSearchParamsFromWindow(),
|
|
1981
1984
|
...normalizeSearchParams(e.options || {})
|
|
1982
1985
|
}, k = flatten(S);
|
|
1983
1986
|
for (const y in k)
|
|
1984
|
-
|
|
1985
|
-
if (n &&
|
|
1987
|
+
p.searchParams.set(y, String(k[y]));
|
|
1988
|
+
if (n && p.searchParams.set("userAttributes", JSON.stringify(n)), o) {
|
|
1986
1989
|
const y = flatten({
|
|
1987
1990
|
query: o
|
|
1988
1991
|
});
|
|
1989
1992
|
for (const C in y)
|
|
1990
|
-
|
|
1993
|
+
p.searchParams.set(C, JSON.stringify(y[C]));
|
|
1991
1994
|
}
|
|
1992
|
-
return
|
|
1995
|
+
return p;
|
|
1993
1996
|
}, checkContentHasResults = (e) => "results" in e;
|
|
1994
1997
|
async function fetchOneEntry(e) {
|
|
1995
1998
|
const t = await fetchEntries({
|
|
@@ -2230,7 +2233,7 @@ function isFromTrustedHost(e, t) {
|
|
|
2230
2233
|
const n = new URL(t.origin), o = n.hostname;
|
|
2231
2234
|
return (e || DEFAULT_TRUSTED_HOSTS).findIndex((r) => r.startsWith("*.") ? o.endsWith(r.slice(1)) : r === o) > -1;
|
|
2232
2235
|
}
|
|
2233
|
-
const SDK_VERSION = "0.14.
|
|
2236
|
+
const SDK_VERSION = "0.14.2", registry = {};
|
|
2234
2237
|
function register(e, t) {
|
|
2235
2238
|
let n = registry[e];
|
|
2236
2239
|
if (n || (n = registry[e] = []), n.push(t), isBrowser()) {
|
|
@@ -2300,33 +2303,33 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2300
2303
|
if (r != null && r.type)
|
|
2301
2304
|
switch (r.type) {
|
|
2302
2305
|
case "builder.evaluate": {
|
|
2303
|
-
const s = r.data.text, c = r.data.arguments || [],
|
|
2304
|
-
let
|
|
2306
|
+
const s = r.data.text, c = r.data.arguments || [], u = r.data.id, h = new Function(s);
|
|
2307
|
+
let m, f = null;
|
|
2305
2308
|
try {
|
|
2306
|
-
|
|
2307
|
-
} catch (
|
|
2308
|
-
f =
|
|
2309
|
+
m = h.apply(null, c);
|
|
2310
|
+
} catch (g) {
|
|
2311
|
+
f = g;
|
|
2309
2312
|
}
|
|
2310
2313
|
f ? (i = window.parent) == null || i.postMessage({
|
|
2311
2314
|
type: "builder.evaluateError",
|
|
2312
2315
|
data: {
|
|
2313
|
-
id:
|
|
2316
|
+
id: u,
|
|
2314
2317
|
error: f.message
|
|
2315
2318
|
}
|
|
2316
|
-
}, "*") :
|
|
2319
|
+
}, "*") : m && typeof m.then == "function" ? m.then((g) => {
|
|
2317
2320
|
var l;
|
|
2318
2321
|
(l = window.parent) == null || l.postMessage({
|
|
2319
2322
|
type: "builder.evaluateResult",
|
|
2320
2323
|
data: {
|
|
2321
|
-
id:
|
|
2322
|
-
result:
|
|
2324
|
+
id: u,
|
|
2325
|
+
result: g
|
|
2323
2326
|
}
|
|
2324
2327
|
}, "*");
|
|
2325
2328
|
}).catch(console.error) : (a = window.parent) == null || a.postMessage({
|
|
2326
2329
|
type: "builder.evaluateResult",
|
|
2327
2330
|
data: {
|
|
2328
|
-
result:
|
|
2329
|
-
id:
|
|
2331
|
+
result: m,
|
|
2332
|
+
id: u
|
|
2330
2333
|
}
|
|
2331
2334
|
}, "*");
|
|
2332
2335
|
break;
|
|
@@ -2513,7 +2516,7 @@ const getRootStateInitialValue = ({
|
|
|
2513
2516
|
meta: e == null ? void 0 : e.meta
|
|
2514
2517
|
} : void 0;
|
|
2515
2518
|
function ContentComponent(e) {
|
|
2516
|
-
var r, i, a, s, c,
|
|
2519
|
+
var r, i, a, s, c, u, h, m, f;
|
|
2517
2520
|
const t = getUpdateVariantVisibilityScript({
|
|
2518
2521
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2519
2522
|
variationId: (r = e.content) == null ? void 0 : r.testVariationId,
|
|
@@ -2523,11 +2526,11 @@ function ContentComponent(e) {
|
|
|
2523
2526
|
...getDefaultRegisteredComponents(),
|
|
2524
2527
|
...e.customComponents || []
|
|
2525
2528
|
].reduce(
|
|
2526
|
-
(
|
|
2527
|
-
...
|
|
2528
|
-
[
|
|
2529
|
+
(g, { component: l, ...d }) => ({
|
|
2530
|
+
...g,
|
|
2531
|
+
[d.name]: {
|
|
2529
2532
|
component: l,
|
|
2530
|
-
...serializeComponentInfo(
|
|
2533
|
+
...serializeComponentInfo(d)
|
|
2531
2534
|
}
|
|
2532
2535
|
}),
|
|
2533
2536
|
{}
|
|
@@ -2550,9 +2553,9 @@ function ContentComponent(e) {
|
|
|
2550
2553
|
...getDefaultRegisteredComponents(),
|
|
2551
2554
|
...e.customComponents || []
|
|
2552
2555
|
].reduce(
|
|
2553
|
-
(
|
|
2554
|
-
...
|
|
2555
|
-
[
|
|
2556
|
+
(g, { component: l, ...d }) => ({
|
|
2557
|
+
...g,
|
|
2558
|
+
[d.name]: serializeComponentInfo(d)
|
|
2556
2559
|
}),
|
|
2557
2560
|
{}
|
|
2558
2561
|
),
|
|
@@ -2584,13 +2587,13 @@ function ContentComponent(e) {
|
|
|
2584
2587
|
{
|
|
2585
2588
|
contentId: (a = o.content) == null ? void 0 : a.id,
|
|
2586
2589
|
cssCode: (c = (s = o.content) == null ? void 0 : s.data) == null ? void 0 : c.cssCode,
|
|
2587
|
-
customFonts: (
|
|
2590
|
+
customFonts: (h = (u = o.content) == null ? void 0 : u.data) == null ? void 0 : h.customFonts
|
|
2588
2591
|
}
|
|
2589
2592
|
) }),
|
|
2590
2593
|
/* @__PURE__ */ jsx(
|
|
2591
2594
|
Blocks,
|
|
2592
2595
|
{
|
|
2593
|
-
blocks: (f = (
|
|
2596
|
+
blocks: (f = (m = o.content) == null ? void 0 : m.data) == null ? void 0 : f.blocks,
|
|
2594
2597
|
context: o,
|
|
2595
2598
|
registeredComponents: n,
|
|
2596
2599
|
linkComponent: e.linkComponent
|
|
@@ -2608,9 +2611,9 @@ function ContentVariants(e) {
|
|
|
2608
2611
|
}), n = function() {
|
|
2609
2612
|
var c;
|
|
2610
2613
|
return getUpdateCookieAndStylesScript(
|
|
2611
|
-
getVariants(e.content).map((
|
|
2612
|
-
id:
|
|
2613
|
-
testRatio:
|
|
2614
|
+
getVariants(e.content).map((u) => ({
|
|
2615
|
+
id: u.testVariationId,
|
|
2616
|
+
testRatio: u.testRatio
|
|
2614
2617
|
})),
|
|
2615
2618
|
((c = e.content) == null ? void 0 : c.id) || ""
|
|
2616
2619
|
);
|
|
@@ -2709,12 +2712,12 @@ const fetchSymbolContent = async ({
|
|
|
2709
2712
|
async function Symbol$1(e) {
|
|
2710
2713
|
var o, r, i, a, s;
|
|
2711
2714
|
const t = function() {
|
|
2712
|
-
var
|
|
2715
|
+
var u, h;
|
|
2713
2716
|
return [
|
|
2714
2717
|
e.attributes[getClassPropName()],
|
|
2715
2718
|
"builder-symbol",
|
|
2716
|
-
(
|
|
2717
|
-
(
|
|
2719
|
+
(u = e.symbol) != null && u.inline ? "builder-inline-symbol" : void 0,
|
|
2720
|
+
(h = e.symbol) != null && h.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
2718
2721
|
].filter(Boolean).join(" ");
|
|
2719
2722
|
}, n = ((o = e.symbol) == null ? void 0 : o.content) || await fetchSymbolContent({
|
|
2720
2723
|
symbol: e.symbol,
|
package/lib/node/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./USE_CLIENT_BUNDLE-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./USE_CLIENT_BUNDLE-15ffe053.cjs"),e=require("./bundle-7ffa568e.cjs");require("react/jsx-runtime");require("react");require("./USE_SERVER_BUNDLE-986afa12.cjs");require("next/navigation");require("lru-cache");exports.Button=t.Button;exports.Fragment=t.FragmentComponent;exports.Image=t.Image;exports.Section=t.SectionComponent;exports.Video=t.Video;exports.Blocks=e.Blocks;exports.Columns=e.Columns;exports.Content=e.ContentVariants;exports.Symbol=e.Symbol;exports.Text=e.Text;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
|
-
import { c as n, F as m, d as c, S as p, V as g } from "./USE_CLIENT_BUNDLE-
|
|
2
|
-
import { B as l, w as u, C as E, S, T as f, F as B, p as C, E as h, G as x, q as b, z as y, c as F, j as P, x as T, y as k, D as w, A as R } from "./bundle-
|
|
1
|
+
import { c as n, F as m, d as c, S as p, V as g } from "./USE_CLIENT_BUNDLE-8d3a2613.js";
|
|
2
|
+
import { B as l, w as u, C as E, S, T as f, F as B, p as C, E as h, G as x, q as b, z as y, c as F, j as P, x as T, y as k, D as w, A as R } from "./bundle-9a2088df.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
|
-
import "./USE_SERVER_BUNDLE-
|
|
5
|
+
import "./USE_SERVER_BUNDLE-de637c59.js";
|
|
6
6
|
import "next/navigation";
|
|
7
7
|
import "lru-cache";
|
|
8
8
|
export {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder.io/sdk-react-nextjs",
|
|
3
3
|
"description": "Builder.io RSC SDK for NextJS App Directory",
|
|
4
|
-
"version": "0.14.
|
|
4
|
+
"version": "0.14.2",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/nextjs",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.14.
|
|
1
|
+
export declare const SDK_VERSION = "0.14.2";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.14.
|
|
1
|
+
export declare const SDK_VERSION = "0.14.2";
|