← Commit history

Expose bounded outline inspection commands for embedded AI-driven review and recording

John Lauer ·6cf0b505c0 ·1mo ago ·parent a80a0b3
3 files changed +6−6
files/chip-thumbnail-widget.js+2−2
@@ -6,9 +6,9 @@     static get observedAttributes(){return ['src','mpn','package'];}     set data(value){this._data=value;if(this.shadowRoot)this._load();}     get data(){return this._data;}-    connectedCallback(){if(!this.shadowRoot)this.attachShadow({mode:'open'});if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',()=>this.isConnected&&this._load(),{once:true});else this._load();}+    connectedCallback(){if(!this.shadowRoot)this.attachShadow({mode:'open'});if(!this._commandHandler){this._commandHandler=e=>{if(e.source!==parent||e.data?.type!=='adom-chip-thumbnail-command')return;const {action,index,open}=e.data,s=this.shadowRoot;let button;if(action==='selectVariant'&&Number.isInteger(index))button=s.querySelectorAll('.variants button')[index];else if(action==='zoom')button=s.querySelector('.zoom');else if(action==='fit')button=s.querySelector('.reset');else if(action==='showFiles'&&typeof open==='boolean'){const details=s.querySelector('details');if(details)details.open=open;}if(button)button.click();this._height();};window.addEventListener('message',this._commandHandler);}if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',()=>this.isConnected&&this._load(),{once:true});else this._load();}     attributeChangedCallback(){if(this.shadowRoot)this._load();}-    disconnectedCallback(){this._request=(this._request||0)+1;}+    disconnectedCallback(){this._request=(this._request||0)+1;if(this._commandHandler){window.removeEventListener('message',this._commandHandler);this._commandHandler=null;}}     _height(){requestAnimationFrame(()=>{parent.postMessage({type:'readme-height',height:Math.ceil(document.documentElement.scrollHeight)+2},'*');parent.postMessage({type:'adom-chip-thumbnail-state',state:this.selfCheck()},'*');});}     async _load(){       const token=this._request=(this._request||0)+1,src=this.getAttribute('src')||'';
skills/component-widgets/widgets/chip-thumbnail-widget.js+2−2
@@ -6,9 +6,9 @@     static get observedAttributes(){return ['src','mpn','package'];}     set data(value){this._data=value;if(this.shadowRoot)this._load();}     get data(){return this._data;}-    connectedCallback(){if(!this.shadowRoot)this.attachShadow({mode:'open'});if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',()=>this.isConnected&&this._load(),{once:true});else this._load();}+    connectedCallback(){if(!this.shadowRoot)this.attachShadow({mode:'open'});if(!this._commandHandler){this._commandHandler=e=>{if(e.source!==parent||e.data?.type!=='adom-chip-thumbnail-command')return;const {action,index,open}=e.data,s=this.shadowRoot;let button;if(action==='selectVariant'&&Number.isInteger(index))button=s.querySelectorAll('.variants button')[index];else if(action==='zoom')button=s.querySelector('.zoom');else if(action==='fit')button=s.querySelector('.reset');else if(action==='showFiles'&&typeof open==='boolean'){const details=s.querySelector('details');if(details)details.open=open;}if(button)button.click();this._height();};window.addEventListener('message',this._commandHandler);}if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',()=>this.isConnected&&this._load(),{once:true});else this._load();}     attributeChangedCallback(){if(this.shadowRoot)this._load();}-    disconnectedCallback(){this._request=(this._request||0)+1;}+    disconnectedCallback(){this._request=(this._request||0)+1;if(this._commandHandler){window.removeEventListener('message',this._commandHandler);this._commandHandler=null;}}     _height(){requestAnimationFrame(()=>{parent.postMessage({type:'readme-height',height:Math.ceil(document.documentElement.scrollHeight)+2},'*');parent.postMessage({type:'adom-chip-thumbnail-state',state:this.selfCheck()},'*');});}     async _load(){       const token=this._request=(this._request||0)+1,src=this.getAttribute('src')||'';
widgets/chip-thumbnail-widget.js+2−2
@@ -6,9 +6,9 @@     static get observedAttributes(){return ['src','mpn','package'];}     set data(value){this._data=value;if(this.shadowRoot)this._load();}     get data(){return this._data;}-    connectedCallback(){if(!this.shadowRoot)this.attachShadow({mode:'open'});if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',()=>this.isConnected&&this._load(),{once:true});else this._load();}+    connectedCallback(){if(!this.shadowRoot)this.attachShadow({mode:'open'});if(!this._commandHandler){this._commandHandler=e=>{if(e.source!==parent||e.data?.type!=='adom-chip-thumbnail-command')return;const {action,index,open}=e.data,s=this.shadowRoot;let button;if(action==='selectVariant'&&Number.isInteger(index))button=s.querySelectorAll('.variants button')[index];else if(action==='zoom')button=s.querySelector('.zoom');else if(action==='fit')button=s.querySelector('.reset');else if(action==='showFiles'&&typeof open==='boolean'){const details=s.querySelector('details');if(details)details.open=open;}if(button)button.click();this._height();};window.addEventListener('message',this._commandHandler);}if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',()=>this.isConnected&&this._load(),{once:true});else this._load();}     attributeChangedCallback(){if(this.shadowRoot)this._load();}-    disconnectedCallback(){this._request=(this._request||0)+1;}+    disconnectedCallback(){this._request=(this._request||0)+1;if(this._commandHandler){window.removeEventListener('message',this._commandHandler);this._commandHandler=null;}}     _height(){requestAnimationFrame(()=>{parent.postMessage({type:'readme-height',height:Math.ceil(document.documentElement.scrollHeight)+2},'*');parent.postMessage({type:'adom-chip-thumbnail-state',state:this.selfCheck()},'*');});}     async _load(){       const token=this._request=(this._request||0)+1,src=this.getAttribute('src')||'';