@adia-ai/web-modules 0.7.22 → 0.7.23

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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog — @adia-ai/web-modules
2
2
 
3
+ ## [0.7.23] — 2026-06-30
4
+
5
+ ### Changed
6
+ - **Kitchen-sink bundle regenerated to carry the `button-ui` child-text fix.** `dist/everything.min.js` was rebuilt so the CDN / `@adia-ai/web-modules/everything` path reflects the `@adia-ai/web-components` `button-ui` `[data-icon-only]` render change (child text now labels the button the same as `text=`). Bundle-only — no `web-modules` source change. See `packages/web-components/CHANGELOG.md#0723--2026-06-30`.
7
+
3
8
  ## [0.7.22] — 2026-06-16
4
9
 
5
10
  ### Changed
@@ -59,7 +59,7 @@ ${i.join(`
59
59
  '../node_modules/@phosphor-icons/core/assets/regular/*.svg',
60
60
  { query: '?raw', import: 'default', eager: true }
61
61
  ),
62
- });`),Oh(Qd)):import("./icons-manifest.js").then(({default:t})=>{let{cdn:e,...i}=t,r=Object.fromEntries(Object.entries(i).map(([n,o])=>{let a=e?`${e}${n}/`:`/node_modules/@phosphor-icons/core/assets/${n}/`,l=o.map(h=>{let c=a+h;return[c,()=>fetch(c).then(d=>d.ok?d.text():Promise.reject(new Error(`icon fetch failed: ${c}`)))]});return[n,Object.fromEntries(l)]}));Oh(r)}).catch(()=>{});var KO=new WeakSet,Ca=class s{#t=null;#e=new Set;get host(){return this.#t}connect(t){let e=this.constructor;!KO.has(e)&&e!==s&&(KO.add(e),e.schema||console.warn(`AdiaUI: ${e.name} extends BaseController without static schema`),this.getState===s.prototype.getState&&console.error(`AdiaUI: ${e.schema?.name??e.name} must implement getState()`)),this.#t&&this.#t!==t&&console.warn(`AdiaUI: ${e.schema?.name??e.name} already connected to a different host`),this.#t=t,this.onConnect(t),this.reflect()}disconnect(t){let e=t??this.#t;e&&(this.onDisconnect(e),this.#t=null)}subscribe(t){return this.#e.add(t),()=>this.#e.delete(t)}notify(){this.reflect();for(let t of this.#e)t()}onConnect(t){}onDisconnect(t){}reflect(){}getState(){throw new Error(`${this.constructor.schema?.name??this.constructor.name}: getState() not implemented`)}},JO=class extends Ca{static schema={name:"route",state:{path:"string",params:"object",route:"object",previous:"string"},commands:["navigate","replace","back","forward","setRoutes"],attributes:["data-route-path"]};#t=[];#e="";#i="";#s={};#r=null;#n=!0;#a=null;constructor({routes:t=[],initial:e,historySync:i=!0}={}){super(),this.#t=t,this.#n=i,this.#e=e??location.pathname,this.#o()}getState(){return{path:this.#e,params:{...this.#s},route:this.#r,previous:this.#i}}reflect(){let t=this.host;t&&t.setAttribute("data-route-path",this.#e)}onConnect(t){this.#n&&(this.#a=()=>{this.#i=this.#e,this.#e=location.pathname,this.#o(),this.notify()},window.addEventListener("popstate",this.#a))}onDisconnect(){this.#a&&(window.removeEventListener("popstate",this.#a),this.#a=null)}#o(){this.#s={},this.#r=null;for(let t of this.#t){let e=this.#l(t.path,this.#e);if(e){this.#s=e.params,this.#r=t;return}}}#l(t,e){let i=t.split("/").filter(Boolean),r=e.split("/").filter(Boolean);if(!t.includes(":"))return t===e?{params:{}}:null;if(i.length!==r.length)return null;let n={};for(let o=0;o<i.length;o++)if(i[o].startsWith(":"))n[i[o].slice(1)]=r[o];else if(i[o]!==r[o])return null;return{params:n}}commands={navigate:t=>{t!==this.#e&&(this.#i=this.#e,this.#e=t,this.#o(),this.#n&&history.pushState(null,"",t),this.notify())},replace:t=>{this.#i=this.#e,this.#e=t,this.#o(),this.#n&&history.replaceState(null,"",t),this.notify()},back:()=>{this.#n&&history.back()},forward:()=>{this.#n&&history.forward()},setRoutes:t=>{this.#t=t,this.#o(),this.notify()}}};C();var Nd=class extends x{static template=()=>null;#t=null;get abort(){return this.#t||(this.#t=new AbortController),this.#t}get signal(){return this.abort.signal}emit(t,e){this.dispatchEvent(e!==void 0?new CustomEvent(t,{bubbles:!0,detail:e}):new Event(t,{bubbles:!0}))}disconnected(){this.#t?.abort(),this.#t=null}},Bd=class extends Ca{static schema={name:"route",state:{path:"string",params:"object",route:"object",previous:"string"},commands:["navigate","replace","back","forward","setRoutes"],attributes:["data-route-path"]};#t=[];#e="";#i="";#s={};#r=null;#n=!0;#a=null;constructor({routes:t=[],initial:e,historySync:i=!0}={}){super(),this.#t=t,this.#n=i,this.#e=e??location.pathname,this.#o()}getState(){return{path:this.#e,params:{...this.#s},route:this.#r,previous:this.#i}}reflect(){let t=this.host;t&&t.setAttribute("data-route-path",this.#e)}onConnect(t){this.#n&&(this.#a=()=>{this.#i=this.#e,this.#e=location.pathname,this.#o(),this.notify()},window.addEventListener("popstate",this.#a))}onDisconnect(){this.#a&&(window.removeEventListener("popstate",this.#a),this.#a=null)}#o(){this.#s={},this.#r=null;for(let t of this.#t){let e=this.#l(t.path,this.#e);if(e){this.#s=e.params,this.#r=t;return}}}#l(t,e){let i=t.split("/").filter(Boolean),r=e.split("/").filter(Boolean);if(!t.includes(":"))return t===e?{params:{}}:null;if(i.length!==r.length)return null;let n={};for(let o=0;o<i.length;o++)if(i[o].startsWith(":"))n[i[o].slice(1)]=r[o];else if(i[o]!==r[o])return null;return{params:n}}commands={navigate:t=>{t!==this.#e&&(this.#i=this.#e,this.#e=t,this.#o(),this.#n&&history.pushState(null,"",t),this.notify())},replace:t=>{this.#i=this.#e,this.#e=t,this.#o(),this.#n&&history.replaceState(null,"",t),this.notify()},back:()=>{this.#n&&history.back()},forward:()=>{this.#n&&history.forward()},setRoutes:t=>{this.#t=t,this.#o(),this.notify()}}},Zd=class extends Nd{#t=new Map;#e=null;#i=null;get#s(){return this.#e||this.controller}set routes(t){this.#e?this.#e.commands.setRoutes(t):(this.#e=new Bd({routes:t}),this.controller=this.#e,this.#e.notify())}navigate(t){this.#s?.commands.navigate(t)}replace(t){this.#s?.commands.replace(t)}connected(){super.connected(),document.addEventListener("click",this.#r)}disconnected(){super.disconnected(),document.removeEventListener("click",this.#r)}#r=t=>{let e=this.#s;if(!e)return;let i=t.target.closest("a[href]");if(!i||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||i.target&&i.target!=="_self")return;let r=i.getAttribute("href");r.startsWith("http")||r.startsWith("//")||r.startsWith("#")||(t.preventDefault(),e.commands.navigate(r))};render(){let t=this.#s;if(!t)return;let{path:e,route:i}=t.getState();e!==this.#i&&(this.#i=e,i?.content&&this.#n(i,t))}async#n(t,e){let i;if(this.#t.has(t.content))i=this.#t.get(t.content);else try{let n=await fetch(t.content,{signal:this.signal});if(!n.ok)return;i=await n.text(),this.#t.set(t.content,i)}catch(n){n.name!=="AbortError"&&console.error("Router fetch error:",n);return}this.templateResolver&&(i=await this.templateResolver(i,t)),this.innerHTML=i;for(let n of this.querySelectorAll("script")){let o=n.getAttribute("type")||"";if(o==="application/json"||o==="application/ld+json")continue;let a=document.createElement("script");o&&(a.type=o),n.src?a.src=n.src:a.textContent=n.textContent,n.replaceWith(a)}if(this.scrollTo(0,0),(this.closest("section")||this.parentElement)?.scrollTo(0,0),t.title&&(document.title=t.title),t.content?.endsWith(".content.html")){let n=t.content.replace(".content.html",".setup.js");try{let o=await import(n);o.default&&o.default(this)}catch{}}let r=e.getState();this.emit("route-loaded",{path:r.path,params:r.params,title:t.title||"",section:t.section||""})}};customElements.define("router-ui",Zd);function oX(s,t){customElements.define(s,t)}function S(s,t){return customElements.get(s)?!1:(customElements.define(s,t),!0)}function aX(s){return!!customElements.get(s)}C();var rr=class extends x{static properties={name:{type:String,default:"",reflect:!0},size:{type:String,default:"",reflect:!0},label:{type:String,default:"",reflect:!0},weight:{type:String,default:"regular",reflect:!0}};#t=this.signal(0);#e=null;connected(){this.setAttribute("role",this.label?"img":"presentation"),this.label||this.setAttribute("aria-hidden","true"),this.#e=new AbortController;let t=this.#e;bh.then(()=>{t.signal.aborted||this.#t.value++})}disconnected(){this.#e?.abort(),this.#e=null}render(){this.#t.value,this.label&&this.setAttribute("aria-label",this.label);let t=qO(this.name,this.weight||"regular");t&&this.innerHTML!==t&&(this.innerHTML=t),this.size&&this.#i(this.size)?this.style.setProperty("--icon-size",this.#s(this.size)):this.style.getPropertyValue("--icon-size")&&this.style.removeProperty("--icon-size")}#i(t){return/^\d+(\.\d+)?(px|rem|em)?$/.test(t)}#s(t){return/^\d+(\.\d+)?$/.test(t)?`${t}px`:t}};S("icon-ui",rr);C();var eC={plus:["+","\uFF0B"],minus:["-","\u2212","\u2013"],x:["\xD7","x ","X "],check:["\u2713","\u2714"],"arrow-right":["\u2192",">"],"arrow-left":["\u2190","<"]},nr=class s extends x{static properties={text:{type:String,default:"",reflect:!0},variant:{type:String,default:"solid",reflect:!0},color:{type:String,default:"",reflect:!0},size:{type:String,default:"md",reflect:!0},disabled:{type:Boolean,default:!1,reflect:!0},stretch:{type:Boolean,default:!1,reflect:!0},icon:{type:String,default:"",reflect:!0},iconTrailing:{type:String,default:"",reflect:!0,attribute:"icon-trailing"},type:{type:String,default:"button",reflect:!0}};static template=()=>null;connected(){this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.addEventListener("click",this.#i),this.addEventListener("keydown",this.#s)}render(){if(this.text&&this.setAttribute("aria-label",this.text),this.icon){let t=this.querySelector(":scope > icon-ui:not([slot])");if(!t||t.name!==this.icon){t&&t.remove();let e=document.createElement("icon-ui");e.setAttribute("name",this.icon),this.prepend(e)}}if(this.iconTrailing){let t=this.querySelector(':scope > icon-ui[slot="icon-trailing"]');if(!t||t.name!==this.iconTrailing){t&&t.remove();let e=document.createElement("icon-ui");e.setAttribute("name",this.iconTrailing),e.setAttribute("slot","icon-trailing"),this.appendChild(e)}}if(this.icon&&this.text){let t=eC[this.icon];t&&t.some(e=>this.text.startsWith(e))&&(s.#e.has(this)||(s.#e.add(this),console.warn(`[button-ui] text="${this.text}" begins with a symbol that icon="${this.icon}" already renders \u2014 the glyph appears twice. Drop the leading symbol from text= (the icon provides it).`,this)))}if(this.icon&&!this.text){let t=this.getAttribute("aria-label"),e=this.getAttribute("aria-labelledby"),i=this.getAttribute("title");!t&&!e&&i?this.setAttribute("aria-label",i):!t&&!e&&!i&&(s.#t.has(this)||(s.#t.add(this),console.warn(`[button-ui] Icon-only button is missing an accessible name.
62
+ });`),Oh(Qd)):import("./icons-manifest.js").then(({default:t})=>{let{cdn:e,...i}=t,r=Object.fromEntries(Object.entries(i).map(([n,o])=>{let a=e?`${e}${n}/`:`/node_modules/@phosphor-icons/core/assets/${n}/`,l=o.map(h=>{let c=a+h;return[c,()=>fetch(c).then(d=>d.ok?d.text():Promise.reject(new Error(`icon fetch failed: ${c}`)))]});return[n,Object.fromEntries(l)]}));Oh(r)}).catch(()=>{});var KO=new WeakSet,Ca=class s{#t=null;#e=new Set;get host(){return this.#t}connect(t){let e=this.constructor;!KO.has(e)&&e!==s&&(KO.add(e),e.schema||console.warn(`AdiaUI: ${e.name} extends BaseController without static schema`),this.getState===s.prototype.getState&&console.error(`AdiaUI: ${e.schema?.name??e.name} must implement getState()`)),this.#t&&this.#t!==t&&console.warn(`AdiaUI: ${e.schema?.name??e.name} already connected to a different host`),this.#t=t,this.onConnect(t),this.reflect()}disconnect(t){let e=t??this.#t;e&&(this.onDisconnect(e),this.#t=null)}subscribe(t){return this.#e.add(t),()=>this.#e.delete(t)}notify(){this.reflect();for(let t of this.#e)t()}onConnect(t){}onDisconnect(t){}reflect(){}getState(){throw new Error(`${this.constructor.schema?.name??this.constructor.name}: getState() not implemented`)}},JO=class extends Ca{static schema={name:"route",state:{path:"string",params:"object",route:"object",previous:"string"},commands:["navigate","replace","back","forward","setRoutes"],attributes:["data-route-path"]};#t=[];#e="";#i="";#s={};#r=null;#n=!0;#a=null;constructor({routes:t=[],initial:e,historySync:i=!0}={}){super(),this.#t=t,this.#n=i,this.#e=e??location.pathname,this.#o()}getState(){return{path:this.#e,params:{...this.#s},route:this.#r,previous:this.#i}}reflect(){let t=this.host;t&&t.setAttribute("data-route-path",this.#e)}onConnect(t){this.#n&&(this.#a=()=>{this.#i=this.#e,this.#e=location.pathname,this.#o(),this.notify()},window.addEventListener("popstate",this.#a))}onDisconnect(){this.#a&&(window.removeEventListener("popstate",this.#a),this.#a=null)}#o(){this.#s={},this.#r=null;for(let t of this.#t){let e=this.#l(t.path,this.#e);if(e){this.#s=e.params,this.#r=t;return}}}#l(t,e){let i=t.split("/").filter(Boolean),r=e.split("/").filter(Boolean);if(!t.includes(":"))return t===e?{params:{}}:null;if(i.length!==r.length)return null;let n={};for(let o=0;o<i.length;o++)if(i[o].startsWith(":"))n[i[o].slice(1)]=r[o];else if(i[o]!==r[o])return null;return{params:n}}commands={navigate:t=>{t!==this.#e&&(this.#i=this.#e,this.#e=t,this.#o(),this.#n&&history.pushState(null,"",t),this.notify())},replace:t=>{this.#i=this.#e,this.#e=t,this.#o(),this.#n&&history.replaceState(null,"",t),this.notify()},back:()=>{this.#n&&history.back()},forward:()=>{this.#n&&history.forward()},setRoutes:t=>{this.#t=t,this.#o(),this.notify()}}};C();var Nd=class extends x{static template=()=>null;#t=null;get abort(){return this.#t||(this.#t=new AbortController),this.#t}get signal(){return this.abort.signal}emit(t,e){this.dispatchEvent(e!==void 0?new CustomEvent(t,{bubbles:!0,detail:e}):new Event(t,{bubbles:!0}))}disconnected(){this.#t?.abort(),this.#t=null}},Bd=class extends Ca{static schema={name:"route",state:{path:"string",params:"object",route:"object",previous:"string"},commands:["navigate","replace","back","forward","setRoutes"],attributes:["data-route-path"]};#t=[];#e="";#i="";#s={};#r=null;#n=!0;#a=null;constructor({routes:t=[],initial:e,historySync:i=!0}={}){super(),this.#t=t,this.#n=i,this.#e=e??location.pathname,this.#o()}getState(){return{path:this.#e,params:{...this.#s},route:this.#r,previous:this.#i}}reflect(){let t=this.host;t&&t.setAttribute("data-route-path",this.#e)}onConnect(t){this.#n&&(this.#a=()=>{this.#i=this.#e,this.#e=location.pathname,this.#o(),this.notify()},window.addEventListener("popstate",this.#a))}onDisconnect(){this.#a&&(window.removeEventListener("popstate",this.#a),this.#a=null)}#o(){this.#s={},this.#r=null;for(let t of this.#t){let e=this.#l(t.path,this.#e);if(e){this.#s=e.params,this.#r=t;return}}}#l(t,e){let i=t.split("/").filter(Boolean),r=e.split("/").filter(Boolean);if(!t.includes(":"))return t===e?{params:{}}:null;if(i.length!==r.length)return null;let n={};for(let o=0;o<i.length;o++)if(i[o].startsWith(":"))n[i[o].slice(1)]=r[o];else if(i[o]!==r[o])return null;return{params:n}}commands={navigate:t=>{t!==this.#e&&(this.#i=this.#e,this.#e=t,this.#o(),this.#n&&history.pushState(null,"",t),this.notify())},replace:t=>{this.#i=this.#e,this.#e=t,this.#o(),this.#n&&history.replaceState(null,"",t),this.notify()},back:()=>{this.#n&&history.back()},forward:()=>{this.#n&&history.forward()},setRoutes:t=>{this.#t=t,this.#o(),this.notify()}}},Zd=class extends Nd{#t=new Map;#e=null;#i=null;get#s(){return this.#e||this.controller}set routes(t){this.#e?this.#e.commands.setRoutes(t):(this.#e=new Bd({routes:t}),this.controller=this.#e,this.#e.notify())}navigate(t){this.#s?.commands.navigate(t)}replace(t){this.#s?.commands.replace(t)}connected(){super.connected(),document.addEventListener("click",this.#r)}disconnected(){super.disconnected(),document.removeEventListener("click",this.#r)}#r=t=>{let e=this.#s;if(!e)return;let i=t.target.closest("a[href]");if(!i||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||i.target&&i.target!=="_self")return;let r=i.getAttribute("href");r.startsWith("http")||r.startsWith("//")||r.startsWith("#")||(t.preventDefault(),e.commands.navigate(r))};render(){let t=this.#s;if(!t)return;let{path:e,route:i}=t.getState();e!==this.#i&&(this.#i=e,i?.content&&this.#n(i,t))}async#n(t,e){let i;if(this.#t.has(t.content))i=this.#t.get(t.content);else try{let n=await fetch(t.content,{signal:this.signal});if(!n.ok)return;i=await n.text(),this.#t.set(t.content,i)}catch(n){n.name!=="AbortError"&&console.error("Router fetch error:",n);return}this.templateResolver&&(i=await this.templateResolver(i,t)),this.innerHTML=i;for(let n of this.querySelectorAll("script")){let o=n.getAttribute("type")||"";if(o==="application/json"||o==="application/ld+json")continue;let a=document.createElement("script");o&&(a.type=o),n.src?a.src=n.src:a.textContent=n.textContent,n.replaceWith(a)}if(this.scrollTo(0,0),(this.closest("section")||this.parentElement)?.scrollTo(0,0),t.title&&(document.title=t.title),t.content?.endsWith(".content.html")){let n=t.content.replace(".content.html",".setup.js");try{let o=await import(n);o.default&&o.default(this)}catch{}}let r=e.getState();this.emit("route-loaded",{path:r.path,params:r.params,title:t.title||"",section:t.section||""})}};customElements.define("router-ui",Zd);function oX(s,t){customElements.define(s,t)}function S(s,t){return customElements.get(s)?!1:(customElements.define(s,t),!0)}function aX(s){return!!customElements.get(s)}C();var rr=class extends x{static properties={name:{type:String,default:"",reflect:!0},size:{type:String,default:"",reflect:!0},label:{type:String,default:"",reflect:!0},weight:{type:String,default:"regular",reflect:!0}};#t=this.signal(0);#e=null;connected(){this.setAttribute("role",this.label?"img":"presentation"),this.label||this.setAttribute("aria-hidden","true"),this.#e=new AbortController;let t=this.#e;bh.then(()=>{t.signal.aborted||this.#t.value++})}disconnected(){this.#e?.abort(),this.#e=null}render(){this.#t.value,this.label&&this.setAttribute("aria-label",this.label);let t=qO(this.name,this.weight||"regular");t&&this.innerHTML!==t&&(this.innerHTML=t),this.size&&this.#i(this.size)?this.style.setProperty("--icon-size",this.#s(this.size)):this.style.getPropertyValue("--icon-size")&&this.style.removeProperty("--icon-size")}#i(t){return/^\d+(\.\d+)?(px|rem|em)?$/.test(t)}#s(t){return/^\d+(\.\d+)?$/.test(t)?`${t}px`:t}};S("icon-ui",rr);C();var eC={plus:["+","\uFF0B"],minus:["-","\u2212","\u2013"],x:["\xD7","x ","X "],check:["\u2713","\u2714"],"arrow-right":["\u2192",">"],"arrow-left":["\u2190","<"]},nr=class s extends x{static properties={text:{type:String,default:"",reflect:!0},variant:{type:String,default:"solid",reflect:!0},color:{type:String,default:"",reflect:!0},size:{type:String,default:"md",reflect:!0},disabled:{type:Boolean,default:!1,reflect:!0},stretch:{type:Boolean,default:!1,reflect:!0},icon:{type:String,default:"",reflect:!0},iconTrailing:{type:String,default:"",reflect:!0,attribute:"icon-trailing"},type:{type:String,default:"button",reflect:!0}};static template=()=>null;connected(){this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.addEventListener("click",this.#i),this.addEventListener("keydown",this.#s)}render(){if(this.text&&this.setAttribute("aria-label",this.text),this.icon){let e=this.querySelector(":scope > icon-ui:not([slot])");if(!e||e.name!==this.icon){e&&e.remove();let i=document.createElement("icon-ui");i.setAttribute("name",this.icon),this.prepend(i)}}if(this.iconTrailing){let e=this.querySelector(':scope > icon-ui[slot="icon-trailing"]');if(!e||e.name!==this.iconTrailing){e&&e.remove();let i=document.createElement("icon-ui");i.setAttribute("name",this.iconTrailing),i.setAttribute("slot","icon-trailing"),this.appendChild(i)}}let t=Array.from(this.childNodes).some(e=>e.nodeType===3&&e.textContent.trim()!=="");if(this.toggleAttribute("data-icon-only",!this.text&&!t),this.icon&&this.text){let e=eC[this.icon];e&&e.some(i=>this.text.startsWith(i))&&(s.#e.has(this)||(s.#e.add(this),console.warn(`[button-ui] text="${this.text}" begins with a symbol that icon="${this.icon}" already renders \u2014 the glyph appears twice. Drop the leading symbol from text= (the icon provides it).`,this)))}if(this.icon&&!this.text&&!t){let e=this.getAttribute("aria-label"),i=this.getAttribute("aria-labelledby"),r=this.getAttribute("title");!e&&!i&&r?this.setAttribute("aria-label",r):!e&&!i&&!r&&(s.#t.has(this)||(s.#t.add(this),console.warn(`[button-ui] Icon-only button is missing an accessible name.
63
63
  Element: <button-ui icon="${this.icon}">
64
64
  Add one of:
65
65
  aria-label="Undo" \u2190 explicit accessible name
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adia-ai/web-modules",
3
- "version": "0.7.22",
3
+ "version": "0.7.23",
4
4
  "description": "AdiaUI composite custom elements \u2014 shell, chat, editor, runtime clusters built from @adia-ai/web-components primitives. Subpath exports per cluster.",
5
5
  "type": "module",
6
6
  "exports": {