@builder.io/sdk-react 0.13.1 → 0.13.2
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 +27 -27
- package/lib/browser/index.mjs +1422 -842
- package/lib/browser/{server-entry-85583984.cjs → server-entry-af9b0dd3.cjs} +1 -1
- package/lib/browser/{server-entry-290b7c02.js → server-entry-be000726.js} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/index.cjs +37 -37
- package/lib/edge/index.mjs +2374 -1794
- package/lib/edge/{server-entry-85583984.cjs → server-entry-af9b0dd3.cjs} +1 -1
- package/lib/edge/{server-entry-0b9553c7.js → server-entry-b02b5197.js} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/node/index.cjs +15 -15
- package/lib/node/index.mjs +1251 -671
- package/lib/node/{server-entry-aa797118.cjs → server-entry-6e7475d7.cjs} +1 -1
- package/lib/node/{server-entry-2b34a58b.js → server-entry-9969d641.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/form/form/component-info.d.ts +2 -0
- package/types/blocks/form/form/form.d.ts +33 -0
- package/types/blocks/form/input/component-info.d.ts +2 -0
- package/types/blocks/form/select/component-info.d.ts +2 -0
- package/types/blocks/form/submit-button/component-info.d.ts +2 -0
- package/types/blocks/slot/slot.d.ts +3 -6
- package/types/constants/extra-components.d.ts +7 -0
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/functions/get-env.d.ts +2 -0
- package/types/functions/get.d.ts +1 -0
- package/types/blocks/form/component-info.d.ts +0 -2
- package/types/blocks/form/form.d.ts +0 -3
- package/types/blocks/input/component-info.d.ts +0 -2
- package/types/blocks/select/component-info.d.ts +0 -2
- package/types/blocks/submit-button/component-info.d.ts +0 -2
- /package/types/blocks/{input → form/input}/input.d.ts +0 -0
- /package/types/blocks/{select → form/select}/select.d.ts +0 -0
- /package/types/blocks/{submit-button → form/submit-button}/submit-button.d.ts +0 -0
|
@@ -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.2",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.2", 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-6e7475d7.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-9969d641.js";
|
|
2
2
|
export {
|
|
3
3
|
t as _processContentResult,
|
|
4
4
|
a as createRegisterComponentMessage,
|
package/package.json
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* This import is used by the Svelte SDK. Do not remove.
|
|
4
|
+
*/
|
|
5
|
+
export type FormProps = PropsWithBuilderData<BuilderComponentsProp & BuilderLinkComponentProp & {
|
|
6
|
+
attributes?: any;
|
|
7
|
+
name?: string;
|
|
8
|
+
action?: string;
|
|
9
|
+
validate?: boolean;
|
|
10
|
+
method?: string;
|
|
11
|
+
sendSubmissionsTo?: string;
|
|
12
|
+
sendSubmissionsToEmail?: string;
|
|
13
|
+
sendWithJs?: boolean;
|
|
14
|
+
contentType?: string;
|
|
15
|
+
customHeaders?: {
|
|
16
|
+
[key: string]: string;
|
|
17
|
+
};
|
|
18
|
+
successUrl?: string;
|
|
19
|
+
previewState?: FormState;
|
|
20
|
+
successMessage?: BuilderBlock[];
|
|
21
|
+
errorMessage?: BuilderBlock[];
|
|
22
|
+
sendingMessage?: BuilderBlock[];
|
|
23
|
+
resetFormOnSubmit?: boolean;
|
|
24
|
+
errorMessagePath?: string;
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* This import is used by the Svelte SDK. Do not remove.
|
|
28
|
+
*/
|
|
29
|
+
export type FormState = "unsubmitted" | "sending" | "success" | "error";
|
|
30
|
+
import type { BuilderBlock } from "../../../types/builder-block.js";
|
|
31
|
+
import type { BuilderComponentsProp, BuilderLinkComponentProp, PropsWithBuilderData } from "../../../types/builder-props.js";
|
|
32
|
+
declare function FormComponent(props: FormProps): React.JSX.Element;
|
|
33
|
+
export default FormComponent;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
export
|
|
2
|
+
export type DropzoneProps = PropsWithBuilderData<{
|
|
3
3
|
name: string;
|
|
4
|
-
builderBlock: BuilderBlock;
|
|
5
|
-
builderContext: BuilderContextInterface;
|
|
6
4
|
attributes: any;
|
|
7
|
-
}
|
|
8
|
-
import type {
|
|
9
|
-
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
5
|
+
}>;
|
|
6
|
+
import type { PropsWithBuilderData } from "../../types/builder-props.js";
|
|
10
7
|
declare function Slot(props: DropzoneProps): React.JSX.Element;
|
|
11
8
|
export default Slot;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* These are in a separate file because React Native does not support them (yet).
|
|
3
|
+
* Having them in a separate file allows us to override it to be empty in the
|
|
4
|
+
* React Native SDK.
|
|
5
|
+
*/
|
|
6
|
+
import type { RegisteredComponent } from '../context/types.js';
|
|
7
|
+
export declare const getExtraComponents: () => RegisteredComponent[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.13.
|
|
1
|
+
export declare const SDK_VERSION = "0.13.2";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const get: (obj: any, path: string, defaultValue?: any) => any;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|