@builder.io/sdk-react-nextjs 0.12.0 → 0.12.1
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-ff4465dc.cjs → browser/USE_CLIENT_BUNDLE-5457b97e.cjs} +1 -1
- package/lib/browser/{USE_CLIENT_BUNDLE-109dedea.js → USE_CLIENT_BUNDLE-ac9ba054.js} +2 -2
- package/lib/{edge/USE_SERVER_BUNDLE-35036883.js → browser/USE_SERVER_BUNDLE-153f7d4b.js} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-ab530745.cjs → browser/USE_SERVER_BUNDLE-a0bf6d8f.cjs} +1 -1
- package/lib/browser/{bundle-ff1186e7.cjs → bundle-6435b7fb.cjs} +19 -19
- package/lib/browser/{bundle-f769d53a.js → bundle-7e2a44d9.js} +302 -259
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +3 -3
- package/lib/{node/USE_CLIENT_BUNDLE-f1c14740.js → edge/USE_CLIENT_BUNDLE-3049fd56.js} +2 -2
- package/lib/{browser/USE_CLIENT_BUNDLE-c6f253a6.cjs → edge/USE_CLIENT_BUNDLE-8922846d.cjs} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-a546a48c.js → edge/USE_SERVER_BUNDLE-231b55dd.js} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-ce3684c3.cjs → edge/USE_SERVER_BUNDLE-24df6623.cjs} +1 -1
- package/lib/edge/{bundle-80ec9a4d.js → bundle-44392f6d.js} +599 -556
- package/lib/edge/{bundle-593d3883.cjs → bundle-6d55a6a7.cjs} +26 -26
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +3 -3
- package/lib/{edge/USE_CLIENT_BUNDLE-23097d3f.cjs → node/USE_CLIENT_BUNDLE-09122ff1.cjs} +1 -1
- package/lib/{edge/USE_CLIENT_BUNDLE-bffeb179.js → node/USE_CLIENT_BUNDLE-f4804af3.js} +2 -2
- package/lib/{browser/USE_SERVER_BUNDLE-a36e67c3.js → node/USE_SERVER_BUNDLE-33c309df.js} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-7d41532a.cjs → node/USE_SERVER_BUNDLE-93366161.cjs} +1 -1
- package/lib/node/{bundle-fd27db7d.js → bundle-217b5738.js} +138 -95
- package/lib/node/{bundle-6e88a55c.cjs → bundle-b9af39ec.cjs} +10 -10
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/package.json +1 -1
- package/types/cjs/blocks/slot/component-info.d.ts +2 -0
- package/types/cjs/blocks/slot/slot.d.ts +11 -0
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/esm/blocks/slot/component-info.d.ts +2 -0
- package/types/esm/blocks/slot/slot.d.ts +11 -0
- 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-6d55a6a7.cjs"),t=require("./USE_CLIENT_BUNDLE-8922846d.cjs");require("lru-cache");require("react/jsx-runtime");require("react");require("next/navigation");require("./USE_SERVER_BUNDLE-24df6623.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-44392f6d.js";
|
|
2
|
+
import { b as w, F as A, c as F, S as T, V } from "./USE_CLIENT_BUNDLE-3049fd56.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-231b55dd.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-b9af39ec.cjs"),r=require("react"),V=require("./USE_SERVER_BUNDLE-93366161.cjs"),A=require("next/navigation");function D(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-fdf49de0",children:e.text})}),t.jsx("style",{children:`.button-fdf49de0 {
|
|
2
2
|
all: unset;
|
|
3
3
|
}`})]})}function U(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 H(e){return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:e.includeBlockProps?{...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 O(e){function o(){var s;return"builder-blocks"+((s=e.blocks)!=null&&s.length?"":" no-blocks")}function g(){var s,m;c.isEditing()&&!((s=e.blocks)!=null&&s.length)&&((m=window.parent)==null||m.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function S(){var s,m;c.isEditing()&&!((s=e.blocks)!=null&&s.length)&&((m=window.parent)==null||m.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return t.jsxs(t.Fragment,{children:[t.jsx(e.BlocksWrapper,{className:o()+" props-blocks-wrapper-4f2c12d8","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:s=>g(),onMouseEnter:s=>S(),onKeyPress:s=>g(),...e.BlocksWrapperProps,children:e.children}),t.jsx("style",{children:`.props-blocks-wrapper-4f2c12d8 {
|
|
4
4
|
display: flex;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as w, Fragment as g, jsx as i } from "react/jsx-runtime";
|
|
3
|
-
import { g as T, a as B, i as E, b as R, c as Y, d as P, e as U, _ as H, f as Z, l as p, h as O, j as ee, k as te, r as ne, s as ie, m as ae, n as ce, o as le } from "./bundle-
|
|
3
|
+
import { g as T, a as B, i as E, b as R, c as Y, d as P, e as U, _ as H, f as Z, l as p, h as O, j as ee, k as te, r as ne, s as ie, m as ae, n as ce, o as le } from "./bundle-217b5738.js";
|
|
4
4
|
import { useRef as N, useState as v, useEffect as b, createContext as oe, createElement as re } from "react";
|
|
5
|
-
import { p as de } from "./USE_SERVER_BUNDLE-
|
|
5
|
+
import { p as de } from "./USE_SERVER_BUNDLE-33c309df.js";
|
|
6
6
|
import { useRouter as se } from "next/navigation";
|
|
7
7
|
function xe(e) {
|
|
8
8
|
return /* @__PURE__ */ w(g, { children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use server";"use strict";const n=require("./bundle-
|
|
1
|
+
"use server";"use strict";const n=require("./bundle-b9af39ec.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-f4804af3.js";
|
|
5
5
|
import "next/navigation";
|
|
6
6
|
function getBlockComponentOptions(e) {
|
|
7
7
|
var t;
|
|
@@ -187,25 +187,25 @@ output;
|
|
|
187
187
|
context: n,
|
|
188
188
|
event: o,
|
|
189
189
|
state: s
|
|
190
|
-
}),
|
|
191
|
-
|
|
192
|
-
console.log(...
|
|
193
|
-
}),
|
|
194
|
-
set(a,
|
|
195
|
-
}), c.forEach(([
|
|
190
|
+
}), m = getIsolateContext(), d = m.global;
|
|
191
|
+
d.setSync("global", d.derefInto()), d.setSync("log", function(...u) {
|
|
192
|
+
console.log(...u);
|
|
193
|
+
}), d.setSync(BUILDER_SET_STATE_NAME, function(u, f) {
|
|
194
|
+
set(a, u, f), i == null || i(a);
|
|
195
|
+
}), c.forEach(([u, f]) => {
|
|
196
196
|
const l = typeof f == "object" ? new ivm.Reference(
|
|
197
197
|
// workaround: methods with default values for arguments is not being cloned over
|
|
198
|
-
|
|
198
|
+
u === "builder" ? {
|
|
199
199
|
...f,
|
|
200
200
|
getUserAttributes: () => f.getUserAttributes()
|
|
201
201
|
} : f
|
|
202
202
|
) : null;
|
|
203
|
-
|
|
204
|
-
}),
|
|
203
|
+
d.setSync(getSyncValName(u), l);
|
|
204
|
+
}), d.setSync(INJECTED_IVM_GLOBAL, ivm);
|
|
205
205
|
const p = processCode({
|
|
206
206
|
code: e,
|
|
207
207
|
args: c
|
|
208
|
-
}), g =
|
|
208
|
+
}), g = m.evalSync(p);
|
|
209
209
|
try {
|
|
210
210
|
return JSON.parse(g);
|
|
211
211
|
} catch {
|
|
@@ -267,14 +267,14 @@ const evaluateBindings = ({
|
|
|
267
267
|
}
|
|
268
268
|
};
|
|
269
269
|
for (const s in e.bindings) {
|
|
270
|
-
const c = e.bindings[s],
|
|
270
|
+
const c = e.bindings[s], m = evaluate({
|
|
271
271
|
code: c,
|
|
272
272
|
localState: n,
|
|
273
273
|
rootState: o,
|
|
274
274
|
rootSetState: r,
|
|
275
275
|
context: t
|
|
276
276
|
});
|
|
277
|
-
set(a, s,
|
|
277
|
+
set(a, s, m);
|
|
278
278
|
}
|
|
279
279
|
return a;
|
|
280
280
|
};
|
|
@@ -337,15 +337,15 @@ const EMPTY_HTML_ELEMENTS = ["area", "base", "br", "col", "embed", "hr", "img",
|
|
|
337
337
|
if (!Array.isArray(r))
|
|
338
338
|
return;
|
|
339
339
|
const i = n.collection.split(".").pop(), a = n.itemName || (i ? i + "Item" : "item");
|
|
340
|
-
return r.map((c,
|
|
340
|
+
return r.map((c, m) => ({
|
|
341
341
|
context: {
|
|
342
342
|
...t,
|
|
343
343
|
localState: {
|
|
344
344
|
...t.localState,
|
|
345
|
-
$index:
|
|
345
|
+
$index: m,
|
|
346
346
|
$item: c,
|
|
347
347
|
[a]: c,
|
|
348
|
-
[`$${a}Index`]:
|
|
348
|
+
[`$${a}Index`]: m
|
|
349
349
|
}
|
|
350
350
|
},
|
|
351
351
|
block: o
|
|
@@ -433,28 +433,28 @@ function BlockStyles(e) {
|
|
|
433
433
|
shouldEvaluateBindings: !0
|
|
434
434
|
}), i = r.responsiveStyles, a = e.context.content, s = getSizesForBreakpoints(
|
|
435
435
|
((l = a == null ? void 0 : a.meta) == null ? void 0 : l.breakpoints) || {}
|
|
436
|
-
), c = i == null ? void 0 : i.large,
|
|
436
|
+
), c = i == null ? void 0 : i.large, m = i == null ? void 0 : i.medium, d = i == null ? void 0 : i.small, p = r.id;
|
|
437
437
|
if (!p)
|
|
438
438
|
return "";
|
|
439
439
|
const g = c ? createCssClass({
|
|
440
440
|
className: p,
|
|
441
441
|
styles: c
|
|
442
|
-
}) : "",
|
|
442
|
+
}) : "", u = m ? createCssClass({
|
|
443
443
|
className: p,
|
|
444
|
-
styles:
|
|
444
|
+
styles: m,
|
|
445
445
|
mediaQuery: getMaxWidthQueryForSize(
|
|
446
446
|
"medium",
|
|
447
447
|
s
|
|
448
448
|
)
|
|
449
|
-
}) : "", f =
|
|
449
|
+
}) : "", f = d ? createCssClass({
|
|
450
450
|
className: p,
|
|
451
|
-
styles:
|
|
451
|
+
styles: d,
|
|
452
452
|
mediaQuery: getMaxWidthQueryForSize(
|
|
453
453
|
"small",
|
|
454
454
|
s
|
|
455
455
|
)
|
|
456
456
|
}) : "";
|
|
457
|
-
return [g,
|
|
457
|
+
return [g, u, f].join(" ");
|
|
458
458
|
};
|
|
459
459
|
return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: n() }) }) : null });
|
|
460
460
|
}
|
|
@@ -598,7 +598,7 @@ function RepeatedBlock(e) {
|
|
|
598
598
|
);
|
|
599
599
|
}
|
|
600
600
|
function Block(e) {
|
|
601
|
-
var
|
|
601
|
+
var m, d, p;
|
|
602
602
|
const t = function() {
|
|
603
603
|
return getComponent({
|
|
604
604
|
block: e.block,
|
|
@@ -611,8 +611,8 @@ function Block(e) {
|
|
|
611
611
|
context: e.context
|
|
612
612
|
});
|
|
613
613
|
}, o = function() {
|
|
614
|
-
var
|
|
615
|
-
return (
|
|
614
|
+
var u;
|
|
615
|
+
return (u = e.block.repeat) != null && u.collection ? e.block : getProcessedBlock({
|
|
616
616
|
block: e.block,
|
|
617
617
|
localState: e.context.localState,
|
|
618
618
|
rootState: e.context.rootState,
|
|
@@ -626,16 +626,16 @@ function Block(e) {
|
|
|
626
626
|
var l, h;
|
|
627
627
|
if ((l = e.block.repeat) != null && l.collection)
|
|
628
628
|
return !!((h = n()) != null && h.length);
|
|
629
|
-
const
|
|
630
|
-
return ("show" in o() ? o().show : !0) && !
|
|
629
|
+
const u = "hide" in o() ? o().hide : !1;
|
|
630
|
+
return ("show" in o() ? o().show : !0) && !u;
|
|
631
631
|
}, a = function() {
|
|
632
632
|
var f;
|
|
633
633
|
return !((f = t()) != null && f.component) && !n() ? o().children ?? [] : [];
|
|
634
634
|
}, s = function() {
|
|
635
|
-
var
|
|
635
|
+
var u, f, l, h, y;
|
|
636
636
|
return {
|
|
637
637
|
blockChildren: o().children ?? [],
|
|
638
|
-
componentRef: (
|
|
638
|
+
componentRef: (u = t()) == null ? void 0 : u.component,
|
|
639
639
|
componentOptions: {
|
|
640
640
|
...getBlockComponentOptions(o()),
|
|
641
641
|
builderContext: e.context,
|
|
@@ -652,7 +652,7 @@ function Block(e) {
|
|
|
652
652
|
}, c = e.context;
|
|
653
653
|
return /* @__PURE__ */ jsx(Fragment, { children: i() ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
654
654
|
/* @__PURE__ */ jsx(BlockStyles, { block: e.block, context: e.context }),
|
|
655
|
-
(
|
|
655
|
+
(m = t()) != null && m.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
656
656
|
ComponentRef,
|
|
657
657
|
{
|
|
658
658
|
componentRef: s().componentRef,
|
|
@@ -674,14 +674,14 @@ function Block(e) {
|
|
|
674
674
|
hasChildren: !1
|
|
675
675
|
}
|
|
676
676
|
) }) : null,
|
|
677
|
-
!isEmptyHtmlElement(r()) && n() ? /* @__PURE__ */ jsx(Fragment, { children: (
|
|
677
|
+
!isEmptyHtmlElement(r()) && n() ? /* @__PURE__ */ jsx(Fragment, { children: (d = n()) == null ? void 0 : d.map((g, u) => /* @__PURE__ */ jsx(
|
|
678
678
|
RepeatedBlock,
|
|
679
679
|
{
|
|
680
680
|
repeatContext: g.context,
|
|
681
681
|
block: g.block,
|
|
682
682
|
registeredComponents: e.registeredComponents
|
|
683
683
|
},
|
|
684
|
-
|
|
684
|
+
u
|
|
685
685
|
)) }) : null,
|
|
686
686
|
!isEmptyHtmlElement(r()) && !n() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
687
687
|
BlockWrapper,
|
|
@@ -743,7 +743,7 @@ function Blocks(e) {
|
|
|
743
743
|
);
|
|
744
744
|
}
|
|
745
745
|
function Columns(e) {
|
|
746
|
-
var
|
|
746
|
+
var u;
|
|
747
747
|
const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet", r = function(l) {
|
|
748
748
|
var h;
|
|
749
749
|
return ((h = n[l]) == null ? void 0 : h.width) || 100 / n.length;
|
|
@@ -760,7 +760,7 @@ function Columns(e) {
|
|
|
760
760
|
desktopStyle: h
|
|
761
761
|
}) {
|
|
762
762
|
return o === "never" ? h : l;
|
|
763
|
-
}, c = e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column",
|
|
763
|
+
}, c = e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column", m = function() {
|
|
764
764
|
return {
|
|
765
765
|
"--flex-dir": c,
|
|
766
766
|
"--flex-dir-tablet": a({
|
|
@@ -768,7 +768,7 @@ function Columns(e) {
|
|
|
768
768
|
desktopStyle: "row"
|
|
769
769
|
})
|
|
770
770
|
};
|
|
771
|
-
},
|
|
771
|
+
}, d = function(l) {
|
|
772
772
|
const h = l === 0 ? 0 : t, y = i(l), b = `${h}px`, v = "100%", x = 0;
|
|
773
773
|
return {
|
|
774
774
|
width: y,
|
|
@@ -827,14 +827,14 @@ function Columns(e) {
|
|
|
827
827
|
"div",
|
|
828
828
|
{
|
|
829
829
|
className: `builder-columns ${e.builderBlock.id}-breakpoints div-39daef82`,
|
|
830
|
-
style:
|
|
830
|
+
style: m(),
|
|
831
831
|
children: [
|
|
832
832
|
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: g() }) }),
|
|
833
|
-
(
|
|
833
|
+
(u = e.columns) == null ? void 0 : u.map((f, l) => /* @__PURE__ */ createElement(
|
|
834
834
|
"div",
|
|
835
835
|
{
|
|
836
836
|
className: "builder-column div-39daef82-2",
|
|
837
|
-
style:
|
|
837
|
+
style: d(l),
|
|
838
838
|
key: l
|
|
839
839
|
},
|
|
840
840
|
/* @__PURE__ */ jsx(
|
|
@@ -1029,7 +1029,7 @@ const getTopLevelDomain = (e) => {
|
|
|
1029
1029
|
...e,
|
|
1030
1030
|
...r
|
|
1031
1031
|
};
|
|
1032
|
-
}, getDefaultCanTrack = (e) => checkIsDefined(e) ? e : !0, componentInfo$
|
|
1032
|
+
}, getDefaultCanTrack = (e) => checkIsDefined(e) ? e : !0, componentInfo$b = {
|
|
1033
1033
|
name: "Core:Button",
|
|
1034
1034
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
|
|
1035
1035
|
defaultStyles: {
|
|
@@ -1062,7 +1062,7 @@ const getTopLevelDomain = (e) => {
|
|
|
1062
1062
|
}],
|
|
1063
1063
|
static: !0,
|
|
1064
1064
|
noWrap: !0
|
|
1065
|
-
}, componentInfo$
|
|
1065
|
+
}, componentInfo$a = {
|
|
1066
1066
|
// TODO: ways to statically preprocess JSON for references, functions, etc
|
|
1067
1067
|
name: "Columns",
|
|
1068
1068
|
isRSC: !0,
|
|
@@ -1263,7 +1263,7 @@ const getTopLevelDomain = (e) => {
|
|
|
1263
1263
|
helperText: "When stacking columns for mobile devices, reverse the ordering",
|
|
1264
1264
|
advanced: !0
|
|
1265
1265
|
}]
|
|
1266
|
-
}, componentInfo$
|
|
1266
|
+
}, componentInfo$9 = {
|
|
1267
1267
|
name: "Custom Code",
|
|
1268
1268
|
static: !0,
|
|
1269
1269
|
requiredPermissions: ["editCode"],
|
|
@@ -1285,7 +1285,7 @@ const getTopLevelDomain = (e) => {
|
|
|
1285
1285
|
helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
|
|
1286
1286
|
advanced: !0
|
|
1287
1287
|
}]
|
|
1288
|
-
}, componentInfo$
|
|
1288
|
+
}, componentInfo$8 = {
|
|
1289
1289
|
name: "Embed",
|
|
1290
1290
|
static: !0,
|
|
1291
1291
|
inputs: [{
|
|
@@ -1310,13 +1310,13 @@ const getTopLevelDomain = (e) => {
|
|
|
1310
1310
|
defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
|
|
1311
1311
|
hideFromUI: !0
|
|
1312
1312
|
}]
|
|
1313
|
-
}, SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"], isJsScript = (e) => SCRIPT_MIME_TYPES.includes(e.type), componentInfo$
|
|
1313
|
+
}, SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"], isJsScript = (e) => SCRIPT_MIME_TYPES.includes(e.type), componentInfo$7 = {
|
|
1314
1314
|
name: "Fragment",
|
|
1315
1315
|
static: !0,
|
|
1316
1316
|
hidden: !0,
|
|
1317
1317
|
canHaveChildren: !0,
|
|
1318
1318
|
noWrap: !0
|
|
1319
|
-
}, componentInfo$
|
|
1319
|
+
}, componentInfo$6 = {
|
|
1320
1320
|
name: "Image",
|
|
1321
1321
|
static: !0,
|
|
1322
1322
|
image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
|
|
@@ -1337,15 +1337,15 @@ const getTopLevelDomain = (e) => {
|
|
|
1337
1337
|
onChange: (e) => {
|
|
1338
1338
|
e.delete("srcset"), e.delete("noWebp");
|
|
1339
1339
|
function n(a, s = 6e4) {
|
|
1340
|
-
return new Promise((c,
|
|
1341
|
-
const
|
|
1340
|
+
return new Promise((c, m) => {
|
|
1341
|
+
const d = document.createElement("img");
|
|
1342
1342
|
let p = !1;
|
|
1343
|
-
|
|
1344
|
-
p = !0, c(
|
|
1345
|
-
},
|
|
1346
|
-
console.warn("Image load failed", g.error),
|
|
1347
|
-
}),
|
|
1348
|
-
p ||
|
|
1343
|
+
d.onload = () => {
|
|
1344
|
+
p = !0, c(d);
|
|
1345
|
+
}, d.addEventListener("error", (g) => {
|
|
1346
|
+
console.warn("Image load failed", g.error), m(g.error);
|
|
1347
|
+
}), d.src = a, setTimeout(() => {
|
|
1348
|
+
p || m(new Error("Image load timed out"));
|
|
1349
1349
|
}, s);
|
|
1350
1350
|
});
|
|
1351
1351
|
}
|
|
@@ -1416,7 +1416,7 @@ const getTopLevelDomain = (e) => {
|
|
|
1416
1416
|
advanced: !0,
|
|
1417
1417
|
defaultValue: 0.7041
|
|
1418
1418
|
}]
|
|
1419
|
-
}, componentInfo$
|
|
1419
|
+
}, componentInfo$5 = {
|
|
1420
1420
|
// friendlyName?
|
|
1421
1421
|
name: "Raw:Img",
|
|
1422
1422
|
hideFromInsertMenu: !0,
|
|
@@ -1430,7 +1430,7 @@ const getTopLevelDomain = (e) => {
|
|
|
1430
1430
|
}],
|
|
1431
1431
|
noWrap: !0,
|
|
1432
1432
|
static: !0
|
|
1433
|
-
}, componentInfo$
|
|
1433
|
+
}, componentInfo$4 = {
|
|
1434
1434
|
name: "Core:Section",
|
|
1435
1435
|
static: !0,
|
|
1436
1436
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -1469,7 +1469,44 @@ const getTopLevelDomain = (e) => {
|
|
|
1469
1469
|
}
|
|
1470
1470
|
}
|
|
1471
1471
|
}]
|
|
1472
|
-
}, componentInfo$
|
|
1472
|
+
}, componentInfo$3 = {
|
|
1473
|
+
name: "Slot",
|
|
1474
|
+
isRSC: !0,
|
|
1475
|
+
description: "Allow child blocks to be inserted into this content when used as a Symbol",
|
|
1476
|
+
docsLink: "https://www.builder.io/c/docs/symbols-with-blocks",
|
|
1477
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",
|
|
1478
|
+
// Maybe wrap this for canHaveChildren so bind children to this hm
|
|
1479
|
+
inputs: [{
|
|
1480
|
+
name: "name",
|
|
1481
|
+
type: "string",
|
|
1482
|
+
required: !0,
|
|
1483
|
+
defaultValue: "children"
|
|
1484
|
+
}]
|
|
1485
|
+
};
|
|
1486
|
+
function Slot(e) {
|
|
1487
|
+
var t, n, o;
|
|
1488
|
+
return /* @__PURE__ */ jsx(
|
|
1489
|
+
"div",
|
|
1490
|
+
{
|
|
1491
|
+
style: {
|
|
1492
|
+
pointerEvents: "auto"
|
|
1493
|
+
},
|
|
1494
|
+
...!((t = e.builderContext.context) != null && t.symbolId) && {
|
|
1495
|
+
"builder-slot": e.name
|
|
1496
|
+
},
|
|
1497
|
+
children: /* @__PURE__ */ jsx(
|
|
1498
|
+
Blocks,
|
|
1499
|
+
{
|
|
1500
|
+
parent: (n = e.builderContext.context) == null ? void 0 : n.symbolId,
|
|
1501
|
+
path: `symbol.data.${e.name}`,
|
|
1502
|
+
context: e.builderContext,
|
|
1503
|
+
blocks: (o = e.builderContext.rootState) == null ? void 0 : o[e.name]
|
|
1504
|
+
}
|
|
1505
|
+
)
|
|
1506
|
+
}
|
|
1507
|
+
);
|
|
1508
|
+
}
|
|
1509
|
+
const componentInfo$2 = {
|
|
1473
1510
|
name: "Symbol",
|
|
1474
1511
|
noWrap: !0,
|
|
1475
1512
|
static: !0,
|
|
@@ -1617,28 +1654,28 @@ const componentInfo = {
|
|
|
1617
1654
|
}]
|
|
1618
1655
|
}, getDefaultRegisteredComponents = () => [{
|
|
1619
1656
|
component: Button,
|
|
1620
|
-
...componentInfo$
|
|
1657
|
+
...componentInfo$b
|
|
1621
1658
|
}, {
|
|
1622
1659
|
component: Columns,
|
|
1623
|
-
...componentInfo$
|
|
1660
|
+
...componentInfo$a
|
|
1624
1661
|
}, {
|
|
1625
1662
|
component: CustomCode,
|
|
1626
|
-
...componentInfo$
|
|
1663
|
+
...componentInfo$9
|
|
1627
1664
|
}, {
|
|
1628
1665
|
component: Embed,
|
|
1629
|
-
...componentInfo$
|
|
1666
|
+
...componentInfo$8
|
|
1630
1667
|
}, {
|
|
1631
1668
|
component: FragmentComponent,
|
|
1632
|
-
...componentInfo$
|
|
1669
|
+
...componentInfo$7
|
|
1633
1670
|
}, {
|
|
1634
1671
|
component: Image,
|
|
1635
|
-
...componentInfo$
|
|
1672
|
+
...componentInfo$6
|
|
1636
1673
|
}, {
|
|
1637
1674
|
component: ImgComponent,
|
|
1638
|
-
...componentInfo$
|
|
1675
|
+
...componentInfo$5
|
|
1639
1676
|
}, {
|
|
1640
1677
|
component: SectionComponent,
|
|
1641
|
-
...componentInfo$
|
|
1678
|
+
...componentInfo$4
|
|
1642
1679
|
}, {
|
|
1643
1680
|
component: Symbol$1,
|
|
1644
1681
|
...componentInfo$2
|
|
@@ -1648,6 +1685,9 @@ const componentInfo = {
|
|
|
1648
1685
|
}, {
|
|
1649
1686
|
component: Video,
|
|
1650
1687
|
...componentInfo
|
|
1688
|
+
}, {
|
|
1689
|
+
component: Slot,
|
|
1690
|
+
...componentInfo$3
|
|
1651
1691
|
}], components = [], createRegisterComponentMessage = (e) => ({
|
|
1652
1692
|
type: "builder.registerComponent",
|
|
1653
1693
|
data: serializeComponentInfo(e)
|
|
@@ -1852,11 +1892,11 @@ const DEFAULT_API_VERSION = "v3", BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUIL
|
|
|
1852
1892
|
apiKey: a,
|
|
1853
1893
|
includeRefs: s = !0,
|
|
1854
1894
|
enrich: c,
|
|
1855
|
-
locale:
|
|
1856
|
-
apiVersion:
|
|
1895
|
+
locale: m,
|
|
1896
|
+
apiVersion: d = DEFAULT_API_VERSION,
|
|
1857
1897
|
fields: p,
|
|
1858
1898
|
omit: g,
|
|
1859
|
-
offset:
|
|
1899
|
+
offset: u,
|
|
1860
1900
|
cacheSeconds: f,
|
|
1861
1901
|
staleCacheSeconds: l,
|
|
1862
1902
|
sort: h,
|
|
@@ -1864,11 +1904,11 @@ const DEFAULT_API_VERSION = "v3", BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUIL
|
|
|
1864
1904
|
} = e;
|
|
1865
1905
|
if (!a)
|
|
1866
1906
|
throw new Error("Missing API key");
|
|
1867
|
-
if (!["v2", "v3"].includes(
|
|
1868
|
-
throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${
|
|
1907
|
+
if (!["v2", "v3"].includes(d))
|
|
1908
|
+
throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${d}'`);
|
|
1869
1909
|
(e.limit === void 0 || e.limit > 1) && !("noTraverse" in e) && (t = !0);
|
|
1870
|
-
const b = new URL(`https://cdn.builder.io/api/${
|
|
1871
|
-
if (b.searchParams.set("omit", g || "meta.componentsUsed"), p && b.searchParams.set("fields", p), Number.isFinite(
|
|
1910
|
+
const b = new URL(`https://cdn.builder.io/api/${d}/content/${i}?apiKey=${a}&limit=${n}&noTraverse=${t}&includeRefs=${s}${m ? `&locale=${m}` : ""}${c ? `&enrich=${c}` : ""}`);
|
|
1911
|
+
if (b.searchParams.set("omit", g || "meta.componentsUsed"), p && b.searchParams.set("fields", p), Number.isFinite(u) && u > -1 && b.searchParams.set("offset", String(Math.floor(u))), typeof y == "boolean" && b.searchParams.set("includeUnpublished", String(y)), f && isPositiveNumber(f) && b.searchParams.set("cacheSeconds", String(f)), l && isPositiveNumber(l) && b.searchParams.set("staleCacheSeconds", String(l)), h) {
|
|
1872
1912
|
const S = flatten({
|
|
1873
1913
|
sort: h
|
|
1874
1914
|
});
|
|
@@ -2125,7 +2165,7 @@ const findParentElement = (e, t, n = !0) => {
|
|
|
2125
2165
|
builderElementIndex: n && o ? [].slice.call(document.getElementsByClassName(o)).indexOf(n) : void 0
|
|
2126
2166
|
}
|
|
2127
2167
|
};
|
|
2128
|
-
}, SDK_VERSION = "0.12.
|
|
2168
|
+
}, SDK_VERSION = "0.12.1", registry = {};
|
|
2129
2169
|
function register(e, t) {
|
|
2130
2170
|
let n = registry[e];
|
|
2131
2171
|
if (n || (n = registry[e] = []), n.push(t), isBrowser()) {
|
|
@@ -2192,10 +2232,10 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2192
2232
|
if (o != null && o.type)
|
|
2193
2233
|
switch (o.type) {
|
|
2194
2234
|
case "builder.evaluate": {
|
|
2195
|
-
const a = o.data.text, s = o.data.arguments || [], c = o.data.id,
|
|
2196
|
-
let
|
|
2235
|
+
const a = o.data.text, s = o.data.arguments || [], c = o.data.id, m = new Function(a);
|
|
2236
|
+
let d, p = null;
|
|
2197
2237
|
try {
|
|
2198
|
-
|
|
2238
|
+
d = m.apply(null, s);
|
|
2199
2239
|
} catch (g) {
|
|
2200
2240
|
p = g;
|
|
2201
2241
|
}
|
|
@@ -2205,9 +2245,9 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2205
2245
|
id: c,
|
|
2206
2246
|
error: p.message
|
|
2207
2247
|
}
|
|
2208
|
-
}, "*") :
|
|
2209
|
-
var
|
|
2210
|
-
(
|
|
2248
|
+
}, "*") : d && typeof d.then == "function" ? d.then((g) => {
|
|
2249
|
+
var u;
|
|
2250
|
+
(u = window.parent) == null || u.postMessage({
|
|
2211
2251
|
type: "builder.evaluateResult",
|
|
2212
2252
|
data: {
|
|
2213
2253
|
id: c,
|
|
@@ -2217,7 +2257,7 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2217
2257
|
}).catch(console.error) : (i = window.parent) == null || i.postMessage({
|
|
2218
2258
|
type: "builder.evaluateResult",
|
|
2219
2259
|
data: {
|
|
2220
|
-
result:
|
|
2260
|
+
result: d,
|
|
2221
2261
|
id: c
|
|
2222
2262
|
}
|
|
2223
2263
|
}, "*");
|
|
@@ -2314,7 +2354,7 @@ const getRootStateInitialValue = ({
|
|
|
2314
2354
|
meta: e == null ? void 0 : e.meta
|
|
2315
2355
|
} : void 0;
|
|
2316
2356
|
function ContentComponent(e) {
|
|
2317
|
-
var r, i, a, s, c,
|
|
2357
|
+
var r, i, a, s, c, m, d, p, g;
|
|
2318
2358
|
const t = getUpdateVariantVisibilityScript({
|
|
2319
2359
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2320
2360
|
variationId: (r = e.content) == null ? void 0 : r.testVariationId,
|
|
@@ -2330,8 +2370,8 @@ function ContentComponent(e) {
|
|
|
2330
2370
|
...components,
|
|
2331
2371
|
...e.customComponents || []
|
|
2332
2372
|
].reduce(
|
|
2333
|
-
(
|
|
2334
|
-
...
|
|
2373
|
+
(u, { component: f, ...l }) => ({
|
|
2374
|
+
...u,
|
|
2335
2375
|
[l.name]: {
|
|
2336
2376
|
component: f,
|
|
2337
2377
|
...serializeComponentInfo(l)
|
|
@@ -2363,8 +2403,8 @@ function ContentComponent(e) {
|
|
|
2363
2403
|
...components,
|
|
2364
2404
|
...e.customComponents || []
|
|
2365
2405
|
].reduce(
|
|
2366
|
-
(
|
|
2367
|
-
...
|
|
2406
|
+
(u, { component: f, ...l }) => ({
|
|
2407
|
+
...u,
|
|
2368
2408
|
[l.name]: serializeComponentInfo(l)
|
|
2369
2409
|
}),
|
|
2370
2410
|
{}
|
|
@@ -2396,7 +2436,7 @@ function ContentComponent(e) {
|
|
|
2396
2436
|
{
|
|
2397
2437
|
contentId: (a = o.content) == null ? void 0 : a.id,
|
|
2398
2438
|
cssCode: (c = (s = o.content) == null ? void 0 : s.data) == null ? void 0 : c.cssCode,
|
|
2399
|
-
customFonts: (
|
|
2439
|
+
customFonts: (d = (m = o.content) == null ? void 0 : m.data) == null ? void 0 : d.customFonts
|
|
2400
2440
|
}
|
|
2401
2441
|
) }),
|
|
2402
2442
|
/* @__PURE__ */ jsx(
|
|
@@ -2419,9 +2459,9 @@ function ContentVariants(e) {
|
|
|
2419
2459
|
}), n = function() {
|
|
2420
2460
|
var c;
|
|
2421
2461
|
return getUpdateCookieAndStylesScript(
|
|
2422
|
-
getVariants(e.content).map((
|
|
2423
|
-
id:
|
|
2424
|
-
testRatio:
|
|
2462
|
+
getVariants(e.content).map((m) => ({
|
|
2463
|
+
id: m.testVariationId,
|
|
2464
|
+
testRatio: m.testRatio
|
|
2425
2465
|
})),
|
|
2426
2466
|
((c = e.content) == null ? void 0 : c.id) || ""
|
|
2427
2467
|
);
|
|
@@ -2516,14 +2556,14 @@ const fetchSymbolContent = async ({
|
|
|
2516
2556
|
});
|
|
2517
2557
|
};
|
|
2518
2558
|
async function Symbol$1(e) {
|
|
2519
|
-
var o, r, i, a;
|
|
2559
|
+
var o, r, i, a, s;
|
|
2520
2560
|
const t = function() {
|
|
2521
|
-
var
|
|
2561
|
+
var m, d;
|
|
2522
2562
|
return [
|
|
2523
2563
|
e.attributes.className,
|
|
2524
2564
|
"builder-symbol",
|
|
2525
|
-
(
|
|
2526
|
-
(
|
|
2565
|
+
(m = e.symbol) != null && m.inline ? "builder-inline-symbol" : void 0,
|
|
2566
|
+
(d = e.symbol) != null && d.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
2527
2567
|
].filter(Boolean).join(" ");
|
|
2528
2568
|
}, n = ((o = e.symbol) == null ? void 0 : o.content) || await fetchSymbolContent({
|
|
2529
2569
|
symbol: e.symbol,
|
|
@@ -2535,14 +2575,17 @@ async function Symbol$1(e) {
|
|
|
2535
2575
|
__isNestedRender: !0,
|
|
2536
2576
|
apiVersion: e.builderContext.apiVersion,
|
|
2537
2577
|
apiKey: e.builderContext.apiKey,
|
|
2538
|
-
context:
|
|
2578
|
+
context: {
|
|
2579
|
+
...e.builderContext.context,
|
|
2580
|
+
symbolId: (r = e.builderBlock) == null ? void 0 : r.id
|
|
2581
|
+
},
|
|
2539
2582
|
customComponents: Object.values(e.builderComponents),
|
|
2540
2583
|
data: {
|
|
2541
|
-
...(
|
|
2584
|
+
...(i = e.symbol) == null ? void 0 : i.data,
|
|
2542
2585
|
...e.builderContext.localState,
|
|
2543
|
-
...(
|
|
2586
|
+
...(a = n == null ? void 0 : n.data) == null ? void 0 : a.state
|
|
2544
2587
|
},
|
|
2545
|
-
model: (
|
|
2588
|
+
model: (s = e.symbol) == null ? void 0 : s.model,
|
|
2546
2589
|
content: n
|
|
2547
2590
|
}
|
|
2548
2591
|
) });
|