@builder.io/sdk-react-nextjs 0.14.21 → 0.14.24
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-421209ac.cjs → USE_CLIENT_BUNDLE-4f10369a.cjs} +2 -2
- package/lib/{node/USE_CLIENT_BUNDLE-14685e18.js → browser/USE_CLIENT_BUNDLE-f9d01f92.js} +21 -21
- package/lib/{edge/USE_SERVER_BUNDLE-81678d13.js → browser/USE_SERVER_BUNDLE-4e9478d4.js} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-53f11a34.cjs → browser/USE_SERVER_BUNDLE-76397f77.cjs} +1 -1
- package/lib/browser/{bundle-1e8b30d0.cjs → bundle-35974522.cjs} +20 -20
- package/lib/browser/{bundle-8e752d91.js → bundle-ca09c73c.js} +333 -333
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +3 -3
- package/lib/{node/USE_CLIENT_BUNDLE-80d049f9.cjs → edge/USE_CLIENT_BUNDLE-d7a952fe.cjs} +2 -2
- package/lib/{browser/USE_CLIENT_BUNDLE-85cd491c.js → edge/USE_CLIENT_BUNDLE-edb4fc98.js} +21 -21
- package/lib/{node/USE_SERVER_BUNDLE-c93447b3.js → edge/USE_SERVER_BUNDLE-8a6ee05a.js} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-c11df0b0.cjs → edge/USE_SERVER_BUNDLE-e3d2232b.cjs} +1 -1
- package/lib/edge/{bundle-4d349481.cjs → bundle-2bd976c9.cjs} +27 -27
- package/lib/edge/{bundle-ad170624.js → bundle-bdc1f5be.js} +421 -421
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +3 -3
- package/lib/{edge/USE_CLIENT_BUNDLE-1d5cd7a9.cjs → node/USE_CLIENT_BUNDLE-2a3a1484.cjs} +2 -2
- package/lib/{edge/USE_CLIENT_BUNDLE-e965200b.js → node/USE_CLIENT_BUNDLE-af2f5052.js} +21 -21
- package/lib/{browser/USE_SERVER_BUNDLE-7f959896.cjs → node/USE_SERVER_BUNDLE-290676c5.cjs} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-c44b1000.js → node/USE_SERVER_BUNDLE-55adca17.js} +1 -1
- package/lib/node/{bundle-8a453488.cjs → bundle-10b57ad3.cjs} +5 -5
- package/lib/node/{bundle-5c7927a4.js → bundle-9b0c3f03.js} +49 -49
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/package.json +3 -3
- package/types/cjs/blocks/accordion/accordion.d.ts +4 -0
- package/types/cjs/blocks/accordion/accordion.types.d.ts +12 -0
- package/types/cjs/blocks/accordion/component-info.d.ts +2 -0
- package/types/cjs/blocks/accordion/helpers.d.ts +1 -0
- package/types/cjs/blocks/accordion/index.d.ts +1 -0
- package/types/cjs/components/block/animator.d.ts +0 -1
- package/types/cjs/components/content-variants/content-variants.types.d.ts +1 -1
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/functions/camel-to-kebab-case.d.ts +1 -1
- package/types/esm/blocks/accordion/accordion.d.ts +4 -0
- package/types/esm/blocks/accordion/accordion.types.d.ts +12 -0
- package/types/esm/blocks/accordion/component-info.d.ts +2 -0
- package/types/esm/blocks/accordion/helpers.d.ts +1 -0
- package/types/esm/blocks/accordion/index.d.ts +1 -0
- package/types/esm/components/block/animator.d.ts +0 -1
- package/types/esm/components/content-variants/content-variants.types.d.ts +1 -1
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/functions/camel-to-kebab-case.d.ts +1 -1
package/lib/browser/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-4f10369a.cjs"),e=require("./bundle-35974522.cjs");require("react/jsx-runtime");require("react");require("./USE_SERVER_BUNDLE-76397f77.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/browser/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-f9d01f92.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-ca09c73c.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
|
-
import "./USE_SERVER_BUNDLE-
|
|
5
|
+
import "./USE_SERVER_BUNDLE-4e9478d4.js";
|
|
6
6
|
import "next/navigation";
|
|
7
7
|
import "lru-cache";
|
|
8
8
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
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-2bd976c9.cjs"),l=require("react"),D=require("./USE_SERVER_BUNDLE-e3d2232b.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,b;n.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((b=window.parent)==null||b.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function S(){var o,b;n.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((b=window.parent)==null||b.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;
|
|
@@ -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,b]=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 h=0;h<v.length;h++){const s=v[h];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: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,b]=l.useState(()=>[]),[v,x]=l.useState(()=>!1);function h(){if(!c.current||!c.current.getElementsByTagName)return;const s=c.current.getElementsByTagName("script");for(let f=0;f<s.length;f++){const u=s[f];if(u.src&&!g.includes(u.src)){g.push(u.src);const k=document.createElement("script");k.async=!0,k.src=u.src,document.head.appendChild(k)}else if(n.isJsScript(u)&&!o.includes(u.innerText))try{o.push(u.innerText),new Function(u.innerText)()}catch(k){console.warn("`Embed`: Error running script:",k)}}}return l.useEffect(()=>{c.current&&!v&&(x(!0),h())},[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,b,v,x,h,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&&((b=(o=e.builderBlock)==null?void 0:o.children)!=null&&b.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=(h=e.builderBlock)==null?void 0:h.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,m,y,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:((m=a==null?void 0:a.meta)==null?void 0:m.breakpoints)||((C=(y=e.builderContextSignal.content)==null?void 0:y.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[b,v]=l.useState(()=>e.contentWrapper||"div");function x(a){return n.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:i=>{var m;const{breakpoints:d,contentId:r}=i;!r||r!==((m=e.builderContextSignal.content)==null?void 0:m.id)||d&&S({meta:{breakpoints:d}})},animation:i=>{n.triggerAnimation(i)},contentUpdate:i=>{S(i)}}})(a)}function h(){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,f]=l.useState(()=>({})),[u,k]=l.useState(()=>({})),[
|
|
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,b]=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 h=0;h<v.length;h++){const s=v[h];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: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,b]=l.useState(()=>[]),[v,x]=l.useState(()=>!1);function h(){if(!c.current||!c.current.getElementsByTagName)return;const s=c.current.getElementsByTagName("script");for(let f=0;f<s.length;f++){const u=s[f];if(u.src&&!g.includes(u.src)){g.push(u.src);const k=document.createElement("script");k.async=!0,k.src=u.src,document.head.appendChild(k)}else if(n.isJsScript(u)&&!o.includes(u.innerText))try{o.push(u.innerText),new Function(u.innerText)()}catch(k){console.warn("`Embed`: Error running script:",k)}}}return l.useEffect(()=>{c.current&&!v&&(x(!0),h())},[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,b,v,x,h,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&&((b=(o=e.builderBlock)==null?void 0:o.children)!=null&&b.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=(h=e.builderBlock)==null?void 0:h.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,m,y,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:((m=a==null?void 0:a.meta)==null?void 0:m.breakpoints)||((C=(y=e.builderContextSignal.content)==null?void 0:y.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[b,v]=l.useState(()=>e.contentWrapper||"div");function x(a){return n.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:i=>{var m;const{breakpoints:d,contentId:r}=i;!r||r!==((m=e.builderContextSignal.content)==null?void 0:m.id)||d&&S({meta:{breakpoints:d}})},animation:i=>{n.triggerAnimation(i)},contentUpdate:i=>{S(i)}}})(a)}function h(){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,f]=l.useState(()=>({})),[u,k]=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,m=(d=e.builderContextSignal.content)==null?void 0:d.id;n._track({type:"click",canTrack:n.getDefaultCanTrack(e.canTrack),contentId:m,apiKey:e.apiKey,variationId:r!==m?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,m])=>{if(!m||u[r]||s[r]&&!n.isEditing())return;u[r]=!0;const y=m.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(y).then(C=>C.json()).then(C=>{g({[r]:C}),s[r]=!0}).catch(C=>{console.error("error fetching dynamic data",m,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}`),m=i.get("apiKey")||i.get("builder.space");d===e.model&&m===e.apiKey&&(!e.content||r===e.content.id)&&n.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(y=>{y&&S(y)})}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,m=(i=e.builderContextSignal.content)==null?void 0:i.id,y=e.apiKey;n._track({type:"impression",canTrack:!0,contentId:m,apiKey:y,variationId:r!==m?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."),h(),w(),E()},[]),l.useEffect(()=>{},[e.content]),l.useEffect(()=>{h()},[(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(b,{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,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as a, Fragment as
|
|
3
|
-
import { i as Z, g as H, a as $, b as O, c as
|
|
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-bdc1f5be.js";
|
|
4
4
|
import { useRef as T, useState as C, useEffect as f, createContext as me } from "react";
|
|
5
|
-
import { p as ge } from "./USE_SERVER_BUNDLE-
|
|
5
|
+
import { p as ge } from "./USE_SERVER_BUNDLE-8a6ee05a.js";
|
|
6
6
|
import { useRouter as be } from "next/navigation";
|
|
7
7
|
function J(e) {
|
|
8
|
-
return /* @__PURE__ */ a(
|
|
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
|
}
|
|
10
10
|
function ke(e) {
|
|
11
11
|
function i() {
|
|
@@ -52,7 +52,7 @@ function Ce(e) {
|
|
|
52
52
|
}
|
|
53
53
|
);
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function Ee(e) {
|
|
56
56
|
function i() {
|
|
57
57
|
return e.includeBlockProps ? {
|
|
58
58
|
...$({
|
|
@@ -70,14 +70,14 @@ function we(e) {
|
|
|
70
70
|
}
|
|
71
71
|
return /* @__PURE__ */ a(e.Wrapper, { ...e.wrapperProps, attributes: i(), children: e.children });
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function we(e) {
|
|
74
74
|
function i() {
|
|
75
75
|
var r;
|
|
76
76
|
return "builder-blocks" + ((r = e.blocks) != null && r.length ? "" : " no-blocks");
|
|
77
77
|
}
|
|
78
78
|
function s() {
|
|
79
79
|
var r, g;
|
|
80
|
-
|
|
80
|
+
E() && !((r = e.blocks) != null && r.length) && ((g = window.parent) == null || g.postMessage(
|
|
81
81
|
{
|
|
82
82
|
type: "builder.clickEmptyBlocks",
|
|
83
83
|
data: {
|
|
@@ -90,7 +90,7 @@ function Ee(e) {
|
|
|
90
90
|
}
|
|
91
91
|
function S() {
|
|
92
92
|
var r, g;
|
|
93
|
-
|
|
93
|
+
E() && !((r = e.blocks) != null && r.length) && ((g = window.parent) == null || g.postMessage(
|
|
94
94
|
{
|
|
95
95
|
type: "builder.hoverEmptyBlocks",
|
|
96
96
|
data: {
|
|
@@ -101,7 +101,7 @@ function Ee(e) {
|
|
|
101
101
|
"*"
|
|
102
102
|
));
|
|
103
103
|
}
|
|
104
|
-
return /* @__PURE__ */ I(
|
|
104
|
+
return /* @__PURE__ */ I(w, { children: [
|
|
105
105
|
/* @__PURE__ */ a(
|
|
106
106
|
e.BlocksWrapper,
|
|
107
107
|
{
|
|
@@ -156,8 +156,8 @@ function Pe(e) {
|
|
|
156
156
|
};
|
|
157
157
|
return e.aspectRatio ? m : void 0;
|
|
158
158
|
}
|
|
159
|
-
return /* @__PURE__ */ I(
|
|
160
|
-
/* @__PURE__ */ I(
|
|
159
|
+
return /* @__PURE__ */ I(w, { children: [
|
|
160
|
+
/* @__PURE__ */ I(w, { children: [
|
|
161
161
|
/* @__PURE__ */ I("picture", { children: [
|
|
162
162
|
s() ? /* @__PURE__ */ a("source", { type: "image/webp", srcSet: s() }) : null,
|
|
163
163
|
/* @__PURE__ */ a(
|
|
@@ -187,7 +187,7 @@ function Pe(e) {
|
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
) : null,
|
|
190
|
-
(h = (v = e.builderBlock) == null ? void 0 : v.children) != null && h.length && e.fitContent ? /* @__PURE__ */ a(
|
|
190
|
+
(h = (v = e.builderBlock) == null ? void 0 : v.children) != null && h.length && e.fitContent ? /* @__PURE__ */ a(w, { children: e.children }) : null,
|
|
191
191
|
!e.fitContent && ((o = (b = e.builderBlock) == null ? void 0 : b.children) != null && o.length) ? /* @__PURE__ */ a("div", { className: "div-3ac67dd4-2", children: e.children }) : null
|
|
192
192
|
] }),
|
|
193
193
|
/* @__PURE__ */ a("style", { children: `.img-3ac67dd4 {
|
|
@@ -311,7 +311,7 @@ function Be(e) {
|
|
|
311
311
|
src: e.imgSrc || e.image,
|
|
312
312
|
...e.attributes
|
|
313
313
|
},
|
|
314
|
-
|
|
314
|
+
E() && e.imgSrc || "default-key"
|
|
315
315
|
);
|
|
316
316
|
}
|
|
317
317
|
function Le(e) {
|
|
@@ -530,7 +530,7 @@ function je(e) {
|
|
|
530
530
|
var t, l;
|
|
531
531
|
const n = ((l = (t = e.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : l.httpRequests) ?? {};
|
|
532
532
|
Object.entries(n).forEach(([c, u]) => {
|
|
533
|
-
if (!u || d[c] || o[c] && !
|
|
533
|
+
if (!u || d[c] || o[c] && !E())
|
|
534
534
|
return;
|
|
535
535
|
d[c] = !0;
|
|
536
536
|
const y = u.replace(
|
|
@@ -558,7 +558,7 @@ function je(e) {
|
|
|
558
558
|
});
|
|
559
559
|
}
|
|
560
560
|
function P() {
|
|
561
|
-
|
|
561
|
+
E() && window.dispatchEvent(
|
|
562
562
|
new CustomEvent(
|
|
563
563
|
"builder:component:stateChange",
|
|
564
564
|
{
|
|
@@ -596,7 +596,7 @@ function je(e) {
|
|
|
596
596
|
}
|
|
597
597
|
function j(n) {
|
|
598
598
|
const t = new URL(location.href).searchParams, l = t.get("builder.preview"), c = t.get(
|
|
599
|
-
`builder.
|
|
599
|
+
`builder.overrides.${l}`
|
|
600
600
|
), u = t.get("apiKey") || t.get("builder.space");
|
|
601
601
|
l === e.model && u === e.apiKey && (!e.content || c === e.content.id) && ue({
|
|
602
602
|
model: e.model,
|
|
@@ -634,7 +634,7 @@ function je(e) {
|
|
|
634
634
|
}, []), f(() => {
|
|
635
635
|
var n, t;
|
|
636
636
|
if (_()) {
|
|
637
|
-
if (
|
|
637
|
+
if (E() && i.current && i.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && V(e.canTrack)) {
|
|
638
638
|
const c = (n = e.builderContextSignal.content) == null ? void 0 : n.testVariationId, u = (t = e.builderContextSignal.content) == null ? void 0 : t.id, y = e.apiKey;
|
|
639
639
|
D({
|
|
640
640
|
type: "impression",
|
|
@@ -644,11 +644,11 @@ function je(e) {
|
|
|
644
644
|
variationId: c !== u ? c : void 0
|
|
645
645
|
});
|
|
646
646
|
}
|
|
647
|
-
ee() &&
|
|
647
|
+
ee() && E();
|
|
648
648
|
}
|
|
649
649
|
}, []), f(() => {
|
|
650
650
|
e.apiKey || te.error(
|
|
651
|
-
"No API key provided to `
|
|
651
|
+
"No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
652
652
|
), b(), B(), P();
|
|
653
653
|
}, []), f(() => {
|
|
654
654
|
}, [e.content]), f(() => {
|
|
@@ -690,10 +690,10 @@ export {
|
|
|
690
690
|
J as D,
|
|
691
691
|
Ne as E,
|
|
692
692
|
Ie as F,
|
|
693
|
-
|
|
693
|
+
Ee as I,
|
|
694
694
|
Re as S,
|
|
695
695
|
Le as V,
|
|
696
|
-
|
|
696
|
+
we as a,
|
|
697
697
|
Be as b,
|
|
698
698
|
ke as c,
|
|
699
699
|
Pe as d,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use server";"use strict";const n=require("./bundle-
|
|
1
|
+
"use server";"use strict";const n=require("./bundle-2bd976c9.cjs");async function s({key:e,value:t}){return n.init(),globalThis._BUILDER_PREVIEW_LRU_CACHE.set(e,t),{[e]:t}}exports.postPreviewContent=s;
|