@uniformdev/canvas 16.2.4 → 17.0.0
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/dist/chunk-VQFPUXRX.mjs +5 -0
- package/dist/cli/cli.d.ts +2 -5
- package/dist/cli/cli.js +72 -56
- package/dist/cli/cli.mjs +71 -55
- package/dist/createEventBus-aea3860f.d.ts +1056 -0
- package/dist/index.d.ts +229 -11
- package/dist/index.esm.js +1 -4
- package/dist/index.js +3 -3
- package/dist/index.mjs +1 -4
- package/package.json +14 -12
- package/dist/chunk-ADDR7SB6.mjs +0 -2
- package/dist/createEventBus-a6696d11.d.ts +0 -266
@@ -0,0 +1,5 @@
|
|
1
|
+
var Y=Object.create;var E=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var X=Object.getOwnPropertyNames;var ee=Object.getPrototypeOf,te=Object.prototype.hasOwnProperty;var ne=(n,e,t)=>e in n?E(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var ye=(n=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(n,{get:(e,t)=>(typeof require!="undefined"?require:e)[t]}):n)(function(n){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+n+'" is not supported')});var Ce=(n,e)=>()=>(n&&(e=n(n=0)),e);var _=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Ee=(n,e)=>{for(var t in e)E(n,t,{get:e[t],enumerable:!0})},S=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of X(e))!te.call(n,o)&&o!==t&&E(n,o,{get:()=>e[o],enumerable:!(r=Q(e,o))||r.enumerable});return n};var re=(n,e,t)=>(t=n!=null?Y(ee(n)):{},S(e||!n||!n.__esModule?E(t,"default",{value:n,enumerable:!0}):t,n)),Te=n=>S(E({},"__esModule",{value:!0}),n);var ge=(n,e,t)=>(ne(n,typeof e!="symbol"?e+"":e,t),t),O=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)};var oe=(n,e,t)=>(O(n,e,"read from private field"),t?t.call(n):e.get(n)),Pe=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},ie=(n,e,t,r)=>(O(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),Ae=(n,e,t,r)=>({set _(o){ie(n,e,o,t)},get _(){return oe(n,e,r)}});var M=_((Se,k)=>{function u(n,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(n)),this._timeouts=n,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}k.exports=u;u.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};u.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};u.prototype.retry=function(n){if(this._timeout&&clearTimeout(this._timeout),!n)return!1;var e=new Date().getTime();if(n&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(n),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(n);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),t=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},t),this._options.unref&&this._timer.unref(),!0};u.prototype.attempt=function(n,e){this._fn=n,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};u.prototype.try=function(n){console.log("Using RetryOperation.try() is deprecated"),this.attempt(n)};u.prototype.start=function(n){console.log("Using RetryOperation.start() is deprecated"),this.attempt(n)};u.prototype.start=u.prototype.try;u.prototype.errors=function(){return this._errors};u.prototype.attempts=function(){return this._attempts};u.prototype.mainError=function(){if(this._errors.length===0)return null;for(var n={},e=null,t=0,r=0;r<this._errors.length;r++){var o=this._errors[r],i=o.message,s=(n[i]||0)+1;n[i]=s,s>=t&&(e=o,t=s)}return e}});var V=_(f=>{var se=M();f.operation=function(n){var e=f.timeouts(n);return new se(e,{forever:n&&(n.forever||n.retries===1/0),unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})};f.timeouts=function(n){if(n instanceof Array)return[].concat(n);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in n)e[t]=n[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],o=0;o<e.retries;o++)r.push(this.createTimeout(o,e));return n&&n.forever&&!r.length&&r.push(this.createTimeout(o,e)),r.sort(function(i,s){return i-s}),r};f.createTimeout=function(n,e){var t=e.randomize?Math.random()+1:1,r=Math.round(t*Math.max(e.minTimeout,1)*Math.pow(e.factor,n));return r=Math.min(r,e.maxTimeout),r};f.wrap=function(n,e,t){if(e instanceof Array&&(t=e,e=null),!t){t=[];for(var r in n)typeof n[r]=="function"&&t.push(r)}for(var o=0;o<t.length;o++){var i=t[o],s=n[i];n[i]=function(c){var m=f.operation(e),p=Array.prototype.slice.call(arguments,1),l=p.pop();p.push(function(h){m.retry(h)||(h&&(arguments[0]=m.mainError()),l.apply(this,arguments))}),m.attempt(function(){c.apply(n,p)})}.bind(n,s),n[i].options=e}}});var B=_((Ne,$)=>{$.exports=V()});function P(n,e){let t=[{ancestorsAndSelf:[{component:n,parentSlot:void 0,parentSlotIndex:void 0}]}];do{let r=t.pop();if(!r)continue;let o=r.ancestorsAndSelf[0],i=!0;e(o.component,r.ancestorsAndSelf,{replaceComponent:a=>{Object.assign(o.component,a),["parameters","variant","slots","data","_pattern","_patternError"].forEach(m=>{a[m]||delete o.component[m]})},removeComponent:()=>{let{parentSlot:a,parentSlotIndex:c}=r.ancestorsAndSelf[0],m=r.ancestorsAndSelf[1];if(a&&typeof c!="undefined")m.component.slots[a].splice(c,1);else throw new Error("Unable to delete composition.")},insertAfter:a=>{let c=Array.isArray(a)?a:[a],{parentSlot:m,parentSlotIndex:p}=r.ancestorsAndSelf[0],l=r.ancestorsAndSelf[1];if(m&&typeof p!="undefined")l.component.slots[m].splice(p+1,0,...c);else throw new Error("Unable to insert after a component not in a slot.")},stopProcessingDescendants(){i=!1}});let s=o.component.slots;if(i&&s){let a=Object.keys(s);for(let c=a.length-1;c>=0;c--){let m=a[c],p=s[m];for(let l=p.length-1;l>=0;l--)t.push({ancestorsAndSelf:[{component:p[l],parentSlot:m,parentSlotIndex:l},...r.ancestorsAndSelf]})}}}while(t.length>0)}function v(n){let e=[];for(let t=n.length-1;t>=0;t--){let{parentSlot:r,parentSlotIndex:o}=n[t];r&&o!==void 0&&e.push(`${r}[${o}]`)}return`.${e.join(".")}`}var N=class{constructor(e,t){this.groups=e.reduce((r,o)=>{var s;let i=t(o.args);return r[i]=(s=r[i])!=null?s:[],r[i].push(o),r},{})}resolveKey(e,t){this.groups[e].forEach(r=>r.resolve(t))}resolveRemaining(e){Object.keys(this.groups).forEach(t=>{this.groups[t].forEach(r=>{r.isCompleted||r.resolve(e)})})}};var A=class{constructor(){this._paramMatches=Array();this._dataMatches=new Map}parameter(e){return this._paramMatches.push({enhancer:this._resolveParameterEnhancer(e)}),this}parameterName(e,t){return(Array.isArray(e)?e:[e]).forEach(o=>this._paramMatches.push({name:o,enhancer:this._resolveParameterEnhancer(t)})),this}parameterType(e,t){return(Array.isArray(e)?e:[e]).forEach(o=>this._paramMatches.push({type:o,enhancer:this._resolveParameterEnhancer(t)})),this}data(e,t){if(this._dataMatches.has(e))throw new Error(`${e} enhancer data key has been used more than once. This will cause data loss.`);return this._dataMatches.set(e,typeof t=="function"?{enhanceOne:t}:t),this}resolveParameterEnhancer(e,t){var r;return(r=this._paramMatches.find(o=>o.name&&o.name===e||o.type&&o.type===t.type||!o.type&&!o.name))==null?void 0:r.enhancer}resolveComponentEnhancers(){return this._dataMatches}_resolveParameterEnhancer(e){return typeof e=="function"?{enhanceOne:e}:e}},L=class{constructor(){this._componentIndex={};this._rootBuilder=new A}parameter(e){return this._rootBuilder.parameter(e),this}parameterName(e,t){return this._rootBuilder.parameterName(e,t),this}parameterType(e,t){return this._rootBuilder.parameterType(e,t),this}data(e,t){return this._rootBuilder.data(e,t),this}component(e,t){return(Array.isArray(e)?e:[e]).forEach(o=>{this._componentIndex[o]=this._componentIndex[o]||new A,t(this._componentIndex[o])}),this}resolveParameterEnhancer(e,t,r){let o=this._componentIndex[e.type];if(o){let i=o.resolveParameterEnhancer(t,r);if(i)return i}return this._rootBuilder.resolveParameterEnhancer(t,r)}resolveComponentEnhancers(e){let t=this._rootBuilder.resolveComponentEnhancers(),r=this._componentIndex[e.type];if(r){t=new Map(t);for(let[o,i]of r.resolveComponentEnhancers())t.set(o,i)}return t}};var w=class{constructor(e,t,r){this._resolve=e;this._reject=t;this.args=r;this._isCompleted=!1}resolve(e){this._resolve(e),this._isCompleted=!0}reject(e){this._reject(e),this._isCompleted=!0}get isCompleted(){return this._isCompleted}};function be({handleBatch:n,shouldQueue:e,limitPolicy:t}){let r=[];return{enhanceOne:async s=>{if(!e||e(s))return new Promise((a,c)=>{r.push(new w(a,c,s))})},completeAll:async()=>{if(r.length>0){try{await n(r)}catch(a){r.forEach(c=>c.reject(a))}if(r.some(a=>!a.isCompleted))throw new Error("The completeAll() function failed to resolve or reject all promises in the batch!")}let s=r.length;return r=[],s},limitPolicy:t}}var x=class extends Error{constructor(){super("Throttled function aborted"),this.name="AbortError"}};function b({limit:n,interval:e,strict:t}){if(!Number.isFinite(n))throw new TypeError("Expected `limit` to be a finite number");if(!Number.isFinite(e))throw new TypeError("Expected `interval` to be a finite number");let r=new Map,o=0,i=0;function s(){let p=Date.now();return p-o>e?(i=1,o=p,0):(i<n?i++:(o+=e,i=1),o-p)}let a=[];function c(){let p=Date.now();if(a.length<n)return a.push(p),0;let l=a.shift()+e;return p>=l?(a.push(p),0):(a.push(l),l-p)}let m=t?c:s;return p=>{let l=function(...h){if(!l.isEnabled)return(async()=>p.apply(this,h))();let y;return new Promise((C,W)=>{y=setTimeout(()=>{C(p.apply(this,h)),r.delete(y)},m()),r.set(y,W)})};return l.abort=()=>{for(let h of r.keys())clearTimeout(h),r.get(h)(new x);r.clear(),a.splice(0,a.length)},l.isEnabled=!0,l}}var U=re(B(),1),ae=new Set(["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"]),R=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}},ce=(n,e,t)=>{let r=t.retries-(e-1);return n.attemptNumber=e,n.retriesLeft=r,n},pe=n=>ae.has(n),D=n=>globalThis.DOMException===void 0?new Error(n):new DOMException(n);async function I(n,e){return new Promise((t,r)=>{e={onFailedAttempt(){},retries:10,...e};let o=U.default.operation(e);o.attempt(async i=>{try{t(await n(i))}catch(s){if(!(s instanceof Error)){r(new TypeError(`Non-error was thrown: "${s}". You should only throw errors.`));return}if(s instanceof R)o.stop(),r(s.originalError);else if(s instanceof TypeError&&!pe(s.message))o.stop(),r(s);else{ce(s,i,e);try{await e.onFailedAttempt(s)}catch(a){r(a);return}o.retry(s)||r(o.mainError())}}}),e.signal&&!e.signal.aborted&&e.signal.addEventListener("abort",()=>{o.stop();let i=e.signal.reason===void 0?D("The operation was aborted."):e.signal.reason;r(i instanceof Error?i:D(i))},{once:!0})})}function j({throttle:n={interval:1e3,limit:10},retry:e={retries:1,factor:1.66}}){let t=n?b(n):null;return function(o){let i=async()=>await o();if(t&&(i=t(i)),e){let s=i;i=()=>I(s,e)}return i()}}var d=async n=>await n();async function Fe({composition:n,enhancers:e,context:t,onErrors:r=o=>{throw new Error(o.map(i=>`${i.message}
|
2
|
+
${typeof i.error=="object"&&"stack"in i.error?i.error.stack:i.error}`).join(`
|
3
|
+
|
4
|
+
`))}}){let o=[],i=new Set,s=new Set;P(n,(c,m)=>{var l;Object.entries((l=c.parameters)!=null?l:{}).forEach(([h,y])=>{let C=e.resolveParameterEnhancer(c,h,y);C&&(s.add(C),o.push(le(c,m,h,y,C,t)))});let p=e.resolveComponentEnhancers(c);o.push(me(c,m,p,t)),i.add(p)}),o.push(...Array.from(i).flatMap(c=>Array.from(c).map(async([,m])=>{var p;try{m.completeAll&&await((p=m.limitPolicy)!=null?p:d)(()=>m.completeAll())}catch(l){return{error:l,message:"Batch component enhancer failed. Individual failed components should receive their own rejections."}}}))),o.push(...Array.from(s).map(async c=>{var m;try{c.completeAll&&await((m=c.limitPolicy)!=null?m:d)(()=>c.completeAll())}catch(p){return{error:p,message:"Batch parameter enhancer failed. Individual failed parameters should receive their own rejections."}}}));let a=(await Promise.all(o)).flatMap(c=>Array.isArray(c)?c:[c]).filter(c=>c);a.length&&r(a)}async function me(n,e,t,r){return t.size&&(n.data={}),await Promise.all(Array.from(t).map(async([o,i])=>{var s;try{let c=await(i.completeAll?d:(s=i.limitPolicy)!=null?s:d)(async()=>i.enhanceOne({component:n,context:r}));c!=null&&(n.data[o]=c)}catch(a){let c=`Component ${v(e)} (type: ${n.type}): data.${o} enhancer threw exception. Data key will not be present.`;return delete n.data[o],{message:c,error:a}}}))}async function le(n,e,t,r,o,i){var s;try{let c=await(o.completeAll?d:(s=o.limitPolicy)!=null?s:d)(async()=>o.enhanceOne({parameter:r,parameterName:t,component:n,context:i}));c===null?delete n.parameters[t]:typeof c=="undefined"?n.parameters[t]={...r,value:r.value}:n.parameters[t]={...r,value:c}}catch(a){let c=`Component ${v(e)} (type: ${n.type}): enhancing parameter ${t} (type: ${r.type}) threw exception. Parameter will be removed.`;return delete n.parameters[t],{message:c,error:a}}}var ze=(n,...e)=>({enhanceOne:r=>{let o="enhanceOne"in n?n.enhanceOne(r):n(r);for(let i of e){let s=ue(o)?o:Promise.resolve(o),a="enhanceOne"in i?i.enhanceOne:i;o=s.then(c=>a({...r,parameter:{type:r.parameter.type,value:c}}))}return o},completeAll:async()=>{var r,o;for(let i of e)if("completeAll"in i)throw new Error("Only the first enhancer in a compose chain can use the completeAll function (batching)");return(o="completeAll"in n?(r=n.completeAll)==null?void 0:r.call(n):0)!=null?o:0}});function ue(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}var T=class extends Error{constructor(t,r,o,i,s,a){super(`${t}
|
5
|
+
${i}${s?" "+s:""} (${r} ${o}${a?` Request ID: ${a}`:""})`);this.errorMessage=t;this.fetchMethod=r;this.fetchUri=o;this.statusCode=i;this.statusText=s;this.requestId=a;Object.setPrototypeOf(this,T.prototype)}},g=class{constructor(e){var r,o,i,s,a,c;if(!e.apiKey&&!e.bearerToken)throw new Error("You must provide an API key or a bearer token");let t=e.fetch;if(!t)if(typeof globalThis!="undefined"&&typeof globalThis.fetch!="undefined")t=globalThis.fetch.bind(globalThis);else if(typeof fetch!="undefined")t=fetch;else throw new Error("You must provide or polyfill a fetch implementation when not in a browser");this.options={...e,fetch:t,apiHost:(r=e.apiHost)!=null?r:"https://uniform.app",apiKey:(o=e.apiKey)!=null?o:null,projectId:(i=e.projectId)!=null?i:null,bearerToken:(s=e.bearerToken)!=null?s:null,limitPolicy:(a=e.limitPolicy)!=null?a:j({}),bypassCache:(c=e.bypassCache)!=null?c:!1}}async getCompositionList(e){let{projectId:t}=this.options,r=this.createUrl("/api/v1/canvas",{...e,projectId:t});return await this.apiClient(r)}async getCompositionBySlug(e){let{projectId:t}=this.options,r=this.createUrl("/api/v1/canvas",{...e,projectId:t});return await this.apiClient(r)}async getCompositionById(e){let{projectId:t}=this.options,r=this.createUrl("/api/v1/canvas",{...e,projectId:t});return await this.apiClient(r)}async updateComposition(e){let t=this.createUrl("/api/v1/canvas");await this.apiClient(t,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async removeComposition(e){let t=this.createUrl("/api/v1/canvas"),{projectId:r}=this.options;await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,projectId:r}),expectNoContent:!0})}async getComponentDefinitions(e){let{projectId:t}=this.options,r=this.createUrl("/api/v1/canvas-definitions",{...e,projectId:t});return await this.apiClient(r)}async updateComponentDefinition(e){let t=this.createUrl("/api/v1/canvas-definitions");await this.apiClient(t,{method:"PUT",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async removeComponentDefinition(e){let t=this.createUrl("/api/v1/canvas-definitions");await this.apiClient(t,{method:"DELETE",body:JSON.stringify({...e,projectId:this.options.projectId}),expectNoContent:!0})}async apiClient(e,t){return this.options.limitPolicy(async()=>{var i;let r=this.options.apiKey?{"x-api-key":this.options.apiKey}:{Authorization:`Bearer ${this.options.bearerToken}`};this.options.bypassCache&&(r["x-bypass-cache"]="true");let o=await this.options.fetch(e.toString(),{...t,headers:{...t==null?void 0:t.headers,...r}});if(!o.ok){let s="";try{let a=await o.text();try{let c=JSON.parse(a);c.errorMessage?s=Array.isArray(c.errorMessage)?c.errorMessage.join(", "):c.errorMessage:s=a}catch(c){s=a}}catch(a){s="General error"}throw new T(s,(i=t==null?void 0:t.method)!=null?i:"GET",e.toString(),o.status,o.statusText,g.getRequestId(o))}return t!=null&&t.expectNoContent?null:await o.json()})}createUrl(e,t){let r=new URL(`${this.options.apiHost}${e}`);return Object.entries(t!=null?t:{}).forEach(([o,i])=>{var s;typeof i!==void 0&&i!==null&&r.searchParams.append(o,(s=i==null?void 0:i.toString())!=null?s:"")}),r}static getRequestId(e){let t=e.headers.get("apigw-requestid");if(t)return t}},F=class extends g{constructor(e){super({...e,bypassCache:!0})}};var Je="$personalization",We="$test",G="$localization",Ye="intentTag",z="locale",Qe="pz",Xe="test",H="localized",et=0,tt=64,K="$pzCrit",Z="$tstVrnt",nt="$enr";var ot=n=>n.startsWith("$");function at(n){return n?n.map((e,t)=>{var i,s;let r=(s=(i=e.parameters)==null?void 0:i[K])==null?void 0:s.value,o=(r==null?void 0:r.name)||`pz-${t}-${e.type}`;return{...e,id:o,pz:r}}):[]}function mt(n){return n?n.map((e,t)=>{var i,s,a;let r=(s=(i=e.parameters)==null?void 0:i[Z])==null?void 0:s.value,o=(a=r==null?void 0:r.id)!=null?a:"testId"in e?e.testId:`ab-${t}-${e.type}`;return{...e,id:o}}):[]}var q="https://js.pusher.com/7.0.3/pusher.min.js";async function he(){if(!(typeof document=="undefined"||typeof window=="undefined"))return window.Pusher?window.Pusher:new Promise((n,e)=>{let t=setTimeout(()=>{window.Pusher&&n(window.Pusher),e(`Unable to load pusher.js; Uniform Canvas live preview disabled. Consider adding <script src="${q}"><\/script> manually.`)},5e3),r=document.createElement("script");r.src=q,r.addEventListener("load",()=>{clearTimeout(t),n(window.Pusher)}),document.head.appendChild(r)})}async function ut(){let n=await he();if(!n)return;let e=window.__UNIFORM_EVENT_BUS__;if(!e){let t=new n("7b5f5abd160fea549ffe",{cluster:"mt1"});t.connect(),console.log("[canvas] \u{1F525} preview connected"),e=window.__UNIFORM_EVENT_BUS__={subscribe:r=>{let o=t.subscribe(r);return{unsubscribe:()=>t.unsubscribe(r),addEventHandler:(i,s)=>(o.bind(i,s),()=>o.unbind(i,s))}}}}return e}function J(n,e,t){return`${n}.${e}@${t}`}function yt({projectId:n,compositionId:e,compositionState:t=0,eventBus:{subscribe:r},callback:o,event:i="updated"}){let s=J(n,e,t),a=r(s),c=a.addEventHandler(i,o);return()=>{c(),a.unsubscribe()}}function fe({component:n}){var r;let e={},t=(r=n.slots)==null?void 0:r[H];return t==null||t.forEach(o=>{var s;let i=(s=o.parameters)==null?void 0:s[z];(i==null?void 0:i.value)&&typeof i.value=="string"&&(e[i.value]=e[i.value]||[],e[i.value].push(o))}),e}function gt({composition:n,locale:e}){P(n,(t,r,o)=>{if(t.type===G){let i=fe({component:t}),s=typeof e=="string"?e:e({component:t,locales:i}),a;if(s&&(a=i[s]),a!=null&&a.length){let[c,...m]=a;o.replaceComponent(c),m.length&&o.insertAfter(m)}else o.removeComponent()}})}export{ye as a,Ce as b,_ as c,Ee as d,re as e,Te as f,ge as g,oe as h,Pe as i,ie as j,Ae as k,P as l,v as m,N as n,A as o,L as p,w as q,be as r,j as s,d as t,Fe as u,ze as v,T as w,g as x,F as y,Je as z,We as A,G as B,Ye as C,z as D,Qe as E,Xe as F,H as G,et as H,tt as I,K as J,Z as K,nt as L,ot as M,at as N,mt as O,ut as P,J as Q,yt as R,fe as S,gt as T};
|
package/dist/cli/cli.d.ts
CHANGED
@@ -1,12 +1,9 @@
|
|
1
1
|
import { UniformCLIPlugin } from '@uniformdev/cli';
|
2
|
-
import {
|
2
|
+
import { A as CanvasDefinitions } from '../createEventBus-aea3860f.js';
|
3
3
|
import { UniformPackage } from '@uniformdev/cli/sync';
|
4
4
|
import 'pusher-js';
|
5
5
|
|
6
|
-
declare type CanvasPackage = UniformPackage &
|
7
|
-
components?: Array<ComponentDefinition>;
|
8
|
-
compositions?: Array<CompositionAPIResponse>;
|
9
|
-
};
|
6
|
+
declare type CanvasPackage = UniformPackage & CanvasDefinitions;
|
10
7
|
declare function readCanvasPackage(filename: string, assertExists: boolean): CanvasPackage;
|
11
8
|
declare function writeCanvasPackage(filename: string, packageContents: CanvasPackage): void;
|
12
9
|
|