@builder.io/sdk-react 0.13.2 → 0.13.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/index.cjs +8 -8
- package/lib/browser/index.mjs +90 -90
- package/lib/browser/{server-entry-be000726.js → server-entry-2a8acf68.js} +1 -1
- package/lib/browser/{server-entry-af9b0dd3.cjs → server-entry-881c178e.cjs} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/index.cjs +13 -13
- package/lib/edge/index.mjs +105 -105
- package/lib/edge/{server-entry-b02b5197.js → server-entry-13732838.js} +1 -1
- package/lib/edge/{server-entry-af9b0dd3.cjs → server-entry-881c178e.cjs} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/node/index.cjs +6 -6
- package/lib/node/index.mjs +283 -283
- package/lib/node/{server-entry-6e7475d7.cjs → server-entry-ad7cbbbf.cjs} +1 -1
- package/lib/node/{server-entry-9969d641.js → server-entry-c8223f30.js} +1 -1
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/package.json +1 -1
- package/types/blocks/columns/columns.d.ts +1 -2
- package/types/blocks/columns/columns.types.d.ts +2 -2
- package/types/blocks/form/form/form.d.ts +3 -3
- package/types/blocks/slot/slot.d.ts +3 -3
- package/types/blocks/symbol/symbol.d.ts +1 -2
- package/types/blocks/symbol/symbol.types.d.ts +2 -2
- package/types/components/block/components/block-wrapper.d.ts +2 -2
- package/types/components/block/components/component-ref/component-ref.helpers.d.ts +3 -3
- package/types/components/block/components/interactive-element.d.ts +3 -2
- package/types/components/blocks/blocks-wrapper.d.ts +2 -2
- package/types/components/content/content.types.d.ts +1 -8
- package/types/components/content/contentProps.types.d.ts +12 -0
- package/types/components/dynamic-renderer/dynamic-renderer.d.ts +4 -3
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/types/builder-props.d.ts +1 -1
- package/types/types/input.d.ts +1 -0
- package/types/types/typescript.d.ts +0 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";const S="react",v="[Builder.io]: ",u={log:(...e)=>console.log(v,...e),error:(...e)=>console.error(v,...e),warn:(...e)=>console.warn(v,...e),debug:(...e)=>console.debug(v,...e)};function a(){return typeof window!="undefined"&&typeof document!="undefined"}function ce(){return a()&&window.self!==window.top}function C(){return ce()&&window.location.search.indexOf("builder.frameEditing=")!==-1}const ue=()=>{if(a()){const e=new URL(location.href);return e.pathname===""&&(e.pathname="/"),e}else return console.warn("Cannot get location for tracking in non-browser environment"),null},de=()=>typeof navigator=="object"&&navigator.userAgent||"",$=()=>{const e=de(),t={Android(){return e.match(/Android/i)},BlackBerry(){return e.match(/BlackBerry/i)},iOS(){return e.match(/iPhone|iPod/i)},Opera(){return e.match(/Opera Mini/i)},Windows(){return e.match(/IEMobile/i)||e.match(/WPDesktop/i)},any(){return t.Android()||t.BlackBerry()||t.iOS()||t.Opera()||t.Windows()||S==="reactNative"}},n=e.match(/Tablet|iPad/i),r=ue();return{urlPath:r==null?void 0:r.pathname,host:(r==null?void 0:r.host)||(r==null?void 0:r.hostname),device:n?"tablet":t.any()?"mobile":"desktop"}},O=e=>JSON.parse(JSON.stringify(e)),h=e=>e!=null,le=e=>{if(e==="localhost"||e==="127.0.0.1")return e;const t=e.split(".");return t.length>2?t.slice(1).join("."):e},j=({name:e,canTrack:t})=>{var n;try{return t?(n=document.cookie.split("; ").find(r=>r.startsWith(`${e}=`)))==null?void 0:n.split("=")[1]:void 0}catch(r){u.warn("[COOKIE] GET error: ",(r==null?void 0:r.message)||r);return}},K=async e=>j(e),fe=e=>e.map(([t,n])=>n?`${t}=${n}`:t).filter(h).join("; "),ge=[["secure",""],["SameSite","None"]],he=({name:e,value:t,expires:n})=>{const o=(a()?location.protocol==="https:":!0)?ge:[[]],s=n?[["expires",n.toUTCString()]]:[[]],i=[[e,t],...s,["path","/"],["domain",le(window.location.hostname)],...o];return fe(i)},_=async({name:e,value:t,expires:n,canTrack:r})=>{try{if(!r)return;const o=he({name:e,value:t,expires:n});document.cookie=o}catch(o){u.warn("[COOKIE] SET error: ",(o==null?void 0:o.message)||o)}},pe="builder.tests",T=e=>`${pe}.${e}`,me=({contentId:e})=>K({name:T(e),canTrack:!0}),ye=({contentId:e})=>j({name:T(e),canTrack:!0}),we=({contentId:e,value:t})=>_({name:T(e),value:t,canTrack:!0}),W=e=>h(e.id)&&h(e.variations)&&Object.keys(e.variations).length>0,be=({id:e,variations:t})=>{var o;let n=0;const r=Math.random();for(const s in t){const i=(o=t[s])==null?void 0:o.testRatio;if(n+=i,r<n)return s}return e},G=e=>{const t=be(e);return we({contentId:e.id,value:t}).catch(n=>{u.error("could not store A/B test variation: ",n)}),t},J=({item:e,testGroupId:t})=>{const n=e.variations[t];return t===e.id||!n?{testVariationId:e.id,testVariationName:"Default"}:{data:n.data,testVariationId:n.id,testVariationName:n.name||(n.id===e.id?"Default":"")}},Se=({item:e,canTrack:t})=>{if(!t)return e;if(!e)return;if(!W(e))return e;const n=ye({contentId:e.id})||G({variations:e.variations,id:e.id}),r=J({item:e,testGroupId:n});return{...e,...r}},Ie=async({item:e,canTrack:t})=>{if(!t||!W(e))return e;const r=await me({contentId:e.id})||G({variations:e.variations,id:e.id}),o=J({item:e,testGroupId:r});return{...e,...o}},z=e=>h(e)?e:!0,ve=[],Ee=e=>({type:"builder.registerComponent",data:H(e)}),ke=e=>{const t=e.toString().trim();return`return (${!t.startsWith("function")&&!t.startsWith("(")?"function ":""}${t}).apply(this, arguments)`},Ce=e=>typeof e=="function"?ke(e):O(e),H=({inputs:e,...t})=>({...O(t),inputs:e==null?void 0:e.map(n=>Object.entries(n).reduce((r,[o,s])=>({...r,[o]:Ce(s)}),{}))});function Oe(){return typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:globalThis}function Te(){const e=Oe().fetch;if(typeof e=="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
|
-
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`),new Error("Builder SDK could not find a global `fetch` function");return e}const X=Te();function E(e,t=null,n="."){return Object.keys(e).reduce((r,o)=>{const s=e[o],i=[t,o].filter(Boolean).join(n);return[typeof s=="object",s!==null,!(Array.isArray(s)&&s.length===0)].every(Boolean)?{...r,...E(s,i,n)}:{...r,[i]:s}},{})}const Ae="v3",M="builder.",Pe="options.",xe=e=>{const t={};return e.forEach((n,r)=>{t[r]=n}),t},A=e=>{if(!e)return{};const t=q(e),n={};return Object.keys(t).forEach(r=>{if(r.startsWith(M)){const o=r.replace(M,"").replace(Pe,"");n[o]=t[r]}}),n},Re=()=>{if(!a())return{};const e=new URLSearchParams(window.location.search);return A(e)},q=e=>e instanceof URLSearchParams?xe(e):e,U=e=>typeof e=="number"&&!isNaN(e)&&e>=0,P=e=>{let{noTraverse:t=!1}=e;const{limit:n=30,userAttributes:r,query:o,model:s,apiKey:i,includeRefs:f=!0,enrich:I,locale:p,apiVersion:y=Ae,fields:d,omit:w,offset:g,cacheSeconds:m,staleCacheSeconds:k,sort:B,includeUnpublished:L}=e;if(!i)throw new Error("Missing API key");if(!["v3"].includes(y))throw new Error(`Invalid apiVersion: expected 'v3', received '${y}'`);(e.limit===void 0||e.limit>1)&&!("noTraverse"in e)&&(t=!0);const c=new URL(`https://cdn.builder.io/api/${y}/content/${s}?apiKey=${i}&limit=${n}&noTraverse=${t}&includeRefs=${f}${p?`&locale=${p}`:""}${I?`&enrich=${I}`:""}`);if(c.searchParams.set("omit",w||"meta.componentsUsed"),d&&c.searchParams.set("fields",d),Number.isFinite(g)&&g>-1&&c.searchParams.set("offset",String(Math.floor(g))),typeof L=="boolean"&&c.searchParams.set("includeUnpublished",String(L)),m&&U(m)&&c.searchParams.set("cacheSeconds",String(m)),k&&U(k)&&c.searchParams.set("staleCacheSeconds",String(k)),B){const l=E({sort:B});for(const b in l)c.searchParams.set(b,JSON.stringify(l[b]))}const ae={...Re(),...q(e.options||{})},V=E(ae);for(const l in V)c.searchParams.set(l,String(V[l]));if(r&&c.searchParams.set("userAttributes",JSON.stringify(r)),o){const l=E({query:o});for(const b in l)c.searchParams.set(b,JSON.stringify(l[b]))}return c},Be=e=>"results"in e;async function x(e){const t=await R({...e,limit:1});return t&&t[0]||null}const Le=x,Ve=async e=>{const t=P(e);return await(await X(t.href)).json()},Y=async(e,t,n=P(e))=>{const r=z(e.canTrack);if(n.search.includes("preview="),!r||!(a()||S==="reactNative"))return t.results;try{const o=[];for(const s of t.results)o.push(await Ie({item:s,canTrack:r}));t.results=o}catch(o){u.error("Could not process A/B tests. ",o)}return t.results};async function R(e){try{const t=P(e),n=await Ve(e);return Be(n)?Y(e,n):(u.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return u.error("Error fetching data. ",t),null}}const Me=R;function Ue(){return!a()||C()?!1:location.search.indexOf("builder.preview=")!==-1}function Fe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}function Q(){return Fe().replace(/-/g,"")}const Z="builderSessionId",Ne=async({canTrack:e})=>{if(!e)return;const t=await K({name:Z,canTrack:e});if(h(t))return t;{const n=De();return $e({id:n,canTrack:e}),n}},De=()=>Q(),$e=({id:e,canTrack:t})=>_({name:Z,value:e,canTrack:t}),ee=()=>a()&&typeof localStorage!="undefined"?localStorage:void 0,je=({key:e,canTrack:t})=>{var n;try{return t?(n=ee())==null?void 0:n.getItem(e):void 0}catch(r){console.debug("[LocalStorage] GET error: ",r);return}},Ke=({key:e,canTrack:t,value:n})=>{var r;try{t&&((r=ee())==null||r.setItem(e,n))}catch(o){console.debug("[LocalStorage] SET error: ",o)}},te="builderVisitorId",_e=({canTrack:e})=>{if(!e)return;const t=je({key:te,canTrack:e});if(h(t))return t;{const n=We();return Ge({id:n,canTrack:e}),n}},We=()=>Q(),Ge=({id:e,canTrack:t})=>Ke({key:te,value:e,canTrack:t}),Je=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await Ne({canTrack:e}),n=_e({canTrack:e});return{sessionId:t,visitorId:n}},ze=async({type:e,canTrack:t,apiKey:n,metadata:r,...o})=>({type:e,data:{...o,metadata:{url:location.href,...r},...await Je({canTrack:t}),userAttributes:$(),ownerId:n}});async function ne(e){if(!e.apiKey){u.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!C()&&(a()||S==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await ze(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const He=e=>ne({...e,canTrack:!0}),Xe=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function re(e,t){const n=new URL(t.origin),r=n.hostname;return(e||Xe).findIndex(o=>o.startsWith("*.")?r.endsWith(o.slice(1)):o===r)>-1}const qe="0.13.
|
|
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 e}const X=Te();function E(e,t=null,n="."){return Object.keys(e).reduce((r,o)=>{const s=e[o],i=[t,o].filter(Boolean).join(n);return[typeof s=="object",s!==null,!(Array.isArray(s)&&s.length===0)].every(Boolean)?{...r,...E(s,i,n)}:{...r,[i]:s}},{})}const Ae="v3",M="builder.",Pe="options.",xe=e=>{const t={};return e.forEach((n,r)=>{t[r]=n}),t},A=e=>{if(!e)return{};const t=q(e),n={};return Object.keys(t).forEach(r=>{if(r.startsWith(M)){const o=r.replace(M,"").replace(Pe,"");n[o]=t[r]}}),n},Re=()=>{if(!a())return{};const e=new URLSearchParams(window.location.search);return A(e)},q=e=>e instanceof URLSearchParams?xe(e):e,U=e=>typeof e=="number"&&!isNaN(e)&&e>=0,P=e=>{let{noTraverse:t=!1}=e;const{limit:n=30,userAttributes:r,query:o,model:s,apiKey:i,includeRefs:f=!0,enrich:I,locale:p,apiVersion:y=Ae,fields:d,omit:w,offset:g,cacheSeconds:m,staleCacheSeconds:k,sort:B,includeUnpublished:L}=e;if(!i)throw new Error("Missing API key");if(!["v3"].includes(y))throw new Error(`Invalid apiVersion: expected 'v3', received '${y}'`);(e.limit===void 0||e.limit>1)&&!("noTraverse"in e)&&(t=!0);const c=new URL(`https://cdn.builder.io/api/${y}/content/${s}?apiKey=${i}&limit=${n}&noTraverse=${t}&includeRefs=${f}${p?`&locale=${p}`:""}${I?`&enrich=${I}`:""}`);if(c.searchParams.set("omit",w||"meta.componentsUsed"),d&&c.searchParams.set("fields",d),Number.isFinite(g)&&g>-1&&c.searchParams.set("offset",String(Math.floor(g))),typeof L=="boolean"&&c.searchParams.set("includeUnpublished",String(L)),m&&U(m)&&c.searchParams.set("cacheSeconds",String(m)),k&&U(k)&&c.searchParams.set("staleCacheSeconds",String(k)),B){const l=E({sort:B});for(const b in l)c.searchParams.set(b,JSON.stringify(l[b]))}const ae={...Re(),...q(e.options||{})},V=E(ae);for(const l in V)c.searchParams.set(l,String(V[l]));if(r&&c.searchParams.set("userAttributes",JSON.stringify(r)),o){const l=E({query:o});for(const b in l)c.searchParams.set(b,JSON.stringify(l[b]))}return c},Be=e=>"results"in e;async function x(e){const t=await R({...e,limit:1});return t&&t[0]||null}const Le=x,Ve=async e=>{const t=P(e);return await(await X(t.href)).json()},Y=async(e,t,n=P(e))=>{const r=z(e.canTrack);if(n.search.includes("preview="),!r||!(a()||S==="reactNative"))return t.results;try{const o=[];for(const s of t.results)o.push(await Ie({item:s,canTrack:r}));t.results=o}catch(o){u.error("Could not process A/B tests. ",o)}return t.results};async function R(e){try{const t=P(e),n=await Ve(e);return Be(n)?Y(e,n):(u.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return u.error("Error fetching data. ",t),null}}const Me=R;function Ue(){return!a()||C()?!1:location.search.indexOf("builder.preview=")!==-1}function Fe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}function Q(){return Fe().replace(/-/g,"")}const Z="builderSessionId",Ne=async({canTrack:e})=>{if(!e)return;const t=await K({name:Z,canTrack:e});if(h(t))return t;{const n=De();return $e({id:n,canTrack:e}),n}},De=()=>Q(),$e=({id:e,canTrack:t})=>_({name:Z,value:e,canTrack:t}),ee=()=>a()&&typeof localStorage!="undefined"?localStorage:void 0,je=({key:e,canTrack:t})=>{var n;try{return t?(n=ee())==null?void 0:n.getItem(e):void 0}catch(r){console.debug("[LocalStorage] GET error: ",r);return}},Ke=({key:e,canTrack:t,value:n})=>{var r;try{t&&((r=ee())==null||r.setItem(e,n))}catch(o){console.debug("[LocalStorage] SET error: ",o)}},te="builderVisitorId",_e=({canTrack:e})=>{if(!e)return;const t=je({key:te,canTrack:e});if(h(t))return t;{const n=We();return Ge({id:n,canTrack:e}),n}},We=()=>Q(),Ge=({id:e,canTrack:t})=>Ke({key:te,value:e,canTrack:t}),Je=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await Ne({canTrack:e}),n=_e({canTrack:e});return{sessionId:t,visitorId:n}},ze=async({type:e,canTrack:t,apiKey:n,metadata:r,...o})=>({type:e,data:{...o,metadata:{url:location.href,...r},...await Je({canTrack:t}),userAttributes:$(),ownerId:n}});async function ne(e){if(!e.apiKey){u.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!C()&&(a()||S==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await ze(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const He=e=>ne({...e,canTrack:!0}),Xe=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function re(e,t){const n=new URL(t.origin),r=n.hostname;return(e||Xe).findIndex(o=>o.startsWith("*.")?r.endsWith(o.slice(1)):o===r)>-1}const qe="0.13.4",F={};function oe(e,t){let n=F[e];if(n||(n=F[e]=[]),n.push(t),a()){const r={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(r,"*"),parent!==window&&window.postMessage(r,"*")}catch(o){console.debug("Could not postmessage",o)}}}const Ye=()=>{oe("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 N=!1;const se=(e={})=>{var t,n;N||(N=!0,a()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:S,version:qe,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",r=>{var s,i;if(!re(e.trustedHosts,r))return;const{data:o}=r;if(o!=null&&o.type)switch(o.type){case"builder.evaluate":{const f=o.data.text,I=o.data.arguments||[],p=o.data.id,y=new Function(f);let d,w=null;try{d=y.apply(null,I)}catch(g){w=g}w?(s=window.parent)==null||s.postMessage({type:"builder.evaluateError",data:{id:p,error:w.message}},"*"):d&&typeof d.then=="function"?d.then(g=>{var m;(m=window.parent)==null||m.postMessage({type:"builder.evaluateResult",data:{id:p,result:g}},"*")}).catch(console.error):(i=window.parent)==null||i.postMessage({type:"builder.evaluateResult",data:{result:d,id:p}},"*");break}}})))},ie=({model:e,trustedHosts:t,callbacks:n})=>r=>{if(!re(t,r))return;const{data:o}=r;if(o)switch(o.type){case"builder.configureSdk":{n.configureSdk(o.data);break}case"builder.triggerAnimation":{n.animation(o.data);break}case"builder.contentUpdate":{const s=o.data,i=s.key||s.alias||s.entry||s.modelName,f=s.data;i===e&&n.contentUpdate(f);break}}},Qe=(e,t,n)=>{if(!a)return u.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};se();const r=ie({callbacks:{contentUpdate:t,animation:()=>{},configureSdk:()=>{}},model:e,trustedHosts:n==null?void 0:n.trustedHosts});return window.addEventListener("message",r),()=>{window.removeEventListener("message",r)}},D={};function Ze(e){if(a()){Object.assign(D,e);const t={type:"builder.settingsChange",data:D};parent.postMessage(t,"*")}}const et=async e=>{var r,o,s;const t=e.path||((r=e.url)==null?void 0:r.pathname)||((o=e.userAttributes)==null?void 0:o.urlPath),n={...e,apiKey:e.apiKey,model:e.model||"page",userAttributes:{...e.userAttributes,...t?{urlPath:t}:{}},options:A(e.searchParams||((s=e.url)==null?void 0:s.searchParams)||e.options)};return{apiKey:n.apiKey,model:n.model,content:await x(n)}};exports.TARGET=S;exports._processContentResult=Y;exports._track=ne;exports.checkIsDefined=h;exports.components=ve;exports.createEditorListener=ie;exports.createRegisterComponentMessage=Ee;exports.fastClone=O;exports.fetch=X;exports.fetchBuilderProps=et;exports.fetchEntries=R;exports.fetchOneEntry=x;exports.getAllContent=Me;exports.getBuilderSearchParams=A;exports.getContent=Le;exports.getDefaultCanTrack=z;exports.getUserAttributes=$;exports.handleABTestingSync=Se;exports.isBrowser=a;exports.isEditing=C;exports.isPreviewing=Ue;exports.logger=u;exports.register=oe;exports.registerInsertMenu=Ye;exports.serializeComponentInfo=H;exports.setEditorSettings=Ze;exports.setupBrowserForEditing=se;exports.subscribeToEditor=Qe;exports.track=He;
|
|
@@ -478,7 +478,7 @@ function Y(e, t) {
|
|
|
478
478
|
const n = new URL(t.origin), r = n.hostname;
|
|
479
479
|
return (e || $e).findIndex((o) => o.startsWith("*.") ? r.endsWith(o.slice(1)) : o === r) > -1;
|
|
480
480
|
}
|
|
481
|
-
const je = "0.13.
|
|
481
|
+
const je = "0.13.4", B = {};
|
|
482
482
|
function De(e, t) {
|
|
483
483
|
let n = B[e];
|
|
484
484
|
if (n || (n = B[e] = []), n.push(t), i()) {
|
|
@@ -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-ad7cbbbf.cjs");exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getAllContent=e.getAllContent;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.getContent=e.getContent;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as t, c as a, f as r, d as i, e as n, h as o, g, j as c, i as d, a as f, r as h, s as l, b as E, t as p } from "./server-entry-
|
|
1
|
+
import { _ as t, c as a, f as r, d as i, e as n, h as o, g, j as c, i as d, a as f, r as h, s as l, b as E, t as p } from "./server-entry-c8223f30.js";
|
|
2
2
|
export {
|
|
3
3
|
t as _processContentResult,
|
|
4
4
|
a as createRegisterComponentMessage,
|
package/package.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type { PropsWithBuilderData } from "../../types/builder-props.js";
|
|
3
2
|
import type { ColumnProps } from "./columns.types.js";
|
|
4
|
-
declare function Columns(props:
|
|
3
|
+
declare function Columns(props: ColumnProps): React.JSX.Element;
|
|
5
4
|
export default Columns;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { BuilderBlock } from '../../types/builder-block.js';
|
|
2
|
-
import type { BuilderComponentsProp, BuilderLinkComponentProp } from '../../types/builder-props.js';
|
|
2
|
+
import type { BuilderComponentsProp, BuilderDataProps, BuilderLinkComponentProp } from '../../types/builder-props.js';
|
|
3
3
|
type Column = {
|
|
4
4
|
blocks: BuilderBlock[];
|
|
5
5
|
width?: number;
|
|
6
6
|
link?: string;
|
|
7
7
|
};
|
|
8
8
|
type StackColumnsAt = 'tablet' | 'mobile' | 'never';
|
|
9
|
-
export interface ColumnProps extends BuilderComponentsProp, BuilderLinkComponentProp {
|
|
9
|
+
export interface ColumnProps extends BuilderComponentsProp, BuilderLinkComponentProp, BuilderDataProps {
|
|
10
10
|
columns?: Column[];
|
|
11
11
|
space?: number;
|
|
12
12
|
stackColumnsAt?: StackColumnsAt;
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* This import is used by the Svelte SDK. Do not remove.
|
|
4
4
|
*/
|
|
5
|
-
export type FormProps =
|
|
5
|
+
export type FormProps = BuilderDataProps & BuilderComponentsProp & BuilderLinkComponentProp & {
|
|
6
6
|
attributes?: any;
|
|
7
7
|
name?: string;
|
|
8
8
|
action?: string;
|
|
@@ -22,12 +22,12 @@ export type FormProps = PropsWithBuilderData<BuilderComponentsProp & BuilderLink
|
|
|
22
22
|
sendingMessage?: BuilderBlock[];
|
|
23
23
|
resetFormOnSubmit?: boolean;
|
|
24
24
|
errorMessagePath?: string;
|
|
25
|
-
}
|
|
25
|
+
};
|
|
26
26
|
/**
|
|
27
27
|
* This import is used by the Svelte SDK. Do not remove.
|
|
28
28
|
*/
|
|
29
29
|
export type FormState = "unsubmitted" | "sending" | "success" | "error";
|
|
30
30
|
import type { BuilderBlock } from "../../../types/builder-block.js";
|
|
31
|
-
import type { BuilderComponentsProp,
|
|
31
|
+
import type { BuilderComponentsProp, BuilderDataProps, BuilderLinkComponentProp } from "../../../types/builder-props.js";
|
|
32
32
|
declare function FormComponent(props: FormProps): React.JSX.Element;
|
|
33
33
|
export default FormComponent;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
export type DropzoneProps =
|
|
2
|
+
export type DropzoneProps = BuilderDataProps & {
|
|
3
3
|
name: string;
|
|
4
4
|
attributes: any;
|
|
5
|
-
}
|
|
6
|
-
import type {
|
|
5
|
+
};
|
|
6
|
+
import type { BuilderDataProps } from "../../types/builder-props.js";
|
|
7
7
|
declare function Slot(props: DropzoneProps): React.JSX.Element;
|
|
8
8
|
export default Slot;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import type { PropsWithBuilderData } from "../../types/builder-props.js";
|
|
3
2
|
import type { SymbolProps } from "./symbol.types.js";
|
|
4
|
-
declare function Symbol(props:
|
|
3
|
+
declare function Symbol(props: SymbolProps): React.JSX.Element;
|
|
5
4
|
export default Symbol;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BuilderContent } from '../../types/builder-content.js';
|
|
2
|
-
import type { BuilderComponentsProp, BuilderLinkComponentProp } from '../../types/builder-props.js';
|
|
2
|
+
import type { BuilderComponentsProp, BuilderDataProps, BuilderLinkComponentProp } from '../../types/builder-props.js';
|
|
3
3
|
interface SymbolInfo {
|
|
4
4
|
model?: string;
|
|
5
5
|
entry?: string;
|
|
@@ -8,7 +8,7 @@ interface SymbolInfo {
|
|
|
8
8
|
inline?: boolean;
|
|
9
9
|
dynamic?: boolean;
|
|
10
10
|
}
|
|
11
|
-
export interface SymbolProps extends BuilderComponentsProp, BuilderLinkComponentProp {
|
|
11
|
+
export interface SymbolProps extends BuilderComponentsProp, BuilderDataProps, BuilderLinkComponentProp {
|
|
12
12
|
symbol?: SymbolInfo;
|
|
13
13
|
dataOnly?: boolean;
|
|
14
14
|
dynamic?: boolean;
|
|
@@ -4,12 +4,12 @@ type BlockWrapperProps = {
|
|
|
4
4
|
block: BuilderBlock;
|
|
5
5
|
context: BuilderContextInterface;
|
|
6
6
|
linkComponent: any;
|
|
7
|
+
children?: any;
|
|
7
8
|
};
|
|
8
9
|
/**
|
|
9
10
|
* This component renders a block's wrapper HTML element (from the block's `tagName` property).
|
|
10
11
|
*/
|
|
11
12
|
import type { BuilderContextInterface } from "../../../context/types.js";
|
|
12
13
|
import type { BuilderBlock } from "../../../types/builder-block.js";
|
|
13
|
-
|
|
14
|
-
declare function BlockWrapper(props: PropsWithChildren<BlockWrapperProps>): React.JSX.Element;
|
|
14
|
+
declare function BlockWrapper(props: BlockWrapperProps): React.JSX.Element;
|
|
15
15
|
export default BlockWrapper;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { BuilderContextInterface, RegisteredComponents } from '../../../../context/types.js';
|
|
2
2
|
import type { BuilderBlock } from '../../../../types/builder-block.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { BuilderDataProps } from '../../../../types/builder-props.js';
|
|
4
4
|
import type { InteractiveElementProps } from '../interactive-element';
|
|
5
|
-
type ComponentOptions =
|
|
5
|
+
type ComponentOptions = BuilderDataProps & {
|
|
6
6
|
[index: string]: any;
|
|
7
7
|
attributes?: {
|
|
8
8
|
[index: string]: any;
|
|
9
9
|
};
|
|
10
|
-
}
|
|
10
|
+
};
|
|
11
11
|
export interface ComponentProps {
|
|
12
12
|
componentRef: any;
|
|
13
13
|
componentOptions: ComponentOptions;
|
|
@@ -5,9 +5,10 @@ export type InteractiveElementProps = {
|
|
|
5
5
|
context: BuilderContextInterface;
|
|
6
6
|
wrapperProps: Dictionary<any>;
|
|
7
7
|
includeBlockProps: boolean;
|
|
8
|
+
children?: any;
|
|
8
9
|
};
|
|
9
10
|
import type { BuilderContextInterface } from "../../../context/types.js";
|
|
10
11
|
import type { BuilderBlock } from "../../../types/builder-block.js";
|
|
11
|
-
import type { Dictionary
|
|
12
|
-
declare function InteractiveElement(props:
|
|
12
|
+
import type { Dictionary } from "../../../types/typescript.js";
|
|
13
|
+
declare function InteractiveElement(props: InteractiveElementProps): React.JSX.Element;
|
|
13
14
|
export default InteractiveElement;
|
|
@@ -12,8 +12,8 @@ export type BlocksWrapperProps = {
|
|
|
12
12
|
* Additonal props to pass to `blocksWrapper`. Defaults to `{}`.
|
|
13
13
|
*/
|
|
14
14
|
BlocksWrapperProps: any;
|
|
15
|
+
children?: any;
|
|
15
16
|
};
|
|
16
17
|
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
17
|
-
|
|
18
|
-
declare function BlocksWrapper(props: PropsWithChildren<BlocksWrapperProps>): React.JSX.Element;
|
|
18
|
+
declare function BlocksWrapper(props: BlocksWrapperProps): React.JSX.Element;
|
|
19
19
|
export default BlocksWrapper;
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import type { BuilderRenderState } from '../../context/types.js';
|
|
2
|
-
|
|
3
|
-
import type { ContentVariantsPrps } from '../content-variants/content-variants.types.js';
|
|
4
|
-
interface InternalRenderProps {
|
|
5
|
-
showContent: boolean;
|
|
6
|
-
isSsrAbTest: boolean;
|
|
7
|
-
}
|
|
8
|
-
export type ContentProps = InternalRenderProps & EnforcePartials<ContentVariantsPrps>;
|
|
2
|
+
export type { ContentProps } from './contentProps.types.js';
|
|
9
3
|
export interface BuilderComponentStateChange {
|
|
10
4
|
state: BuilderRenderState;
|
|
11
5
|
ref: {
|
|
@@ -17,4 +11,3 @@ export interface BuilderComponentStateChange {
|
|
|
17
11
|
};
|
|
18
12
|
};
|
|
19
13
|
}
|
|
20
|
-
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { EnforcePartials } from '../../types/enforced-partials.js';
|
|
2
|
+
import type { ContentVariantsPrps } from '../content-variants/content-variants.types.js';
|
|
3
|
+
interface InternalRenderProps {
|
|
4
|
+
showContent: boolean;
|
|
5
|
+
isSsrAbTest: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* This is in a separate file so that we can override it (most notably in Vue,
|
|
9
|
+
* where prop types cannot be wrapped by generics like `EnforcePartials`).
|
|
10
|
+
*/
|
|
11
|
+
export type ContentProps = InternalRenderProps & EnforcePartials<ContentVariantsPrps>;
|
|
12
|
+
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
export interface DynamicRendererProps {
|
|
3
|
+
children?: any;
|
|
4
4
|
TagName: any;
|
|
5
5
|
attributes: any;
|
|
6
6
|
actionAttributes: any;
|
|
7
|
-
}
|
|
7
|
+
}
|
|
8
|
+
declare function DynamicRenderer(props: DynamicRendererProps): React.JSX.Element;
|
|
8
9
|
export default DynamicRenderer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.13.
|
|
1
|
+
export declare const SDK_VERSION = "0.13.4";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BuilderContextInterface, RegisteredComponents } from '../context/types.js';
|
|
2
2
|
import type { BuilderBlock } from './builder-block.js';
|
|
3
|
-
export type
|
|
3
|
+
export type BuilderDataProps = {
|
|
4
4
|
builderBlock: BuilderBlock;
|
|
5
5
|
builderContext: BuilderContextInterface;
|
|
6
6
|
};
|
package/types/types/input.d.ts
CHANGED