@adia-ai/web-modules 0.8.43 → 0.8.44
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 +8 -0
- package/chat/chat-sidebar/chat-sidebar.d.ts +4 -0
- package/dist/chat/chat-shell.min.js +1 -1
- package/dist/editor/editor-shell.min.js +1 -1
- package/dist/everything.min.js +130 -130
- package/dist/shell/admin-shell.min.js +1 -1
- package/dist/simple/simple-shell.min.js +1 -1
- package/package.json +6 -6
- package/shell/admin-command/admin-command.d.ts +5 -0
- package/shell/admin-sidebar/admin-sidebar.d.ts +4 -0
- package/simple/simple-shell/simple-shell.d.ts +2 -0
- package/theme/theme-panel/theme-panel.d.ts +31 -0
|
@@ -7,4 +7,4 @@ function ge(e,t){customElements.define(e,t)}function R(e,t){return customElement
|
|
|
7
7
|
`+u+" Compute the full attr value as a single expression and interpolate the whole.")}continue}let c=+a[1],s=o.name;s[0]==="@"?(i.removeAttribute(s),n[c]={t:"e",n:i,name:s.slice(1),c:void 0,_fx:null}):s[0]==="."?(i.removeAttribute(s),n[c]={t:"p",n:i,name:W(i,s.slice(1)),c:void 0,_fx:null,_resolved:!1}):s[0]==="?"?(i.removeAttribute(s),console.warn(`[template] Lit-style boolean attribute "${s}=" is not supported.
|
|
8
8
|
Element: <${i.tagName.toLowerCase()}>
|
|
9
9
|
Use .${s.slice(1)}=\${value} (property binding) instead \u2014 the primitive reflects the property to the DOM attribute for you.
|
|
10
|
-
See USAGE.md \xA7 Template parser \u2014 invariants + unsupported syntaxes.`),n[c]={t:"n",n:document.createTextNode(""),c:void 0,_fx:null}):n[c]={t:"a",n:i,name:s,c:void 0,_fx:null}}return n}function C(e){for(let t of e)t&&t._fx&&(t._fx(),t._fx=null)}function M(e){if(e.n.nodeType===1&&e.n[j])return e.n;let t=document.createElement("span");return t.style.display="contents",t.setAttribute("role","presentation"),t[j]=!0,e.n.replaceWith(t),e.n=t,t}var U=e=>e!=null&&typeof e=="object"&&e.strings,V=e=>typeof e=="function"||e!=null&&typeof e.handleEvent=="function";function L(e,t){if(t!==e.c){if(e.t==="n")if(t!=null&&t._directive)t._commit(M(e));else if(U(t))g(t,M(e));else if(Array.isArray(t)){let n=M(e);n.replaceChildren();for(let r of t)if(U(r)){let i=document.createElement("span");i.style.display="contents",i.setAttribute("role","presentation"),n.appendChild(i),g(r,i)}else n.appendChild(document.createTextNode(r??""))}else if(v(t))e.n.replaceWith(t),e.n=t;else if(e.n[j]){let n=document.createTextNode(t??"");e.n.replaceWith(n),e.n=n}else e.n.textContent=t??"";else if(e.t==="a")t==null||t===!1?e.n.removeAttribute(e.name):e.n.setAttribute(e.name,t===!0?"":t);else if(e.t==="p"){if(!e._resolved){let n=W(e.n,e.name);n!==e.name&&(e.name=n),e._resolved=!0}e.n[e.name]=t}else e.t==="e"&&(V(e.c)&&e.n.removeEventListener(e.name,e.c),V(t)&&e.n.addEventListener(e.name,t));e.c=t}}function se(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(!r)continue;let i=t[n],o=r.t!=="e"&&typeof i=="function",a=!o&&r.t!=="e"&&k(i);if(r._fx&&!o&&!a&&(r._fx(),r._fx=null),o){r._fx||(r._fx=m(()=>L(r,i())));continue}if(a){r._fx||(r._fx=m(()=>L(r,i.value)));continue}L(r,i)}}function ae(e,t,n){return{_directive:!0,_commit(r){let i=r[y]||new Map,o=new Map,a=[];for(let s=0;s<e.length;s++){let l=t(e[s],s);if(o.has(l))continue;a.push(l);let u=n(e[s],s);if(i.has(l)){let d=i.get(l);g(u,d),o.set(l,d)}else{let d=document.createElement("span");d.style.display="contents",d.setAttribute("role","presentation"),g(u,d),o.set(l,d)}}for(let[s,l]of i)o.has(s)||(l._i&&C(l._i.p),l.remove());let c=null;for(let s=a.length-1;s>=0;s--){let l=o.get(a[s]);(l.nextSibling!==c||l.parentNode!==r)&&r.insertBefore(l,c),c=l}r[y]=o}}}var x=new Map;function le(e,t){return t===`data-${e}`||t.startsWith(`data-${e}-`)}function z(e,t){return e===t||e.startsWith(`${t}-`)||t.startsWith(`${e}-`)}function ce(e){let t=[e.name,...e.prefixes||[]],n=[...e.attributes||[],...e.config||[]].filter(r=>!t.some(i=>le(i,r)));if(n.length>0)throw new Error(`Trait "${e.name}" declares attribute(s) outside its owned data-* namespace: ${n.join(", ")}. A trait owns "data-${e.name}" / "data-${e.name}-*" by default; register any other prefix via defineTrait({ ..., prefixes: [...] }) (ADR-0060) or rename the attribute.`)}function ue(e){let t=e.prefixes||[];for(let[n,r]of x){if(n===e.name)continue;let i=r.schema,o=[i.name,...i.prefixes||[]];for(let a of t)for(let c of o)if(z(a,c))throw new Error(`Trait "${e.name}"'s registered prefix "${a}" overlaps trait "${i.name}"'s owned namespace ("${c}"). Registered prefixes must be globally exclusive across the trait registry (ADR-0060).`);for(let a of i.prefixes||[])if(z(a,e.name))throw new Error(`Trait "${e.name}"'s name overlaps trait "${i.name}"'s registered prefix "${a}". Registered prefixes must be globally exclusive across the trait registry (ADR-0060).`)}}var G=new Set(["input-interaction","keyboard-navigation","forms-data","layout-measurement","motion-positioning","animation-feedback","visual-dynamics","interaction-delight","audio-haptics-sensory"]);function _e(e){if(!e.name)throw new Error("Trait requires a name");if(!e.setup)throw new Error(`Trait "${e.name}" requires a setup function`);if(!e.category)throw new Error(`Trait "${e.name}" requires a category`);if(!G.has(e.category))throw new Error(`Trait "${e.name}" has unknown category "${e.category}". Known: ${[...G].join(", ")}`);if(!e.description)throw new Error(`Trait "${e.name}" requires a description`);ce(e),ue(e);let t=Object.freeze({name:e.name,category:e.category,description:e.description,attributes:Object.freeze(e.attributes||[]),events:Object.freeze(e.events||[]),config:Object.freeze(e.config||[]),prefixes:Object.freeze(e.prefixes||[])});function n(){let r=null;return{schema:t,connect(i,o){r=e.setup({host:i,...o||{}})},disconnect(i){r&&(r(),r=null);for(let o of t.attributes)i.hasAttribute(o)&&(console.warn(`Trait "${t.name}": attribute "${o}" still present after disconnect`),i.removeAttribute(o))}}}return n.schema=t,x.set(e.name,n),n}function K(e){return x.get(e)||null}function Ce(e){return x.get(e)?.schema||null}function Oe(){return[...x.keys()]}var P=Symbol(),w=Symbol();function fe(e,t){e[w]=new Map,e[P]=new Map;for(let[n,r]of Object.entries(t)){let i=r.attribute??n.toLowerCase(),o=r.type??String,a=Object.prototype.hasOwnProperty.call(e,n),c=a?e[n]:void 0;a&&delete e[n];let s=p(r.default??void 0);e[P].set(n,s),Object.defineProperty(e,n,{get(){return s.value},set(l){let u=s.peek();Object.is(u,l)||(e[w].set(n,u),s.value=l,r.reflect&&he(e,i,l,o))},configurable:!0}),a&&(s.value=c)}}var de=Object.freeze({setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0},get form(){return null},get labels(){return[]},get validity(){return{}},get validationMessage(){return""},get willValidate(){return!1}});function he(e,t,n,r){r===Boolean?n?e.setAttribute(t,""):e.removeAttribute(t):n==null?e.removeAttribute(t):e.setAttribute(t,String(n))}var X=(e,t)=>t===Boolean?e!==null:t===Number?e===null?null:+e:e;function me(e){if(Object.hasOwn(e,"_sa"))return;e._sa=!0;let t=e.styles;if(!t||!("adoptedStyleSheets"in document))return;let n=Array.isArray(t)?t:[t];document.adoptedStyleSheets=[...document.adoptedStyleSheets,...n.filter(r=>!document.adoptedStyleSheets.includes(r))]}function Y(e){if(Object.hasOwn(e,"_pp"))return;e._pp={};let t=e.parts;if(t)for(let[n,r]of Object.entries(t)){let i=document.createElement("template");i.innerHTML=r,e._pp[n]=i.content.firstElementChild}}var O=class extends HTMLElement{static get properties(){return{}}static get traits(){return[]}static get observedAttributes(){let t=Object.entries(this.properties).map(([n,r])=>r.attribute??n.toLowerCase());return t.includes("traits")?t:[...t,"traits"]}#i=[];#n=[];#o=[];#t=null;#r=null;#e=null;#a=p(0);constructor(){super(),this.internals=typeof this.attachInternals=="function"?this.attachInternals():de,fe(this,this.constructor.properties)}connectedCallback(){let t=this.constructor;t._tag||(t._tag=this.localName),me(t),Y(t),E(()=>{for(let[n,r]of Object.entries(t.properties)){let i=r.attribute??n.toLowerCase();this.hasAttribute(i)?this[n]=X(this.getAttribute(i),r.type??String):r.reflect&&r.type===Boolean&&this[n]===!0&&this.setAttribute(i,"")}}),E(()=>this.connected()),this.#i.push(m(()=>{for(let r of this[P].values())r.value;this.#a.value;let n=t.template(this);if(n&&g(n,this),this.render(),this[w].size){let r=new Map(this[w]);this[w].clear(),this.updated(r)}},{host:this.localName,onError:this.onError?n=>this.onError(n):null})),this.#e||(this.#e=new Set);for(let n of t.traits)this.#s(n);this.#c(),this.#t&&this.#l()}disconnectedCallback(){this._i&&C(this._i.p);for(let t of this.#i)t();this.#i.length=0;for(let t of this.#o)t.value=void 0;this.#o.length=0;for(let t of this.#n)t.disconnect(this);this.#n.length=0,this.#e?.clear(),this.#r?.(),this.#r=null,this.#t?.disconnect?.(this),this.disconnected()}#l(){let t=this.#t;t.connect?.(this),this.#r=t.subscribe?.(()=>{this.#a.value++})}get controller(){return this.#t}set controller(t){this.#r?.(),this.#r=null,this.#t?.disconnect?.(this),this.#t=t,t&&this.isConnected&&this.#l()}#s(t,{declarative:n=!1}={}){this.#e.add(t);let r=t();r.connect(this,{host:this,signal:p,computed:N,effect:m}),n&&(r._declarative=!0),this.#n.push(r)}addTrait(t){return this.#e||(this.#e=new Set),this.#e.has(t)?this:(this.#s(t),this)}#c(){let t=this.getAttribute("traits");if(t)for(let n of t.split(/\s+/).filter(Boolean)){let r=K(n);if(!r){console.warn(`<${this.localName}> traits="${n}" \u2014 trait not found. Did you forget to import it?`);continue}this.#e.has(r)||this.#s(r,{declarative:!0})}}#f(){if(!this.#e)return;let t=[];for(let n of this.#n)if(n._declarative){n.disconnect(this);for(let r of this.#e)if(r.schema?.name&&n.schema?.name===r.schema.name){this.#e.delete(r);break}}else t.push(n);this.#n.length=0,this.#n.push(...t),this.#c()}attributeChangedCallback(t,n,r){if(t==="traits"){this.isConnected&&this.#f();return}for(let[i,o]of Object.entries(this.constructor.properties))if((o.attribute??i.toLowerCase())===t){this[i]=X(r,o.type??String);break}}static template=()=>null;static create(t={}){let n=this._tag??customElements.getName?.(this);if(!n)throw new Error("Component not registered");let r=document.createElement(n);for(let[i,o]of Object.entries(t))r[i]=o;return r}signal(t){let n=p(t);return this.#o.push(n),n}ensure(t){for(let o of this.children)if(o.getAttribute("slot")===t)return o;let n=this.#u(t);if(n)return n;Y(this.constructor);let r=this.constructor._pp?.[t];if(!r)return null;let i=r.cloneNode(!0);return i._uiPart=!0,this.appendChild(i),i}drop(t){for(let r of this.children)if(r.getAttribute("slot")===t){r.remove();return}let n=this.#u(t);n&&n.remove()}#u(t){for(let n of this.querySelectorAll(`[slot="${t}"]`)){let r=n.parentElement,i=!0;for(;r&&r!==this;){if(r.localName.includes("-")){i=!1;break}r=r.parentElement}if(i&&r===this)return n}return null}reconcile(t,n,r,i){let o=t[y]||new Map,a=new Map,c=[];for(let l=0;l<n.length;l++){let u=n[l],d=r(u,l);if(a.has(d))continue;let S=o.get(d);S?i(u,l,S):S=i(u,l,null),a.set(d,S),c.push(d)}for(let[l,u]of o)a.has(l)||u.remove();let s=null;for(let l=c.length-1;l>=0;l--){let u=a.get(c[l]);(u.nextSibling!==s||u.parentNode!==t)&&t.insertBefore(u,s),s=u}t[y]=a}connected(){}render(){}disconnected(){}updated(t){}};var pe="rounded borderless",T=class e extends O{static properties={mode:{type:String,default:"",reflect:!0}};static template=()=>null;connected(){this.hasAttribute("mode")||(this.mode=pe),this.addEventListener("click",this.#n),this.#o()}#i(t){return this.querySelector(`admin-sidebar[slot="${t}"], admin-sidebar[name="${t}"]`)}#n=t=>{let n=t.target.closest("[data-sidebar-toggle]");if(n&&this.contains(n)){let i=n.getAttribute("data-sidebar-toggle"),o=this.#i(i);o&&typeof o.toggle!="function"&&this.#r("admin-sidebar",`slot="${i}"`,"Sidebar toggle"),o?.toggle?.();return}let r=t.target.closest("[data-command-trigger]");if(r&&this.contains(r)){t.stopPropagation();let i=this.querySelector("admin-command");if(!i)return;if(typeof i.show!="function"){this.#r("admin-command","","Command palette");return}i.show()}};#o(){let t=this.querySelector("admin-command"),n=this.querySelector("nav-ui");!t||!n||t.addEventListener("command-select",r=>{let i=n.querySelector(`nav-item-ui[value="${r.detail.value}"]`);i&&n.select(i)})}static#t=new WeakSet;#r(t,n,r){let i=n?this.querySelector(`${t}[${n}], ${t}[${n.replace("slot=","name=")}]`):this.querySelector(t);if(!i||e.#t.has(i))return;e.#t.add(i);let o=t==="admin-sidebar"?"shell/admin-sidebar":"shell/admin-command";console.warn(`[admin-shell] <${t}${n?" "+n:""}> is in the DOM but ${t==="admin-sidebar"?"AdminSidebar":"AdminCommand"} is NOT registered \u2014 ${r} will not work. Import the cluster barrel \`@adia-ai/web-modules/shell\` (which registers all shell elements), OR add \`@adia-ai/web-modules/${o}\` alongside \`@adia-ai/web-modules/shell/admin-shell\` on the per-component path. Closes FB-55 silent-failure trap.`)}};R("admin-shell",T);export{T as AdminShell};
|
|
10
|
+
See USAGE.md \xA7 Template parser \u2014 invariants + unsupported syntaxes.`),n[c]={t:"n",n:document.createTextNode(""),c:void 0,_fx:null}):n[c]={t:"a",n:i,name:s,c:void 0,_fx:null}}return n}function C(e){for(let t of e)t&&t._fx&&(t._fx(),t._fx=null)}function M(e){if(e.n.nodeType===1&&e.n[j])return e.n;let t=document.createElement("span");return t.style.display="contents",t.setAttribute("role","presentation"),t[j]=!0,e.n.replaceWith(t),e.n=t,t}var U=e=>e!=null&&typeof e=="object"&&e.strings,V=e=>typeof e=="function"||e!=null&&typeof e.handleEvent=="function";function L(e,t){if(t!==e.c){if(e.t==="n")if(t!=null&&t._directive)t._commit(M(e));else if(U(t))g(t,M(e));else if(Array.isArray(t)){let n=M(e);n.replaceChildren();for(let r of t)if(U(r)){let i=document.createElement("span");i.style.display="contents",i.setAttribute("role","presentation"),n.appendChild(i),g(r,i)}else n.appendChild(document.createTextNode(r??""))}else if(v(t))e.n.replaceWith(t),e.n=t;else if(e.n[j]){let n=document.createTextNode(t??"");e.n.replaceWith(n),e.n=n}else e.n.textContent=t??"";else if(e.t==="a")t==null||t===!1?e.n.removeAttribute(e.name):e.n.setAttribute(e.name,t===!0?"":t);else if(e.t==="p"){if(!e._resolved){let n=W(e.n,e.name);n!==e.name&&(e.name=n),e._resolved=!0}e.n[e.name]=t}else e.t==="e"&&(V(e.c)&&e.n.removeEventListener(e.name,e.c),V(t)&&e.n.addEventListener(e.name,t));e.c=t}}function se(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(!r)continue;let i=t[n],o=r.t!=="e"&&typeof i=="function",a=!o&&r.t!=="e"&&k(i);if(r._fx&&!o&&!a&&(r._fx(),r._fx=null),o){r._fx||(r._fx=m(()=>L(r,i())));continue}if(a){r._fx||(r._fx=m(()=>L(r,i.value)));continue}L(r,i)}}function ae(e,t,n){return{_directive:!0,_commit(r){let i=r[y]||new Map,o=new Map,a=[];for(let s=0;s<e.length;s++){let l=t(e[s],s);if(o.has(l))continue;a.push(l);let u=n(e[s],s);if(i.has(l)){let d=i.get(l);g(u,d),o.set(l,d)}else{let d=document.createElement("span");d.style.display="contents",d.setAttribute("role","presentation"),g(u,d),o.set(l,d)}}for(let[s,l]of i)o.has(s)||(l._i&&C(l._i.p),l.remove());let c=null;for(let s=a.length-1;s>=0;s--){let l=o.get(a[s]);(l.nextSibling!==c||l.parentNode!==r)&&r.insertBefore(l,c),c=l}r[y]=o}}}var x=new Map;function le(e,t){return t===`data-${e}`||t.startsWith(`data-${e}-`)}function z(e,t){return e===t||e.startsWith(`${t}-`)||t.startsWith(`${e}-`)}function ce(e){let t=[e.name,...e.prefixes||[]],n=[...e.attributes||[],...e.config||[]].filter(r=>!t.some(i=>le(i,r)));if(n.length>0)throw new Error(`Trait "${e.name}" declares attribute(s) outside its owned data-* namespace: ${n.join(", ")}. A trait owns "data-${e.name}" / "data-${e.name}-*" by default; register any other prefix via defineTrait({ ..., prefixes: [...] }) (ADR-0060) or rename the attribute.`)}function ue(e){let t=e.prefixes||[];for(let[n,r]of x){if(n===e.name)continue;let i=r.schema,o=[i.name,...i.prefixes||[]];for(let a of t)for(let c of o)if(z(a,c))throw new Error(`Trait "${e.name}"'s registered prefix "${a}" overlaps trait "${i.name}"'s owned namespace ("${c}"). Registered prefixes must be globally exclusive across the trait registry (ADR-0060).`);for(let a of i.prefixes||[])if(z(a,e.name))throw new Error(`Trait "${e.name}"'s name overlaps trait "${i.name}"'s registered prefix "${a}". Registered prefixes must be globally exclusive across the trait registry (ADR-0060).`)}}var G=new Set(["input-interaction","keyboard-navigation","forms-data","layout-measurement","motion-positioning","animation-feedback","visual-dynamics","interaction-delight","audio-haptics-sensory"]);function _e(e){if(!e.name)throw new Error("Trait requires a name");if(!e.setup)throw new Error(`Trait "${e.name}" requires a setup function`);if(!e.category)throw new Error(`Trait "${e.name}" requires a category`);if(!G.has(e.category))throw new Error(`Trait "${e.name}" has unknown category "${e.category}". Known: ${[...G].join(", ")}`);if(!e.description)throw new Error(`Trait "${e.name}" requires a description`);ce(e),ue(e);let t=Object.freeze({name:e.name,category:e.category,description:e.description,attributes:Object.freeze(e.attributes||[]),events:Object.freeze(e.events||[]),config:Object.freeze(e.config||[]),prefixes:Object.freeze(e.prefixes||[])});function n(){let r=null;return{schema:t,connect(i,o){r=e.setup({host:i,...o||{}})},disconnect(i){r&&(r(),r=null);for(let o of t.attributes)i.hasAttribute(o)&&(console.warn(`Trait "${t.name}": attribute "${o}" still present after disconnect`),i.removeAttribute(o))}}}return n.schema=t,x.set(e.name,n),n}function K(e){return x.get(e)||null}function Ce(e){return x.get(e)?.schema||null}function Oe(){return[...x.keys()]}var P=Symbol(),w=Symbol();function fe(e,t){e[w]=new Map,e[P]=new Map;for(let[n,r]of Object.entries(t)){let i=r.attribute??n.toLowerCase(),o=r.type??String,a=Object.prototype.hasOwnProperty.call(e,n),c=a?e[n]:void 0;a&&delete e[n];let s=p(r.default??void 0);e[P].set(n,s),Object.defineProperty(e,n,{get(){return s.value},set(l){let u=s.peek();Object.is(u,l)||(e[w].set(n,u),s.value=l,r.reflect&&he(e,i,l,o))},configurable:!0}),a&&(s.value=c)}}var de=Object.freeze({setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0},get form(){return null},get labels(){return[]},get validity(){return{}},get validationMessage(){return""},get willValidate(){return!1}});function he(e,t,n,r){r===Boolean?n?e.setAttribute(t,""):e.removeAttribute(t):n==null?e.removeAttribute(t):e.setAttribute(t,String(n))}var X=(e,t)=>t===Boolean?e!==null&&e!=="false":t===Number?e===null?null:+e:e;function me(e){if(Object.hasOwn(e,"_sa"))return;e._sa=!0;let t=e.styles;if(!t||!("adoptedStyleSheets"in document))return;let n=Array.isArray(t)?t:[t];document.adoptedStyleSheets=[...document.adoptedStyleSheets,...n.filter(r=>!document.adoptedStyleSheets.includes(r))]}function Y(e){if(Object.hasOwn(e,"_pp"))return;e._pp={};let t=e.parts;if(t)for(let[n,r]of Object.entries(t)){let i=document.createElement("template");i.innerHTML=r,e._pp[n]=i.content.firstElementChild}}var O=class extends HTMLElement{static get properties(){return{}}static get traits(){return[]}static get observedAttributes(){let t=Object.entries(this.properties).map(([n,r])=>r.attribute??n.toLowerCase());return t.includes("traits")?t:[...t,"traits"]}#i=[];#n=[];#o=[];#t=null;#r=null;#e=null;#a=p(0);constructor(){super(),this.internals=typeof this.attachInternals=="function"?this.attachInternals():de,fe(this,this.constructor.properties)}connectedCallback(){let t=this.constructor;t._tag||(t._tag=this.localName),me(t),Y(t),E(()=>{for(let[n,r]of Object.entries(t.properties)){let i=r.attribute??n.toLowerCase();this.hasAttribute(i)?this[n]=X(this.getAttribute(i),r.type??String):r.reflect&&r.type===Boolean&&this[n]===!0&&this.setAttribute(i,"")}}),E(()=>this.connected()),this.#i.push(m(()=>{for(let r of this[P].values())r.value;this.#a.value;let n=t.template(this);if(n&&g(n,this),this.render(),this[w].size){let r=new Map(this[w]);this[w].clear(),this.updated(r)}},{host:this.localName,onError:this.onError?n=>this.onError(n):null})),this.#e||(this.#e=new Set);for(let n of t.traits)this.#s(n);this.#c(),this.#t&&this.#l()}disconnectedCallback(){this._i&&C(this._i.p);for(let t of this.#i)t();this.#i.length=0;for(let t of this.#o)t.value=void 0;this.#o.length=0;for(let t of this.#n)t.disconnect(this);this.#n.length=0,this.#e?.clear(),this.#r?.(),this.#r=null,this.#t?.disconnect?.(this),this.disconnected()}#l(){let t=this.#t;t.connect?.(this),this.#r=t.subscribe?.(()=>{this.#a.value++})}get controller(){return this.#t}set controller(t){this.#r?.(),this.#r=null,this.#t?.disconnect?.(this),this.#t=t,t&&this.isConnected&&this.#l()}#s(t,{declarative:n=!1}={}){this.#e.add(t);let r=t();r.connect(this,{host:this,signal:p,computed:N,effect:m}),n&&(r._declarative=!0),this.#n.push(r)}addTrait(t){return this.#e||(this.#e=new Set),this.#e.has(t)?this:(this.#s(t),this)}#c(){let t=this.getAttribute("traits");if(t)for(let n of t.split(/\s+/).filter(Boolean)){let r=K(n);if(!r){console.warn(`<${this.localName}> traits="${n}" \u2014 trait not found. Did you forget to import it?`);continue}this.#e.has(r)||this.#s(r,{declarative:!0})}}#f(){if(!this.#e)return;let t=[];for(let n of this.#n)if(n._declarative){n.disconnect(this);for(let r of this.#e)if(r.schema?.name&&n.schema?.name===r.schema.name){this.#e.delete(r);break}}else t.push(n);this.#n.length=0,this.#n.push(...t),this.#c()}attributeChangedCallback(t,n,r){if(t==="traits"){this.isConnected&&this.#f();return}for(let[i,o]of Object.entries(this.constructor.properties))if((o.attribute??i.toLowerCase())===t){this[i]=X(r,o.type??String);break}}static template=()=>null;static create(t={}){let n=this._tag??customElements.getName?.(this);if(!n)throw new Error("Component not registered");let r=document.createElement(n);for(let[i,o]of Object.entries(t))r[i]=o;return r}signal(t){let n=p(t);return this.#o.push(n),n}ensure(t){for(let o of this.children)if(o.getAttribute("slot")===t)return o;let n=this.#u(t);if(n)return n;Y(this.constructor);let r=this.constructor._pp?.[t];if(!r)return null;let i=r.cloneNode(!0);return i._uiPart=!0,this.appendChild(i),i}drop(t){for(let r of this.children)if(r.getAttribute("slot")===t){r.remove();return}let n=this.#u(t);n&&n.remove()}#u(t){for(let n of this.querySelectorAll(`[slot="${t}"]`)){let r=n.parentElement,i=!0;for(;r&&r!==this;){if(r.localName.includes("-")){i=!1;break}r=r.parentElement}if(i&&r===this)return n}return null}reconcile(t,n,r,i){let o=t[y]||new Map,a=new Map,c=[];for(let l=0;l<n.length;l++){let u=n[l],d=r(u,l);if(a.has(d))continue;let S=o.get(d);S?i(u,l,S):S=i(u,l,null),a.set(d,S),c.push(d)}for(let[l,u]of o)a.has(l)||u.remove();let s=null;for(let l=c.length-1;l>=0;l--){let u=a.get(c[l]);(u.nextSibling!==s||u.parentNode!==t)&&t.insertBefore(u,s),s=u}t[y]=a}connected(){}render(){}disconnected(){}updated(t){}};var pe="rounded borderless",T=class e extends O{static properties={mode:{type:String,default:"",reflect:!0}};static template=()=>null;connected(){this.hasAttribute("mode")||(this.mode=pe),this.addEventListener("click",this.#n),this.#o()}#i(t){return this.querySelector(`admin-sidebar[slot="${t}"], admin-sidebar[name="${t}"]`)}#n=t=>{let n=t.target.closest("[data-sidebar-toggle]");if(n&&this.contains(n)){let i=n.getAttribute("data-sidebar-toggle"),o=this.#i(i);o&&typeof o.toggle!="function"&&this.#r("admin-sidebar",`slot="${i}"`,"Sidebar toggle"),o?.toggle?.();return}let r=t.target.closest("[data-command-trigger]");if(r&&this.contains(r)){t.stopPropagation();let i=this.querySelector("admin-command");if(!i)return;if(typeof i.show!="function"){this.#r("admin-command","","Command palette");return}i.show()}};#o(){let t=this.querySelector("admin-command"),n=this.querySelector("nav-ui");!t||!n||t.addEventListener("command-select",r=>{let i=n.querySelector(`nav-item-ui[value="${r.detail.value}"]`);i&&n.select(i)})}static#t=new WeakSet;#r(t,n,r){let i=n?this.querySelector(`${t}[${n}], ${t}[${n.replace("slot=","name=")}]`):this.querySelector(t);if(!i||e.#t.has(i))return;e.#t.add(i);let o=t==="admin-sidebar"?"shell/admin-sidebar":"shell/admin-command";console.warn(`[admin-shell] <${t}${n?" "+n:""}> is in the DOM but ${t==="admin-sidebar"?"AdminSidebar":"AdminCommand"} is NOT registered \u2014 ${r} will not work. Import the cluster barrel \`@adia-ai/web-modules/shell\` (which registers all shell elements), OR add \`@adia-ai/web-modules/${o}\` alongside \`@adia-ai/web-modules/shell/admin-shell\` on the per-component path. Closes FB-55 silent-failure trap.`)}};R("admin-shell",T);export{T as AdminShell};
|
|
@@ -7,4 +7,4 @@ var A=Symbol("signal"),u=null,h=null,_=!1;function R(e){for(let t of e){if(t.dis
|
|
|
7
7
|
`+f+" Compute the full attr value as a single expression and interpolate the whole.")}continue}let c=+a[1],s=o.name;s[0]==="@"?(i.removeAttribute(s),n[c]={t:"e",n:i,name:s.slice(1),c:void 0,_fx:null}):s[0]==="."?(i.removeAttribute(s),n[c]={t:"p",n:i,name:q(i,s.slice(1)),c:void 0,_fx:null,_resolved:!1}):s[0]==="?"?(i.removeAttribute(s),console.warn(`[template] Lit-style boolean attribute "${s}=" is not supported.
|
|
8
8
|
Element: <${i.tagName.toLowerCase()}>
|
|
9
9
|
Use .${s.slice(1)}=\${value} (property binding) instead \u2014 the primitive reflects the property to the DOM attribute for you.
|
|
10
|
-
See USAGE.md \xA7 Template parser \u2014 invariants + unsupported syntaxes.`),n[c]={t:"n",n:document.createTextNode(""),c:void 0,_fx:null}):n[c]={t:"a",n:i,name:s,c:void 0,_fx:null}}return n}function $(e){for(let t of e)t&&t._fx&&(t._fx(),t._fx=null)}function M(e){if(e.n.nodeType===1&&e.n[v])return e.n;let t=document.createElement("span");return t.style.display="contents",t.setAttribute("role","presentation"),t[v]=!0,e.n.replaceWith(t),e.n=t,t}var V=e=>e!=null&&typeof e=="object"&&e.strings,z=e=>typeof e=="function"||e!=null&&typeof e.handleEvent=="function";function L(e,t){if(t!==e.c){if(e.t==="n")if(t!=null&&t._directive)t._commit(M(e));else if(V(t))g(t,M(e));else if(Array.isArray(t)){let n=M(e);n.replaceChildren();for(let r of t)if(V(r)){let i=document.createElement("span");i.style.display="contents",i.setAttribute("role","presentation"),n.appendChild(i),g(r,i)}else n.appendChild(document.createTextNode(r??""))}else if(j(t))e.n.replaceWith(t),e.n=t;else if(e.n[v]){let n=document.createTextNode(t??"");e.n.replaceWith(n),e.n=n}else e.n.textContent=t??"";else if(e.t==="a")t==null||t===!1?e.n.removeAttribute(e.name):e.n.setAttribute(e.name,t===!0?"":t);else if(e.t==="p"){if(!e._resolved){let n=q(e.n,e.name);n!==e.name&&(e.name=n),e._resolved=!0}e.n[e.name]=t}else e.t==="e"&&(z(e.c)&&e.n.removeEventListener(e.name,e.c),z(t)&&e.n.addEventListener(e.name,t));e.c=t}}function oe(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(!r)continue;let i=t[n],o=r.t!=="e"&&typeof i=="function",a=!o&&r.t!=="e"&&k(i);if(r._fx&&!o&&!a&&(r._fx(),r._fx=null),o){r._fx||(r._fx=p(()=>L(r,i())));continue}if(a){r._fx||(r._fx=p(()=>L(r,i.value)));continue}L(r,i)}}function se(e,t,n){return{_directive:!0,_commit(r){let i=r[y]||new Map,o=new Map,a=[];for(let s=0;s<e.length;s++){let l=t(e[s],s);if(o.has(l))continue;a.push(l);let f=n(e[s],s);if(i.has(l)){let d=i.get(l);g(f,d),o.set(l,d)}else{let d=document.createElement("span");d.style.display="contents",d.setAttribute("role","presentation"),g(f,d),o.set(l,d)}}for(let[s,l]of i)o.has(s)||(l._i&&$(l._i.p),l.remove());let c=null;for(let s=a.length-1;s>=0;s--){let l=o.get(a[s]);(l.nextSibling!==c||l.parentNode!==r)&&r.insertBefore(l,c),c=l}r[y]=o}}}var x=new Map;function ae(e,t){return t===`data-${e}`||t.startsWith(`data-${e}-`)}function U(e,t){return e===t||e.startsWith(`${t}-`)||t.startsWith(`${e}-`)}function le(e){let t=[e.name,...e.prefixes||[]],n=[...e.attributes||[],...e.config||[]].filter(r=>!t.some(i=>ae(i,r)));if(n.length>0)throw new Error(`Trait "${e.name}" declares attribute(s) outside its owned data-* namespace: ${n.join(", ")}. A trait owns "data-${e.name}" / "data-${e.name}-*" by default; register any other prefix via defineTrait({ ..., prefixes: [...] }) (ADR-0060) or rename the attribute.`)}function ce(e){let t=e.prefixes||[];for(let[n,r]of x){if(n===e.name)continue;let i=r.schema,o=[i.name,...i.prefixes||[]];for(let a of t)for(let c of o)if(U(a,c))throw new Error(`Trait "${e.name}"'s registered prefix "${a}" overlaps trait "${i.name}"'s owned namespace ("${c}"). Registered prefixes must be globally exclusive across the trait registry (ADR-0060).`);for(let a of i.prefixes||[])if(U(a,e.name))throw new Error(`Trait "${e.name}"'s name overlaps trait "${i.name}"'s registered prefix "${a}". Registered prefixes must be globally exclusive across the trait registry (ADR-0060).`)}}var F=new Set(["input-interaction","keyboard-navigation","forms-data","layout-measurement","motion-positioning","animation-feedback","visual-dynamics","interaction-delight","audio-haptics-sensory"]);function we(e){if(!e.name)throw new Error("Trait requires a name");if(!e.setup)throw new Error(`Trait "${e.name}" requires a setup function`);if(!e.category)throw new Error(`Trait "${e.name}" requires a category`);if(!F.has(e.category))throw new Error(`Trait "${e.name}" has unknown category "${e.category}". Known: ${[...F].join(", ")}`);if(!e.description)throw new Error(`Trait "${e.name}" requires a description`);le(e),ce(e);let t=Object.freeze({name:e.name,category:e.category,description:e.description,attributes:Object.freeze(e.attributes||[]),events:Object.freeze(e.events||[]),config:Object.freeze(e.config||[]),prefixes:Object.freeze(e.prefixes||[])});function n(){let r=null;return{schema:t,connect(i,o){r=e.setup({host:i,...o||{}})},disconnect(i){r&&(r(),r=null);for(let o of t.attributes)i.hasAttribute(o)&&(console.warn(`Trait "${t.name}": attribute "${o}" still present after disconnect`),i.removeAttribute(o))}}}return n.schema=t,x.set(e.name,n),n}function G(e){return x.get(e)||null}function Se(e){return x.get(e)?.schema||null}function Ae(){return[...x.keys()]}var P=Symbol(),w=Symbol();function fe(e,t){e[w]=new Map,e[P]=new Map;for(let[n,r]of Object.entries(t)){let i=r.attribute??n.toLowerCase(),o=r.type??String,a=Object.prototype.hasOwnProperty.call(e,n),c=a?e[n]:void 0;a&&delete e[n];let s=m(r.default??void 0);e[P].set(n,s),Object.defineProperty(e,n,{get(){return s.value},set(l){let f=s.peek();Object.is(f,l)||(e[w].set(n,f),s.value=l,r.reflect&&de(e,i,l,o))},configurable:!0}),a&&(s.value=c)}}var ue=Object.freeze({setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0},get form(){return null},get labels(){return[]},get validity(){return{}},get validationMessage(){return""},get willValidate(){return!1}});function de(e,t,n,r){r===Boolean?n?e.setAttribute(t,""):e.removeAttribute(t):n==null?e.removeAttribute(t):e.setAttribute(t,String(n))}var K=(e,t)=>t===Boolean?e!==null:t===Number?e===null?null:+e:e;function he(e){if(Object.hasOwn(e,"_sa"))return;e._sa=!0;let t=e.styles;if(!t||!("adoptedStyleSheets"in document))return;let n=Array.isArray(t)?t:[t];document.adoptedStyleSheets=[...document.adoptedStyleSheets,...n.filter(r=>!document.adoptedStyleSheets.includes(r))]}function X(e){if(Object.hasOwn(e,"_pp"))return;e._pp={};let t=e.parts;if(t)for(let[n,r]of Object.entries(t)){let i=document.createElement("template");i.innerHTML=r,e._pp[n]=i.content.firstElementChild}}var E=class extends HTMLElement{static get properties(){return{}}static get traits(){return[]}static get observedAttributes(){let t=Object.entries(this.properties).map(([n,r])=>r.attribute??n.toLowerCase());return t.includes("traits")?t:[...t,"traits"]}#i=[];#t=[];#o=[];#n=null;#r=null;#e=null;#a=m(0);constructor(){super(),this.internals=typeof this.attachInternals=="function"?this.attachInternals():ue,fe(this,this.constructor.properties)}connectedCallback(){let t=this.constructor;t._tag||(t._tag=this.localName),he(t),X(t),N(()=>{for(let[n,r]of Object.entries(t.properties)){let i=r.attribute??n.toLowerCase();this.hasAttribute(i)?this[n]=K(this.getAttribute(i),r.type??String):r.reflect&&r.type===Boolean&&this[n]===!0&&this.setAttribute(i,"")}}),N(()=>this.connected()),this.#i.push(p(()=>{for(let r of this[P].values())r.value;this.#a.value;let n=t.template(this);if(n&&g(n,this),this.render(),this[w].size){let r=new Map(this[w]);this[w].clear(),this.updated(r)}},{host:this.localName,onError:this.onError?n=>this.onError(n):null})),this.#e||(this.#e=new Set);for(let n of t.traits)this.#s(n);this.#c(),this.#n&&this.#l()}disconnectedCallback(){this._i&&$(this._i.p);for(let t of this.#i)t();this.#i.length=0;for(let t of this.#o)t.value=void 0;this.#o.length=0;for(let t of this.#t)t.disconnect(this);this.#t.length=0,this.#e?.clear(),this.#r?.(),this.#r=null,this.#n?.disconnect?.(this),this.disconnected()}#l(){let t=this.#n;t.connect?.(this),this.#r=t.subscribe?.(()=>{this.#a.value++})}get controller(){return this.#n}set controller(t){this.#r?.(),this.#r=null,this.#n?.disconnect?.(this),this.#n=t,t&&this.isConnected&&this.#l()}#s(t,{declarative:n=!1}={}){this.#e.add(t);let r=t();r.connect(this,{host:this,signal:m,computed:C,effect:p}),n&&(r._declarative=!0),this.#t.push(r)}addTrait(t){return this.#e||(this.#e=new Set),this.#e.has(t)?this:(this.#s(t),this)}#c(){let t=this.getAttribute("traits");if(t)for(let n of t.split(/\s+/).filter(Boolean)){let r=G(n);if(!r){console.warn(`<${this.localName}> traits="${n}" \u2014 trait not found. Did you forget to import it?`);continue}this.#e.has(r)||this.#s(r,{declarative:!0})}}#u(){if(!this.#e)return;let t=[];for(let n of this.#t)if(n._declarative){n.disconnect(this);for(let r of this.#e)if(r.schema?.name&&n.schema?.name===r.schema.name){this.#e.delete(r);break}}else t.push(n);this.#t.length=0,this.#t.push(...t),this.#c()}attributeChangedCallback(t,n,r){if(t==="traits"){this.isConnected&&this.#u();return}for(let[i,o]of Object.entries(this.constructor.properties))if((o.attribute??i.toLowerCase())===t){this[i]=K(r,o.type??String);break}}static template=()=>null;static create(t={}){let n=this._tag??customElements.getName?.(this);if(!n)throw new Error("Component not registered");let r=document.createElement(n);for(let[i,o]of Object.entries(t))r[i]=o;return r}signal(t){let n=m(t);return this.#o.push(n),n}ensure(t){for(let o of this.children)if(o.getAttribute("slot")===t)return o;let n=this.#f(t);if(n)return n;X(this.constructor);let r=this.constructor._pp?.[t];if(!r)return null;let i=r.cloneNode(!0);return i._uiPart=!0,this.appendChild(i),i}drop(t){for(let r of this.children)if(r.getAttribute("slot")===t){r.remove();return}let n=this.#f(t);n&&n.remove()}#f(t){for(let n of this.querySelectorAll(`[slot="${t}"]`)){let r=n.parentElement,i=!0;for(;r&&r!==this;){if(r.localName.includes("-")){i=!1;break}r=r.parentElement}if(i&&r===this)return n}return null}reconcile(t,n,r,i){let o=t[y]||new Map,a=new Map,c=[];for(let l=0;l<n.length;l++){let f=n[l],d=r(f,l);if(a.has(d))continue;let S=o.get(d);S?i(f,l,S):S=i(f,l,null),a.set(d,S),c.push(d)}for(let[l,f]of o)a.has(l)||f.remove();let s=null;for(let l=c.length-1;l>=0;l--){let f=a.get(c[l]);(f.nextSibling!==s||f.parentNode!==t)&&t.insertBefore(f,s),s=f}t[y]=a}connected(){}render(){}disconnected(){}updated(t){}};var O=class extends E{static properties={centered:{type:Boolean,default:!1,reflect:!0},"full-bleed":{type:Boolean,default:!1,reflect:!0}};static template=()=>null};customElements.get("simple-shell")||customElements.define("simple-shell",O);export{O as SimpleShell};
|
|
10
|
+
See USAGE.md \xA7 Template parser \u2014 invariants + unsupported syntaxes.`),n[c]={t:"n",n:document.createTextNode(""),c:void 0,_fx:null}):n[c]={t:"a",n:i,name:s,c:void 0,_fx:null}}return n}function $(e){for(let t of e)t&&t._fx&&(t._fx(),t._fx=null)}function M(e){if(e.n.nodeType===1&&e.n[v])return e.n;let t=document.createElement("span");return t.style.display="contents",t.setAttribute("role","presentation"),t[v]=!0,e.n.replaceWith(t),e.n=t,t}var V=e=>e!=null&&typeof e=="object"&&e.strings,z=e=>typeof e=="function"||e!=null&&typeof e.handleEvent=="function";function L(e,t){if(t!==e.c){if(e.t==="n")if(t!=null&&t._directive)t._commit(M(e));else if(V(t))g(t,M(e));else if(Array.isArray(t)){let n=M(e);n.replaceChildren();for(let r of t)if(V(r)){let i=document.createElement("span");i.style.display="contents",i.setAttribute("role","presentation"),n.appendChild(i),g(r,i)}else n.appendChild(document.createTextNode(r??""))}else if(j(t))e.n.replaceWith(t),e.n=t;else if(e.n[v]){let n=document.createTextNode(t??"");e.n.replaceWith(n),e.n=n}else e.n.textContent=t??"";else if(e.t==="a")t==null||t===!1?e.n.removeAttribute(e.name):e.n.setAttribute(e.name,t===!0?"":t);else if(e.t==="p"){if(!e._resolved){let n=q(e.n,e.name);n!==e.name&&(e.name=n),e._resolved=!0}e.n[e.name]=t}else e.t==="e"&&(z(e.c)&&e.n.removeEventListener(e.name,e.c),z(t)&&e.n.addEventListener(e.name,t));e.c=t}}function oe(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(!r)continue;let i=t[n],o=r.t!=="e"&&typeof i=="function",a=!o&&r.t!=="e"&&k(i);if(r._fx&&!o&&!a&&(r._fx(),r._fx=null),o){r._fx||(r._fx=p(()=>L(r,i())));continue}if(a){r._fx||(r._fx=p(()=>L(r,i.value)));continue}L(r,i)}}function se(e,t,n){return{_directive:!0,_commit(r){let i=r[y]||new Map,o=new Map,a=[];for(let s=0;s<e.length;s++){let l=t(e[s],s);if(o.has(l))continue;a.push(l);let f=n(e[s],s);if(i.has(l)){let d=i.get(l);g(f,d),o.set(l,d)}else{let d=document.createElement("span");d.style.display="contents",d.setAttribute("role","presentation"),g(f,d),o.set(l,d)}}for(let[s,l]of i)o.has(s)||(l._i&&$(l._i.p),l.remove());let c=null;for(let s=a.length-1;s>=0;s--){let l=o.get(a[s]);(l.nextSibling!==c||l.parentNode!==r)&&r.insertBefore(l,c),c=l}r[y]=o}}}var x=new Map;function ae(e,t){return t===`data-${e}`||t.startsWith(`data-${e}-`)}function U(e,t){return e===t||e.startsWith(`${t}-`)||t.startsWith(`${e}-`)}function le(e){let t=[e.name,...e.prefixes||[]],n=[...e.attributes||[],...e.config||[]].filter(r=>!t.some(i=>ae(i,r)));if(n.length>0)throw new Error(`Trait "${e.name}" declares attribute(s) outside its owned data-* namespace: ${n.join(", ")}. A trait owns "data-${e.name}" / "data-${e.name}-*" by default; register any other prefix via defineTrait({ ..., prefixes: [...] }) (ADR-0060) or rename the attribute.`)}function ce(e){let t=e.prefixes||[];for(let[n,r]of x){if(n===e.name)continue;let i=r.schema,o=[i.name,...i.prefixes||[]];for(let a of t)for(let c of o)if(U(a,c))throw new Error(`Trait "${e.name}"'s registered prefix "${a}" overlaps trait "${i.name}"'s owned namespace ("${c}"). Registered prefixes must be globally exclusive across the trait registry (ADR-0060).`);for(let a of i.prefixes||[])if(U(a,e.name))throw new Error(`Trait "${e.name}"'s name overlaps trait "${i.name}"'s registered prefix "${a}". Registered prefixes must be globally exclusive across the trait registry (ADR-0060).`)}}var F=new Set(["input-interaction","keyboard-navigation","forms-data","layout-measurement","motion-positioning","animation-feedback","visual-dynamics","interaction-delight","audio-haptics-sensory"]);function we(e){if(!e.name)throw new Error("Trait requires a name");if(!e.setup)throw new Error(`Trait "${e.name}" requires a setup function`);if(!e.category)throw new Error(`Trait "${e.name}" requires a category`);if(!F.has(e.category))throw new Error(`Trait "${e.name}" has unknown category "${e.category}". Known: ${[...F].join(", ")}`);if(!e.description)throw new Error(`Trait "${e.name}" requires a description`);le(e),ce(e);let t=Object.freeze({name:e.name,category:e.category,description:e.description,attributes:Object.freeze(e.attributes||[]),events:Object.freeze(e.events||[]),config:Object.freeze(e.config||[]),prefixes:Object.freeze(e.prefixes||[])});function n(){let r=null;return{schema:t,connect(i,o){r=e.setup({host:i,...o||{}})},disconnect(i){r&&(r(),r=null);for(let o of t.attributes)i.hasAttribute(o)&&(console.warn(`Trait "${t.name}": attribute "${o}" still present after disconnect`),i.removeAttribute(o))}}}return n.schema=t,x.set(e.name,n),n}function G(e){return x.get(e)||null}function Se(e){return x.get(e)?.schema||null}function Ae(){return[...x.keys()]}var P=Symbol(),w=Symbol();function fe(e,t){e[w]=new Map,e[P]=new Map;for(let[n,r]of Object.entries(t)){let i=r.attribute??n.toLowerCase(),o=r.type??String,a=Object.prototype.hasOwnProperty.call(e,n),c=a?e[n]:void 0;a&&delete e[n];let s=m(r.default??void 0);e[P].set(n,s),Object.defineProperty(e,n,{get(){return s.value},set(l){let f=s.peek();Object.is(f,l)||(e[w].set(n,f),s.value=l,r.reflect&&de(e,i,l,o))},configurable:!0}),a&&(s.value=c)}}var ue=Object.freeze({setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0},get form(){return null},get labels(){return[]},get validity(){return{}},get validationMessage(){return""},get willValidate(){return!1}});function de(e,t,n,r){r===Boolean?n?e.setAttribute(t,""):e.removeAttribute(t):n==null?e.removeAttribute(t):e.setAttribute(t,String(n))}var K=(e,t)=>t===Boolean?e!==null&&e!=="false":t===Number?e===null?null:+e:e;function he(e){if(Object.hasOwn(e,"_sa"))return;e._sa=!0;let t=e.styles;if(!t||!("adoptedStyleSheets"in document))return;let n=Array.isArray(t)?t:[t];document.adoptedStyleSheets=[...document.adoptedStyleSheets,...n.filter(r=>!document.adoptedStyleSheets.includes(r))]}function X(e){if(Object.hasOwn(e,"_pp"))return;e._pp={};let t=e.parts;if(t)for(let[n,r]of Object.entries(t)){let i=document.createElement("template");i.innerHTML=r,e._pp[n]=i.content.firstElementChild}}var E=class extends HTMLElement{static get properties(){return{}}static get traits(){return[]}static get observedAttributes(){let t=Object.entries(this.properties).map(([n,r])=>r.attribute??n.toLowerCase());return t.includes("traits")?t:[...t,"traits"]}#i=[];#t=[];#o=[];#n=null;#r=null;#e=null;#a=m(0);constructor(){super(),this.internals=typeof this.attachInternals=="function"?this.attachInternals():ue,fe(this,this.constructor.properties)}connectedCallback(){let t=this.constructor;t._tag||(t._tag=this.localName),he(t),X(t),N(()=>{for(let[n,r]of Object.entries(t.properties)){let i=r.attribute??n.toLowerCase();this.hasAttribute(i)?this[n]=K(this.getAttribute(i),r.type??String):r.reflect&&r.type===Boolean&&this[n]===!0&&this.setAttribute(i,"")}}),N(()=>this.connected()),this.#i.push(p(()=>{for(let r of this[P].values())r.value;this.#a.value;let n=t.template(this);if(n&&g(n,this),this.render(),this[w].size){let r=new Map(this[w]);this[w].clear(),this.updated(r)}},{host:this.localName,onError:this.onError?n=>this.onError(n):null})),this.#e||(this.#e=new Set);for(let n of t.traits)this.#s(n);this.#c(),this.#n&&this.#l()}disconnectedCallback(){this._i&&$(this._i.p);for(let t of this.#i)t();this.#i.length=0;for(let t of this.#o)t.value=void 0;this.#o.length=0;for(let t of this.#t)t.disconnect(this);this.#t.length=0,this.#e?.clear(),this.#r?.(),this.#r=null,this.#n?.disconnect?.(this),this.disconnected()}#l(){let t=this.#n;t.connect?.(this),this.#r=t.subscribe?.(()=>{this.#a.value++})}get controller(){return this.#n}set controller(t){this.#r?.(),this.#r=null,this.#n?.disconnect?.(this),this.#n=t,t&&this.isConnected&&this.#l()}#s(t,{declarative:n=!1}={}){this.#e.add(t);let r=t();r.connect(this,{host:this,signal:m,computed:C,effect:p}),n&&(r._declarative=!0),this.#t.push(r)}addTrait(t){return this.#e||(this.#e=new Set),this.#e.has(t)?this:(this.#s(t),this)}#c(){let t=this.getAttribute("traits");if(t)for(let n of t.split(/\s+/).filter(Boolean)){let r=G(n);if(!r){console.warn(`<${this.localName}> traits="${n}" \u2014 trait not found. Did you forget to import it?`);continue}this.#e.has(r)||this.#s(r,{declarative:!0})}}#u(){if(!this.#e)return;let t=[];for(let n of this.#t)if(n._declarative){n.disconnect(this);for(let r of this.#e)if(r.schema?.name&&n.schema?.name===r.schema.name){this.#e.delete(r);break}}else t.push(n);this.#t.length=0,this.#t.push(...t),this.#c()}attributeChangedCallback(t,n,r){if(t==="traits"){this.isConnected&&this.#u();return}for(let[i,o]of Object.entries(this.constructor.properties))if((o.attribute??i.toLowerCase())===t){this[i]=K(r,o.type??String);break}}static template=()=>null;static create(t={}){let n=this._tag??customElements.getName?.(this);if(!n)throw new Error("Component not registered");let r=document.createElement(n);for(let[i,o]of Object.entries(t))r[i]=o;return r}signal(t){let n=m(t);return this.#o.push(n),n}ensure(t){for(let o of this.children)if(o.getAttribute("slot")===t)return o;let n=this.#f(t);if(n)return n;X(this.constructor);let r=this.constructor._pp?.[t];if(!r)return null;let i=r.cloneNode(!0);return i._uiPart=!0,this.appendChild(i),i}drop(t){for(let r of this.children)if(r.getAttribute("slot")===t){r.remove();return}let n=this.#f(t);n&&n.remove()}#f(t){for(let n of this.querySelectorAll(`[slot="${t}"]`)){let r=n.parentElement,i=!0;for(;r&&r!==this;){if(r.localName.includes("-")){i=!1;break}r=r.parentElement}if(i&&r===this)return n}return null}reconcile(t,n,r,i){let o=t[y]||new Map,a=new Map,c=[];for(let l=0;l<n.length;l++){let f=n[l],d=r(f,l);if(a.has(d))continue;let S=o.get(d);S?i(f,l,S):S=i(f,l,null),a.set(d,S),c.push(d)}for(let[l,f]of o)a.has(l)||f.remove();let s=null;for(let l=c.length-1;l>=0;l--){let f=a.get(c[l]);(f.nextSibling!==s||f.parentNode!==t)&&t.insertBefore(f,s),s=f}t[y]=a}connected(){}render(){}disconnected(){}updated(t){}};var O=class extends E{static properties={centered:{type:Boolean,default:!1,reflect:!0},"full-bleed":{type:Boolean,default:!1,reflect:!0}};static template=()=>null};customElements.get("simple-shell")||customElements.define("simple-shell",O);export{O as SimpleShell};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adia-ai/web-modules",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.44",
|
|
4
4
|
"description": "AdiaUI composite custom elements — shell, chat, editor, runtime clusters built from @adia-ai/web-components primitives. Subpath exports per cluster.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -389,11 +389,11 @@
|
|
|
389
389
|
"./simple/**/*.js"
|
|
390
390
|
],
|
|
391
391
|
"peerDependencies": {
|
|
392
|
-
"@adia-ai/web-components": "0.8.
|
|
393
|
-
"@adia-ai/a2ui": "0.8.
|
|
394
|
-
"@adia-ai/llm": "0.8.
|
|
395
|
-
"@adia-ai/agent": "0.8.
|
|
396
|
-
"@adia-ai/persona": "0.8.
|
|
392
|
+
"@adia-ai/web-components": "0.8.44",
|
|
393
|
+
"@adia-ai/a2ui": "0.8.44",
|
|
394
|
+
"@adia-ai/llm": "0.8.44",
|
|
395
|
+
"@adia-ai/agent": "0.8.44",
|
|
396
|
+
"@adia-ai/persona": "0.8.44"
|
|
397
397
|
},
|
|
398
398
|
"publishConfig": {
|
|
399
399
|
"access": "public",
|
|
@@ -29,6 +29,11 @@ export interface AdminCommandCommandSelectEventDetail {
|
|
|
29
29
|
export type AdminCommandCommandSelectEvent = CustomEvent<AdminCommandCommandSelectEventDetail>;
|
|
30
30
|
|
|
31
31
|
export class AdminCommand extends UIElement {
|
|
32
|
+
/** Opts out of the keyboard listener entirely. Use when the host
|
|
33
|
+
wires its own shortcut handling, or when the palette should be
|
|
34
|
+
mouse-only.
|
|
35
|
+
*/
|
|
36
|
+
noShortcut: boolean;
|
|
32
37
|
/** Reflected — set while the dialog is showing. Synced with both
|
|
33
38
|
programmatic .show()/.hide() and native dialog close events
|
|
34
39
|
(esc key, backdrop click).
|
|
@@ -43,6 +43,10 @@ duplicating threshold math.
|
|
|
43
43
|
.toggle() / .collapse() / .expand() public methods.
|
|
44
44
|
*/
|
|
45
45
|
collapsible: boolean;
|
|
46
|
+
/** Optional override for the snap-floor width. Defaults to reading
|
|
47
|
+
CSS min-width via getComputedStyle.
|
|
48
|
+
*/
|
|
49
|
+
minWidth: string;
|
|
46
50
|
/** Identifier for localStorage namespacing. Defaults to slot value
|
|
47
51
|
("leading" or "trailing"). Override when running multiple sidebars
|
|
48
52
|
with the same slot.
|
|
@@ -26,4 +26,6 @@ import { UIElement } from '../../../web-components/core/element.js';
|
|
|
26
26
|
export class SimpleShell extends UIElement {
|
|
27
27
|
/** Reflected — vertically centers content in viewport. */
|
|
28
28
|
centered: boolean;
|
|
29
|
+
/** Reflected — drops the default max-width so content fills full viewport. */
|
|
30
|
+
fullBleed: boolean;
|
|
29
31
|
}
|
|
@@ -40,6 +40,27 @@ export interface ThemePanelThemeChangeEventDetail {
|
|
|
40
40
|
export type ThemePanelThemeChangeEvent = CustomEvent<ThemePanelThemeChangeEventDetail>;
|
|
41
41
|
|
|
42
42
|
export class ThemePanel extends UIElement {
|
|
43
|
+
/** Reflected — mirrors the current --a-density value on the target
|
|
44
|
+
element. Stringified number.
|
|
45
|
+
*/
|
|
46
|
+
activeDensity: string;
|
|
47
|
+
/** Reflected — mirrors the current --a-radius-k value on the target
|
|
48
|
+
element. Stringified number.
|
|
49
|
+
*/
|
|
50
|
+
activeRadius: string;
|
|
51
|
+
/** Reflected — the active [scale] tier on the target element; empty
|
|
52
|
+
for the unscaled default (no [scale] attribute set).
|
|
53
|
+
*/
|
|
54
|
+
activeScale: string;
|
|
55
|
+
/** Reflected — the resolved color-scheme (auto collapsed to a
|
|
56
|
+
concrete value). Either "light" or "dark".
|
|
57
|
+
*/
|
|
58
|
+
activeScheme: string;
|
|
59
|
+
/** Reflected — the currently selected theme slug. Empty string when
|
|
60
|
+
unset (default theme). Read-only externally; use .apply({theme})
|
|
61
|
+
to change.
|
|
62
|
+
*/
|
|
63
|
+
activeTheme: string;
|
|
43
64
|
/** Renders the density + radius slider block. Sliders bind to
|
|
44
65
|
--a-density and --a-radius-k on the target element.
|
|
45
66
|
*/
|
|
@@ -70,6 +91,16 @@ matchMedia listener; user clicks on the scheme toggle promote to
|
|
|
70
91
|
an explicit light or dark choice.
|
|
71
92
|
*/
|
|
72
93
|
scheme: 'light' | 'dark' | 'auto';
|
|
94
|
+
/** Renders an integrated light/dark <segmented-ui> at the top of the
|
|
95
|
+
panel. When absent, the panel omits scheme entirely — consumers
|
|
96
|
+
can still drive scheme via the .apply({scheme}) public method.
|
|
97
|
+
*/
|
|
98
|
+
schemeToggle: boolean;
|
|
99
|
+
/** Namespace for localStorage keys when [persist] is set. Five keys
|
|
100
|
+
are written: {prefix}theme, {prefix}scheme, {prefix}density,
|
|
101
|
+
{prefix}radius, {prefix}scale.
|
|
102
|
+
*/
|
|
103
|
+
storagePrefix: string;
|
|
73
104
|
/** CSS selector for the element that receives [theme] and
|
|
74
105
|
--a-density / --a-radius-k writes. Defaults to :root (the
|
|
75
106
|
<html> element). Scoped targets are useful for preview-pane
|