@builder.io/sdk-react-nextjs 0.13.3 → 0.14.0
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-04cd188b.js → USE_CLIENT_BUNDLE-3ca5290b.js} +2 -5
- package/lib/{node/USE_CLIENT_BUNDLE-85cf7e92.cjs → browser/USE_CLIENT_BUNDLE-ae2cf58a.cjs} +2 -2
- package/lib/{edge/USE_SERVER_BUNDLE-c05264ac.cjs → browser/USE_SERVER_BUNDLE-44bff58a.cjs} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-1f2bfec0.js → browser/USE_SERVER_BUNDLE-87bb4fc8.js} +1 -1
- package/lib/browser/bundle-0f8e9b11.cjs +168 -0
- package/lib/browser/{bundle-16af19fc.js → bundle-4016f64d.js} +490 -515
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +26 -30
- package/lib/{browser/USE_CLIENT_BUNDLE-dcad73d0.cjs → edge/USE_CLIENT_BUNDLE-e243b06f.cjs} +2 -2
- package/lib/{node/USE_CLIENT_BUNDLE-d1e6dcd3.js → edge/USE_CLIENT_BUNDLE-eea569d0.js} +2 -5
- package/lib/{node/USE_SERVER_BUNDLE-1aafe1f0.cjs → edge/USE_SERVER_BUNDLE-0b2f4389.cjs} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-601fafbe.js → edge/USE_SERVER_BUNDLE-4db772c9.js} +1 -1
- package/lib/edge/{bundle-32e28c53.js → bundle-30e52741.js} +1064 -1089
- package/lib/edge/bundle-972c668c.cjs +188 -0
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +26 -30
- package/lib/{edge/USE_CLIENT_BUNDLE-403b6348.cjs → node/USE_CLIENT_BUNDLE-293178d5.cjs} +2 -2
- package/lib/{edge/USE_CLIENT_BUNDLE-5b75ae27.js → node/USE_CLIENT_BUNDLE-3a1f710c.js} +2 -5
- package/lib/{browser/USE_SERVER_BUNDLE-498895bc.js → node/USE_SERVER_BUNDLE-86b87f1d.js} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-f6de6931.cjs → node/USE_SERVER_BUNDLE-e487f694.cjs} +1 -1
- package/lib/node/{bundle-42fea3bc.js → bundle-3d5a7e60.js} +107 -132
- package/lib/node/{bundle-3f825965.cjs → bundle-b908270e.cjs} +7 -7
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +26 -30
- package/package.json +1 -1
- package/types/cjs/components/content-variants/content-variants.types.d.ts +0 -2
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/functions/get-content/index.d.ts +0 -10
- package/types/cjs/functions/get-content/types.d.ts +0 -11
- package/types/cjs/functions/register-component.d.ts +0 -9
- package/types/cjs/index-helpers/blocks-exports.d.ts +0 -8
- package/types/cjs/server-index.d.ts +1 -1
- package/types/esm/components/content-variants/content-variants.types.d.ts +0 -2
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/functions/get-content/index.d.ts +0 -10
- package/types/esm/functions/get-content/types.d.ts +0 -11
- package/types/esm/functions/register-component.d.ts +0 -9
- package/types/esm/index-helpers/blocks-exports.d.ts +0 -8
- package/types/esm/server-index.d.ts +1 -1
- package/lib/browser/bundle-09521c43.cjs +0 -168
- package/lib/edge/bundle-10fb1352.cjs +0 -188
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";"use strict";const t=require("react/jsx-runtime"),a=require("./bundle-
|
|
1
|
+
"use client";"use strict";const t=require("react/jsx-runtime"),a=require("./bundle-b908270e.cjs"),r=require("react"),D=require("./USE_SERVER_BUNDLE-e487f694.cjs"),V=require("next/navigation");function C(e){return t.jsx(t.Fragment,{children:a.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(t.Fragment,{children:t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})}):t.jsx(t.Fragment,{children:t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})})}function H(e){return t.jsx(C,{TagName:e.link?e.builderLinkComponent||"a":"button",attributes:{...e.attributes,[a.getClassPropName()]:`${e.link?"":"builder-button"} ${e.attributes[a.getClassPropName()]||""}`,...e.link?{href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"link"}:{role:"button"}},actionAttributes:{},children:e.text})}function U(e){return t.jsx(C,{TagName:e.Wrapper,attributes:a.getBlockProperties({block:e.block,context:e.context}),actionAttributes:a.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 $(e){return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:e.includeBlockProps?{...a.getBlockProperties({block:e.block,context:e.context}),...a.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 l(){var o;return"builder-blocks"+((o=e.blocks)!=null&&o.length?"":" no-blocks")}function g(){var o,m;a.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((m=window.parent)==null||m.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function x(){var o,m;a.isEditing()&&!((o=e.blocks)!=null&&o.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:l()+" props-blocks-wrapper-7354e098","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:o=>g(),onMouseEnter:o=>x(),onKeyPress:o=>g(),...e.BlocksWrapperProps,children:e.children}),t.jsx("style",{children:`.props-blocks-wrapper-7354e098 {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
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 l=r.useRef(null),[g,x]=r.useState(()=>[]),[o,m]=r.useState(()=>[]);return r.useEffect(()=>{var v;if(!((v=l.current)!=null&&v.getElementsByTagName)||typeof window>"u")return;const h=l.current.getElementsByTagName("script");for(let b=0;b<h.length;b++){const s=h[b];if(s.src){if(g.includes(s.src))continue;g.push(s.src);const f=document.createElement("script");f.async=!0,f.src=s.src,document.head.appendChild(f)}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(f){console.warn("`CustomCode`: Error running script:",f)}}}},[]),t.jsx("div",{ref:l,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}function Y(e){const l=r.useRef(null),[g,x]=r.useState(()=>[]),[o,m]=r.useState(()=>[]),[h,v]=r.useState(()=>!1);function b(){if(!l.current||!l.current.getElementsByTagName)return;const s=l.current.getElementsByTagName("script");for(let f=0;f<s.length;f++){const k=s[f];if(k.src&&!g.includes(k.src)){g.push(k.src);const y=document.createElement("script");y.async=!0,y.src=k.src,document.head.appendChild(y)}else if(a.isJsScript(k)&&!o.includes(k.innerText))try{o.push(k.innerText),new Function(k.innerText)()}catch(y){console.warn("`Embed`: Error running script:",y)}}}return r.useEffect(()=>{l.current&&!h&&(v(!0),b())},[l.current,h]),t.jsx("div",{className:"builder-embed",ref:l,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},a.isEditing()&&e.imgSrc||"default-key")}function p(e){var x,o,m,h,v,b,s;function l(){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{...l()}}return t.jsxs("div",{style:{position:"relative"},children:[t.jsx("video",{className:"builder-video",...g(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(x=e.attributes)==null?void 0:x.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&&((m=(o=e.builderBlock)==null?void 0:o.children)!=null&&m.length))?t.jsx(t.Fragment,{children:t.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}})}):null,(v=(h=e.builderBlock)==null?void 0:h.children)!=null&&v.length&&e.fitContent?t.jsx(t.Fragment,{children: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(t.Fragment,{children: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 ee=r.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{}});function te(e){var P,T,B,N,F,L,W;const l=r.useRef(null),[g,x]=r.useState(()=>0);r.useState(()=>!0);function o(i){var c,d;const n={...e.builderContextSignal.rootState,...i};e.builderContextSignal.rootSetState?(d=(c=e.builderContextSignal).rootSetState)==null||d.call(c,n):e.builderContextSignal.rootState=n}function m(i){var c,d,u,S,A;const n={...e.builderContextSignal.content,...i,data:{...(c=e.builderContextSignal.content)==null?void 0:c.data,...i==null?void 0:i.data},meta:{...(d=e.builderContextSignal.content)==null?void 0:d.meta,...i==null?void 0:i.meta,breakpoints:((u=i==null?void 0:i.meta)==null?void 0:u.breakpoints)||((A=(S=e.builderContextSignal.content)==null?void 0:S.meta)==null?void 0:A.breakpoints)}};D.postPreviewContent({value:n,key:n.id}).then(()=>{M.refresh()})}r.useState(()=>0);const[h,v]=r.useState(()=>!1),[b,s]=r.useState(()=>e.contentWrapper||"div");function f(i){return a.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:n=>{var u;const{breakpoints:c,contentId:d}=n;!d||d!==((u=e.builderContextSignal.content)==null?void 0:u.id)||c&&(m({meta:{breakpoints:c}}),x(g+1))},animation:n=>{a.triggerAnimation(n)},contentUpdate:n=>{m(n),x(g+1)}}})(i)}function k(){var n,c;const i=(c=(n=e.builderContextSignal.content)==null?void 0:n.data)==null?void 0:c.jsCode;i&&a.evaluate({code:i,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})}const[y,ne]=r.useState(()=>({})),[j,K]=r.useState(()=>!1);function q(i){var n,c;if(e.builderContextSignal.content){const d=(n=e.builderContextSignal.content)==null?void 0:n.testVariationId,u=(c=e.builderContextSignal.content)==null?void 0:c.id;a._track({type:"click",canTrack:a.getDefaultCanTrack(e.canTrack),contentId:u,apiKey:e.apiKey,variationId:d!==u?d:void 0,...a.getInteractionPropertiesForEvent(i),unique:!j})}j||K(!0)}function _(i){return i.replace(/{{([^}]+)}}/g,(n,c)=>a.evaluate({code:c,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState}))}function z({url:i,key:n}){a.fetch(i).then(c=>c.json()).then(c=>{var u,S;const d={...e.builderContextSignal.rootState,[n]:c};(S=(u=e.builderContextSignal).rootSetState)==null||S.call(u,d),y[n]=!0}).catch(c=>{console.error("error fetching dynamic data",i,c)})}function w(){var n,c;const i=((c=(n=e.builderContextSignal.content)==null?void 0:n.data)==null?void 0:c.httpRequests)??{};Object.entries(i).forEach(([d,u])=>{if(u&&(!y[d]||a.isEditing())){const S=_(u);z({url:S,key:d})}})}function E(){a.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:a.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function R(i){x(g+1),window.addEventListener("message",f),a.registerInsertMenu(),a.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.
|
|
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 l=r.useRef(null),[g,x]=r.useState(()=>[]),[o,m]=r.useState(()=>[]);return r.useEffect(()=>{var v;if(!((v=l.current)!=null&&v.getElementsByTagName)||typeof window>"u")return;const h=l.current.getElementsByTagName("script");for(let b=0;b<h.length;b++){const s=h[b];if(s.src){if(g.includes(s.src))continue;g.push(s.src);const f=document.createElement("script");f.async=!0,f.src=s.src,document.head.appendChild(f)}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(f){console.warn("`CustomCode`: Error running script:",f)}}}},[]),t.jsx("div",{ref:l,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}function Y(e){const l=r.useRef(null),[g,x]=r.useState(()=>[]),[o,m]=r.useState(()=>[]),[h,v]=r.useState(()=>!1);function b(){if(!l.current||!l.current.getElementsByTagName)return;const s=l.current.getElementsByTagName("script");for(let f=0;f<s.length;f++){const k=s[f];if(k.src&&!g.includes(k.src)){g.push(k.src);const y=document.createElement("script");y.async=!0,y.src=k.src,document.head.appendChild(y)}else if(a.isJsScript(k)&&!o.includes(k.innerText))try{o.push(k.innerText),new Function(k.innerText)()}catch(y){console.warn("`Embed`: Error running script:",y)}}}return r.useEffect(()=>{l.current&&!h&&(v(!0),b())},[l.current,h]),t.jsx("div",{className:"builder-embed",ref:l,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},a.isEditing()&&e.imgSrc||"default-key")}function p(e){var x,o,m,h,v,b,s;function l(){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{...l()}}return t.jsxs("div",{style:{position:"relative"},children:[t.jsx("video",{className:"builder-video",...g(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(x=e.attributes)==null?void 0:x.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&&((m=(o=e.builderBlock)==null?void 0:o.children)!=null&&m.length))?t.jsx(t.Fragment,{children:t.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}})}):null,(v=(h=e.builderBlock)==null?void 0:h.children)!=null&&v.length&&e.fitContent?t.jsx(t.Fragment,{children: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(t.Fragment,{children: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 ee=r.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{}});function te(e){var P,T,B,N,F,L,W;const l=r.useRef(null),[g,x]=r.useState(()=>0);r.useState(()=>!0);function o(i){var c,d;const n={...e.builderContextSignal.rootState,...i};e.builderContextSignal.rootSetState?(d=(c=e.builderContextSignal).rootSetState)==null||d.call(c,n):e.builderContextSignal.rootState=n}function m(i){var c,d,u,S,A;const n={...e.builderContextSignal.content,...i,data:{...(c=e.builderContextSignal.content)==null?void 0:c.data,...i==null?void 0:i.data},meta:{...(d=e.builderContextSignal.content)==null?void 0:d.meta,...i==null?void 0:i.meta,breakpoints:((u=i==null?void 0:i.meta)==null?void 0:u.breakpoints)||((A=(S=e.builderContextSignal.content)==null?void 0:S.meta)==null?void 0:A.breakpoints)}};D.postPreviewContent({value:n,key:n.id}).then(()=>{M.refresh()})}r.useState(()=>0);const[h,v]=r.useState(()=>!1),[b,s]=r.useState(()=>e.contentWrapper||"div");function f(i){return a.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:n=>{var u;const{breakpoints:c,contentId:d}=n;!d||d!==((u=e.builderContextSignal.content)==null?void 0:u.id)||c&&(m({meta:{breakpoints:c}}),x(g+1))},animation:n=>{a.triggerAnimation(n)},contentUpdate:n=>{m(n),x(g+1)}}})(i)}function k(){var n,c;const i=(c=(n=e.builderContextSignal.content)==null?void 0:n.data)==null?void 0:c.jsCode;i&&a.evaluate({code:i,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})}const[y,ne]=r.useState(()=>({})),[j,K]=r.useState(()=>!1);function q(i){var n,c;if(e.builderContextSignal.content){const d=(n=e.builderContextSignal.content)==null?void 0:n.testVariationId,u=(c=e.builderContextSignal.content)==null?void 0:c.id;a._track({type:"click",canTrack:a.getDefaultCanTrack(e.canTrack),contentId:u,apiKey:e.apiKey,variationId:d!==u?d:void 0,...a.getInteractionPropertiesForEvent(i),unique:!j})}j||K(!0)}function _(i){return i.replace(/{{([^}]+)}}/g,(n,c)=>a.evaluate({code:c,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState}))}function z({url:i,key:n}){a.fetch(i).then(c=>c.json()).then(c=>{var u,S;const d={...e.builderContextSignal.rootState,[n]:c};(S=(u=e.builderContextSignal).rootSetState)==null||S.call(u,d),y[n]=!0}).catch(c=>{console.error("error fetching dynamic data",i,c)})}function w(){var n,c;const i=((c=(n=e.builderContextSignal.content)==null?void 0:n.data)==null?void 0:c.httpRequests)??{};Object.entries(i).forEach(([d,u])=>{if(u&&(!y[d]||a.isEditing())){const S=_(u);z({url:S,key:d})}})}function E(){a.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:a.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function R(i){x(g+1),window.addEventListener("message",f),a.registerInsertMenu(),a.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(n=>{var d;const c=a.createRegisterComponentMessage(n);(d=window.parent)==null||d.postMessage(c,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",E)}function I(i){const n=new URL(location.href).searchParams,c=n.get("builder.preview"),d=n.get(`builder.preview.${c}`),u=n.get("apiKey")||n.get("builder.space");c===e.model&&u===e.apiKey&&(!e.content||d===e.content.id)&&a.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(S=>{S&&m(S)})}const M=V.useRouter();return r.useEffect(()=>{var i;return(i=l.current)==null||i.addEventListener("initeditingbldr",R),()=>{var n;return(n=l.current)==null?void 0:n.removeEventListener("initeditingbldr",R)}},[]),r.useEffect(()=>{var i;return(i=l.current)==null||i.addEventListener("initpreviewingbldr",I),()=>{var n;return(n=l.current)==null?void 0:n.removeEventListener("initpreviewingbldr",I)}},[]),r.useEffect(()=>{var i,n;if(a.isBrowser()){if(a.isEditing()&&l.current&&l.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&a.getDefaultCanTrack(e.canTrack)){const d=(i=e.builderContextSignal.content)==null?void 0:i.testVariationId,u=(n=e.builderContextSignal.content)==null?void 0:n.id,S=e.apiKey;a._track({type:"impression",canTrack:!0,contentId:u,apiKey:S,variationId:d!==u?d:void 0})}a.isPreviewing()&&l.current}},[]),r.useEffect(()=>{e.apiKey||a.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),k(),w(),E()},[]),r.useEffect(()=>{},[e.content]),r.useEffect(()=>{a.isBrowser()&&(window.removeEventListener("message",f),window.addEventListener("message",f))},[h]),r.useEffect(()=>{k()},[(T=(P=e.builderContextSignal.content)==null?void 0:P.data)==null?void 0:T.jsCode]),r.useEffect(()=>{w()},[(N=(B=e.builderContextSignal.content)==null?void 0:B.data)==null?void 0:N.httpRequests]),r.useEffect(()=>{E()},[e.builderContextSignal.rootState]),r.useEffect(()=>{e.data&&o(e.data)},[e.data]),r.useEffect(()=>{e.locale&&o({locale:e.locale})},[e.locale]),r.useEffect(()=>()=>{a.isBrowser()&&(window.removeEventListener("message",f),window.removeEventListener("builder:component:stateChangeListenerActivated",E))},[]),t.jsx(ee.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?t.jsx(t.Fragment,{children:r.createElement(b,{key:g,ref:l,onClick:i=>q(i),"builder-content-id":(F=e.builderContextSignal.content)==null?void 0:F.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},...e.contentWrapperProps,className:`variant-${((L=e.content)==null?void 0:L.testVariationId)||((W=e.content)==null?void 0:W.id)}`},e.children)}):null})}exports.BlockWrapper=U;exports.BlocksWrapper=O;exports.Button=H;exports.CustomCode=X;exports.DynamicRenderer=C;exports.Embed=Y;exports.EnableEditor=te;exports.FragmentComponent=J;exports.Image=G;exports.ImgComponent=Z;exports.InteractiveElement=$;exports.SectionComponent=Q;exports.Video=p;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as i, Fragment as h, jsxs as E } from "react/jsx-runtime";
|
|
3
|
-
import { i as p, g as H, a as $, b as O, c as w, d as R, e as ee, f as P, h as V, _ as D, j as te, l as ne, k as ie, t as ae, m as U, n as ce, o as re, r as le, s as oe, p as de, q as se, u as ue } from "./bundle-
|
|
3
|
+
import { i as p, g as H, a as $, b as O, c as w, d as R, e as ee, f as P, h as V, _ as D, j as te, l as ne, k as ie, t as ae, m as U, n as ce, o as re, r as le, s as oe, p as de, q as se, u as ue } from "./bundle-3d5a7e60.js";
|
|
4
4
|
import { useRef as T, useState as x, useEffect as b, createContext as me, createElement as ge } from "react";
|
|
5
|
-
import { p as he } from "./USE_SERVER_BUNDLE-
|
|
5
|
+
import { p as he } from "./USE_SERVER_BUNDLE-86b87f1d.js";
|
|
6
6
|
import { useRouter as be } from "next/navigation";
|
|
7
7
|
function J(e) {
|
|
8
8
|
return /* @__PURE__ */ i(h, { children: p(e.TagName) ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ i(h, { children: typeof e.TagName == "string" ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) : /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) }) });
|
|
@@ -578,9 +578,6 @@ function Ke(e) {
|
|
|
578
578
|
...e.locale ? {
|
|
579
579
|
locale: e.locale
|
|
580
580
|
} : {},
|
|
581
|
-
...e.includeRefs ? {
|
|
582
|
-
includeRefs: e.includeRefs
|
|
583
|
-
} : {},
|
|
584
581
|
...e.enrich ? {
|
|
585
582
|
enrich: e.enrich
|
|
586
583
|
} : {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use server";"use strict";const n=require("./bundle-
|
|
1
|
+
"use server";"use strict";const n=require("./bundle-b908270e.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
|
-
import { LRUCache } from "lru-cache";
|
|
2
1
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { I as InteractiveElement, B as BlockWrapper, a as BlocksWrapper, D as DynamicRenderer, C as CustomCode, E as Embed, b as ImgComponent, V as Video, c as Button, F as FragmentComponent, d as Image, S as SectionComponent, e as EnableEditor } from "./USE_CLIENT_BUNDLE-d1e6dcd3.js";
|
|
4
2
|
import "react";
|
|
3
|
+
import { I as InteractiveElement, B as BlockWrapper, a as BlocksWrapper, D as DynamicRenderer, C as CustomCode, E as Embed, b as ImgComponent, V as Video, c as Button, F as FragmentComponent, d as Image, S as SectionComponent, e as EnableEditor } from "./USE_CLIENT_BUNDLE-3a1f710c.js";
|
|
4
|
+
import { LRUCache } from "lru-cache";
|
|
5
5
|
import "next/navigation";
|
|
6
6
|
const EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), isEmptyElement = (e) => typeof e == "string" && EMPTY_HTML_ELEMENTS.has(e.toLowerCase()), TARGET = "rsc", getClassPropName = () => {
|
|
7
7
|
switch (TARGET) {
|
|
@@ -216,10 +216,10 @@ output;
|
|
|
216
216
|
context: n,
|
|
217
217
|
event: o,
|
|
218
218
|
state: s
|
|
219
|
-
}), m = getIsolateContext(),
|
|
220
|
-
|
|
219
|
+
}), m = getIsolateContext(), g = m.global;
|
|
220
|
+
g.setSync("global", g.derefInto()), g.setSync("log", function(...d) {
|
|
221
221
|
console.log(...d);
|
|
222
|
-
}),
|
|
222
|
+
}), g.setSync(BUILDER_SET_STATE_NAME, function(d, l) {
|
|
223
223
|
set(a, d, l), i == null || i(a);
|
|
224
224
|
}), c.forEach(([d, l]) => {
|
|
225
225
|
const u = typeof l == "object" ? new ivm.Reference(
|
|
@@ -229,16 +229,16 @@ output;
|
|
|
229
229
|
getUserAttributes: () => l.getUserAttributes()
|
|
230
230
|
} : l
|
|
231
231
|
) : null;
|
|
232
|
-
|
|
233
|
-
}),
|
|
232
|
+
g.setSync(getSyncValName(d), u);
|
|
233
|
+
}), g.setSync(INJECTED_IVM_GLOBAL, ivm);
|
|
234
234
|
const p = processCode({
|
|
235
235
|
code: e,
|
|
236
236
|
args: c
|
|
237
|
-
}),
|
|
237
|
+
}), f = m.evalSync(p);
|
|
238
238
|
try {
|
|
239
|
-
return JSON.parse(
|
|
239
|
+
return JSON.parse(f);
|
|
240
240
|
} catch {
|
|
241
|
-
return
|
|
241
|
+
return f;
|
|
242
242
|
}
|
|
243
243
|
}, checkIsDefined = (e) => e != null;
|
|
244
244
|
function isNodeRuntime() {
|
|
@@ -473,10 +473,10 @@ function BlockStyles(e) {
|
|
|
473
473
|
shouldEvaluateBindings: !0
|
|
474
474
|
}), i = r.responsiveStyles, a = e.context.content, s = getSizesForBreakpoints(
|
|
475
475
|
((u = a == null ? void 0 : a.meta) == null ? void 0 : u.breakpoints) || {}
|
|
476
|
-
), c = i == null ? void 0 : i.large, m = i == null ? void 0 : i.medium,
|
|
476
|
+
), c = i == null ? void 0 : i.large, m = i == null ? void 0 : i.medium, g = i == null ? void 0 : i.small, p = r.id;
|
|
477
477
|
if (!p)
|
|
478
478
|
return "";
|
|
479
|
-
const
|
|
479
|
+
const f = c ? createCssClass({
|
|
480
480
|
className: p,
|
|
481
481
|
styles: c
|
|
482
482
|
}) : "", d = m ? createCssClass({
|
|
@@ -486,15 +486,15 @@ function BlockStyles(e) {
|
|
|
486
486
|
"medium",
|
|
487
487
|
s
|
|
488
488
|
)
|
|
489
|
-
}) : "", l =
|
|
489
|
+
}) : "", l = g ? createCssClass({
|
|
490
490
|
className: p,
|
|
491
|
-
styles:
|
|
491
|
+
styles: g,
|
|
492
492
|
mediaQuery: getMaxWidthQueryForSize(
|
|
493
493
|
"small",
|
|
494
494
|
s
|
|
495
495
|
)
|
|
496
496
|
}) : "";
|
|
497
|
-
return [
|
|
497
|
+
return [f, d, l].join(" ");
|
|
498
498
|
};
|
|
499
499
|
return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: n() }) }) : null });
|
|
500
500
|
}
|
|
@@ -657,7 +657,7 @@ function RepeatedBlock(e) {
|
|
|
657
657
|
);
|
|
658
658
|
}
|
|
659
659
|
function Block(e) {
|
|
660
|
-
var m,
|
|
660
|
+
var m, g, p;
|
|
661
661
|
const t = function() {
|
|
662
662
|
return getComponent({
|
|
663
663
|
block: e.block,
|
|
@@ -692,17 +692,17 @@ function Block(e) {
|
|
|
692
692
|
var l;
|
|
693
693
|
return !((l = t()) != null && l.component) && !n() ? o().children ?? [] : [];
|
|
694
694
|
}, s = function() {
|
|
695
|
-
var d, l, u, b,
|
|
695
|
+
var d, l, u, b, h, S, k, y, C, x;
|
|
696
696
|
return {
|
|
697
697
|
blockChildren: o().children ?? [],
|
|
698
698
|
componentRef: (d = t()) == null ? void 0 : d.component,
|
|
699
699
|
componentOptions: {
|
|
700
700
|
...getBlockComponentOptions(o()),
|
|
701
701
|
builderContext: e.context,
|
|
702
|
-
...((l = t()) == null ? void 0 : l.name) === "Core:Button" || ((u = t()) == null ? void 0 : u.name) === "Symbol" || ((b = t()) == null ? void 0 : b.name) === "Columns" || ((
|
|
702
|
+
...((l = t()) == null ? void 0 : l.name) === "Core:Button" || ((u = t()) == null ? void 0 : u.name) === "Symbol" || ((b = t()) == null ? void 0 : b.name) === "Columns" || ((h = t()) == null ? void 0 : h.name) === "Form:Form" ? {
|
|
703
703
|
builderLinkComponent: e.linkComponent
|
|
704
704
|
} : {},
|
|
705
|
-
...((
|
|
705
|
+
...((S = t()) == null ? void 0 : S.name) === "Symbol" || ((k = t()) == null ? void 0 : k.name) === "Columns" || ((y = t()) == null ? void 0 : y.name) === "Form:Form" ? {
|
|
706
706
|
builderComponents: e.registeredComponents
|
|
707
707
|
} : {}
|
|
708
708
|
},
|
|
@@ -710,8 +710,8 @@ function Block(e) {
|
|
|
710
710
|
linkComponent: e.linkComponent,
|
|
711
711
|
registeredComponents: e.registeredComponents,
|
|
712
712
|
builderBlock: o(),
|
|
713
|
-
includeBlockProps: ((
|
|
714
|
-
isInteractive: !((
|
|
713
|
+
includeBlockProps: ((C = t()) == null ? void 0 : C.noWrap) === !0,
|
|
714
|
+
isInteractive: !((x = t()) != null && x.isRSC)
|
|
715
715
|
};
|
|
716
716
|
}, c = e.context;
|
|
717
717
|
return /* @__PURE__ */ jsx(Fragment, { children: i() ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -729,11 +729,11 @@ function Block(e) {
|
|
|
729
729
|
includeBlockProps: s().includeBlockProps,
|
|
730
730
|
isInteractive: s().isInteractive
|
|
731
731
|
}
|
|
732
|
-
) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (p = n()) == null ? void 0 : p.map((
|
|
732
|
+
) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (p = n()) == null ? void 0 : p.map((f, d) => /* @__PURE__ */ jsx(
|
|
733
733
|
RepeatedBlock,
|
|
734
734
|
{
|
|
735
|
-
repeatContext:
|
|
736
|
-
block:
|
|
735
|
+
repeatContext: f.context,
|
|
736
|
+
block: f.block,
|
|
737
737
|
registeredComponents: e.registeredComponents,
|
|
738
738
|
linkComponent: e.linkComponent
|
|
739
739
|
},
|
|
@@ -760,15 +760,15 @@ function Block(e) {
|
|
|
760
760
|
isInteractive: s().isInteractive
|
|
761
761
|
}
|
|
762
762
|
),
|
|
763
|
-
(
|
|
763
|
+
(g = a()) == null ? void 0 : g.map((f) => /* @__PURE__ */ jsx(
|
|
764
764
|
Block,
|
|
765
765
|
{
|
|
766
|
-
block:
|
|
766
|
+
block: f,
|
|
767
767
|
context: c,
|
|
768
768
|
registeredComponents: e.registeredComponents,
|
|
769
769
|
linkComponent: e.linkComponent
|
|
770
770
|
},
|
|
771
|
-
|
|
771
|
+
f.id
|
|
772
772
|
))
|
|
773
773
|
]
|
|
774
774
|
}
|
|
@@ -825,39 +825,39 @@ function Columns(e) {
|
|
|
825
825
|
desktopStyle: "row"
|
|
826
826
|
})
|
|
827
827
|
};
|
|
828
|
-
},
|
|
829
|
-
const b = u === 0 ? 0 : t,
|
|
828
|
+
}, g = function(u) {
|
|
829
|
+
const b = u === 0 ? 0 : t, h = i(u), S = `${b}px`, k = "100%", y = 0;
|
|
830
830
|
return {
|
|
831
831
|
...{
|
|
832
832
|
display: "flex",
|
|
833
833
|
flexDirection: "column",
|
|
834
834
|
alignItems: "stretch"
|
|
835
835
|
},
|
|
836
|
-
width:
|
|
837
|
-
["marginLeft"]:
|
|
836
|
+
width: h,
|
|
837
|
+
["marginLeft"]: S,
|
|
838
838
|
"--column-width-mobile": s({
|
|
839
|
-
stackedStyle: x,
|
|
840
|
-
desktopStyle: y
|
|
841
|
-
}),
|
|
842
|
-
"--column-margin-left-mobile": s({
|
|
843
839
|
stackedStyle: k,
|
|
844
840
|
desktopStyle: h
|
|
845
841
|
}),
|
|
846
|
-
"--column-
|
|
847
|
-
stackedStyle:
|
|
848
|
-
desktopStyle:
|
|
842
|
+
"--column-margin-left-mobile": s({
|
|
843
|
+
stackedStyle: y,
|
|
844
|
+
desktopStyle: S
|
|
849
845
|
}),
|
|
850
|
-
"--column-
|
|
846
|
+
"--column-width-tablet": a({
|
|
851
847
|
stackedStyle: k,
|
|
852
848
|
desktopStyle: h
|
|
849
|
+
}),
|
|
850
|
+
"--column-margin-left-tablet": a({
|
|
851
|
+
stackedStyle: y,
|
|
852
|
+
desktopStyle: S
|
|
853
853
|
})
|
|
854
854
|
};
|
|
855
855
|
}, p = function(u) {
|
|
856
|
-
var
|
|
856
|
+
var h, S;
|
|
857
857
|
return getSizesForBreakpoints(
|
|
858
|
-
((
|
|
858
|
+
((S = (h = e.builderContext.content) == null ? void 0 : h.meta) == null ? void 0 : S.breakpoints) || {}
|
|
859
859
|
)[u].max;
|
|
860
|
-
},
|
|
860
|
+
}, f = function() {
|
|
861
861
|
return `
|
|
862
862
|
@media (max-width: ${p("medium")}px) {
|
|
863
863
|
.${e.builderBlock.id}-breakpoints {
|
|
@@ -891,7 +891,7 @@ function Columns(e) {
|
|
|
891
891
|
className: `builder-columns ${e.builderBlock.id}-breakpoints div-65bb9135`,
|
|
892
892
|
style: m(),
|
|
893
893
|
children: [
|
|
894
|
-
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles:
|
|
894
|
+
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: f() }) }),
|
|
895
895
|
(d = e.columns) == null ? void 0 : d.map((l, u) => /* @__PURE__ */ jsx(
|
|
896
896
|
DynamicRenderer,
|
|
897
897
|
{
|
|
@@ -902,7 +902,7 @@ function Columns(e) {
|
|
|
902
902
|
href: l.link
|
|
903
903
|
} : {},
|
|
904
904
|
[getClassPropName()]: "builder-column",
|
|
905
|
-
style: mapStyleObjToStrIfNeeded(
|
|
905
|
+
style: mapStyleObjToStrIfNeeded(g(u))
|
|
906
906
|
},
|
|
907
907
|
children: /* @__PURE__ */ jsx(
|
|
908
908
|
Blocks,
|
|
@@ -1357,13 +1357,13 @@ const getTopLevelDomain = (e) => {
|
|
|
1357
1357
|
e.delete("srcset"), e.delete("noWebp");
|
|
1358
1358
|
function n(a, s = 6e4) {
|
|
1359
1359
|
return new Promise((c, m) => {
|
|
1360
|
-
const
|
|
1360
|
+
const g = document.createElement("img");
|
|
1361
1361
|
let p = !1;
|
|
1362
|
-
|
|
1363
|
-
p = !0, c(
|
|
1364
|
-
},
|
|
1365
|
-
console.warn("Image load failed",
|
|
1366
|
-
}),
|
|
1362
|
+
g.onload = () => {
|
|
1363
|
+
p = !0, c(g);
|
|
1364
|
+
}, g.addEventListener("error", (f) => {
|
|
1365
|
+
console.warn("Image load failed", f.error), m(f.error);
|
|
1366
|
+
}), g.src = a, setTimeout(() => {
|
|
1367
1367
|
p || m(new Error("Image load timed out"));
|
|
1368
1368
|
}, s);
|
|
1369
1369
|
});
|
|
@@ -1650,7 +1650,7 @@ const componentInfo$3 = {
|
|
|
1650
1650
|
type: "file",
|
|
1651
1651
|
allowedFileTypes: ["mp4"],
|
|
1652
1652
|
bubble: !0,
|
|
1653
|
-
defaultValue: "https://
|
|
1653
|
+
defaultValue: "https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd27731a526464deba0016216f5f9e570%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=d27731a526464deba0016216f5f9e570&alt=media&optimized=true",
|
|
1654
1654
|
required: !0
|
|
1655
1655
|
}, {
|
|
1656
1656
|
name: "posterImage",
|
|
@@ -1754,7 +1754,7 @@ const componentInfo$3 = {
|
|
|
1754
1754
|
}, {
|
|
1755
1755
|
component: Text,
|
|
1756
1756
|
...componentInfo$4
|
|
1757
|
-
}, ...getExtraComponents()],
|
|
1757
|
+
}, ...getExtraComponents()], createRegisterComponentMessage = (e) => ({
|
|
1758
1758
|
type: "builder.registerComponent",
|
|
1759
1759
|
data: serializeComponentInfo(e)
|
|
1760
1760
|
}), serializeFn = (e) => {
|
|
@@ -1947,52 +1947,47 @@ const DEFAULT_API_VERSION = "v3", BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUIL
|
|
|
1947
1947
|
const e = new URLSearchParams(window.location.search);
|
|
1948
1948
|
return getBuilderSearchParams(e);
|
|
1949
1949
|
}, normalizeSearchParams = (e) => e instanceof URLSearchParams ? convertSearchParamsToQueryObject(e) : e, isPositiveNumber = (e) => typeof e == "number" && !isNaN(e) && e >= 0, generateContentUrl = (e) => {
|
|
1950
|
-
let {
|
|
1951
|
-
noTraverse: t = !1
|
|
1952
|
-
} = e;
|
|
1953
1950
|
const {
|
|
1954
|
-
limit:
|
|
1955
|
-
userAttributes:
|
|
1956
|
-
query:
|
|
1957
|
-
model:
|
|
1958
|
-
apiKey:
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
fields: p,
|
|
1951
|
+
limit: t = 30,
|
|
1952
|
+
userAttributes: n,
|
|
1953
|
+
query: o,
|
|
1954
|
+
model: r,
|
|
1955
|
+
apiKey: i,
|
|
1956
|
+
enrich: a,
|
|
1957
|
+
locale: s,
|
|
1958
|
+
apiVersion: c = DEFAULT_API_VERSION,
|
|
1959
|
+
fields: m,
|
|
1964
1960
|
omit: g,
|
|
1965
|
-
offset:
|
|
1966
|
-
cacheSeconds:
|
|
1967
|
-
staleCacheSeconds:
|
|
1968
|
-
sort:
|
|
1969
|
-
includeUnpublished:
|
|
1961
|
+
offset: p,
|
|
1962
|
+
cacheSeconds: f,
|
|
1963
|
+
staleCacheSeconds: d,
|
|
1964
|
+
sort: l,
|
|
1965
|
+
includeUnpublished: u
|
|
1970
1966
|
} = e;
|
|
1971
|
-
if (!
|
|
1967
|
+
if (!i)
|
|
1972
1968
|
throw new Error("Missing API key");
|
|
1973
|
-
if (!["v3"].includes(
|
|
1974
|
-
throw new Error(`Invalid apiVersion: expected 'v3', received '${
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
sort: b
|
|
1969
|
+
if (!["v3"].includes(c))
|
|
1970
|
+
throw new Error(`Invalid apiVersion: expected 'v3', received '${c}'`);
|
|
1971
|
+
const b = t !== 1, h = new URL(`https://cdn.builder.io/api/${c}/content/${r}`);
|
|
1972
|
+
if (h.searchParams.set("apiKey", i), h.searchParams.set("limit", String(t)), h.searchParams.set("noTraverse", String(b)), h.searchParams.set("includeRefs", String(!0)), s && h.searchParams.set("locale", s), a && h.searchParams.set("enrich", String(a)), h.searchParams.set("omit", g || "meta.componentsUsed"), m && h.searchParams.set("fields", m), Number.isFinite(p) && p > -1 && h.searchParams.set("offset", String(Math.floor(p))), typeof u == "boolean" && h.searchParams.set("includeUnpublished", String(u)), f && isPositiveNumber(f) && h.searchParams.set("cacheSeconds", String(f)), d && isPositiveNumber(d) && h.searchParams.set("staleCacheSeconds", String(d)), l) {
|
|
1973
|
+
const y = flatten({
|
|
1974
|
+
sort: l
|
|
1980
1975
|
});
|
|
1981
|
-
for (const C in
|
|
1982
|
-
h.searchParams.set(C, JSON.stringify(
|
|
1976
|
+
for (const C in y)
|
|
1977
|
+
h.searchParams.set(C, JSON.stringify(y[C]));
|
|
1983
1978
|
}
|
|
1984
|
-
const
|
|
1979
|
+
const S = {
|
|
1985
1980
|
...getBuilderSearchParamsFromWindow(),
|
|
1986
1981
|
...normalizeSearchParams(e.options || {})
|
|
1987
|
-
}, k = flatten(
|
|
1988
|
-
for (const
|
|
1989
|
-
h.searchParams.set(
|
|
1990
|
-
if (
|
|
1991
|
-
const
|
|
1992
|
-
query:
|
|
1982
|
+
}, k = flatten(S);
|
|
1983
|
+
for (const y in k)
|
|
1984
|
+
h.searchParams.set(y, String(k[y]));
|
|
1985
|
+
if (n && h.searchParams.set("userAttributes", JSON.stringify(n)), o) {
|
|
1986
|
+
const y = flatten({
|
|
1987
|
+
query: o
|
|
1993
1988
|
});
|
|
1994
|
-
for (const C in
|
|
1995
|
-
h.searchParams.set(C, JSON.stringify(
|
|
1989
|
+
for (const C in y)
|
|
1990
|
+
h.searchParams.set(C, JSON.stringify(y[C]));
|
|
1996
1991
|
}
|
|
1997
1992
|
return h;
|
|
1998
1993
|
}, checkContentHasResults = (e) => "results" in e;
|
|
@@ -2003,7 +1998,7 @@ async function fetchOneEntry(e) {
|
|
|
2003
1998
|
});
|
|
2004
1999
|
return t && t[0] || null;
|
|
2005
2000
|
}
|
|
2006
|
-
const
|
|
2001
|
+
const _fetchContent = async (e) => {
|
|
2007
2002
|
const t = generateContentUrl(e);
|
|
2008
2003
|
return await (await fetch$1(t.href)).json();
|
|
2009
2004
|
}, _processContentResult = async (e, t, n = generateContentUrl(e)) => {
|
|
@@ -2043,7 +2038,6 @@ async function fetchEntries(e) {
|
|
|
2043
2038
|
return logger.error("Error fetching data. ", t), null;
|
|
2044
2039
|
}
|
|
2045
2040
|
}
|
|
2046
|
-
const getAllContent = fetchEntries;
|
|
2047
2041
|
function isPreviewing() {
|
|
2048
2042
|
return !isBrowser() || isEditing() ? !1 : location.search.indexOf("builder.preview=") !== -1;
|
|
2049
2043
|
}
|
|
@@ -2236,7 +2230,7 @@ function isFromTrustedHost(e, t) {
|
|
|
2236
2230
|
const n = new URL(t.origin), o = n.hostname;
|
|
2237
2231
|
return (e || DEFAULT_TRUSTED_HOSTS).findIndex((r) => r.startsWith("*.") ? o.endsWith(r.slice(1)) : r === o) > -1;
|
|
2238
2232
|
}
|
|
2239
|
-
const SDK_VERSION = "0.
|
|
2233
|
+
const SDK_VERSION = "0.14.0", registry = {};
|
|
2240
2234
|
function register(e, t) {
|
|
2241
2235
|
let n = registry[e];
|
|
2242
2236
|
if (n || (n = registry[e] = []), n.push(t), isBrowser()) {
|
|
@@ -2306,18 +2300,18 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2306
2300
|
if (r != null && r.type)
|
|
2307
2301
|
switch (r.type) {
|
|
2308
2302
|
case "builder.evaluate": {
|
|
2309
|
-
const s = r.data.text, c = r.data.arguments || [], m = r.data.id,
|
|
2310
|
-
let p,
|
|
2303
|
+
const s = r.data.text, c = r.data.arguments || [], m = r.data.id, g = new Function(s);
|
|
2304
|
+
let p, f = null;
|
|
2311
2305
|
try {
|
|
2312
|
-
p =
|
|
2306
|
+
p = g.apply(null, c);
|
|
2313
2307
|
} catch (d) {
|
|
2314
|
-
|
|
2308
|
+
f = d;
|
|
2315
2309
|
}
|
|
2316
|
-
|
|
2310
|
+
f ? (i = window.parent) == null || i.postMessage({
|
|
2317
2311
|
type: "builder.evaluateError",
|
|
2318
2312
|
data: {
|
|
2319
2313
|
id: m,
|
|
2320
|
-
error:
|
|
2314
|
+
error: f.message
|
|
2321
2315
|
}
|
|
2322
2316
|
}, "*") : p && typeof p.then == "function" ? p.then((d) => {
|
|
2323
2317
|
var l;
|
|
@@ -2519,7 +2513,7 @@ const getRootStateInitialValue = ({
|
|
|
2519
2513
|
meta: e == null ? void 0 : e.meta
|
|
2520
2514
|
} : void 0;
|
|
2521
2515
|
function ContentComponent(e) {
|
|
2522
|
-
var r, i, a, s, c, m,
|
|
2516
|
+
var r, i, a, s, c, m, g, p, f;
|
|
2523
2517
|
const t = getUpdateVariantVisibilityScript({
|
|
2524
2518
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2525
2519
|
variationId: (r = e.content) == null ? void 0 : r.testVariationId,
|
|
@@ -2527,12 +2521,6 @@ function ContentComponent(e) {
|
|
|
2527
2521
|
contentId: (i = e.content) == null ? void 0 : i.id
|
|
2528
2522
|
}), n = [
|
|
2529
2523
|
...getDefaultRegisteredComponents(),
|
|
2530
|
-
// While this `components` object is deprecated, we must maintain support for it.
|
|
2531
|
-
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
2532
|
-
// existing usage.
|
|
2533
|
-
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
2534
|
-
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
2535
|
-
...components,
|
|
2536
2524
|
...e.customComponents || []
|
|
2537
2525
|
].reduce(
|
|
2538
2526
|
(d, { component: l, ...u }) => ({
|
|
@@ -2560,12 +2548,6 @@ function ContentComponent(e) {
|
|
|
2560
2548
|
apiVersion: e.apiVersion,
|
|
2561
2549
|
componentInfos: [
|
|
2562
2550
|
...getDefaultRegisteredComponents(),
|
|
2563
|
-
// While this `components` object is deprecated, we must maintain support for it.
|
|
2564
|
-
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
2565
|
-
// existing usage.
|
|
2566
|
-
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
2567
|
-
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
2568
|
-
...components,
|
|
2569
2551
|
...e.customComponents || []
|
|
2570
2552
|
].reduce(
|
|
2571
2553
|
(d, { component: l, ...u }) => ({
|
|
@@ -2588,7 +2570,6 @@ function ContentComponent(e) {
|
|
|
2588
2570
|
apiKey: e.apiKey,
|
|
2589
2571
|
canTrack: e.canTrack,
|
|
2590
2572
|
locale: e.locale,
|
|
2591
|
-
includeRefs: e.includeRefs,
|
|
2592
2573
|
enrich: e.enrich,
|
|
2593
2574
|
showContent: e.showContent,
|
|
2594
2575
|
builderContextSignal: o,
|
|
@@ -2603,13 +2584,13 @@ function ContentComponent(e) {
|
|
|
2603
2584
|
{
|
|
2604
2585
|
contentId: (a = o.content) == null ? void 0 : a.id,
|
|
2605
2586
|
cssCode: (c = (s = o.content) == null ? void 0 : s.data) == null ? void 0 : c.cssCode,
|
|
2606
|
-
customFonts: (
|
|
2587
|
+
customFonts: (g = (m = o.content) == null ? void 0 : m.data) == null ? void 0 : g.customFonts
|
|
2607
2588
|
}
|
|
2608
2589
|
) }),
|
|
2609
2590
|
/* @__PURE__ */ jsx(
|
|
2610
2591
|
Blocks,
|
|
2611
2592
|
{
|
|
2612
|
-
blocks: (
|
|
2593
|
+
blocks: (f = (p = o.content) == null ? void 0 : p.data) == null ? void 0 : f.blocks,
|
|
2613
2594
|
context: o,
|
|
2614
2595
|
registeredComponents: n,
|
|
2615
2596
|
linkComponent: e.linkComponent
|
|
@@ -2670,7 +2651,6 @@ function ContentVariants(e) {
|
|
|
2670
2651
|
linkComponent: e.linkComponent,
|
|
2671
2652
|
canTrack: e.canTrack,
|
|
2672
2653
|
locale: e.locale,
|
|
2673
|
-
includeRefs: e.includeRefs,
|
|
2674
2654
|
enrich: e.enrich,
|
|
2675
2655
|
isSsrAbTest: t,
|
|
2676
2656
|
blocksWrapper: e.blocksWrapper,
|
|
@@ -2696,7 +2676,6 @@ function ContentVariants(e) {
|
|
|
2696
2676
|
linkComponent: e.linkComponent,
|
|
2697
2677
|
canTrack: e.canTrack,
|
|
2698
2678
|
locale: e.locale,
|
|
2699
|
-
includeRefs: e.includeRefs,
|
|
2700
2679
|
enrich: e.enrich,
|
|
2701
2680
|
isSsrAbTest: t,
|
|
2702
2681
|
blocksWrapper: e.blocksWrapper,
|
|
@@ -2730,12 +2709,12 @@ const fetchSymbolContent = async ({
|
|
|
2730
2709
|
async function Symbol$1(e) {
|
|
2731
2710
|
var o, r, i, a, s;
|
|
2732
2711
|
const t = function() {
|
|
2733
|
-
var m,
|
|
2712
|
+
var m, g;
|
|
2734
2713
|
return [
|
|
2735
2714
|
e.attributes[getClassPropName()],
|
|
2736
2715
|
"builder-symbol",
|
|
2737
2716
|
(m = e.symbol) != null && m.inline ? "builder-inline-symbol" : void 0,
|
|
2738
|
-
(
|
|
2717
|
+
(g = e.symbol) != null && g.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
2739
2718
|
].filter(Boolean).join(" ");
|
|
2740
2719
|
}, n = ((o = e.symbol) == null ? void 0 : o.content) || await fetchSymbolContent({
|
|
2741
2720
|
symbol: e.symbol,
|
|
@@ -2763,7 +2742,7 @@ async function Symbol$1(e) {
|
|
|
2763
2742
|
}
|
|
2764
2743
|
) });
|
|
2765
2744
|
}
|
|
2766
|
-
const
|
|
2745
|
+
const settings = {};
|
|
2767
2746
|
function setEditorSettings(e) {
|
|
2768
2747
|
if (isBrowser()) {
|
|
2769
2748
|
Object.assign(settings, e);
|
|
@@ -2795,17 +2774,13 @@ const fetchBuilderProps = async (e) => {
|
|
|
2795
2774
|
};
|
|
2796
2775
|
};
|
|
2797
2776
|
export {
|
|
2798
|
-
|
|
2777
|
+
track as A,
|
|
2799
2778
|
Blocks as B,
|
|
2800
2779
|
ContentVariants as C,
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
fetchEntries as H,
|
|
2806
|
-
getAllContent as I,
|
|
2807
|
-
getContent as J,
|
|
2808
|
-
RenderBlocks as R,
|
|
2780
|
+
subscribeToEditor as D,
|
|
2781
|
+
fetchBuilderProps as E,
|
|
2782
|
+
_processContentResult as F,
|
|
2783
|
+
fetchEntries as G,
|
|
2809
2784
|
Symbol$1 as S,
|
|
2810
2785
|
Text as T,
|
|
2811
2786
|
_track as _,
|
|
@@ -2831,8 +2806,8 @@ export {
|
|
|
2831
2806
|
triggerAnimation as t,
|
|
2832
2807
|
fetch$1 as u,
|
|
2833
2808
|
init as v,
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2809
|
+
Columns as w,
|
|
2810
|
+
register as x,
|
|
2811
|
+
setEditorSettings as y,
|
|
2812
|
+
getBuilderSearchParams as z
|
|
2838
2813
|
};
|