@combeenation/custom-code-sdk 0.0.1-alpha8 → 0.0.1-alpha9

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/README.md CHANGED
File without changes
@@ -1 +1 @@
1
- "use strict";var de=Object.defineProperty;var D=t=>{throw TypeError(t)};var ce=(t,n,e)=>n in t?de(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var d=(t,n,e)=>ce(t,typeof n!="symbol"?n+"":n,e),M=(t,n,e)=>n.has(t)||D("Cannot "+e);var s=(t,n,e)=>(M(t,n,"read from private field"),e?e.call(t):n.get(t)),a=(t,n,e)=>n.has(t)?D("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(t):n.set(t,e),C=(t,n,e,i)=>(M(t,n,"write to private field"),i?i.call(t,e):n.set(t,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("zod"),L="0.0.1-alpha8";var S,l;class Ce{constructor(n){d(this,"id");a(this,S,"v1");a(this,l);var i,r;this.id=n;const e=(r=(i=window.Cbn)==null?void 0:i.getCustomCodeSdkBridge)==null?void 0:r.call(i,s(this,S));if(C(this,l,e==null?void 0:e.getButtonSdkBridge(this.id)),!s(this,l))throw new Error(`Cannot access API for Button "${this.id}".`)}onRendered(n){var e;return((e=s(this,l))==null?void 0:e.addOnRenderedCallback(n))??{unsubscribe:()=>{}}}onClick(n){var e;return((e=s(this,l))==null?void 0:e.addOnClickCallback(n))??{unsubscribe:()=>{}}}async setVisible(n){var e;await((e=s(this,l))==null?void 0:e.setVisible(n))}setText(n){var e;(e=s(this,l))==null||e.setText(n)}}S=new WeakMap,l=new WeakMap;var T,g;class le{constructor(n){d(this,"id");a(this,T,"v1");a(this,g);var i,r;this.id=n;const e=(r=(i=window.Cbn)==null?void 0:i.getCustomCodeSdkBridge)==null?void 0:r.call(i,s(this,T));if(C(this,g,e==null?void 0:e.getCheckboxSdkBridge(this.id)),!s(this,g))throw new Error(`Cannot access API for Checkbox "${this.id}".`)}onRendered(n){var e;return((e=s(this,g))==null?void 0:e.addOnRenderedCallback(n))??{unsubscribe:()=>{}}}async setVisible(n){var e;await((e=s(this,g))==null?void 0:e.setVisible(n))}}T=new WeakMap,g=new WeakMap;var z,h;class ue{constructor(n){d(this,"id");a(this,z,"v1");a(this,h);var i,r;this.id=n;const e=(r=(i=window.Cbn)==null?void 0:i.getCustomCodeSdkBridge)==null?void 0:r.call(i,s(this,z));if(C(this,h,e==null?void 0:e.getCollapsibleSdkBridge(this.id)),!s(this,h))throw new Error(`Cannot access API for Collapsible "${this.id}".`)}onRendered(n){var e;return((e=s(this,h))==null?void 0:e.addOnRenderedCallback(n))??{unsubscribe:()=>{}}}async setVisible(n){var e;await((e=s(this,h))==null?void 0:e.setVisible(n))}}z=new WeakMap,h=new WeakMap;var B,c;class ge{constructor(n){d(this,"id");a(this,B,"v1");a(this,c);var i,r;this.id=n;const e=(r=(i=window.Cbn)==null?void 0:i.getCustomCodeSdkBridge)==null?void 0:r.call(i,s(this,B));if(C(this,c,e==null?void 0:e.getCustomCtrlSdkBridge(this.id)),!s(this,c))throw new Error(`Cannot access API for Custom Control "${this.id}".`)}set renderFn(n){var e;(e=s(this,c))==null||e.setRenderFn(n)}async render(n){var e;typeof n=="function"&&(this.renderFn=n),await((e=s(this,c))==null?void 0:e.render())}onRendered(n){var e;return((e=s(this,c))==null?void 0:e.addOnRenderedCallback(n))??{unsubscribe:()=>{}}}getElement(){var e;return(e=s(this,c))==null?void 0:e.getElement()}async setVisible(n){var e;await((e=s(this,c))==null?void 0:e.setVisible(n))}}B=new WeakMap,c=new WeakMap;var E,b;class he{constructor(n){d(this,"id");a(this,E,"v1");a(this,b);var i,r;this.id=n;const e=(r=(i=window.Cbn)==null?void 0:i.getCustomCodeSdkBridge)==null?void 0:r.call(i,s(this,E));if(C(this,b,e==null?void 0:e.getDataviewSdkBridge(this.id)),!s(this,b))throw new Error(`Cannot access API for Dataview "${this.id}".`)}onRendered(n){var e;return((e=s(this,b))==null?void 0:e.addOnRenderedCallback(n))??{unsubscribe:()=>{}}}async setVisible(n){var e;await((e=s(this,b))==null?void 0:e.setVisible(n))}}E=new WeakMap,b=new WeakMap;var v,m;class be{constructor(n){d(this,"id");a(this,v,"v1");a(this,m);var i,r;this.id=n;const e=(r=(i=window.Cbn)==null?void 0:i.getCustomCodeSdkBridge)==null?void 0:r.call(i,s(this,v));if(C(this,m,e==null?void 0:e.getInputSdkBridge(this.id)),!s(this,m))throw new Error(`Cannot access API for Input "${this.id}".`)}onRendered(n){var e;return((e=s(this,m))==null?void 0:e.addOnRenderedCallback(n))??{unsubscribe:()=>{}}}async setVisible(n){var e;await((e=s(this,m))==null?void 0:e.setVisible(n))}}v=new WeakMap,m=new WeakMap;var R,p;class me{constructor(n){d(this,"id");a(this,R,"v1");a(this,p);var i,r;this.id=n;const e=(r=(i=window.Cbn)==null?void 0:i.getCustomCodeSdkBridge)==null?void 0:r.call(i,s(this,R));if(C(this,p,e==null?void 0:e.getPanelSdkBridge(this.id)),!s(this,p))throw new Error(`Cannot access API for Panel "${this.id}".`)}onRendered(n){var e;return((e=s(this,p))==null?void 0:e.addOnRenderedCallback(n))??{unsubscribe:()=>{}}}async setVisible(n){var e;await((e=s(this,p))==null?void 0:e.setVisible(n))}}R=new WeakMap,p=new WeakMap;var P,u;class pe{constructor(n){d(this,"id");a(this,P,"v1");a(this,u);var i,r;this.id=n;const e=(r=(i=window.Cbn)==null?void 0:i.getCustomCodeSdkBridge)==null?void 0:r.call(i,s(this,P));if(C(this,u,e==null?void 0:e.getTextSdkBridge(this.id)),!s(this,u))throw new Error(`Cannot access API for Text "${this.id}".`)}onRendered(n){var e;return((e=s(this,u))==null?void 0:e.addOnRenderedCallback(n))??{unsubscribe:()=>{}}}async setVisible(n){var e;await((e=s(this,u))==null?void 0:e.setVisible(n))}setText(n){var e;(e=s(this,u))==null||e.setText(n)}}P=new WeakMap,u=new WeakMap;const _=1,y=[];function we(t,n){if(y.length>=_)throw new Error(`Only ${_} \`ConfiguratorClient\` can be created at a time.`);y.push({client:t,internals:n})}function N(){const t=y[0];if(!t)throw new Error("Operation not possible as no `ConfiguratorClient` has been registered yet.");return t.client}function fe(){const t=y[0];if(!t)throw new Error("Operation not possible as no `ConfiguratorClient` has been registered yet.");return t.internals}const ke="v1";var A,G;const O=(G=(A=window.Cbn)==null?void 0:A.getCustomCodeSdkBridge)==null?void 0:G.call(A,"v1");if(!O)throw new Error("Cannot access Configurator SDK bridge. Make sure to only use the `custom-code-sdk` inside a Combeenation Configurator.");const K=O.createCfgrClient(ke,we);if(!K)throw new Error("Cannot create Configurator Client. Make sure to only use the `custom-code-sdk` inside a Combeenation Configurator.");const w=O.getParentPageUtilsSdkBridge(),U=O.getCfgrUtilsSdkBridge(),I=K,x={Text:"Text",Number:"Number",Logic:"Logic"},f={ValueComponent:"ValueComponent",TableComponent:"TableComponent",RecordComponent:"RecordComponent",ResourceComponent:"ResourceComponent",GraphicComponent:"GraphicComponent",CheckoutComponent:"CheckoutComponent"},k={ValueEditor:"ValueEditor",TableEditor:"TableEditor",Fiber:"Fiber",FiberEditor:"FiberEditor",CfgrField:"CfgrField"};o.z.enum([k.ValueEditor,k.TableEditor,k.Fiber,k.FiberEditor,k.CfgrField]);o.z.union([o.z.string(),o.z.number(),o.z.boolean()]);const V=t=>typeof t=="string";o.z.string();o.z.enum([x.Text,x.Number,x.Logic]);o.z.string();o.z.custom(t=>V(t)&&t.toLowerCase()===t);const W=t=>(t==null?void 0:t.toLowerCase())??"";o.z.string();const Ve=o.z.custom(t=>V(t)?new RegExp(`^${f.ValueComponent}<.*>$`).test(t):!1),Ae=o.z.custom(t=>V(t)?new RegExp(`^${f.RecordComponent}<.*>$`).test(t):!1),ye=o.z.custom(t=>V(t)?new RegExp(`^${f.ResourceComponent}<.*>$`).test(t):!1),Ie=o.z.custom(t=>V(t)?new RegExp(`^${f.TableComponent}<.*>$`).test(t):!1);o.z.union([Ve,Ie,Ae,ye,o.z.literal(f.GraphicComponent),o.z.literal(f.CheckoutComponent)]);const Z=o.z.union([o.z.string(),o.z.number(),o.z.boolean()]),Se=o.z.union([Z,o.z.array(Z),o.z.object({}),o.z.unknown()]),Te=o.z.object({$typ:o.z.literal("Error"),Id:o.z.string(),Message:o.z.string(),route:o.z.unknown().optional()});Te.or(Se);const j=new Map;function ze(t){const n=W(t.name);j.has(n)||j.set(n,t)}class Be{constructor(n,e){d(this,"name");d(this,"zodType");this.name=n,this.zodType=e,ze(this)}async getValue(){return await N().getCmpValue(this.name)}async setInput(n){const e=W(this.name);await fe().setCmpInput(e,n,this.zodType)}onValueChanged(n,e=!1,i){N().onCmpValueChanged(this.name,n,i,e)}}const H=()=>U.getAssetPaths();var Q=(t=>(t[t.Facebook=0]="Facebook",t[t.Pinterest=1]="Pinterest",t[t.Twitter=2]="Twitter",t[t.LinkedIn=3]="LinkedIn",t[t.WhatsApp=4]="WhatsApp",t[t.Custom=5]="Custom",t[t.NativeShare=6]="NativeShare",t))(Q||{});const Ee="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+X2ZkAAAAASUVORK5CYII=",X=I.onAnyCmpValueChanged.bind(I),q=async t=>{if(await I.finishConfiguration(t==null?void 0:t.input),t.sendDataToParentPage){const n=t.transformParentPageData();await w.sendConfigurationFinished(n)}},Y=async t=>{const n=Q[t.platform],e=t.imageUrl??Ee,i={...t,platform:n,imageUrl:e},r=await I.shareConfiguration(i);await U.openShareWindow(t.platform,r);const{shareUrl:F,shareConfigurationId:$}=r;return{shareUrl:F,shareConfigurationId:$}},J=async t=>{const{promise:n,resolve:e}=Promise.withResolvers(),i={};for(const[r,F]of Object.entries(t))F.onValueChanged($=>{i[r]=$,Object.keys(t).every(ae=>ae in i)&&e(i)},!0);return n},ee=()=>w.isInIFrame(),te=t=>w.setIFrameSize(t),ne=t=>U.navigateToLogin(t),ie=(t,n)=>w.sendCustomMsg(t,n),se=t=>w.redirectParentPage(t),oe=()=>w.getParentPageUrl(),re=(t,n)=>w.fireAnalyticsEvent(t,n),ve=Object.freeze(Object.defineProperty({__proto__:null,configuratorIsInIFrame:ee,createSyncCmpValuesStore:J,finishConfiguration:q,fireAnalyticsEvent:re,getAssetPaths:H,getParentPageUrl:oe,navigateToLogin:ne,onAnyCmpValueChanged:X,redirectParentPage:se,sendCustomMsgToParentPage:ie,setConfiguratorIFrameSize:te,shareConfiguration:Y,version:L},Symbol.toStringTag,{value:"Module"}));console.log(`Loading custom code SDK v${L}`);exports.Button=Ce;exports.CbnSdk=ve;exports.Checkbox=le;exports.Collapsible=ue;exports.CustomControl=ge;exports.Dataview=he;exports.Input=be;exports.Panel=me;exports.Text=pe;exports.ValueComponent=Be;exports.configuratorIsInIFrame=ee;exports.createSyncCmpValuesStore=J;exports.finishConfiguration=q;exports.fireAnalyticsEvent=re;exports.getAssetPaths=H;exports.getParentPageUrl=oe;exports.navigateToLogin=ne;exports.onAnyCmpValueChanged=X;exports.redirectParentPage=se;exports.sendCustomMsgToParentPage=ie;exports.setConfiguratorIFrameSize=te;exports.shareConfiguration=Y;exports.version=L;
1
+ "use strict";var de=Object.defineProperty;var D=t=>{throw TypeError(t)};var ce=(t,n,e)=>n in t?de(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var d=(t,n,e)=>ce(t,typeof n!="symbol"?n+"":n,e),M=(t,n,e)=>n.has(t)||D("Cannot "+e);var s=(t,n,e)=>(M(t,n,"read from private field"),e?e.call(t):n.get(t)),a=(t,n,e)=>n.has(t)?D("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(t):n.set(t,e),C=(t,n,e,i)=>(M(t,n,"write to private field"),i?i.call(t,e):n.set(t,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("zod"),L="0.0.1-alpha9";var S,l;class Ce{constructor(n){d(this,"id");a(this,S,"v1");a(this,l);var i,r;this.id=n;const e=(r=(i=window.Cbn)==null?void 0:i.getCustomCodeSdkBridge)==null?void 0:r.call(i,s(this,S));if(C(this,l,e==null?void 0:e.getButtonSdkBridge(this.id)),!s(this,l))throw new Error(`Cannot access API for Button "${this.id}".`)}onRendered(n){var e;return((e=s(this,l))==null?void 0:e.addOnRenderedCallback(n))??{unsubscribe:()=>{}}}onClick(n){var e;return((e=s(this,l))==null?void 0:e.addOnClickCallback(n))??{unsubscribe:()=>{}}}async setVisible(n){var e;await((e=s(this,l))==null?void 0:e.setVisible(n))}setText(n){var e;(e=s(this,l))==null||e.setText(n)}}S=new WeakMap,l=new WeakMap;var T,g;class le{constructor(n){d(this,"id");a(this,T,"v1");a(this,g);var i,r;this.id=n;const e=(r=(i=window.Cbn)==null?void 0:i.getCustomCodeSdkBridge)==null?void 0:r.call(i,s(this,T));if(C(this,g,e==null?void 0:e.getCheckboxSdkBridge(this.id)),!s(this,g))throw new Error(`Cannot access API for Checkbox "${this.id}".`)}onRendered(n){var e;return((e=s(this,g))==null?void 0:e.addOnRenderedCallback(n))??{unsubscribe:()=>{}}}async setVisible(n){var e;await((e=s(this,g))==null?void 0:e.setVisible(n))}}T=new WeakMap,g=new WeakMap;var z,h;class ue{constructor(n){d(this,"id");a(this,z,"v1");a(this,h);var i,r;this.id=n;const e=(r=(i=window.Cbn)==null?void 0:i.getCustomCodeSdkBridge)==null?void 0:r.call(i,s(this,z));if(C(this,h,e==null?void 0:e.getCollapsibleSdkBridge(this.id)),!s(this,h))throw new Error(`Cannot access API for Collapsible "${this.id}".`)}onRendered(n){var e;return((e=s(this,h))==null?void 0:e.addOnRenderedCallback(n))??{unsubscribe:()=>{}}}async setVisible(n){var e;await((e=s(this,h))==null?void 0:e.setVisible(n))}}z=new WeakMap,h=new WeakMap;var B,c;class ge{constructor(n){d(this,"id");a(this,B,"v1");a(this,c);var i,r;this.id=n;const e=(r=(i=window.Cbn)==null?void 0:i.getCustomCodeSdkBridge)==null?void 0:r.call(i,s(this,B));if(C(this,c,e==null?void 0:e.getCustomCtrlSdkBridge(this.id)),!s(this,c))throw new Error(`Cannot access API for Custom Control "${this.id}".`)}set renderFn(n){var e;(e=s(this,c))==null||e.setRenderFn(n)}async render(n){var e;typeof n=="function"&&(this.renderFn=n),await((e=s(this,c))==null?void 0:e.render())}onRendered(n){var e;return((e=s(this,c))==null?void 0:e.addOnRenderedCallback(n))??{unsubscribe:()=>{}}}getElement(){var e;return(e=s(this,c))==null?void 0:e.getElement()}async setVisible(n){var e;await((e=s(this,c))==null?void 0:e.setVisible(n))}}B=new WeakMap,c=new WeakMap;var E,b;class he{constructor(n){d(this,"id");a(this,E,"v1");a(this,b);var i,r;this.id=n;const e=(r=(i=window.Cbn)==null?void 0:i.getCustomCodeSdkBridge)==null?void 0:r.call(i,s(this,E));if(C(this,b,e==null?void 0:e.getDataviewSdkBridge(this.id)),!s(this,b))throw new Error(`Cannot access API for Dataview "${this.id}".`)}onRendered(n){var e;return((e=s(this,b))==null?void 0:e.addOnRenderedCallback(n))??{unsubscribe:()=>{}}}async setVisible(n){var e;await((e=s(this,b))==null?void 0:e.setVisible(n))}}E=new WeakMap,b=new WeakMap;var v,m;class be{constructor(n){d(this,"id");a(this,v,"v1");a(this,m);var i,r;this.id=n;const e=(r=(i=window.Cbn)==null?void 0:i.getCustomCodeSdkBridge)==null?void 0:r.call(i,s(this,v));if(C(this,m,e==null?void 0:e.getInputSdkBridge(this.id)),!s(this,m))throw new Error(`Cannot access API for Input "${this.id}".`)}onRendered(n){var e;return((e=s(this,m))==null?void 0:e.addOnRenderedCallback(n))??{unsubscribe:()=>{}}}async setVisible(n){var e;await((e=s(this,m))==null?void 0:e.setVisible(n))}}v=new WeakMap,m=new WeakMap;var R,p;class me{constructor(n){d(this,"id");a(this,R,"v1");a(this,p);var i,r;this.id=n;const e=(r=(i=window.Cbn)==null?void 0:i.getCustomCodeSdkBridge)==null?void 0:r.call(i,s(this,R));if(C(this,p,e==null?void 0:e.getPanelSdkBridge(this.id)),!s(this,p))throw new Error(`Cannot access API for Panel "${this.id}".`)}onRendered(n){var e;return((e=s(this,p))==null?void 0:e.addOnRenderedCallback(n))??{unsubscribe:()=>{}}}async setVisible(n){var e;await((e=s(this,p))==null?void 0:e.setVisible(n))}}R=new WeakMap,p=new WeakMap;var P,u;class pe{constructor(n){d(this,"id");a(this,P,"v1");a(this,u);var i,r;this.id=n;const e=(r=(i=window.Cbn)==null?void 0:i.getCustomCodeSdkBridge)==null?void 0:r.call(i,s(this,P));if(C(this,u,e==null?void 0:e.getTextSdkBridge(this.id)),!s(this,u))throw new Error(`Cannot access API for Text "${this.id}".`)}onRendered(n){var e;return((e=s(this,u))==null?void 0:e.addOnRenderedCallback(n))??{unsubscribe:()=>{}}}async setVisible(n){var e;await((e=s(this,u))==null?void 0:e.setVisible(n))}setText(n){var e;(e=s(this,u))==null||e.setText(n)}}P=new WeakMap,u=new WeakMap;const _=1,y=[];function we(t,n){if(y.length>=_)throw new Error(`Only ${_} \`ConfiguratorClient\` can be created at a time.`);y.push({client:t,internals:n})}function N(){const t=y[0];if(!t)throw new Error("Operation not possible as no `ConfiguratorClient` has been registered yet.");return t.client}function fe(){const t=y[0];if(!t)throw new Error("Operation not possible as no `ConfiguratorClient` has been registered yet.");return t.internals}const ke="v1";var A,G;const O=(G=(A=window.Cbn)==null?void 0:A.getCustomCodeSdkBridge)==null?void 0:G.call(A,"v1");if(!O)throw new Error("Cannot access Configurator SDK bridge. Make sure to only use the `custom-code-sdk` inside a Combeenation Configurator.");const K=O.createCfgrClient(ke,we);if(!K)throw new Error("Cannot create Configurator Client. Make sure to only use the `custom-code-sdk` inside a Combeenation Configurator.");const w=O.getParentPageUtilsSdkBridge(),U=O.getCfgrUtilsSdkBridge(),I=K,x={Text:"Text",Number:"Number",Logic:"Logic"},f={ValueComponent:"ValueComponent",TableComponent:"TableComponent",RecordComponent:"RecordComponent",ResourceComponent:"ResourceComponent",GraphicComponent:"GraphicComponent",CheckoutComponent:"CheckoutComponent"},k={ValueEditor:"ValueEditor",TableEditor:"TableEditor",Fiber:"Fiber",FiberEditor:"FiberEditor",CfgrField:"CfgrField"};o.z.enum([k.ValueEditor,k.TableEditor,k.Fiber,k.FiberEditor,k.CfgrField]);o.z.union([o.z.string(),o.z.number(),o.z.boolean()]);const V=t=>typeof t=="string";o.z.string();o.z.enum([x.Text,x.Number,x.Logic]);o.z.string();o.z.custom(t=>V(t)&&t.toLowerCase()===t);const W=t=>(t==null?void 0:t.toLowerCase())??"";o.z.string();const Ve=o.z.custom(t=>V(t)?new RegExp(`^${f.ValueComponent}<.*>$`).test(t):!1),Ae=o.z.custom(t=>V(t)?new RegExp(`^${f.RecordComponent}<.*>$`).test(t):!1),ye=o.z.custom(t=>V(t)?new RegExp(`^${f.ResourceComponent}<.*>$`).test(t):!1),Ie=o.z.custom(t=>V(t)?new RegExp(`^${f.TableComponent}<.*>$`).test(t):!1);o.z.union([Ve,Ie,Ae,ye,o.z.literal(f.GraphicComponent),o.z.literal(f.CheckoutComponent)]);const Z=o.z.union([o.z.string(),o.z.number(),o.z.boolean()]),Se=o.z.union([Z,o.z.array(Z),o.z.object({}),o.z.unknown()]),Te=o.z.object({$typ:o.z.literal("Error"),Id:o.z.string(),Message:o.z.string(),route:o.z.unknown().optional()});Te.or(Se);const j=new Map;function ze(t){const n=W(t.name);j.has(n)||j.set(n,t)}class Be{constructor(n,e){d(this,"name");d(this,"zodType");this.name=n,this.zodType=e,ze(this)}async getValue(){return await N().getCmpValue(this.name)}async setInput(n){const e=W(this.name);await fe().setCmpInput(e,n,this.zodType)}onValueChanged(n,e=!1,i){N().onCmpValueChanged(this.name,n,i,e)}}const H=()=>U.getAssetPaths();var Q=(t=>(t[t.Facebook=0]="Facebook",t[t.Pinterest=1]="Pinterest",t[t.Twitter=2]="Twitter",t[t.LinkedIn=3]="LinkedIn",t[t.WhatsApp=4]="WhatsApp",t[t.Custom=5]="Custom",t[t.NativeShare=6]="NativeShare",t))(Q||{});const Ee="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+X2ZkAAAAASUVORK5CYII=",X=I.onAnyCmpValueChanged.bind(I),q=async t=>{if(await I.finishConfiguration(t==null?void 0:t.input),t.sendDataToParentPage){const n=t.transformParentPageData();await w.sendConfigurationFinished(n)}},Y=async t=>{const n=Q[t.platform],e=t.imageUrl??Ee,i={...t,platform:n,imageUrl:e},r=await I.shareConfiguration(i);await U.openShareWindow(t.platform,r);const{shareUrl:F,shareConfigurationId:$}=r;return{shareUrl:F,shareConfigurationId:$}},J=async t=>{const{promise:n,resolve:e}=Promise.withResolvers(),i={};for(const[r,F]of Object.entries(t))F.onValueChanged($=>{i[r]=$,Object.keys(t).every(ae=>ae in i)&&e(i)},!0);return n},ee=()=>w.isInIFrame(),te=t=>w.setIFrameSize(t),ne=t=>U.navigateToLogin(t),ie=(t,n)=>w.sendCustomMsg(t,n),se=t=>w.redirectParentPage(t),oe=()=>w.getParentPageUrl(),re=(t,n)=>w.fireAnalyticsEvent(t,n),ve=Object.freeze(Object.defineProperty({__proto__:null,configuratorIsInIFrame:ee,createSyncCmpValuesStore:J,finishConfiguration:q,fireAnalyticsEvent:re,getAssetPaths:H,getParentPageUrl:oe,navigateToLogin:ne,onAnyCmpValueChanged:X,redirectParentPage:se,sendCustomMsgToParentPage:ie,setConfiguratorIFrameSize:te,shareConfiguration:Y,version:L},Symbol.toStringTag,{value:"Module"}));console.log(`Loading custom code SDK v${L}`);exports.Button=Ce;exports.CbnSdk=ve;exports.Checkbox=le;exports.Collapsible=ue;exports.CustomControl=ge;exports.Dataview=he;exports.Input=be;exports.Panel=me;exports.Text=pe;exports.ValueComponent=Be;exports.configuratorIsInIFrame=ee;exports.createSyncCmpValuesStore=J;exports.finishConfiguration=q;exports.fireAnalyticsEvent=re;exports.getAssetPaths=H;exports.getParentPageUrl=oe;exports.navigateToLogin=ne;exports.onAnyCmpValueChanged=X;exports.redirectParentPage=se;exports.sendCustomMsgToParentPage=ie;exports.setConfiguratorIFrameSize=te;exports.shareConfiguration=Y;exports.version=L;
package/dist/bundle.es.js CHANGED
@@ -6,7 +6,7 @@ var Y = (t, n, e) => n in t ? X(t, n, { enumerable: !0, configurable: !0, writab
6
6
  var d = (t, n, e) => Y(t, typeof n != "symbol" ? n + "" : n, e), _ = (t, n, e) => n.has(t) || D("Cannot " + e);
7
7
  var s = (t, n, e) => (_(t, n, "read from private field"), e ? e.call(t) : n.get(t)), a = (t, n, e) => n.has(t) ? D("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(t) : n.set(t, e), C = (t, n, e, i) => (_(t, n, "write to private field"), i ? i.call(t, e) : n.set(t, e), e);
8
8
  import { z as o } from "zod";
9
- const G = "0.0.1-alpha8";
9
+ const G = "0.0.1-alpha9";
10
10
  var E, l;
11
11
  class Be {
12
12
  constructor(n) {
package/dist/index.d.ts CHANGED
@@ -293,7 +293,7 @@ export declare const fireAnalyticsEvent: (event: string, eventData?: object | st
293
293
  export declare type FlexShopFinishJson = Shopware6FinishJson;
294
294
 
295
295
  /**
296
- * Returns the resolved 3D asset paths (babylon.js assets, material packs, texture image assets)
296
+ * Returns the resolved 3D asset paths (babylon.js assets, material assets, texture image assets)
297
297
  * for all pre-packed asset bundles configured for this Configurator.
298
298
  *
299
299
  * The result is fetched once and cached — subsequent calls resolve immediately from cache.
@@ -333,8 +333,6 @@ declare type JsonPrimitive = string | number | boolean | null;
333
333
  */
334
334
  declare type MaterialAsset = z.infer<typeof ZMaterialAsset>;
335
335
 
336
- declare type MaterialPackName = z.infer<typeof ZMaterialPackName>;
337
-
338
336
  /**
339
337
  * Navigates to the login page of the Configurator.
340
338
  *
@@ -473,10 +471,8 @@ declare type SdkAssetPaths = {
473
471
  babylonJsAssets: {
474
472
  [key: AssetName]: Url;
475
473
  };
476
- materialPacks: {
477
- [key: MaterialPackName]: {
478
- [key: AssetName]: MaterialAsset;
479
- };
474
+ materialAssets: {
475
+ [key: AssetName]: MaterialAsset;
480
476
  };
481
477
  textureImageAssets: {
482
478
  [key: AssetName]: Url;
@@ -706,8 +702,6 @@ declare const ZMaterialAsset: z.ZodObject<{
706
702
  id: z.ZodString;
707
703
  }, z.ZodTypeAny, "passthrough">>;
708
704
 
709
- declare const ZMaterialPackName: z.ZodString;
710
-
711
705
  declare const ZUrl: z.ZodBranded<z.ZodString, "Url">;
712
706
 
713
707
  export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@combeenation/custom-code-sdk",
3
- "version": "0.0.1-alpha8",
3
+ "version": "0.0.1-alpha9",
4
4
  "description": "Combeenation custom code SDK package",
5
5
  "keywords": [],
6
6
  "homepage": "",