@builder.io/sdk-react-nextjs 0.14.14 → 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/browser/{USE_CLIENT_BUNDLE-70154bac.cjs → USE_CLIENT_BUNDLE-026b8026.cjs} +3 -3
- package/lib/{node/USE_CLIENT_BUNDLE-89941ef9.js → browser/USE_CLIENT_BUNDLE-30c6c6c1.js} +15 -15
- package/lib/{edge/USE_SERVER_BUNDLE-1121f242.js → browser/USE_SERVER_BUNDLE-685e6983.js} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-d3cc548d.cjs → browser/USE_SERVER_BUNDLE-ce31724e.cjs} +1 -1
- package/lib/browser/{bundle-f1cd7d0a.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/{browser/USE_CLIENT_BUNDLE-ad032551.js → edge/USE_CLIENT_BUNDLE-5b0b3e9b.js} +15 -15
- package/lib/{node/USE_CLIENT_BUNDLE-3989e89a.cjs → edge/USE_CLIENT_BUNDLE-9b110136.cjs} +3 -3
- package/lib/{node/USE_SERVER_BUNDLE-f4da05aa.js → edge/USE_SERVER_BUNDLE-0f9fd6f2.js} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-3ab6385f.cjs → edge/USE_SERVER_BUNDLE-b3d619da.cjs} +1 -1
- package/lib/edge/{bundle-8245f8e0.js → bundle-b24e7c9b.js} +1049 -1032
- package/lib/edge/{bundle-b9b92cc4.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-c5064905.js → node/USE_CLIENT_BUNDLE-f8067984.js} +15 -15
- package/lib/{edge/USE_CLIENT_BUNDLE-eb046f66.cjs → node/USE_CLIENT_BUNDLE-f9ebade4.cjs} +3 -3
- package/lib/{browser/USE_SERVER_BUNDLE-ad177672.js → node/USE_SERVER_BUNDLE-4b52a0c0.js} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-f82cfb7c.cjs → node/USE_SERVER_BUNDLE-e1e73ba6.cjs} +1 -1
- package/lib/node/{bundle-67ae1b65.cjs → bundle-0fc157c8.cjs} +19 -12
- package/lib/node/{bundle-eb971cd7.js → bundle-8d3cab60.js} +189 -154
- 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/get-content/types.d.ts +3 -3
- package/types/cjs/functions/is-previewing.d.ts +1 -1
- package/types/cjs/helpers/logger.d.ts +1 -0
- package/types/esm/components/block/animator.d.ts +1 -1
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/functions/get-content/types.d.ts +3 -3
- package/types/esm/functions/is-previewing.d.ts +1 -1
- package/types/esm/helpers/logger.d.ts +1 -0
- package/lib/browser/bundle-e04a480e.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()) {
|
|
@@ -203,8 +204,26 @@ if (typeof output === 'object' && output !== null) {
|
|
|
203
204
|
|
|
204
205
|
output;
|
|
205
206
|
`;
|
|
207
|
+
};
|
|
208
|
+
let IVM_INSTANCE = null;
|
|
209
|
+
const getIvm = () => {
|
|
210
|
+
try {
|
|
211
|
+
const e = safeDynamicRequire("isolated-vm");
|
|
212
|
+
if (e)
|
|
213
|
+
return e;
|
|
214
|
+
} catch (e) {
|
|
215
|
+
logger.error("isolated-vm import error.", e);
|
|
216
|
+
}
|
|
217
|
+
throw new Error(`${MSG_PREFIX}could not import \`isolated-vm\` module for safe script execution on Node server.
|
|
218
|
+
|
|
219
|
+
In certain Node environments, the SDK requires additional initialization steps. This can be achieved by
|
|
220
|
+
importing and calling \`initializeNodeRuntime()\` from "@builder.io/sdk-react/node/init". This must be done in
|
|
221
|
+
a server-only execution path within your application.
|
|
222
|
+
|
|
223
|
+
Please see the documentation for more information: https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments
|
|
224
|
+
`);
|
|
206
225
|
}, getIsolateContext = () => {
|
|
207
|
-
const e =
|
|
226
|
+
const e = getIvm();
|
|
208
227
|
return new e.Isolate({
|
|
209
228
|
memoryLimit: 128
|
|
210
229
|
}).createContextSync();
|
|
@@ -217,7 +236,7 @@ output;
|
|
|
217
236
|
rootSetState: i,
|
|
218
237
|
rootState: a
|
|
219
238
|
}) => {
|
|
220
|
-
const s =
|
|
239
|
+
const s = getIvm(), c = fastClone({
|
|
221
240
|
...a,
|
|
222
241
|
...r
|
|
223
242
|
}), u = getFunctionArguments({
|
|
@@ -225,29 +244,29 @@ output;
|
|
|
225
244
|
context: n,
|
|
226
245
|
event: o,
|
|
227
246
|
state: c
|
|
228
|
-
}), g = getIsolateContext(),
|
|
229
|
-
|
|
247
|
+
}), g = getIsolateContext(), d = g.global;
|
|
248
|
+
d.setSync("global", d.derefInto()), d.setSync("log", function(...m) {
|
|
230
249
|
console.log(...m);
|
|
231
|
-
}),
|
|
232
|
-
set(a, m,
|
|
233
|
-
}), u.forEach(([m,
|
|
234
|
-
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(
|
|
235
254
|
// workaround: methods with default values for arguments is not being cloned over
|
|
236
255
|
m === "builder" ? {
|
|
237
|
-
...
|
|
238
|
-
getUserAttributes: () =>
|
|
239
|
-
} :
|
|
256
|
+
...l,
|
|
257
|
+
getUserAttributes: () => l.getUserAttributes()
|
|
258
|
+
} : l
|
|
240
259
|
) : null;
|
|
241
|
-
|
|
242
|
-
}),
|
|
260
|
+
d.setSync(getSyncValName(m), b);
|
|
261
|
+
}), d.setSync(INJECTED_IVM_GLOBAL, s);
|
|
243
262
|
const f = processCode({
|
|
244
263
|
code: e,
|
|
245
264
|
args: u
|
|
246
|
-
}),
|
|
265
|
+
}), h = g.evalSync(f);
|
|
247
266
|
try {
|
|
248
|
-
return JSON.parse(
|
|
267
|
+
return JSON.parse(h);
|
|
249
268
|
} catch {
|
|
250
|
-
return
|
|
269
|
+
return h;
|
|
251
270
|
}
|
|
252
271
|
}, checkIsDefined = (e) => e != null;
|
|
253
272
|
function isNodeRuntime() {
|
|
@@ -260,7 +279,7 @@ const shouldForceBrowserRuntimeInNode = () => {
|
|
|
260
279
|
return !1;
|
|
261
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");
|
|
262
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;
|
|
263
|
-
}, chooseBrowserOrServerEval = (e) => isBrowser() || shouldForceBrowserRuntimeInNode() ? runInBrowser(e) : runInNode(e), _EvalCache = class
|
|
282
|
+
}, chooseBrowserOrServerEval = (e) => isBrowser() || shouldForceBrowserRuntimeInNode() ? runInBrowser(e) : runInNode(e), _EvalCache = class k {
|
|
264
283
|
static getCacheKey(t) {
|
|
265
284
|
return JSON.stringify({
|
|
266
285
|
...t,
|
|
@@ -270,10 +289,10 @@ const shouldForceBrowserRuntimeInNode = () => {
|
|
|
270
289
|
});
|
|
271
290
|
}
|
|
272
291
|
static getCachedValue(t) {
|
|
273
|
-
return
|
|
292
|
+
return k.cache.get(t);
|
|
274
293
|
}
|
|
275
294
|
static setCachedValue(t, n) {
|
|
276
|
-
|
|
295
|
+
k.cache.size > 20 && k.cache.delete(k.cache.keys().next().value), k.cache.set(t, {
|
|
277
296
|
value: n
|
|
278
297
|
});
|
|
279
298
|
}
|
|
@@ -526,6 +545,47 @@ function InlinedStyles(e) {
|
|
|
526
545
|
}
|
|
527
546
|
);
|
|
528
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
|
+
}
|
|
529
589
|
function BlockStyles(e) {
|
|
530
590
|
const t = function() {
|
|
531
591
|
const r = getProcessedBlock({
|
|
@@ -538,7 +598,7 @@ function BlockStyles(e) {
|
|
|
538
598
|
});
|
|
539
599
|
return checkIsDefined(r.hide) ? !r.hide : checkIsDefined(r.show) ? r.show : !0;
|
|
540
600
|
}, n = function() {
|
|
541
|
-
var
|
|
601
|
+
var p, S, C;
|
|
542
602
|
const r = getProcessedBlock({
|
|
543
603
|
block: e.block,
|
|
544
604
|
localState: e.context.localState,
|
|
@@ -547,29 +607,48 @@ function BlockStyles(e) {
|
|
|
547
607
|
context: e.context.context,
|
|
548
608
|
shouldEvaluateBindings: !0
|
|
549
609
|
}), i = r.responsiveStyles, a = e.context.content, s = getSizesForBreakpoints(
|
|
550
|
-
((
|
|
551
|
-
), c = i == null ? void 0 : i.large, u = i == null ? void 0 : i.medium, g = i == null ? void 0 : i.small,
|
|
552
|
-
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)
|
|
553
613
|
return "";
|
|
554
614
|
const f = c ? createCssClass({
|
|
555
|
-
className:
|
|
615
|
+
className: d,
|
|
556
616
|
styles: c
|
|
557
|
-
}) : "",
|
|
558
|
-
className:
|
|
617
|
+
}) : "", h = u ? createCssClass({
|
|
618
|
+
className: d,
|
|
559
619
|
styles: u,
|
|
560
620
|
mediaQuery: getMaxWidthQueryForSize(
|
|
561
621
|
"medium",
|
|
562
622
|
s
|
|
563
623
|
)
|
|
564
624
|
}) : "", m = g ? createCssClass({
|
|
565
|
-
className:
|
|
625
|
+
className: d,
|
|
566
626
|
styles: g,
|
|
567
627
|
mediaQuery: getMaxWidthQueryForSize(
|
|
568
628
|
"small",
|
|
569
629
|
s
|
|
570
630
|
)
|
|
571
|
-
}) : "";
|
|
572
|
-
|
|
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(" ");
|
|
573
652
|
};
|
|
574
653
|
return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { id: "builderio-block", styles: n() }) }) : null });
|
|
575
654
|
}
|
|
@@ -730,29 +809,29 @@ function Block(e) {
|
|
|
730
809
|
shouldEvaluateBindings: !0
|
|
731
810
|
});
|
|
732
811
|
}, r = function() {
|
|
733
|
-
var
|
|
734
|
-
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";
|
|
735
814
|
}, i = function() {
|
|
736
|
-
var m,
|
|
815
|
+
var m, l;
|
|
737
816
|
if ((m = e.block.repeat) != null && m.collection)
|
|
738
|
-
return !!((
|
|
817
|
+
return !!((l = n()) != null && l.length);
|
|
739
818
|
const f = "hide" in o() ? o().hide : !1;
|
|
740
819
|
return ("show" in o() ? o().show : !0) && !f;
|
|
741
820
|
}, a = function() {
|
|
742
|
-
var
|
|
743
|
-
return !((
|
|
821
|
+
var h;
|
|
822
|
+
return !((h = t()) != null && h.component) && !n() ? o().children ?? [] : [];
|
|
744
823
|
}, s = function() {
|
|
745
|
-
var f,
|
|
824
|
+
var f, h, m, l, b, p, S, C, y, v;
|
|
746
825
|
return {
|
|
747
826
|
blockChildren: o().children ?? [],
|
|
748
827
|
componentRef: (f = t()) == null ? void 0 : f.component,
|
|
749
828
|
componentOptions: {
|
|
750
829
|
...getBlockComponentOptions(o()),
|
|
751
830
|
builderContext: e.context,
|
|
752
|
-
...((
|
|
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" ? {
|
|
753
832
|
builderLinkComponent: e.linkComponent
|
|
754
833
|
} : {},
|
|
755
|
-
...((
|
|
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" ? {
|
|
756
835
|
builderComponents: e.registeredComponents
|
|
757
836
|
} : {}
|
|
758
837
|
},
|
|
@@ -761,7 +840,7 @@ function Block(e) {
|
|
|
761
840
|
registeredComponents: e.registeredComponents,
|
|
762
841
|
builderBlock: o(),
|
|
763
842
|
includeBlockProps: ((y = t()) == null ? void 0 : y.noWrap) === !0,
|
|
764
|
-
isInteractive: !((
|
|
843
|
+
isInteractive: !((v = t()) != null && v.isRSC)
|
|
765
844
|
};
|
|
766
845
|
};
|
|
767
846
|
return /* @__PURE__ */ jsx(Fragment, { children: i() ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -779,11 +858,11 @@ function Block(e) {
|
|
|
779
858
|
includeBlockProps: s().includeBlockProps,
|
|
780
859
|
isInteractive: s().isInteractive
|
|
781
860
|
}
|
|
782
|
-
) }) : /* @__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(
|
|
783
862
|
RepeatedBlock,
|
|
784
863
|
{
|
|
785
|
-
repeatContext:
|
|
786
|
-
block:
|
|
864
|
+
repeatContext: d.context,
|
|
865
|
+
block: d.block,
|
|
787
866
|
registeredComponents: e.registeredComponents,
|
|
788
867
|
linkComponent: e.linkComponent
|
|
789
868
|
},
|
|
@@ -810,15 +889,15 @@ function Block(e) {
|
|
|
810
889
|
isInteractive: s().isInteractive
|
|
811
890
|
}
|
|
812
891
|
),
|
|
813
|
-
(u = a()) == null ? void 0 : u.map((
|
|
892
|
+
(u = a()) == null ? void 0 : u.map((d) => /* @__PURE__ */ jsx(
|
|
814
893
|
Block,
|
|
815
894
|
{
|
|
816
|
-
block:
|
|
895
|
+
block: d,
|
|
817
896
|
registeredComponents: e.registeredComponents,
|
|
818
897
|
linkComponent: e.linkComponent,
|
|
819
898
|
context: e.context
|
|
820
899
|
},
|
|
821
|
-
|
|
900
|
+
d.id
|
|
822
901
|
))
|
|
823
902
|
]
|
|
824
903
|
}
|
|
@@ -850,23 +929,23 @@ function Blocks(e) {
|
|
|
850
929
|
);
|
|
851
930
|
}
|
|
852
931
|
function Columns(e) {
|
|
853
|
-
var
|
|
854
|
-
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) {
|
|
855
934
|
var b;
|
|
856
|
-
return ((b = n[
|
|
857
|
-
}, i = function(
|
|
935
|
+
return ((b = n[l]) == null ? void 0 : b.width) || 100 / n.length;
|
|
936
|
+
}, i = function(l) {
|
|
858
937
|
const b = t * (n.length - 1) / n.length;
|
|
859
|
-
return `calc(${r(
|
|
938
|
+
return `calc(${r(l)}% - ${b}px)`;
|
|
860
939
|
}, a = function({
|
|
861
|
-
stackedStyle:
|
|
940
|
+
stackedStyle: l,
|
|
862
941
|
desktopStyle: b
|
|
863
942
|
}) {
|
|
864
|
-
return o === "tablet" ?
|
|
943
|
+
return o === "tablet" ? l : b;
|
|
865
944
|
}, s = function({
|
|
866
|
-
stackedStyle:
|
|
945
|
+
stackedStyle: l,
|
|
867
946
|
desktopStyle: b
|
|
868
947
|
}) {
|
|
869
|
-
return o === "never" ? b :
|
|
948
|
+
return o === "never" ? b : l;
|
|
870
949
|
}, c = e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column", u = function() {
|
|
871
950
|
return {
|
|
872
951
|
"--flex-dir": c,
|
|
@@ -875,41 +954,41 @@ function Columns(e) {
|
|
|
875
954
|
desktopStyle: "row"
|
|
876
955
|
})
|
|
877
956
|
};
|
|
878
|
-
}, g = function(
|
|
879
|
-
const b =
|
|
957
|
+
}, g = function(l) {
|
|
958
|
+
const b = l === 0 ? 0 : t, p = i(l), S = `${b}px`, C = "100%", y = 0;
|
|
880
959
|
return {
|
|
881
960
|
...{
|
|
882
961
|
display: "flex",
|
|
883
962
|
flexDirection: "column",
|
|
884
963
|
alignItems: "stretch"
|
|
885
964
|
},
|
|
886
|
-
width:
|
|
965
|
+
width: p,
|
|
887
966
|
["marginLeft"]: S,
|
|
888
967
|
"--column-width-mobile": s({
|
|
889
|
-
stackedStyle:
|
|
890
|
-
desktopStyle:
|
|
968
|
+
stackedStyle: C,
|
|
969
|
+
desktopStyle: p
|
|
891
970
|
}),
|
|
892
971
|
"--column-margin-left-mobile": s({
|
|
893
972
|
stackedStyle: y,
|
|
894
973
|
desktopStyle: S
|
|
895
974
|
}),
|
|
896
975
|
"--column-width-tablet": a({
|
|
897
|
-
stackedStyle:
|
|
898
|
-
desktopStyle:
|
|
976
|
+
stackedStyle: C,
|
|
977
|
+
desktopStyle: p
|
|
899
978
|
}),
|
|
900
979
|
"--column-margin-left-tablet": a({
|
|
901
980
|
stackedStyle: y,
|
|
902
981
|
desktopStyle: S
|
|
903
982
|
})
|
|
904
983
|
};
|
|
905
|
-
},
|
|
906
|
-
var
|
|
984
|
+
}, d = function(l) {
|
|
985
|
+
var p, S;
|
|
907
986
|
return getSizesForBreakpoints(
|
|
908
|
-
((S = (
|
|
909
|
-
)[
|
|
987
|
+
((S = (p = e.builderContext.content) == null ? void 0 : p.meta) == null ? void 0 : S.breakpoints) || {}
|
|
988
|
+
)[l].max;
|
|
910
989
|
}, f = function() {
|
|
911
990
|
return `
|
|
912
|
-
@media (max-width: ${
|
|
991
|
+
@media (max-width: ${d("medium")}px) {
|
|
913
992
|
.${e.builderBlock.id}-breakpoints {
|
|
914
993
|
flex-direction: var(--flex-dir-tablet);
|
|
915
994
|
align-items: stretch;
|
|
@@ -921,7 +1000,7 @@ function Columns(e) {
|
|
|
921
1000
|
}
|
|
922
1001
|
}
|
|
923
1002
|
|
|
924
|
-
@media (max-width: ${
|
|
1003
|
+
@media (max-width: ${d("small")}px) {
|
|
925
1004
|
.${e.builderBlock.id}-breakpoints {
|
|
926
1005
|
flex-direction: var(--flex-dir);
|
|
927
1006
|
align-items: stretch;
|
|
@@ -942,7 +1021,7 @@ function Columns(e) {
|
|
|
942
1021
|
style: u(),
|
|
943
1022
|
children: [
|
|
944
1023
|
/* @__PURE__ */ jsx(InlinedStyles, { id: "builderio-columns", styles: f() }),
|
|
945
|
-
(
|
|
1024
|
+
(h = e.columns) == null ? void 0 : h.map((m, l) => /* @__PURE__ */ jsx(
|
|
946
1025
|
DynamicRenderer,
|
|
947
1026
|
{
|
|
948
1027
|
TagName: m.link ? e.builderLinkComponent || "a" : "div",
|
|
@@ -952,12 +1031,12 @@ function Columns(e) {
|
|
|
952
1031
|
href: m.link
|
|
953
1032
|
} : {},
|
|
954
1033
|
[getClassPropName()]: "builder-column",
|
|
955
|
-
style: mapStyleObjToStrIfNeeded(g(
|
|
1034
|
+
style: mapStyleObjToStrIfNeeded(g(l))
|
|
956
1035
|
},
|
|
957
1036
|
children: /* @__PURE__ */ jsx(
|
|
958
1037
|
Blocks,
|
|
959
1038
|
{
|
|
960
|
-
path: `component.options.columns.${
|
|
1039
|
+
path: `component.options.columns.${l}.blocks`,
|
|
961
1040
|
parent: e.builderBlock.id,
|
|
962
1041
|
styleProp: {
|
|
963
1042
|
flexGrow: "1"
|
|
@@ -969,7 +1048,7 @@ function Columns(e) {
|
|
|
969
1048
|
}
|
|
970
1049
|
)
|
|
971
1050
|
},
|
|
972
|
-
|
|
1051
|
+
l
|
|
973
1052
|
))
|
|
974
1053
|
]
|
|
975
1054
|
}
|
|
@@ -1408,13 +1487,13 @@ const getTopLevelDomain = (e) => {
|
|
|
1408
1487
|
function n(a, s = 6e4) {
|
|
1409
1488
|
return new Promise((c, u) => {
|
|
1410
1489
|
const g = document.createElement("img");
|
|
1411
|
-
let
|
|
1490
|
+
let d = !1;
|
|
1412
1491
|
g.onload = () => {
|
|
1413
|
-
|
|
1492
|
+
d = !0, c(g);
|
|
1414
1493
|
}, g.addEventListener("error", (f) => {
|
|
1415
1494
|
console.warn("Image load failed", f.error), u(f.error);
|
|
1416
1495
|
}), g.src = a, setTimeout(() => {
|
|
1417
|
-
|
|
1496
|
+
d || u(new Error("Image load timed out"));
|
|
1418
1497
|
}, s);
|
|
1419
1498
|
});
|
|
1420
1499
|
}
|
|
@@ -2003,38 +2082,38 @@ const DEFAULT_API_VERSION = "v3", BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUIL
|
|
|
2003
2082
|
apiVersion: c = DEFAULT_API_VERSION,
|
|
2004
2083
|
fields: u,
|
|
2005
2084
|
omit: g,
|
|
2006
|
-
offset:
|
|
2085
|
+
offset: d,
|
|
2007
2086
|
cacheSeconds: f,
|
|
2008
|
-
staleCacheSeconds:
|
|
2087
|
+
staleCacheSeconds: h,
|
|
2009
2088
|
sort: m,
|
|
2010
|
-
includeUnpublished:
|
|
2089
|
+
includeUnpublished: l
|
|
2011
2090
|
} = e;
|
|
2012
2091
|
if (!i)
|
|
2013
2092
|
throw new Error("Missing API key");
|
|
2014
2093
|
if (!["v3"].includes(c))
|
|
2015
2094
|
throw new Error(`Invalid apiVersion: expected 'v3', received '${c}'`);
|
|
2016
|
-
const b = t !== 1,
|
|
2017
|
-
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) {
|
|
2018
2097
|
const y = flatten({
|
|
2019
2098
|
sort: m
|
|
2020
2099
|
});
|
|
2021
|
-
for (const
|
|
2022
|
-
|
|
2100
|
+
for (const v in y)
|
|
2101
|
+
p.searchParams.set(v, JSON.stringify(y[v]));
|
|
2023
2102
|
}
|
|
2024
2103
|
const S = {
|
|
2025
2104
|
...getBuilderSearchParamsFromWindow(),
|
|
2026
2105
|
...normalizeSearchParams(e.options || {})
|
|
2027
|
-
},
|
|
2028
|
-
for (const y in
|
|
2029
|
-
|
|
2030
|
-
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) {
|
|
2031
2110
|
const y = flatten({
|
|
2032
2111
|
query: o
|
|
2033
2112
|
});
|
|
2034
|
-
for (const
|
|
2035
|
-
|
|
2113
|
+
for (const v in y)
|
|
2114
|
+
p.searchParams.set(v, JSON.stringify(y[v]));
|
|
2036
2115
|
}
|
|
2037
|
-
return
|
|
2116
|
+
return p;
|
|
2038
2117
|
}, checkContentHasResults = (e) => "results" in e;
|
|
2039
2118
|
async function fetchOneEntry(e) {
|
|
2040
2119
|
const t = await fetchEntries({
|
|
@@ -2084,10 +2163,8 @@ async function fetchEntries(e) {
|
|
|
2084
2163
|
}
|
|
2085
2164
|
}
|
|
2086
2165
|
function isPreviewing(e) {
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
const t = getSearchString(e || window.location.search);
|
|
2090
|
-
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;
|
|
2091
2168
|
}
|
|
2092
2169
|
function uuidv4() {
|
|
2093
2170
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
@@ -2278,7 +2355,7 @@ function isFromTrustedHost(e, t) {
|
|
|
2278
2355
|
const n = new URL(t.origin), o = n.hostname;
|
|
2279
2356
|
return (e || DEFAULT_TRUSTED_HOSTS).findIndex((r) => r.startsWith("*.") ? o.endsWith(r.slice(1)) : r === o) > -1;
|
|
2280
2357
|
}
|
|
2281
|
-
const SDK_VERSION = "0.14.
|
|
2358
|
+
const SDK_VERSION = "0.14.16", registry = {};
|
|
2282
2359
|
function register(e, t) {
|
|
2283
2360
|
let n = registry[e];
|
|
2284
2361
|
if (n || (n = registry[e] = []), n.push(t), isBrowser()) {
|
|
@@ -2349,11 +2426,11 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2349
2426
|
switch (r.type) {
|
|
2350
2427
|
case "builder.evaluate": {
|
|
2351
2428
|
const s = r.data.text, c = r.data.arguments || [], u = r.data.id, g = new Function(s);
|
|
2352
|
-
let
|
|
2429
|
+
let d, f = null;
|
|
2353
2430
|
try {
|
|
2354
|
-
|
|
2355
|
-
} catch (
|
|
2356
|
-
f =
|
|
2431
|
+
d = g.apply(null, c);
|
|
2432
|
+
} catch (h) {
|
|
2433
|
+
f = h;
|
|
2357
2434
|
}
|
|
2358
2435
|
f ? (i = window.parent) == null || i.postMessage({
|
|
2359
2436
|
type: "builder.evaluateError",
|
|
@@ -2361,19 +2438,19 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2361
2438
|
id: u,
|
|
2362
2439
|
error: f.message
|
|
2363
2440
|
}
|
|
2364
|
-
}, "*") :
|
|
2441
|
+
}, "*") : d && typeof d.then == "function" ? d.then((h) => {
|
|
2365
2442
|
var m;
|
|
2366
2443
|
(m = window.parent) == null || m.postMessage({
|
|
2367
2444
|
type: "builder.evaluateResult",
|
|
2368
2445
|
data: {
|
|
2369
2446
|
id: u,
|
|
2370
|
-
result:
|
|
2447
|
+
result: h
|
|
2371
2448
|
}
|
|
2372
2449
|
}, "*");
|
|
2373
2450
|
}).catch(console.error) : (a = window.parent) == null || a.postMessage({
|
|
2374
2451
|
type: "builder.evaluateResult",
|
|
2375
2452
|
data: {
|
|
2376
|
-
result:
|
|
2453
|
+
result: d,
|
|
2377
2454
|
id: u
|
|
2378
2455
|
}
|
|
2379
2456
|
}, "*");
|
|
@@ -2426,49 +2503,7 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2426
2503
|
return window.addEventListener("message", o), () => {
|
|
2427
2504
|
window.removeEventListener("message", o);
|
|
2428
2505
|
};
|
|
2429
|
-
}
|
|
2430
|
-
function assign(e, ...t) {
|
|
2431
|
-
const n = Object(e);
|
|
2432
|
-
for (let o = 1; o < arguments.length; o++) {
|
|
2433
|
-
const r = arguments[o];
|
|
2434
|
-
if (r != null)
|
|
2435
|
-
for (const i in r)
|
|
2436
|
-
Object.prototype.hasOwnProperty.call(r, i) && (n[i] = r[i]);
|
|
2437
|
-
}
|
|
2438
|
-
return n;
|
|
2439
|
-
}
|
|
2440
|
-
const camelCaseToKebabCase = (e) => e ? e.replace(/([A-Z])/g, (t) => `-${t[0].toLowerCase()}`) : "";
|
|
2441
|
-
function warnElementNotPresent(e) {
|
|
2442
|
-
console.warn(`Cannot animate element: element with ID ${e} not found!`);
|
|
2443
|
-
}
|
|
2444
|
-
function augmentAnimation(e, t) {
|
|
2445
|
-
const n = getAllStylesUsed(e), o = getComputedStyle(t), r = e.steps[0].styles, i = e.steps[e.steps.length - 1].styles, a = [r, i];
|
|
2446
|
-
for (const s of a)
|
|
2447
|
-
for (const c of n)
|
|
2448
|
-
c in s || (s[c] = o[c]);
|
|
2449
|
-
}
|
|
2450
|
-
function getAllStylesUsed(e) {
|
|
2451
|
-
const t = [];
|
|
2452
|
-
for (const n of e.steps)
|
|
2453
|
-
for (const o in n.styles)
|
|
2454
|
-
t.indexOf(o) === -1 && t.push(o);
|
|
2455
|
-
return t;
|
|
2456
|
-
}
|
|
2457
|
-
function triggerAnimation(e) {
|
|
2458
|
-
const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
|
|
2459
|
-
if (!t.length) {
|
|
2460
|
-
warnElementNotPresent(e.elementId || e.id || "");
|
|
2461
|
-
return;
|
|
2462
|
-
}
|
|
2463
|
-
Array.from(t).forEach((n) => {
|
|
2464
|
-
augmentAnimation(e, n), n.style.transition = "none", n.style.transitionDelay = "0", assign(n.style, e.steps[0].styles), setTimeout(() => {
|
|
2465
|
-
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(() => {
|
|
2466
|
-
n.style.transition = "", n.style.transitionDelay = "";
|
|
2467
|
-
}, (e.delay || 0) * 1e3 + e.duration * 1e3 + 100);
|
|
2468
|
-
});
|
|
2469
|
-
});
|
|
2470
|
-
}
|
|
2471
|
-
const getCssFromFont = (e) => {
|
|
2506
|
+
}, getCssFromFont = (e) => {
|
|
2472
2507
|
var i;
|
|
2473
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);
|
|
2474
2509
|
let r = "";
|
|
@@ -2562,7 +2597,7 @@ const getRootStateInitialValue = ({
|
|
|
2562
2597
|
meta: e == null ? void 0 : e.meta
|
|
2563
2598
|
} : void 0;
|
|
2564
2599
|
function ContentComponent(e) {
|
|
2565
|
-
var r, i, a, s, c, u, g,
|
|
2600
|
+
var r, i, a, s, c, u, g, d, f;
|
|
2566
2601
|
const t = getUpdateVariantVisibilityScript({
|
|
2567
2602
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2568
2603
|
variationId: (r = e.content) == null ? void 0 : r.testVariationId,
|
|
@@ -2572,11 +2607,11 @@ function ContentComponent(e) {
|
|
|
2572
2607
|
...getDefaultRegisteredComponents(),
|
|
2573
2608
|
...e.customComponents || []
|
|
2574
2609
|
].reduce(
|
|
2575
|
-
(
|
|
2576
|
-
...
|
|
2577
|
-
[
|
|
2610
|
+
(h, { component: m, ...l }) => ({
|
|
2611
|
+
...h,
|
|
2612
|
+
[l.name]: {
|
|
2578
2613
|
component: m,
|
|
2579
|
-
...serializeComponentInfo(
|
|
2614
|
+
...serializeComponentInfo(l)
|
|
2580
2615
|
}
|
|
2581
2616
|
}),
|
|
2582
2617
|
{}
|
|
@@ -2599,9 +2634,9 @@ function ContentComponent(e) {
|
|
|
2599
2634
|
...getDefaultRegisteredComponents(),
|
|
2600
2635
|
...e.customComponents || []
|
|
2601
2636
|
].reduce(
|
|
2602
|
-
(
|
|
2603
|
-
...
|
|
2604
|
-
[
|
|
2637
|
+
(h, { component: m, ...l }) => ({
|
|
2638
|
+
...h,
|
|
2639
|
+
[l.name]: serializeComponentInfo(l)
|
|
2605
2640
|
}),
|
|
2606
2641
|
{}
|
|
2607
2642
|
),
|
|
@@ -2646,7 +2681,7 @@ function ContentComponent(e) {
|
|
|
2646
2681
|
/* @__PURE__ */ jsx(
|
|
2647
2682
|
Blocks,
|
|
2648
2683
|
{
|
|
2649
|
-
blocks: (f = (
|
|
2684
|
+
blocks: (f = (d = o.content) == null ? void 0 : d.data) == null ? void 0 : f.blocks,
|
|
2650
2685
|
context: o,
|
|
2651
2686
|
registeredComponents: n,
|
|
2652
2687
|
linkComponent: e.linkComponent
|