@builder.io/sdk-react-nextjs 0.14.7 → 0.14.9

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.
Files changed (40) hide show
  1. package/lib/{node/USE_CLIENT_BUNDLE-04e65a8b.js → browser/USE_CLIENT_BUNDLE-07d1ba4b.js} +205 -212
  2. package/lib/browser/USE_CLIENT_BUNDLE-5b3511d0.cjs +21 -0
  3. package/lib/{edge/USE_SERVER_BUNDLE-536a078a.js → browser/USE_SERVER_BUNDLE-059335ee.js} +1 -1
  4. package/lib/{edge/USE_SERVER_BUNDLE-0165e9c2.cjs → browser/USE_SERVER_BUNDLE-4e489369.cjs} +1 -1
  5. package/lib/browser/{bundle-187b6567.js → bundle-53a4ab4a.js} +92 -88
  6. package/lib/browser/{bundle-f2d9f409.cjs → bundle-9d3cdb5c.cjs} +12 -11
  7. package/lib/browser/index.cjs +1 -1
  8. package/lib/browser/index.mjs +3 -3
  9. package/lib/edge/USE_CLIENT_BUNDLE-0d437014.cjs +21 -0
  10. package/lib/{browser/USE_CLIENT_BUNDLE-f0eac1bb.js → edge/USE_CLIENT_BUNDLE-99299aaa.js} +205 -212
  11. package/lib/{node/USE_SERVER_BUNDLE-dee3041b.js → edge/USE_SERVER_BUNDLE-2d91be32.js} +1 -1
  12. package/lib/{node/USE_SERVER_BUNDLE-6f53d199.cjs → edge/USE_SERVER_BUNDLE-37a2c2d3.cjs} +1 -1
  13. package/lib/edge/{bundle-d26182eb.js → bundle-d76be364.js} +199 -195
  14. package/lib/edge/{bundle-f84983cc.cjs → bundle-da19475d.cjs} +19 -18
  15. package/lib/edge/index.cjs +1 -1
  16. package/lib/edge/index.mjs +3 -3
  17. package/lib/node/USE_CLIENT_BUNDLE-94a936b5.cjs +21 -0
  18. package/lib/{edge/USE_CLIENT_BUNDLE-7cf0df22.js → node/USE_CLIENT_BUNDLE-aa4a4eb2.js} +205 -212
  19. package/lib/{browser/USE_SERVER_BUNDLE-280036e3.js → node/USE_SERVER_BUNDLE-91781c1b.js} +1 -1
  20. package/lib/{browser/USE_SERVER_BUNDLE-ea761ee7.cjs → node/USE_SERVER_BUNDLE-d58e151a.cjs} +1 -1
  21. package/lib/node/{bundle-29f6bee7.js → bundle-49817803.js} +45 -41
  22. package/lib/node/{bundle-b303d0db.cjs → bundle-955ea489.cjs} +8 -7
  23. package/lib/node/index.cjs +1 -1
  24. package/lib/node/index.mjs +3 -3
  25. package/package.json +1 -1
  26. package/types/cjs/components/content/components/enable-editor.d.ts +1 -1
  27. package/types/cjs/components/content/components/styles.d.ts +1 -0
  28. package/types/cjs/components/content/components/styles.helpers.d.ts +1 -0
  29. package/types/cjs/components/content/contentProps.types.d.ts +6 -1
  30. package/types/cjs/components/content-variants/content-variants.d.ts +1 -1
  31. package/types/cjs/constants/sdk-version.d.ts +1 -1
  32. package/types/esm/components/content/components/enable-editor.d.ts +1 -1
  33. package/types/esm/components/content/components/styles.d.ts +1 -0
  34. package/types/esm/components/content/components/styles.helpers.d.ts +1 -0
  35. package/types/esm/components/content/contentProps.types.d.ts +6 -1
  36. package/types/esm/components/content-variants/content-variants.d.ts +1 -1
  37. package/types/esm/constants/sdk-version.d.ts +1 -1
  38. package/lib/browser/USE_CLIENT_BUNDLE-9a694813.cjs +0 -21
  39. package/lib/edge/USE_CLIENT_BUNDLE-bda05805.cjs +0 -21
  40. package/lib/node/USE_CLIENT_BUNDLE-4e14ccee.cjs +0 -21
@@ -0,0 +1,21 @@
1
+ "use client";"use strict";const t=require("react/jsx-runtime"),a=require("./bundle-9d3cdb5c.cjs"),o=require("react"),_=require("./USE_SERVER_BUNDLE-4e489369.cjs"),z=require("next/navigation");function E(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(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children}):t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})}function M(e){return t.jsx(E,{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"}},TagName:e.link?e.builderLinkComponent||"a":"button",actionAttributes:{},children:e.text})}function D(e){return t.jsx(E,{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 V(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 H(e){function r(){var l;return"builder-blocks"+((l=e.blocks)!=null&&l.length?"":" no-blocks")}function m(){var l,b;a.isEditing()&&!((l=e.blocks)!=null&&l.length)&&((b=window.parent)==null||b.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function S(){var l,b;a.isEditing()&&!((l=e.blocks)!=null&&l.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:r()+" props-blocks-wrapper-7cd1560e","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:l=>m(),onMouseEnter:l=>S(),onKeyPress:l=>m(),...e.BlocksWrapperProps,children:e.children}),t.jsx("style",{children:`.props-blocks-wrapper-7cd1560e {
2
+ display: flex;
3
+ flex-direction: column;
4
+ align-items: stretch;
5
+ }`})]})}function U(e){return t.jsx("span",{children:e.children})}function $(e){var l,b,h,x;function r(){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"),a.getSrcSet(d)}else if(e.image&&!e.srcset)return a.getSrcSet(d);return a.getSrcSet(d)}function m(){var g;return(g=r==null?void 0:r())!=null&&g.match(/builder\.io/)&&!e.noWebp?r().replace(/\?/g,"?format=webp&"):""}function S(){const g={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?g:void 0}return t.jsxs(t.Fragment,{children:[t.jsxs(t.Fragment,{children:[t.jsxs("picture",{children:[m()?t.jsx("source",{type:"image/webp",srcSet:m()}):null,t.jsx("img",{loading:"lazy",alt:e.altText,role:e.altText?void 0:"presentation",style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...S()},className:"builder-image"+(e.className?" "+e.className:"")+" img-a0c95e8c",src:e.image,srcSet:r(),sizes:e.sizes})]}),e.aspectRatio&&!((b=(l=e.builderBlock)==null?void 0:l.children)!=null&&b.length&&e.fitContent)?t.jsx("div",{className:"builder-image-sizer div-a0c95e8c",style:{paddingTop:e.aspectRatio*100+"%"}}):null,(x=(h=e.builderBlock)==null?void 0:h.children)!=null&&x.length&&e.fitContent?t.jsx(t.Fragment,{children:e.children}):null,!e.fitContent&&e.children?t.jsx("div",{className:"div-a0c95e8c-2",children:e.children}):null]}),t.jsx("style",{children:`.img-a0c95e8c {
6
+ opacity: 1;
7
+ transition: opacity 0.2s ease-in-out;
8
+ }.div-a0c95e8c {
9
+ width: 100%;
10
+ pointer-events: none;
11
+ font-size: 0;
12
+ }.div-a0c95e8c-2 {
13
+ display: flex;
14
+ flex-direction: column;
15
+ align-items: stretch;
16
+ position: absolute;
17
+ top: 0;
18
+ left: 0;
19
+ width: 100%;
20
+ height: 100%;
21
+ }`})]})}function O(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 J(e){const r=o.useRef(null),[m,S]=o.useState(()=>[]),[l,b]=o.useState(()=>[]);return o.useEffect(()=>{var x;if(!((x=r.current)!=null&&x.getElementsByTagName)||typeof window>"u")return;const h=r.current.getElementsByTagName("script");for(let g=0;g<h.length;g++){const d=h[g];if(d.src){if(m.includes(d.src))continue;m.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(l.includes(d.innerText))continue;try{l.push(d.innerText),new Function(d.innerText)()}catch(f){console.warn("`CustomCode`: Error running script:",f)}}}},[]),t.jsx("div",{ref:r,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}function G(e){const r=o.useRef(null),[m,S]=o.useState(()=>[]),[l,b]=o.useState(()=>[]),[h,x]=o.useState(()=>!1);function g(){if(!r.current||!r.current.getElementsByTagName)return;const d=r.current.getElementsByTagName("script");for(let f=0;f<d.length;f++){const k=d[f];if(k.src&&!m.includes(k.src)){m.push(k.src);const y=document.createElement("script");y.async=!0,y.src=k.src,document.head.appendChild(y)}else if(a.isJsScript(k)&&!l.includes(k.innerText))try{l.push(k.innerText),new Function(k.innerText)()}catch(y){console.warn("`Embed`: Error running script:",y)}}}return o.useEffect(()=>{r.current&&!h&&(x(!0),g())},[r.current,h]),t.jsx("div",{className:"builder-embed",ref:r,dangerouslySetInnerHTML:{__html:e.content}})}function Q(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 X(e){var S,l,b,h,x,g,d;function r(){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 m(){return{...r()}}return t.jsxs("div",{style:{position:"relative"},children:[t.jsx("video",{className:"builder-video",...m(),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=(l=e.builderBlock)==null?void 0:l.children)!=null&&b.length))?t.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}}):null,(x=(h=e.builderBlock)==null?void 0:h.children)!=null&&x.length&&e.fitContent?t.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children}):null,(d=(g=e.builderBlock)==null?void 0:g.children)!=null&&d.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 Y=o.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{}});function Z(e){var R,P,T,B,N,L,F;const r=o.useRef(null);function m(i){var c,s;const n={...e.builderContextSignal.rootState,...i};e.builderContextSignal.rootSetState?(s=(c=e.builderContextSignal).rootSetState)==null||s.call(c,n):e.builderContextSignal.rootState=n}function S(i){var c,s,u,v,W;const n={...e.builderContextSignal.content,...i,data:{...(c=e.builderContextSignal.content)==null?void 0:c.data,...i==null?void 0:i.data},meta:{...(s=e.builderContextSignal.content)==null?void 0:s.meta,...i==null?void 0:i.meta,breakpoints:((u=i==null?void 0:i.meta)==null?void 0:u.breakpoints)||((W=(v=e.builderContextSignal.content)==null?void 0:v.meta)==null?void 0:W.breakpoints)}};_.postPreviewContent({value:n,key:n.id}).then(()=>{q.refresh()})}const[l,b]=o.useState(()=>e.contentWrapper||"div");function h(i){return a.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:n=>{var u;const{breakpoints:c,contentId:s}=n;!s||s!==((u=e.builderContextSignal.content)==null?void 0:u.id)||c&&S({meta:{breakpoints:c}})},animation:n=>{a.triggerAnimation(n)},contentUpdate:n=>{S(n)}}})(i)}function x(){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,enableCache:!1})}const[g,d]=o.useState(()=>({})),[f,k]=o.useState(()=>!1);function y(i){var n,c;if(e.builderContextSignal.content){const s=(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:s!==u?s:void 0,...a.getInteractionPropertiesForEvent(i),unique:!f})}f||k(!0)}function A(i){return i.replace(/{{([^}]+)}}/g,(n,c)=>String(a.evaluate({code:c,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!0})))}function K({url:i,key:n}){a.fetch(i).then(c=>c.json()).then(c=>{var u,v;const s={...e.builderContextSignal.rootState,[n]:c};(v=(u=e.builderContextSignal).rootSetState)==null||v.call(u,s),g[n]=!0}).catch(c=>{console.error("error fetching dynamic data",i,c)})}function j(){var n,c;const i=((c=(n=e.builderContextSignal.content)==null?void 0:n.data)==null?void 0:c.httpRequests)??{};Object.entries(i).forEach(([s,u])=>{if(u&&(!g[s]||a.isEditing())){const v=A(u);K({url:v,key:s})}})}function C(){a.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:a.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function w(i){window.addEventListener("message",h),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 s;const c=a.createRegisterComponentMessage(n);(s=window.parent)==null||s.postMessage(c,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",C)}function I(i){const n=new URL(location.href).searchParams,c=n.get("builder.preview"),s=n.get(`builder.preview.${c}`),u=n.get("apiKey")||n.get("builder.space");c===e.model&&u===e.apiKey&&(!e.content||s===e.content.id)&&a.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(v=>{v&&S(v)})}const q=z.useRouter();return o.useEffect(()=>{var i;return(i=r.current)==null||i.addEventListener("initeditingbldr",w),()=>{var n;return(n=r.current)==null?void 0:n.removeEventListener("initeditingbldr",w)}},[]),o.useEffect(()=>{var i;return(i=r.current)==null||i.addEventListener("initpreviewingbldr",I),()=>{var n;return(n=r.current)==null?void 0:n.removeEventListener("initpreviewingbldr",I)}},[]),o.useEffect(()=>{var i,n;if(a.isBrowser()){if(a.isEditing()&&r.current&&r.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&a.getDefaultCanTrack(e.canTrack)){const s=(i=e.builderContextSignal.content)==null?void 0:i.testVariationId,u=(n=e.builderContextSignal.content)==null?void 0:n.id,v=e.apiKey;a._track({type:"impression",canTrack:!0,contentId:u,apiKey:v,variationId:s!==u?s:void 0})}a.isPreviewing()}},[]),o.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."),x(),j(),C()},[]),o.useEffect(()=>{},[e.content]),o.useEffect(()=>{x()},[(P=(R=e.builderContextSignal.content)==null?void 0:R.data)==null?void 0:P.jsCode]),o.useEffect(()=>{j()},[(B=(T=e.builderContextSignal.content)==null?void 0:T.data)==null?void 0:B.httpRequests]),o.useEffect(()=>{C()},[e.builderContextSignal.rootState]),o.useEffect(()=>{e.data&&m(e.data)},[e.data]),o.useEffect(()=>{e.locale&&m({locale:e.locale})},[e.locale]),o.useEffect(()=>()=>{a.isBrowser()&&(window.removeEventListener("message",h),window.removeEventListener("builder:component:stateChangeListenerActivated",C))},[]),t.jsx(Y.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?t.jsx(l,{ref:r,onClick:i=>y(i),"builder-content-id":(N=e.builderContextSignal.content)==null?void 0:N.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},...e.contentWrapperProps,className:`variant-${((L=e.content)==null?void 0:L.testVariationId)||((F=e.content)==null?void 0:F.id)}`,children:e.children}):null})}exports.BlockWrapper=D;exports.BlocksWrapper=H;exports.Button=M;exports.CustomCode=J;exports.DynamicRenderer=E;exports.Embed=G;exports.EnableEditor=Z;exports.FragmentComponent=U;exports.Image=$;exports.ImgComponent=Q;exports.InteractiveElement=V;exports.SectionComponent=O;exports.Video=X;
@@ -1,5 +1,5 @@
1
1
  "use server";
2
- import { v as s } from "./bundle-d26182eb.js";
2
+ import { v as s } from "./bundle-53a4ab4a.js";
3
3
  async function n({
4
4
  key: t,
5
5
  value: r
@@ -1 +1 @@
1
- "use server";"use strict";const n=require("./bundle-f84983cc.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
+ "use server";"use strict";const n=require("./bundle-9d3cdb5c.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,9 +1,9 @@
1
1
  import { jsx as l, Fragment as v, jsxs as R } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { LRUCache as We } from "lru-cache";
4
- import { I as Oe, B as $e, a as Ne, D as Fe, C as Le, E as Ue, b as _e, V as De, c as Me, F as je, d as He, S as Ke, e as ze } from "./USE_CLIENT_BUNDLE-f0eac1bb.js";
4
+ import { I as Oe, B as $e, a as Ne, D as Fe, C as Le, E as Ue, b as De, V as _e, c as Me, F as je, d as He, S as Ke, e as ze } from "./USE_CLIENT_BUNDLE-07d1ba4b.js";
5
5
  import "next/navigation";
6
- const qe = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), ro = (e) => typeof e == "string" && qe.has(e.toLowerCase()), T = "rsc", M = () => {
6
+ const qe = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), so = (e) => typeof e == "string" && qe.has(e.toLowerCase()), T = "rsc", M = () => {
7
7
  switch (T) {
8
8
  case "react":
9
9
  case "reactNative":
@@ -16,7 +16,7 @@ const qe = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr",
16
16
  return "class";
17
17
  }
18
18
  };
19
- function Ge(e) {
19
+ function Ye(e) {
20
20
  var t;
21
21
  return {
22
22
  ...(t = e.component) == null ? void 0 : t.options,
@@ -36,17 +36,17 @@ const A = "[Builder.io]: ", x = {
36
36
  function S() {
37
37
  return typeof window < "u" && typeof document < "u";
38
38
  }
39
- const Je = (e) => {
39
+ const Ge = (e) => {
40
40
  const t = {};
41
41
  return e.forEach((n, o) => {
42
42
  t[o] = n;
43
43
  }), t;
44
- }, le = (e) => e instanceof URLSearchParams ? Je(e) : e, de = (e) => typeof e == "string" ? e : e instanceof URLSearchParams ? e.toString() : new URLSearchParams(e).toString();
45
- function Ye() {
44
+ }, le = (e) => e instanceof URLSearchParams ? Ge(e) : e, de = (e) => typeof e == "string" ? e : e instanceof URLSearchParams ? e.toString() : new URLSearchParams(e).toString();
45
+ function Je() {
46
46
  return S() && window.self !== window.top;
47
47
  }
48
48
  function j(e) {
49
- return Ye() && de(e || window.location.search).indexOf("builder.frameEditing=") !== -1;
49
+ return Je() && de(e || window.location.search).indexOf("builder.frameEditing=") !== -1;
50
50
  }
51
51
  const Qe = () => {
52
52
  if (S()) {
@@ -99,7 +99,7 @@ const Qe = () => {
99
99
  getUserAttributes: () => ue()
100
100
  }), tt = (e, {
101
101
  isExpression: t = !0
102
- }) => /* we disable this for cases where we definitely don't want a return */ t && !(e.includes(";") || e.includes(" return ") || e.trim().startsWith("return ")) ? `return (${e});` : e, J = ({
102
+ }) => /* we disable this for cases where we definitely don't want a return */ t && !(e.includes(";") || e.includes(" return ") || e.trim().startsWith("return ")) ? `return (${e});` : e, G = ({
103
103
  code: e,
104
104
  builder: t,
105
105
  context: n,
@@ -156,7 +156,7 @@ const ot = () => {
156
156
  return !1;
157
157
  const e = process.arch === "arm64", t = process.version.startsWith("v20"), n = (o = process.env.NODE_OPTIONS) == null ? void 0 : o.includes("--no-node-snapshot");
158
158
  return e && t && !n ? (x.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "), !0) : !1;
159
- }, it = (e) => (S() || ot(), J(e)), H = class P {
159
+ }, it = (e) => (S() || ot(), G(e)), H = class P {
160
160
  static getCacheKey(t) {
161
161
  return JSON.stringify({
162
162
  ...t,
@@ -389,7 +389,7 @@ const ut = ({
389
389
  default: 991,
390
390
  max: 1200
391
391
  }
392
- }, Y = (e, t = pe) => `@media (max-width: ${t[e].max}px)`, ge = ({
392
+ }, J = (e, t = pe) => `@media (max-width: ${t[e].max}px)`, ge = ({
393
393
  small: e,
394
394
  medium: t
395
395
  }) => {
@@ -450,14 +450,14 @@ function ft(e) {
450
450
  }) : "", b = d ? L({
451
451
  className: u,
452
452
  styles: d,
453
- mediaQuery: Y(
453
+ mediaQuery: J(
454
454
  "medium",
455
455
  s
456
456
  )
457
457
  }) : "", h = p ? L({
458
458
  className: u,
459
459
  styles: p,
460
- mediaQuery: Y(
460
+ mediaQuery: J(
461
461
  "small",
462
462
  s
463
463
  )
@@ -479,7 +479,7 @@ const pt = (e) => `on${ht(e)}`, gt = (e, t) => (n) => K({
479
479
  isExpression: !1,
480
480
  enableCache: !0
481
481
  });
482
- function ao(e) {
482
+ function co(e) {
483
483
  const t = {}, n = e.block.actions ?? {};
484
484
  for (const o in n) {
485
485
  if (!n.hasOwnProperty(o))
@@ -640,7 +640,7 @@ function F(e) {
640
640
  blockChildren: o().children ?? [],
641
641
  componentRef: (f = t()) == null ? void 0 : f.component,
642
642
  componentOptions: {
643
- ...Ge(o()),
643
+ ...Ye(o()),
644
644
  builderContext: e.context,
645
645
  ...((b = t()) == null ? void 0 : b.name) === "Core:Button" || ((h = t()) == null ? void 0 : h.name) === "Symbol" || ((m = t()) == null ? void 0 : m.name) === "Columns" || ((y = t()) == null ? void 0 : y.name) === "Form:Form" ? {
646
646
  builderLinkComponent: e.linkComponent
@@ -892,7 +892,7 @@ function wt(e, t) {
892
892
  }
893
893
  return null;
894
894
  }
895
- function so(e) {
895
+ function lo(e) {
896
896
  if (!e)
897
897
  return e;
898
898
  const t = [100, 200, 400, 800, 1200, 1600, 2e3];
@@ -1378,7 +1378,7 @@ const It = (e) => {
1378
1378
  advanced: !0,
1379
1379
  defaultValue: 0.7041
1380
1380
  }]
1381
- }, _t = {
1381
+ }, Dt = {
1382
1382
  name: "Core:Section",
1383
1383
  static: !0,
1384
1384
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -1417,7 +1417,7 @@ const It = (e) => {
1417
1417
  }
1418
1418
  }
1419
1419
  }]
1420
- }, Dt = {
1420
+ }, _t = {
1421
1421
  name: "Slot",
1422
1422
  isRSC: !0,
1423
1423
  description: "Allow child blocks to be inserted into this content when used as a Symbol",
@@ -1566,7 +1566,7 @@ const zt = {
1566
1566
  defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
1567
1567
  hideFromUI: !0
1568
1568
  }]
1569
- }, Gt = ["text/javascript", "application/javascript", "application/ecmascript"], co = (e) => Gt.includes(e.type), Jt = {
1569
+ }, Yt = ["text/javascript", "application/javascript", "application/ecmascript"], uo = (e) => Yt.includes(e.type), Gt = {
1570
1570
  // friendlyName?
1571
1571
  name: "Raw:Img",
1572
1572
  hideFromInsertMenu: !0,
@@ -1580,7 +1580,7 @@ const zt = {
1580
1580
  }],
1581
1581
  noWrap: !0,
1582
1582
  static: !0
1583
- }, Yt = {
1583
+ }, Jt = {
1584
1584
  name: "Video",
1585
1585
  canHaveChildren: !0,
1586
1586
  defaultStyles: {
@@ -1667,12 +1667,12 @@ const zt = {
1667
1667
  }, {
1668
1668
  component: Ue,
1669
1669
  ...qt
1670
+ }, {
1671
+ component: De,
1672
+ ...Gt
1670
1673
  }, {
1671
1674
  component: _e,
1672
1675
  ...Jt
1673
- }, {
1674
- component: De,
1675
- ...Yt
1676
1676
  }], Z = () => [{
1677
1677
  component: Me,
1678
1678
  ...Nt
@@ -1687,23 +1687,23 @@ const zt = {
1687
1687
  ...Ut
1688
1688
  }, {
1689
1689
  component: Ke,
1690
- ..._t
1690
+ ...Dt
1691
1691
  }, {
1692
1692
  component: Mt,
1693
- ...Dt
1693
+ ..._t
1694
1694
  }, {
1695
- component: Xn,
1695
+ component: eo,
1696
1696
  ...jt
1697
1697
  }, {
1698
1698
  component: Kt,
1699
1699
  ...Ht
1700
- }, ...Qt()], lo = (e) => ({
1700
+ }, ...Qt()], mo = (e) => ({
1701
1701
  type: "builder.registerComponent",
1702
- data: _(e)
1702
+ data: D(e)
1703
1703
  }), Xt = (e) => {
1704
1704
  const t = e.toString().trim();
1705
1705
  return `return (${!t.startsWith("function") && !t.startsWith("(") ? "function " : ""}${t}).apply(this, arguments)`;
1706
- }, Zt = (e) => typeof e == "function" ? Xt(e) : $(e), _ = ({
1706
+ }, Zt = (e) => typeof e == "function" ? Xt(e) : $(e), D = ({
1707
1707
  inputs: e,
1708
1708
  ...t
1709
1709
  }) => ({
@@ -1821,7 +1821,7 @@ const zt = {
1821
1821
  }) => `window.${we}(
1822
1822
  "${t}", "${e}", ${Ie}
1823
1823
  )`;
1824
- function D(e) {
1824
+ function _(e) {
1825
1825
  return /* @__PURE__ */ l(
1826
1826
  "script",
1827
1827
  {
@@ -1884,7 +1884,7 @@ const hn = "v3", ee = "builder.", pn = "options.", Te = (e) => {
1884
1884
  return {};
1885
1885
  const e = new URLSearchParams(window.location.search);
1886
1886
  return Te(e);
1887
- }, te = (e) => typeof e == "number" && !isNaN(e) && e >= 0, G = (e) => {
1887
+ }, te = (e) => typeof e == "number" && !isNaN(e) && e >= 0, Y = (e) => {
1888
1888
  const {
1889
1889
  limit: t = 30,
1890
1890
  userAttributes: n,
@@ -1937,9 +1937,9 @@ async function Ee(e) {
1937
1937
  return t && t[0] || null;
1938
1938
  }
1939
1939
  const yn = async (e) => {
1940
- const t = G(e);
1940
+ const t = Y(e);
1941
1941
  return await (await fn(t.href)).json();
1942
- }, Sn = async (e, t, n = G(e)) => {
1942
+ }, Sn = async (e, t, n = Y(e)) => {
1943
1943
  const o = U(e.canTrack);
1944
1944
  if (n.search.includes("preview=")) {
1945
1945
  const r = [];
@@ -1966,7 +1966,7 @@ const yn = async (e) => {
1966
1966
  };
1967
1967
  async function kn(e) {
1968
1968
  try {
1969
- const t = G(e), n = await yn(e);
1969
+ const t = Y(e), n = await yn(e);
1970
1970
  return bn(n) ? Sn(e, n) : (x.error("Error fetching data. ", {
1971
1971
  url: t,
1972
1972
  content: n,
@@ -1976,7 +1976,7 @@ async function kn(e) {
1976
1976
  return x.error("Error fetching data. ", t), null;
1977
1977
  }
1978
1978
  }
1979
- function uo(e) {
1979
+ function fo(e) {
1980
1980
  if (!S())
1981
1981
  return !1;
1982
1982
  const t = de(e || window.location.search);
@@ -2120,7 +2120,7 @@ async function Bn(e) {
2120
2120
  console.error("Failed to track: ", t);
2121
2121
  });
2122
2122
  }
2123
- const mo = (e) => Bn({
2123
+ const ho = (e) => Bn({
2124
2124
  ...e,
2125
2125
  canTrack: !0
2126
2126
  });
@@ -2150,7 +2150,7 @@ const Wn = (e, t, n = !0) => {
2150
2150
  x: r,
2151
2151
  y: a
2152
2152
  };
2153
- }, fo = (e) => {
2153
+ }, po = (e) => {
2154
2154
  const t = e.target, n = t && On(t), o = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
2155
2155
  return {
2156
2156
  targetBuilderElement: o || void 0,
@@ -2171,7 +2171,7 @@ function Be(e, t) {
2171
2171
  const n = new URL(t.origin), o = n.hostname;
2172
2172
  return (e || $n).findIndex((i) => i.startsWith("*.") ? o.endsWith(i.slice(1)) : i === o) > -1;
2173
2173
  }
2174
- const Nn = "0.14.7", ie = {};
2174
+ const Nn = "0.14.9", ie = {};
2175
2175
  function Fn(e, t) {
2176
2176
  let n = ie[e];
2177
2177
  if (n || (n = ie[e] = []), n.push(t), S()) {
@@ -2189,7 +2189,7 @@ function Fn(e, t) {
2189
2189
  }
2190
2190
  }
2191
2191
  }
2192
- const ho = () => {
2192
+ const go = () => {
2193
2193
  Fn("insertMenu", {
2194
2194
  name: "_default",
2195
2195
  default: !0,
@@ -2300,7 +2300,7 @@ const Ln = (e = {}) => {
2300
2300
  break;
2301
2301
  }
2302
2302
  }
2303
- }, po = (e, t, n) => {
2303
+ }, bo = (e, t, n) => {
2304
2304
  if (!S)
2305
2305
  return x.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."), () => {
2306
2306
  };
@@ -2330,8 +2330,8 @@ function ae(e, ...t) {
2330
2330
  }
2331
2331
  return n;
2332
2332
  }
2333
- const _n = (e) => e ? e.replace(/([A-Z])/g, (t) => `-${t[0].toLowerCase()}`) : "";
2334
- function Dn(e) {
2333
+ const Dn = (e) => e ? e.replace(/([A-Z])/g, (t) => `-${t[0].toLowerCase()}`) : "";
2334
+ function _n(e) {
2335
2335
  console.warn(`Cannot animate element: element with ID ${e} not found!`);
2336
2336
  }
2337
2337
  function Mn(e, t) {
@@ -2347,15 +2347,15 @@ function jn(e) {
2347
2347
  t.indexOf(o) === -1 && t.push(o);
2348
2348
  return t;
2349
2349
  }
2350
- function go(e) {
2350
+ function yo(e) {
2351
2351
  const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
2352
2352
  if (!t.length) {
2353
- Dn(e.elementId || e.id || "");
2353
+ _n(e.elementId || e.id || "");
2354
2354
  return;
2355
2355
  }
2356
2356
  Array.from(t).forEach((n) => {
2357
2357
  Mn(e, n), n.style.transition = "none", n.style.transitionDelay = "0", ae(n.style, e.steps[0].styles), setTimeout(() => {
2358
- n.style.transition = `all ${e.duration}s ${_n(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s"), ae(n.style, e.steps[1].styles), setTimeout(() => {
2358
+ n.style.transition = `all ${e.duration}s ${Dn(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s"), ae(n.style, e.steps[1].styles), setTimeout(() => {
2359
2359
  n.style.transition = "", n.style.transitionDelay = "";
2360
2360
  }, (e.delay || 0) * 1e3 + e.duration * 1e3 + 100);
2361
2361
  });
@@ -2395,17 +2395,7 @@ font-weight: ${a};
2395
2395
  }, zn = ({
2396
2396
  cssCode: e,
2397
2397
  contentId: t
2398
- }) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "";
2399
- function qn(e) {
2400
- const t = `
2401
- ${zn({
2402
- cssCode: e.cssCode,
2403
- contentId: e.contentId
2404
- })}
2405
- ${Kn({
2406
- customFonts: e.customFonts
2407
- })}
2408
-
2398
+ }) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "", qn = `
2409
2399
  .builder-button {
2410
2400
  all: unset;
2411
2401
  }
@@ -2422,10 +2412,21 @@ ${Kn({
2422
2412
  text-align: inherit;
2423
2413
  font-family: inherit;
2424
2414
  }
2415
+ `, Yn = (e) => e ? "" : qn;
2416
+ function Gn(e) {
2417
+ const t = `
2418
+ ${zn({
2419
+ cssCode: e.cssCode,
2420
+ contentId: e.contentId
2421
+ })}
2422
+ ${Kn({
2423
+ customFonts: e.customFonts
2424
+ })}
2425
+ ${Yn(e.isNestedRender)}
2425
2426
  `.trim();
2426
2427
  return /* @__PURE__ */ l(N, { styles: t });
2427
2428
  }
2428
- const Gn = ({
2429
+ const Jn = ({
2429
2430
  content: e,
2430
2431
  data: t,
2431
2432
  locale: n
@@ -2442,7 +2443,7 @@ const Gn = ({
2442
2443
  locale: n
2443
2444
  } : {}
2444
2445
  };
2445
- }, Jn = ({
2446
+ }, Qn = ({
2446
2447
  content: e,
2447
2448
  data: t
2448
2449
  }) => e ? {
@@ -2468,17 +2469,17 @@ function se(e) {
2468
2469
  ...b,
2469
2470
  [m.name]: {
2470
2471
  component: h,
2471
- ..._(m)
2472
+ ...D(m)
2472
2473
  }
2473
2474
  }),
2474
2475
  {}
2475
2476
  ), o = {
2476
- content: Jn({
2477
+ content: Qn({
2477
2478
  content: e.content,
2478
2479
  data: e.data
2479
2480
  }),
2480
2481
  localState: void 0,
2481
- rootState: Gn({
2482
+ rootState: Jn({
2482
2483
  content: e.content,
2483
2484
  data: e.data,
2484
2485
  locale: e.locale
@@ -2493,7 +2494,7 @@ function se(e) {
2493
2494
  ].reduce(
2494
2495
  (b, { component: h, ...m }) => ({
2495
2496
  ...b,
2496
- [m.name]: _(m)
2497
+ [m.name]: D(m)
2497
2498
  }),
2498
2499
  {}
2499
2500
  ),
@@ -2519,10 +2520,11 @@ function se(e) {
2519
2520
  linkComponent: e.linkComponent,
2520
2521
  trustedHosts: e.trustedHosts,
2521
2522
  children: [
2522
- e.isSsrAbTest ? /* @__PURE__ */ l(D, { scriptStr: t }) : null,
2523
+ e.isSsrAbTest ? /* @__PURE__ */ l(_, { scriptStr: t }) : null,
2523
2524
  /* @__PURE__ */ l(
2524
- qn,
2525
+ Gn,
2525
2526
  {
2527
+ isNestedRender: e.isNestedRender,
2526
2528
  contentId: (a = o.content) == null ? void 0 : a.id,
2527
2529
  cssCode: (c = (s = o.content) == null ? void 0 : s.data) == null ? void 0 : c.cssCode,
2528
2530
  customFonts: (p = (d = o.content) == null ? void 0 : d.data) == null ? void 0 : p.customFonts
@@ -2541,7 +2543,7 @@ function se(e) {
2541
2543
  }
2542
2544
  );
2543
2545
  }
2544
- function Yn(e) {
2546
+ function Xn(e) {
2545
2547
  var r, a;
2546
2548
  const t = nn({
2547
2549
  canTrack: U(e.canTrack),
@@ -2568,7 +2570,7 @@ function Yn(e) {
2568
2570
  });
2569
2571
  };
2570
2572
  return /* @__PURE__ */ R(v, { children: [
2571
- !e.__isNestedRender && T !== "reactNative" ? /* @__PURE__ */ l(D, { scriptStr: rn() }) : null,
2573
+ !e.isNestedRender && T !== "reactNative" ? /* @__PURE__ */ l(_, { scriptStr: rn() }) : null,
2572
2574
  t ? /* @__PURE__ */ R(v, { children: [
2573
2575
  /* @__PURE__ */ l(
2574
2576
  N,
@@ -2577,10 +2579,11 @@ function Yn(e) {
2577
2579
  styles: o()
2578
2580
  }
2579
2581
  ),
2580
- /* @__PURE__ */ l(D, { scriptStr: n() }),
2582
+ /* @__PURE__ */ l(_, { scriptStr: n() }),
2581
2583
  (a = B(e.content)) == null ? void 0 : a.map((s) => /* @__PURE__ */ l(
2582
2584
  se,
2583
2585
  {
2586
+ isNestedRender: e.isNestedRender,
2584
2587
  content: s,
2585
2588
  showContent: !1,
2586
2589
  model: e.model,
@@ -2606,6 +2609,7 @@ function Yn(e) {
2606
2609
  /* @__PURE__ */ l(
2607
2610
  se,
2608
2611
  {
2612
+ isNestedRender: e.isNestedRender,
2609
2613
  content: i(),
2610
2614
  showContent: !0,
2611
2615
  model: e.model,
@@ -2628,7 +2632,7 @@ function Yn(e) {
2628
2632
  )
2629
2633
  ] });
2630
2634
  }
2631
- const Qn = async ({
2635
+ const Zn = async ({
2632
2636
  builderContextValue: e,
2633
2637
  symbol: t
2634
2638
  }) => {
@@ -2647,7 +2651,7 @@ const Qn = async ({
2647
2651
  x.error("Could not fetch symbol content: ", n);
2648
2652
  });
2649
2653
  };
2650
- async function Xn(e) {
2654
+ async function eo(e) {
2651
2655
  var o, i, r, a, s;
2652
2656
  const t = function() {
2653
2657
  var d, p;
@@ -2657,14 +2661,14 @@ async function Xn(e) {
2657
2661
  (d = e.symbol) != null && d.inline ? "builder-inline-symbol" : void 0,
2658
2662
  (p = e.symbol) != null && p.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
2659
2663
  ].filter(Boolean).join(" ");
2660
- }, n = ((o = e.symbol) == null ? void 0 : o.content) || await Qn({
2664
+ }, n = ((o = e.symbol) == null ? void 0 : o.content) || await Zn({
2661
2665
  symbol: e.symbol,
2662
2666
  builderContextValue: e.builderContext
2663
2667
  });
2664
2668
  return /* @__PURE__ */ l("div", { ...e.attributes, className: t(), children: /* @__PURE__ */ l(
2665
- Yn,
2669
+ Xn,
2666
2670
  {
2667
- __isNestedRender: !0,
2671
+ isNestedRender: !0,
2668
2672
  apiVersion: e.builderContext.apiVersion,
2669
2673
  apiKey: e.builderContext.apiKey,
2670
2674
  context: {
@@ -2686,7 +2690,7 @@ async function Xn(e) {
2686
2690
  ) });
2687
2691
  }
2688
2692
  const ce = {};
2689
- function bo(e) {
2693
+ function So(e) {
2690
2694
  if (S()) {
2691
2695
  Object.assign(ce, e);
2692
2696
  const t = {
@@ -2696,7 +2700,7 @@ function bo(e) {
2696
2700
  parent.postMessage(t, "*");
2697
2701
  }
2698
2702
  }
2699
- const yo = async (e) => {
2703
+ const ko = async (e) => {
2700
2704
  var o, i, r;
2701
2705
  const t = e.path || ((o = e.url) == null ? void 0 : o.pathname) || ((i = e.userAttributes) == null ? void 0 : i.urlPath), n = {
2702
2706
  ...e,
@@ -2717,40 +2721,40 @@ const yo = async (e) => {
2717
2721
  };
2718
2722
  };
2719
2723
  export {
2720
- mo as A,
2724
+ ho as A,
2721
2725
  z as B,
2722
2726
  xt as C,
2723
- po as D,
2724
- yo as E,
2727
+ bo as D,
2728
+ ko as E,
2725
2729
  Sn as F,
2726
2730
  kn as G,
2727
- Xn as S,
2731
+ eo as S,
2728
2732
  Kt as T,
2729
2733
  Bn as _,
2730
2734
  St as a,
2731
- ao as b,
2735
+ co as b,
2732
2736
  j as c,
2733
- so as d,
2734
- co as e,
2737
+ lo as d,
2738
+ uo as e,
2735
2739
  S as f,
2736
2740
  M as g,
2737
2741
  U as h,
2738
- ro as i,
2739
- uo as j,
2742
+ so as i,
2743
+ fo as j,
2740
2744
  Un as k,
2741
2745
  x as l,
2742
2746
  K as m,
2743
- fo as n,
2747
+ po as n,
2744
2748
  $ as o,
2745
- lo as p,
2749
+ mo as p,
2746
2750
  Ee as q,
2747
- ho as r,
2751
+ go as r,
2748
2752
  Ln as s,
2749
- go as t,
2753
+ yo as t,
2750
2754
  fn as u,
2751
2755
  ln as v,
2752
- Yn as w,
2756
+ Xn as w,
2753
2757
  Fn as x,
2754
- bo as y,
2758
+ So as y,
2755
2759
  Te as z
2756
2760
  };