@builder.io/sdk-react 3.0.3 → 3.0.5
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 +20 -20
- package/lib/browser/blocks-exports.mjs +517 -529
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/{server-entry-5eafc5bd.cjs → server-entry-101d66b8.cjs} +1 -1
- package/lib/browser/{server-entry-c904f136.js → server-entry-785c0408.js} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-032726a7.cjs → accordion-190c4426.cjs} +1 -1
- package/lib/edge/{accordion-c786f197.js → accordion-cd6e0363.js} +1 -1
- package/lib/edge/{blocks-827b0a87.cjs → blocks-766e8d45.cjs} +9 -9
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{blocks-105e50e5.js → blocks-fe2d7c1a.js} +2 -3
- package/lib/edge/{button-5cbfe22c.cjs → button-694fcd4f.cjs} +1 -1
- package/lib/edge/{button-f0e0ea72.js → button-6a27481c.js} +2 -2
- package/lib/edge/{columns-9e187314.js → columns-90e6407e.js} +18 -18
- package/lib/edge/{columns-d07da61d.cjs → columns-b38bf0f7.cjs} +2 -2
- package/lib/edge/{content-variants-0db90715.cjs → content-variants-4e385c19.cjs} +1 -1
- package/lib/edge/{content-variants-59dc0824.js → content-variants-cbb89349.js} +10 -10
- package/lib/edge/form-16bbf874.js +166 -0
- package/lib/edge/form-547645eb.cjs +1 -0
- package/lib/edge/{get-class-prop-name-8fb0e5ad.cjs → get-class-prop-name-58770197.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-6b143ec7.js → get-class-prop-name-8b719c6b.js} +1 -1
- package/lib/edge/{image-2a2b26d2.js → image-38917f45.js} +22 -24
- package/lib/edge/image-590e36ae.cjs +17 -0
- package/lib/edge/{img-72bf9d21.cjs → img-8859c851.cjs} +1 -1
- package/lib/edge/{img-2c4c6b78.js → img-d3351743.js} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-752f3ce9.js → input-24c601b4.js} +1 -1
- package/lib/edge/{input-6eca8427.cjs → input-4fe0fc6d.cjs} +1 -1
- package/lib/edge/{select-a1d6e80e.js → select-af05377b.js} +1 -1
- package/lib/edge/{select-49a73a0b.cjs → select-c73bd418.cjs} +1 -1
- package/lib/edge/{server-entry-6b2058e2.cjs → server-entry-3c7fa63a.cjs} +1 -1
- package/lib/edge/{server-entry-35f12729.js → server-entry-67bfc740.js} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-b9bcbd41.js → slot-32a4df0c.js} +3 -3
- package/lib/edge/{slot-2327e009.cjs → slot-759c8dd9.cjs} +1 -1
- package/lib/edge/{symbol-33e7736f.js → symbol-50360a37.js} +2 -2
- package/lib/edge/{symbol-3527699b.cjs → symbol-8d63aa7d.cjs} +1 -1
- package/lib/edge/{tabs-bc422e4c.js → tabs-6535c934.js} +3 -3
- package/lib/edge/{tabs-2df0eaa2.cjs → tabs-fc6c1700.cjs} +1 -1
- package/lib/edge/video-4ecfd08b.cjs +1 -0
- package/lib/edge/{video-58c2cc8d.js → video-a3f10439.js} +0 -1
- package/lib/node/blocks-exports.cjs +14 -14
- package/lib/node/blocks-exports.mjs +500 -512
- 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-606ce65a.cjs → server-entry-95273908.cjs} +1 -1
- package/lib/node/{server-entry-d1ed35c5.js → server-entry-ffc70868.js} +1 -1
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/lib/node/{setIvm-6675714a.js → setIvm-2cea7252.js} +1 -1
- package/lib/node/{setIvm-e4deba11.cjs → setIvm-4ce0db03.cjs} +1 -1
- package/lib/node/setIvm.cjs +1 -1
- package/lib/node/setIvm.mjs +2 -2
- package/lib/node/{should-force-browser-runtime-in-node-75b2b3a0.js → should-force-browser-runtime-in-node-c0d50009.js} +1 -1
- package/lib/node/{should-force-browser-runtime-in-node-03adae17.cjs → should-force-browser-runtime-in-node-d3e6df07.cjs} +1 -1
- package/package.json +2 -2
- package/types/blocks/form/form/form.d.ts +1 -0
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/types/components.d.ts +2 -2
- package/lib/edge/form-79639135.cjs +0 -1
- package/lib/edge/form-7a7b98cf.js +0 -176
- package/lib/edge/image-4db81d72.cjs +0 -17
- package/lib/edge/video-e20dcbbc.cjs +0 -1
package/lib/browser/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./blocks-exports.cjs"),e=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./blocks-exports.cjs"),e=require("./server-entry-101d66b8.cjs");require("react/jsx-runtime");require("react");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;
|
package/lib/browser/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Blocks as i, BuilderContext as s, Button as n, Columns as c, Content as m, Fragment as g, Image as a, Section as d, Symbol as l, Text as p, Video as u } from "./blocks-exports.mjs";
|
|
2
|
-
import { _processContentResult as B, createRegisterComponentMessage as C, fetchBuilderProps as E, fetchEntries as h, fetchOneEntry as x, getBuilderSearchParams as S, isEditing as b, isPreviewing as P, register as k, setEditorSettings as y, subscribeToEditor as R, track as T } from "./server-entry-
|
|
2
|
+
import { _processContentResult as B, createRegisterComponentMessage as C, fetchBuilderProps as E, fetchEntries as h, fetchOneEntry as x, getBuilderSearchParams as S, isEditing as b, isPreviewing as P, register as k, setEditorSettings as y, subscribeToEditor as R, track as T } from "./server-entry-785c0408.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
export {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const w="react",I="[Builder.io]: ",d={log:(...t)=>console.log(I,...t),error:(...t)=>console.error(I,...t),warn:(...t)=>console.warn(I,...t),debug:(...t)=>console.debug(I,...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:P(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 P(t){return JSON.parse(JSON.stringify(t,(e,n)=>typeof n=="function"?bt(n):n))}const U={};function W(t,e){t==="plugin"&&(e=P(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 vt(t){if(c()){Object.assign(L,t);const e={type:"builder.settingsChange",data:L};parent.postMessage(e,"*")}}const F="builder.",It="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(It,"");n[s]=e[r]}}),n},kt=()=>{if(!c())return{};const t=new URLSearchParams(window.location.search);return O(t)},_="3.0.
|
|
1
|
+
"use strict";const w="react",I="[Builder.io]: ",d={log:(...t)=>console.log(I,...t),error:(...t)=>console.error(I,...t),warn:(...t)=>console.warn(I,...t),debug:(...t)=>console.debug(I,...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:P(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 P(t){return JSON.parse(JSON.stringify(t,(e,n)=>typeof n=="function"?bt(n):n))}const U={};function W(t,e){t==="plugin"&&(e=P(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 vt(t){if(c()){Object.assign(L,t);const e={type:"builder.settingsChange",data:L};parent.postMessage(e,"*")}}const F="builder.",It="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(It,"");n[s]=e[r]}}),n},kt=()=>{if(!c())return{};const t=new URLSearchParams(window.location.search);return O(t)},_="3.0.5",$=()=>({"X-Builder-SDK":w,"X-Builder-SDK-GEN":"2","X-Builder-SDK-Version":_}),Et=t=>{if(t==="localhost"||t==="127.0.0.1")return t;const e=t.split(".");return e.length>2?e.slice(1).join("."):t},G=({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}},z=async t=>G(t),At=t=>t.map(([e,n])=>n?`${e}=${n}`:e).filter(p).join("; "),Pt=[["secure",""],["SameSite","None"]],Ot=({name:t,value:e,expires:n})=>{const s=(c()?location.protocol==="https:":!0)?Pt:[[]],o=n?[["expires",n.toUTCString()]]:[[]],i=[[t,e],...o,["path","/"],["domain",Et(window.location.hostname)],...s];return At(i)},H=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 J(){return Ct().replace(/-/g,"")}const X="builderSessionId",Tt=async({canTrack:t})=>{if(!t)return;const e=await z({name:X,canTrack:t});if(p(e))return e;{const n=xt();return Bt({id:n,canTrack:t}),n}},xt=()=>J(),Bt=({id:t,canTrack:e})=>H({name:X,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=()=>J(),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",...$()},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,k=new Function(u);let l,h=null;try{l=k.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}`,$t=({contentId:t})=>z({name:C(t),canTrack:!0}),Gt=({contentId:t})=>G({name:C(t),canTrack:!0}),zt=({contentId:t,value:e})=>H({name:C(t),value:e,canTrack:!0}),rt=t=>p(t.id)&&p(t.variations)&&Object.keys(t.variations).length>0,Ht=({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=Ht(t);return zt({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":"")}},Jt=({item:t,canTrack:e})=>{if(!e)return t;if(!t)return;if(!rt(t))return t;const n=Gt({contentId:t.id})||st({variations:t.variations,id:t.id}),r=ot({item:t,testGroupId:n});return{...t,...r}},Xt=async({item:t,canTrack:e})=>{if(!e||!rt(t))return t;const r=await $t({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 A(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,...A(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:k,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 E=u||(n==null?void 0:n.locale);let y=n||{};if(E&&(a.searchParams.set("locale",E),y={locale:E,...y}),i&&a.searchParams.set("enrich",String(i)),a.searchParams.set("omit",k||"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=A({sort:b});for(const v in f)a.searchParams.set(v,JSON.stringify(f[v]))}const B={...kt(),...M(t.options||{})};y={...y,...ne(B)};const R=A(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 v in f)a.searchParams.set(v,JSON.stringify(f[v]))}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,...$()}};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 Xt({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.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=Jt;exports.isBrowser=c;exports.isEditing=K;exports.isPreviewing=wt;exports.logFetch=Z;exports.logger=d;exports.register=W;exports.registerInsertMenu=jt;exports.serializeIncludingFunctions=P;exports.setEditorSettings=vt;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.
|
|
115
|
+
}, K = "3.0.5", 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-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./server-entry-101d66b8.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-
|
|
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-785c0408.js";
|
|
2
2
|
export {
|
|
3
3
|
r as _processContentResult,
|
|
4
4
|
s as createRegisterComponentMessage,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),j=require("react"),g=require("./blocks-exports.cjs");require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),j=require("react"),g=require("./blocks-exports.cjs");require("./server-entry-3c7fa63a.cjs");function S(e){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(i,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}return i.default=e,Object.freeze(i)}const v=S(j),y=e=>e.toString();function p(e){var u;const[i,r]=j.useState(()=>[]);function s(){return!!(e.grid||e.oneAtATime)}function O(){return{display:"flex",alignItems:"stretch",flexDirection:"column",...e.grid&&{flexDirection:"row",alignItems:"flex-start",flexWrap:"wrap"}}}function C(){const n={...{display:"flex",flexDirection:"column"},alignItems:"stretch",cursor:"pointer"};return Object.fromEntries(Object.entries(n).filter(([l,a])=>a!==void 0))}function h(t){return`builder-accordion-title builder-accordion-title-${i.includes(t)?"open":"closed"}`}function k(t){return`builder-accordion-detail builder-accordion-detail-${i.includes(t)?"open":"closed"}`}function d(){let t=null;if(e.grid&&i.length&&document){const l=i[0];let o=document.querySelector(`.builder-accordion-title[data-index="${l}"]`);if(t=l,o){let m=o.getBoundingClientRect();for(;o=o&&o.nextElementSibling;)if(o){if(o.classList.contains("builder-accordion-detail"))continue;const f=o.getBoundingClientRect();if(f.left>m.left){const b=parseInt(o.getAttribute("data-index")||"",10);isNaN(b)||(m=f,t=b)}else break}}}return typeof t=="number"&&(t=t+1),t}function I(){const t={order:typeof d()=="number"?d():void 0,...e.grid&&{width:"100%"}};return Object.fromEntries(Object.entries(t).filter(([n,l])=>l!==void 0))}function x(t){i.includes(t)?r(s()?[]:i.filter(n=>n!==t)):r(s()?[t]:i.concat(t))}return c.jsx("div",{className:"builder-accordion",style:O(),children:(u=e.items)==null?void 0:u.map((t,n)=>c.jsxs(v.Fragment,{children:[c.jsx("div",{className:h(n),style:{...C(),...e.grid&&{width:e.gridRowWidth,order:d()!==null?y(n):y(n+1)}},"data-index":n,onClick:l=>x(n),children:c.jsx(g.Blocks,{blocks:t.title,path:`items.${n}.title`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}),i.includes(n)?c.jsx("div",{className:k(n),style:I(),children:c.jsx(g.Blocks,{blocks:t.detail,path:`items.${n}.detail`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]},n))})}exports.default=p;
|
|
@@ -2,7 +2,7 @@ import { jsx as l, jsxs as j } from "react/jsx-runtime";
|
|
|
2
2
|
import * as p from "react";
|
|
3
3
|
import { useState as x } from "react";
|
|
4
4
|
import { Blocks as g } from "./blocks-exports.mjs";
|
|
5
|
-
import "./server-entry-
|
|
5
|
+
import "./server-entry-67bfc740.js";
|
|
6
6
|
const y = (t) => t.toString();
|
|
7
7
|
function B(t) {
|
|
8
8
|
var a;
|