@builder.io/sdk-react 3.0.2 → 3.0.3

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 (66) hide show
  1. package/lib/browser/blocks-exports.cjs +23 -23
  2. package/lib/browser/blocks-exports.mjs +284 -283
  3. package/lib/browser/index.cjs +1 -1
  4. package/lib/browser/index.mjs +1 -1
  5. package/lib/browser/{server-entry-75ce8600.cjs → server-entry-5eafc5bd.cjs} +1 -1
  6. package/lib/browser/{server-entry-a2495a20.js → server-entry-c904f136.js} +1 -1
  7. package/lib/browser/server-entry.cjs +1 -1
  8. package/lib/browser/server-entry.mjs +1 -1
  9. package/lib/edge/accordion-032726a7.cjs +1 -0
  10. package/lib/edge/{accordion-c020e15b.js → accordion-c786f197.js} +17 -16
  11. package/lib/edge/{blocks-27ac5b23.js → blocks-105e50e5.js} +4 -4
  12. package/lib/edge/{blocks-cd946d16.cjs → blocks-827b0a87.cjs} +8 -8
  13. package/lib/edge/blocks-exports.cjs +1 -1
  14. package/lib/edge/blocks-exports.mjs +2 -2
  15. package/lib/edge/{button-8572fca5.cjs → button-5cbfe22c.cjs} +1 -1
  16. package/lib/edge/{button-5cdb4f26.js → button-f0e0ea72.js} +2 -2
  17. package/lib/edge/{columns-3ac1fa96.js → columns-9e187314.js} +12 -12
  18. package/lib/edge/{columns-c8a9cb89.cjs → columns-d07da61d.cjs} +2 -2
  19. package/lib/edge/{content-variants-caa23bf7.cjs → content-variants-0db90715.cjs} +6 -6
  20. package/lib/edge/{content-variants-23c8eec6.js → content-variants-59dc0824.js} +10 -10
  21. package/lib/edge/{custom-code-6d9730ff.cjs → custom-code-8119ea3f.cjs} +1 -1
  22. package/lib/edge/{form-3d9bf265.cjs → form-79639135.cjs} +1 -1
  23. package/lib/edge/{form-7fc5691b.js → form-7a7b98cf.js} +13 -13
  24. package/lib/edge/{get-class-prop-name-a4845b04.js → get-class-prop-name-6b143ec7.js} +1 -1
  25. package/lib/edge/{get-class-prop-name-29fd576a.cjs → get-class-prop-name-8fb0e5ad.cjs} +1 -1
  26. package/lib/edge/{image-5c9e156f.js → image-2a2b26d2.js} +6 -6
  27. package/lib/edge/{image-94922c87.cjs → image-4db81d72.cjs} +3 -3
  28. package/lib/edge/{img-388698cb.js → img-2c4c6b78.js} +1 -1
  29. package/lib/edge/{img-102acaa2.cjs → img-72bf9d21.cjs} +1 -1
  30. package/lib/edge/index.cjs +1 -1
  31. package/lib/edge/index.mjs +1 -1
  32. package/lib/edge/{input-10e350a9.cjs → input-6eca8427.cjs} +1 -1
  33. package/lib/edge/{input-5484e9e7.js → input-752f3ce9.js} +1 -1
  34. package/lib/edge/{select-f11be7a7.cjs → select-49a73a0b.cjs} +1 -1
  35. package/lib/edge/{select-b8406bcf.js → select-a1d6e80e.js} +1 -1
  36. package/lib/edge/{server-entry-7ce03a4e.js → server-entry-35f12729.js} +1 -1
  37. package/lib/edge/{server-entry-1879cbc4.cjs → server-entry-6b2058e2.cjs} +1 -1
  38. package/lib/edge/server-entry.cjs +1 -1
  39. package/lib/edge/server-entry.mjs +1 -1
  40. package/lib/edge/{slot-4ab390ec.cjs → slot-2327e009.cjs} +1 -1
  41. package/lib/edge/{slot-23f75377.js → slot-b9bcbd41.js} +3 -3
  42. package/lib/edge/{symbol-2eafb4e0.js → symbol-33e7736f.js} +2 -2
  43. package/lib/edge/{symbol-fa343d77.cjs → symbol-3527699b.cjs} +1 -1
  44. package/lib/edge/{tabs-7d258d82.cjs → tabs-2df0eaa2.cjs} +1 -1
  45. package/lib/edge/{tabs-4c9c64f6.js → tabs-bc422e4c.js} +3 -3
  46. package/lib/node/blocks-exports.cjs +23 -23
  47. package/lib/node/blocks-exports.mjs +282 -281
  48. package/lib/node/index.cjs +1 -1
  49. package/lib/node/index.mjs +3 -3
  50. package/lib/node/init.cjs +1 -1
  51. package/lib/node/init.mjs +3 -3
  52. package/lib/node/{server-entry-ec330556.cjs → server-entry-606ce65a.cjs} +1 -1
  53. package/lib/node/{server-entry-2b263dde.js → server-entry-d1ed35c5.js} +1 -1
  54. package/lib/node/server-entry.cjs +1 -1
  55. package/lib/node/server-entry.mjs +1 -1
  56. package/lib/node/{setIvm-7eb67cd6.js → setIvm-6675714a.js} +1 -1
  57. package/lib/node/{setIvm-1e6f0b60.cjs → setIvm-e4deba11.cjs} +1 -1
  58. package/lib/node/setIvm.cjs +1 -1
  59. package/lib/node/setIvm.mjs +2 -2
  60. package/lib/node/{should-force-browser-runtime-in-node-23218b19.cjs → should-force-browser-runtime-in-node-03adae17.cjs} +1 -1
  61. package/lib/node/{should-force-browser-runtime-in-node-cdae9360.js → should-force-browser-runtime-in-node-75b2b3a0.js} +1 -1
  62. package/package.json +1 -1
  63. package/types/constants/sdk-version.d.ts +1 -1
  64. package/types/types/builder-content.d.ts +1 -0
  65. package/types/types/input.d.ts +10 -0
  66. package/lib/edge/accordion-1c16f65e.cjs +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./blocks-exports.cjs"),e=require("./server-entry-ec330556.cjs");require("react/jsx-runtime");require("react");require("./setIvm-1e6f0b60.cjs");require("./should-force-browser-runtime-in-node-23218b19.cjs");exports.Blocks=t.Blocks;exports.BuilderContext=t.BuilderContext;exports.Button=t.Button;exports.Columns=t.Columns;exports.Content=t.Content;exports.Fragment=t.Fragment;exports.Image=t.Image;exports.Section=t.Section;exports.Symbol=t.Symbol;exports.Text=t.Text;exports.Video=t.Video;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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./blocks-exports.cjs"),e=require("./server-entry-606ce65a.cjs");require("react/jsx-runtime");require("react");require("./setIvm-e4deba11.cjs");require("./should-force-browser-runtime-in-node-03adae17.cjs");exports.Blocks=t.Blocks;exports.BuilderContext=t.BuilderContext;exports.Button=t.Button;exports.Columns=t.Columns;exports.Content=t.Content;exports.Fragment=t.Fragment;exports.Image=t.Image;exports.Section=t.Section;exports.Symbol=t.Symbol;exports.Text=t.Text;exports.Video=t.Video;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;
@@ -1,9 +1,9 @@
1
1
  import { Blocks as n, BuilderContext as m, Button as c, Columns as g, Content as p, Fragment as a, Image as d, Section as l, Symbol as u, Text as f, Video as B } from "./blocks-exports.mjs";
2
- import { _processContentResult as E, createRegisterComponentMessage as h, fetchBuilderProps as x, fetchEntries as S, fetchOneEntry as b, getBuilderSearchParams as P, isEditing as k, isPreviewing as y, register as R, setEditorSettings as T, subscribeToEditor as v, track as w } from "./server-entry-2b263dde.js";
2
+ import { _processContentResult as E, createRegisterComponentMessage as h, fetchBuilderProps as x, fetchEntries as S, fetchOneEntry as b, getBuilderSearchParams as P, isEditing as k, isPreviewing as y, register as R, setEditorSettings as T, subscribeToEditor as v, track as w } from "./server-entry-d1ed35c5.js";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
- import "./setIvm-7eb67cd6.js";
6
- import "./should-force-browser-runtime-in-node-cdae9360.js";
5
+ import "./setIvm-6675714a.js";
6
+ import "./should-force-browser-runtime-in-node-75b2b3a0.js";
7
7
  export {
8
8
  n as Blocks,
9
9
  m as BuilderContext,
package/lib/node/init.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./should-force-browser-runtime-in-node-23218b19.cjs"),t=require("isolated-vm"),r=require("./setIvm-1e6f0b60.cjs");require("./server-entry-ec330556.cjs");const n=e=>{if(o.shouldForceBrowserRuntimeInNode({shouldLogWarning:!0}))return;const{ivmIsolateOptions:i}=e||{};r.setIvm(t,i)};exports.initializeNodeRuntime=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./should-force-browser-runtime-in-node-03adae17.cjs"),t=require("isolated-vm"),r=require("./setIvm-e4deba11.cjs");require("./server-entry-606ce65a.cjs");const n=e=>{if(o.shouldForceBrowserRuntimeInNode({shouldLogWarning:!0}))return;const{ivmIsolateOptions:i}=e||{};r.setIvm(t,i)};exports.initializeNodeRuntime=n;
package/lib/node/init.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { shouldForceBrowserRuntimeInNode as r } from "./should-force-browser-runtime-in-node-cdae9360.js";
1
+ import { shouldForceBrowserRuntimeInNode as r } from "./should-force-browser-runtime-in-node-75b2b3a0.js";
2
2
  import t from "isolated-vm";
3
- import { setIvm as e } from "./setIvm-7eb67cd6.js";
4
- import "./server-entry-2b263dde.js";
3
+ import { setIvm as e } from "./setIvm-6675714a.js";
4
+ import "./server-entry-d1ed35c5.js";
5
5
  const u = (o) => {
6
6
  if (r({
7
7
  shouldLogWarning: !0
@@ -1,2 +1,2 @@
1
- "use strict";const w="react",v="[Builder.io]: ",d={log:(...t)=>console.log(v,...t),error:(...t)=>console.error(v,...t),warn:(...t)=>console.warn(v,...t),debug:(...t)=>console.debug(v,...t)};function c(){return typeof window!="undefined"&&typeof document!="undefined"}const gt=t=>{const e={};return t.forEach((n,r)=>{e[r]=n}),e},M=t=>t instanceof URLSearchParams?gt(t):t,N=t=>typeof t=="string"?t:t instanceof URLSearchParams?t.toString():new URLSearchParams(t).toString();function pt(){return c()&&window.self!==window.top}function K(t){return pt()&&N(t||window.location.search).indexOf("builder.frameEditing=")!==-1}const mt=()=>{if(c()){const t=new URL(location.href);return t.pathname===""&&(t.pathname="/"),t}else return console.warn("Cannot get location for tracking in non-browser environment"),null},yt=()=>typeof navigator=="object"&&navigator.userAgent||"",j=()=>{const t=yt(),e={Android(){return t.match(/Android/i)},BlackBerry(){return t.match(/BlackBerry/i)},iOS(){return t.match(/iPhone|iPod/i)},Opera(){return t.match(/Opera Mini/i)},Windows(){return t.match(/IEMobile/i)||t.match(/WPDesktop/i)},any(){return e.Android()||e.BlackBerry()||e.iOS()||e.Opera()||e.Windows()||w==="reactNative"}},n=t.match(/Tablet|iPad/i),r=mt();return{urlPath:r==null?void 0:r.pathname,host:(r==null?void 0:r.host)||(r==null?void 0:r.hostname),device:n?"tablet":e.any()?"mobile":"desktop"}},p=t=>t!=null;function wt(t){const e=t||(c()?window.location.search:void 0);return e?N(e).indexOf("builder.preview=")!==-1:!1}const St=t=>({type:"builder.registerComponent",data:A(t)}),bt=t=>{const e=t.toString().trim(),n=/^[a-zA-Z0-9_]+\s*=>/i.test(e);return`return (${!e.startsWith("function")&&!e.startsWith("async")&&!e.startsWith("(")&&!n?"function ":""}${e}).apply(this, arguments)`};function A(t){return JSON.parse(JSON.stringify(t,(e,n)=>typeof n=="function"?bt(n):n))}const U={};function W(t,e){t==="plugin"&&(e=A(e));let n=U[t];if(n||(n=U[t]=[]),n.push(e),c()){const r={type:"builder.register",data:{type:t,info:e}};try{parent.postMessage(r,"*"),parent!==window&&window.postMessage(r,"*")}catch(s){console.debug("Could not postmessage",s)}}}const L={};function It(t){if(c()){Object.assign(L,t);const e={type:"builder.settingsChange",data:L};parent.postMessage(e,"*")}}const F="builder.",vt="options.",O=t=>{if(!t)return{};const e=M(t),n={};return Object.keys(e).forEach(r=>{if(r.startsWith(F)){const s=r.replace(F,"").replace(vt,"");n[s]=e[r]}}),n},Et=()=>{if(!c())return{};const t=new URLSearchParams(window.location.search);return O(t)},_="3.0.2",G=()=>({"X-Builder-SDK":w,"X-Builder-SDK-GEN":"2","X-Builder-SDK-Version":_}),kt=t=>{if(t==="localhost"||t==="127.0.0.1")return t;const e=t.split(".");return e.length>2?e.slice(1).join("."):t},$=({name:t,canTrack:e})=>{var n;try{return e?(n=document.cookie.split("; ").find(r=>r.startsWith(`${t}=`)))==null?void 0:n.split("=")[1]:void 0}catch(r){d.warn("[COOKIE] GET error: ",(r==null?void 0:r.message)||r);return}},X=async t=>$(t),Pt=t=>t.map(([e,n])=>n?`${e}=${n}`:e).filter(p).join("; "),At=[["secure",""],["SameSite","None"]],Ot=({name:t,value:e,expires:n})=>{const s=(c()?location.protocol==="https:":!0)?At:[[]],o=n?[["expires",n.toUTCString()]]:[[]],i=[[t,e],...o,["path","/"],["domain",kt(window.location.hostname)],...s];return Pt(i)},z=async({name:t,value:e,expires:n,canTrack:r})=>{try{if(!r)return;const s=Ot({name:t,value:e,expires:n});document.cookie=s}catch(s){d.warn("[COOKIE] SET error: ",(s==null?void 0:s.message)||s)}};function Ct(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t=="x"?e:e&3|8).toString(16)})}function H(){return Ct().replace(/-/g,"")}const J="builderSessionId",Tt=async({canTrack:t})=>{if(!t)return;const e=await X({name:J,canTrack:t});if(p(e))return e;{const n=xt();return Bt({id:n,canTrack:t}),n}},xt=()=>H(),Bt=({id:t,canTrack:e})=>z({name:J,value:t,canTrack:e}),Q=()=>c()&&typeof localStorage!="undefined"?localStorage:void 0,Rt=({key:t,canTrack:e})=>{var n;try{return e?(n=Q())==null?void 0:n.getItem(t):void 0}catch(r){console.debug("[LocalStorage] GET error: ",r);return}},Ut=({key:t,canTrack:e,value:n})=>{var r;try{e&&((r=Q())==null||r.setItem(t,n))}catch(s){console.debug("[LocalStorage] SET error: ",s)}},Y="builderVisitorId",Lt=({canTrack:t})=>{if(!t)return;const e=Rt({key:Y,canTrack:t});if(p(e))return e;{const n=Ft();return Vt({id:n,canTrack:t}),n}},Ft=()=>H(),Vt=({id:t,canTrack:e})=>Ut({key:Y,value:t,canTrack:e});function Z(t){var e;typeof process!="undefined"&&((e=process.env)!=null&&e.DEBUG)&&String(process.env.DEBUG)=="true"&&d.log(t)}const Dt=async({canTrack:t})=>{if(!t)return{visitorId:void 0,sessionId:void 0};const e=await Tt({canTrack:t}),n=Lt({canTrack:t});return{sessionId:e,visitorId:n}},Mt=async({type:t,canTrack:e,apiKey:n,metadata:r,...s})=>({type:t,data:{...s,metadata:{url:location.href,...r},...await Dt({canTrack:e}),userAttributes:j(),ownerId:n}});async function q({apiHost:t,...e}){if(!e.apiKey){d.error("Missing API key for track call. Please provide your API key.");return}if(!e.canTrack||K()||!(c()||w==="reactNative"))return;const r=`${t||"https://cdn.builder.io"}/api/v1/track`;return Z(r),fetch(r,{method:"POST",body:JSON.stringify({events:[await Mt(e)]}),headers:{"content-type":"application/json",...G()},mode:"cors"}).catch(s=>{console.error("Failed to track: ",s)})}const Nt=t=>q({...t,canTrack:!0}),Kt=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function tt(t,e){if(!e.origin.startsWith("http")&&!e.origin.startsWith("https"))return!1;const n=new URL(e.origin),r=n.hostname;return(t||Kt).findIndex(s=>s.startsWith("*.")?r.endsWith(s.slice(1)):s===r)>-1}const jt=()=>{W("insertMenu",{name:"_default",default:!0,items:[{name:"Box"},{name:"Text"},{name:"Image"},{name:"Columns"},{name:"Core:Section"},{name:"Core:Button"},{name:"Embed"},{name:"Custom Code"}]})};let V=!1;const et=(t={})=>{var e,n;V||(V=!0,c()&&((e=window.parent)==null||e.postMessage({type:"builder.sdkInfo",data:{target:w,version:_,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:t}},"*"),window.addEventListener("message",r=>{var o,i;if(!tt(t.trustedHosts,r))return;const{data:s}=r;if(s!=null&&s.type)switch(s.type){case"builder.evaluate":{const u=s.data.text,S=s.data.arguments||[],m=s.data.id,E=new Function(u);let l,h=null;try{l=E.apply(null,S)}catch(g){h=g}h?(o=window.parent)==null||o.postMessage({type:"builder.evaluateError",data:{id:m,error:h.message}},"*"):l&&typeof l.then=="function"?l.then(g=>{var b;(b=window.parent)==null||b.postMessage({type:"builder.evaluateResult",data:{id:m,result:g}},"*")}).catch(console.error):(i=window.parent)==null||i.postMessage({type:"builder.evaluateResult",data:{result:l,id:m}},"*");break}}})))},nt=({model:t,trustedHosts:e,callbacks:n})=>r=>{if(!tt(e,r))return;const{data:s}=r;if(s)switch(s.type){case"builder.configureSdk":{n.configureSdk(s.data);break}case"builder.triggerAnimation":{n.animation(s.data);break}case"builder.contentUpdate":{const o=s.data,i=o.key||o.alias||o.entry||o.modelName,u=o.data;i===t&&n.contentUpdate(u);break}}},Wt=(t,e,n)=>{if(!c)return d.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};et();const r=nt({callbacks:{contentUpdate:e,animation:()=>{},configureSdk:()=>{}},model:t,trustedHosts:n==null?void 0:n.trustedHosts});return window.addEventListener("message",r),()=>{window.removeEventListener("message",r)}},_t="builder.tests",C=t=>`${_t}.${t}`,Gt=({contentId:t})=>X({name:C(t),canTrack:!0}),$t=({contentId:t})=>$({name:C(t),canTrack:!0}),Xt=({contentId:t,value:e})=>z({name:C(t),value:e,canTrack:!0}),rt=t=>p(t.id)&&p(t.variations)&&Object.keys(t.variations).length>0,zt=({id:t,variations:e})=>{var s;let n=0;const r=Math.random();for(const o in e){const i=(s=e[o])==null?void 0:s.testRatio;if(n+=i,r<n)return o}return t},st=t=>{const e=zt(t);return Xt({contentId:t.id,value:e}).catch(n=>{d.error("could not store A/B test variation: ",n)}),e},ot=({item:t,testGroupId:e})=>{const n=t.variations[e];return e===t.id||!n?{testVariationId:t.id,testVariationName:"Default"}:{data:n.data,testVariationId:n.id,testVariationName:n.name||(n.id===t.id?"Default":"")}},Ht=({item:t,canTrack:e})=>{if(!e)return t;if(!t)return;if(!rt(t))return t;const n=$t({contentId:t.id})||st({variations:t.variations,id:t.id}),r=ot({item:t,testGroupId:n});return{...t,...r}},Jt=async({item:t,canTrack:e})=>{if(!e||!rt(t))return t;const r=await Gt({contentId:t.id})||st({variations:t.variations,id:t.id}),s=ot({item:t,testGroupId:r});return{...t,...s}},it=t=>p(t)?t:!0;function Qt(){return typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:globalThis}function Yt(){const t=Qt().fetch;if(typeof t=="undefined")throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
1
+ "use strict";const w="react",v="[Builder.io]: ",d={log:(...t)=>console.log(v,...t),error:(...t)=>console.error(v,...t),warn:(...t)=>console.warn(v,...t),debug:(...t)=>console.debug(v,...t)};function c(){return typeof window!="undefined"&&typeof document!="undefined"}const gt=t=>{const e={};return t.forEach((n,r)=>{e[r]=n}),e},M=t=>t instanceof URLSearchParams?gt(t):t,N=t=>typeof t=="string"?t:t instanceof URLSearchParams?t.toString():new URLSearchParams(t).toString();function pt(){return c()&&window.self!==window.top}function K(t){return pt()&&N(t||window.location.search).indexOf("builder.frameEditing=")!==-1}const mt=()=>{if(c()){const t=new URL(location.href);return t.pathname===""&&(t.pathname="/"),t}else return console.warn("Cannot get location for tracking in non-browser environment"),null},yt=()=>typeof navigator=="object"&&navigator.userAgent||"",j=()=>{const t=yt(),e={Android(){return t.match(/Android/i)},BlackBerry(){return t.match(/BlackBerry/i)},iOS(){return t.match(/iPhone|iPod/i)},Opera(){return t.match(/Opera Mini/i)},Windows(){return t.match(/IEMobile/i)||t.match(/WPDesktop/i)},any(){return e.Android()||e.BlackBerry()||e.iOS()||e.Opera()||e.Windows()||w==="reactNative"}},n=t.match(/Tablet|iPad/i),r=mt();return{urlPath:r==null?void 0:r.pathname,host:(r==null?void 0:r.host)||(r==null?void 0:r.hostname),device:n?"tablet":e.any()?"mobile":"desktop"}},p=t=>t!=null;function wt(t){const e=t||(c()?window.location.search:void 0);return e?N(e).indexOf("builder.preview=")!==-1:!1}const St=t=>({type:"builder.registerComponent",data:A(t)}),bt=t=>{const e=t.toString().trim(),n=/^[a-zA-Z0-9_]+\s*=>/i.test(e);return`return (${!e.startsWith("function")&&!e.startsWith("async")&&!e.startsWith("(")&&!n?"function ":""}${e}).apply(this, arguments)`};function A(t){return JSON.parse(JSON.stringify(t,(e,n)=>typeof n=="function"?bt(n):n))}const U={};function W(t,e){t==="plugin"&&(e=A(e));let n=U[t];if(n||(n=U[t]=[]),n.push(e),c()){const r={type:"builder.register",data:{type:t,info:e}};try{parent.postMessage(r,"*"),parent!==window&&window.postMessage(r,"*")}catch(s){console.debug("Could not postmessage",s)}}}const L={};function It(t){if(c()){Object.assign(L,t);const e={type:"builder.settingsChange",data:L};parent.postMessage(e,"*")}}const F="builder.",vt="options.",O=t=>{if(!t)return{};const e=M(t),n={};return Object.keys(e).forEach(r=>{if(r.startsWith(F)){const s=r.replace(F,"").replace(vt,"");n[s]=e[r]}}),n},Et=()=>{if(!c())return{};const t=new URLSearchParams(window.location.search);return O(t)},_="3.0.3",G=()=>({"X-Builder-SDK":w,"X-Builder-SDK-GEN":"2","X-Builder-SDK-Version":_}),kt=t=>{if(t==="localhost"||t==="127.0.0.1")return t;const e=t.split(".");return e.length>2?e.slice(1).join("."):t},$=({name:t,canTrack:e})=>{var n;try{return e?(n=document.cookie.split("; ").find(r=>r.startsWith(`${t}=`)))==null?void 0:n.split("=")[1]:void 0}catch(r){d.warn("[COOKIE] GET error: ",(r==null?void 0:r.message)||r);return}},X=async t=>$(t),Pt=t=>t.map(([e,n])=>n?`${e}=${n}`:e).filter(p).join("; "),At=[["secure",""],["SameSite","None"]],Ot=({name:t,value:e,expires:n})=>{const s=(c()?location.protocol==="https:":!0)?At:[[]],o=n?[["expires",n.toUTCString()]]:[[]],i=[[t,e],...o,["path","/"],["domain",kt(window.location.hostname)],...s];return Pt(i)},z=async({name:t,value:e,expires:n,canTrack:r})=>{try{if(!r)return;const s=Ot({name:t,value:e,expires:n});document.cookie=s}catch(s){d.warn("[COOKIE] SET error: ",(s==null?void 0:s.message)||s)}};function Ct(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t=="x"?e:e&3|8).toString(16)})}function H(){return Ct().replace(/-/g,"")}const J="builderSessionId",Tt=async({canTrack:t})=>{if(!t)return;const e=await X({name:J,canTrack:t});if(p(e))return e;{const n=xt();return Bt({id:n,canTrack:t}),n}},xt=()=>H(),Bt=({id:t,canTrack:e})=>z({name:J,value:t,canTrack:e}),Q=()=>c()&&typeof localStorage!="undefined"?localStorage:void 0,Rt=({key:t,canTrack:e})=>{var n;try{return e?(n=Q())==null?void 0:n.getItem(t):void 0}catch(r){console.debug("[LocalStorage] GET error: ",r);return}},Ut=({key:t,canTrack:e,value:n})=>{var r;try{e&&((r=Q())==null||r.setItem(t,n))}catch(s){console.debug("[LocalStorage] SET error: ",s)}},Y="builderVisitorId",Lt=({canTrack:t})=>{if(!t)return;const e=Rt({key:Y,canTrack:t});if(p(e))return e;{const n=Ft();return Vt({id:n,canTrack:t}),n}},Ft=()=>H(),Vt=({id:t,canTrack:e})=>Ut({key:Y,value:t,canTrack:e});function Z(t){var e;typeof process!="undefined"&&((e=process.env)!=null&&e.DEBUG)&&String(process.env.DEBUG)=="true"&&d.log(t)}const Dt=async({canTrack:t})=>{if(!t)return{visitorId:void 0,sessionId:void 0};const e=await Tt({canTrack:t}),n=Lt({canTrack:t});return{sessionId:e,visitorId:n}},Mt=async({type:t,canTrack:e,apiKey:n,metadata:r,...s})=>({type:t,data:{...s,metadata:{url:location.href,...r},...await Dt({canTrack:e}),userAttributes:j(),ownerId:n}});async function q({apiHost:t,...e}){if(!e.apiKey){d.error("Missing API key for track call. Please provide your API key.");return}if(!e.canTrack||K()||!(c()||w==="reactNative"))return;const r=`${t||"https://cdn.builder.io"}/api/v1/track`;return Z(r),fetch(r,{method:"POST",body:JSON.stringify({events:[await Mt(e)]}),headers:{"content-type":"application/json",...G()},mode:"cors"}).catch(s=>{console.error("Failed to track: ",s)})}const Nt=t=>q({...t,canTrack:!0}),Kt=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function tt(t,e){if(!e.origin.startsWith("http")&&!e.origin.startsWith("https"))return!1;const n=new URL(e.origin),r=n.hostname;return(t||Kt).findIndex(s=>s.startsWith("*.")?r.endsWith(s.slice(1)):s===r)>-1}const jt=()=>{W("insertMenu",{name:"_default",default:!0,items:[{name:"Box"},{name:"Text"},{name:"Image"},{name:"Columns"},{name:"Core:Section"},{name:"Core:Button"},{name:"Embed"},{name:"Custom Code"}]})};let V=!1;const et=(t={})=>{var e,n;V||(V=!0,c()&&((e=window.parent)==null||e.postMessage({type:"builder.sdkInfo",data:{target:w,version:_,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:t}},"*"),window.addEventListener("message",r=>{var o,i;if(!tt(t.trustedHosts,r))return;const{data:s}=r;if(s!=null&&s.type)switch(s.type){case"builder.evaluate":{const u=s.data.text,S=s.data.arguments||[],m=s.data.id,E=new Function(u);let l,h=null;try{l=E.apply(null,S)}catch(g){h=g}h?(o=window.parent)==null||o.postMessage({type:"builder.evaluateError",data:{id:m,error:h.message}},"*"):l&&typeof l.then=="function"?l.then(g=>{var b;(b=window.parent)==null||b.postMessage({type:"builder.evaluateResult",data:{id:m,result:g}},"*")}).catch(console.error):(i=window.parent)==null||i.postMessage({type:"builder.evaluateResult",data:{result:l,id:m}},"*");break}}})))},nt=({model:t,trustedHosts:e,callbacks:n})=>r=>{if(!tt(e,r))return;const{data:s}=r;if(s)switch(s.type){case"builder.configureSdk":{n.configureSdk(s.data);break}case"builder.triggerAnimation":{n.animation(s.data);break}case"builder.contentUpdate":{const o=s.data,i=o.key||o.alias||o.entry||o.modelName,u=o.data;i===t&&n.contentUpdate(u);break}}},Wt=(t,e,n)=>{if(!c)return d.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};et();const r=nt({callbacks:{contentUpdate:e,animation:()=>{},configureSdk:()=>{}},model:t,trustedHosts:n==null?void 0:n.trustedHosts});return window.addEventListener("message",r),()=>{window.removeEventListener("message",r)}},_t="builder.tests",C=t=>`${_t}.${t}`,Gt=({contentId:t})=>X({name:C(t),canTrack:!0}),$t=({contentId:t})=>$({name:C(t),canTrack:!0}),Xt=({contentId:t,value:e})=>z({name:C(t),value:e,canTrack:!0}),rt=t=>p(t.id)&&p(t.variations)&&Object.keys(t.variations).length>0,zt=({id:t,variations:e})=>{var s;let n=0;const r=Math.random();for(const o in e){const i=(s=e[o])==null?void 0:s.testRatio;if(n+=i,r<n)return o}return t},st=t=>{const e=zt(t);return Xt({contentId:t.id,value:e}).catch(n=>{d.error("could not store A/B test variation: ",n)}),e},ot=({item:t,testGroupId:e})=>{const n=t.variations[e];return e===t.id||!n?{testVariationId:t.id,testVariationName:"Default"}:{data:n.data,testVariationId:n.id,testVariationName:n.name||(n.id===t.id?"Default":"")}},Ht=({item:t,canTrack:e})=>{if(!e)return t;if(!t)return;if(!rt(t))return t;const n=$t({contentId:t.id})||st({variations:t.variations,id:t.id}),r=ot({item:t,testGroupId:n});return{...t,...r}},Jt=async({item:t,canTrack:e})=>{if(!e||!rt(t))return t;const r=await Gt({contentId:t.id})||st({variations:t.variations,id:t.id}),s=ot({item:t,testGroupId:r});return{...t,...s}},it=t=>p(t)?t:!0;function Qt(){return typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:globalThis}function Yt(){const t=Qt().fetch;if(typeof t=="undefined")throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
2
2
  For more information, read https://github.com/BuilderIO/this-package-uses-fetch`),new Error("Builder SDK could not find a global `fetch` function");return t}const Zt=Yt();function P(t,e=null,n="."){return Object.keys(t).reduce((r,s)=>{const o=t[s],i=[e,s].filter(Boolean).join(n);return[typeof o=="object",o!==null,!(Array.isArray(o)&&o.length===0)].every(Boolean)?{...r,...P(o,i,n)}:{...r,[i]:o}},{})}function at(t,e,n={}){for(const r in t){const s=t[r],o=e?e+"."+r:r;s&&typeof s=="object"&&!Array.isArray(s)&&!Object.keys(s).find(i=>i.startsWith("$"))?at(s,o,n):n[o]=s}return n}function qt(t){const e={};for(const n in t){const r=n.split(".");let s=e;for(let o=0;o<r.length;o++){const i=r[o];o===r.length-1?s[i]=t[n]:(s[i]=s[i]||{},s=s[i])}}return e}const te="v3",D=t=>typeof t=="number"&&!isNaN(t)&&t>=0,T=t=>{const{limit:e=30,userAttributes:n,query:r,model:s,apiKey:o,enrich:i,locale:u,apiVersion:S=te,fields:m,omit:E,offset:l,cacheSeconds:h,staleCacheSeconds:g,sort:b,includeUnpublished:x,apiHost:dt}=t;if(!o)throw new Error("Missing API key");if(!["v3"].includes(S))throw new Error(`Invalid apiVersion: expected 'v3', received '${S}'`);const ft=e!==1,ht=dt||"https://cdn.builder.io",a=new URL(`${ht}/api/${S}/content/${s}`);a.searchParams.set("apiKey",o),a.searchParams.set("limit",String(e)),a.searchParams.set("noTraverse",String(ft)),a.searchParams.set("includeRefs",String(!0));const k=u||(n==null?void 0:n.locale);let y=n||{};if(k&&(a.searchParams.set("locale",k),y={locale:k,...y}),i&&a.searchParams.set("enrich",String(i)),a.searchParams.set("omit",E||"meta.componentsUsed"),m&&a.searchParams.set("fields",m),Number.isFinite(l)&&l>-1&&a.searchParams.set("offset",String(Math.floor(l))),typeof x=="boolean"&&a.searchParams.set("includeUnpublished",String(x)),h&&D(h)&&a.searchParams.set("cacheSeconds",String(h)),g&&D(g)&&a.searchParams.set("staleCacheSeconds",String(g)),b){const f=P({sort:b});for(const I in f)a.searchParams.set(I,JSON.stringify(f[I]))}const B={...Et(),...M(t.options||{})};y={...y,...ne(B)};const R=P(B);for(const f in R)a.searchParams.set(f,String(R[f]));if(Object.keys(y).length>0&&a.searchParams.set("userAttributes",JSON.stringify(y)),r){const f=at({query:r});for(const I in f)a.searchParams.set(I,JSON.stringify(f[I]))}return a},ee=t=>{const e={};for(const n in t)n.startsWith("userAttributes.")&&(e[n]=t[n],delete t[n]);return e},ne=t=>{if(c()&&t.preview==="BUILDER_STUDIO"){t["userAttributes.urlPath"]=window.location.pathname,t["userAttributes.host"]=window.location.host;const e=ee(t),{userAttributes:n}=qt(e);return n}return{}},re=t=>"results"in t;async function ct(t){const e=await lt({...t,limit:1});return e&&e[0]||null}const se=async t=>{var i,u;const e=T(t),n=(i=t.fetch)!=null?i:Zt,r={...t.fetchOptions,headers:{...(u=t.fetchOptions)==null?void 0:u.headers,...G()}};return await(await n(e.href,r)).json()},ut=async(t,e,n=T(t))=>{const r=it(t.canTrack);if(n.search.includes("preview="),!r||!(c()||w==="reactNative"))return e.results;try{const s=[];for(const o of e.results)s.push(await Jt({item:o,canTrack:r}));e.results=s}catch(s){d.error("Could not process A/B tests. ",s)}return e.results};async function lt(t){const e=T(t),n=await se(t);if(!re(n))throw d.error("Error fetching data. ",{url:e,content:n,options:t}),n;return ut(t,n)}const oe=async t=>{var r,s,o;const e=t.path||((r=t.url)==null?void 0:r.pathname)||((s=t.userAttributes)==null?void 0:s.urlPath),n={...t,apiKey:t.apiKey,model:t.model||"page",userAttributes:{...t.userAttributes,...e?{urlPath:e}:{}},options:O(t.searchParams||((o=t.url)==null?void 0:o.searchParams)||t.options)};return{apiKey:n.apiKey,model:n.model,content:await ct(n)}};exports.MSG_PREFIX=v;exports.TARGET=w;exports._processContentResult=ut;exports._track=q;exports.checkIsDefined=p;exports.createEditorListener=nt;exports.createRegisterComponentMessage=St;exports.fetchBuilderProps=oe;exports.fetchEntries=lt;exports.fetchOneEntry=ct;exports.getBuilderSearchParams=O;exports.getDefaultCanTrack=it;exports.getUserAttributes=j;exports.handleABTestingSync=Ht;exports.isBrowser=c;exports.isEditing=K;exports.isPreviewing=wt;exports.logFetch=Z;exports.logger=d;exports.register=W;exports.registerInsertMenu=jt;exports.serializeIncludingFunctions=A;exports.setEditorSettings=It;exports.setupBrowserForEditing=et;exports.subscribeToEditor=Wt;exports.track=Nt;
@@ -112,7 +112,7 @@ const R = "builder.", dt = "options.", M = (t) => {
112
112
  return {};
113
113
  const t = new URLSearchParams(window.location.search);
114
114
  return M(t);
115
- }, K = "3.0.2", j = () => ({
115
+ }, K = "3.0.3", j = () => ({
116
116
  "X-Builder-SDK": v,
117
117
  "X-Builder-SDK-GEN": "2",
118
118
  "X-Builder-SDK-Version": K
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./server-entry-ec330556.cjs");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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./server-entry-606ce65a.cjs");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;
@@ -1,4 +1,4 @@
1
- import { _processContentResult as r, createRegisterComponentMessage as s, fetchBuilderProps as i, fetchEntries as n, fetchOneEntry as o, getBuilderSearchParams as c, isEditing as g, isPreviewing as a, register as d, setEditorSettings as E, subscribeToEditor as f, track as h } from "./server-entry-2b263dde.js";
1
+ import { _processContentResult as r, createRegisterComponentMessage as s, fetchBuilderProps as i, fetchEntries as n, fetchOneEntry as o, getBuilderSearchParams as c, isEditing as g, isPreviewing as a, register as d, setEditorSettings as E, subscribeToEditor as f, track as h } from "./server-entry-d1ed35c5.js";
2
2
  export {
3
3
  r as _processContentResult,
4
4
  s as createRegisterComponentMessage,
@@ -1,4 +1,4 @@
1
- import { isEditing, isBrowser, getUserAttributes, TARGET, logger, MSG_PREFIX } from "./server-entry-2b263dde.js";
1
+ import { isEditing, isBrowser, getUserAttributes, TARGET, logger, MSG_PREFIX } from "./server-entry-d1ed35c5.js";
2
2
  const getFunctionArguments = ({
3
3
  builder: e,
4
4
  context: t,
@@ -1,4 +1,4 @@
1
- "use strict";const serverEntry=require("./server-entry-ec330556.cjs"),getFunctionArguments=({builder:e,context:t,event:s,state:r})=>Object.entries({state:r,Builder:e,builder:e,context:t,event:s}),getBuilderGlobals=()=>({isEditing:serverEntry.isEditing(),isBrowser:serverEntry.isBrowser(),isServer:!serverEntry.isBrowser(),getUserAttributes:()=>serverEntry.getUserAttributes()}),parseCode=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e;function flattenState({rootState:e,localState:t,rootSetState:s}){return new Proxy(e,{get:(r,n)=>{if(t&&n in t)return t[n];const o=r[n];return typeof o=="object"&&o!==null?flattenState({rootState:o,localState:void 0,rootSetState:s?i=>{r[n]=i,s(r)}:void 0}):o},set:(r,n,o)=>{if(t&&n in t)throw new Error("Writing to local state is not allowed as it is read-only.");return r[n]=o,s==null||s(r),!0}})}const SDK_NAME_FOR_TARGET=(()=>{switch(serverEntry.TARGET){case"rsc":return"react-nextjs";case"reactNative":return"react-native";default:return serverEntry.TARGET}})(),SDK_NAME=`@builder.io/sdk-${SDK_NAME_FOR_TARGET}`,fastClone=e=>JSON.parse(JSON.stringify(e)),set=(e,t,s)=>{if(Object(e)!==e)return e;const r=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return r.slice(0,-1).reduce((n,o,i)=>Object(n[o])===n[o]?n[o]:n[o]=Math.abs(Number(r[i+1]))>>0===+r[i+1]?[]:{},e)[r[r.length-1]]=s,e},noop=()=>{};let safeDynamicRequire=noop;try{safeDynamicRequire=eval("require")}catch(e){}const getSyncValName=e=>`bldr_${e}_sync`,BUILDER_SET_STATE_NAME="BUILDER_SET_STATE",INJECTED_IVM_GLOBAL="BUILDER_IVM",REF_TO_PROXY_FN=`
1
+ "use strict";const serverEntry=require("./server-entry-606ce65a.cjs"),getFunctionArguments=({builder:e,context:t,event:s,state:r})=>Object.entries({state:r,Builder:e,builder:e,context:t,event:s}),getBuilderGlobals=()=>({isEditing:serverEntry.isEditing(),isBrowser:serverEntry.isBrowser(),isServer:!serverEntry.isBrowser(),getUserAttributes:()=>serverEntry.getUserAttributes()}),parseCode=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e;function flattenState({rootState:e,localState:t,rootSetState:s}){return new Proxy(e,{get:(r,n)=>{if(t&&n in t)return t[n];const o=r[n];return typeof o=="object"&&o!==null?flattenState({rootState:o,localState:void 0,rootSetState:s?i=>{r[n]=i,s(r)}:void 0}):o},set:(r,n,o)=>{if(t&&n in t)throw new Error("Writing to local state is not allowed as it is read-only.");return r[n]=o,s==null||s(r),!0}})}const SDK_NAME_FOR_TARGET=(()=>{switch(serverEntry.TARGET){case"rsc":return"react-nextjs";case"reactNative":return"react-native";default:return serverEntry.TARGET}})(),SDK_NAME=`@builder.io/sdk-${SDK_NAME_FOR_TARGET}`,fastClone=e=>JSON.parse(JSON.stringify(e)),set=(e,t,s)=>{if(Object(e)!==e)return e;const r=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return r.slice(0,-1).reduce((n,o,i)=>Object(n[o])===n[o]?n[o]:n[o]=Math.abs(Number(r[i+1]))>>0===+r[i+1]?[]:{},e)[r[r.length-1]]=s,e},noop=()=>{};let safeDynamicRequire=noop;try{safeDynamicRequire=eval("require")}catch(e){}const getSyncValName=e=>`bldr_${e}_sync`,BUILDER_SET_STATE_NAME="BUILDER_SET_STATE",INJECTED_IVM_GLOBAL="BUILDER_IVM",REF_TO_PROXY_FN=`
2
2
  var refToProxy = (obj) => {
3
3
  if (typeof obj !== 'object' || obj === null) {
4
4
  return obj;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./setIvm-1e6f0b60.cjs");require("./server-entry-ec330556.cjs");exports.setIvm=e.setIvm;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./setIvm-e4deba11.cjs");require("./server-entry-606ce65a.cjs");exports.setIvm=e.setIvm;
@@ -1,5 +1,5 @@
1
- import { setIvm as t } from "./setIvm-7eb67cd6.js";
2
- import "./server-entry-2b263dde.js";
1
+ import { setIvm as t } from "./setIvm-6675714a.js";
2
+ import "./server-entry-d1ed35c5.js";
3
3
  export {
4
4
  t as setIvm
5
5
  };
@@ -1 +1 @@
1
- "use strict";const s=require("./server-entry-ec330556.cjs");function t(){var e;return typeof process!="undefined"&&s.checkIsDefined((e=process==null?void 0:process.versions)==null?void 0:e.node)}const c=({shouldLogWarning:e})=>{var o;if(!t())return!1;const n=process.arch==="arm64",r=process.version.startsWith("v20"),i=(o=process.env.NODE_OPTIONS)==null?void 0:o.includes("--no-node-snapshot");return n&&r&&!i?(e&&s.logger.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};exports.shouldForceBrowserRuntimeInNode=c;
1
+ "use strict";const s=require("./server-entry-606ce65a.cjs");function t(){var e;return typeof process!="undefined"&&s.checkIsDefined((e=process==null?void 0:process.versions)==null?void 0:e.node)}const c=({shouldLogWarning:e})=>{var o;if(!t())return!1;const n=process.arch==="arm64",r=process.version.startsWith("v20"),i=(o=process.env.NODE_OPTIONS)==null?void 0:o.includes("--no-node-snapshot");return n&&r&&!i?(e&&s.logger.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};exports.shouldForceBrowserRuntimeInNode=c;
@@ -1,4 +1,4 @@
1
- import { checkIsDefined as i, logger as t } from "./server-entry-2b263dde.js";
1
+ import { checkIsDefined as i, logger as t } from "./server-entry-d1ed35c5.js";
2
2
  function a() {
3
3
  var o;
4
4
  return typeof process != "undefined" && i((o = process == null ? void 0 : process.versions) == null ? void 0 : o.node);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-react",
3
3
  "description": "Builder.io SDK for React",
4
- "version": "3.0.2",
4
+ "version": "3.0.3",
5
5
  "homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/react",
6
6
  "type": "module",
7
7
  "repository": {
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "3.0.2";
1
+ export declare const SDK_VERSION = "3.0.3";
@@ -33,6 +33,7 @@ export interface BuilderContent extends BuilderContentVariation {
33
33
  published?: 'published' | 'draft' | 'archived';
34
34
  modelId?: string;
35
35
  priority?: number;
36
+ firstPublished?: number;
36
37
  lastUpdated?: number;
37
38
  startDate?: number;
38
39
  endDate?: number;
@@ -19,6 +19,16 @@ export interface Input {
19
19
  /** @hidden */
20
20
  autoFocus?: boolean;
21
21
  subFields?: Input[];
22
+ /**
23
+ * When input is of `type` `object`, use this field to collapse multiple inputs
24
+ * in the Visual Editor by default and preserve screen space.
25
+ */
26
+ folded?: boolean;
27
+ /**
28
+ * When input is of `type` `object`, provide guidance in the Visual Editor
29
+ * on how to edit this object's contents.
30
+ */
31
+ keysHelperText?: string;
22
32
  /**
23
33
  * Additional text to render in the UI to give guidance on how to use this
24
34
  *
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),O=require("react"),g=require("./blocks-exports.cjs");require("./server-entry-1879cbc4.cjs");const y=t=>t.toString();function v(t){var u;const[o,s]=O.useState(()=>[]);function d(){return!!(t.grid||t.oneAtATime)}function C(){return{display:"flex",alignItems:"stretch",flexDirection:"column",...t.grid&&{flexDirection:"row",alignItems:"flex-start",flexWrap:"wrap"}}}function h(){const n={...{display:"flex",flexDirection:"column"},alignItems:"stretch",cursor:"pointer"};return Object.fromEntries(Object.entries(n).filter(([l,a])=>a!==void 0))}function j(e){return`builder-accordion-title builder-accordion-title-${o.includes(e)?"open":"closed"}`}function k(e){return`builder-accordion-detail builder-accordion-detail-${o.includes(e)?"open":"closed"}`}function c(){let e=null;if(t.grid&&o.length&&document){const l=o[0];let i=document.querySelector(`.builder-accordion-title[data-index="${l}"]`);if(e=l,i){let m=i.getBoundingClientRect();for(;i=i&&i.nextElementSibling;)if(i){if(i.classList.contains("builder-accordion-detail"))continue;const f=i.getBoundingClientRect();if(f.left>m.left){const b=parseInt(i.getAttribute("data-index")||"",10);isNaN(b)||(m=f,e=b)}else break}}}return typeof e=="number"&&(e=e+1),e}function x(){const e={order:typeof c()=="number"?c():void 0,...t.grid&&{width:"100%"}};return Object.fromEntries(Object.entries(e).filter(([n,l])=>l!==void 0))}function I(e){o.includes(e)?s(d()?[]:o.filter(n=>n!==e)):s(d()?[e]:o.concat(e))}return r.jsx("div",{className:"builder-accordion",style:C(),children:(u=t.items)==null?void 0:u.map((e,n)=>r.jsxs(r.Fragment,{children:[r.jsx("div",{className:j(n),style:{...h(),...t.grid&&{width:t.gridRowWidth,order:c()!==null?y(n):y(n+1)}},"data-index":n,onClick:l=>I(n),children:r.jsx(g.Blocks,{blocks:e.title,path:`items.${n}.title`,parent:t.builderBlock.id,context:t.builderContext,registeredComponents:t.builderComponents,linkComponent:t.builderLinkComponent})}),o.includes(n)?r.jsx("div",{className:k(n),style:x(),children:r.jsx(g.Blocks,{blocks:e.detail,path:`items.${n}.detail`,parent:t.builderBlock.id,context:t.builderContext,registeredComponents:t.builderComponents,linkComponent:t.builderLinkComponent})}):null]}))})}exports.default=v;