@builder.io/sdk-react-nextjs 0.7.4 → 0.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{node/USE_CLIENT_BUNDLE-539be307.cjs → browser/USE_CLIENT_BUNDLE-0a0cc62f.cjs} +1 -1
- package/lib/browser/{USE_CLIENT_BUNDLE-6b3887b7.js → USE_CLIENT_BUNDLE-a7787106.js} +2 -2
- package/lib/{edge/USE_SERVER_BUNDLE-2c9d1a5d.js → browser/USE_SERVER_BUNDLE-05ea12e2.js} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-e5ab43ec.cjs → browser/USE_SERVER_BUNDLE-73128060.cjs} +1 -1
- package/lib/browser/{bundle-fc3e7377.js → bundle-bf220619.js} +140 -140
- package/lib/browser/{bundle-df55c296.cjs → bundle-d14f38c0.cjs} +13 -13
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +3 -3
- package/lib/{browser/USE_CLIENT_BUNDLE-f95a196a.cjs → edge/USE_CLIENT_BUNDLE-2b470811.cjs} +1 -1
- package/lib/{node/USE_CLIENT_BUNDLE-a5c6399c.js → edge/USE_CLIENT_BUNDLE-b3aaa944.js} +2 -2
- package/lib/{node/USE_SERVER_BUNDLE-7f4ba7e9.cjs → edge/USE_SERVER_BUNDLE-b3b4afa9.cjs} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-21bf3ffc.js → edge/USE_SERVER_BUNDLE-f39207f2.js} +1 -1
- package/lib/edge/{bundle-38f08fa1.cjs → bundle-2a7da030.cjs} +14 -14
- package/lib/edge/{bundle-bef73246.js → bundle-bca2cd58.js} +262 -262
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +3 -3
- package/lib/{edge/USE_CLIENT_BUNDLE-a32e462e.js → node/USE_CLIENT_BUNDLE-955f9345.js} +2 -2
- package/lib/{edge/USE_CLIENT_BUNDLE-44225d7a.cjs → node/USE_CLIENT_BUNDLE-a8082119.cjs} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-eed7792a.cjs → node/USE_SERVER_BUNDLE-136e4ed6.cjs} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-b314d0f7.js → node/USE_SERVER_BUNDLE-ac2a6bf7.js} +1 -1
- package/lib/node/{bundle-74479d5d.js → bundle-b06f63f6.js} +80 -80
- package/lib/node/{bundle-f7863fb3.cjs → bundle-f16e2dbd.cjs} +8 -8
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/package.json +1 -1
- package/types/cjs/components/content/content.helpers.d.ts +1 -1
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/esm/components/content/content.helpers.d.ts +1 -1
- package/types/esm/constants/sdk-version.d.ts +1 -1
package/lib/edge/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bundle-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bundle-2a7da030.cjs"),t=require("./USE_CLIENT_BUNDLE-2b470811.cjs");require("lru-cache");require("react/jsx-runtime");require("react");require("next/navigation");require("./USE_SERVER_BUNDLE-b3b4afa9.cjs");exports.Blocks=e.Blocks;exports.Columns=e.Columns;exports.Content=e.ContentVariants;exports.RenderBlocks=e.RenderBlocks;exports.RenderContent=e.RenderContent;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.getAllContent=e.getAllContent;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.getContent=e.getContent;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.track=e.track;exports.Button=t.Button;exports.Fragment=t.FragmentComponent;exports.Image=t.Image;exports.Section=t.SectionComponent;exports.Video=t.Video;
|
package/lib/edge/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { B as i, t as m, C as c, R as g, q as p, S as l, T as C, w as d, m as f, E as u, x as B, n as S, y as E, A as R, z as h, i as x, f as k, u as y, v as P, D as b } from "./bundle-
|
|
2
|
-
import { b as w, F as A, c as F, S as T, V } from "./USE_CLIENT_BUNDLE-
|
|
1
|
+
import { B as i, t as m, C as c, R as g, q as p, S as l, T as C, w as d, m as f, E as u, x as B, n as S, y as E, A as R, z as h, i as x, f as k, u as y, v as P, D as b } from "./bundle-bca2cd58.js";
|
|
2
|
+
import { b as w, F as A, c as F, S as T, V } from "./USE_CLIENT_BUNDLE-b3aaa944.js";
|
|
3
3
|
import "lru-cache";
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "react";
|
|
6
6
|
import "next/navigation";
|
|
7
|
-
import "./USE_SERVER_BUNDLE-
|
|
7
|
+
import "./USE_SERVER_BUNDLE-f39207f2.js";
|
|
8
8
|
export {
|
|
9
9
|
i as Blocks,
|
|
10
10
|
w as Button,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as C, Fragment as h, jsx as i } from "react/jsx-runtime";
|
|
3
|
-
import { g as T, a as N, i as E, b as R, c as Q, d as P, e as D, _ as U, f as X, l as Y, h as H, j as Z, k as p, r as ee, s as te, m as ne, n as ie, o as ae } from "./bundle-
|
|
3
|
+
import { g as T, a as N, i as E, b as R, c as Q, d as P, e as D, _ as U, f as X, l as Y, h as H, j as Z, k as p, r as ee, s as te, m as ne, n as ie, o as ae } from "./bundle-b06f63f6.js";
|
|
4
4
|
import { useRef as B, useState as k, useEffect as v, createContext as ce, createElement as le } from "react";
|
|
5
|
-
import { p as oe } from "./USE_SERVER_BUNDLE-
|
|
5
|
+
import { p as oe } from "./USE_SERVER_BUNDLE-ac2a6bf7.js";
|
|
6
6
|
import { useRouter as re } from "next/navigation";
|
|
7
7
|
function ge(e) {
|
|
8
8
|
return /* @__PURE__ */ C(h, { children: [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";"use strict";const t=require("react/jsx-runtime"),c=require("./bundle-
|
|
1
|
+
"use client";"use strict";const t=require("react/jsx-runtime"),c=require("./bundle-f16e2dbd.cjs"),l=require("react"),M=require("./USE_SERVER_BUNDLE-136e4ed6.cjs"),V=require("next/navigation");function W(e){return t.jsxs(t.Fragment,{children:[e.link?t.jsx(t.Fragment,{children:t.jsx("a",{...e.attributes,href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"button",children:e.text})}):t.jsx(t.Fragment,{children:t.jsx("button",{...e.attributes,style:e.attributes.style,className:e.attributes.className+" button-5294b10c",children:e.text})}),t.jsx("style",{children:`.button-5294b10c {
|
|
2
2
|
all: unset;
|
|
3
3
|
}`})]})}function A(e){return t.jsxs(t.Fragment,{children:[" ",e.hasChildren?t.jsx(t.Fragment,{children:t.jsxs(e.Wrapper,{...c.getBlockProperties({block:e.block,context:e.context}),...c.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0}),children:[" ",e.children," "]})}):t.jsx(t.Fragment,{children:t.jsx(e.Wrapper,{...c.getBlockProperties({block:e.block,context:e.context}),...c.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0})})})," "]})}function D(e){return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:{...c.getBlockProperties({block:e.block,context:e.context}),...c.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})},children:e.children})}function U(e){function a(){var o;return"builder-blocks"+((o=e.blocks)!=null&&o.length?"":" no-blocks")}function g(){var o,h;c.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((h=window.parent)==null||h.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function S(){var o,h;c.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((h=window.parent)==null||h.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:a()+" div-02c7a115","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:o=>g(),onMouseEnter:o=>S(),onKeyPress:o=>g(),children:e.children}),t.jsx("style",{children:`.div-02c7a115 {
|
|
4
4
|
display: flex;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use server";"use strict";const n=require("./bundle-
|
|
1
|
+
"use server";"use strict";const n=require("./bundle-f16e2dbd.cjs");async function s({key:e,value:t}){return n.init(),globalThis._BUILDER_PREVIEW_LRU_CACHE.set(e,t),{[e]:t}}exports.postPreviewContent=s;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LRUCache } from "lru-cache";
|
|
2
2
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { createElement } from "react";
|
|
4
|
-
import { I as InteractiveElement, B as BlockWrapper, a as BlocksWrapper, b as Button, C as CustomCode, E as Embed, F as FragmentComponent, c as Image, d as ImgComponent, S as SectionComponent, V as Video, e as EnableEditor } from "./USE_CLIENT_BUNDLE-
|
|
4
|
+
import { I as InteractiveElement, B as BlockWrapper, a as BlocksWrapper, b as Button, C as CustomCode, E as Embed, F as FragmentComponent, c as Image, d as ImgComponent, S as SectionComponent, V as Video, e as EnableEditor } from "./USE_CLIENT_BUNDLE-955f9345.js";
|
|
5
5
|
import "next/navigation";
|
|
6
6
|
function getBlockComponentOptions(e) {
|
|
7
7
|
var t;
|
|
@@ -186,25 +186,25 @@ output;
|
|
|
186
186
|
context: n,
|
|
187
187
|
event: o,
|
|
188
188
|
state: s
|
|
189
|
-
}),
|
|
190
|
-
|
|
189
|
+
}), m = getIsolateContext(), f = m.global;
|
|
190
|
+
f.setSync("global", f.derefInto()), f.setSync("log", function(...l) {
|
|
191
191
|
console.log(...l);
|
|
192
|
-
}),
|
|
193
|
-
set(a, l,
|
|
194
|
-
}), c.forEach(([l,
|
|
195
|
-
const d = typeof
|
|
192
|
+
}), f.setSync(BUILDER_SET_STATE_NAME, function(l, u) {
|
|
193
|
+
set(a, l, u), r == null || r(a);
|
|
194
|
+
}), c.forEach(([l, u]) => {
|
|
195
|
+
const d = typeof u == "object" ? new ivm.Reference(
|
|
196
196
|
// workaround: methods with default values for arguments is not being cloned over
|
|
197
197
|
l === "builder" ? {
|
|
198
|
-
...
|
|
199
|
-
getUserAttributes: () =>
|
|
200
|
-
} :
|
|
198
|
+
...u,
|
|
199
|
+
getUserAttributes: () => u.getUserAttributes()
|
|
200
|
+
} : u
|
|
201
201
|
) : null;
|
|
202
|
-
|
|
203
|
-
}),
|
|
202
|
+
f.setSync(getSyncValName(l), d);
|
|
203
|
+
}), f.setSync(INJECTED_IVM_GLOBAL, ivm);
|
|
204
204
|
const g = processCode({
|
|
205
205
|
code: e,
|
|
206
206
|
args: c
|
|
207
|
-
}), p =
|
|
207
|
+
}), p = m.evalSync(g);
|
|
208
208
|
try {
|
|
209
209
|
return JSON.parse(p);
|
|
210
210
|
} catch {
|
|
@@ -266,14 +266,14 @@ const evaluateBindings = ({
|
|
|
266
266
|
}
|
|
267
267
|
};
|
|
268
268
|
for (const s in e.bindings) {
|
|
269
|
-
const c = e.bindings[s],
|
|
269
|
+
const c = e.bindings[s], m = evaluate({
|
|
270
270
|
code: c,
|
|
271
271
|
localState: n,
|
|
272
272
|
rootState: o,
|
|
273
273
|
rootSetState: i,
|
|
274
274
|
context: t
|
|
275
275
|
});
|
|
276
|
-
set(a, s,
|
|
276
|
+
set(a, s, m);
|
|
277
277
|
}
|
|
278
278
|
return a;
|
|
279
279
|
};
|
|
@@ -336,15 +336,15 @@ const EMPTY_HTML_ELEMENTS = ["area", "base", "br", "col", "embed", "hr", "img",
|
|
|
336
336
|
if (!Array.isArray(i))
|
|
337
337
|
return;
|
|
338
338
|
const r = n.collection.split(".").pop(), a = n.itemName || (r ? r + "Item" : "item");
|
|
339
|
-
return i.map((c,
|
|
339
|
+
return i.map((c, m) => ({
|
|
340
340
|
context: {
|
|
341
341
|
...t,
|
|
342
342
|
localState: {
|
|
343
343
|
...t.localState,
|
|
344
|
-
$index:
|
|
344
|
+
$index: m,
|
|
345
345
|
$item: c,
|
|
346
346
|
[a]: c,
|
|
347
|
-
[`$${a}Index`]:
|
|
347
|
+
[`$${a}Index`]: m
|
|
348
348
|
}
|
|
349
349
|
},
|
|
350
350
|
block: o
|
|
@@ -432,28 +432,28 @@ function BlockStyles(e) {
|
|
|
432
432
|
shouldEvaluateBindings: !0
|
|
433
433
|
}), r = i.responsiveStyles, a = e.context.content, s = getSizesForBreakpoints(
|
|
434
434
|
((d = a == null ? void 0 : a.meta) == null ? void 0 : d.breakpoints) || {}
|
|
435
|
-
), c = r == null ? void 0 : r.large,
|
|
435
|
+
), c = r == null ? void 0 : r.large, m = r == null ? void 0 : r.medium, f = r == null ? void 0 : r.small, g = i.id;
|
|
436
436
|
if (!g)
|
|
437
437
|
return "";
|
|
438
438
|
const p = c ? createCssClass({
|
|
439
439
|
className: g,
|
|
440
440
|
styles: c
|
|
441
|
-
}) : "", l =
|
|
441
|
+
}) : "", l = m ? createCssClass({
|
|
442
442
|
className: g,
|
|
443
|
-
styles:
|
|
443
|
+
styles: m,
|
|
444
444
|
mediaQuery: getMaxWidthQueryForSize(
|
|
445
445
|
"medium",
|
|
446
446
|
s
|
|
447
447
|
)
|
|
448
|
-
}) : "",
|
|
448
|
+
}) : "", u = f ? createCssClass({
|
|
449
449
|
className: g,
|
|
450
|
-
styles:
|
|
450
|
+
styles: f,
|
|
451
451
|
mediaQuery: getMaxWidthQueryForSize(
|
|
452
452
|
"small",
|
|
453
453
|
s
|
|
454
454
|
)
|
|
455
455
|
}) : "";
|
|
456
|
-
return [p, l,
|
|
456
|
+
return [p, l, u].join(" ");
|
|
457
457
|
};
|
|
458
458
|
return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: n() }) }) : null });
|
|
459
459
|
}
|
|
@@ -599,7 +599,7 @@ function RepeatedBlock(e) {
|
|
|
599
599
|
);
|
|
600
600
|
}
|
|
601
601
|
function Block(e) {
|
|
602
|
-
var
|
|
602
|
+
var m, f, g, p;
|
|
603
603
|
const t = function() {
|
|
604
604
|
return getComponent({
|
|
605
605
|
block: e.block,
|
|
@@ -612,7 +612,8 @@ function Block(e) {
|
|
|
612
612
|
context: e.context
|
|
613
613
|
});
|
|
614
614
|
}, o = function() {
|
|
615
|
-
|
|
615
|
+
var u;
|
|
616
|
+
return (u = e.block.repeat) != null && u.collection ? e.block : getProcessedBlock({
|
|
616
617
|
block: e.block,
|
|
617
618
|
localState: e.context.localState,
|
|
618
619
|
rootState: e.context.rootState,
|
|
@@ -623,15 +624,19 @@ function Block(e) {
|
|
|
623
624
|
}, i = function() {
|
|
624
625
|
return e.block.tagName || "div";
|
|
625
626
|
}, r = function() {
|
|
626
|
-
|
|
627
|
+
var b, y;
|
|
628
|
+
if ((b = e.block.repeat) != null && b.collection)
|
|
629
|
+
return !!((y = n()) != null && y.length);
|
|
630
|
+
const u = "hide" in o() ? o().hide : !1;
|
|
631
|
+
return ("show" in o() ? o().show : !0) && !u;
|
|
627
632
|
}, a = function() {
|
|
628
633
|
var d;
|
|
629
634
|
return !((d = t()) != null && d.component) && !n() ? o().children ?? [] : [];
|
|
630
635
|
}, s = function() {
|
|
631
|
-
var
|
|
636
|
+
var u, d, b, y, h;
|
|
632
637
|
return {
|
|
633
638
|
blockChildren: o().children ?? [],
|
|
634
|
-
componentRef: (
|
|
639
|
+
componentRef: (u = t()) == null ? void 0 : u.component,
|
|
635
640
|
componentOptions: {
|
|
636
641
|
...getBlockComponentOptions(o()),
|
|
637
642
|
builderContext: e.context,
|
|
@@ -646,7 +651,7 @@ function Block(e) {
|
|
|
646
651
|
isInteractive: !((h = t()) != null && h.isRSC)
|
|
647
652
|
};
|
|
648
653
|
}, c = e.context;
|
|
649
|
-
return /* @__PURE__ */ jsx(Fragment, { children: r() ? /* @__PURE__ */ jsx(Fragment, { children: (
|
|
654
|
+
return /* @__PURE__ */ jsx(Fragment, { children: r() ? /* @__PURE__ */ jsx(Fragment, { children: (m = t()) != null && m.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
650
655
|
ComponentRef,
|
|
651
656
|
{
|
|
652
657
|
componentRef: s().componentRef,
|
|
@@ -668,14 +673,14 @@ function Block(e) {
|
|
|
668
673
|
hasChildren: !1
|
|
669
674
|
}
|
|
670
675
|
) }) : null,
|
|
671
|
-
!isEmptyHtmlElement(i()) && n() ? /* @__PURE__ */ jsx(Fragment, { children: (
|
|
676
|
+
!isEmptyHtmlElement(i()) && n() ? /* @__PURE__ */ jsx(Fragment, { children: (f = n()) == null ? void 0 : f.map((l, u) => /* @__PURE__ */ jsx(
|
|
672
677
|
RepeatedBlock,
|
|
673
678
|
{
|
|
674
679
|
repeatContext: l.context,
|
|
675
680
|
block: l.block,
|
|
676
681
|
registeredComponents: e.registeredComponents
|
|
677
682
|
},
|
|
678
|
-
|
|
683
|
+
u
|
|
679
684
|
)) }) : null,
|
|
680
685
|
!isEmptyHtmlElement(i()) && !n() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
681
686
|
BlockWrapper,
|
|
@@ -769,7 +774,7 @@ function Columns(e) {
|
|
|
769
774
|
desktopStyle: b
|
|
770
775
|
}) {
|
|
771
776
|
return o === "never" ? b : d;
|
|
772
|
-
}, c = e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column",
|
|
777
|
+
}, c = e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column", m = function() {
|
|
773
778
|
return {
|
|
774
779
|
"--flex-dir": c,
|
|
775
780
|
"--flex-dir-tablet": a({
|
|
@@ -777,7 +782,7 @@ function Columns(e) {
|
|
|
777
782
|
desktopStyle: "row"
|
|
778
783
|
})
|
|
779
784
|
};
|
|
780
|
-
},
|
|
785
|
+
}, f = function(d) {
|
|
781
786
|
const b = d === 0 ? 0 : t, y = r(d), h = `${b}px`, v = "100%", x = 0;
|
|
782
787
|
return {
|
|
783
788
|
width: y,
|
|
@@ -836,14 +841,14 @@ function Columns(e) {
|
|
|
836
841
|
"div",
|
|
837
842
|
{
|
|
838
843
|
className: `builder-columns ${e.builderBlock.id}-breakpoints div-0d69fe26`,
|
|
839
|
-
style:
|
|
844
|
+
style: m(),
|
|
840
845
|
children: [
|
|
841
846
|
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: p() }) }),
|
|
842
|
-
(l = e.columns) == null ? void 0 : l.map((
|
|
847
|
+
(l = e.columns) == null ? void 0 : l.map((u, d) => /* @__PURE__ */ createElement(
|
|
843
848
|
"div",
|
|
844
849
|
{
|
|
845
850
|
className: "builder-column div-0d69fe26-2",
|
|
846
|
-
style:
|
|
851
|
+
style: f(d),
|
|
847
852
|
key: d
|
|
848
853
|
},
|
|
849
854
|
/* @__PURE__ */ jsx(
|
|
@@ -856,7 +861,7 @@ function Columns(e) {
|
|
|
856
861
|
},
|
|
857
862
|
context: e.builderContext,
|
|
858
863
|
registeredComponents: e.builderComponents,
|
|
859
|
-
blocks:
|
|
864
|
+
blocks: u.blocks
|
|
860
865
|
}
|
|
861
866
|
)
|
|
862
867
|
))
|
|
@@ -1346,15 +1351,15 @@ const getTopLevelDomain = (e) => {
|
|
|
1346
1351
|
onChange: (e) => {
|
|
1347
1352
|
e.delete("srcset"), e.delete("noWebp");
|
|
1348
1353
|
function n(a, s = 6e4) {
|
|
1349
|
-
return new Promise((c,
|
|
1350
|
-
const
|
|
1354
|
+
return new Promise((c, m) => {
|
|
1355
|
+
const f = document.createElement("img");
|
|
1351
1356
|
let g = !1;
|
|
1352
|
-
|
|
1353
|
-
g = !0, c(
|
|
1354
|
-
},
|
|
1355
|
-
console.warn("Image load failed", p.error),
|
|
1356
|
-
}),
|
|
1357
|
-
g ||
|
|
1357
|
+
f.onload = () => {
|
|
1358
|
+
g = !0, c(f);
|
|
1359
|
+
}, f.addEventListener("error", (p) => {
|
|
1360
|
+
console.warn("Image load failed", p.error), m(p.error);
|
|
1361
|
+
}), f.src = a, setTimeout(() => {
|
|
1362
|
+
g || m(new Error("Image load timed out"));
|
|
1358
1363
|
}, s);
|
|
1359
1364
|
});
|
|
1360
1365
|
}
|
|
@@ -1861,23 +1866,23 @@ const DEFAULT_API_VERSION = "v3", BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUIL
|
|
|
1861
1866
|
apiKey: a,
|
|
1862
1867
|
includeRefs: s = !0,
|
|
1863
1868
|
enrich: c,
|
|
1864
|
-
locale:
|
|
1865
|
-
apiVersion:
|
|
1869
|
+
locale: m,
|
|
1870
|
+
apiVersion: f = DEFAULT_API_VERSION,
|
|
1866
1871
|
fields: g,
|
|
1867
1872
|
omit: p,
|
|
1868
1873
|
offset: l,
|
|
1869
|
-
cacheSeconds:
|
|
1874
|
+
cacheSeconds: u,
|
|
1870
1875
|
staleCacheSeconds: d,
|
|
1871
1876
|
sort: b,
|
|
1872
1877
|
includeUnpublished: y
|
|
1873
1878
|
} = e;
|
|
1874
1879
|
if (!a)
|
|
1875
1880
|
throw new Error("Missing API key");
|
|
1876
|
-
if (!["v2", "v3"].includes(
|
|
1877
|
-
throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${
|
|
1881
|
+
if (!["v2", "v3"].includes(f))
|
|
1882
|
+
throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${f}'`);
|
|
1878
1883
|
(e.limit === void 0 || e.limit > 1) && !("noTraverse" in e) && (t = !0);
|
|
1879
|
-
const h = new URL(`https://cdn.builder.io/api/${
|
|
1880
|
-
if (h.searchParams.set("omit", p || "meta.componentsUsed"), g && h.searchParams.set("fields", g), Number.isFinite(l) && l > -1 && h.searchParams.set("offset", String(Math.floor(l))), typeof y == "boolean" && h.searchParams.set("includeUnpublished", String(y)),
|
|
1884
|
+
const h = new URL(`https://cdn.builder.io/api/${f}/content/${r}?apiKey=${a}&limit=${n}&noTraverse=${t}&includeRefs=${s}${m ? `&locale=${m}` : ""}${c ? `&enrich=${c}` : ""}`);
|
|
1885
|
+
if (h.searchParams.set("omit", p || "meta.componentsUsed"), g && h.searchParams.set("fields", g), Number.isFinite(l) && l > -1 && h.searchParams.set("offset", String(Math.floor(l))), typeof y == "boolean" && h.searchParams.set("includeUnpublished", String(y)), u && isPositiveNumber(u) && h.searchParams.set("cacheSeconds", String(u)), d && isPositiveNumber(d) && h.searchParams.set("staleCacheSeconds", String(d)), b) {
|
|
1881
1886
|
const S = flatten({
|
|
1882
1887
|
sort: b
|
|
1883
1888
|
});
|
|
@@ -2134,7 +2139,7 @@ const findParentElement = (e, t, n = !0) => {
|
|
|
2134
2139
|
builderElementIndex: n && o ? [].slice.call(document.getElementsByClassName(o)).indexOf(n) : void 0
|
|
2135
2140
|
}
|
|
2136
2141
|
};
|
|
2137
|
-
}, SDK_VERSION = "0.7.
|
|
2142
|
+
}, SDK_VERSION = "0.7.6", registry = {};
|
|
2138
2143
|
function register(e, t) {
|
|
2139
2144
|
let n = registry[e];
|
|
2140
2145
|
if (n || (n = registry[e] = []), n.push(t), isBrowser()) {
|
|
@@ -2201,10 +2206,10 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2201
2206
|
if (o != null && o.type)
|
|
2202
2207
|
switch (o.type) {
|
|
2203
2208
|
case "builder.evaluate": {
|
|
2204
|
-
const a = o.data.text, s = o.data.arguments || [], c = o.data.id,
|
|
2205
|
-
let
|
|
2209
|
+
const a = o.data.text, s = o.data.arguments || [], c = o.data.id, m = new Function(a);
|
|
2210
|
+
let f, g = null;
|
|
2206
2211
|
try {
|
|
2207
|
-
|
|
2212
|
+
f = m.apply(null, s);
|
|
2208
2213
|
} catch (p) {
|
|
2209
2214
|
g = p;
|
|
2210
2215
|
}
|
|
@@ -2214,7 +2219,7 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2214
2219
|
id: c,
|
|
2215
2220
|
error: g.message
|
|
2216
2221
|
}
|
|
2217
|
-
}, "*") :
|
|
2222
|
+
}, "*") : f && typeof f.then == "function" ? f.then((p) => {
|
|
2218
2223
|
var l;
|
|
2219
2224
|
(l = window.parent) == null || l.postMessage({
|
|
2220
2225
|
type: "builder.evaluateResult",
|
|
@@ -2226,7 +2231,7 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2226
2231
|
}).catch(console.error) : (r = window.parent) == null || r.postMessage({
|
|
2227
2232
|
type: "builder.evaluateResult",
|
|
2228
2233
|
data: {
|
|
2229
|
-
result:
|
|
2234
|
+
result: f,
|
|
2230
2235
|
id: c
|
|
2231
2236
|
}
|
|
2232
2237
|
}, "*");
|
|
@@ -2300,22 +2305,17 @@ const getContextStateInitialValue = ({
|
|
|
2300
2305
|
locale: n
|
|
2301
2306
|
}) => {
|
|
2302
2307
|
var r, a, s;
|
|
2303
|
-
const o = {};
|
|
2304
|
-
(
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
...(s = e == null ? void 0 : e.data) == null ? void 0 : s.state,
|
|
2308
|
+
const o = {}, i = ((r = e == null ? void 0 : e.data) == null ? void 0 : r.state) || {};
|
|
2309
|
+
return (s = (a = e == null ? void 0 : e.data) == null ? void 0 : a.inputs) == null || s.forEach((c) => {
|
|
2310
|
+
c.name && c.defaultValue !== void 0 && (o[c.name] = c.defaultValue);
|
|
2311
|
+
}), {
|
|
2312
|
+
...o,
|
|
2313
|
+
...i,
|
|
2310
2314
|
...t,
|
|
2311
2315
|
...n ? {
|
|
2312
2316
|
locale: n
|
|
2313
2317
|
} : {}
|
|
2314
2318
|
};
|
|
2315
|
-
return {
|
|
2316
|
-
...o,
|
|
2317
|
-
...i
|
|
2318
|
-
};
|
|
2319
2319
|
}, getContentInitialValue = ({
|
|
2320
2320
|
content: e,
|
|
2321
2321
|
data: t
|
|
@@ -2328,7 +2328,7 @@ const getContextStateInitialValue = ({
|
|
|
2328
2328
|
meta: e == null ? void 0 : e.meta
|
|
2329
2329
|
} : void 0;
|
|
2330
2330
|
function ContentComponent(e) {
|
|
2331
|
-
var i, r, a, s, c,
|
|
2331
|
+
var i, r, a, s, c, m, f, g, p;
|
|
2332
2332
|
const t = getUpdateVariantVisibilityScript({
|
|
2333
2333
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2334
2334
|
variationId: (i = e.content) == null ? void 0 : i.testVariationId,
|
|
@@ -2344,10 +2344,10 @@ function ContentComponent(e) {
|
|
|
2344
2344
|
...components,
|
|
2345
2345
|
...e.customComponents || []
|
|
2346
2346
|
].reduce(
|
|
2347
|
-
(l, { component:
|
|
2347
|
+
(l, { component: u, ...d }) => ({
|
|
2348
2348
|
...l,
|
|
2349
2349
|
[d.name]: {
|
|
2350
|
-
component:
|
|
2350
|
+
component: u,
|
|
2351
2351
|
...serializeComponentInfo(d)
|
|
2352
2352
|
}
|
|
2353
2353
|
}),
|
|
@@ -2377,7 +2377,7 @@ function ContentComponent(e) {
|
|
|
2377
2377
|
...components,
|
|
2378
2378
|
...e.customComponents || []
|
|
2379
2379
|
].reduce(
|
|
2380
|
-
(l, { component:
|
|
2380
|
+
(l, { component: u, ...d }) => ({
|
|
2381
2381
|
...l,
|
|
2382
2382
|
[d.name]: serializeComponentInfo(d)
|
|
2383
2383
|
}),
|
|
@@ -2405,7 +2405,7 @@ function ContentComponent(e) {
|
|
|
2405
2405
|
{
|
|
2406
2406
|
contentId: (a = o.content) == null ? void 0 : a.id,
|
|
2407
2407
|
cssCode: (c = (s = o.content) == null ? void 0 : s.data) == null ? void 0 : c.cssCode,
|
|
2408
|
-
customFonts: (
|
|
2408
|
+
customFonts: (f = (m = o.content) == null ? void 0 : m.data) == null ? void 0 : f.customFonts
|
|
2409
2409
|
}
|
|
2410
2410
|
) }),
|
|
2411
2411
|
/* @__PURE__ */ jsx(
|
|
@@ -2428,9 +2428,9 @@ function ContentVariants(e) {
|
|
|
2428
2428
|
}), n = function() {
|
|
2429
2429
|
var c;
|
|
2430
2430
|
return getUpdateCookieAndStylesScript(
|
|
2431
|
-
getVariants(e.content).map((
|
|
2432
|
-
id:
|
|
2433
|
-
testRatio:
|
|
2431
|
+
getVariants(e.content).map((m) => ({
|
|
2432
|
+
id: m.testVariationId,
|
|
2433
|
+
testRatio: m.testRatio
|
|
2434
2434
|
})),
|
|
2435
2435
|
((c = e.content) == null ? void 0 : c.id) || ""
|
|
2436
2436
|
);
|
|
@@ -2519,12 +2519,12 @@ const fetchSymbolContent = async ({
|
|
|
2519
2519
|
async function Symbol$1(e) {
|
|
2520
2520
|
var o, i, r, a;
|
|
2521
2521
|
const t = function() {
|
|
2522
|
-
var c,
|
|
2522
|
+
var c, m;
|
|
2523
2523
|
return [
|
|
2524
2524
|
e.attributes.className,
|
|
2525
2525
|
"builder-symbol",
|
|
2526
2526
|
(c = e.symbol) != null && c.inline ? "builder-inline-symbol" : void 0,
|
|
2527
|
-
(
|
|
2527
|
+
(m = e.symbol) != null && m.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
2528
2528
|
].filter(Boolean).join(" ");
|
|
2529
2529
|
}, n = ((o = e.symbol) == null ? void 0 : o.content) || await fetchSymbolContent({
|
|
2530
2530
|
symbol: e.symbol,
|