@builder.io/sdk-react-nextjs 0.14.15 → 0.14.16
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-85565442.cjs → browser/USE_CLIENT_BUNDLE-026b8026.cjs} +3 -3
- package/lib/browser/{USE_CLIENT_BUNDLE-619fca6f.js → USE_CLIENT_BUNDLE-30c6c6c1.js} +15 -15
- package/lib/{edge/USE_SERVER_BUNDLE-54c1fcea.js → browser/USE_SERVER_BUNDLE-685e6983.js} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-b436e323.cjs → browser/USE_SERVER_BUNDLE-ce31724e.cjs} +1 -1
- package/lib/browser/{bundle-62dcf48b.js → bundle-5c0a9d7a.js} +555 -538
- package/lib/browser/bundle-9744b895.cjs +169 -0
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +3 -3
- package/lib/{node/USE_CLIENT_BUNDLE-c0730eab.js → edge/USE_CLIENT_BUNDLE-5b0b3e9b.js} +15 -15
- package/lib/{browser/USE_CLIENT_BUNDLE-d44f1d9a.cjs → edge/USE_CLIENT_BUNDLE-9b110136.cjs} +3 -3
- package/lib/{node/USE_SERVER_BUNDLE-558179bb.js → edge/USE_SERVER_BUNDLE-0f9fd6f2.js} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-81427dab.cjs → edge/USE_SERVER_BUNDLE-b3d619da.cjs} +1 -1
- package/lib/edge/{bundle-67ad9183.js → bundle-b24e7c9b.js} +1049 -1032
- package/lib/edge/{bundle-fbc6c22e.cjs → bundle-f1760904.cjs} +29 -29
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +3 -3
- package/lib/{edge/USE_CLIENT_BUNDLE-84dff6eb.js → node/USE_CLIENT_BUNDLE-f8067984.js} +15 -15
- package/lib/{edge/USE_CLIENT_BUNDLE-97b90370.cjs → node/USE_CLIENT_BUNDLE-f9ebade4.cjs} +3 -3
- package/lib/{browser/USE_SERVER_BUNDLE-b4db53a9.js → node/USE_SERVER_BUNDLE-4b52a0c0.js} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-72579b21.cjs → node/USE_SERVER_BUNDLE-e1e73ba6.cjs} +1 -1
- package/lib/node/{bundle-3fe2b5da.cjs → bundle-0fc157c8.cjs} +9 -9
- package/lib/node/{bundle-5f638f04.js → bundle-8d3cab60.js} +169 -152
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/package.json +1 -1
- package/types/cjs/components/block/animator.d.ts +1 -1
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/functions/is-previewing.d.ts +1 -1
- package/types/esm/components/block/animator.d.ts +1 -1
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/functions/is-previewing.d.ts +1 -1
- package/lib/browser/bundle-df3df109.cjs +0 -169
|
@@ -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-f8067984.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 = () => {
|
|
@@ -46,7 +46,8 @@ function isIframe() {
|
|
|
46
46
|
return isBrowser() && window.self !== window.top;
|
|
47
47
|
}
|
|
48
48
|
function isEditing(e) {
|
|
49
|
-
return isIframe() &&
|
|
49
|
+
return isIframe() && // accessing window.location.search is safe here because `isIframe()` is only `true` if we're in a browser.
|
|
50
|
+
getSearchString(e || window.location.search).indexOf("builder.frameEditing=") !== -1;
|
|
50
51
|
}
|
|
51
52
|
const getLocation = () => {
|
|
52
53
|
if (isBrowser()) {
|
|
@@ -243,29 +244,29 @@ const getIvm = () => {
|
|
|
243
244
|
context: n,
|
|
244
245
|
event: o,
|
|
245
246
|
state: c
|
|
246
|
-
}), g = getIsolateContext(),
|
|
247
|
-
|
|
247
|
+
}), g = getIsolateContext(), d = g.global;
|
|
248
|
+
d.setSync("global", d.derefInto()), d.setSync("log", function(...m) {
|
|
248
249
|
console.log(...m);
|
|
249
|
-
}),
|
|
250
|
-
set(a, m,
|
|
251
|
-
}), u.forEach(([m,
|
|
252
|
-
const b = typeof
|
|
250
|
+
}), d.setSync(BUILDER_SET_STATE_NAME, function(m, l) {
|
|
251
|
+
set(a, m, l), i == null || i(a);
|
|
252
|
+
}), u.forEach(([m, l]) => {
|
|
253
|
+
const b = typeof l == "object" ? new s.Reference(
|
|
253
254
|
// workaround: methods with default values for arguments is not being cloned over
|
|
254
255
|
m === "builder" ? {
|
|
255
|
-
...
|
|
256
|
-
getUserAttributes: () =>
|
|
257
|
-
} :
|
|
256
|
+
...l,
|
|
257
|
+
getUserAttributes: () => l.getUserAttributes()
|
|
258
|
+
} : l
|
|
258
259
|
) : null;
|
|
259
|
-
|
|
260
|
-
}),
|
|
260
|
+
d.setSync(getSyncValName(m), b);
|
|
261
|
+
}), d.setSync(INJECTED_IVM_GLOBAL, s);
|
|
261
262
|
const f = processCode({
|
|
262
263
|
code: e,
|
|
263
264
|
args: u
|
|
264
|
-
}),
|
|
265
|
+
}), h = g.evalSync(f);
|
|
265
266
|
try {
|
|
266
|
-
return JSON.parse(
|
|
267
|
+
return JSON.parse(h);
|
|
267
268
|
} catch {
|
|
268
|
-
return
|
|
269
|
+
return h;
|
|
269
270
|
}
|
|
270
271
|
}, checkIsDefined = (e) => e != null;
|
|
271
272
|
function isNodeRuntime() {
|
|
@@ -278,7 +279,7 @@ const shouldForceBrowserRuntimeInNode = () => {
|
|
|
278
279
|
return !1;
|
|
279
280
|
const e = process.arch === "arm64", t = process.version.startsWith("v20"), n = (o = process.env.NODE_OPTIONS) == null ? void 0 : o.includes("--no-node-snapshot");
|
|
280
281
|
return e && t && !n ? (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;
|
|
281
|
-
}, chooseBrowserOrServerEval = (e) => isBrowser() || shouldForceBrowserRuntimeInNode() ? runInBrowser(e) : runInNode(e), _EvalCache = class
|
|
282
|
+
}, chooseBrowserOrServerEval = (e) => isBrowser() || shouldForceBrowserRuntimeInNode() ? runInBrowser(e) : runInNode(e), _EvalCache = class k {
|
|
282
283
|
static getCacheKey(t) {
|
|
283
284
|
return JSON.stringify({
|
|
284
285
|
...t,
|
|
@@ -288,10 +289,10 @@ const shouldForceBrowserRuntimeInNode = () => {
|
|
|
288
289
|
});
|
|
289
290
|
}
|
|
290
291
|
static getCachedValue(t) {
|
|
291
|
-
return
|
|
292
|
+
return k.cache.get(t);
|
|
292
293
|
}
|
|
293
294
|
static setCachedValue(t, n) {
|
|
294
|
-
|
|
295
|
+
k.cache.size > 20 && k.cache.delete(k.cache.keys().next().value), k.cache.set(t, {
|
|
295
296
|
value: n
|
|
296
297
|
});
|
|
297
298
|
}
|
|
@@ -544,6 +545,47 @@ function InlinedStyles(e) {
|
|
|
544
545
|
}
|
|
545
546
|
);
|
|
546
547
|
}
|
|
548
|
+
function assign(e, ...t) {
|
|
549
|
+
const n = Object(e);
|
|
550
|
+
for (let o = 1; o < arguments.length; o++) {
|
|
551
|
+
const r = arguments[o];
|
|
552
|
+
if (r != null)
|
|
553
|
+
for (const i in r)
|
|
554
|
+
Object.prototype.hasOwnProperty.call(r, i) && (n[i] = r[i]);
|
|
555
|
+
}
|
|
556
|
+
return n;
|
|
557
|
+
}
|
|
558
|
+
const camelCaseToKebabCase = (e) => e ? e.replace(/([A-Z])/g, (t) => `-${t[0].toLowerCase()}`) : "";
|
|
559
|
+
function warnElementNotPresent(e) {
|
|
560
|
+
console.warn(`Cannot animate element: element with ID ${e} not found!`);
|
|
561
|
+
}
|
|
562
|
+
function augmentAnimation(e, t) {
|
|
563
|
+
const n = getAllStylesUsed(e), o = getComputedStyle(t), r = e.steps[0].styles, i = e.steps[e.steps.length - 1].styles, a = [r, i];
|
|
564
|
+
for (const s of a)
|
|
565
|
+
for (const c of n)
|
|
566
|
+
c in s || (s[c] = o[c]);
|
|
567
|
+
}
|
|
568
|
+
function getAllStylesUsed(e) {
|
|
569
|
+
const t = [];
|
|
570
|
+
for (const n of e.steps)
|
|
571
|
+
for (const o in n.styles)
|
|
572
|
+
t.indexOf(o) === -1 && t.push(o);
|
|
573
|
+
return t;
|
|
574
|
+
}
|
|
575
|
+
function triggerAnimation(e) {
|
|
576
|
+
const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
|
|
577
|
+
if (!t.length) {
|
|
578
|
+
warnElementNotPresent(e.elementId || e.id || "");
|
|
579
|
+
return;
|
|
580
|
+
}
|
|
581
|
+
Array.from(t).forEach((n) => {
|
|
582
|
+
augmentAnimation(e, n), n.style.transition = "none", n.style.transitionDelay = "0", assign(n.style, e.steps[0].styles), setTimeout(() => {
|
|
583
|
+
n.style.transition = `all ${e.duration}s ${camelCaseToKebabCase(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s"), assign(n.style, e.steps[1].styles), setTimeout(() => {
|
|
584
|
+
n.style.transition = "", n.style.transitionDelay = "";
|
|
585
|
+
}, (e.delay || 0) * 1e3 + e.duration * 1e3 + 100);
|
|
586
|
+
});
|
|
587
|
+
});
|
|
588
|
+
}
|
|
547
589
|
function BlockStyles(e) {
|
|
548
590
|
const t = function() {
|
|
549
591
|
const r = getProcessedBlock({
|
|
@@ -556,7 +598,7 @@ function BlockStyles(e) {
|
|
|
556
598
|
});
|
|
557
599
|
return checkIsDefined(r.hide) ? !r.hide : checkIsDefined(r.show) ? r.show : !0;
|
|
558
600
|
}, n = function() {
|
|
559
|
-
var
|
|
601
|
+
var p, S, C;
|
|
560
602
|
const r = getProcessedBlock({
|
|
561
603
|
block: e.block,
|
|
562
604
|
localState: e.context.localState,
|
|
@@ -565,29 +607,48 @@ function BlockStyles(e) {
|
|
|
565
607
|
context: e.context.context,
|
|
566
608
|
shouldEvaluateBindings: !0
|
|
567
609
|
}), i = r.responsiveStyles, a = e.context.content, s = getSizesForBreakpoints(
|
|
568
|
-
((
|
|
569
|
-
), c = i == null ? void 0 : i.large, u = i == null ? void 0 : i.medium, g = i == null ? void 0 : i.small,
|
|
570
|
-
if (!
|
|
610
|
+
((p = a == null ? void 0 : a.meta) == null ? void 0 : p.breakpoints) || {}
|
|
611
|
+
), c = i == null ? void 0 : i.large, u = i == null ? void 0 : i.medium, g = i == null ? void 0 : i.small, d = r.id;
|
|
612
|
+
if (!d)
|
|
571
613
|
return "";
|
|
572
614
|
const f = c ? createCssClass({
|
|
573
|
-
className:
|
|
615
|
+
className: d,
|
|
574
616
|
styles: c
|
|
575
|
-
}) : "",
|
|
576
|
-
className:
|
|
617
|
+
}) : "", h = u ? createCssClass({
|
|
618
|
+
className: d,
|
|
577
619
|
styles: u,
|
|
578
620
|
mediaQuery: getMaxWidthQueryForSize(
|
|
579
621
|
"medium",
|
|
580
622
|
s
|
|
581
623
|
)
|
|
582
624
|
}) : "", m = g ? createCssClass({
|
|
583
|
-
className:
|
|
625
|
+
className: d,
|
|
584
626
|
styles: g,
|
|
585
627
|
mediaQuery: getMaxWidthQueryForSize(
|
|
586
628
|
"small",
|
|
587
629
|
s
|
|
588
630
|
)
|
|
589
|
-
}) : "";
|
|
590
|
-
|
|
631
|
+
}) : "", l = r.animations && r.animations.find((y) => y.trigger === "hover");
|
|
632
|
+
let b = "";
|
|
633
|
+
if (l) {
|
|
634
|
+
const y = ((C = (S = l.steps) == null ? void 0 : S[1]) == null ? void 0 : C.styles) || {};
|
|
635
|
+
b = createCssClass({
|
|
636
|
+
className: `${d}:hover`,
|
|
637
|
+
styles: {
|
|
638
|
+
...y,
|
|
639
|
+
transition: `all ${l.duration}s ${camelCaseToKebabCase(
|
|
640
|
+
l.easing
|
|
641
|
+
)}`,
|
|
642
|
+
transitionDelay: l.delay ? `${l.delay}s` : "0s"
|
|
643
|
+
}
|
|
644
|
+
}) || "";
|
|
645
|
+
}
|
|
646
|
+
return [
|
|
647
|
+
f,
|
|
648
|
+
h,
|
|
649
|
+
m,
|
|
650
|
+
b
|
|
651
|
+
].join(" ");
|
|
591
652
|
};
|
|
592
653
|
return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { id: "builderio-block", styles: n() }) }) : null });
|
|
593
654
|
}
|
|
@@ -748,29 +809,29 @@ function Block(e) {
|
|
|
748
809
|
shouldEvaluateBindings: !0
|
|
749
810
|
});
|
|
750
811
|
}, r = function() {
|
|
751
|
-
var
|
|
752
|
-
return e.block.tagName === "a" || ((
|
|
812
|
+
var h;
|
|
813
|
+
return e.block.tagName === "a" || ((h = o().properties) == null ? void 0 : h.href) || o().href ? e.linkComponent || "a" : e.block.tagName || "div";
|
|
753
814
|
}, i = function() {
|
|
754
|
-
var m,
|
|
815
|
+
var m, l;
|
|
755
816
|
if ((m = e.block.repeat) != null && m.collection)
|
|
756
|
-
return !!((
|
|
817
|
+
return !!((l = n()) != null && l.length);
|
|
757
818
|
const f = "hide" in o() ? o().hide : !1;
|
|
758
819
|
return ("show" in o() ? o().show : !0) && !f;
|
|
759
820
|
}, a = function() {
|
|
760
|
-
var
|
|
761
|
-
return !((
|
|
821
|
+
var h;
|
|
822
|
+
return !((h = t()) != null && h.component) && !n() ? o().children ?? [] : [];
|
|
762
823
|
}, s = function() {
|
|
763
|
-
var f,
|
|
824
|
+
var f, h, m, l, b, p, S, C, y, v;
|
|
764
825
|
return {
|
|
765
826
|
blockChildren: o().children ?? [],
|
|
766
827
|
componentRef: (f = t()) == null ? void 0 : f.component,
|
|
767
828
|
componentOptions: {
|
|
768
829
|
...getBlockComponentOptions(o()),
|
|
769
830
|
builderContext: e.context,
|
|
770
|
-
...((
|
|
831
|
+
...((h = t()) == null ? void 0 : h.name) === "Core:Button" || ((m = t()) == null ? void 0 : m.name) === "Symbol" || ((l = t()) == null ? void 0 : l.name) === "Columns" || ((b = t()) == null ? void 0 : b.name) === "Form:Form" ? {
|
|
771
832
|
builderLinkComponent: e.linkComponent
|
|
772
833
|
} : {},
|
|
773
|
-
...((
|
|
834
|
+
...((p = t()) == null ? void 0 : p.name) === "Symbol" || ((S = t()) == null ? void 0 : S.name) === "Columns" || ((C = t()) == null ? void 0 : C.name) === "Form:Form" ? {
|
|
774
835
|
builderComponents: e.registeredComponents
|
|
775
836
|
} : {}
|
|
776
837
|
},
|
|
@@ -779,7 +840,7 @@ function Block(e) {
|
|
|
779
840
|
registeredComponents: e.registeredComponents,
|
|
780
841
|
builderBlock: o(),
|
|
781
842
|
includeBlockProps: ((y = t()) == null ? void 0 : y.noWrap) === !0,
|
|
782
|
-
isInteractive: !((
|
|
843
|
+
isInteractive: !((v = t()) != null && v.isRSC)
|
|
783
844
|
};
|
|
784
845
|
};
|
|
785
846
|
return /* @__PURE__ */ jsx(Fragment, { children: i() ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -797,11 +858,11 @@ function Block(e) {
|
|
|
797
858
|
includeBlockProps: s().includeBlockProps,
|
|
798
859
|
isInteractive: s().isInteractive
|
|
799
860
|
}
|
|
800
|
-
) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (g = n()) == null ? void 0 : g.map((
|
|
861
|
+
) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (g = n()) == null ? void 0 : g.map((d, f) => /* @__PURE__ */ jsx(
|
|
801
862
|
RepeatedBlock,
|
|
802
863
|
{
|
|
803
|
-
repeatContext:
|
|
804
|
-
block:
|
|
864
|
+
repeatContext: d.context,
|
|
865
|
+
block: d.block,
|
|
805
866
|
registeredComponents: e.registeredComponents,
|
|
806
867
|
linkComponent: e.linkComponent
|
|
807
868
|
},
|
|
@@ -828,15 +889,15 @@ function Block(e) {
|
|
|
828
889
|
isInteractive: s().isInteractive
|
|
829
890
|
}
|
|
830
891
|
),
|
|
831
|
-
(u = a()) == null ? void 0 : u.map((
|
|
892
|
+
(u = a()) == null ? void 0 : u.map((d) => /* @__PURE__ */ jsx(
|
|
832
893
|
Block,
|
|
833
894
|
{
|
|
834
|
-
block:
|
|
895
|
+
block: d,
|
|
835
896
|
registeredComponents: e.registeredComponents,
|
|
836
897
|
linkComponent: e.linkComponent,
|
|
837
898
|
context: e.context
|
|
838
899
|
},
|
|
839
|
-
|
|
900
|
+
d.id
|
|
840
901
|
))
|
|
841
902
|
]
|
|
842
903
|
}
|
|
@@ -868,23 +929,23 @@ function Blocks(e) {
|
|
|
868
929
|
);
|
|
869
930
|
}
|
|
870
931
|
function Columns(e) {
|
|
871
|
-
var
|
|
872
|
-
const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet", r = function(
|
|
932
|
+
var h;
|
|
933
|
+
const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet", r = function(l) {
|
|
873
934
|
var b;
|
|
874
|
-
return ((b = n[
|
|
875
|
-
}, i = function(
|
|
935
|
+
return ((b = n[l]) == null ? void 0 : b.width) || 100 / n.length;
|
|
936
|
+
}, i = function(l) {
|
|
876
937
|
const b = t * (n.length - 1) / n.length;
|
|
877
|
-
return `calc(${r(
|
|
938
|
+
return `calc(${r(l)}% - ${b}px)`;
|
|
878
939
|
}, a = function({
|
|
879
|
-
stackedStyle:
|
|
940
|
+
stackedStyle: l,
|
|
880
941
|
desktopStyle: b
|
|
881
942
|
}) {
|
|
882
|
-
return o === "tablet" ?
|
|
943
|
+
return o === "tablet" ? l : b;
|
|
883
944
|
}, s = function({
|
|
884
|
-
stackedStyle:
|
|
945
|
+
stackedStyle: l,
|
|
885
946
|
desktopStyle: b
|
|
886
947
|
}) {
|
|
887
|
-
return o === "never" ? b :
|
|
948
|
+
return o === "never" ? b : l;
|
|
888
949
|
}, c = e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column", u = function() {
|
|
889
950
|
return {
|
|
890
951
|
"--flex-dir": c,
|
|
@@ -893,41 +954,41 @@ function Columns(e) {
|
|
|
893
954
|
desktopStyle: "row"
|
|
894
955
|
})
|
|
895
956
|
};
|
|
896
|
-
}, g = function(
|
|
897
|
-
const b =
|
|
957
|
+
}, g = function(l) {
|
|
958
|
+
const b = l === 0 ? 0 : t, p = i(l), S = `${b}px`, C = "100%", y = 0;
|
|
898
959
|
return {
|
|
899
960
|
...{
|
|
900
961
|
display: "flex",
|
|
901
962
|
flexDirection: "column",
|
|
902
963
|
alignItems: "stretch"
|
|
903
964
|
},
|
|
904
|
-
width:
|
|
965
|
+
width: p,
|
|
905
966
|
["marginLeft"]: S,
|
|
906
967
|
"--column-width-mobile": s({
|
|
907
|
-
stackedStyle:
|
|
908
|
-
desktopStyle:
|
|
968
|
+
stackedStyle: C,
|
|
969
|
+
desktopStyle: p
|
|
909
970
|
}),
|
|
910
971
|
"--column-margin-left-mobile": s({
|
|
911
972
|
stackedStyle: y,
|
|
912
973
|
desktopStyle: S
|
|
913
974
|
}),
|
|
914
975
|
"--column-width-tablet": a({
|
|
915
|
-
stackedStyle:
|
|
916
|
-
desktopStyle:
|
|
976
|
+
stackedStyle: C,
|
|
977
|
+
desktopStyle: p
|
|
917
978
|
}),
|
|
918
979
|
"--column-margin-left-tablet": a({
|
|
919
980
|
stackedStyle: y,
|
|
920
981
|
desktopStyle: S
|
|
921
982
|
})
|
|
922
983
|
};
|
|
923
|
-
},
|
|
924
|
-
var
|
|
984
|
+
}, d = function(l) {
|
|
985
|
+
var p, S;
|
|
925
986
|
return getSizesForBreakpoints(
|
|
926
|
-
((S = (
|
|
927
|
-
)[
|
|
987
|
+
((S = (p = e.builderContext.content) == null ? void 0 : p.meta) == null ? void 0 : S.breakpoints) || {}
|
|
988
|
+
)[l].max;
|
|
928
989
|
}, f = function() {
|
|
929
990
|
return `
|
|
930
|
-
@media (max-width: ${
|
|
991
|
+
@media (max-width: ${d("medium")}px) {
|
|
931
992
|
.${e.builderBlock.id}-breakpoints {
|
|
932
993
|
flex-direction: var(--flex-dir-tablet);
|
|
933
994
|
align-items: stretch;
|
|
@@ -939,7 +1000,7 @@ function Columns(e) {
|
|
|
939
1000
|
}
|
|
940
1001
|
}
|
|
941
1002
|
|
|
942
|
-
@media (max-width: ${
|
|
1003
|
+
@media (max-width: ${d("small")}px) {
|
|
943
1004
|
.${e.builderBlock.id}-breakpoints {
|
|
944
1005
|
flex-direction: var(--flex-dir);
|
|
945
1006
|
align-items: stretch;
|
|
@@ -960,7 +1021,7 @@ function Columns(e) {
|
|
|
960
1021
|
style: u(),
|
|
961
1022
|
children: [
|
|
962
1023
|
/* @__PURE__ */ jsx(InlinedStyles, { id: "builderio-columns", styles: f() }),
|
|
963
|
-
(
|
|
1024
|
+
(h = e.columns) == null ? void 0 : h.map((m, l) => /* @__PURE__ */ jsx(
|
|
964
1025
|
DynamicRenderer,
|
|
965
1026
|
{
|
|
966
1027
|
TagName: m.link ? e.builderLinkComponent || "a" : "div",
|
|
@@ -970,12 +1031,12 @@ function Columns(e) {
|
|
|
970
1031
|
href: m.link
|
|
971
1032
|
} : {},
|
|
972
1033
|
[getClassPropName()]: "builder-column",
|
|
973
|
-
style: mapStyleObjToStrIfNeeded(g(
|
|
1034
|
+
style: mapStyleObjToStrIfNeeded(g(l))
|
|
974
1035
|
},
|
|
975
1036
|
children: /* @__PURE__ */ jsx(
|
|
976
1037
|
Blocks,
|
|
977
1038
|
{
|
|
978
|
-
path: `component.options.columns.${
|
|
1039
|
+
path: `component.options.columns.${l}.blocks`,
|
|
979
1040
|
parent: e.builderBlock.id,
|
|
980
1041
|
styleProp: {
|
|
981
1042
|
flexGrow: "1"
|
|
@@ -987,7 +1048,7 @@ function Columns(e) {
|
|
|
987
1048
|
}
|
|
988
1049
|
)
|
|
989
1050
|
},
|
|
990
|
-
|
|
1051
|
+
l
|
|
991
1052
|
))
|
|
992
1053
|
]
|
|
993
1054
|
}
|
|
@@ -1426,13 +1487,13 @@ const getTopLevelDomain = (e) => {
|
|
|
1426
1487
|
function n(a, s = 6e4) {
|
|
1427
1488
|
return new Promise((c, u) => {
|
|
1428
1489
|
const g = document.createElement("img");
|
|
1429
|
-
let
|
|
1490
|
+
let d = !1;
|
|
1430
1491
|
g.onload = () => {
|
|
1431
|
-
|
|
1492
|
+
d = !0, c(g);
|
|
1432
1493
|
}, g.addEventListener("error", (f) => {
|
|
1433
1494
|
console.warn("Image load failed", f.error), u(f.error);
|
|
1434
1495
|
}), g.src = a, setTimeout(() => {
|
|
1435
|
-
|
|
1496
|
+
d || u(new Error("Image load timed out"));
|
|
1436
1497
|
}, s);
|
|
1437
1498
|
});
|
|
1438
1499
|
}
|
|
@@ -2021,38 +2082,38 @@ const DEFAULT_API_VERSION = "v3", BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUIL
|
|
|
2021
2082
|
apiVersion: c = DEFAULT_API_VERSION,
|
|
2022
2083
|
fields: u,
|
|
2023
2084
|
omit: g,
|
|
2024
|
-
offset:
|
|
2085
|
+
offset: d,
|
|
2025
2086
|
cacheSeconds: f,
|
|
2026
|
-
staleCacheSeconds:
|
|
2087
|
+
staleCacheSeconds: h,
|
|
2027
2088
|
sort: m,
|
|
2028
|
-
includeUnpublished:
|
|
2089
|
+
includeUnpublished: l
|
|
2029
2090
|
} = e;
|
|
2030
2091
|
if (!i)
|
|
2031
2092
|
throw new Error("Missing API key");
|
|
2032
2093
|
if (!["v3"].includes(c))
|
|
2033
2094
|
throw new Error(`Invalid apiVersion: expected 'v3', received '${c}'`);
|
|
2034
|
-
const b = t !== 1,
|
|
2035
|
-
if (
|
|
2095
|
+
const b = t !== 1, p = new URL(`https://cdn.builder.io/api/${c}/content/${r}`);
|
|
2096
|
+
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", g || "meta.componentsUsed"), u && p.searchParams.set("fields", u), Number.isFinite(d) && d > -1 && p.searchParams.set("offset", String(Math.floor(d))), typeof l == "boolean" && p.searchParams.set("includeUnpublished", String(l)), f && isPositiveNumber(f) && p.searchParams.set("cacheSeconds", String(f)), h && isPositiveNumber(h) && p.searchParams.set("staleCacheSeconds", String(h)), m) {
|
|
2036
2097
|
const y = flatten({
|
|
2037
2098
|
sort: m
|
|
2038
2099
|
});
|
|
2039
|
-
for (const
|
|
2040
|
-
|
|
2100
|
+
for (const v in y)
|
|
2101
|
+
p.searchParams.set(v, JSON.stringify(y[v]));
|
|
2041
2102
|
}
|
|
2042
2103
|
const S = {
|
|
2043
2104
|
...getBuilderSearchParamsFromWindow(),
|
|
2044
2105
|
...normalizeSearchParams(e.options || {})
|
|
2045
|
-
},
|
|
2046
|
-
for (const y in
|
|
2047
|
-
|
|
2048
|
-
if (n &&
|
|
2106
|
+
}, C = flatten(S);
|
|
2107
|
+
for (const y in C)
|
|
2108
|
+
p.searchParams.set(y, String(C[y]));
|
|
2109
|
+
if (n && p.searchParams.set("userAttributes", JSON.stringify(n)), o) {
|
|
2049
2110
|
const y = flatten({
|
|
2050
2111
|
query: o
|
|
2051
2112
|
});
|
|
2052
|
-
for (const
|
|
2053
|
-
|
|
2113
|
+
for (const v in y)
|
|
2114
|
+
p.searchParams.set(v, JSON.stringify(y[v]));
|
|
2054
2115
|
}
|
|
2055
|
-
return
|
|
2116
|
+
return p;
|
|
2056
2117
|
}, checkContentHasResults = (e) => "results" in e;
|
|
2057
2118
|
async function fetchOneEntry(e) {
|
|
2058
2119
|
const t = await fetchEntries({
|
|
@@ -2102,10 +2163,8 @@ async function fetchEntries(e) {
|
|
|
2102
2163
|
}
|
|
2103
2164
|
}
|
|
2104
2165
|
function isPreviewing(e) {
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
const t = getSearchString(e || window.location.search);
|
|
2108
|
-
return isEditing(t) ? !1 : t.indexOf("builder.preview=") !== -1;
|
|
2166
|
+
const t = e || (isBrowser() ? window.location.search : void 0);
|
|
2167
|
+
return t ? getSearchString(t).indexOf("builder.preview=") !== -1 : !1;
|
|
2109
2168
|
}
|
|
2110
2169
|
function uuidv4() {
|
|
2111
2170
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
@@ -2296,7 +2355,7 @@ function isFromTrustedHost(e, t) {
|
|
|
2296
2355
|
const n = new URL(t.origin), o = n.hostname;
|
|
2297
2356
|
return (e || DEFAULT_TRUSTED_HOSTS).findIndex((r) => r.startsWith("*.") ? o.endsWith(r.slice(1)) : r === o) > -1;
|
|
2298
2357
|
}
|
|
2299
|
-
const SDK_VERSION = "0.14.
|
|
2358
|
+
const SDK_VERSION = "0.14.16", registry = {};
|
|
2300
2359
|
function register(e, t) {
|
|
2301
2360
|
let n = registry[e];
|
|
2302
2361
|
if (n || (n = registry[e] = []), n.push(t), isBrowser()) {
|
|
@@ -2367,11 +2426,11 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2367
2426
|
switch (r.type) {
|
|
2368
2427
|
case "builder.evaluate": {
|
|
2369
2428
|
const s = r.data.text, c = r.data.arguments || [], u = r.data.id, g = new Function(s);
|
|
2370
|
-
let
|
|
2429
|
+
let d, f = null;
|
|
2371
2430
|
try {
|
|
2372
|
-
|
|
2373
|
-
} catch (
|
|
2374
|
-
f =
|
|
2431
|
+
d = g.apply(null, c);
|
|
2432
|
+
} catch (h) {
|
|
2433
|
+
f = h;
|
|
2375
2434
|
}
|
|
2376
2435
|
f ? (i = window.parent) == null || i.postMessage({
|
|
2377
2436
|
type: "builder.evaluateError",
|
|
@@ -2379,19 +2438,19 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2379
2438
|
id: u,
|
|
2380
2439
|
error: f.message
|
|
2381
2440
|
}
|
|
2382
|
-
}, "*") :
|
|
2441
|
+
}, "*") : d && typeof d.then == "function" ? d.then((h) => {
|
|
2383
2442
|
var m;
|
|
2384
2443
|
(m = window.parent) == null || m.postMessage({
|
|
2385
2444
|
type: "builder.evaluateResult",
|
|
2386
2445
|
data: {
|
|
2387
2446
|
id: u,
|
|
2388
|
-
result:
|
|
2447
|
+
result: h
|
|
2389
2448
|
}
|
|
2390
2449
|
}, "*");
|
|
2391
2450
|
}).catch(console.error) : (a = window.parent) == null || a.postMessage({
|
|
2392
2451
|
type: "builder.evaluateResult",
|
|
2393
2452
|
data: {
|
|
2394
|
-
result:
|
|
2453
|
+
result: d,
|
|
2395
2454
|
id: u
|
|
2396
2455
|
}
|
|
2397
2456
|
}, "*");
|
|
@@ -2444,49 +2503,7 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2444
2503
|
return window.addEventListener("message", o), () => {
|
|
2445
2504
|
window.removeEventListener("message", o);
|
|
2446
2505
|
};
|
|
2447
|
-
}
|
|
2448
|
-
function assign(e, ...t) {
|
|
2449
|
-
const n = Object(e);
|
|
2450
|
-
for (let o = 1; o < arguments.length; o++) {
|
|
2451
|
-
const r = arguments[o];
|
|
2452
|
-
if (r != null)
|
|
2453
|
-
for (const i in r)
|
|
2454
|
-
Object.prototype.hasOwnProperty.call(r, i) && (n[i] = r[i]);
|
|
2455
|
-
}
|
|
2456
|
-
return n;
|
|
2457
|
-
}
|
|
2458
|
-
const camelCaseToKebabCase = (e) => e ? e.replace(/([A-Z])/g, (t) => `-${t[0].toLowerCase()}`) : "";
|
|
2459
|
-
function warnElementNotPresent(e) {
|
|
2460
|
-
console.warn(`Cannot animate element: element with ID ${e} not found!`);
|
|
2461
|
-
}
|
|
2462
|
-
function augmentAnimation(e, t) {
|
|
2463
|
-
const n = getAllStylesUsed(e), o = getComputedStyle(t), r = e.steps[0].styles, i = e.steps[e.steps.length - 1].styles, a = [r, i];
|
|
2464
|
-
for (const s of a)
|
|
2465
|
-
for (const c of n)
|
|
2466
|
-
c in s || (s[c] = o[c]);
|
|
2467
|
-
}
|
|
2468
|
-
function getAllStylesUsed(e) {
|
|
2469
|
-
const t = [];
|
|
2470
|
-
for (const n of e.steps)
|
|
2471
|
-
for (const o in n.styles)
|
|
2472
|
-
t.indexOf(o) === -1 && t.push(o);
|
|
2473
|
-
return t;
|
|
2474
|
-
}
|
|
2475
|
-
function triggerAnimation(e) {
|
|
2476
|
-
const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
|
|
2477
|
-
if (!t.length) {
|
|
2478
|
-
warnElementNotPresent(e.elementId || e.id || "");
|
|
2479
|
-
return;
|
|
2480
|
-
}
|
|
2481
|
-
Array.from(t).forEach((n) => {
|
|
2482
|
-
augmentAnimation(e, n), n.style.transition = "none", n.style.transitionDelay = "0", assign(n.style, e.steps[0].styles), setTimeout(() => {
|
|
2483
|
-
n.style.transition = `all ${e.duration}s ${camelCaseToKebabCase(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s"), assign(n.style, e.steps[1].styles), setTimeout(() => {
|
|
2484
|
-
n.style.transition = "", n.style.transitionDelay = "";
|
|
2485
|
-
}, (e.delay || 0) * 1e3 + e.duration * 1e3 + 100);
|
|
2486
|
-
});
|
|
2487
|
-
});
|
|
2488
|
-
}
|
|
2489
|
-
const getCssFromFont = (e) => {
|
|
2506
|
+
}, getCssFromFont = (e) => {
|
|
2490
2507
|
var i;
|
|
2491
2508
|
const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], o = e.fileUrl ?? ((i = e == null ? void 0 : e.files) == null ? void 0 : i.regular);
|
|
2492
2509
|
let r = "";
|
|
@@ -2580,7 +2597,7 @@ const getRootStateInitialValue = ({
|
|
|
2580
2597
|
meta: e == null ? void 0 : e.meta
|
|
2581
2598
|
} : void 0;
|
|
2582
2599
|
function ContentComponent(e) {
|
|
2583
|
-
var r, i, a, s, c, u, g,
|
|
2600
|
+
var r, i, a, s, c, u, g, d, f;
|
|
2584
2601
|
const t = getUpdateVariantVisibilityScript({
|
|
2585
2602
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2586
2603
|
variationId: (r = e.content) == null ? void 0 : r.testVariationId,
|
|
@@ -2590,11 +2607,11 @@ function ContentComponent(e) {
|
|
|
2590
2607
|
...getDefaultRegisteredComponents(),
|
|
2591
2608
|
...e.customComponents || []
|
|
2592
2609
|
].reduce(
|
|
2593
|
-
(
|
|
2594
|
-
...
|
|
2595
|
-
[
|
|
2610
|
+
(h, { component: m, ...l }) => ({
|
|
2611
|
+
...h,
|
|
2612
|
+
[l.name]: {
|
|
2596
2613
|
component: m,
|
|
2597
|
-
...serializeComponentInfo(
|
|
2614
|
+
...serializeComponentInfo(l)
|
|
2598
2615
|
}
|
|
2599
2616
|
}),
|
|
2600
2617
|
{}
|
|
@@ -2617,9 +2634,9 @@ function ContentComponent(e) {
|
|
|
2617
2634
|
...getDefaultRegisteredComponents(),
|
|
2618
2635
|
...e.customComponents || []
|
|
2619
2636
|
].reduce(
|
|
2620
|
-
(
|
|
2621
|
-
...
|
|
2622
|
-
[
|
|
2637
|
+
(h, { component: m, ...l }) => ({
|
|
2638
|
+
...h,
|
|
2639
|
+
[l.name]: serializeComponentInfo(l)
|
|
2623
2640
|
}),
|
|
2624
2641
|
{}
|
|
2625
2642
|
),
|
|
@@ -2664,7 +2681,7 @@ function ContentComponent(e) {
|
|
|
2664
2681
|
/* @__PURE__ */ jsx(
|
|
2665
2682
|
Blocks,
|
|
2666
2683
|
{
|
|
2667
|
-
blocks: (f = (
|
|
2684
|
+
blocks: (f = (d = o.content) == null ? void 0 : d.data) == null ? void 0 : f.blocks,
|
|
2668
2685
|
context: o,
|
|
2669
2686
|
registeredComponents: n,
|
|
2670
2687
|
linkComponent: e.linkComponent
|
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-f9ebade4.cjs"),e=require("./bundle-0fc157c8.cjs");require("react/jsx-runtime");require("react");require("./USE_SERVER_BUNDLE-e1e73ba6.cjs");require("next/navigation");require("lru-cache");exports.BuilderContext=t.builderContext;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 { f as n, c as m, F as c, d as p, S as g, V as d } from "./USE_CLIENT_BUNDLE-
|
|
2
|
-
import { B as l, C as f, w as B, S as C, T as E, F as S, q as x, E as h, G as b, u as y, z as F, c as P, j as T, x as k, y as w, D as R, A as V } from "./bundle-
|
|
1
|
+
import { f as n, c as m, F as c, d as p, S as g, V as d } from "./USE_CLIENT_BUNDLE-f8067984.js";
|
|
2
|
+
import { B as l, C as f, w as B, S as C, T as E, F as S, q as x, E as h, G as b, u as y, z as F, c as P, j as T, x as k, y as w, D as R, A as V } from "./bundle-8d3cab60.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
|
-
import "./USE_SERVER_BUNDLE-
|
|
5
|
+
import "./USE_SERVER_BUNDLE-4b52a0c0.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.16",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/nextjs",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|