@builder.io/sdk-react-nextjs 0.11.2 → 0.11.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{node/USE_CLIENT_BUNDLE-fef58fdc.js → browser/USE_CLIENT_BUNDLE-7df7e7c0.js} +201 -186
- package/lib/browser/USE_CLIENT_BUNDLE-d5da4b24.cjs +23 -0
- package/lib/{edge/USE_SERVER_BUNDLE-8b1e2888.cjs → browser/USE_SERVER_BUNDLE-8af2f5dc.cjs} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-bc0c817b.js → browser/USE_SERVER_BUNDLE-f1f7aed0.js} +1 -1
- package/lib/browser/bundle-0dffcadd.cjs +168 -0
- package/lib/browser/{bundle-4ee84dab.js → bundle-a7aa61af.js} +342 -366
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +3 -3
- package/lib/edge/USE_CLIENT_BUNDLE-00c9108d.cjs +23 -0
- package/lib/{browser/USE_CLIENT_BUNDLE-336f80e4.js → edge/USE_CLIENT_BUNDLE-0a7d6596.js} +201 -186
- package/lib/{node/USE_SERVER_BUNDLE-830537df.cjs → edge/USE_SERVER_BUNDLE-426439b2.cjs} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-0bc450f5.js → edge/USE_SERVER_BUNDLE-b5008704.js} +1 -1
- package/lib/edge/{bundle-d029deb6.cjs → bundle-274cf781.cjs} +32 -32
- package/lib/edge/{bundle-cd2b1a4d.js → bundle-b11ace6b.js} +1019 -1043
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +3 -3
- package/lib/{edge/USE_CLIENT_BUNDLE-73820ea9.js → node/USE_CLIENT_BUNDLE-66fa8f31.js} +201 -186
- package/lib/node/USE_CLIENT_BUNDLE-760546ac.cjs +23 -0
- package/lib/{browser/USE_SERVER_BUNDLE-657cf8f3.js → node/USE_SERVER_BUNDLE-b09b2378.js} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-57d976dd.cjs → node/USE_SERVER_BUNDLE-d148827b.cjs} +1 -1
- package/lib/node/{bundle-e760a35e.js → bundle-5539b1a0.js} +235 -259
- package/lib/node/{bundle-a03659b6.cjs → bundle-701c93a1.cjs} +11 -11
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/package.json +97 -5
- package/types/cjs/blocks/button/button.d.ts +1 -9
- package/types/cjs/blocks/button/button.types.d.ts +6 -0
- package/types/cjs/blocks/columns/columns.d.ts +2 -14
- package/types/cjs/blocks/columns/columns.types.d.ts +15 -0
- package/types/cjs/blocks/fragment/fragment.d.ts +1 -5
- package/types/cjs/blocks/fragment/fragment.types.d.ts +5 -0
- package/types/cjs/blocks/image/image.d.ts +1 -19
- package/types/cjs/blocks/image/image.types.d.ts +19 -0
- package/types/cjs/blocks/section/section.d.ts +1 -9
- package/types/cjs/blocks/section/section.types.d.ts +6 -0
- package/types/cjs/blocks/symbol/symbol.d.ts +2 -23
- package/types/cjs/blocks/symbol/symbol.types.d.ts +18 -0
- package/types/cjs/blocks/text/text.d.ts +1 -3
- package/types/cjs/blocks/text/text.types.d.ts +3 -0
- package/types/cjs/blocks/video/video.d.ts +1 -21
- package/types/cjs/blocks/video/video.types.d.ts +21 -0
- package/types/cjs/components/blocks/blocks.d.ts +1 -6
- package/types/cjs/components/blocks/blocks.types.d.ts +6 -0
- package/types/cjs/components/content/components/enable-editor.d.ts +1 -1
- package/types/cjs/components/content/content.helpers.d.ts +1 -1
- package/types/cjs/components/content-variants/content-variants.types.d.ts +30 -1
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/functions/get-content/index.d.ts +1 -1
- package/types/cjs/functions/get-content/types.d.ts +2 -2
- package/types/cjs/server-index.d.ts +10 -1
- package/types/esm/blocks/button/button.d.ts +1 -9
- package/types/esm/blocks/button/button.types.d.ts +6 -0
- package/types/esm/blocks/columns/columns.d.ts +2 -14
- package/types/esm/blocks/columns/columns.types.d.ts +15 -0
- package/types/esm/blocks/fragment/fragment.d.ts +1 -5
- package/types/esm/blocks/fragment/fragment.types.d.ts +5 -0
- package/types/esm/blocks/image/image.d.ts +1 -19
- package/types/esm/blocks/image/image.types.d.ts +19 -0
- package/types/esm/blocks/section/section.d.ts +1 -9
- package/types/esm/blocks/section/section.types.d.ts +6 -0
- package/types/esm/blocks/symbol/symbol.d.ts +2 -23
- package/types/esm/blocks/symbol/symbol.types.d.ts +18 -0
- package/types/esm/blocks/text/text.d.ts +1 -3
- package/types/esm/blocks/text/text.types.d.ts +3 -0
- package/types/esm/blocks/video/video.d.ts +1 -21
- package/types/esm/blocks/video/video.types.d.ts +21 -0
- package/types/esm/components/blocks/blocks.d.ts +1 -6
- package/types/esm/components/blocks/blocks.types.d.ts +6 -0
- package/types/esm/components/content/components/enable-editor.d.ts +1 -1
- package/types/esm/components/content/content.helpers.d.ts +1 -1
- package/types/esm/components/content-variants/content-variants.types.d.ts +30 -1
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/functions/get-content/index.d.ts +1 -1
- package/types/esm/functions/get-content/types.d.ts +2 -2
- package/types/esm/server-index.d.ts +10 -1
- package/lib/browser/USE_CLIENT_BUNDLE-27f8858d.cjs +0 -23
- package/lib/browser/bundle-343c6c9c.cjs +0 -168
- package/lib/edge/USE_CLIENT_BUNDLE-c3dc5e68.cjs +0 -23
- package/lib/node/USE_CLIENT_BUNDLE-cdd14ec9.cjs +0 -23
package/lib/browser/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bundle-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bundle-0dffcadd.cjs"),t=require("./USE_CLIENT_BUNDLE-d5da4b24.cjs");require("lru-cache");require("react/jsx-runtime");require("react");require("next/navigation");require("./USE_SERVER_BUNDLE-8af2f5dc.cjs");exports.Blocks=e.Blocks;exports.Columns=e.Columns;exports.Content=e.ContentVariants;exports.RenderBlocks=e.RenderBlocks;exports.RenderContent=e.RenderContent;exports.Symbol=e.Symbol;exports.Text=e.Text;exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getAllContent=e.getAllContent;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.getContent=e.getContent;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.track=e.track;exports.Button=t.Button;exports.Fragment=t.FragmentComponent;exports.Image=t.Image;exports.Section=t.SectionComponent;exports.Video=t.Video;
|
package/lib/browser/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { B as i, t as m, C as c, R as g, q as p, S as l, T as C, w as d, m as f, E as u, x as B, n as S, y as E, A as R, z as h, i as x, f as k, u as y, v as P, D as b } from "./bundle-
|
|
2
|
-
import { b as w, F as A, c as F, S as T, V } from "./USE_CLIENT_BUNDLE-
|
|
1
|
+
import { B as i, t as m, C as c, R as g, q as p, S as l, T as C, w as d, m as f, E as u, x as B, n as S, y as E, A as R, z as h, i as x, f as k, u as y, v as P, D as b } from "./bundle-a7aa61af.js";
|
|
2
|
+
import { b as w, F as A, c as F, S as T, V } from "./USE_CLIENT_BUNDLE-7df7e7c0.js";
|
|
3
3
|
import "lru-cache";
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "react";
|
|
6
6
|
import "next/navigation";
|
|
7
|
-
import "./USE_SERVER_BUNDLE-
|
|
7
|
+
import "./USE_SERVER_BUNDLE-f1f7aed0.js";
|
|
8
8
|
export {
|
|
9
9
|
i as Blocks,
|
|
10
10
|
w as Button,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";"use strict";const t=require("react/jsx-runtime"),c=require("./bundle-274cf781.cjs"),r=require("react"),V=require("./USE_SERVER_BUNDLE-426439b2.cjs"),A=require("next/navigation");function D(e){return t.jsxs(t.Fragment,{children:[e.link?t.jsx(t.Fragment,{children:t.jsx("a",{...e.attributes,href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"button",children:e.text})}):t.jsx(t.Fragment,{children:t.jsx("button",{...e.attributes,style:e.attributes.style,className:e.attributes.className+" button-fdf49de0",children:e.text})}),t.jsx("style",{children:`.button-fdf49de0 {
|
|
2
|
+
all: unset;
|
|
3
|
+
}`})]})}function U(e){return t.jsxs(t.Fragment,{children:[" ",e.hasChildren?t.jsx(t.Fragment,{children:t.jsxs(e.Wrapper,{...c.getBlockProperties({block:e.block,context:e.context}),...c.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0}),children:[" ",e.children," "]})}):t.jsx(t.Fragment,{children:t.jsx(e.Wrapper,{...c.getBlockProperties({block:e.block,context:e.context}),...c.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0})})})," "]})}function H(e){return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:e.includeBlockProps?{...c.getBlockProperties({block:e.block,context:e.context}),...c.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{},children:e.children})}function O(e){function o(){var s;return"builder-blocks"+((s=e.blocks)!=null&&s.length?"":" no-blocks")}function g(){var s,m;c.isEditing()&&!((s=e.blocks)!=null&&s.length)&&((m=window.parent)==null||m.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function S(){var s,m;c.isEditing()&&!((s=e.blocks)!=null&&s.length)&&((m=window.parent)==null||m.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return t.jsxs(t.Fragment,{children:[t.jsx(e.BlocksWrapper,{className:o()+" props-blocks-wrapper-4f2c12d8","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:s=>g(),onMouseEnter:s=>S(),onKeyPress:s=>g(),...e.BlocksWrapperProps,children:e.children}),t.jsx("style",{children:`.props-blocks-wrapper-4f2c12d8 {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
align-items: stretch;
|
|
7
|
+
}`})]})}function J(e){return t.jsx("span",{children:e.children})}function $(e){var s,m,x,v;function o(){var f;const d=e.image||e.src;if(!d||!(d.match(/builder\.io/)||d.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((f=e.image)!=null&&f.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),c.getSrcSet(d)}else if(e.image&&!e.srcset)return c.getSrcSet(d);return c.getSrcSet(d)}function g(){var b;return(b=o==null?void 0:o())!=null&&b.match(/builder\.io/)&&!e.noWebp?o().replace(/\?/g,"?format=webp&"):""}function S(){const b={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?b:void 0}return t.jsxs(t.Fragment,{children:[t.jsxs(t.Fragment,{children:[t.jsxs("picture",{children:[g()?t.jsx(t.Fragment,{children:t.jsx("source",{type:"image/webp",srcSet:g()})}):null,t.jsx("img",{loading:"lazy",alt:e.altText,role:e.altText?"presentation":void 0,style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...S()},className:"builder-image"+(e.className?" "+e.className:"")+" img-40c70c9b",src:e.image,srcSet:o(),sizes:e.sizes})]}),e.aspectRatio&&!((m=(s=e.builderBlock)==null?void 0:s.children)!=null&&m.length&&e.fitContent)?t.jsx(t.Fragment,{children:t.jsx("div",{className:"builder-image-sizer div-40c70c9b",style:{paddingTop:e.aspectRatio*100+"%"}})}):null,(v=(x=e.builderBlock)==null?void 0:x.children)!=null&&v.length&&e.fitContent?t.jsx(t.Fragment,{children:e.children}):null,!e.fitContent&&e.children?t.jsx(t.Fragment,{children:t.jsx("div",{className:"div-40c70c9b-2",children:e.children})}):null]}),t.jsx("style",{children:`.img-40c70c9b {
|
|
8
|
+
opacity: 1;
|
|
9
|
+
transition: opacity 0.2s ease-in-out;
|
|
10
|
+
}.div-40c70c9b {
|
|
11
|
+
width: 100%;
|
|
12
|
+
pointer-events: none;
|
|
13
|
+
font-size: 0;
|
|
14
|
+
}.div-40c70c9b-2 {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
align-items: stretch;
|
|
18
|
+
position: absolute;
|
|
19
|
+
top: 0;
|
|
20
|
+
left: 0;
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: 100%;
|
|
23
|
+
}`})]})}function G(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 Q(e){const o=r.useRef(null),[g,S]=r.useState(()=>[]),[s,m]=r.useState(()=>[]);return r.useEffect(()=>{var v;if(!((v=o.current)!=null&&v.getElementsByTagName)||typeof window>"u")return;const x=o.current.getElementsByTagName("script");for(let b=0;b<x.length;b++){const d=x[b];if(d.src){if(g.includes(d.src))continue;g.push(d.src);const f=document.createElement("script");f.async=!0,f.src=d.src,document.head.appendChild(f)}else if(!d.type||["text/javascript","application/javascript","application/ecmascript"].includes(d.type)){if(s.includes(d.innerText))continue;try{s.push(d.innerText),new Function(d.innerText)()}catch(f){console.warn("`CustomCode`: Error running script:",f)}}}},[]),t.jsx("div",{ref:o,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}function X(e){const o=r.useRef(null),[g,S]=r.useState(()=>[]),[s,m]=r.useState(()=>[]),[x,v]=r.useState(()=>!1);function b(){if(!o.current||!o.current.getElementsByTagName)return;const d=o.current.getElementsByTagName("script");for(let f=0;f<d.length;f++){const k=d[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(c.isJsScript(k)&&!s.includes(k.innerText))try{s.push(k.innerText),new Function(k.innerText)()}catch(y){console.warn("`Embed`: Error running script:",y)}}}return r.useEffect(()=>{o.current&&!x&&(v(!0),b())},[o.current,x]),t.jsx("div",{className:"builder-embed",ref:o,dangerouslySetInnerHTML:{__html:e.content}})}function Y(e){return t.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},c.isEditing()&&e.imgSrc||"default-key")}function Z(e){var S,s,m,x,v,b,d;function o(){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{...o()}}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&&((m=(s=e.builderBlock)==null?void 0:s.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=(x=e.builderBlock)==null?void 0:x.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,(d=(b=e.builderBlock)==null?void 0:b.children)!=null&&d.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 p=r.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{}});function ee(e){var I,P,B,F,T,N,L;const o=r.useRef(null),[g,S]=r.useState(()=>0);r.useState(()=>!0);function s(n){var a,l;const i={...e.builderContextSignal.rootState,...n};e.builderContextSignal.rootSetState?(l=(a=e.builderContextSignal).rootSetState)==null||l.call(a,i):e.builderContextSignal.rootState=i}function m(n){var a,l,u,h,W;const i={...e.builderContextSignal.content,...n,data:{...(a=e.builderContextSignal.content)==null?void 0:a.data,...n==null?void 0:n.data},meta:{...(l=e.builderContextSignal.content)==null?void 0:l.meta,...n==null?void 0:n.meta,breakpoints:((u=n==null?void 0:n.meta)==null?void 0:u.breakpoints)||((W=(h=e.builderContextSignal.content)==null?void 0:h.meta)==null?void 0:W.breakpoints)}};V.postPreviewContent({value:i,key:i.id}).then(()=>{M.refresh()})}r.useState(()=>0);const[x,v]=r.useState(()=>!1),[b,d]=r.useState(()=>e.contentWrapper||"div");function f(n){var a;const{data:i}=n;if(i)switch(i.type){case"builder.configureSdk":{const l=i.data,{breakpoints:u,contentId:h}=l;if(!h||h!==((a=e.builderContextSignal.content)==null?void 0:a.id))return;u&&m({meta:{breakpoints:u}}),S(g+1);break}case"builder.contentUpdate":{const l=i.data,u=l.key||l.alias||l.entry||l.modelName,h=l.data;u===e.model&&(m(h),S(g+1));break}}}function k(){var i,a;const n=(a=(i=e.builderContextSignal.content)==null?void 0:i.data)==null?void 0:a.jsCode;n&&c.evaluate({code:n,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})}const[y,te]=r.useState(()=>({})),[E,K]=r.useState(()=>!1);function q(n){var i,a;if(e.builderContextSignal.content){const l=(i=e.builderContextSignal.content)==null?void 0:i.testVariationId,u=(a=e.builderContextSignal.content)==null?void 0:a.id;c._track({type:"click",canTrack:c.getDefaultCanTrack(e.canTrack),contentId:u,apiKey:e.apiKey,variationId:l!==u?l:void 0,...c.getInteractionPropertiesForEvent(n),unique:!E})}E||K(!0)}function _(n){return n.replace(/{{([^}]+)}}/g,(i,a)=>c.evaluate({code:a,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState}))}function z({url:n,key:i}){c.fetch(n).then(a=>a.json()).then(a=>{var u,h;const l={...e.builderContextSignal.rootState,[i]:a};(h=(u=e.builderContextSignal).rootSetState)==null||h.call(u,l),y[i]=!0}).catch(a=>{console.error("error fetching dynamic data",n,a)})}function j(){var i,a;const n=((a=(i=e.builderContextSignal.content)==null?void 0:i.data)==null?void 0:a.httpRequests)??{};Object.entries(n).forEach(([l,u])=>{if(u&&(!y[l]||c.isEditing())){const h=_(u);z({url:h,key:l})}})}function C(){c.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:c.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function w(n){S(g+1),window.addEventListener("message",f),c.registerInsertMenu(),c.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.includeRefs?{includeRefs:e.includeRefs}:{},...e.enrich?{enrich:e.enrich}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(i=>{var l;const a=c.createRegisterComponentMessage(i);(l=window.parent)==null||l.postMessage(a,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",C)}function R(n){const i=new URL(location.href).searchParams,a=i.get("builder.preview"),l=i.get(`builder.preview.${a}`),u=i.get("apiKey")||i.get("builder.space");a===e.model&&u===e.apiKey&&(!e.content||l===e.content.id)&&c.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(h=>{h&&m(h)})}const M=A.useRouter();return r.useEffect(()=>{var n;return(n=o.current)==null||n.addEventListener("initeditingbldr",w),()=>{var i;return(i=o.current)==null?void 0:i.removeEventListener("initeditingbldr",w)}},[]),r.useEffect(()=>{var n;return(n=o.current)==null||n.addEventListener("initpreviewingbldr",R),()=>{var i;return(i=o.current)==null?void 0:i.removeEventListener("initpreviewingbldr",R)}},[]),r.useEffect(()=>{var n,i;if(c.isBrowser()){if(c.isEditing()&&o.current&&o.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&c.getDefaultCanTrack(e.canTrack)){const l=(n=e.builderContextSignal.content)==null?void 0:n.testVariationId,u=(i=e.builderContextSignal.content)==null?void 0:i.id,h=e.apiKey;c._track({type:"impression",canTrack:!0,contentId:u,apiKey:h,variationId:l!==u?l:void 0})}c.isPreviewing()&&o.current}},[]),r.useEffect(()=>{e.apiKey||c.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),k(),j(),C()},[]),r.useEffect(()=>{},[e.content]),r.useEffect(()=>{c.isBrowser()&&(window.removeEventListener("message",f),window.addEventListener("message",f))},[x]),r.useEffect(()=>{k()},[(P=(I=e.builderContextSignal.content)==null?void 0:I.data)==null?void 0:P.jsCode,e.builderContextSignal.rootState]),r.useEffect(()=>{j()},[(F=(B=e.builderContextSignal.content)==null?void 0:B.data)==null?void 0:F.httpRequests]),r.useEffect(()=>{C()},[e.builderContextSignal.rootState]),r.useEffect(()=>{e.data&&s(e.data)},[e.data]),r.useEffect(()=>{e.locale&&s({locale:e.locale})},[e.locale]),r.useEffect(()=>()=>{c.isBrowser()&&(window.removeEventListener("message",f),window.removeEventListener("builder:component:stateChangeListenerActivated",C))},[]),t.jsx(p.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?t.jsx(t.Fragment,{children:r.createElement(b,{key:g,ref:o,onClick:n=>q(n),"builder-content-id":(T=e.builderContextSignal.content)==null?void 0:T.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},...e.contentWrapperProps,className:`variant-${((N=e.content)==null?void 0:N.testVariationId)||((L=e.content)==null?void 0:L.id)}`},e.children)}):null})}exports.BlockWrapper=U;exports.BlocksWrapper=O;exports.Button=D;exports.CustomCode=Q;exports.Embed=X;exports.EnableEditor=ee;exports.FragmentComponent=J;exports.Image=$;exports.ImgComponent=Y;exports.InteractiveElement=H;exports.SectionComponent=G;exports.Video=Z;
|