@builder.io/sdk-react 5.1.0 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/blocks-exports.cjs +17 -17
- package/lib/browser/blocks-exports.mjs +592 -560
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/{server-entry-7b82deab.cjs → server-entry-1549d863.cjs} +2 -2
- package/lib/browser/{server-entry-1df58bc2.js → server-entry-81390e9b.js} +126 -126
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-a57423b4.js → accordion-90d607ca.js} +1 -1
- package/lib/edge/{accordion-ac489baa.cjs → accordion-ba377db1.cjs} +1 -1
- package/lib/edge/{blocks-966052b8.js → blocks-482bd303.js} +359 -327
- package/lib/edge/{blocks-612edfa7.cjs → blocks-49400750.cjs} +12 -12
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-33b8e000.cjs → button-1dd20b20.cjs} +1 -1
- package/lib/edge/{button-da479943.js → button-76b09bda.js} +2 -2
- package/lib/edge/{columns-384a8553.js → columns-89f6f5b7.js} +3 -3
- package/lib/edge/{columns-476f3763.cjs → columns-ed698360.cjs} +1 -1
- package/lib/edge/{content-variants-b281c0c9.js → content-variants-6e54d1d8.js} +12 -12
- package/lib/edge/{content-variants-21daab2e.cjs → content-variants-98b86c90.cjs} +2 -2
- package/lib/edge/{custom-code-8f1a8bf6.js → custom-code-3387f2ee.js} +1 -1
- package/lib/edge/{custom-code-d420a6d1.cjs → custom-code-62511fce.cjs} +1 -1
- package/lib/edge/{embed-36d96f7c.cjs → embed-54bfd2b5.cjs} +1 -1
- package/lib/edge/{embed-4baabd44.js → embed-e24c574a.js} +1 -1
- package/lib/edge/{form-597542fa.cjs → form-5c77fb87.cjs} +1 -1
- package/lib/edge/{form-7b4ce85e.js → form-b3b23e9b.js} +3 -3
- package/lib/edge/{get-class-prop-name-71cc2ebb.js → get-class-prop-name-2e01e11c.js} +1 -1
- package/lib/edge/{get-class-prop-name-0e04739a.cjs → get-class-prop-name-3347a655.cjs} +1 -1
- package/lib/edge/{img-ac7c30e0.cjs → img-8430be52.cjs} +1 -1
- package/lib/edge/{img-f7f612f5.js → img-d900f0a6.js} +2 -2
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-eb1cbd99.js → input-6b9d2f0d.js} +1 -1
- package/lib/edge/{input-b6bd8bd9.cjs → input-e522b3f8.cjs} +1 -1
- package/lib/edge/{personalization-container-5fd328ca.js → personalization-container-42afbf21.js} +4 -4
- package/lib/edge/{personalization-container-c5a53dee.cjs → personalization-container-9469f576.cjs} +1 -1
- package/lib/edge/{select-e0f16408.cjs → select-38371935.cjs} +1 -1
- package/lib/edge/{select-3f4a8f91.js → select-e1a9f4c9.js} +1 -1
- package/lib/edge/{server-entry-2d0b2a53.js → server-entry-954fe774.js} +1 -1
- package/lib/edge/{server-entry-00719c56.cjs → server-entry-a2bf7e77.cjs} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-bf1f3ed7.cjs → slot-562ee3ff.cjs} +1 -1
- package/lib/edge/{slot-38a6fa40.js → slot-cc86bcca.js} +3 -3
- package/lib/edge/symbol-099ae199.cjs +1 -0
- package/lib/edge/symbol-6224d576.js +93 -0
- package/lib/edge/{tabs-312a6e0a.js → tabs-51cb7107.js} +3 -3
- package/lib/edge/{tabs-c4a1844c.cjs → tabs-e1cf9ee7.cjs} +1 -1
- package/lib/node/blocks-exports.cjs +12 -12
- package/lib/node/blocks-exports.mjs +356 -340
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +3 -3
- package/lib/node/{server-entry-6fc232c7.cjs → server-entry-1c10e3d9.cjs} +2 -2
- package/lib/node/{server-entry-4228cc2b.js → server-entry-85c98f9a.js} +126 -126
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/lib/node/setIvm-a5e6d580.cjs +48 -0
- package/lib/node/{setIvm-29867fb3.js → setIvm-ed61fc8c.js} +60 -44
- package/lib/node/setIvm.cjs +1 -1
- package/lib/node/setIvm.mjs +2 -2
- package/lib/node/{should-force-browser-runtime-in-node-7c48ac04.js → should-force-browser-runtime-in-node-03c2678b.js} +1 -1
- package/lib/node/{should-force-browser-runtime-in-node-eab67c2a.cjs → should-force-browser-runtime-in-node-36ea59a2.cjs} +1 -1
- package/package.json +1 -1
- package/types/blocks/symbol/symbol.helpers.d.ts +2 -0
- package/types/blocks/symbol/symbol.types.d.ts +2 -0
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/functions/evaluate/evaluate.d.ts +1 -1
- package/types/functions/evaluate/helpers.d.ts +9 -1
- package/types/functions/get-block-actions-handler.d.ts +2 -0
- package/types/functions/get-block-actions.d.ts +2 -0
- package/lib/edge/symbol-3a09c0c2.cjs +0 -1
- package/lib/edge/symbol-54dc2d3c.js +0 -93
- package/lib/node/setIvm-5abc9e0c.cjs +0 -48
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const b="react";function a(){return typeof window!="undefined"&&typeof document!="undefined"}const I="[Builder.io]: ",f={log:(...t)=>console.log(I,...t),error:(...t)=>console.error(I,...t),warn:(...t)=>console.warn(I,...t),debug:(...t)=>console.debug(I,...t)},S=t=>t!=null,St=t=>{if(t==="localhost"||t==="127.0.0.1")return t;const e=t.split(".");return e.length>2?e.slice(1).join("."):t},v=({name:t,canTrack:e})=>{var r;try{return e?(r=document.cookie.split("; ").find(n=>n.startsWith(`${t}=`)))==null?void 0:r.split("=")[1]:void 0}catch(n){f.warn("[COOKIE] GET error: ",(n==null?void 0:n.message)||n);return}},j=async t=>v(t),bt=t=>t.map(([e,r])=>r?`${e}=${r}`:e).filter(S).join("; "),yt=[["secure",""],["SameSite","None"]],mt=({name:t,value:e,expires:r})=>{const s=(a()?location.protocol==="https:":!0)?yt:[[]],o=r?[["expires",r.toUTCString()]]:[[]],i=[[t,e],...o,["path","/"],["domain",St(window.location.hostname)],...s];return bt(i)},U=async({name:t,value:e,expires:r,canTrack:n})=>{try{if(!n)return;const s=mt({name:t,value:e,expires:r});document.cookie=s}catch(s){f.warn("[COOKIE] SET error: ",(s==null?void 0:s.message)||s)}};const N="builder.userAttributes";function V(){let t=!0;const e=new Set;return{setUserAttributes(r){if(!a())return;const n={...this.getUserAttributes(),...r};U({name:N,value:JSON.stringify(n),canTrack:t}),e.forEach(s=>s(n))},getUserAttributes(){return a()?JSON.parse(v({name:N,canTrack:t})||"{}"):{}},subscribeOnUserAttributesChange(r,{fireImmediately:n}={}){return e.add(r),n&&r(this.getUserAttributes()),function(){e.delete(r)}},setCanTrack(r){t=r}}}let k;a()&&b==="qwik"?(window.__BUILDER_USER_ATTRIBUTES_SERVICE__||(window.__BUILDER_USER_ATTRIBUTES_SERVICE__=V()),k=window.__BUILDER_USER_ATTRIBUTES_SERVICE__):k=V();const O=k,wt=t=>{O.setUserAttributes(t)},Et=t=>{const e={};return t.forEach((r,n)=>{e[n]=r}),e},$=t=>t instanceof URLSearchParams?Et(t):t,G=t=>typeof t=="string"?t:t instanceof URLSearchParams?t.toString():new URLSearchParams(t).toString();function At(){return a()&&window.self!==window.top}function J(t){return At()&&G(t||window.location.search).indexOf("builder.frameEditing=")!==-1}function It(t){const e=t||(a()?window.location.search:void 0);return e?G(e).indexOf("builder.preview=")!==-1:!1}const vt=t=>({type:"builder.registerComponent",data:P(t)}),kt=t=>{const e=t.toString().trim(),r=/^[a-zA-Z0-9_]+\s*=>/i.test(e);return`return (${!e.startsWith("function")&&!e.startsWith("async")&&!e.startsWith("(")&&!r?"function ":""}${e}).apply(this, arguments)`};function P(t){return JSON.parse(JSON.stringify(t,(e,r)=>typeof r=="function"?kt(r):r))}const D={};function Tt(t,e){t==="plugin"&&(e=P(e));let r=D[t];if(r||(r=D[t]=[]),r.push(e),a()){const n={type:"builder.register",data:{type:t,info:e}};try{parent.postMessage(n,"*"),parent!==window&&window.postMessage(n,"*")}catch(s){console.debug("Could not postmessage",s)}}}function Ut(t){var e;if(a()){const r=JSON.parse(JSON.stringify(t));t.action&&(r.action=t.action.toString()),(e=window.parent)==null||e.postMessage({type:"builder.registerAction",data:r},"*")}}const F={};function Ot(t){if(a()){Object.assign(F,t);const e={type:"builder.settingsChange",data:F};parent.postMessage(e,"*")}}const M="builder.",Pt="options.",R=t=>{if(!t)return{};const e=$(t),r={};return Object.keys(e).forEach(n=>{if(n.startsWith(M)){const s=n.replace(M,"").replace(Pt,"");r[s]=e[n]}}),r},Rt=()=>{if(!a())return{};const t=new URLSearchParams(window.location.search);return R(t)},z="5.1.0",X=()=>({"X-Builder-SDK":b,"X-Builder-SDK-GEN":"2","X-Builder-SDK-Version":z});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 Q="builderSessionId",Bt=async({canTrack:t})=>{if(!t)return;const e=await j({name:Q,canTrack:t});if(S(e))return e;{const r=xt();return _t({id:r,canTrack:t}),r}},xt=()=>H(),_t=({id:t,canTrack:e})=>U({name:Q,value:t,canTrack:e}),Y=()=>a()&&typeof localStorage!="undefined"?localStorage:void 0,Lt=({key:t,canTrack:e})=>{var r;try{return e?(r=Y())==null?void 0:r.getItem(t):void 0}catch(n){console.debug("[LocalStorage] GET error: ",n);return}},Nt=({key:t,canTrack:e,value:r})=>{var n;try{e&&((n=Y())==null||n.setItem(t,r))}catch(s){console.debug("[LocalStorage] SET error: ",s)}},Z="builderVisitorId",Vt=({canTrack:t})=>{if(!t)return;const e=Lt({key:Z,canTrack:t});if(S(e))return e;{const r=Dt();return Ft({id:r,canTrack:t}),r}},Dt=()=>H(),Ft=({id:t,canTrack:e})=>Nt({key:Z,value:t,canTrack:e});function q(t){var e;typeof process!="undefined"&&((e=process.env)!=null&&e.DEBUG)&&String(process.env.DEBUG)=="true"&&f.log(t)}const Mt=()=>{if(a()){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},Kt=()=>typeof navigator=="object"&&navigator.userAgent||"",tt=()=>{const t=Kt(),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()||b==="reactNative"}},r=t.match(/Tablet|iPad/i),n=Mt();return{urlPath:n==null?void 0:n.pathname,host:(n==null?void 0:n.host)||(n==null?void 0:n.hostname),device:r?"tablet":e.any()?"mobile":"desktop"}},Wt=async({canTrack:t})=>{if(!t)return{visitorId:void 0,sessionId:void 0};const e=await Bt({canTrack:t}),r=Vt({canTrack:t});return{sessionId:e,visitorId:r}},jt=async({type:t,canTrack:e,apiKey:r,metadata:n,...s})=>({type:t,data:{...s,metadata:{url:location.href,...n},...await Wt({canTrack:e}),userAttributes:tt(),ownerId:r}});async function et({apiHost:t,...e}){if(!e.apiKey){f.error("Missing API key for track call. Please provide your API key.");return}if(!e.canTrack||J()||!(a()||b==="reactNative"))return;const n=`${t||"https://cdn.builder.io"}/api/v1/track`;return q(n),fetch(n,{method:"POST",body:JSON.stringify({events:[await jt(e)]}),headers:{"content-type":"application/json",...X()},mode:"cors"}).catch(s=>{console.error("Failed to track: ",s)})}const $t=t=>et({...t,canTrack:!0}),Gt=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function rt(t,e){if(!e.origin.startsWith("http")&&!e.origin.startsWith("https"))return!1;const r=new URL(e.origin),n=r.hostname;return(t||Gt).findIndex(s=>s.startsWith("*.")?n.endsWith(s.slice(1)):s===n)>-1}let K=!1;const nt=t=>{var e,r;K||(K=!0,a()&&((e=window.parent)==null||e.postMessage({type:"builder.sdkInfo",data:{target:b,version:z,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0,modelName:t.modelName,apiKey:t.apiKey,supportsXSmallBreakpoint:!0,blockLevelPersonalization:!0}},"*"),(r=window.parent)==null||r.postMessage({type:"builder.updateContent",data:{options:t}},"*"),window.addEventListener("message",n=>{var o,i;if(!rt(t.trustedHosts,n))return;const{data:s}=n;if(s!=null&&s.type)switch(s.type){case"builder.evaluate":{const u=s.data.text,l=s.data.arguments||[],y=s.data.id,m=new Function(u);let d,h=null;try{d=m.apply(null,l)}catch(p){h=p}h?(o=window.parent)==null||o.postMessage({type:"builder.evaluateError",data:{id:y,error:h.message}},"*"):d&&typeof d.then=="function"?d.then(p=>{var w;(w=window.parent)==null||w.postMessage({type:"builder.evaluateResult",data:{id:y,result:p}},"*")}).catch(console.error):(i=window.parent)==null||i.postMessage({type:"builder.evaluateResult",data:{result:d,id:y}},"*");break}}})))},st=({model:t,trustedHosts:e,callbacks:r})=>n=>{if(!rt(e,n))return;const{data:s}=n;if(s)switch(s.type){case"builder.configureSdk":{r.configureSdk(s.data);break}case"builder.triggerAnimation":{r.animation(s.data);break}case"builder.resetState":{const o=s.data,i=o.model,u=o==null?void 0:o.state,l=o.editType;i===t&&u&&r.stateUpdate(u,l);break}case"builder.contentUpdate":{const o=s.data,i=o.key||o.alias||o.entry||o.modelName,u=o.data,l=o.editType;i===t&&r.contentUpdate(u,l);break}}},Jt=({model:t,apiKey:e,callback:r,trustedHosts:n})=>{if(!a)return f.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};nt({modelName:t,apiKey:e});const s=st({callbacks:{contentUpdate:r,animation:()=>{},configureSdk:()=>{},stateUpdate:()=>{}},model:t,trustedHosts:n});return window.addEventListener("message",s),()=>{window.removeEventListener("message",s)}},zt="builder.tests",C=t=>`${zt}.${t}`,Xt=({contentId:t})=>j({name:C(t),canTrack:!0}),Ht=({contentId:t})=>v({name:C(t),canTrack:!0}),Qt=({contentId:t,value:e})=>U({name:C(t),value:e,canTrack:!0}),ot=t=>S(t.id)&&S(t.variations)&&Object.keys(t.variations).length>0,Yt=({id:t,variations:e})=>{var s;let r=0;const n=Math.random();for(const o in e){const i=(s=e[o])==null?void 0:s.testRatio;if(r+=i,n<r)return o}return t},it=t=>{const e=Yt(t);return Qt({contentId:t.id,value:e}).catch(r=>{f.error("could not store A/B test variation: ",r)}),e},at=({item:t,testGroupId:e})=>{const r=t.variations[e];return e===t.id||!r?{testVariationId:t.id,testVariationName:"Default"}:{data:r.data,testVariationId:r.id,testVariationName:r.name||(r.id===t.id?"Default":"")}},Zt=({item:t,canTrack:e})=>{if(!e)return t;if(!t)return;if(!ot(t))return t;const r=Ht({contentId:t.id})||it({variations:t.variations,id:t.id}),n=at({item:t,testGroupId:r});return{...t,...n}},qt=async({item:t,canTrack:e})=>{if(!e||!ot(t))return t;const n=await Xt({contentId:t.id})||it({variations:t.variations,id:t.id}),s=at({item:t,testGroupId:n});return{...t,...s}},ct=t=>{const e=S(t)?t:!0;return O.setCanTrack(e),e};function te(){return typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:globalThis}function ee(){const t=te().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 b="react";function a(){return typeof window!="undefined"&&typeof document!="undefined"}const I="[Builder.io]: ",f={log:(...t)=>console.log(I,...t),error:(...t)=>console.error(I,...t),warn:(...t)=>console.warn(I,...t),debug:(...t)=>console.debug(I,...t)},S=t=>t!=null,St=t=>{if(t==="localhost"||t==="127.0.0.1")return t;const e=t.split(".");return e.length>2?e.slice(1).join("."):t},v=({name:t,canTrack:e})=>{var r;try{return e?(r=document.cookie.split("; ").find(n=>n.startsWith(`${t}=`)))==null?void 0:r.split("=")[1]:void 0}catch(n){f.warn("[COOKIE] GET error: ",(n==null?void 0:n.message)||n);return}},j=async t=>v(t),bt=t=>t.map(([e,r])=>r?`${e}=${r}`:e).filter(S).join("; "),yt=[["secure",""],["SameSite","None"]],mt=({name:t,value:e,expires:r})=>{const s=(a()?location.protocol==="https:":!0)?yt:[[]],o=r?[["expires",r.toUTCString()]]:[[]],i=[[t,e],...o,["path","/"],["domain",St(window.location.hostname)],...s];return bt(i)},U=async({name:t,value:e,expires:r,canTrack:n})=>{try{if(!n)return;const s=mt({name:t,value:e,expires:r});document.cookie=s}catch(s){f.warn("[COOKIE] SET error: ",(s==null?void 0:s.message)||s)}};const N="builder.userAttributes";function V(){let t=!0;const e=new Set;return{setUserAttributes(r){if(!a())return;const n={...this.getUserAttributes(),...r};U({name:N,value:JSON.stringify(n),canTrack:t}),e.forEach(s=>s(n))},getUserAttributes(){return a()?JSON.parse(v({name:N,canTrack:t})||"{}"):{}},subscribeOnUserAttributesChange(r,{fireImmediately:n}={}){return e.add(r),n&&r(this.getUserAttributes()),function(){e.delete(r)}},setCanTrack(r){t=r}}}let k;a()&&b==="qwik"?(window.__BUILDER_USER_ATTRIBUTES_SERVICE__||(window.__BUILDER_USER_ATTRIBUTES_SERVICE__=V()),k=window.__BUILDER_USER_ATTRIBUTES_SERVICE__):k=V();const O=k,wt=t=>{O.setUserAttributes(t)},Et=t=>{const e={};return t.forEach((r,n)=>{e[n]=r}),e},$=t=>t instanceof URLSearchParams?Et(t):t,G=t=>typeof t=="string"?t:t instanceof URLSearchParams?t.toString():new URLSearchParams(t).toString();function At(){return a()&&window.self!==window.top}function J(t){return At()&&G(t||window.location.search).indexOf("builder.frameEditing=")!==-1}function It(t){const e=t||(a()?window.location.search:void 0);return e?G(e).indexOf("builder.preview=")!==-1:!1}const vt=t=>({type:"builder.registerComponent",data:P(t)}),kt=t=>{const e=t.toString().trim(),r=/^[a-zA-Z0-9_]+\s*=>/i.test(e);return`return (${!e.startsWith("function")&&!e.startsWith("async")&&!e.startsWith("(")&&!r?"function ":""}${e}).apply(this, arguments)`};function P(t){return JSON.parse(JSON.stringify(t,(e,r)=>typeof r=="function"?kt(r):r))}const D={};function Tt(t,e){t==="plugin"&&(e=P(e));let r=D[t];if(r||(r=D[t]=[]),r.push(e),a()){const n={type:"builder.register",data:{type:t,info:e}};try{parent.postMessage(n,"*"),parent!==window&&window.postMessage(n,"*")}catch(s){console.debug("Could not postmessage",s)}}}function Ut(t){var e;if(a()){const r=JSON.parse(JSON.stringify(t));t.action&&(r.action=t.action.toString()),(e=window.parent)==null||e.postMessage({type:"builder.registerAction",data:r},"*")}}const F={};function Ot(t){if(a()){Object.assign(F,t);const e={type:"builder.settingsChange",data:F};parent.postMessage(e,"*")}}const M="builder.",Pt="options.",R=t=>{if(!t)return{};const e=$(t),r={};return Object.keys(e).forEach(n=>{if(n.startsWith(M)){const s=n.replace(M,"").replace(Pt,"");r[s]=e[n]}}),r},Rt=()=>{if(!a())return{};const t=new URLSearchParams(window.location.search);return R(t)},z="5.2.0",X=()=>({"X-Builder-SDK":b,"X-Builder-SDK-GEN":"2","X-Builder-SDK-Version":z});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 Q="builderSessionId",Bt=async({canTrack:t})=>{if(!t)return;const e=await j({name:Q,canTrack:t});if(S(e))return e;{const r=xt();return _t({id:r,canTrack:t}),r}},xt=()=>H(),_t=({id:t,canTrack:e})=>U({name:Q,value:t,canTrack:e}),Y=()=>a()&&typeof localStorage!="undefined"?localStorage:void 0,Lt=({key:t,canTrack:e})=>{var r;try{return e?(r=Y())==null?void 0:r.getItem(t):void 0}catch(n){console.debug("[LocalStorage] GET error: ",n);return}},Nt=({key:t,canTrack:e,value:r})=>{var n;try{e&&((n=Y())==null||n.setItem(t,r))}catch(s){console.debug("[LocalStorage] SET error: ",s)}},Z="builderVisitorId",Vt=({canTrack:t})=>{if(!t)return;const e=Lt({key:Z,canTrack:t});if(S(e))return e;{const r=Dt();return Ft({id:r,canTrack:t}),r}},Dt=()=>H(),Ft=({id:t,canTrack:e})=>Nt({key:Z,value:t,canTrack:e});function q(t){var e;typeof process!="undefined"&&((e=process.env)!=null&&e.DEBUG)&&String(process.env.DEBUG)=="true"&&f.log(t)}const Mt=()=>{if(a()){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},Kt=()=>typeof navigator=="object"&&navigator.userAgent||"",tt=()=>{const t=Kt(),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()||b==="reactNative"}},r=t.match(/Tablet|iPad/i),n=Mt();return{urlPath:n==null?void 0:n.pathname,host:(n==null?void 0:n.host)||(n==null?void 0:n.hostname),device:r?"tablet":e.any()?"mobile":"desktop"}},Wt=async({canTrack:t})=>{if(!t)return{visitorId:void 0,sessionId:void 0};const e=await Bt({canTrack:t}),r=Vt({canTrack:t});return{sessionId:e,visitorId:r}},jt=async({type:t,canTrack:e,apiKey:r,metadata:n,...s})=>({type:t,data:{...s,metadata:{url:location.href,...n},...await Wt({canTrack:e}),userAttributes:tt(),ownerId:r}});async function et({apiHost:t,...e}){if(!e.apiKey){f.error("Missing API key for track call. Please provide your API key.");return}if(!e.canTrack||J()||!(a()||b==="reactNative"))return;const n=`${t||"https://cdn.builder.io"}/api/v1/track`;return q(n),fetch(n,{method:"POST",body:JSON.stringify({events:[await jt(e)]}),headers:{"content-type":"application/json",...X()},mode:"cors"}).catch(s=>{console.error("Failed to track: ",s)})}const $t=t=>et({...t,canTrack:!0}),Gt=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function rt(t,e){if(!e.origin.startsWith("http")&&!e.origin.startsWith("https"))return!1;const r=new URL(e.origin),n=r.hostname;return(t||Gt).findIndex(s=>s.startsWith("*.")?n.endsWith(s.slice(1)):s===n)>-1}let K=!1;const nt=t=>{var e,r;K||(K=!0,a()&&((e=window.parent)==null||e.postMessage({type:"builder.sdkInfo",data:{target:b,version:z,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0,modelName:t.modelName,apiKey:t.apiKey,supportsXSmallBreakpoint:!0,blockLevelPersonalization:!0}},"*"),(r=window.parent)==null||r.postMessage({type:"builder.updateContent",data:{options:t}},"*"),window.addEventListener("message",n=>{var o,i;if(!rt(t.trustedHosts,n))return;const{data:s}=n;if(s!=null&&s.type)switch(s.type){case"builder.evaluate":{const u=s.data.text,l=s.data.arguments||[],y=s.data.id,m=new Function(u);let d,h=null;try{d=m.apply(null,l)}catch(p){h=p}h?(o=window.parent)==null||o.postMessage({type:"builder.evaluateError",data:{id:y,error:h.message}},"*"):d&&typeof d.then=="function"?d.then(p=>{var w;(w=window.parent)==null||w.postMessage({type:"builder.evaluateResult",data:{id:y,result:p}},"*")}).catch(console.error):(i=window.parent)==null||i.postMessage({type:"builder.evaluateResult",data:{result:d,id:y}},"*");break}}})))},st=({model:t,trustedHosts:e,callbacks:r})=>n=>{if(!rt(e,n))return;const{data:s}=n;if(s)switch(s.type){case"builder.configureSdk":{r.configureSdk(s.data);break}case"builder.triggerAnimation":{r.animation(s.data);break}case"builder.resetState":{const o=s.data,i=o.model,u=o==null?void 0:o.state,l=o.editType;i===t&&u&&r.stateUpdate(u,l);break}case"builder.contentUpdate":{const o=s.data,i=o.key||o.alias||o.entry||o.modelName,u=o.data,l=o.editType;i===t&&r.contentUpdate(u,l);break}}},Jt=({model:t,apiKey:e,callback:r,trustedHosts:n})=>{if(!a)return f.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};nt({modelName:t,apiKey:e});const s=st({callbacks:{contentUpdate:r,animation:()=>{},configureSdk:()=>{},stateUpdate:()=>{}},model:t,trustedHosts:n});return window.addEventListener("message",s),()=>{window.removeEventListener("message",s)}},zt="builder.tests",C=t=>`${zt}.${t}`,Xt=({contentId:t})=>j({name:C(t),canTrack:!0}),Ht=({contentId:t})=>v({name:C(t),canTrack:!0}),Qt=({contentId:t,value:e})=>U({name:C(t),value:e,canTrack:!0}),ot=t=>S(t.id)&&S(t.variations)&&Object.keys(t.variations).length>0,Yt=({id:t,variations:e})=>{var s;let r=0;const n=Math.random();for(const o in e){const i=(s=e[o])==null?void 0:s.testRatio;if(r+=i,n<r)return o}return t},it=t=>{const e=Yt(t);return Qt({contentId:t.id,value:e}).catch(r=>{f.error("could not store A/B test variation: ",r)}),e},at=({item:t,testGroupId:e})=>{const r=t.variations[e];return e===t.id||!r?{testVariationId:t.id,testVariationName:"Default"}:{data:r.data,testVariationId:r.id,testVariationName:r.name||(r.id===t.id?"Default":"")}},Zt=({item:t,canTrack:e})=>{if(!e)return t;if(!t)return;if(!ot(t))return t;const r=Ht({contentId:t.id})||it({variations:t.variations,id:t.id}),n=at({item:t,testGroupId:r});return{...t,...n}},qt=async({item:t,canTrack:e})=>{if(!e||!ot(t))return t;const n=await Xt({contentId:t.id})||it({variations:t.variations,id:t.id}),s=at({item:t,testGroupId:n});return{...t,...s}},ct=t=>{const e=S(t)?t:!0;return O.setCanTrack(e),e};function te(){return typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:globalThis}function ee(){const t=te().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 re=ee();function T(t,e=null,r="."){return Object.keys(t).reduce((n,s)=>{const o=t[s],i=[e,s].filter(Boolean).join(r);return[typeof o=="object",o!==null,!(Array.isArray(o)&&o.length===0)].every(Boolean)?{...n,...T(o,i,r)}:{...n,[i]:o}},{})}function ut(t,e,r={}){for(const n in t){const s=t[n],o=e?e+"."+n:n;s&&typeof s=="object"&&!Array.isArray(s)&&!Object.keys(s).find(i=>i.startsWith("$"))?ut(s,o,r):r[o]=s}return r}function ne(t){const e={};for(const r in t){const n=r.split(".");let s=e;for(let o=0;o<n.length;o++){const i=n[o];o===n.length-1?s[i]=t[r]:(s[i]=s[i]||{},s=s[i])}}return e}const se="v3",W=t=>typeof t=="number"&&!isNaN(t)&&t>=0,B=t=>{const{limit:e=30,userAttributes:r,query:n,model:s,apiKey:o,enrich:i,locale:u,apiVersion:l=se,fields:y,omit:m,offset:d,cacheSeconds:h,staleCacheSeconds:p,sort:w,includeUnpublished:x,apiHost:gt}=t;if(!o)throw new Error("Missing API key");if(!["v3"].includes(l))throw new Error(`Invalid apiVersion: expected 'v3', received '${l}'`);const ht=e!==1,pt=gt||"https://cdn.builder.io",c=new URL(`${pt}/api/${l}/content/${s}`);c.searchParams.set("apiKey",o),c.searchParams.set("limit",String(e)),c.searchParams.set("noTraverse",String(ht)),c.searchParams.set("includeRefs",String(!0)),u&&c.searchParams.set("locale",u);let A=r||{};if(i&&c.searchParams.set("enrich",String(i)),c.searchParams.set("omit",m!=null?m:"meta.componentsUsed"),y&&c.searchParams.set("fields",y),Number.isFinite(d)&&d>-1&&c.searchParams.set("offset",String(Math.floor(d))),typeof x=="boolean"&&c.searchParams.set("includeUnpublished",String(x)),h&&W(h)&&c.searchParams.set("cacheSeconds",String(h)),p&&W(p)&&c.searchParams.set("staleCacheSeconds",String(p)),w){const g=T({sort:w});for(const E in g)c.searchParams.set(E,JSON.stringify(g[E]))}const _={...Rt(),...$(t.options||{})};A={...A,...ie(_)};const L=T(_);for(const g in L)c.searchParams.set(g,String(L[g]));if(Object.keys(A).length>0&&c.searchParams.set("userAttributes",JSON.stringify(A)),n){const g=ut({query:n});for(const E in g)c.searchParams.set(E,JSON.stringify(g[E]))}return c},oe=t=>{const e={};for(const r in t)r.startsWith("userAttributes.")&&(e[r]=t[r],delete t[r]);return e},ie=t=>{if(a()&&t.preview==="BUILDER_STUDIO"){t["userAttributes.urlPath"]=window.location.pathname,t["userAttributes.host"]=window.location.host;const e=oe(t),{userAttributes:r}=ne(e);return r}return{}},ae=t=>"results"in t;async function lt(t){var n;const e=t.locale||((n=t.userAttributes)==null?void 0:n.locale);e&&(t.locale=e,t.userAttributes={locale:e,...t.userAttributes});const r=await ft({...t,limit:1});return r&&r[0]||null}const ce=async t=>{var i,u;const e=B(t),r=(i=t.fetch)!=null?i:re,n={...t.fetchOptions,headers:{...(u=t.fetchOptions)==null?void 0:u.headers,...X()}};return await(await r(e.href,n)).json()},dt=async(t,e,r=B(t))=>{const n=ct(t.canTrack);if(r.search.includes("preview="),!n||!(a()||b==="reactNative"))return e.results;try{const s=[];for(const o of e.results)s.push(await qt({item:o,canTrack:n}));e.results=s}catch(s){f.error("Could not process A/B tests. ",s)}return e.results};async function ft(t){const e=B(t),r=await ce(t);if(!ae(r))throw f.error("Error fetching data. ",{url:e,content:r,options:t}),r;return dt(t,r)}const ue=async t=>{var n,s,o;const e=t.path||((n=t.url)==null?void 0:n.pathname)||((s=t.userAttributes)==null?void 0:s.urlPath),r={...t,apiKey:t.apiKey,model:t.model||"page",userAttributes:{...t.userAttributes,...e?{urlPath:e}:{}},options:R(t.searchParams||((o=t.url)==null?void 0:o.searchParams)||t.options)};return{apiKey:r.apiKey,model:r.model,content:await lt(r)}};exports.TARGET=b;exports._processContentResult=dt;exports._track=et;exports.checkIsDefined=S;exports.createEditorListener=st;exports.createRegisterComponentMessage=vt;exports.fetchBuilderProps=ue;exports.fetchEntries=ft;exports.fetchOneEntry=lt;exports.getBuilderSearchParams=R;exports.getCookieSync=v;exports.getDefaultCanTrack=ct;exports.getUserAttributes=tt;exports.handleABTestingSync=Zt;exports.isBrowser=a;exports.isEditing=J;exports.isPreviewing=It;exports.logFetch=q;exports.logger=f;exports.register=Tt;exports.registerAction=Ut;exports.serializeIncludingFunctions=P;exports.setClientUserAttributes=wt;exports.setEditorSettings=Ot;exports.setupBrowserForEditing=nt;exports.subscribeToEditor=Jt;exports.track=$t;exports.userAttributesService=O;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./server-entry-a2bf7e77.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.registerAction=e.registerAction;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _processContentResult as r, createRegisterComponentMessage as i, fetchBuilderProps as s, fetchEntries as n, fetchOneEntry as o, getBuilderSearchParams as c, isEditing as g, isPreviewing as a, register as d, registerAction as E, setEditorSettings as f, subscribeToEditor as h, track as p } from "./server-entry-
|
|
1
|
+
import { _processContentResult as r, createRegisterComponentMessage as i, fetchBuilderProps as s, fetchEntries as n, fetchOneEntry as o, getBuilderSearchParams as c, isEditing as g, isPreviewing as a, register as d, registerAction as E, setEditorSettings as f, subscribeToEditor as h, track as p } from "./server-entry-954fe774.js";
|
|
2
2
|
export {
|
|
3
3
|
r as _processContentResult,
|
|
4
4
|
i as createRegisterComponentMessage,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),i=require("./blocks-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),i=require("./blocks-49400750.cjs");require("react");require("./blocks-exports.cjs");require("./server-entry-a2bf7e77.cjs");require("./get-class-prop-name-3347a655.cjs");require("./dynamic-renderer-b29b45ca.cjs");function u(e){var t,n,r;return o.jsx("div",{style:{pointerEvents:"auto"},...!((t=e.builderContext.context)!=null&&t.symbolId)&&{"builder-slot":e.name},children:o.jsx(i.Blocks,{parent:(n=e.builderContext.context)==null?void 0:n.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,registeredComponents:e.builderComponents,blocks:(r=e.builderContext.rootState)==null?void 0:r[e.name]})})}exports.default=u;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { Blocks as m } from "./blocks-
|
|
2
|
+
import { Blocks as m } from "./blocks-482bd303.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "./blocks-exports.mjs";
|
|
5
|
-
import "./server-entry-
|
|
6
|
-
import "./get-class-prop-name-
|
|
5
|
+
import "./server-entry-954fe774.js";
|
|
6
|
+
import "./get-class-prop-name-2e01e11c.js";
|
|
7
7
|
import "./dynamic-renderer-8b343325.js";
|
|
8
8
|
function c(t) {
|
|
9
9
|
var e, o, n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react/jsx-runtime"),r=require("react"),h=require("./blocks-exports.cjs"),j=require("./get-class-prop-name-3347a655.cjs"),C=require("./server-entry-a2bf7e77.cjs"),q=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return C.fetchOneEntry({model:t.model,apiKey:t.global&&t.ownerId?t.ownerId:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(c=>{C.logger.error("Could not fetch symbol content: ",c)})};function I(e){var a,l,d,u,m,s,y;function t(){return"div"}function c(){return"div"}function v(){return Object.values(e.builderComponents)}function g(){var n,o;return[e.attributes[j.getClassPropName()],"builder-symbol",(n=e.symbol)!=null&&n.inline?"builder-inline-symbol":void 0,(o=e.symbol)!=null&&o.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")}const[i,k]=r.useState(()=>{var n;return(n=e.symbol)==null?void 0:n.content}),[x,S]=r.useState(()=>{var n;return(n=e.symbol)==null?void 0:n.entry});function E(){var n;i&&x===((n=e.symbol)==null?void 0:n.entry)||q({symbol:e.symbol,builderContextValue:e.builderContext}).then(o=>{var b;o&&(k(o),S((b=e.symbol)==null?void 0:b.entry))})}return r.useEffect(()=>{},[]),r.useEffect(()=>{E()},[e.symbol]),f.jsx("div",{...e.attributes,className:g(),children:f.jsx(h.Content,{nonce:e.builderContext.nonce,isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:(a=e.symbol)!=null&&a.global&&((l=e.symbol)!=null&&l.ownerId)?e.symbol.ownerId:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(d=e.builderBlock)==null?void 0:d.id},customComponents:v(),data:{...(u=e.symbol)==null?void 0:u.data,...e.builderContext.localState,...(m=i==null?void 0:i.data)==null?void 0:m.state},canTrack:e.builderContext.canTrack,model:(y=(s=e.symbol)==null?void 0:s.model)!=null?y:"",content:i,linkComponent:e.builderLinkComponent,blocksWrapper:t(),contentWrapper:c()})})}exports.default=I;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { useState as s, useEffect as C } from "react";
|
|
3
|
+
import { Content as K } from "./blocks-exports.mjs";
|
|
4
|
+
import { getClassPropName as S } from "./get-class-prop-name-2e01e11c.js";
|
|
5
|
+
import { fetchOneEntry as E, logger as N } from "./server-entry-954fe774.js";
|
|
6
|
+
const W = async ({
|
|
7
|
+
builderContextValue: t,
|
|
8
|
+
symbol: e
|
|
9
|
+
}) => {
|
|
10
|
+
if (e != null && e.model && // This is a hack, we should not need to check for this, but it is needed for Svelte.
|
|
11
|
+
(t != null && t.apiKey))
|
|
12
|
+
return E({
|
|
13
|
+
model: e.model,
|
|
14
|
+
apiKey: e.global && e.ownerId ? e.ownerId : t.apiKey,
|
|
15
|
+
apiVersion: t.apiVersion,
|
|
16
|
+
...(e == null ? void 0 : e.entry) && {
|
|
17
|
+
query: {
|
|
18
|
+
id: e.entry
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}).catch((r) => {
|
|
22
|
+
N.error("Could not fetch symbol content: ", r);
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
function q(t) {
|
|
26
|
+
var a, c, l, d, m, u, y;
|
|
27
|
+
function e() {
|
|
28
|
+
return "div";
|
|
29
|
+
}
|
|
30
|
+
function r() {
|
|
31
|
+
return "div";
|
|
32
|
+
}
|
|
33
|
+
function v() {
|
|
34
|
+
return Object.values(t.builderComponents);
|
|
35
|
+
}
|
|
36
|
+
function k() {
|
|
37
|
+
var n, i;
|
|
38
|
+
return [
|
|
39
|
+
t.attributes[S()],
|
|
40
|
+
"builder-symbol",
|
|
41
|
+
(n = t.symbol) != null && n.inline ? "builder-inline-symbol" : void 0,
|
|
42
|
+
(i = t.symbol) != null && i.dynamic || t.dynamic ? "builder-dynamic-symbol" : void 0
|
|
43
|
+
].filter(Boolean).join(" ");
|
|
44
|
+
}
|
|
45
|
+
const [o, h] = s(() => {
|
|
46
|
+
var n;
|
|
47
|
+
return (n = t.symbol) == null ? void 0 : n.content;
|
|
48
|
+
}), [x, g] = s(() => {
|
|
49
|
+
var n;
|
|
50
|
+
return (n = t.symbol) == null ? void 0 : n.entry;
|
|
51
|
+
});
|
|
52
|
+
function I() {
|
|
53
|
+
var n;
|
|
54
|
+
o && x === ((n = t.symbol) == null ? void 0 : n.entry) || W({
|
|
55
|
+
symbol: t.symbol,
|
|
56
|
+
builderContextValue: t.builderContext
|
|
57
|
+
}).then((i) => {
|
|
58
|
+
var b;
|
|
59
|
+
i && (h(i), g((b = t.symbol) == null ? void 0 : b.entry));
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return C(() => {
|
|
63
|
+
}, []), C(() => {
|
|
64
|
+
I();
|
|
65
|
+
}, [t.symbol]), /* @__PURE__ */ f("div", { ...t.attributes, className: k(), children: /* @__PURE__ */ f(
|
|
66
|
+
K,
|
|
67
|
+
{
|
|
68
|
+
nonce: t.builderContext.nonce,
|
|
69
|
+
isNestedRender: !0,
|
|
70
|
+
apiVersion: t.builderContext.apiVersion,
|
|
71
|
+
apiKey: (a = t.symbol) != null && a.global && ((c = t.symbol) != null && c.ownerId) ? t.symbol.ownerId : t.builderContext.apiKey,
|
|
72
|
+
context: {
|
|
73
|
+
...t.builderContext.context,
|
|
74
|
+
symbolId: (l = t.builderBlock) == null ? void 0 : l.id
|
|
75
|
+
},
|
|
76
|
+
customComponents: v(),
|
|
77
|
+
data: {
|
|
78
|
+
...(d = t.symbol) == null ? void 0 : d.data,
|
|
79
|
+
...t.builderContext.localState,
|
|
80
|
+
...(m = o == null ? void 0 : o.data) == null ? void 0 : m.state
|
|
81
|
+
},
|
|
82
|
+
canTrack: t.builderContext.canTrack,
|
|
83
|
+
model: (y = (u = t.symbol) == null ? void 0 : u.model) != null ? y : "",
|
|
84
|
+
content: o,
|
|
85
|
+
linkComponent: t.builderLinkComponent,
|
|
86
|
+
blocksWrapper: e(),
|
|
87
|
+
contentWrapper: r()
|
|
88
|
+
}
|
|
89
|
+
) });
|
|
90
|
+
}
|
|
91
|
+
export {
|
|
92
|
+
q as default
|
|
93
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as d, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { useState as m } from "react";
|
|
3
|
-
import { Blocks as c } from "./blocks-
|
|
3
|
+
import { Blocks as c } from "./blocks-482bd303.js";
|
|
4
4
|
import "./blocks-exports.mjs";
|
|
5
|
-
import "./server-entry-
|
|
6
|
-
import "./get-class-prop-name-
|
|
5
|
+
import "./server-entry-954fe774.js";
|
|
6
|
+
import "./get-class-prop-name-2e01e11c.js";
|
|
7
7
|
import "./dynamic-renderer-8b343325.js";
|
|
8
8
|
function x(t) {
|
|
9
9
|
var b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),s=require("react"),r=require("./blocks-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),s=require("react"),r=require("./blocks-49400750.cjs");require("./blocks-exports.cjs");require("./server-entry-a2bf7e77.cjs");require("./get-class-prop-name-3347a655.cjs");require("./dynamic-renderer-b29b45ca.cjs");function d(e){var o;const[n,a]=s.useState(()=>e.defaultActiveTab?e.defaultActiveTab-1:0);function c(t){return e.tabs&&e.tabs[t].content}function u(t){return t===n?e.activeTabStyle:{}}function b(t){t===n&&e.collapsible?a(-1):a(t)}return l.jsxs("div",{children:[l.jsx("div",{className:"builder-tabs-wrap",style:{display:"flex",flexDirection:"row",justifyContent:e.tabHeaderLayout||"flex-start",overflow:"auto"},children:(o=e.tabs)==null?void 0:o.map((t,i)=>l.jsx("span",{className:`builder-tab-wrap ${n===i?"builder-tab-active":""}`,style:u(i),onClick:f=>b(i),children:l.jsx(r.Blocks,{parent:e.builderBlock.id,path:`tabs.${i}.label`,blocks:t.label,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})},i))}),c(n)?l.jsx("div",{children:l.jsx(r.Blocks,{parent:e.builderBlock.id,path:`tabs.${n}.content`,blocks:c(n),context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]})}exports.default=d;
|