@builder.io/sdk-react-nextjs 0.16.3 → 0.16.6
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 +15 -15
- package/lib/browser/blocks-exports.mjs +158 -138
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/init.cjs +1 -1
- package/lib/browser/init.mjs +1 -1
- package/lib/browser/{server-entry-8a47b9f9.cjs → server-entry-0418e1e6.cjs} +2 -2
- package/lib/{node/server-entry-b8ecec52.js → browser/server-entry-226d18cc.js} +84 -83
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/blocks-exports.cjs +16 -16
- package/lib/edge/blocks-exports.mjs +180 -160
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/init.cjs +1 -1
- package/lib/edge/init.mjs +1 -1
- package/lib/{node/server-entry-8a47b9f9.cjs → edge/server-entry-0418e1e6.cjs} +2 -2
- package/lib/{browser/server-entry-b8ecec52.js → edge/server-entry-226d18cc.js} +84 -83
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/node/blocks-exports.cjs +12 -12
- package/lib/node/blocks-exports.mjs +105 -85
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +2 -2
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +2 -2
- package/lib/node/{node-runtime-e2a21ba1.cjs → node-runtime-f354effa.cjs} +1 -1
- package/lib/node/{node-runtime-ffe74dec.js → node-runtime-f79fed3b.js} +1 -1
- package/lib/{edge/server-entry-8a47b9f9.cjs → node/server-entry-0418e1e6.cjs} +2 -2
- package/lib/{edge/server-entry-b8ecec52.js → node/server-entry-226d18cc.js} +84 -83
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/package.json +1 -1
- package/types/cjs/blocks/image/image.types.d.ts +2 -0
- package/types/cjs/blocks/symbol/symbol.types.d.ts +1 -0
- package/types/cjs/components/content-variants/content-variants.types.d.ts +2 -1
- package/types/cjs/components/content-variants/extra-framework-props-types.d.ts +2 -0
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/context/extra-context-types.d.ts +6 -0
- package/types/cjs/context/types.d.ts +2 -1
- package/types/cjs/functions/register-component.d.ts +1 -1
- package/types/esm/blocks/image/image.types.d.ts +2 -0
- package/types/esm/blocks/symbol/symbol.types.d.ts +1 -0
- package/types/esm/components/content-variants/content-variants.types.d.ts +2 -1
- package/types/esm/components/content-variants/extra-framework-props-types.d.ts +2 -0
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/context/extra-context-types.d.ts +6 -0
- package/types/esm/context/types.d.ts +2 -1
- package/types/esm/functions/register-component.d.ts +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const ue=require("lru-cache"),I="rsc",b="[Builder.io]: ",d={log:(...e)=>console.log(b,...e),error:(...e)=>console.error(b,...e),warn:(...e)=>console.warn(b,...e),debug:(...e)=>console.debug(b,...e)};function c(){return typeof window!="undefined"&&typeof document!="undefined"}const de=e=>{const t={};return e.forEach((n,r)=>{t[r]=n}),t},
|
|
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 z=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}},{})}function J(e,t,n={}){for(const r in e){const o=e[r],s=t?t+"."+r:r;o&&typeof o=="object"&&!Array.isArray(o)&&!Object.keys(o).find(i=>i.startsWith("$"))?J(o,s,n):n[s]=o}return n}const xe="v3",
|
|
1
|
+
"use strict";const ue=require("lru-cache"),I="rsc",b="[Builder.io]: ",d={log:(...e)=>console.log(b,...e),error:(...e)=>console.error(b,...e),warn:(...e)=>console.warn(b,...e),debug:(...e)=>console.debug(b,...e)};function c(){return typeof window!="undefined"&&typeof document!="undefined"}const de=e=>{const t={};return e.forEach((n,r)=>{t[r]=n}),t},V=e=>e instanceof URLSearchParams?de(e):e,M=e=>typeof e=="string"?e:e instanceof URLSearchParams?e.toString():new URLSearchParams(e).toString();function le(){return c()&&window.self!==window.top}function _(e){return le()&&M(e||window.location.search).indexOf("builder.frameEditing=")!==-1}const fe=()=>{if(c()){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},ge=()=>typeof navigator=="object"&&navigator.userAgent||"",F=()=>{const e=ge(),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()||I==="reactNative"}},n=e.match(/Tablet|iPad/i),r=fe();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"}},p=e=>e!=null,he=e=>{if(e==="localhost"||e==="127.0.0.1")return e;const t=e.split(".");return t.length>2?t.slice(1).join("."):e},D=({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){d.warn("[COOKIE] GET error: ",(r==null?void 0:r.message)||r);return}},N=async e=>D(e),pe=e=>e.map(([t,n])=>n?`${t}=${n}`:t).filter(p).join("; "),me=[["secure",""],["SameSite","None"]],ye=({name:e,value:t,expires:n})=>{const o=(c()?location.protocol==="https:":!0)?me:[[]],s=n?[["expires",n.toUTCString()]]:[[]],i=[[e,t],...s,["path","/"],["domain",he(window.location.hostname)],...o];return pe(i)},j=async({name:e,value:t,expires:n,canTrack:r})=>{try{if(!r)return;const o=ye({name:e,value:t,expires:n});document.cookie=o}catch(o){d.warn("[COOKIE] SET error: ",(o==null?void 0:o.message)||o)}},we="builder.tests",k=e=>`${we}.${e}`,Se=({contentId:e})=>N({name:k(e),canTrack:!0}),be=({contentId:e})=>D({name:k(e),canTrack:!0}),Ie=({contentId:e,value:t})=>j({name:k(e),value:t,canTrack:!0}),K=e=>p(e.id)&&p(e.variations)&&Object.keys(e.variations).length>0,ve=({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},W=e=>{const t=ve(e);return Ie({contentId:e.id,value:t}).catch(n=>{d.error("could not store A/B test variation: ",n)}),t},$=({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":"")}},Ee=({item:e,canTrack:t})=>{if(!t)return e;if(!e)return;if(!K(e))return e;const n=be({contentId:e.id})||W({variations:e.variations,id:e.id}),r=$({item:e,testGroupId:n});return{...e,...r}},ke=async({item:e,canTrack:t})=>{if(!t||!K(e))return e;const r=await Se({contentId:e.id})||W({variations:e.variations,id:e.id}),o=$({item:e,testGroupId:r});return{...e,...o}},G=e=>p(e)?e:!0,Pe=e=>({type:"builder.registerComponent",data:P(e)}),Ce=e=>{const t=e.toString().trim();return`return (${!t.startsWith("function")&&!t.startsWith("(")?"function ":""}${t}).apply(this, arguments)`};function P(e){return JSON.parse(JSON.stringify(e,(t,n)=>typeof n=="function"?Ce(n):n))}const Re=e=>{const t=e.get("preview"),n=e.get("overrides."+t);return n||d.warn("No previewed ID found in search params."),n};function H(){globalThis._BUILDER_PREVIEW_LRU_CACHE||(globalThis._BUILDER_PREVIEW_LRU_CACHE=new ue.LRUCache({max:500,ttl:1e3*60*5}))}function Oe(e){H();const t=Re(e);return typeof t=="string"?globalThis._BUILDER_PREVIEW_LRU_CACHE.get(t):void 0}function Ae(){return typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:globalThis}function Te(){const e=Ae().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 z=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}},{})}function J(e,t,n={}){for(const r in e){const o=e[r],s=t?t+"."+r:r;o&&typeof o=="object"&&!Array.isArray(o)&&!Object.keys(o).find(i=>i.startsWith("$"))?J(o,s,n):n[s]=o}return n}const xe="v3",T="builder.",Be="options.",C=e=>{if(!e)return{};const t=V(e),n={};return Object.keys(t).forEach(r=>{if(r.startsWith(T)){const o=r.replace(T,"").replace(Be,"");n[o]=t[r]}}),n},Le=()=>{if(!c())return{};const e=new URLSearchParams(window.location.search);return C(e)},x=e=>typeof e=="number"&&!isNaN(e)&&e>=0,R=e=>{const{limit:t=30,userAttributes:n,query:r,model:o,apiKey:s,enrich:i,locale:u,apiVersion:y=xe,fields:m,omit:v,offset:l,cacheSeconds:g,staleCacheSeconds:h,sort:w,includeUnpublished:O}=e;if(!s)throw new Error("Missing API key");if(!["v3"].includes(y))throw new Error(`Invalid apiVersion: expected 'v3', received '${y}'`);const ae=t!==1,a=new URL(`https://cdn.builder.io/api/${y}/content/${o}`);if(a.searchParams.set("apiKey",s),a.searchParams.set("limit",String(t)),a.searchParams.set("noTraverse",String(ae)),a.searchParams.set("includeRefs",String(!0)),u&&a.searchParams.set("locale",u),i&&a.searchParams.set("enrich",String(i)),a.searchParams.set("omit",v||"meta.componentsUsed"),m&&a.searchParams.set("fields",m),Number.isFinite(l)&&l>-1&&a.searchParams.set("offset",String(Math.floor(l))),typeof O=="boolean"&&a.searchParams.set("includeUnpublished",String(O)),g&&x(g)&&a.searchParams.set("cacheSeconds",String(g)),h&&x(h)&&a.searchParams.set("staleCacheSeconds",String(h)),w){const f=E({sort:w});for(const S in f)a.searchParams.set(S,JSON.stringify(f[S]))}const ce={...Le(),...V(e.options||{})},A=E(ce);for(const f in A)a.searchParams.set(f,String(A[f]));if(n&&a.searchParams.set("userAttributes",JSON.stringify(n)),r){const f=J({query:r});for(const S in f)a.searchParams.set(S,JSON.stringify(f[S]))}return a},Ue=e=>"results"in e;async function X(e){const t=await Q({...e,limit:1});return t&&t[0]||null}const Ve=async e=>{var s;const t=R(e);return await(await((s=e.fetch)!=null?s:z)(t.href,e.fetchOptions)).json()},q=async(e,t,n=R(e))=>{const r=G(e.canTrack);if(n.search.includes("preview=")){const s=[];for(const i of t.results){const u=Oe(n.searchParams);s.push(u||i)}t.results=s}if(!r||!(c()||I==="reactNative"))return t.results;try{const s=[];for(const i of t.results)s.push(await ke({item:i,canTrack:r}));t.results=s}catch(s){d.error("Could not process A/B tests. ",s)}return t.results};async function Q(e){try{const t=R(e),n=await Ve(e);return Ue(n)?q(e,n):(d.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return d.error("Error fetching data. ",t),null}}function Me(e){const t=e||(c()?window.location.search:void 0);return t?M(t).indexOf("builder.preview=")!==-1:!1}function _e(){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 Y(){return _e().replace(/-/g,"")}const Z="builderSessionId",Fe=async({canTrack:e})=>{if(!e)return;const t=await N({name:Z,canTrack:e});if(p(t))return t;{const n=De();return Ne({id:n,canTrack:e}),n}},De=()=>Y(),Ne=({id:e,canTrack:t})=>j({name:Z,value:e,canTrack:t}),ee=()=>c()&&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",We=({canTrack:e})=>{if(!e)return;const t=je({key:te,canTrack:e});if(p(t))return t;{const n=$e();return Ge({id:n,canTrack:e}),n}},$e=()=>Y(),Ge=({id:e,canTrack:t})=>Ke({key:te,value:e,canTrack:t}),He=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await Fe({canTrack:e}),n=We({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 He({canTrack:t}),userAttributes:F(),ownerId:n}});async function ne(e){if(!e.apiKey){d.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!_()&&(c()||I==="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 Je=e=>ne({...e,canTrack:!0}),Xe=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function re(e,t){if(!t.origin.startsWith("http")&&!t.origin.startsWith("https"))return!1;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.16.6",B={};function oe(e,t){e==="plugin"&&(t=P(t));let n=B[e];if(n||(n=B[e]=[]),n.push(t),c()){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 Qe=()=>{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 L=!1;const se=(e={})=>{var t,n;L||(L=!0,c()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:I,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 u=o.data.text,y=o.data.arguments||[],m=o.data.id,v=new Function(u);let l,g=null;try{l=v.apply(null,y)}catch(h){g=h}g?(s=window.parent)==null||s.postMessage({type:"builder.evaluateError",data:{id:m,error:g.message}},"*"):l&&typeof l.then=="function"?l.then(h=>{var w;(w=window.parent)==null||w.postMessage({type:"builder.evaluateResult",data:{id:m,result:h}},"*")}).catch(console.error):(i=window.parent)==null||i.postMessage({type:"builder.evaluateResult",data:{result:l,id:m}},"*");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,u=s.data;i===e&&n.contentUpdate(u);break}}},Ye=(e,t,n)=>{if(!c)return d.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)}},U={};function Ze(e){if(c()){Object.assign(U,e);const t={type:"builder.settingsChange",data:U};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:C(e.searchParams||((s=e.url)==null?void 0:s.searchParams)||e.options)};return{apiKey:n.apiKey,model:n.model,content:await X(n)}};exports.MSG_PREFIX=b;exports.TARGET=I;exports._processContentResult=q;exports._track=ne;exports.checkIsDefined=p;exports.createEditorListener=ie;exports.createRegisterComponentMessage=Pe;exports.fetch=z;exports.fetchBuilderProps=et;exports.fetchEntries=Q;exports.fetchOneEntry=X;exports.getBuilderSearchParams=C;exports.getDefaultCanTrack=G;exports.getUserAttributes=F;exports.handleABTestingSync=Ee;exports.init=H;exports.isBrowser=c;exports.isEditing=_;exports.isPreviewing=Me;exports.logger=d;exports.register=oe;exports.registerInsertMenu=Qe;exports.serializeIncludingFunctions=P;exports.setEditorSettings=Ze;exports.setupBrowserForEditing=se;exports.subscribeToEditor=Ye;exports.track=Je;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LRUCache as
|
|
1
|
+
import { LRUCache as Q } from "lru-cache";
|
|
2
2
|
const v = "rsc", b = "[Builder.io]: ", l = {
|
|
3
3
|
log: (...e) => console.log(b, ...e),
|
|
4
4
|
error: (...e) => console.error(b, ...e),
|
|
@@ -8,27 +8,27 @@ const v = "rsc", b = "[Builder.io]: ", l = {
|
|
|
8
8
|
function c() {
|
|
9
9
|
return typeof window != "undefined" && typeof document != "undefined";
|
|
10
10
|
}
|
|
11
|
-
const
|
|
11
|
+
const Y = (e) => {
|
|
12
12
|
const t = {};
|
|
13
13
|
return e.forEach((n, r) => {
|
|
14
14
|
t[r] = n;
|
|
15
15
|
}), t;
|
|
16
|
-
}, B = (e) => e instanceof URLSearchParams ?
|
|
17
|
-
function
|
|
16
|
+
}, B = (e) => e instanceof URLSearchParams ? Y(e) : e, U = (e) => typeof e == "string" ? e : e instanceof URLSearchParams ? e.toString() : new URLSearchParams(e).toString();
|
|
17
|
+
function Z() {
|
|
18
18
|
return c() && window.self !== window.top;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
return
|
|
20
|
+
function ee(e) {
|
|
21
|
+
return Z() && // accessing window.location.search is safe here because `isIframe()` is only `true` if we're in a browser.
|
|
22
22
|
U(e || window.location.search).indexOf("builder.frameEditing=") !== -1;
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const te = () => {
|
|
25
25
|
if (c()) {
|
|
26
26
|
const e = new URL(location.href);
|
|
27
27
|
return e.pathname === "" && (e.pathname = "/"), e;
|
|
28
28
|
} else
|
|
29
29
|
return console.warn("Cannot get location for tracking in non-browser environment"), null;
|
|
30
|
-
},
|
|
31
|
-
const e =
|
|
30
|
+
}, ne = () => typeof navigator == "object" && navigator.userAgent || "", re = () => {
|
|
31
|
+
const e = ne(), t = {
|
|
32
32
|
Android() {
|
|
33
33
|
return e.match(/Android/i);
|
|
34
34
|
},
|
|
@@ -47,13 +47,13 @@ const ee = () => {
|
|
|
47
47
|
any() {
|
|
48
48
|
return t.Android() || t.BlackBerry() || t.iOS() || t.Opera() || t.Windows() || v === "reactNative";
|
|
49
49
|
}
|
|
50
|
-
}, n = e.match(/Tablet|iPad/i), r =
|
|
50
|
+
}, n = e.match(/Tablet|iPad/i), r = te();
|
|
51
51
|
return {
|
|
52
52
|
urlPath: r == null ? void 0 : r.pathname,
|
|
53
53
|
host: (r == null ? void 0 : r.host) || (r == null ? void 0 : r.hostname),
|
|
54
54
|
device: n ? "tablet" : t.any() ? "mobile" : "desktop"
|
|
55
55
|
};
|
|
56
|
-
}, m = (e) => e != null,
|
|
56
|
+
}, m = (e) => e != null, oe = (e) => {
|
|
57
57
|
if (e === "localhost" || e === "127.0.0.1")
|
|
58
58
|
return e;
|
|
59
59
|
const t = e.split(".");
|
|
@@ -69,13 +69,13 @@ const ee = () => {
|
|
|
69
69
|
l.warn("[COOKIE] GET error: ", (r == null ? void 0 : r.message) || r);
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
|
-
}, M = async (e) => V(e),
|
|
72
|
+
}, M = async (e) => V(e), se = (e) => e.map(([t, n]) => n ? `${t}=${n}` : t).filter(m).join("; "), ie = [["secure", ""], ["SameSite", "None"]], ae = ({
|
|
73
73
|
name: e,
|
|
74
74
|
value: t,
|
|
75
75
|
expires: n
|
|
76
76
|
}) => {
|
|
77
|
-
const o = (c() ? location.protocol === "https:" : !0) ?
|
|
78
|
-
return
|
|
77
|
+
const o = (c() ? location.protocol === "https:" : !0) ? ie : [[]], s = n ? [["expires", n.toUTCString()]] : [[]], i = [[e, t], ...s, ["path", "/"], ["domain", oe(window.location.hostname)], ...o];
|
|
78
|
+
return se(i);
|
|
79
79
|
}, _ = async ({
|
|
80
80
|
name: e,
|
|
81
81
|
value: t,
|
|
@@ -85,7 +85,7 @@ const ee = () => {
|
|
|
85
85
|
try {
|
|
86
86
|
if (!r)
|
|
87
87
|
return;
|
|
88
|
-
const o =
|
|
88
|
+
const o = ae({
|
|
89
89
|
name: e,
|
|
90
90
|
value: t,
|
|
91
91
|
expires: n
|
|
@@ -94,24 +94,24 @@ const ee = () => {
|
|
|
94
94
|
} catch (o) {
|
|
95
95
|
l.warn("[COOKIE] SET error: ", (o == null ? void 0 : o.message) || o);
|
|
96
96
|
}
|
|
97
|
-
},
|
|
97
|
+
}, ce = "builder.tests", k = (e) => `${ce}.${e}`, ue = ({
|
|
98
98
|
contentId: e
|
|
99
99
|
}) => M({
|
|
100
100
|
name: k(e),
|
|
101
101
|
canTrack: !0
|
|
102
|
-
}),
|
|
102
|
+
}), de = ({
|
|
103
103
|
contentId: e
|
|
104
104
|
}) => V({
|
|
105
105
|
name: k(e),
|
|
106
106
|
canTrack: !0
|
|
107
|
-
}),
|
|
107
|
+
}), le = ({
|
|
108
108
|
contentId: e,
|
|
109
109
|
value: t
|
|
110
110
|
}) => _({
|
|
111
111
|
name: k(e),
|
|
112
112
|
value: t,
|
|
113
113
|
canTrack: !0
|
|
114
|
-
}),
|
|
114
|
+
}), F = (e) => m(e.id) && m(e.variations) && Object.keys(e.variations).length > 0, fe = ({
|
|
115
115
|
id: e,
|
|
116
116
|
variations: t
|
|
117
117
|
}) => {
|
|
@@ -124,9 +124,9 @@ const ee = () => {
|
|
|
124
124
|
return s;
|
|
125
125
|
}
|
|
126
126
|
return e;
|
|
127
|
-
},
|
|
128
|
-
const t =
|
|
129
|
-
return
|
|
127
|
+
}, N = (e) => {
|
|
128
|
+
const t = fe(e);
|
|
129
|
+
return le({
|
|
130
130
|
contentId: e.id,
|
|
131
131
|
value: t
|
|
132
132
|
}).catch((n) => {
|
|
@@ -154,11 +154,11 @@ const ee = () => {
|
|
|
154
154
|
return e;
|
|
155
155
|
if (!e)
|
|
156
156
|
return;
|
|
157
|
-
if (!
|
|
157
|
+
if (!F(e))
|
|
158
158
|
return e;
|
|
159
|
-
const n =
|
|
159
|
+
const n = de({
|
|
160
160
|
contentId: e.id
|
|
161
|
-
}) ||
|
|
161
|
+
}) || N({
|
|
162
162
|
variations: e.variations,
|
|
163
163
|
id: e.id
|
|
164
164
|
}), r = D({
|
|
@@ -169,15 +169,15 @@ const ee = () => {
|
|
|
169
169
|
...e,
|
|
170
170
|
...r
|
|
171
171
|
};
|
|
172
|
-
},
|
|
172
|
+
}, he = async ({
|
|
173
173
|
item: e,
|
|
174
174
|
canTrack: t
|
|
175
175
|
}) => {
|
|
176
|
-
if (!t || !
|
|
176
|
+
if (!t || !F(e))
|
|
177
177
|
return e;
|
|
178
|
-
const r = await
|
|
178
|
+
const r = await ue({
|
|
179
179
|
contentId: e.id
|
|
180
|
-
}) ||
|
|
180
|
+
}) || N({
|
|
181
181
|
variations: e.variations,
|
|
182
182
|
id: e.id
|
|
183
183
|
}), o = D({
|
|
@@ -188,22 +188,22 @@ const ee = () => {
|
|
|
188
188
|
...e,
|
|
189
189
|
...o
|
|
190
190
|
};
|
|
191
|
-
},
|
|
191
|
+
}, ge = (e) => m(e) ? e : !0, Xe = (e) => ({
|
|
192
192
|
type: "builder.registerComponent",
|
|
193
|
-
data:
|
|
194
|
-
}),
|
|
193
|
+
data: j(e)
|
|
194
|
+
}), pe = (e) => {
|
|
195
195
|
const t = e.toString().trim();
|
|
196
196
|
return `return (${!t.startsWith("function") && !t.startsWith("(") ? "function " : ""}${t}).apply(this, arguments)`;
|
|
197
197
|
};
|
|
198
|
-
function
|
|
199
|
-
return JSON.parse(JSON.stringify(e, (t, n) => typeof n == "function" ?
|
|
198
|
+
function j(e) {
|
|
199
|
+
return JSON.parse(JSON.stringify(e, (t, n) => typeof n == "function" ? pe(n) : n));
|
|
200
200
|
}
|
|
201
201
|
const me = (e) => {
|
|
202
202
|
const t = e.get("preview"), n = e.get("overrides." + t);
|
|
203
203
|
return n || l.warn("No previewed ID found in search params."), n;
|
|
204
204
|
};
|
|
205
205
|
function ye() {
|
|
206
|
-
globalThis._BUILDER_PREVIEW_LRU_CACHE || (globalThis._BUILDER_PREVIEW_LRU_CACHE = new
|
|
206
|
+
globalThis._BUILDER_PREVIEW_LRU_CACHE || (globalThis._BUILDER_PREVIEW_LRU_CACHE = new Q({
|
|
207
207
|
max: 500,
|
|
208
208
|
// how long to live in ms
|
|
209
209
|
ttl: 1e3 * 60 * 5
|
|
@@ -237,14 +237,14 @@ function E(e, t = null, n = ".") {
|
|
|
237
237
|
};
|
|
238
238
|
}, {});
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function K(e, t, n = {}) {
|
|
241
241
|
for (const r in e) {
|
|
242
242
|
const o = e[r], s = t ? t + "." + r : r;
|
|
243
|
-
o && typeof o == "object" && !Array.isArray(o) && !Object.keys(o).find((i) => i.startsWith("$")) ?
|
|
243
|
+
o && typeof o == "object" && !Array.isArray(o) && !Object.keys(o).find((i) => i.startsWith("$")) ? K(o, s, n) : n[s] = o;
|
|
244
244
|
}
|
|
245
245
|
return n;
|
|
246
246
|
}
|
|
247
|
-
const Ie = "v3", R = "builder.", Ee = "options.",
|
|
247
|
+
const Ie = "v3", R = "builder.", Ee = "options.", W = (e) => {
|
|
248
248
|
if (!e)
|
|
249
249
|
return {};
|
|
250
250
|
const t = B(e), n = {};
|
|
@@ -258,8 +258,8 @@ const Ie = "v3", R = "builder.", Ee = "options.", K = (e) => {
|
|
|
258
258
|
if (!c())
|
|
259
259
|
return {};
|
|
260
260
|
const e = new URLSearchParams(window.location.search);
|
|
261
|
-
return
|
|
262
|
-
}, x = (e) => typeof e == "number" && !isNaN(e) && e >= 0,
|
|
261
|
+
return W(e);
|
|
262
|
+
}, x = (e) => typeof e == "number" && !isNaN(e) && e >= 0, P = (e) => {
|
|
263
263
|
const {
|
|
264
264
|
limit: t = 30,
|
|
265
265
|
userAttributes: n,
|
|
@@ -275,36 +275,36 @@ const Ie = "v3", R = "builder.", Ee = "options.", K = (e) => {
|
|
|
275
275
|
cacheSeconds: h,
|
|
276
276
|
staleCacheSeconds: g,
|
|
277
277
|
sort: w,
|
|
278
|
-
includeUnpublished:
|
|
278
|
+
includeUnpublished: C
|
|
279
279
|
} = e;
|
|
280
280
|
if (!s)
|
|
281
281
|
throw new Error("Missing API key");
|
|
282
282
|
if (!["v3"].includes(y))
|
|
283
283
|
throw new Error(`Invalid apiVersion: expected 'v3', received '${y}'`);
|
|
284
|
-
const
|
|
285
|
-
if (a.searchParams.set("apiKey", s), a.searchParams.set("limit", String(t)), a.searchParams.set("noTraverse", String(
|
|
284
|
+
const X = t !== 1, a = new URL(`https://cdn.builder.io/api/${y}/content/${o}`);
|
|
285
|
+
if (a.searchParams.set("apiKey", s), a.searchParams.set("limit", String(t)), a.searchParams.set("noTraverse", String(X)), a.searchParams.set("includeRefs", String(!0)), u && a.searchParams.set("locale", u), i && a.searchParams.set("enrich", String(i)), a.searchParams.set("omit", I || "meta.componentsUsed"), p && a.searchParams.set("fields", p), Number.isFinite(d) && d > -1 && a.searchParams.set("offset", String(Math.floor(d))), typeof C == "boolean" && a.searchParams.set("includeUnpublished", String(C)), h && x(h) && a.searchParams.set("cacheSeconds", String(h)), g && x(g) && a.searchParams.set("staleCacheSeconds", String(g)), w) {
|
|
286
286
|
const f = E({
|
|
287
287
|
sort: w
|
|
288
288
|
});
|
|
289
289
|
for (const S in f)
|
|
290
290
|
a.searchParams.set(S, JSON.stringify(f[S]));
|
|
291
291
|
}
|
|
292
|
-
const
|
|
292
|
+
const q = {
|
|
293
293
|
...ke(),
|
|
294
294
|
...B(e.options || {})
|
|
295
|
-
}, O = E(
|
|
295
|
+
}, O = E(q);
|
|
296
296
|
for (const f in O)
|
|
297
297
|
a.searchParams.set(f, String(O[f]));
|
|
298
298
|
if (n && a.searchParams.set("userAttributes", JSON.stringify(n)), r) {
|
|
299
|
-
const f =
|
|
299
|
+
const f = K({
|
|
300
300
|
query: r
|
|
301
301
|
});
|
|
302
302
|
for (const S in f)
|
|
303
303
|
a.searchParams.set(S, JSON.stringify(f[S]));
|
|
304
304
|
}
|
|
305
305
|
return a;
|
|
306
|
-
},
|
|
307
|
-
async function
|
|
306
|
+
}, Pe = (e) => "results" in e;
|
|
307
|
+
async function Ce(e) {
|
|
308
308
|
const t = await xe({
|
|
309
309
|
...e,
|
|
310
310
|
limit: 1
|
|
@@ -313,10 +313,10 @@ async function Pe(e) {
|
|
|
313
313
|
}
|
|
314
314
|
const Oe = async (e) => {
|
|
315
315
|
var s;
|
|
316
|
-
const t =
|
|
316
|
+
const t = P(e);
|
|
317
317
|
return await (await ((s = e.fetch) != null ? s : ve)(t.href, e.fetchOptions)).json();
|
|
318
|
-
}, Re = async (e, t, n =
|
|
319
|
-
const r =
|
|
318
|
+
}, Re = async (e, t, n = P(e)) => {
|
|
319
|
+
const r = ge(e.canTrack);
|
|
320
320
|
if (n.search.includes("preview=")) {
|
|
321
321
|
const s = [];
|
|
322
322
|
for (const i of t.results) {
|
|
@@ -330,7 +330,7 @@ const Oe = async (e) => {
|
|
|
330
330
|
try {
|
|
331
331
|
const s = [];
|
|
332
332
|
for (const i of t.results)
|
|
333
|
-
s.push(await
|
|
333
|
+
s.push(await he({
|
|
334
334
|
item: i,
|
|
335
335
|
canTrack: r
|
|
336
336
|
}));
|
|
@@ -342,8 +342,8 @@ const Oe = async (e) => {
|
|
|
342
342
|
};
|
|
343
343
|
async function xe(e) {
|
|
344
344
|
try {
|
|
345
|
-
const t =
|
|
346
|
-
return
|
|
345
|
+
const t = P(e), n = await Oe(e);
|
|
346
|
+
return Pe(n) ? Re(e, n) : (l.error("Error fetching data. ", {
|
|
347
347
|
url: t,
|
|
348
348
|
content: n,
|
|
349
349
|
options: e
|
|
@@ -362,16 +362,16 @@ function Ae() {
|
|
|
362
362
|
return (e == "x" ? t : t & 3 | 8).toString(16);
|
|
363
363
|
});
|
|
364
364
|
}
|
|
365
|
-
function
|
|
365
|
+
function $() {
|
|
366
366
|
return Ae().replace(/-/g, "");
|
|
367
367
|
}
|
|
368
|
-
const
|
|
368
|
+
const G = "builderSessionId", Te = async ({
|
|
369
369
|
canTrack: e
|
|
370
370
|
}) => {
|
|
371
371
|
if (!e)
|
|
372
372
|
return;
|
|
373
373
|
const t = await M({
|
|
374
|
-
name:
|
|
374
|
+
name: G,
|
|
375
375
|
canTrack: e
|
|
376
376
|
});
|
|
377
377
|
if (m(t))
|
|
@@ -383,20 +383,20 @@ const $ = "builderSessionId", Te = async ({
|
|
|
383
383
|
canTrack: e
|
|
384
384
|
}), n;
|
|
385
385
|
}
|
|
386
|
-
}, Le = () =>
|
|
386
|
+
}, Le = () => $(), Be = ({
|
|
387
387
|
id: e,
|
|
388
388
|
canTrack: t
|
|
389
389
|
}) => _({
|
|
390
|
-
name:
|
|
390
|
+
name: G,
|
|
391
391
|
value: e,
|
|
392
392
|
canTrack: t
|
|
393
|
-
}),
|
|
393
|
+
}), H = () => c() && typeof localStorage != "undefined" ? localStorage : void 0, Ue = ({
|
|
394
394
|
key: e,
|
|
395
395
|
canTrack: t
|
|
396
396
|
}) => {
|
|
397
397
|
var n;
|
|
398
398
|
try {
|
|
399
|
-
return t ? (n =
|
|
399
|
+
return t ? (n = H()) == null ? void 0 : n.getItem(e) : void 0;
|
|
400
400
|
} catch (r) {
|
|
401
401
|
console.debug("[LocalStorage] GET error: ", r);
|
|
402
402
|
return;
|
|
@@ -408,36 +408,36 @@ const $ = "builderSessionId", Te = async ({
|
|
|
408
408
|
}) => {
|
|
409
409
|
var r;
|
|
410
410
|
try {
|
|
411
|
-
t && ((r =
|
|
411
|
+
t && ((r = H()) == null || r.setItem(e, n));
|
|
412
412
|
} catch (o) {
|
|
413
413
|
console.debug("[LocalStorage] SET error: ", o);
|
|
414
414
|
}
|
|
415
|
-
},
|
|
415
|
+
}, J = "builderVisitorId", Me = ({
|
|
416
416
|
canTrack: e
|
|
417
417
|
}) => {
|
|
418
418
|
if (!e)
|
|
419
419
|
return;
|
|
420
420
|
const t = Ue({
|
|
421
|
-
key:
|
|
421
|
+
key: J,
|
|
422
422
|
canTrack: e
|
|
423
423
|
});
|
|
424
424
|
if (m(t))
|
|
425
425
|
return t;
|
|
426
426
|
{
|
|
427
427
|
const n = _e();
|
|
428
|
-
return
|
|
428
|
+
return Fe({
|
|
429
429
|
id: n,
|
|
430
430
|
canTrack: e
|
|
431
431
|
}), n;
|
|
432
432
|
}
|
|
433
|
-
}, _e = () =>
|
|
433
|
+
}, _e = () => $(), Fe = ({
|
|
434
434
|
id: e,
|
|
435
435
|
canTrack: t
|
|
436
436
|
}) => Ve({
|
|
437
|
-
key:
|
|
437
|
+
key: J,
|
|
438
438
|
value: e,
|
|
439
439
|
canTrack: t
|
|
440
|
-
}),
|
|
440
|
+
}), Ne = async ({
|
|
441
441
|
canTrack: e
|
|
442
442
|
}) => {
|
|
443
443
|
if (!e)
|
|
@@ -468,10 +468,10 @@ const $ = "builderSessionId", Te = async ({
|
|
|
468
468
|
url: location.href,
|
|
469
469
|
...r
|
|
470
470
|
},
|
|
471
|
-
...await
|
|
471
|
+
...await Ne({
|
|
472
472
|
canTrack: t
|
|
473
473
|
}),
|
|
474
|
-
userAttributes:
|
|
474
|
+
userAttributes: re(),
|
|
475
475
|
ownerId: n
|
|
476
476
|
}
|
|
477
477
|
});
|
|
@@ -480,7 +480,7 @@ async function je(e) {
|
|
|
480
480
|
l.error("Missing API key for track call. Please provide your API key.");
|
|
481
481
|
return;
|
|
482
482
|
}
|
|
483
|
-
if (e.canTrack && !
|
|
483
|
+
if (e.canTrack && !ee() && (c() || v === "reactNative"))
|
|
484
484
|
return fetch("https://cdn.builder.io/api/v1/track", {
|
|
485
485
|
method: "POST",
|
|
486
486
|
body: JSON.stringify({
|
|
@@ -498,14 +498,15 @@ const Qe = (e) => je({
|
|
|
498
498
|
...e,
|
|
499
499
|
canTrack: !0
|
|
500
500
|
}), Ke = ["*.beta.builder.io", "beta.builder.io", "builder.io", "localhost", "qa.builder.io"];
|
|
501
|
-
function
|
|
501
|
+
function z(e, t) {
|
|
502
502
|
if (!t.origin.startsWith("http") && !t.origin.startsWith("https"))
|
|
503
503
|
return !1;
|
|
504
504
|
const n = new URL(t.origin), r = n.hostname;
|
|
505
505
|
return (e || Ke).findIndex((o) => o.startsWith("*.") ? r.endsWith(o.slice(1)) : o === r) > -1;
|
|
506
506
|
}
|
|
507
|
-
const We = "0.16.
|
|
507
|
+
const We = "0.16.6", A = {};
|
|
508
508
|
function $e(e, t) {
|
|
509
|
+
e === "plugin" && (t = j(t));
|
|
509
510
|
let n = A[e];
|
|
510
511
|
if (n || (n = A[e] = []), n.push(t), c()) {
|
|
511
512
|
const r = {
|
|
@@ -566,7 +567,7 @@ const Ge = (e = {}) => {
|
|
|
566
567
|
}
|
|
567
568
|
}, "*"), window.addEventListener("message", (r) => {
|
|
568
569
|
var s, i;
|
|
569
|
-
if (!
|
|
570
|
+
if (!z(e.trustedHosts, r))
|
|
570
571
|
return;
|
|
571
572
|
const {
|
|
572
573
|
data: o
|
|
@@ -612,7 +613,7 @@ const Ge = (e = {}) => {
|
|
|
612
613
|
trustedHosts: t,
|
|
613
614
|
callbacks: n
|
|
614
615
|
}) => (r) => {
|
|
615
|
-
if (!
|
|
616
|
+
if (!z(t, r))
|
|
616
617
|
return;
|
|
617
618
|
const {
|
|
618
619
|
data: o
|
|
@@ -675,12 +676,12 @@ const tt = async (e) => {
|
|
|
675
676
|
urlPath: t
|
|
676
677
|
} : {}
|
|
677
678
|
},
|
|
678
|
-
options:
|
|
679
|
+
options: W(e.searchParams || ((s = e.url) == null ? void 0 : s.searchParams) || e.options)
|
|
679
680
|
};
|
|
680
681
|
return {
|
|
681
682
|
apiKey: n.apiKey,
|
|
682
683
|
model: n.model,
|
|
683
|
-
content: await
|
|
684
|
+
content: await Ce(n)
|
|
684
685
|
};
|
|
685
686
|
};
|
|
686
687
|
export {
|
|
@@ -694,19 +695,19 @@ export {
|
|
|
694
695
|
ve as fetch,
|
|
695
696
|
tt as fetchBuilderProps,
|
|
696
697
|
xe as fetchEntries,
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
698
|
+
Ce as fetchOneEntry,
|
|
699
|
+
W as getBuilderSearchParams,
|
|
700
|
+
ge as getDefaultCanTrack,
|
|
701
|
+
re as getUserAttributes,
|
|
701
702
|
ze as handleABTestingSync,
|
|
702
703
|
ye as init,
|
|
703
704
|
c as isBrowser,
|
|
704
|
-
|
|
705
|
+
ee as isEditing,
|
|
705
706
|
qe as isPreviewing,
|
|
706
707
|
l as logger,
|
|
707
708
|
$e as register,
|
|
708
709
|
Ye as registerInsertMenu,
|
|
709
|
-
|
|
710
|
+
j as serializeIncludingFunctions,
|
|
710
711
|
et as setEditorSettings,
|
|
711
712
|
Ge as setupBrowserForEditing,
|
|
712
713
|
Ze as subscribeToEditor,
|
|
@@ -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-0418e1e6.cjs");require("lru-cache");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 i, createRegisterComponentMessage as s, fetchBuilderProps as o, fetchEntries as n, fetchOneEntry as c, getBuilderSearchParams as g, isEditing as a, isPreviewing as d, register as p, setEditorSettings as E, subscribeToEditor as f, track as h } from "./server-entry-
|
|
1
|
+
import { _processContentResult as i, createRegisterComponentMessage as s, fetchBuilderProps as o, fetchEntries as n, fetchOneEntry as c, getBuilderSearchParams as g, isEditing as a, isPreviewing as d, register as p, setEditorSettings as E, subscribeToEditor as f, track as h } from "./server-entry-226d18cc.js";
|
|
2
2
|
import "lru-cache";
|
|
3
3
|
export {
|
|
4
4
|
i as _processContentResult,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder.io/sdk-react-nextjs",
|
|
3
3
|
"description": "Builder.io RSC SDK for NextJS App Directory",
|
|
4
|
-
"version": "0.16.
|
|
4
|
+
"version": "0.16.6",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/nextjs",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BuilderBlock } from '../../types/builder-block.js';
|
|
2
2
|
export interface ImageProps {
|
|
3
|
+
attributes?: string;
|
|
3
4
|
highPriority?: boolean;
|
|
4
5
|
className?: string;
|
|
5
6
|
image: string;
|
|
@@ -12,6 +13,7 @@ export interface ImageProps {
|
|
|
12
13
|
backgroundPosition?: string;
|
|
13
14
|
srcset?: string;
|
|
14
15
|
aspectRatio?: number;
|
|
16
|
+
lockAspectRatio?: boolean;
|
|
15
17
|
children?: any;
|
|
16
18
|
fitContent?: boolean;
|
|
17
19
|
builderBlock?: BuilderBlock;
|
|
@@ -2,7 +2,8 @@ import type { BuilderRenderContext, RegisteredComponent } from '../../context/ty
|
|
|
2
2
|
import type { ApiVersion } from '../../types/api-version.js';
|
|
3
3
|
import type { BuilderContent } from '../../types/builder-content.js';
|
|
4
4
|
import type { Nullable } from '../../types/typescript.js';
|
|
5
|
-
|
|
5
|
+
import type { ExtraFrameworkProps } from './extra-framework-props-types.js';
|
|
6
|
+
export interface ContentVariantsPrps extends ExtraFrameworkProps {
|
|
6
7
|
/**
|
|
7
8
|
* The Builder content JSON to render (required).
|
|
8
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.16.
|
|
1
|
+
export declare const SDK_VERSION = "0.16.6";
|
|
@@ -3,13 +3,14 @@ import type { ApiVersion } from '../types/api-version.js';
|
|
|
3
3
|
import type { BuilderContent } from '../types/builder-content.js';
|
|
4
4
|
import type { ComponentInfo } from '../types/components.js';
|
|
5
5
|
import type { Dictionary, Nullable } from '../types/typescript.js';
|
|
6
|
+
import type { ExtraContextTypes } from './extra-context-types.js';
|
|
6
7
|
export type RegisteredComponent = ComponentInfo & {
|
|
7
8
|
component: any;
|
|
8
9
|
};
|
|
9
10
|
export type RegisteredComponents = Dictionary<RegisteredComponent>;
|
|
10
11
|
export type BuilderRenderState = Record<string, unknown>;
|
|
11
12
|
export type BuilderRenderContext = Record<string, unknown>;
|
|
12
|
-
export interface BuilderContextInterface extends Pick<BlocksWrapperProps, 'BlocksWrapper' | 'BlocksWrapperProps'
|
|
13
|
+
export interface BuilderContextInterface extends Pick<BlocksWrapperProps, 'BlocksWrapper' | 'BlocksWrapperProps'>, ExtraContextTypes {
|
|
13
14
|
content: Nullable<BuilderContent>;
|
|
14
15
|
context: BuilderRenderContext;
|
|
15
16
|
/**
|