@builder.io/sdk-react-nextjs 0.14.25 → 0.14.27
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-1ddfeb58.cjs → USE_CLIENT_BUNDLE-2cf82d62.cjs} +5 -5
- package/lib/{node/USE_CLIENT_BUNDLE-ef4baa66.js → browser/USE_CLIENT_BUNDLE-6310e997.js} +36 -35
- package/lib/{edge/USE_SERVER_BUNDLE-78eb2f70.cjs → browser/USE_SERVER_BUNDLE-96b0d36a.cjs} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-f025d6d8.js → browser/USE_SERVER_BUNDLE-af025398.js} +1 -1
- package/lib/browser/bundle-301a174a.cjs +169 -0
- package/lib/browser/{bundle-761961a0.js → bundle-9a8df6bb.js} +311 -302
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +3 -3
- package/lib/{node/USE_CLIENT_BUNDLE-f7463aa3.cjs → edge/USE_CLIENT_BUNDLE-23fc72a9.cjs} +5 -5
- package/lib/{browser/USE_CLIENT_BUNDLE-8cd3386f.js → edge/USE_CLIENT_BUNDLE-890ac9eb.js} +36 -35
- package/lib/{node/USE_SERVER_BUNDLE-3c35d11e.js → edge/USE_SERVER_BUNDLE-317929d2.js} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-e5e233d2.cjs → edge/USE_SERVER_BUNDLE-73825717.cjs} +1 -1
- package/lib/edge/bundle-8d9ad243.cjs +189 -0
- package/lib/edge/{bundle-2dc98ad8.js → bundle-db39aa05.js} +843 -842
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +3 -3
- package/lib/{edge/USE_CLIENT_BUNDLE-e4abd45c.js → node/USE_CLIENT_BUNDLE-70674322.js} +36 -35
- package/lib/{edge/USE_CLIENT_BUNDLE-2ee56c62.cjs → node/USE_CLIENT_BUNDLE-f80aef0a.cjs} +5 -5
- package/lib/{browser/USE_SERVER_BUNDLE-457ff39c.js → node/USE_SERVER_BUNDLE-07526cde.js} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-7b480ad5.cjs → node/USE_SERVER_BUNDLE-07fef498.cjs} +1 -1
- package/lib/node/{bundle-90827143.js → bundle-ae4a53d3.js} +26 -17
- package/lib/node/{bundle-df5510f7.cjs → bundle-c7a93d74.cjs} +5 -5
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/package.json +1 -1
- package/types/cjs/blocks/image/image.types.d.ts +1 -0
- package/types/cjs/components/block/block.helpers.d.ts +20 -2
- package/types/cjs/components/block/components/block-wrapper.d.ts +0 -1
- package/types/cjs/components/content/components/enable-editor.d.ts +1 -1
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/context/types.d.ts +1 -0
- package/types/esm/blocks/image/image.types.d.ts +1 -0
- package/types/esm/components/block/block.helpers.d.ts +20 -2
- package/types/esm/components/block/components/block-wrapper.d.ts +0 -1
- package/types/esm/components/content/components/enable-editor.d.ts +1 -1
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/context/types.d.ts +1 -0
- package/lib/browser/bundle-9d1d2542.cjs +0 -169
- package/lib/edge/bundle-8f003cc6.cjs +0 -189
package/lib/edge/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./USE_CLIENT_BUNDLE-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./USE_CLIENT_BUNDLE-23fc72a9.cjs"),e=require("./bundle-8d9ad243.cjs");require("react/jsx-runtime");require("react");require("./USE_SERVER_BUNDLE-73825717.cjs");require("next/navigation");require("lru-cache");exports.BuilderContext=t.builderContext;exports.Button=t.Button;exports.Fragment=t.FragmentComponent;exports.Image=t.Image;exports.Section=t.SectionComponent;exports.Video=t.Video;exports.Blocks=e.Blocks;exports.Columns=e.Columns;exports.Content=e.ContentVariants;exports.Symbol=e.Symbol;exports.Text=e.Text;exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
|
package/lib/edge/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { f as n, c as m, F as c, d as p, S as g, V as d } from "./USE_CLIENT_BUNDLE-
|
|
2
|
-
import { B as l, C as f, x as B, S as C, T as E, G as S, u as x, F as h, H as b, v as y, A as F, c as P, j as T, y as k, z as v, E as R, D as V } from "./bundle-
|
|
1
|
+
import { f as n, c as m, F as c, d as p, S as g, V as d } from "./USE_CLIENT_BUNDLE-890ac9eb.js";
|
|
2
|
+
import { B as l, C as f, x as B, S as C, T as E, G as S, u as x, F as h, H as b, v as y, A as F, c as P, j as T, y as k, z as v, E as R, D as V } from "./bundle-db39aa05.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
|
-
import "./USE_SERVER_BUNDLE-
|
|
5
|
+
import "./USE_SERVER_BUNDLE-317929d2.js";
|
|
6
6
|
import "next/navigation";
|
|
7
7
|
import "lru-cache";
|
|
8
8
|
export {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as a, Fragment as w, jsxs as I } from "react/jsx-runtime";
|
|
3
|
-
import { i as Z, g as H, a as $, b as O, c as E, d as R, e as p, f as _, h as V, _ as D, j as ee, l as te, k as ne, m as ie, t as ae, n as U, o as ce, p as re, q as le, r as oe, s as de, u as se, v as ue } from "./bundle-
|
|
4
|
-
import { useRef as T, useState as C, useEffect as
|
|
5
|
-
import { p as ge } from "./USE_SERVER_BUNDLE-
|
|
6
|
-
import { useRouter as
|
|
3
|
+
import { i as Z, g as H, a as $, b as O, c as E, d as R, e as p, f as _, h as V, _ as D, j as ee, l as te, k as ne, m as ie, t as ae, n as U, o as ce, p as re, q as le, r as oe, s as de, u as se, v as ue } from "./bundle-ae4a53d3.js";
|
|
4
|
+
import { useRef as T, useState as C, useEffect as b, createContext as me } from "react";
|
|
5
|
+
import { p as ge } from "./USE_SERVER_BUNDLE-07526cde.js";
|
|
6
|
+
import { useRouter as fe } from "next/navigation";
|
|
7
7
|
function J(e) {
|
|
8
8
|
return /* @__PURE__ */ a(w, { children: Z(e.TagName) ? /* @__PURE__ */ a(w, { children: /* @__PURE__ */ a(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ a(w, { children: typeof e.TagName == "string" ? /* @__PURE__ */ a(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) : /* @__PURE__ */ a(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) });
|
|
9
9
|
}
|
|
@@ -127,7 +127,7 @@ function Ie(e) {
|
|
|
127
127
|
return /* @__PURE__ */ a("span", { children: e.children });
|
|
128
128
|
}
|
|
129
129
|
function Pe(e) {
|
|
130
|
-
var r, g, v, h,
|
|
130
|
+
var r, g, v, h, f, o;
|
|
131
131
|
function i() {
|
|
132
132
|
var x;
|
|
133
133
|
const d = e.image || e.src;
|
|
@@ -163,7 +163,8 @@ function Pe(e) {
|
|
|
163
163
|
/* @__PURE__ */ a(
|
|
164
164
|
"img",
|
|
165
165
|
{
|
|
166
|
-
loading: "lazy",
|
|
166
|
+
loading: e.highPriority ? "eager" : "lazy",
|
|
167
|
+
fetchPriority: e.highPriority ? "high" : "auto",
|
|
167
168
|
alt: e.altText,
|
|
168
169
|
role: e.altText ? void 0 : "presentation",
|
|
169
170
|
style: {
|
|
@@ -171,7 +172,7 @@ function Pe(e) {
|
|
|
171
172
|
objectFit: e.backgroundSize || "cover",
|
|
172
173
|
...S()
|
|
173
174
|
},
|
|
174
|
-
className: "builder-image" + (e.className ? " " + e.className : "") + " img-
|
|
175
|
+
className: "builder-image" + (e.className ? " " + e.className : "") + " img-ac3dff4a",
|
|
175
176
|
src: e.image,
|
|
176
177
|
srcSet: i(),
|
|
177
178
|
sizes: e.sizes
|
|
@@ -181,23 +182,23 @@ function Pe(e) {
|
|
|
181
182
|
e.aspectRatio && !((g = (r = e.builderBlock) == null ? void 0 : r.children) != null && g.length && e.fitContent) ? /* @__PURE__ */ a(
|
|
182
183
|
"div",
|
|
183
184
|
{
|
|
184
|
-
className: "builder-image-sizer div-
|
|
185
|
+
className: "builder-image-sizer div-ac3dff4a",
|
|
185
186
|
style: {
|
|
186
187
|
paddingTop: e.aspectRatio * 100 + "%"
|
|
187
188
|
}
|
|
188
189
|
}
|
|
189
190
|
) : null,
|
|
190
191
|
(h = (v = e.builderBlock) == null ? void 0 : v.children) != null && h.length && e.fitContent ? /* @__PURE__ */ a(w, { children: e.children }) : null,
|
|
191
|
-
!e.fitContent && ((o = (
|
|
192
|
+
!e.fitContent && ((o = (f = e.builderBlock) == null ? void 0 : f.children) != null && o.length) ? /* @__PURE__ */ a("div", { className: "div-ac3dff4a-2", children: e.children }) : null
|
|
192
193
|
] }),
|
|
193
|
-
/* @__PURE__ */ a("style", { children: `.img-
|
|
194
|
+
/* @__PURE__ */ a("style", { children: `.img-ac3dff4a {
|
|
194
195
|
opacity: 1;
|
|
195
196
|
transition: opacity 0.2s ease-in-out;
|
|
196
|
-
}.div-
|
|
197
|
+
}.div-ac3dff4a {
|
|
197
198
|
width: 100%;
|
|
198
199
|
pointer-events: none;
|
|
199
200
|
font-size: 0;
|
|
200
|
-
}.div-
|
|
201
|
+
}.div-ac3dff4a-2 {
|
|
201
202
|
display: flex;
|
|
202
203
|
flex-direction: column;
|
|
203
204
|
align-items: stretch;
|
|
@@ -232,13 +233,13 @@ function Re(e) {
|
|
|
232
233
|
}
|
|
233
234
|
function Te(e) {
|
|
234
235
|
const i = T(null), [s, S] = C(() => []), [r, g] = C(() => []);
|
|
235
|
-
return
|
|
236
|
+
return b(() => {
|
|
236
237
|
var h;
|
|
237
238
|
if (!((h = i.current) != null && h.getElementsByTagName) || typeof window > "u")
|
|
238
239
|
return;
|
|
239
240
|
const v = i.current.getElementsByTagName("script");
|
|
240
|
-
for (let
|
|
241
|
-
const o = v[
|
|
241
|
+
for (let f = 0; f < v.length; f++) {
|
|
242
|
+
const o = v[f];
|
|
242
243
|
if (o.src) {
|
|
243
244
|
if (s.includes(o.src))
|
|
244
245
|
continue;
|
|
@@ -270,7 +271,7 @@ function Te(e) {
|
|
|
270
271
|
}
|
|
271
272
|
function Ne(e) {
|
|
272
273
|
const i = T(null), [s, S] = C(() => []), [r, g] = C(() => []), [v, h] = C(() => !1);
|
|
273
|
-
function
|
|
274
|
+
function f() {
|
|
274
275
|
if (!i.current || !i.current.getElementsByTagName)
|
|
275
276
|
return;
|
|
276
277
|
const o = i.current.getElementsByTagName("script");
|
|
@@ -288,8 +289,8 @@ function Ne(e) {
|
|
|
288
289
|
}
|
|
289
290
|
}
|
|
290
291
|
}
|
|
291
|
-
return
|
|
292
|
-
i.current && !v && (h(!0),
|
|
292
|
+
return b(() => {
|
|
293
|
+
i.current && !v && (h(!0), f());
|
|
293
294
|
}, [i.current, v]), /* @__PURE__ */ a(
|
|
294
295
|
"div",
|
|
295
296
|
{
|
|
@@ -315,7 +316,7 @@ function Be(e) {
|
|
|
315
316
|
);
|
|
316
317
|
}
|
|
317
318
|
function Le(e) {
|
|
318
|
-
var S, r, g, v, h,
|
|
319
|
+
var S, r, g, v, h, f, o;
|
|
319
320
|
function i() {
|
|
320
321
|
return {
|
|
321
322
|
...e.autoPlay === !0 ? {
|
|
@@ -394,7 +395,7 @@ function Le(e) {
|
|
|
394
395
|
children: e.children
|
|
395
396
|
}
|
|
396
397
|
) : null,
|
|
397
|
-
(o = (
|
|
398
|
+
(o = (f = e.builderBlock) == null ? void 0 : f.children) != null && o.length && !e.fitContent ? /* @__PURE__ */ a(
|
|
398
399
|
"div",
|
|
399
400
|
{
|
|
400
401
|
style: {
|
|
@@ -494,7 +495,7 @@ function je(e) {
|
|
|
494
495
|
}
|
|
495
496
|
})(n);
|
|
496
497
|
}
|
|
497
|
-
function
|
|
498
|
+
function f() {
|
|
498
499
|
var t, l;
|
|
499
500
|
const n = (l = (t = e.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : l.jsCode;
|
|
500
501
|
n && U({
|
|
@@ -606,8 +607,8 @@ function je(e) {
|
|
|
606
607
|
y && S(y);
|
|
607
608
|
});
|
|
608
609
|
}
|
|
609
|
-
const X =
|
|
610
|
-
return
|
|
610
|
+
const X = fe();
|
|
611
|
+
return b(() => {
|
|
611
612
|
var n;
|
|
612
613
|
return (n = i.current) == null || n.addEventListener(
|
|
613
614
|
"initeditingbldr",
|
|
@@ -619,7 +620,7 @@ function je(e) {
|
|
|
619
620
|
L
|
|
620
621
|
);
|
|
621
622
|
};
|
|
622
|
-
}, []),
|
|
623
|
+
}, []), b(() => {
|
|
623
624
|
var n;
|
|
624
625
|
return (n = i.current) == null || n.addEventListener(
|
|
625
626
|
"initpreviewingbldr",
|
|
@@ -631,7 +632,7 @@ function je(e) {
|
|
|
631
632
|
j
|
|
632
633
|
);
|
|
633
634
|
};
|
|
634
|
-
}, []),
|
|
635
|
+
}, []), b(() => {
|
|
635
636
|
var n, t;
|
|
636
637
|
if (_()) {
|
|
637
638
|
if (E() && i.current && i.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && V(e.canTrack)) {
|
|
@@ -646,24 +647,24 @@ function je(e) {
|
|
|
646
647
|
}
|
|
647
648
|
ee() && E();
|
|
648
649
|
}
|
|
649
|
-
}, []),
|
|
650
|
+
}, []), b(() => {
|
|
650
651
|
e.apiKey || te.error(
|
|
651
652
|
"No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
652
|
-
),
|
|
653
|
-
}, []),
|
|
654
|
-
}, [e.content]),
|
|
655
|
-
|
|
656
|
-
}, [(K = (W = e.builderContextSignal.content) == null ? void 0 : W.data) == null ? void 0 : K.jsCode]),
|
|
653
|
+
), f(), B(), P();
|
|
654
|
+
}, []), b(() => {
|
|
655
|
+
}, [e.content]), b(() => {
|
|
656
|
+
f();
|
|
657
|
+
}, [(K = (W = e.builderContextSignal.content) == null ? void 0 : W.data) == null ? void 0 : K.jsCode]), b(() => {
|
|
657
658
|
B();
|
|
658
|
-
}, [(F = (A = e.builderContextSignal.content) == null ? void 0 : A.data) == null ? void 0 : F.httpRequests]),
|
|
659
|
+
}, [(F = (A = e.builderContextSignal.content) == null ? void 0 : A.data) == null ? void 0 : F.httpRequests]), b(() => {
|
|
659
660
|
P();
|
|
660
|
-
}, [e.builderContextSignal.rootState]),
|
|
661
|
+
}, [e.builderContextSignal.rootState]), b(() => {
|
|
661
662
|
e.data && s(e.data);
|
|
662
|
-
}, [e.data]),
|
|
663
|
+
}, [e.data]), b(() => {
|
|
663
664
|
e.locale && s({
|
|
664
665
|
locale: e.locale
|
|
665
666
|
});
|
|
666
|
-
}, [e.locale]),
|
|
667
|
+
}, [e.locale]), b(() => () => {
|
|
667
668
|
_() && (window.removeEventListener("message", h), window.removeEventListener(
|
|
668
669
|
"builder:component:stateChangeListenerActivated",
|
|
669
670
|
P
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use client";"use strict";const t=require("react/jsx-runtime"),n=require("./bundle-
|
|
1
|
+
"use client";"use strict";const t=require("react/jsx-runtime"),n=require("./bundle-c7a93d74.cjs"),l=require("react"),D=require("./USE_SERVER_BUNDLE-07fef498.cjs"),H=require("next/navigation");function j(e){return t.jsx(t.Fragment,{children:n.isEmptyElement(e.TagName)?t.jsx(t.Fragment,{children:t.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):t.jsx(t.Fragment,{children:typeof e.TagName=="string"?t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children}):t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})}function V(e){function c(){return{...e.attributes,[n.getClassPropName()]:`${e.link?"":"builder-button"} ${e.attributes[n.getClassPropName()]||""}`,...e.link?{href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"link"}:{role:"button"}}}return t.jsx(j,{attributes:c(),TagName:e.link?e.builderLinkComponent||"a":"button",actionAttributes:{},children:e.text})}function U(e){return t.jsx(j,{TagName:e.Wrapper,attributes:n.getBlockProperties({block:e.block,context:e.context}),actionAttributes:n.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})}function O(e){function c(){return e.includeBlockProps?{...n.getBlockProperties({block:e.block,context:e.context}),...n.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{}}return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:c(),children:e.children})}function $(e){function c(){var o;return"builder-blocks"+((o=e.blocks)!=null&&o.length?"":" no-blocks")}function g(){var o,h;n.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;n.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(e.BlocksWrapper,{className:c()+" props-blocks-wrapper-7cd1560e","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:o=>g(),onMouseEnter:o=>S(),onKeyPress:o=>g(),...e.BlocksWrapperProps,children:e.children}),t.jsx("style",{children:`.props-blocks-wrapper-7cd1560e {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
align-items: stretch;
|
|
5
|
-
}`})]})}function J(e){return t.jsx("span",{children:e.children})}function G(e){var o,
|
|
5
|
+
}`})]})}function J(e){return t.jsx("span",{children:e.children})}function G(e){var o,h,v,x,b,s;function c(){var y;const u=e.image||e.src;if(!u||!(u.match(/builder\.io/)||u.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((y=e.image)!=null&&y.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),n.getSrcSet(u)}else if(e.image&&!e.srcset)return n.getSrcSet(u);return n.getSrcSet(u)}function g(){var m;return(m=c==null?void 0:c())!=null&&m.match(/builder\.io/)&&!e.noWebp?c().replace(/\?/g,"?format=webp&"):""}function S(){const m={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?m:void 0}return t.jsxs(t.Fragment,{children:[t.jsxs(t.Fragment,{children:[t.jsxs("picture",{children:[g()?t.jsx("source",{type:"image/webp",srcSet:g()}):null,t.jsx("img",{loading:e.highPriority?"eager":"lazy",fetchPriority:e.highPriority?"high":"auto",alt:e.altText,role:e.altText?void 0:"presentation",style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...S()},className:"builder-image"+(e.className?" "+e.className:"")+" img-ac3dff4a",src:e.image,srcSet:c(),sizes:e.sizes})]}),e.aspectRatio&&!((h=(o=e.builderBlock)==null?void 0:o.children)!=null&&h.length&&e.fitContent)?t.jsx("div",{className:"builder-image-sizer div-ac3dff4a",style:{paddingTop:e.aspectRatio*100+"%"}}):null,(x=(v=e.builderBlock)==null?void 0:v.children)!=null&&x.length&&e.fitContent?t.jsx(t.Fragment,{children:e.children}):null,!e.fitContent&&((s=(b=e.builderBlock)==null?void 0:b.children)!=null&&s.length)?t.jsx("div",{className:"div-ac3dff4a-2",children:e.children}):null]}),t.jsx("style",{children:`.img-ac3dff4a {
|
|
6
6
|
opacity: 1;
|
|
7
7
|
transition: opacity 0.2s ease-in-out;
|
|
8
|
-
}.div-
|
|
8
|
+
}.div-ac3dff4a {
|
|
9
9
|
width: 100%;
|
|
10
10
|
pointer-events: none;
|
|
11
11
|
font-size: 0;
|
|
12
|
-
}.div-
|
|
12
|
+
}.div-ac3dff4a-2 {
|
|
13
13
|
display: flex;
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
align-items: stretch;
|
|
@@ -18,4 +18,4 @@
|
|
|
18
18
|
left: 0;
|
|
19
19
|
width: 100%;
|
|
20
20
|
height: 100%;
|
|
21
|
-
}`})]})}function Q(e){return t.jsx("section",{...e.attributes,style:{width:"100%",alignSelf:"stretch",flexGrow:1,boxSizing:"border-box",maxWidth:e.maxWidth||1200,display:"flex",flexDirection:"column",alignItems:"stretch",marginLeft:"auto",marginRight:"auto"},children:e.children})}function X(e){const c=l.useRef(null),[g,S]=l.useState(()=>[]),[o,
|
|
21
|
+
}`})]})}function Q(e){return t.jsx("section",{...e.attributes,style:{width:"100%",alignSelf:"stretch",flexGrow:1,boxSizing:"border-box",maxWidth:e.maxWidth||1200,display:"flex",flexDirection:"column",alignItems:"stretch",marginLeft:"auto",marginRight:"auto"},children:e.children})}function X(e){const c=l.useRef(null),[g,S]=l.useState(()=>[]),[o,h]=l.useState(()=>[]);return l.useEffect(()=>{var x;if(!((x=c.current)!=null&&x.getElementsByTagName)||typeof window>"u")return;const v=c.current.getElementsByTagName("script");for(let b=0;b<v.length;b++){const s=v[b];if(s.src){if(g.includes(s.src))continue;g.push(s.src);const m=document.createElement("script");m.async=!0,m.src=s.src,document.head.appendChild(m)}else if(!s.type||["text/javascript","application/javascript","application/ecmascript"].includes(s.type)){if(o.includes(s.innerText))continue;try{o.push(s.innerText),new Function(s.innerText)()}catch(m){console.warn("`CustomCode`: Error running script:",m)}}}},[]),t.jsx("div",{ref:c,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}function Y(e){const c=l.useRef(null),[g,S]=l.useState(()=>[]),[o,h]=l.useState(()=>[]),[v,x]=l.useState(()=>!1);function b(){if(!c.current||!c.current.getElementsByTagName)return;const s=c.current.getElementsByTagName("script");for(let m=0;m<s.length;m++){const u=s[m];if(u.src&&!g.includes(u.src)){g.push(u.src);const y=document.createElement("script");y.async=!0,y.src=u.src,document.head.appendChild(y)}else if(n.isJsScript(u)&&!o.includes(u.innerText))try{o.push(u.innerText),new Function(u.innerText)()}catch(y){console.warn("`Embed`: Error running script:",y)}}}return l.useEffect(()=>{c.current&&!v&&(x(!0),b())},[c.current,v]),t.jsx("div",{className:"builder-embed",ref:c,dangerouslySetInnerHTML:{__html:e.content}})}function Z(e){return t.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},n.isEditing()&&e.imgSrc||"default-key")}function p(e){var S,o,h,v,x,b,s;function c(){return{...e.autoPlay===!0?{autoPlay:!0}:{},...e.muted===!0?{muted:!0}:{},...e.controls===!0?{controls:!0}:{},...e.loop===!0?{loop:!0}:{},...e.playsInline===!0?{playsInline:!0}:{}}}function g(){return{...c()}}return t.jsxs("div",{style:{position:"relative"},children:[t.jsx("video",{className:"builder-video",...g(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(S=e.attributes)==null?void 0:S.style,objectFit:e.fit,objectPosition:e.position,zIndex:2,borderRadius:"1px",...e.aspectRatio?{position:"absolute"}:null},src:e.video||"no-src",poster:e.posterImage,children:e.lazyLoad?null:t.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((h=(o=e.builderBlock)==null?void 0:o.children)!=null&&h.length))?t.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}}):null,(x=(v=e.builderBlock)==null?void 0:v.children)!=null&&x.length&&e.fitContent?t.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children}):null,(s=(b=e.builderBlock)==null?void 0:b.children)!=null&&s.length&&!e.fitContent?t.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",alignItems:"stretch",position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},children:e.children}):null]})}const A=l.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{}});function ee(e){var T,B,N,L,F,W,q;const c=l.useRef(null);function g(a){var d,r;const i={...e.builderContextSignal.rootState,...a};e.builderContextSignal.rootSetState?(r=(d=e.builderContextSignal).rootSetState)==null||r.call(d,i):e.builderContextSignal.rootState=i}function S(a){var d,r,f,k,C;const i={...e.builderContextSignal.content,...a,data:{...(d=e.builderContextSignal.content)==null?void 0:d.data,...a==null?void 0:a.data},meta:{...(r=e.builderContextSignal.content)==null?void 0:r.meta,...a==null?void 0:a.meta,breakpoints:((f=a==null?void 0:a.meta)==null?void 0:f.breakpoints)||((C=(k=e.builderContextSignal.content)==null?void 0:k.meta)==null?void 0:C.breakpoints)}};D.postPreviewContent({value:i,key:i.id}).then(()=>{z.refresh()})}function o(){return e.showContent?{}:{hidden:!0,"aria-hidden":!0}}const[h,v]=l.useState(()=>e.contentWrapper||"div");function x(a){return n.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:i=>{var f;const{breakpoints:d,contentId:r}=i;!r||r!==((f=e.builderContextSignal.content)==null?void 0:f.id)||d&&S({meta:{breakpoints:d}})},animation:i=>{n.triggerAnimation(i)},contentUpdate:i=>{S(i)}}})(a)}function b(){var i,d;const a=(d=(i=e.builderContextSignal.content)==null?void 0:i.data)==null?void 0:d.jsCode;a&&n.evaluate({code:a,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!1})}const[s,m]=l.useState(()=>({})),[u,y]=l.useState(()=>({})),[I,K]=l.useState(()=>!1);function _(a){var i,d;if(e.builderContextSignal.content){const r=(i=e.builderContextSignal.content)==null?void 0:i.testVariationId,f=(d=e.builderContextSignal.content)==null?void 0:d.id;n._track({type:"click",canTrack:n.getDefaultCanTrack(e.canTrack),contentId:f,apiKey:e.apiKey,variationId:r!==f?r:void 0,...n.getInteractionPropertiesForEvent(a),unique:!I})}I||K(!0)}function w(){var i,d;const a=((d=(i=e.builderContextSignal.content)==null?void 0:i.data)==null?void 0:d.httpRequests)??{};Object.entries(a).forEach(([r,f])=>{if(!f||u[r]||s[r]&&!n.isEditing())return;u[r]=!0;const k=f.replace(/{{([^}]+)}}/g,(C,M)=>String(n.evaluate({code:M,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!0})));n.fetch(k).then(C=>C.json()).then(C=>{g({[r]:C}),s[r]=!0}).catch(C=>{console.error("error fetching dynamic data",f,C)}).finally(()=>{u[r]=!1})})}function E(){n.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:n.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function P(a){window.addEventListener("message",x),n.registerInsertMenu(),n.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(i=>{var r;const d=n.createRegisterComponentMessage(i);(r=window.parent)==null||r.postMessage(d,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",E)}function R(a){const i=new URL(location.href).searchParams,d=i.get("builder.preview"),r=i.get(`builder.overrides.${d}`),f=i.get("apiKey")||i.get("builder.space");d===e.model&&f===e.apiKey&&(!e.content||r===e.content.id)&&n.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(k=>{k&&S(k)})}const z=H.useRouter();return l.useEffect(()=>{var a;return(a=c.current)==null||a.addEventListener("initeditingbldr",P),()=>{var i;return(i=c.current)==null?void 0:i.removeEventListener("initeditingbldr",P)}},[]),l.useEffect(()=>{var a;return(a=c.current)==null||a.addEventListener("initpreviewingbldr",R),()=>{var i;return(i=c.current)==null?void 0:i.removeEventListener("initpreviewingbldr",R)}},[]),l.useEffect(()=>{var a,i;if(n.isBrowser()){if(n.isEditing()&&c.current&&c.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&n.getDefaultCanTrack(e.canTrack)){const r=(a=e.builderContextSignal.content)==null?void 0:a.testVariationId,f=(i=e.builderContextSignal.content)==null?void 0:i.id,k=e.apiKey;n._track({type:"impression",canTrack:!0,contentId:f,apiKey:k,variationId:r!==f?r:void 0})}n.isPreviewing()&&n.isEditing()}},[]),l.useEffect(()=>{e.apiKey||n.logger.error("No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."),b(),w(),E()},[]),l.useEffect(()=>{},[e.content]),l.useEffect(()=>{b()},[(B=(T=e.builderContextSignal.content)==null?void 0:T.data)==null?void 0:B.jsCode]),l.useEffect(()=>{w()},[(L=(N=e.builderContextSignal.content)==null?void 0:N.data)==null?void 0:L.httpRequests]),l.useEffect(()=>{E()},[e.builderContextSignal.rootState]),l.useEffect(()=>{e.data&&g(e.data)},[e.data]),l.useEffect(()=>{e.locale&&g({locale:e.locale})},[e.locale]),l.useEffect(()=>()=>{n.isBrowser()&&(window.removeEventListener("message",x),window.removeEventListener("builder:component:stateChangeListenerActivated",E))},[]),t.jsx(A.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?t.jsx(h,{ref:c,onClick:a=>_(a),"builder-content-id":(F=e.builderContextSignal.content)==null?void 0:F.id,"builder-model":e.model,...o(),...e.contentWrapperProps,className:n.getWrapperClassName(((W=e.content)==null?void 0:W.testVariationId)||((q=e.content)==null?void 0:q.id)),children:e.children}):null})}exports.BlockWrapper=U;exports.BlocksWrapper=$;exports.Button=V;exports.CustomCode=X;exports.DynamicRenderer=j;exports.Embed=Y;exports.EnableEditor=ee;exports.FragmentComponent=J;exports.Image=G;exports.ImgComponent=Z;exports.InteractiveElement=O;exports.SectionComponent=Q;exports.Video=p;exports.builderContext=A;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use server";"use strict";const n=require("./bundle-
|
|
1
|
+
"use server";"use strict";const n=require("./bundle-c7a93d74.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 { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import { LRUCache } from "lru-cache";
|
|
4
|
-
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-
|
|
4
|
+
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-70674322.js";
|
|
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 = () => {
|
|
7
7
|
switch (TARGET) {
|
|
@@ -21,11 +21,7 @@ function getBlockComponentOptions(e) {
|
|
|
21
21
|
var t;
|
|
22
22
|
return {
|
|
23
23
|
...(t = e.component) == null ? void 0 : t.options,
|
|
24
|
-
...e.options
|
|
25
|
-
/**
|
|
26
|
-
* Our built-in components frequently make use of the block, so we provide all of it under `builderBlock`
|
|
27
|
-
*/
|
|
28
|
-
builderBlock: e
|
|
24
|
+
...e.options
|
|
29
25
|
};
|
|
30
26
|
}
|
|
31
27
|
const MSG_PREFIX = "[Builder.io]: ", logger = {
|
|
@@ -495,7 +491,15 @@ const getComponent = ({
|
|
|
495
491
|
},
|
|
496
492
|
block: o
|
|
497
493
|
}));
|
|
498
|
-
},
|
|
494
|
+
}, provideLinkComponent = (e, t) => e && (e.isRSC && TARGET === "rsc" || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(e.name)) ? {
|
|
495
|
+
builderLinkComponent: t
|
|
496
|
+
} : {}, provideRegisteredComponents = (e, t) => e && (e.isRSC && TARGET === "rsc" || ["Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(e.name)) ? {
|
|
497
|
+
builderComponents: t
|
|
498
|
+
} : {}, provideBuilderBlock = (e, t) => e && (e.isRSC && TARGET === "rsc" || TARGET === "reactNative" || ["Builder:Accordion", "Columns", "Form:Form", "Builder: Tabs", "Symbol", "Image", "Video"].includes(e.name)) ? {
|
|
499
|
+
builderBlock: t
|
|
500
|
+
} : {}, provideBuilderContext = (e, t) => e && (e.isRSC && TARGET === "rsc" || ["Builder:Accordion", "Columns", "Form:Form", "Builder: Tabs", "Symbol", "Slot"].includes(e.name)) ? {
|
|
501
|
+
builderContext: t
|
|
502
|
+
} : {}, SIZES = {
|
|
499
503
|
small: {
|
|
500
504
|
min: 320,
|
|
501
505
|
default: 321,
|
|
@@ -788,13 +792,13 @@ function Block(e) {
|
|
|
788
792
|
componentRef: (u = t()) == null ? void 0 : u.component,
|
|
789
793
|
componentOptions: {
|
|
790
794
|
...getBlockComponentOptions(o()),
|
|
791
|
-
|
|
792
|
-
...
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
795
|
+
...provideBuilderBlock(t(), o()),
|
|
796
|
+
...provideBuilderContext(t(), e.context),
|
|
797
|
+
...provideLinkComponent(t(), e.linkComponent),
|
|
798
|
+
...provideRegisteredComponents(
|
|
799
|
+
t(),
|
|
800
|
+
e.registeredComponents
|
|
801
|
+
)
|
|
798
802
|
},
|
|
799
803
|
context: e.context,
|
|
800
804
|
linkComponent: e.linkComponent,
|
|
@@ -834,7 +838,6 @@ function Block(e) {
|
|
|
834
838
|
Wrapper: r(),
|
|
835
839
|
block: o(),
|
|
836
840
|
context: e.context,
|
|
837
|
-
linkComponent: e.linkComponent,
|
|
838
841
|
children: [
|
|
839
842
|
/* @__PURE__ */ jsx(
|
|
840
843
|
ComponentRef,
|
|
@@ -1523,6 +1526,11 @@ const getTopLevelDomain = (e) => {
|
|
|
1523
1526
|
type: "boolean",
|
|
1524
1527
|
helperText: "When child blocks are provided, fit to them instead of using the image's aspect ratio",
|
|
1525
1528
|
defaultValue: !0
|
|
1529
|
+
}, {
|
|
1530
|
+
name: "highPriority",
|
|
1531
|
+
type: "boolean",
|
|
1532
|
+
advanced: !0,
|
|
1533
|
+
helperText: "Mark this image as high priority compared to other images on the page. This prevents lazy loading of the image and tells the browser to load this image before others on the page."
|
|
1526
1534
|
}, {
|
|
1527
1535
|
name: "aspectRatio",
|
|
1528
1536
|
type: "number",
|
|
@@ -2328,7 +2336,7 @@ function isFromTrustedHost(e, t) {
|
|
|
2328
2336
|
const n = new URL(t.origin), o = n.hostname;
|
|
2329
2337
|
return (e || DEFAULT_TRUSTED_HOSTS).findIndex((r) => r.startsWith("*.") ? o.endsWith(r.slice(1)) : r === o) > -1;
|
|
2330
2338
|
}
|
|
2331
|
-
const SDK_VERSION = "0.14.
|
|
2339
|
+
const SDK_VERSION = "0.14.27", registry = {};
|
|
2332
2340
|
function register(e, t) {
|
|
2333
2341
|
let n = registry[e];
|
|
2334
2342
|
if (n || (n = registry[e] = []), n.push(t), isBrowser()) {
|
|
@@ -2642,6 +2650,7 @@ function ContentComponent(e) {
|
|
|
2642
2650
|
}),
|
|
2643
2651
|
rootSetState: void 0,
|
|
2644
2652
|
context: e.context || {},
|
|
2653
|
+
canTrack: e.canTrack,
|
|
2645
2654
|
apiKey: e.apiKey,
|
|
2646
2655
|
apiVersion: e.apiVersion,
|
|
2647
2656
|
componentInfos: [
|
|
@@ -2673,7 +2682,6 @@ function ContentComponent(e) {
|
|
|
2673
2682
|
builderContextSignal: o,
|
|
2674
2683
|
contentWrapper: e.contentWrapper,
|
|
2675
2684
|
contentWrapperProps: e.contentWrapperProps,
|
|
2676
|
-
linkComponent: e.linkComponent,
|
|
2677
2685
|
trustedHosts: e.trustedHosts,
|
|
2678
2686
|
children: [
|
|
2679
2687
|
e.isSsrAbTest ? /* @__PURE__ */ jsx(
|
|
@@ -2859,6 +2867,7 @@ async function Symbol$1(e) {
|
|
|
2859
2867
|
...e.builderContext.localState,
|
|
2860
2868
|
...(c = r == null ? void 0 : r.data) == null ? void 0 : c.state
|
|
2861
2869
|
},
|
|
2870
|
+
canTrack: e.builderContext.canTrack,
|
|
2862
2871
|
model: (d = e.symbol) == null ? void 0 : d.model,
|
|
2863
2872
|
content: r,
|
|
2864
2873
|
linkComponent: e.builderLinkComponent,
|