@zhama/a2ui 0.12.0 → 0.13.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.
@@ -1,2 +1,2 @@
1
- 'use strict';var z=Object.defineProperty;var _=(e,t,r)=>t in e?z(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r;var y=(e,t,r)=>_(e,typeof t!="symbol"?t+"":t,r);function J(e){return d(e)}function D(e,t){return e==="path"&&typeof t=="string"}function d(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function I(e){return d(e)?"explicitList"in e||"template"in e:false}function v(e){return !!(typeof e=="string"||d(e)&&"path"in e&&typeof e.path=="string")}function W(e){return !!(typeof e=="number"||d(e)&&"path"in e&&typeof e.path=="string")}function q(e){return !!(typeof e=="boolean"||d(e)&&"path"in e&&typeof e.path=="string")}function h(e){return d(e)?"id"in e&&"type"in e&&"properties"in e:false}function M(e){return d(e)&&"url"in e&&v(e.url)}function x(e){return d(e)&&"child"in e&&h(e.child)&&"action"in e}function A(e){return d(e)?"child"in e?h(e.child):"children"in e?Array.isArray(e.children)&&e.children.every(h):false:false}function b(e){return d(e)&&"label"in e&&v(e.label)&&"value"in e&&q(e.value)}function S(e){return d(e)&&"children"in e&&Array.isArray(e.children)&&e.children.every(h)}function k(e){return d(e)&&"value"in e&&v(e.value)}function V(e){return d(e)}function T(e){return d(e)&&"url"in e&&v(e.url)}function $(e){return d(e)&&"name"in e&&v(e.name)}function P(e){return d(e)&&"children"in e&&Array.isArray(e.children)&&e.children.every(h)}function E(e){return d(e)&&"entryPointChild"in e&&h(e.entryPointChild)&&"contentChild"in e&&h(e.contentChild)}function O(e){return d(e)&&"selections"in e}function j(e){return d(e)&&"children"in e&&Array.isArray(e.children)&&e.children.every(h)}function B(e){return d(e)&&"value"in e&&W(e.value)}function G(e){return d(e)&&"title"in e&&v(e.title)&&"child"in e&&h(e.child)}function U(e){return d(e)&&"tabItems"in e&&Array.isArray(e.tabItems)&&e.tabItems.every(G)}function N(e){return d(e)&&"text"in e&&v(e.text)}function F(e){return d(e)&&"label"in e&&v(e.label)}function L(e){return d(e)&&"url"in e&&v(e.url)}var m=class m{constructor(t={}){y(this,"mapCtor",Map);y(this,"arrayCtor",Array);y(this,"setCtor",Set);y(this,"objCtor",Object);y(this,"surfaces");this.arrayCtor=t.arrayCtor??Array,this.mapCtor=t.mapCtor??Map,this.setCtor=t.setCtor??Set,this.objCtor=t.objCtor??Object,this.surfaces=new this.mapCtor;}getSurfaces(){return this.surfaces}clearSurfaces(){this.surfaces.clear();}processMessages(t){console.log("[A2UI] processMessages called with",t.length,"messages");for(let r of t)"createSurface"in r?this.handleCreateSurface(r):"updateComponents"in r?this.handleUpdateComponents(r):"updateDataModel"in r?this.handleUpdateDataModel(r):"deleteSurface"in r?this.handleDeleteSurface(r):console.warn("[A2UI] Unknown message type:",Object.keys(r));}getData(t,r,a=m.DEFAULT_SURFACE_ID){let n=this.getOrCreateSurface(a);if(!n)return console.warn("[A2UI] getData: surface not found:",a),null;let o;return r==="."||r===""?o=t.dataContextPath??"/":o=this.resolvePath(r,t.dataContextPath),this.getDataByPath(n.dataModel,o)}setData(t,r,a,n=m.DEFAULT_SURFACE_ID){if(!t){console.warn("No component node set");return}let o=this.getOrCreateSurface(n);if(!o)return;let l;r==="."||r===""?l=t.dataContextPath??"/":l=this.resolvePath(r,t.dataContextPath),this.setDataByPath(o.dataModel,l,a);}resolvePath(t,r){return t.startsWith("/")?t:r&&r!=="/"?r.endsWith("/")?`${r}${t}`:`${r}/${t}`:`/${t}`}handleCreateSurface(t){let{createSurface:r}=t,a=r.surfaceId,n=this.getOrCreateSurface(a);n.catalogId=r.catalogId;}handleUpdateComponents(t){let{updateComponents:r}=t,a=r.surfaceId,n=this.getOrCreateSurface(a);for(let o of r.components)n.components.set(o.id,o),n.rootComponentId||(n.rootComponentId=o.id);this.rebuildComponentTree(n);}handleUpdateDataModel(t){let{updateDataModel:r}=t,a=r.surfaceId,n=this.getOrCreateSurface(a),o=r.path??"/",l=r.op??"replace",u=r.value;l==="remove"?this.removeDataByPath(n.dataModel,o):u!==void 0&&this.setDataByPath(n.dataModel,o,u),this.rebuildComponentTree(n);}handleDeleteSurface(t){let{deleteSurface:r}=t;this.surfaces.delete(r.surfaceId);}setDataByPath(t,r,a){let n=this.normalizePath(r).split("/").filter(u=>u);if(n.length===0){if(d(a)&&!(a instanceof Map)){t.clear();for(let[u,c]of Object.entries(a))t.set(u,c);}return}let o=t;for(let u=0;u<n.length-1;u++){let c=n[u],i;if(o instanceof Map?i=o.get(c):Array.isArray(o)&&/^\d+$/.test(c)&&(i=o[parseInt(c,10)]),i===void 0||typeof i!="object"||i===null){let f=new this.mapCtor;o instanceof Map?o.set(c,f):Array.isArray(o)&&(o[parseInt(c,10)]=f),i=f;}o=i;}let l=n[n.length-1];o instanceof Map?o.set(l,a):Array.isArray(o)&&/^\d+$/.test(l)&&(o[parseInt(l,10)]=a);}removeDataByPath(t,r){let a=this.normalizePath(r).split("/").filter(l=>l);if(a.length===0){t.clear();return}let n=t;for(let l=0;l<a.length-1;l++){let u=a[l],c;if(n instanceof Map?c=n.get(u):Array.isArray(n)&&/^\d+$/.test(u)&&(c=n[parseInt(u,10)]),c===void 0||typeof c!="object"||c===null)return;n=c;}let o=a[a.length-1];n instanceof Map&&n.delete(o);}normalizePath(t){return "/"+t.replace(/\[(\d+)\]/g,".$1").split(".").filter(n=>n.length>0).join("/")}getDataByPath(t,r){let a=this.normalizePath(r).split("/").filter(o=>o),n=t;for(let o of a){if(n==null)return null;if(n instanceof Map)n=n.get(o);else if(Array.isArray(n)&&/^\d+$/.test(o))n=n[parseInt(o,10)];else if(d(n))n=n[o];else return null}return n??null}getOrCreateSurface(t){let r=this.surfaces.get(t);return r||(r={rootComponentId:null,componentTree:null,dataModel:new this.mapCtor,components:new this.mapCtor,styles:{}},this.surfaces.set(t,r)),r}rebuildComponentTree(t){if(!t.rootComponentId){t.componentTree=null;return}let r=new this.setCtor;t.componentTree=this.buildNodeRecursive(t.rootComponentId,t,r,"/","");}buildNodeRecursive(t,r,a,n,o=""){let l=`${t}${o}`,{components:u}=r;if(!u.has(t))return null;if(a.has(l))throw new Error(`Circular dependency for component "${l}".`);a.add(l);let c=u.get(t),i=c.component,f={...c};delete f.id,delete f.component;let s={};for(let[R,w]of Object.entries(f))s[R]=this.resolvePropertyValue(w,r,a,n,o);a.delete(l);let g=c.weight,p={id:l,dataContextPath:n,weight:typeof g=="number"||typeof g=="string"?g:void 0};switch(i){case "Text":if(!N(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Text",properties:s};case "Image":if(!T(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Image",properties:s};case "Icon":if(!$(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Icon",properties:s};case "Video":if(!L(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Video",properties:s};case "AudioPlayer":if(!M(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"AudioPlayer",properties:s};case "Row":if(!j(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Row",properties:s};case "Column":if(!S(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Column",properties:s};case "List":if(!P(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"List",properties:s};case "Card":if(!A(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Card",properties:s};case "Tabs":if(!U(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Tabs",properties:s};case "Divider":if(!V(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Divider",properties:s};case "Modal":if(!E(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Modal",properties:s};case "Button":if(!x(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Button",properties:s};case "CheckBox":if(!b(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"CheckBox",properties:s};case "TextField":if(!F(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"TextField",properties:s};case "DateTimeInput":if(!k(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"DateTimeInput",properties:s};case "MultipleChoice":if(!O(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"MultipleChoice",properties:s};case "Slider":if(!B(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Slider",properties:s};default:return {...p,type:i,properties:s}}}resolvePropertyValue(t,r,a,n,o=""){if(typeof t=="string"&&r.components.has(t))return this.buildNodeRecursive(t,r,a,n,o);if(I(t)){if(t.explicitList)return t.explicitList.map(l=>this.buildNodeRecursive(l,r,a,n,o));if(t.template){let l=this.resolvePath(t.template.dataBinding,n),u=this.getDataByPath(r.dataModel,l),c=t.template;return Array.isArray(u)?u.map((i,f)=>{let p=`:${[...n.split("/").filter(w=>/^\d+$/.test(w)),f].join(":")}`,R=`${l}/${f}`;return this.buildNodeRecursive(c.componentId,r,a,R,p)}):u instanceof Map?Array.from(u.keys(),i=>{let f=`:${i}`,s=`${l}/${i}`;return this.buildNodeRecursive(c.componentId,r,a,s,f)}):[]}}if(Array.isArray(t))return t.map(l=>this.resolvePropertyValue(l,r,a,n,o));if(d(t)){let l={};for(let[u,c]of Object.entries(t)){let i=c;if(D(u,c)&&n!=="/"){i=c.replace(/^\.?\/item/,"").replace(/^\.?\/text/,"").replace(/^\.?\/label/,"").replace(/^\.?\//,""),l[u]=i;continue}l[u]=this.resolvePropertyValue(i,r,a,n,o);}return l}return t}};y(m,"DEFAULT_SURFACE_ID","@default");var C=m;function X(){return new C}
2
- exports.A2uiMessageProcessor=C;exports.createMessageProcessor=X;exports.isAnyComponentNode=h;exports.isBooleanValue=q;exports.isComponentArrayReference=I;exports.isNumberValue=W;exports.isObject=d;exports.isPath=D;exports.isResolvedAudioPlayer=M;exports.isResolvedButton=x;exports.isResolvedCard=A;exports.isResolvedCheckbox=b;exports.isResolvedColumn=S;exports.isResolvedDateTimeInput=k;exports.isResolvedDivider=V;exports.isResolvedIcon=$;exports.isResolvedImage=T;exports.isResolvedList=P;exports.isResolvedModal=E;exports.isResolvedMultipleChoice=O;exports.isResolvedRow=j;exports.isResolvedSlider=B;exports.isResolvedTabItem=G;exports.isResolvedTabs=U;exports.isResolvedText=N;exports.isResolvedTextField=F;exports.isResolvedVideo=L;exports.isStringValue=v;exports.isValueMap=J;
1
+ 'use strict';var z=Object.defineProperty;var _=(e,t,n)=>t in e?z(e,t,{enumerable:true,configurable:true,writable:true,value:n}):e[t]=n;var m=(e,t,n)=>_(e,typeof t!="symbol"?t+"":t,n);function J(e){return c(e)}function D(e,t){return e==="path"&&typeof t=="string"}function c(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function I(e){return c(e)?"explicitList"in e||"template"in e:false}function g(e){return !!(typeof e=="string"||c(e)&&"path"in e&&typeof e.path=="string")}function W(e){return !!(typeof e=="number"||c(e)&&"path"in e&&typeof e.path=="string")}function q(e){return !!(typeof e=="boolean"||c(e)&&"path"in e&&typeof e.path=="string")}function h(e){return c(e)?"id"in e&&"type"in e&&"properties"in e:false}function M(e){return c(e)&&"url"in e&&g(e.url)}function x(e){return c(e)&&"child"in e&&h(e.child)&&"action"in e}function A(e){return c(e)?"child"in e?h(e.child):"children"in e?Array.isArray(e.children)&&e.children.every(h):false:false}function b(e){return c(e)&&"label"in e&&g(e.label)&&"value"in e&&q(e.value)}function S(e){return c(e)&&"children"in e&&Array.isArray(e.children)&&e.children.every(h)}function k(e){return c(e)&&"value"in e&&g(e.value)}function V(e){return c(e)}function T(e){return c(e)&&"url"in e&&g(e.url)}function $(e){return c(e)&&"name"in e&&g(e.name)}function P(e){return c(e)&&"children"in e&&Array.isArray(e.children)&&e.children.every(h)}function E(e){return c(e)&&"entryPointChild"in e&&h(e.entryPointChild)&&"contentChild"in e&&h(e.contentChild)}function O(e){return c(e)&&"selections"in e}function U(e){return c(e)&&"children"in e&&Array.isArray(e.children)&&e.children.every(h)}function j(e){return c(e)&&"value"in e&&W(e.value)}function G(e){return c(e)&&"title"in e&&g(e.title)&&"child"in e&&h(e.child)}function B(e){return c(e)&&"tabItems"in e&&Array.isArray(e.tabItems)&&e.tabItems.every(G)}function N(e){return c(e)&&"text"in e&&g(e.text)}function L(e){return c(e)&&"label"in e&&g(e.label)}function F(e){return c(e)&&"url"in e&&g(e.url)}var v=class v{constructor(t={}){m(this,"mapCtor",Map);m(this,"arrayCtor",Array);m(this,"setCtor",Set);m(this,"objCtor",Object);m(this,"surfaces");this.arrayCtor=t.arrayCtor??Array,this.mapCtor=t.mapCtor??Map,this.setCtor=t.setCtor??Set,this.objCtor=t.objCtor??Object,this.surfaces=new this.mapCtor;}getSurfaces(){return this.surfaces}clearSurfaces(){this.surfaces.clear();}processMessages(t){console.log("[A2UI] processMessages called with",t.length,"messages");for(let n of t)"createSurface"in n?this.handleCreateSurface(n):"updateComponents"in n?this.handleUpdateComponents(n):"updateDataModel"in n?this.handleUpdateDataModel(n):"deleteSurface"in n?this.handleDeleteSurface(n):console.warn("[A2UI] Unknown message type:",Object.keys(n));}getData(t,n,l=v.DEFAULT_SURFACE_ID){let r=this.getOrCreateSurface(l);if(!r)return console.warn("[A2UI] getData: surface not found:",l),null;let o;n==="."||n===""?o=t.dataContextPath??"/":o=this.resolvePath(n,t.dataContextPath);let s=this.getDataByPath(r.dataModel,o);return console.log("[A2UI] getData:",{surfaceId:l,relativePath:n,finalPath:o,result:s,dataModelSize:r.dataModel.size,formData:r.dataModel.get("form")}),s}setData(t,n,l,r=v.DEFAULT_SURFACE_ID){if(!t){console.warn("No component node set");return}let o=this.getOrCreateSurface(r);if(!o)return;let s;n==="."||n===""?s=t.dataContextPath??"/":s=this.resolvePath(n,t.dataContextPath),console.log("[A2UI] setData:",{surfaceId:r,relativePath:n,finalPath:s,value:l}),this.setDataByPath(o.dataModel,s,l),console.log("[A2UI] dataModel after setData:",{surfaceId:r,formData:o.dataModel.get("form")});}resolvePath(t,n){return t.startsWith("/")?t:n&&n!=="/"?n.endsWith("/")?`${n}${t}`:`${n}/${t}`:`/${t}`}handleCreateSurface(t){let{createSurface:n}=t,l=n.surfaceId,r=this.getOrCreateSurface(l);r.catalogId=n.catalogId;}handleUpdateComponents(t){let{updateComponents:n}=t,l=n.surfaceId,r=this.getOrCreateSurface(l);for(let d of n.components)r.components.set(d.id,d);let o=n.components,s=null;for(let d of o)if(d.id.endsWith("-root")){s=d.id;break}if(!s){let d=new this.setCtor;for(let i of o){let f=i;if(Array.isArray(f.children))for(let a of f.children)typeof a=="string"&&d.add(a);typeof f.child=="string"&&d.add(f.child);}let u=["Column","Row","List","Card"];for(let i of o)if(!d.has(i.id)&&u.includes(i.component)){s=i.id;break}}!s&&o.length>0&&(s=o[o.length-1].id),s&&(r.rootComponentId=s),this.rebuildComponentTree(r);}handleUpdateDataModel(t){let{updateDataModel:n}=t,l=n.surfaceId,r=this.getOrCreateSurface(l),o=n.path??"/",s=n.op??"replace",d=n.value;s==="remove"?this.removeDataByPath(r.dataModel,o):d!==void 0&&this.setDataByPath(r.dataModel,o,d),this.rebuildComponentTree(r);}handleDeleteSurface(t){let{deleteSurface:n}=t;this.surfaces.delete(n.surfaceId);}setDataByPath(t,n,l){let r=this.normalizePath(n).split("/").filter(d=>d);if(r.length===0){if(c(l)&&!(l instanceof Map)){t.clear();for(let[d,u]of Object.entries(l))t.set(d,u);}return}let o=t;for(let d=0;d<r.length-1;d++){let u=r[d],i;if(o instanceof Map?i=o.get(u):Array.isArray(o)&&/^\d+$/.test(u)?i=o[parseInt(u,10)]:c(o)&&(i=o[u]),i===void 0||typeof i!="object"||i===null){let f=new this.mapCtor;o instanceof Map?o.set(u,f):Array.isArray(o)?o[parseInt(u,10)]=f:c(o)&&(o[u]=f),i=f;}o=i;}let s=r[r.length-1];o instanceof Map?o.set(s,l):Array.isArray(o)&&/^\d+$/.test(s)?o[parseInt(s,10)]=l:c(o)&&(o[s]=l);}removeDataByPath(t,n){let l=this.normalizePath(n).split("/").filter(s=>s);if(l.length===0){t.clear();return}let r=t;for(let s=0;s<l.length-1;s++){let d=l[s],u;if(r instanceof Map?u=r.get(d):Array.isArray(r)&&/^\d+$/.test(d)&&(u=r[parseInt(d,10)]),u===void 0||typeof u!="object"||u===null)return;r=u;}let o=l[l.length-1];r instanceof Map&&r.delete(o);}normalizePath(t){return "/"+t.replace(/\[(\d+)\]/g,".$1").split(".").filter(r=>r.length>0).join("/")}getDataByPath(t,n){let l=this.normalizePath(n).split("/").filter(o=>o),r=t;for(let o of l){if(r==null)return null;if(r instanceof Map)r=r.get(o);else if(Array.isArray(r)&&/^\d+$/.test(o))r=r[parseInt(o,10)];else if(c(r))r=r[o];else return null}return r??null}getOrCreateSurface(t){let n=this.surfaces.get(t);return n||(n={rootComponentId:null,componentTree:null,dataModel:new this.mapCtor,components:new this.mapCtor,styles:{}},this.surfaces.set(t,n)),n}rebuildComponentTree(t){if(!t.rootComponentId){t.componentTree=null;return}let n=new this.setCtor;t.componentTree=this.buildNodeRecursive(t.rootComponentId,t,n,"/","");}buildNodeRecursive(t,n,l,r,o=""){let s=`${t}${o}`,{components:d}=n;if(!d.has(t))return null;if(l.has(s))throw new Error(`Circular dependency for component "${s}".`);l.add(s);let u=d.get(t),i=u.component,f={...u};delete f.id,delete f.component;let a={};for(let[R,w]of Object.entries(f))a[R]=this.resolvePropertyValue(w,n,l,r,o);l.delete(s);let y=u.weight,p={id:s,dataContextPath:r,weight:typeof y=="number"||typeof y=="string"?y:void 0};switch(i){case "Text":if(!N(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Text",properties:a};case "Image":if(!T(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Image",properties:a};case "Icon":if(!$(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Icon",properties:a};case "Video":if(!F(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Video",properties:a};case "AudioPlayer":if(!M(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"AudioPlayer",properties:a};case "Row":if(!U(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Row",properties:a};case "Column":if(!S(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Column",properties:a};case "List":if(!P(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"List",properties:a};case "Card":if(!A(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Card",properties:a};case "Tabs":if(!B(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Tabs",properties:a};case "Divider":if(!V(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Divider",properties:a};case "Modal":if(!E(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Modal",properties:a};case "Button":if(!x(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Button",properties:a};case "CheckBox":if(!b(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"CheckBox",properties:a};case "TextField":if(!L(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"TextField",properties:a};case "DateTimeInput":if(!k(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"DateTimeInput",properties:a};case "MultipleChoice":if(!O(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"MultipleChoice",properties:a};case "Slider":if(!j(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Slider",properties:a};default:return {...p,type:i,properties:a}}}resolvePropertyValue(t,n,l,r,o=""){if(typeof t=="string"&&n.components.has(t))return this.buildNodeRecursive(t,n,l,r,o);if(I(t)){if(t.explicitList)return t.explicitList.map(s=>this.buildNodeRecursive(s,n,l,r,o));if(t.template){let s=this.resolvePath(t.template.dataBinding,r),d=this.getDataByPath(n.dataModel,s),u=t.template;return Array.isArray(d)?d.map((i,f)=>{let p=`:${[...r.split("/").filter(w=>/^\d+$/.test(w)),f].join(":")}`,R=`${s}/${f}`;return this.buildNodeRecursive(u.componentId,n,l,R,p)}):d instanceof Map?Array.from(d.keys(),i=>{let f=`:${i}`,a=`${s}/${i}`;return this.buildNodeRecursive(u.componentId,n,l,a,f)}):[]}}if(Array.isArray(t))return t.map(s=>this.resolvePropertyValue(s,n,l,r,o));if(c(t)){let s={};for(let[d,u]of Object.entries(t)){let i=u;if(D(d,u)&&r!=="/"){i=u.replace(/^\.?\/item/,"").replace(/^\.?\/text/,"").replace(/^\.?\/label/,"").replace(/^\.?\//,""),s[d]=i;continue}s[d]=this.resolvePropertyValue(i,n,l,r,o);}return s}return t}};m(v,"DEFAULT_SURFACE_ID","@default");var C=v;function X(){return new C}
2
+ exports.A2uiMessageProcessor=C;exports.createMessageProcessor=X;exports.isAnyComponentNode=h;exports.isBooleanValue=q;exports.isComponentArrayReference=I;exports.isNumberValue=W;exports.isObject=c;exports.isPath=D;exports.isResolvedAudioPlayer=M;exports.isResolvedButton=x;exports.isResolvedCard=A;exports.isResolvedCheckbox=b;exports.isResolvedColumn=S;exports.isResolvedDateTimeInput=k;exports.isResolvedDivider=V;exports.isResolvedIcon=$;exports.isResolvedImage=T;exports.isResolvedList=P;exports.isResolvedModal=E;exports.isResolvedMultipleChoice=O;exports.isResolvedRow=U;exports.isResolvedSlider=j;exports.isResolvedTabItem=G;exports.isResolvedTabs=B;exports.isResolvedText=N;exports.isResolvedTextField=L;exports.isResolvedVideo=F;exports.isStringValue=g;exports.isValueMap=J;
@@ -1,2 +1,2 @@
1
- var z=Object.defineProperty;var _=(e,t,r)=>t in e?z(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r;var y=(e,t,r)=>_(e,typeof t!="symbol"?t+"":t,r);function J(e){return d(e)}function D(e,t){return e==="path"&&typeof t=="string"}function d(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function I(e){return d(e)?"explicitList"in e||"template"in e:false}function v(e){return !!(typeof e=="string"||d(e)&&"path"in e&&typeof e.path=="string")}function W(e){return !!(typeof e=="number"||d(e)&&"path"in e&&typeof e.path=="string")}function q(e){return !!(typeof e=="boolean"||d(e)&&"path"in e&&typeof e.path=="string")}function h(e){return d(e)?"id"in e&&"type"in e&&"properties"in e:false}function M(e){return d(e)&&"url"in e&&v(e.url)}function x(e){return d(e)&&"child"in e&&h(e.child)&&"action"in e}function A(e){return d(e)?"child"in e?h(e.child):"children"in e?Array.isArray(e.children)&&e.children.every(h):false:false}function b(e){return d(e)&&"label"in e&&v(e.label)&&"value"in e&&q(e.value)}function S(e){return d(e)&&"children"in e&&Array.isArray(e.children)&&e.children.every(h)}function k(e){return d(e)&&"value"in e&&v(e.value)}function V(e){return d(e)}function T(e){return d(e)&&"url"in e&&v(e.url)}function $(e){return d(e)&&"name"in e&&v(e.name)}function P(e){return d(e)&&"children"in e&&Array.isArray(e.children)&&e.children.every(h)}function E(e){return d(e)&&"entryPointChild"in e&&h(e.entryPointChild)&&"contentChild"in e&&h(e.contentChild)}function O(e){return d(e)&&"selections"in e}function j(e){return d(e)&&"children"in e&&Array.isArray(e.children)&&e.children.every(h)}function B(e){return d(e)&&"value"in e&&W(e.value)}function G(e){return d(e)&&"title"in e&&v(e.title)&&"child"in e&&h(e.child)}function U(e){return d(e)&&"tabItems"in e&&Array.isArray(e.tabItems)&&e.tabItems.every(G)}function N(e){return d(e)&&"text"in e&&v(e.text)}function F(e){return d(e)&&"label"in e&&v(e.label)}function L(e){return d(e)&&"url"in e&&v(e.url)}var m=class m{constructor(t={}){y(this,"mapCtor",Map);y(this,"arrayCtor",Array);y(this,"setCtor",Set);y(this,"objCtor",Object);y(this,"surfaces");this.arrayCtor=t.arrayCtor??Array,this.mapCtor=t.mapCtor??Map,this.setCtor=t.setCtor??Set,this.objCtor=t.objCtor??Object,this.surfaces=new this.mapCtor;}getSurfaces(){return this.surfaces}clearSurfaces(){this.surfaces.clear();}processMessages(t){console.log("[A2UI] processMessages called with",t.length,"messages");for(let r of t)"createSurface"in r?this.handleCreateSurface(r):"updateComponents"in r?this.handleUpdateComponents(r):"updateDataModel"in r?this.handleUpdateDataModel(r):"deleteSurface"in r?this.handleDeleteSurface(r):console.warn("[A2UI] Unknown message type:",Object.keys(r));}getData(t,r,a=m.DEFAULT_SURFACE_ID){let n=this.getOrCreateSurface(a);if(!n)return console.warn("[A2UI] getData: surface not found:",a),null;let o;return r==="."||r===""?o=t.dataContextPath??"/":o=this.resolvePath(r,t.dataContextPath),this.getDataByPath(n.dataModel,o)}setData(t,r,a,n=m.DEFAULT_SURFACE_ID){if(!t){console.warn("No component node set");return}let o=this.getOrCreateSurface(n);if(!o)return;let l;r==="."||r===""?l=t.dataContextPath??"/":l=this.resolvePath(r,t.dataContextPath),this.setDataByPath(o.dataModel,l,a);}resolvePath(t,r){return t.startsWith("/")?t:r&&r!=="/"?r.endsWith("/")?`${r}${t}`:`${r}/${t}`:`/${t}`}handleCreateSurface(t){let{createSurface:r}=t,a=r.surfaceId,n=this.getOrCreateSurface(a);n.catalogId=r.catalogId;}handleUpdateComponents(t){let{updateComponents:r}=t,a=r.surfaceId,n=this.getOrCreateSurface(a);for(let o of r.components)n.components.set(o.id,o),n.rootComponentId||(n.rootComponentId=o.id);this.rebuildComponentTree(n);}handleUpdateDataModel(t){let{updateDataModel:r}=t,a=r.surfaceId,n=this.getOrCreateSurface(a),o=r.path??"/",l=r.op??"replace",u=r.value;l==="remove"?this.removeDataByPath(n.dataModel,o):u!==void 0&&this.setDataByPath(n.dataModel,o,u),this.rebuildComponentTree(n);}handleDeleteSurface(t){let{deleteSurface:r}=t;this.surfaces.delete(r.surfaceId);}setDataByPath(t,r,a){let n=this.normalizePath(r).split("/").filter(u=>u);if(n.length===0){if(d(a)&&!(a instanceof Map)){t.clear();for(let[u,c]of Object.entries(a))t.set(u,c);}return}let o=t;for(let u=0;u<n.length-1;u++){let c=n[u],i;if(o instanceof Map?i=o.get(c):Array.isArray(o)&&/^\d+$/.test(c)&&(i=o[parseInt(c,10)]),i===void 0||typeof i!="object"||i===null){let f=new this.mapCtor;o instanceof Map?o.set(c,f):Array.isArray(o)&&(o[parseInt(c,10)]=f),i=f;}o=i;}let l=n[n.length-1];o instanceof Map?o.set(l,a):Array.isArray(o)&&/^\d+$/.test(l)&&(o[parseInt(l,10)]=a);}removeDataByPath(t,r){let a=this.normalizePath(r).split("/").filter(l=>l);if(a.length===0){t.clear();return}let n=t;for(let l=0;l<a.length-1;l++){let u=a[l],c;if(n instanceof Map?c=n.get(u):Array.isArray(n)&&/^\d+$/.test(u)&&(c=n[parseInt(u,10)]),c===void 0||typeof c!="object"||c===null)return;n=c;}let o=a[a.length-1];n instanceof Map&&n.delete(o);}normalizePath(t){return "/"+t.replace(/\[(\d+)\]/g,".$1").split(".").filter(n=>n.length>0).join("/")}getDataByPath(t,r){let a=this.normalizePath(r).split("/").filter(o=>o),n=t;for(let o of a){if(n==null)return null;if(n instanceof Map)n=n.get(o);else if(Array.isArray(n)&&/^\d+$/.test(o))n=n[parseInt(o,10)];else if(d(n))n=n[o];else return null}return n??null}getOrCreateSurface(t){let r=this.surfaces.get(t);return r||(r={rootComponentId:null,componentTree:null,dataModel:new this.mapCtor,components:new this.mapCtor,styles:{}},this.surfaces.set(t,r)),r}rebuildComponentTree(t){if(!t.rootComponentId){t.componentTree=null;return}let r=new this.setCtor;t.componentTree=this.buildNodeRecursive(t.rootComponentId,t,r,"/","");}buildNodeRecursive(t,r,a,n,o=""){let l=`${t}${o}`,{components:u}=r;if(!u.has(t))return null;if(a.has(l))throw new Error(`Circular dependency for component "${l}".`);a.add(l);let c=u.get(t),i=c.component,f={...c};delete f.id,delete f.component;let s={};for(let[R,w]of Object.entries(f))s[R]=this.resolvePropertyValue(w,r,a,n,o);a.delete(l);let g=c.weight,p={id:l,dataContextPath:n,weight:typeof g=="number"||typeof g=="string"?g:void 0};switch(i){case "Text":if(!N(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Text",properties:s};case "Image":if(!T(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Image",properties:s};case "Icon":if(!$(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Icon",properties:s};case "Video":if(!L(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Video",properties:s};case "AudioPlayer":if(!M(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"AudioPlayer",properties:s};case "Row":if(!j(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Row",properties:s};case "Column":if(!S(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Column",properties:s};case "List":if(!P(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"List",properties:s};case "Card":if(!A(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Card",properties:s};case "Tabs":if(!U(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Tabs",properties:s};case "Divider":if(!V(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Divider",properties:s};case "Modal":if(!E(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Modal",properties:s};case "Button":if(!x(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Button",properties:s};case "CheckBox":if(!b(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"CheckBox",properties:s};case "TextField":if(!F(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"TextField",properties:s};case "DateTimeInput":if(!k(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"DateTimeInput",properties:s};case "MultipleChoice":if(!O(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"MultipleChoice",properties:s};case "Slider":if(!B(s))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Slider",properties:s};default:return {...p,type:i,properties:s}}}resolvePropertyValue(t,r,a,n,o=""){if(typeof t=="string"&&r.components.has(t))return this.buildNodeRecursive(t,r,a,n,o);if(I(t)){if(t.explicitList)return t.explicitList.map(l=>this.buildNodeRecursive(l,r,a,n,o));if(t.template){let l=this.resolvePath(t.template.dataBinding,n),u=this.getDataByPath(r.dataModel,l),c=t.template;return Array.isArray(u)?u.map((i,f)=>{let p=`:${[...n.split("/").filter(w=>/^\d+$/.test(w)),f].join(":")}`,R=`${l}/${f}`;return this.buildNodeRecursive(c.componentId,r,a,R,p)}):u instanceof Map?Array.from(u.keys(),i=>{let f=`:${i}`,s=`${l}/${i}`;return this.buildNodeRecursive(c.componentId,r,a,s,f)}):[]}}if(Array.isArray(t))return t.map(l=>this.resolvePropertyValue(l,r,a,n,o));if(d(t)){let l={};for(let[u,c]of Object.entries(t)){let i=c;if(D(u,c)&&n!=="/"){i=c.replace(/^\.?\/item/,"").replace(/^\.?\/text/,"").replace(/^\.?\/label/,"").replace(/^\.?\//,""),l[u]=i;continue}l[u]=this.resolvePropertyValue(i,r,a,n,o);}return l}return t}};y(m,"DEFAULT_SURFACE_ID","@default");var C=m;function X(){return new C}
2
- export{C as A2uiMessageProcessor,X as createMessageProcessor,h as isAnyComponentNode,q as isBooleanValue,I as isComponentArrayReference,W as isNumberValue,d as isObject,D as isPath,M as isResolvedAudioPlayer,x as isResolvedButton,A as isResolvedCard,b as isResolvedCheckbox,S as isResolvedColumn,k as isResolvedDateTimeInput,V as isResolvedDivider,$ as isResolvedIcon,T as isResolvedImage,P as isResolvedList,E as isResolvedModal,O as isResolvedMultipleChoice,j as isResolvedRow,B as isResolvedSlider,G as isResolvedTabItem,U as isResolvedTabs,N as isResolvedText,F as isResolvedTextField,L as isResolvedVideo,v as isStringValue,J as isValueMap};
1
+ var z=Object.defineProperty;var _=(e,t,n)=>t in e?z(e,t,{enumerable:true,configurable:true,writable:true,value:n}):e[t]=n;var m=(e,t,n)=>_(e,typeof t!="symbol"?t+"":t,n);function J(e){return c(e)}function D(e,t){return e==="path"&&typeof t=="string"}function c(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function I(e){return c(e)?"explicitList"in e||"template"in e:false}function g(e){return !!(typeof e=="string"||c(e)&&"path"in e&&typeof e.path=="string")}function W(e){return !!(typeof e=="number"||c(e)&&"path"in e&&typeof e.path=="string")}function q(e){return !!(typeof e=="boolean"||c(e)&&"path"in e&&typeof e.path=="string")}function h(e){return c(e)?"id"in e&&"type"in e&&"properties"in e:false}function M(e){return c(e)&&"url"in e&&g(e.url)}function x(e){return c(e)&&"child"in e&&h(e.child)&&"action"in e}function A(e){return c(e)?"child"in e?h(e.child):"children"in e?Array.isArray(e.children)&&e.children.every(h):false:false}function b(e){return c(e)&&"label"in e&&g(e.label)&&"value"in e&&q(e.value)}function S(e){return c(e)&&"children"in e&&Array.isArray(e.children)&&e.children.every(h)}function k(e){return c(e)&&"value"in e&&g(e.value)}function V(e){return c(e)}function T(e){return c(e)&&"url"in e&&g(e.url)}function $(e){return c(e)&&"name"in e&&g(e.name)}function P(e){return c(e)&&"children"in e&&Array.isArray(e.children)&&e.children.every(h)}function E(e){return c(e)&&"entryPointChild"in e&&h(e.entryPointChild)&&"contentChild"in e&&h(e.contentChild)}function O(e){return c(e)&&"selections"in e}function U(e){return c(e)&&"children"in e&&Array.isArray(e.children)&&e.children.every(h)}function j(e){return c(e)&&"value"in e&&W(e.value)}function G(e){return c(e)&&"title"in e&&g(e.title)&&"child"in e&&h(e.child)}function B(e){return c(e)&&"tabItems"in e&&Array.isArray(e.tabItems)&&e.tabItems.every(G)}function N(e){return c(e)&&"text"in e&&g(e.text)}function L(e){return c(e)&&"label"in e&&g(e.label)}function F(e){return c(e)&&"url"in e&&g(e.url)}var v=class v{constructor(t={}){m(this,"mapCtor",Map);m(this,"arrayCtor",Array);m(this,"setCtor",Set);m(this,"objCtor",Object);m(this,"surfaces");this.arrayCtor=t.arrayCtor??Array,this.mapCtor=t.mapCtor??Map,this.setCtor=t.setCtor??Set,this.objCtor=t.objCtor??Object,this.surfaces=new this.mapCtor;}getSurfaces(){return this.surfaces}clearSurfaces(){this.surfaces.clear();}processMessages(t){console.log("[A2UI] processMessages called with",t.length,"messages");for(let n of t)"createSurface"in n?this.handleCreateSurface(n):"updateComponents"in n?this.handleUpdateComponents(n):"updateDataModel"in n?this.handleUpdateDataModel(n):"deleteSurface"in n?this.handleDeleteSurface(n):console.warn("[A2UI] Unknown message type:",Object.keys(n));}getData(t,n,l=v.DEFAULT_SURFACE_ID){let r=this.getOrCreateSurface(l);if(!r)return console.warn("[A2UI] getData: surface not found:",l),null;let o;n==="."||n===""?o=t.dataContextPath??"/":o=this.resolvePath(n,t.dataContextPath);let s=this.getDataByPath(r.dataModel,o);return console.log("[A2UI] getData:",{surfaceId:l,relativePath:n,finalPath:o,result:s,dataModelSize:r.dataModel.size,formData:r.dataModel.get("form")}),s}setData(t,n,l,r=v.DEFAULT_SURFACE_ID){if(!t){console.warn("No component node set");return}let o=this.getOrCreateSurface(r);if(!o)return;let s;n==="."||n===""?s=t.dataContextPath??"/":s=this.resolvePath(n,t.dataContextPath),console.log("[A2UI] setData:",{surfaceId:r,relativePath:n,finalPath:s,value:l}),this.setDataByPath(o.dataModel,s,l),console.log("[A2UI] dataModel after setData:",{surfaceId:r,formData:o.dataModel.get("form")});}resolvePath(t,n){return t.startsWith("/")?t:n&&n!=="/"?n.endsWith("/")?`${n}${t}`:`${n}/${t}`:`/${t}`}handleCreateSurface(t){let{createSurface:n}=t,l=n.surfaceId,r=this.getOrCreateSurface(l);r.catalogId=n.catalogId;}handleUpdateComponents(t){let{updateComponents:n}=t,l=n.surfaceId,r=this.getOrCreateSurface(l);for(let d of n.components)r.components.set(d.id,d);let o=n.components,s=null;for(let d of o)if(d.id.endsWith("-root")){s=d.id;break}if(!s){let d=new this.setCtor;for(let i of o){let f=i;if(Array.isArray(f.children))for(let a of f.children)typeof a=="string"&&d.add(a);typeof f.child=="string"&&d.add(f.child);}let u=["Column","Row","List","Card"];for(let i of o)if(!d.has(i.id)&&u.includes(i.component)){s=i.id;break}}!s&&o.length>0&&(s=o[o.length-1].id),s&&(r.rootComponentId=s),this.rebuildComponentTree(r);}handleUpdateDataModel(t){let{updateDataModel:n}=t,l=n.surfaceId,r=this.getOrCreateSurface(l),o=n.path??"/",s=n.op??"replace",d=n.value;s==="remove"?this.removeDataByPath(r.dataModel,o):d!==void 0&&this.setDataByPath(r.dataModel,o,d),this.rebuildComponentTree(r);}handleDeleteSurface(t){let{deleteSurface:n}=t;this.surfaces.delete(n.surfaceId);}setDataByPath(t,n,l){let r=this.normalizePath(n).split("/").filter(d=>d);if(r.length===0){if(c(l)&&!(l instanceof Map)){t.clear();for(let[d,u]of Object.entries(l))t.set(d,u);}return}let o=t;for(let d=0;d<r.length-1;d++){let u=r[d],i;if(o instanceof Map?i=o.get(u):Array.isArray(o)&&/^\d+$/.test(u)?i=o[parseInt(u,10)]:c(o)&&(i=o[u]),i===void 0||typeof i!="object"||i===null){let f=new this.mapCtor;o instanceof Map?o.set(u,f):Array.isArray(o)?o[parseInt(u,10)]=f:c(o)&&(o[u]=f),i=f;}o=i;}let s=r[r.length-1];o instanceof Map?o.set(s,l):Array.isArray(o)&&/^\d+$/.test(s)?o[parseInt(s,10)]=l:c(o)&&(o[s]=l);}removeDataByPath(t,n){let l=this.normalizePath(n).split("/").filter(s=>s);if(l.length===0){t.clear();return}let r=t;for(let s=0;s<l.length-1;s++){let d=l[s],u;if(r instanceof Map?u=r.get(d):Array.isArray(r)&&/^\d+$/.test(d)&&(u=r[parseInt(d,10)]),u===void 0||typeof u!="object"||u===null)return;r=u;}let o=l[l.length-1];r instanceof Map&&r.delete(o);}normalizePath(t){return "/"+t.replace(/\[(\d+)\]/g,".$1").split(".").filter(r=>r.length>0).join("/")}getDataByPath(t,n){let l=this.normalizePath(n).split("/").filter(o=>o),r=t;for(let o of l){if(r==null)return null;if(r instanceof Map)r=r.get(o);else if(Array.isArray(r)&&/^\d+$/.test(o))r=r[parseInt(o,10)];else if(c(r))r=r[o];else return null}return r??null}getOrCreateSurface(t){let n=this.surfaces.get(t);return n||(n={rootComponentId:null,componentTree:null,dataModel:new this.mapCtor,components:new this.mapCtor,styles:{}},this.surfaces.set(t,n)),n}rebuildComponentTree(t){if(!t.rootComponentId){t.componentTree=null;return}let n=new this.setCtor;t.componentTree=this.buildNodeRecursive(t.rootComponentId,t,n,"/","");}buildNodeRecursive(t,n,l,r,o=""){let s=`${t}${o}`,{components:d}=n;if(!d.has(t))return null;if(l.has(s))throw new Error(`Circular dependency for component "${s}".`);l.add(s);let u=d.get(t),i=u.component,f={...u};delete f.id,delete f.component;let a={};for(let[R,w]of Object.entries(f))a[R]=this.resolvePropertyValue(w,n,l,r,o);l.delete(s);let y=u.weight,p={id:s,dataContextPath:r,weight:typeof y=="number"||typeof y=="string"?y:void 0};switch(i){case "Text":if(!N(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Text",properties:a};case "Image":if(!T(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Image",properties:a};case "Icon":if(!$(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Icon",properties:a};case "Video":if(!F(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Video",properties:a};case "AudioPlayer":if(!M(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"AudioPlayer",properties:a};case "Row":if(!U(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Row",properties:a};case "Column":if(!S(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Column",properties:a};case "List":if(!P(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"List",properties:a};case "Card":if(!A(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Card",properties:a};case "Tabs":if(!B(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Tabs",properties:a};case "Divider":if(!V(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Divider",properties:a};case "Modal":if(!E(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Modal",properties:a};case "Button":if(!x(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Button",properties:a};case "CheckBox":if(!b(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"CheckBox",properties:a};case "TextField":if(!L(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"TextField",properties:a};case "DateTimeInput":if(!k(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"DateTimeInput",properties:a};case "MultipleChoice":if(!O(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"MultipleChoice",properties:a};case "Slider":if(!j(a))throw new Error(`Invalid data; expected ${i}`);return {...p,type:"Slider",properties:a};default:return {...p,type:i,properties:a}}}resolvePropertyValue(t,n,l,r,o=""){if(typeof t=="string"&&n.components.has(t))return this.buildNodeRecursive(t,n,l,r,o);if(I(t)){if(t.explicitList)return t.explicitList.map(s=>this.buildNodeRecursive(s,n,l,r,o));if(t.template){let s=this.resolvePath(t.template.dataBinding,r),d=this.getDataByPath(n.dataModel,s),u=t.template;return Array.isArray(d)?d.map((i,f)=>{let p=`:${[...r.split("/").filter(w=>/^\d+$/.test(w)),f].join(":")}`,R=`${s}/${f}`;return this.buildNodeRecursive(u.componentId,n,l,R,p)}):d instanceof Map?Array.from(d.keys(),i=>{let f=`:${i}`,a=`${s}/${i}`;return this.buildNodeRecursive(u.componentId,n,l,a,f)}):[]}}if(Array.isArray(t))return t.map(s=>this.resolvePropertyValue(s,n,l,r,o));if(c(t)){let s={};for(let[d,u]of Object.entries(t)){let i=u;if(D(d,u)&&r!=="/"){i=u.replace(/^\.?\/item/,"").replace(/^\.?\/text/,"").replace(/^\.?\/label/,"").replace(/^\.?\//,""),s[d]=i;continue}s[d]=this.resolvePropertyValue(i,n,l,r,o);}return s}return t}};m(v,"DEFAULT_SURFACE_ID","@default");var C=v;function X(){return new C}
2
+ export{C as A2uiMessageProcessor,X as createMessageProcessor,h as isAnyComponentNode,q as isBooleanValue,I as isComponentArrayReference,W as isNumberValue,c as isObject,D as isPath,M as isResolvedAudioPlayer,x as isResolvedButton,A as isResolvedCard,b as isResolvedCheckbox,S as isResolvedColumn,k as isResolvedDateTimeInput,V as isResolvedDivider,$ as isResolvedIcon,T as isResolvedImage,P as isResolvedList,E as isResolvedModal,O as isResolvedMultipleChoice,U as isResolvedRow,j as isResolvedSlider,G as isResolvedTabItem,B as isResolvedTabs,N as isResolvedText,L as isResolvedTextField,F as isResolvedVideo,g as isStringValue,J as isValueMap};
@@ -0,0 +1,230 @@
1
+ import { T as Theme } from './types-Csi2jaoN.cjs';
2
+
3
+ /**
4
+ * A2UI Shared Style Constants
5
+ *
6
+ * 基础设计常量,参照官方 A2UI Lit 实现
7
+ */
8
+ /** 基础网格单位 (px) */
9
+ declare const GRID = 4;
10
+ /** 调色板色调值 */
11
+ declare const SHADES: readonly [0, 5, 10, 15, 20, 25, 30, 35, 40, 50, 60, 70, 80, 90, 95, 98, 99, 100];
12
+ /** 调色板前缀 */
13
+ declare const PALETTE_KEYS: readonly ["p", "s", "t", "n", "nv", "e"];
14
+ type Shade = (typeof SHADES)[number];
15
+ type PaletteKey = (typeof PALETTE_KEYS)[number];
16
+ /**
17
+ * 将样式键转换为 CSS 变量名
18
+ * 例如: "p35" -> "--p-35", "n0" -> "--n-0"
19
+ */
20
+ declare function toProp(key: string): string;
21
+ /**
22
+ * 获取反转的色调 (用于暗色模式)
23
+ */
24
+ declare function getInverseKey(key: string): string;
25
+
26
+ declare const layoutStyles: string;
27
+
28
+ declare const colorStyles: string;
29
+
30
+ declare const typographyStyles: string;
31
+
32
+ declare const borderStyles: string;
33
+
34
+ declare const behaviorStyles: string;
35
+
36
+ declare const iconStyles: string;
37
+
38
+ /**
39
+ * A2UI Core Styles
40
+ *
41
+ * 合并所有样式模块,生成完整的 CSS 字符串
42
+ */
43
+
44
+ /**
45
+ * 基础样式 (reset + container)
46
+ */
47
+ declare const baseStyles = "\n /* A2UI Base Styles */\n .a2ui-root {\n font-family: var(--a2-font-sans);\n font-size: var(--a2-text-bm);\n line-height: 1.5;\n color: hsl(var(--a2-foreground));\n background-color: transparent;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n }\n\n .a2ui-root *,\n .a2ui-root *::before,\n .a2ui-root *::after {\n box-sizing: border-box;\n }\n\n /* Reset headings */\n .a2ui-root h1,\n .a2ui-root h2,\n .a2ui-root h3,\n .a2ui-root h4,\n .a2ui-root h5,\n .a2ui-root h6 {\n margin: 0;\n font-weight: 600;\n line-height: 1.25;\n }\n\n .a2ui-root p {\n margin: 0;\n }\n\n .a2ui-root ul,\n .a2ui-root ol {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n .a2ui-root a {\n color: inherit;\n text-decoration: none;\n }\n\n /* \u6309\u94AE\u57FA\u7840\u91CD\u7F6E - \u53EA\u8BBE\u7F6E\u7EE7\u627F\u5C5E\u6027\uFF0C\u4E0D\u8986\u76D6\u5DE5\u5177\u7C7B */\n .a2ui-root button {\n font: inherit;\n margin: 0;\n cursor: pointer;\n }\n\n .a2ui-root input,\n .a2ui-root textarea,\n .a2ui-root select {\n font: inherit;\n color: inherit;\n }\n\n .a2ui-root img,\n .a2ui-root video {\n max-width: 100%;\n height: auto;\n }\n\n /* Scrollbar styling */\n .a2ui-root::-webkit-scrollbar {\n width: 6px;\n height: 6px;\n }\n\n .a2ui-root::-webkit-scrollbar-track {\n background: transparent;\n }\n\n .a2ui-root::-webkit-scrollbar-thumb {\n background: light-dark(var(--n-30), var(--n-70));\n border-radius: 3px;\n }\n\n .a2ui-root::-webkit-scrollbar-thumb:hover {\n background: light-dark(var(--n-40), var(--n-60));\n }\n";
48
+ /**
49
+ * 所有结构化样式(合并后的 CSS 字符串)
50
+ */
51
+ declare const structuralStyles: string;
52
+ /**
53
+ * 获取完整的 A2UI 样式 CSS
54
+ */
55
+ declare function getA2UIStyles(): string;
56
+
57
+ /**
58
+ * A2UI Default Theme
59
+ *
60
+ * 使用自定义 A2UI 工具类系统,对齐官方 Lit 实现
61
+ * 类名格式: a2-{category}-{value}
62
+ */
63
+
64
+ /**
65
+ * 默认主题配置
66
+ */
67
+ declare const defaultTheme: Theme;
68
+ /**
69
+ * 创建自定义主题(基于默认主题)
70
+ */
71
+ declare function createTheme(customTheme: Partial<Theme>): Theme;
72
+ /**
73
+ * 合并样式类映射
74
+ */
75
+ declare function mergeStyles(...classes: Array<Record<string, boolean>>): Record<string, boolean>;
76
+ /**
77
+ * 克隆默认主题(用于创建变体)
78
+ */
79
+ declare function cloneDefaultTheme(): Theme;
80
+
81
+ /**
82
+ * A2UI Theme
83
+ *
84
+ * 主题配置和注入接口
85
+ *
86
+ * 使用方式:
87
+ * ```ts
88
+ * import { injectTheme, tegoOSTheme } from '@zhama/a2ui/styles';
89
+ *
90
+ * // 使用预设主题
91
+ * injectTheme(tegoOSTheme);
92
+ *
93
+ * // 或自定义主题
94
+ * injectTheme({
95
+ * primary: '230 83% 60%',
96
+ * foreground: '222 84% 5%',
97
+ * border: '214 32% 91%',
98
+ * });
99
+ * ```
100
+ */
101
+ interface A2UITheme {
102
+ primary?: string;
103
+ primaryForeground?: string;
104
+ secondary?: string;
105
+ secondaryForeground?: string;
106
+ muted?: string;
107
+ mutedForeground?: string;
108
+ accent?: string;
109
+ accentForeground?: string;
110
+ destructive?: string;
111
+ destructiveForeground?: string;
112
+ background?: string;
113
+ foreground?: string;
114
+ card?: string;
115
+ cardForeground?: string;
116
+ popover?: string;
117
+ popoverForeground?: string;
118
+ border?: string;
119
+ input?: string;
120
+ ring?: string;
121
+ success?: string;
122
+ successForeground?: string;
123
+ warning?: string;
124
+ warningForeground?: string;
125
+ info?: string;
126
+ infoForeground?: string;
127
+ radius?: string;
128
+ radiusSm?: string;
129
+ radiusLg?: string;
130
+ fontSans?: string;
131
+ fontMono?: string;
132
+ shadowSm?: string;
133
+ shadow?: string;
134
+ shadowMd?: string;
135
+ shadowLg?: string;
136
+ }
137
+ /**
138
+ * 预设主题:Tego OS
139
+ * 与 tego-os 的 shadcn/tailwind 主题完全一致
140
+ */
141
+ declare const tegoOSTheme: A2UITheme;
142
+ /**
143
+ * 预设主题:Tego OS 暗色
144
+ */
145
+ declare const tegoOSDarkTheme: A2UITheme;
146
+ /**
147
+ * 注入主题变量到 DOM
148
+ *
149
+ * @param theme - 主题配置对象
150
+ * @param target - 注入目标,默认为 document.documentElement
151
+ */
152
+ declare function injectTheme(theme: A2UITheme, target?: HTMLElement): void;
153
+ /**
154
+ * 生成主题 CSS 字符串
155
+ * 可用于 SSR 或 style 标签注入
156
+ *
157
+ * @param theme - 主题配置对象
158
+ * @param selector - CSS 选择器,默认为 ':root'
159
+ */
160
+ declare function generateThemeCSS(theme: A2UITheme, selector?: string): string;
161
+
162
+ /**
163
+ * A2UI Style Utilities
164
+ */
165
+ /**
166
+ * 合并多个 class 映射,后面的会覆盖前面的相同前缀的类
167
+ */
168
+ declare function merge(...classes: Array<Record<string, boolean>>): Record<string, boolean>;
169
+ /**
170
+ * 将类追加到目标对象的所有属性
171
+ */
172
+ declare function appendToAll(target: Record<string, string[]>, exclusions: string[], ...classes: Array<Record<string, boolean>>): Record<string, string[]>;
173
+ /**
174
+ * 将类名映射转换为 className 字符串
175
+ */
176
+ declare function classesToString(classes: Record<string, boolean>): string;
177
+ /**
178
+ * 将样式对象转换为 React CSSProperties
179
+ */
180
+ declare function stylesToCSS(styles: Record<string, string>): React.CSSProperties;
181
+ /**
182
+ * 合并 className(类似 clsx/cn)
183
+ */
184
+ declare function cn(...inputs: (string | Record<string, boolean> | undefined | null | false)[]): string;
185
+
186
+ /**
187
+ * A2UI Styles Module
188
+ *
189
+ * 导出:
190
+ * - 核心样式生成器
191
+ * - 主题配置 (defaultTheme, createTheme)
192
+ * - 主题注入 (injectTheme, tegoOSTheme, A2UITheme)
193
+ * - 样式工具函数 (merge, classesToString, etc.)
194
+ */
195
+
196
+ type index_A2UITheme = A2UITheme;
197
+ declare const index_GRID: typeof GRID;
198
+ declare const index_PALETTE_KEYS: typeof PALETTE_KEYS;
199
+ type index_PaletteKey = PaletteKey;
200
+ declare const index_SHADES: typeof SHADES;
201
+ type index_Shade = Shade;
202
+ declare const index_appendToAll: typeof appendToAll;
203
+ declare const index_baseStyles: typeof baseStyles;
204
+ declare const index_behaviorStyles: typeof behaviorStyles;
205
+ declare const index_borderStyles: typeof borderStyles;
206
+ declare const index_classesToString: typeof classesToString;
207
+ declare const index_cloneDefaultTheme: typeof cloneDefaultTheme;
208
+ declare const index_cn: typeof cn;
209
+ declare const index_colorStyles: typeof colorStyles;
210
+ declare const index_createTheme: typeof createTheme;
211
+ declare const index_defaultTheme: typeof defaultTheme;
212
+ declare const index_generateThemeCSS: typeof generateThemeCSS;
213
+ declare const index_getA2UIStyles: typeof getA2UIStyles;
214
+ declare const index_getInverseKey: typeof getInverseKey;
215
+ declare const index_iconStyles: typeof iconStyles;
216
+ declare const index_injectTheme: typeof injectTheme;
217
+ declare const index_layoutStyles: typeof layoutStyles;
218
+ declare const index_merge: typeof merge;
219
+ declare const index_mergeStyles: typeof mergeStyles;
220
+ declare const index_structuralStyles: typeof structuralStyles;
221
+ declare const index_stylesToCSS: typeof stylesToCSS;
222
+ declare const index_tegoOSDarkTheme: typeof tegoOSDarkTheme;
223
+ declare const index_tegoOSTheme: typeof tegoOSTheme;
224
+ declare const index_toProp: typeof toProp;
225
+ declare const index_typographyStyles: typeof typographyStyles;
226
+ declare namespace index {
227
+ export { type index_A2UITheme as A2UITheme, index_GRID as GRID, index_PALETTE_KEYS as PALETTE_KEYS, type index_PaletteKey as PaletteKey, index_SHADES as SHADES, type index_Shade as Shade, index_appendToAll as appendToAll, index_baseStyles as baseStyles, index_behaviorStyles as behaviorStyles, index_borderStyles as borderStyles, index_classesToString as classesToString, index_cloneDefaultTheme as cloneDefaultTheme, index_cn as cn, index_colorStyles as colorStyles, index_createTheme as createTheme, index_defaultTheme as defaultTheme, index_generateThemeCSS as generateThemeCSS, index_getA2UIStyles as getA2UIStyles, index_getInverseKey as getInverseKey, index_iconStyles as iconStyles, index_injectTheme as injectTheme, index_layoutStyles as layoutStyles, index_merge as merge, index_mergeStyles as mergeStyles, index_structuralStyles as structuralStyles, index_stylesToCSS as stylesToCSS, index_tegoOSDarkTheme as tegoOSDarkTheme, index_tegoOSTheme as tegoOSTheme, index_toProp as toProp, index_typographyStyles as typographyStyles };
228
+ }
229
+
230
+ export { type A2UITheme as A, generateThemeCSS as B, GRID as G, PALETTE_KEYS as P, SHADES as S, appendToAll as a, cn as b, classesToString as c, defaultTheme as d, createTheme as e, mergeStyles as f, cloneDefaultTheme as g, structuralStyles as h, index as i, getA2UIStyles as j, baseStyles as k, layoutStyles as l, merge as m, colorStyles as n, borderStyles as o, behaviorStyles as p, iconStyles as q, type Shade as r, stylesToCSS as s, typographyStyles as t, type PaletteKey as u, toProp as v, getInverseKey as w, tegoOSTheme as x, tegoOSDarkTheme as y, injectTheme as z };
@@ -0,0 +1,230 @@
1
+ import { T as Theme } from './types-Csi2jaoN.js';
2
+
3
+ /**
4
+ * A2UI Shared Style Constants
5
+ *
6
+ * 基础设计常量,参照官方 A2UI Lit 实现
7
+ */
8
+ /** 基础网格单位 (px) */
9
+ declare const GRID = 4;
10
+ /** 调色板色调值 */
11
+ declare const SHADES: readonly [0, 5, 10, 15, 20, 25, 30, 35, 40, 50, 60, 70, 80, 90, 95, 98, 99, 100];
12
+ /** 调色板前缀 */
13
+ declare const PALETTE_KEYS: readonly ["p", "s", "t", "n", "nv", "e"];
14
+ type Shade = (typeof SHADES)[number];
15
+ type PaletteKey = (typeof PALETTE_KEYS)[number];
16
+ /**
17
+ * 将样式键转换为 CSS 变量名
18
+ * 例如: "p35" -> "--p-35", "n0" -> "--n-0"
19
+ */
20
+ declare function toProp(key: string): string;
21
+ /**
22
+ * 获取反转的色调 (用于暗色模式)
23
+ */
24
+ declare function getInverseKey(key: string): string;
25
+
26
+ declare const layoutStyles: string;
27
+
28
+ declare const colorStyles: string;
29
+
30
+ declare const typographyStyles: string;
31
+
32
+ declare const borderStyles: string;
33
+
34
+ declare const behaviorStyles: string;
35
+
36
+ declare const iconStyles: string;
37
+
38
+ /**
39
+ * A2UI Core Styles
40
+ *
41
+ * 合并所有样式模块,生成完整的 CSS 字符串
42
+ */
43
+
44
+ /**
45
+ * 基础样式 (reset + container)
46
+ */
47
+ declare const baseStyles = "\n /* A2UI Base Styles */\n .a2ui-root {\n font-family: var(--a2-font-sans);\n font-size: var(--a2-text-bm);\n line-height: 1.5;\n color: hsl(var(--a2-foreground));\n background-color: transparent;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n }\n\n .a2ui-root *,\n .a2ui-root *::before,\n .a2ui-root *::after {\n box-sizing: border-box;\n }\n\n /* Reset headings */\n .a2ui-root h1,\n .a2ui-root h2,\n .a2ui-root h3,\n .a2ui-root h4,\n .a2ui-root h5,\n .a2ui-root h6 {\n margin: 0;\n font-weight: 600;\n line-height: 1.25;\n }\n\n .a2ui-root p {\n margin: 0;\n }\n\n .a2ui-root ul,\n .a2ui-root ol {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n .a2ui-root a {\n color: inherit;\n text-decoration: none;\n }\n\n /* \u6309\u94AE\u57FA\u7840\u91CD\u7F6E - \u53EA\u8BBE\u7F6E\u7EE7\u627F\u5C5E\u6027\uFF0C\u4E0D\u8986\u76D6\u5DE5\u5177\u7C7B */\n .a2ui-root button {\n font: inherit;\n margin: 0;\n cursor: pointer;\n }\n\n .a2ui-root input,\n .a2ui-root textarea,\n .a2ui-root select {\n font: inherit;\n color: inherit;\n }\n\n .a2ui-root img,\n .a2ui-root video {\n max-width: 100%;\n height: auto;\n }\n\n /* Scrollbar styling */\n .a2ui-root::-webkit-scrollbar {\n width: 6px;\n height: 6px;\n }\n\n .a2ui-root::-webkit-scrollbar-track {\n background: transparent;\n }\n\n .a2ui-root::-webkit-scrollbar-thumb {\n background: light-dark(var(--n-30), var(--n-70));\n border-radius: 3px;\n }\n\n .a2ui-root::-webkit-scrollbar-thumb:hover {\n background: light-dark(var(--n-40), var(--n-60));\n }\n";
48
+ /**
49
+ * 所有结构化样式(合并后的 CSS 字符串)
50
+ */
51
+ declare const structuralStyles: string;
52
+ /**
53
+ * 获取完整的 A2UI 样式 CSS
54
+ */
55
+ declare function getA2UIStyles(): string;
56
+
57
+ /**
58
+ * A2UI Default Theme
59
+ *
60
+ * 使用自定义 A2UI 工具类系统,对齐官方 Lit 实现
61
+ * 类名格式: a2-{category}-{value}
62
+ */
63
+
64
+ /**
65
+ * 默认主题配置
66
+ */
67
+ declare const defaultTheme: Theme;
68
+ /**
69
+ * 创建自定义主题(基于默认主题)
70
+ */
71
+ declare function createTheme(customTheme: Partial<Theme>): Theme;
72
+ /**
73
+ * 合并样式类映射
74
+ */
75
+ declare function mergeStyles(...classes: Array<Record<string, boolean>>): Record<string, boolean>;
76
+ /**
77
+ * 克隆默认主题(用于创建变体)
78
+ */
79
+ declare function cloneDefaultTheme(): Theme;
80
+
81
+ /**
82
+ * A2UI Theme
83
+ *
84
+ * 主题配置和注入接口
85
+ *
86
+ * 使用方式:
87
+ * ```ts
88
+ * import { injectTheme, tegoOSTheme } from '@zhama/a2ui/styles';
89
+ *
90
+ * // 使用预设主题
91
+ * injectTheme(tegoOSTheme);
92
+ *
93
+ * // 或自定义主题
94
+ * injectTheme({
95
+ * primary: '230 83% 60%',
96
+ * foreground: '222 84% 5%',
97
+ * border: '214 32% 91%',
98
+ * });
99
+ * ```
100
+ */
101
+ interface A2UITheme {
102
+ primary?: string;
103
+ primaryForeground?: string;
104
+ secondary?: string;
105
+ secondaryForeground?: string;
106
+ muted?: string;
107
+ mutedForeground?: string;
108
+ accent?: string;
109
+ accentForeground?: string;
110
+ destructive?: string;
111
+ destructiveForeground?: string;
112
+ background?: string;
113
+ foreground?: string;
114
+ card?: string;
115
+ cardForeground?: string;
116
+ popover?: string;
117
+ popoverForeground?: string;
118
+ border?: string;
119
+ input?: string;
120
+ ring?: string;
121
+ success?: string;
122
+ successForeground?: string;
123
+ warning?: string;
124
+ warningForeground?: string;
125
+ info?: string;
126
+ infoForeground?: string;
127
+ radius?: string;
128
+ radiusSm?: string;
129
+ radiusLg?: string;
130
+ fontSans?: string;
131
+ fontMono?: string;
132
+ shadowSm?: string;
133
+ shadow?: string;
134
+ shadowMd?: string;
135
+ shadowLg?: string;
136
+ }
137
+ /**
138
+ * 预设主题:Tego OS
139
+ * 与 tego-os 的 shadcn/tailwind 主题完全一致
140
+ */
141
+ declare const tegoOSTheme: A2UITheme;
142
+ /**
143
+ * 预设主题:Tego OS 暗色
144
+ */
145
+ declare const tegoOSDarkTheme: A2UITheme;
146
+ /**
147
+ * 注入主题变量到 DOM
148
+ *
149
+ * @param theme - 主题配置对象
150
+ * @param target - 注入目标,默认为 document.documentElement
151
+ */
152
+ declare function injectTheme(theme: A2UITheme, target?: HTMLElement): void;
153
+ /**
154
+ * 生成主题 CSS 字符串
155
+ * 可用于 SSR 或 style 标签注入
156
+ *
157
+ * @param theme - 主题配置对象
158
+ * @param selector - CSS 选择器,默认为 ':root'
159
+ */
160
+ declare function generateThemeCSS(theme: A2UITheme, selector?: string): string;
161
+
162
+ /**
163
+ * A2UI Style Utilities
164
+ */
165
+ /**
166
+ * 合并多个 class 映射,后面的会覆盖前面的相同前缀的类
167
+ */
168
+ declare function merge(...classes: Array<Record<string, boolean>>): Record<string, boolean>;
169
+ /**
170
+ * 将类追加到目标对象的所有属性
171
+ */
172
+ declare function appendToAll(target: Record<string, string[]>, exclusions: string[], ...classes: Array<Record<string, boolean>>): Record<string, string[]>;
173
+ /**
174
+ * 将类名映射转换为 className 字符串
175
+ */
176
+ declare function classesToString(classes: Record<string, boolean>): string;
177
+ /**
178
+ * 将样式对象转换为 React CSSProperties
179
+ */
180
+ declare function stylesToCSS(styles: Record<string, string>): React.CSSProperties;
181
+ /**
182
+ * 合并 className(类似 clsx/cn)
183
+ */
184
+ declare function cn(...inputs: (string | Record<string, boolean> | undefined | null | false)[]): string;
185
+
186
+ /**
187
+ * A2UI Styles Module
188
+ *
189
+ * 导出:
190
+ * - 核心样式生成器
191
+ * - 主题配置 (defaultTheme, createTheme)
192
+ * - 主题注入 (injectTheme, tegoOSTheme, A2UITheme)
193
+ * - 样式工具函数 (merge, classesToString, etc.)
194
+ */
195
+
196
+ type index_A2UITheme = A2UITheme;
197
+ declare const index_GRID: typeof GRID;
198
+ declare const index_PALETTE_KEYS: typeof PALETTE_KEYS;
199
+ type index_PaletteKey = PaletteKey;
200
+ declare const index_SHADES: typeof SHADES;
201
+ type index_Shade = Shade;
202
+ declare const index_appendToAll: typeof appendToAll;
203
+ declare const index_baseStyles: typeof baseStyles;
204
+ declare const index_behaviorStyles: typeof behaviorStyles;
205
+ declare const index_borderStyles: typeof borderStyles;
206
+ declare const index_classesToString: typeof classesToString;
207
+ declare const index_cloneDefaultTheme: typeof cloneDefaultTheme;
208
+ declare const index_cn: typeof cn;
209
+ declare const index_colorStyles: typeof colorStyles;
210
+ declare const index_createTheme: typeof createTheme;
211
+ declare const index_defaultTheme: typeof defaultTheme;
212
+ declare const index_generateThemeCSS: typeof generateThemeCSS;
213
+ declare const index_getA2UIStyles: typeof getA2UIStyles;
214
+ declare const index_getInverseKey: typeof getInverseKey;
215
+ declare const index_iconStyles: typeof iconStyles;
216
+ declare const index_injectTheme: typeof injectTheme;
217
+ declare const index_layoutStyles: typeof layoutStyles;
218
+ declare const index_merge: typeof merge;
219
+ declare const index_mergeStyles: typeof mergeStyles;
220
+ declare const index_structuralStyles: typeof structuralStyles;
221
+ declare const index_stylesToCSS: typeof stylesToCSS;
222
+ declare const index_tegoOSDarkTheme: typeof tegoOSDarkTheme;
223
+ declare const index_tegoOSTheme: typeof tegoOSTheme;
224
+ declare const index_toProp: typeof toProp;
225
+ declare const index_typographyStyles: typeof typographyStyles;
226
+ declare namespace index {
227
+ export { type index_A2UITheme as A2UITheme, index_GRID as GRID, index_PALETTE_KEYS as PALETTE_KEYS, type index_PaletteKey as PaletteKey, index_SHADES as SHADES, type index_Shade as Shade, index_appendToAll as appendToAll, index_baseStyles as baseStyles, index_behaviorStyles as behaviorStyles, index_borderStyles as borderStyles, index_classesToString as classesToString, index_cloneDefaultTheme as cloneDefaultTheme, index_cn as cn, index_colorStyles as colorStyles, index_createTheme as createTheme, index_defaultTheme as defaultTheme, index_generateThemeCSS as generateThemeCSS, index_getA2UIStyles as getA2UIStyles, index_getInverseKey as getInverseKey, index_iconStyles as iconStyles, index_injectTheme as injectTheme, index_layoutStyles as layoutStyles, index_merge as merge, index_mergeStyles as mergeStyles, index_structuralStyles as structuralStyles, index_stylesToCSS as stylesToCSS, index_tegoOSDarkTheme as tegoOSDarkTheme, index_tegoOSTheme as tegoOSTheme, index_toProp as toProp, index_typographyStyles as typographyStyles };
228
+ }
229
+
230
+ export { type A2UITheme as A, generateThemeCSS as B, GRID as G, PALETTE_KEYS as P, SHADES as S, appendToAll as a, cn as b, classesToString as c, defaultTheme as d, createTheme as e, mergeStyles as f, cloneDefaultTheme as g, structuralStyles as h, index as i, getA2UIStyles as j, baseStyles as k, layoutStyles as l, merge as m, colorStyles as n, borderStyles as o, behaviorStyles as p, iconStyles as q, type Shade as r, stylesToCSS as s, typographyStyles as t, type PaletteKey as u, toProp as v, getInverseKey as w, tegoOSTheme as x, tegoOSDarkTheme as y, injectTheme as z };