@builder.io/sdk-react-nextjs 0.7.4 → 0.7.5
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-6b3887b7.js → USE_CLIENT_BUNDLE-02851f5b.js} +2 -2
- package/lib/{node/USE_CLIENT_BUNDLE-539be307.cjs → browser/USE_CLIENT_BUNDLE-19024ae3.cjs} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-2c9d1a5d.js → browser/USE_SERVER_BUNDLE-0dbfec06.js} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-e5ab43ec.cjs → browser/USE_SERVER_BUNDLE-99af92f3.cjs} +1 -1
- package/lib/browser/{bundle-df55c296.cjs → bundle-cf866f2c.cjs} +13 -13
- package/lib/browser/{bundle-fc3e7377.js → bundle-ed21dd97.js} +79 -82
- 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-853614ad.cjs} +1 -1
- package/lib/{node/USE_CLIENT_BUNDLE-a5c6399c.js → edge/USE_CLIENT_BUNDLE-a1ac1e61.js} +2 -2
- package/lib/{node/USE_SERVER_BUNDLE-7f4ba7e9.cjs → edge/USE_SERVER_BUNDLE-949923da.cjs} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-21bf3ffc.js → edge/USE_SERVER_BUNDLE-f8e4c4d9.js} +1 -1
- package/lib/edge/{bundle-bef73246.js → bundle-48628d9c.js} +274 -277
- package/lib/edge/{bundle-38f08fa1.cjs → bundle-97130d9a.cjs} +13 -13
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +3 -3
- package/lib/{edge/USE_CLIENT_BUNDLE-44225d7a.cjs → node/USE_CLIENT_BUNDLE-23b5881f.cjs} +1 -1
- package/lib/{edge/USE_CLIENT_BUNDLE-a32e462e.js → node/USE_CLIENT_BUNDLE-b63c2d8e.js} +2 -2
- package/lib/{browser/USE_SERVER_BUNDLE-b314d0f7.js → node/USE_SERVER_BUNDLE-643288fc.js} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-eed7792a.cjs → node/USE_SERVER_BUNDLE-d645bd91.cjs} +1 -1
- package/lib/node/{bundle-74479d5d.js → bundle-3ab5a1ab.js} +77 -80
- package/lib/node/{bundle-f7863fb3.cjs → bundle-3f7e723b.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-97130d9a.cjs"),t=require("./USE_CLIENT_BUNDLE-853614ad.cjs");require("lru-cache");require("react/jsx-runtime");require("react");require("next/navigation");require("./USE_SERVER_BUNDLE-949923da.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-48628d9c.js";
|
|
2
|
+
import { b as w, F as A, c as F, S as T, V } from "./USE_CLIENT_BUNDLE-a1ac1e61.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-f8e4c4d9.js";
|
|
8
8
|
export {
|
|
9
9
|
i as Blocks,
|
|
10
10
|
w as Button,
|
|
@@ -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-3f7e723b.cjs"),l=require("react"),M=require("./USE_SERVER_BUNDLE-d645bd91.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,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-3ab5a1ab.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-643288fc.js";
|
|
6
6
|
import { useRouter as re } from "next/navigation";
|
|
7
7
|
function ge(e) {
|
|
8
8
|
return /* @__PURE__ */ C(h, { children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use server";"use strict";const n=require("./bundle-
|
|
1
|
+
"use server";"use strict";const n=require("./bundle-3f7e723b.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-b63c2d8e.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,16 @@ function Block(e) {
|
|
|
623
624
|
}, i = function() {
|
|
624
625
|
return e.block.tagName || "div";
|
|
625
626
|
}, r = function() {
|
|
626
|
-
|
|
627
|
+
var u, d;
|
|
628
|
+
return "hide" in o() ? !o().hide : "show" in o() ? o().show : !((u = e.block.repeat) != null && u.collection && !((d = n()) != null && d.length));
|
|
627
629
|
}, a = function() {
|
|
628
630
|
var d;
|
|
629
631
|
return !((d = t()) != null && d.component) && !n() ? o().children ?? [] : [];
|
|
630
632
|
}, s = function() {
|
|
631
|
-
var
|
|
633
|
+
var u, d, b, y, h;
|
|
632
634
|
return {
|
|
633
635
|
blockChildren: o().children ?? [],
|
|
634
|
-
componentRef: (
|
|
636
|
+
componentRef: (u = t()) == null ? void 0 : u.component,
|
|
635
637
|
componentOptions: {
|
|
636
638
|
...getBlockComponentOptions(o()),
|
|
637
639
|
builderContext: e.context,
|
|
@@ -646,7 +648,7 @@ function Block(e) {
|
|
|
646
648
|
isInteractive: !((h = t()) != null && h.isRSC)
|
|
647
649
|
};
|
|
648
650
|
}, c = e.context;
|
|
649
|
-
return /* @__PURE__ */ jsx(Fragment, { children: r() ? /* @__PURE__ */ jsx(Fragment, { children: (
|
|
651
|
+
return /* @__PURE__ */ jsx(Fragment, { children: r() ? /* @__PURE__ */ jsx(Fragment, { children: (m = t()) != null && m.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
650
652
|
ComponentRef,
|
|
651
653
|
{
|
|
652
654
|
componentRef: s().componentRef,
|
|
@@ -668,14 +670,14 @@ function Block(e) {
|
|
|
668
670
|
hasChildren: !1
|
|
669
671
|
}
|
|
670
672
|
) }) : null,
|
|
671
|
-
!isEmptyHtmlElement(i()) && n() ? /* @__PURE__ */ jsx(Fragment, { children: (
|
|
673
|
+
!isEmptyHtmlElement(i()) && n() ? /* @__PURE__ */ jsx(Fragment, { children: (f = n()) == null ? void 0 : f.map((l, u) => /* @__PURE__ */ jsx(
|
|
672
674
|
RepeatedBlock,
|
|
673
675
|
{
|
|
674
676
|
repeatContext: l.context,
|
|
675
677
|
block: l.block,
|
|
676
678
|
registeredComponents: e.registeredComponents
|
|
677
679
|
},
|
|
678
|
-
|
|
680
|
+
u
|
|
679
681
|
)) }) : null,
|
|
680
682
|
!isEmptyHtmlElement(i()) && !n() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
681
683
|
BlockWrapper,
|
|
@@ -769,7 +771,7 @@ function Columns(e) {
|
|
|
769
771
|
desktopStyle: b
|
|
770
772
|
}) {
|
|
771
773
|
return o === "never" ? b : d;
|
|
772
|
-
}, c = e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column",
|
|
774
|
+
}, c = e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column", m = function() {
|
|
773
775
|
return {
|
|
774
776
|
"--flex-dir": c,
|
|
775
777
|
"--flex-dir-tablet": a({
|
|
@@ -777,7 +779,7 @@ function Columns(e) {
|
|
|
777
779
|
desktopStyle: "row"
|
|
778
780
|
})
|
|
779
781
|
};
|
|
780
|
-
},
|
|
782
|
+
}, f = function(d) {
|
|
781
783
|
const b = d === 0 ? 0 : t, y = r(d), h = `${b}px`, v = "100%", x = 0;
|
|
782
784
|
return {
|
|
783
785
|
width: y,
|
|
@@ -836,14 +838,14 @@ function Columns(e) {
|
|
|
836
838
|
"div",
|
|
837
839
|
{
|
|
838
840
|
className: `builder-columns ${e.builderBlock.id}-breakpoints div-0d69fe26`,
|
|
839
|
-
style:
|
|
841
|
+
style: m(),
|
|
840
842
|
children: [
|
|
841
843
|
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: p() }) }),
|
|
842
|
-
(l = e.columns) == null ? void 0 : l.map((
|
|
844
|
+
(l = e.columns) == null ? void 0 : l.map((u, d) => /* @__PURE__ */ createElement(
|
|
843
845
|
"div",
|
|
844
846
|
{
|
|
845
847
|
className: "builder-column div-0d69fe26-2",
|
|
846
|
-
style:
|
|
848
|
+
style: f(d),
|
|
847
849
|
key: d
|
|
848
850
|
},
|
|
849
851
|
/* @__PURE__ */ jsx(
|
|
@@ -856,7 +858,7 @@ function Columns(e) {
|
|
|
856
858
|
},
|
|
857
859
|
context: e.builderContext,
|
|
858
860
|
registeredComponents: e.builderComponents,
|
|
859
|
-
blocks:
|
|
861
|
+
blocks: u.blocks
|
|
860
862
|
}
|
|
861
863
|
)
|
|
862
864
|
))
|
|
@@ -1346,15 +1348,15 @@ const getTopLevelDomain = (e) => {
|
|
|
1346
1348
|
onChange: (e) => {
|
|
1347
1349
|
e.delete("srcset"), e.delete("noWebp");
|
|
1348
1350
|
function n(a, s = 6e4) {
|
|
1349
|
-
return new Promise((c,
|
|
1350
|
-
const
|
|
1351
|
+
return new Promise((c, m) => {
|
|
1352
|
+
const f = document.createElement("img");
|
|
1351
1353
|
let g = !1;
|
|
1352
|
-
|
|
1353
|
-
g = !0, c(
|
|
1354
|
-
},
|
|
1355
|
-
console.warn("Image load failed", p.error),
|
|
1356
|
-
}),
|
|
1357
|
-
g ||
|
|
1354
|
+
f.onload = () => {
|
|
1355
|
+
g = !0, c(f);
|
|
1356
|
+
}, f.addEventListener("error", (p) => {
|
|
1357
|
+
console.warn("Image load failed", p.error), m(p.error);
|
|
1358
|
+
}), f.src = a, setTimeout(() => {
|
|
1359
|
+
g || m(new Error("Image load timed out"));
|
|
1358
1360
|
}, s);
|
|
1359
1361
|
});
|
|
1360
1362
|
}
|
|
@@ -1861,23 +1863,23 @@ const DEFAULT_API_VERSION = "v3", BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUIL
|
|
|
1861
1863
|
apiKey: a,
|
|
1862
1864
|
includeRefs: s = !0,
|
|
1863
1865
|
enrich: c,
|
|
1864
|
-
locale:
|
|
1865
|
-
apiVersion:
|
|
1866
|
+
locale: m,
|
|
1867
|
+
apiVersion: f = DEFAULT_API_VERSION,
|
|
1866
1868
|
fields: g,
|
|
1867
1869
|
omit: p,
|
|
1868
1870
|
offset: l,
|
|
1869
|
-
cacheSeconds:
|
|
1871
|
+
cacheSeconds: u,
|
|
1870
1872
|
staleCacheSeconds: d,
|
|
1871
1873
|
sort: b,
|
|
1872
1874
|
includeUnpublished: y
|
|
1873
1875
|
} = e;
|
|
1874
1876
|
if (!a)
|
|
1875
1877
|
throw new Error("Missing API key");
|
|
1876
|
-
if (!["v2", "v3"].includes(
|
|
1877
|
-
throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${
|
|
1878
|
+
if (!["v2", "v3"].includes(f))
|
|
1879
|
+
throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${f}'`);
|
|
1878
1880
|
(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)),
|
|
1881
|
+
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}` : ""}`);
|
|
1882
|
+
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
1883
|
const S = flatten({
|
|
1882
1884
|
sort: b
|
|
1883
1885
|
});
|
|
@@ -2134,7 +2136,7 @@ const findParentElement = (e, t, n = !0) => {
|
|
|
2134
2136
|
builderElementIndex: n && o ? [].slice.call(document.getElementsByClassName(o)).indexOf(n) : void 0
|
|
2135
2137
|
}
|
|
2136
2138
|
};
|
|
2137
|
-
}, SDK_VERSION = "0.7.
|
|
2139
|
+
}, SDK_VERSION = "0.7.5", registry = {};
|
|
2138
2140
|
function register(e, t) {
|
|
2139
2141
|
let n = registry[e];
|
|
2140
2142
|
if (n || (n = registry[e] = []), n.push(t), isBrowser()) {
|
|
@@ -2201,10 +2203,10 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2201
2203
|
if (o != null && o.type)
|
|
2202
2204
|
switch (o.type) {
|
|
2203
2205
|
case "builder.evaluate": {
|
|
2204
|
-
const a = o.data.text, s = o.data.arguments || [], c = o.data.id,
|
|
2205
|
-
let
|
|
2206
|
+
const a = o.data.text, s = o.data.arguments || [], c = o.data.id, m = new Function(a);
|
|
2207
|
+
let f, g = null;
|
|
2206
2208
|
try {
|
|
2207
|
-
|
|
2209
|
+
f = m.apply(null, s);
|
|
2208
2210
|
} catch (p) {
|
|
2209
2211
|
g = p;
|
|
2210
2212
|
}
|
|
@@ -2214,7 +2216,7 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2214
2216
|
id: c,
|
|
2215
2217
|
error: g.message
|
|
2216
2218
|
}
|
|
2217
|
-
}, "*") :
|
|
2219
|
+
}, "*") : f && typeof f.then == "function" ? f.then((p) => {
|
|
2218
2220
|
var l;
|
|
2219
2221
|
(l = window.parent) == null || l.postMessage({
|
|
2220
2222
|
type: "builder.evaluateResult",
|
|
@@ -2226,7 +2228,7 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2226
2228
|
}).catch(console.error) : (r = window.parent) == null || r.postMessage({
|
|
2227
2229
|
type: "builder.evaluateResult",
|
|
2228
2230
|
data: {
|
|
2229
|
-
result:
|
|
2231
|
+
result: f,
|
|
2230
2232
|
id: c
|
|
2231
2233
|
}
|
|
2232
2234
|
}, "*");
|
|
@@ -2300,22 +2302,17 @@ const getContextStateInitialValue = ({
|
|
|
2300
2302
|
locale: n
|
|
2301
2303
|
}) => {
|
|
2302
2304
|
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,
|
|
2305
|
+
const o = {}, i = ((r = e == null ? void 0 : e.data) == null ? void 0 : r.state) || {};
|
|
2306
|
+
return (s = (a = e == null ? void 0 : e.data) == null ? void 0 : a.inputs) == null || s.forEach((c) => {
|
|
2307
|
+
c.name && c.defaultValue !== void 0 && (o[c.name] = c.defaultValue);
|
|
2308
|
+
}), {
|
|
2309
|
+
...o,
|
|
2310
|
+
...i,
|
|
2310
2311
|
...t,
|
|
2311
2312
|
...n ? {
|
|
2312
2313
|
locale: n
|
|
2313
2314
|
} : {}
|
|
2314
2315
|
};
|
|
2315
|
-
return {
|
|
2316
|
-
...o,
|
|
2317
|
-
...i
|
|
2318
|
-
};
|
|
2319
2316
|
}, getContentInitialValue = ({
|
|
2320
2317
|
content: e,
|
|
2321
2318
|
data: t
|
|
@@ -2328,7 +2325,7 @@ const getContextStateInitialValue = ({
|
|
|
2328
2325
|
meta: e == null ? void 0 : e.meta
|
|
2329
2326
|
} : void 0;
|
|
2330
2327
|
function ContentComponent(e) {
|
|
2331
|
-
var i, r, a, s, c,
|
|
2328
|
+
var i, r, a, s, c, m, f, g, p;
|
|
2332
2329
|
const t = getUpdateVariantVisibilityScript({
|
|
2333
2330
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2334
2331
|
variationId: (i = e.content) == null ? void 0 : i.testVariationId,
|
|
@@ -2344,10 +2341,10 @@ function ContentComponent(e) {
|
|
|
2344
2341
|
...components,
|
|
2345
2342
|
...e.customComponents || []
|
|
2346
2343
|
].reduce(
|
|
2347
|
-
(l, { component:
|
|
2344
|
+
(l, { component: u, ...d }) => ({
|
|
2348
2345
|
...l,
|
|
2349
2346
|
[d.name]: {
|
|
2350
|
-
component:
|
|
2347
|
+
component: u,
|
|
2351
2348
|
...serializeComponentInfo(d)
|
|
2352
2349
|
}
|
|
2353
2350
|
}),
|
|
@@ -2377,7 +2374,7 @@ function ContentComponent(e) {
|
|
|
2377
2374
|
...components,
|
|
2378
2375
|
...e.customComponents || []
|
|
2379
2376
|
].reduce(
|
|
2380
|
-
(l, { component:
|
|
2377
|
+
(l, { component: u, ...d }) => ({
|
|
2381
2378
|
...l,
|
|
2382
2379
|
[d.name]: serializeComponentInfo(d)
|
|
2383
2380
|
}),
|
|
@@ -2405,7 +2402,7 @@ function ContentComponent(e) {
|
|
|
2405
2402
|
{
|
|
2406
2403
|
contentId: (a = o.content) == null ? void 0 : a.id,
|
|
2407
2404
|
cssCode: (c = (s = o.content) == null ? void 0 : s.data) == null ? void 0 : c.cssCode,
|
|
2408
|
-
customFonts: (
|
|
2405
|
+
customFonts: (f = (m = o.content) == null ? void 0 : m.data) == null ? void 0 : f.customFonts
|
|
2409
2406
|
}
|
|
2410
2407
|
) }),
|
|
2411
2408
|
/* @__PURE__ */ jsx(
|
|
@@ -2428,9 +2425,9 @@ function ContentVariants(e) {
|
|
|
2428
2425
|
}), n = function() {
|
|
2429
2426
|
var c;
|
|
2430
2427
|
return getUpdateCookieAndStylesScript(
|
|
2431
|
-
getVariants(e.content).map((
|
|
2432
|
-
id:
|
|
2433
|
-
testRatio:
|
|
2428
|
+
getVariants(e.content).map((m) => ({
|
|
2429
|
+
id: m.testVariationId,
|
|
2430
|
+
testRatio: m.testRatio
|
|
2434
2431
|
})),
|
|
2435
2432
|
((c = e.content) == null ? void 0 : c.id) || ""
|
|
2436
2433
|
);
|
|
@@ -2519,12 +2516,12 @@ const fetchSymbolContent = async ({
|
|
|
2519
2516
|
async function Symbol$1(e) {
|
|
2520
2517
|
var o, i, r, a;
|
|
2521
2518
|
const t = function() {
|
|
2522
|
-
var c,
|
|
2519
|
+
var c, m;
|
|
2523
2520
|
return [
|
|
2524
2521
|
e.attributes.className,
|
|
2525
2522
|
"builder-symbol",
|
|
2526
2523
|
(c = e.symbol) != null && c.inline ? "builder-inline-symbol" : void 0,
|
|
2527
|
-
(
|
|
2524
|
+
(m = e.symbol) != null && m.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
2528
2525
|
].filter(Boolean).join(" ");
|
|
2529
2526
|
}, n = ((o = e.symbol) == null ? void 0 : o.content) || await fetchSymbolContent({
|
|
2530
2527
|
symbol: e.symbol,
|