This commit is contained in:
Home Assistant Version Control
2026-09-02 17:25:54 +00:00
parent 96984f8a7c
commit 9cf15e8480
3 changed files with 175 additions and 175 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{
"domain": "cafe",
"name": "C.A.F.E.",
"version": "0.7.0",
"version": "0.9.0",
"codeowners": [],
"config_flow": true,
"dependencies": ["frontend", "http"],
File diff suppressed because one or more lines are too long
@@ -1,2 +1,2 @@
var d=Object.defineProperty;var o=(t,s,e)=>s in t?d(t,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[s]=e;var h=(t,s,e)=>o(t,typeof s!="symbol"?s+"":s,e);class m extends HTMLElement{constructor(){super(...arguments);h(this,"_messageHandler");h(this,"iframe",null);h(this,"_hass")}set hass(e){var a;this._hass=e,window.hass=e;const i=(a=this.iframe)==null?void 0:a.contentWindow;i!=null&&i.setHass&&i.setHass(e)}get hass(){return this._hass}connectedCallback(){var a,n;this.style.display="block",this.style.width="100%",this.style.height="100%",this.style.position="relative";const i=((n=(a=this._hass)==null?void 0:a.themes)==null?void 0:n.darkMode)??!1?"hsl(222.2, 84%, 4.9%)":"hsl(0, 0%, 100%)";this.iframe=document.createElement("iframe"),this.iframe.src="/cafe-hass/index.html",this.iframe.style.width="100%",this.iframe.style.height="100%",this.iframe.style.border="none",this.iframe.style.display="block",this.iframe.style.background=i,this.iframe.setAttribute("allow","clipboard-read *; clipboard-write *"),this.appendChild(this.iframe),this._messageHandler=r=>{var l;r.source===((l=this.iframe)==null?void 0:l.contentWindow)&&r.data&&r.data.type==="CAFE_TOGGLE_SIDEBAR"&&this.dispatchEvent(new Event("hass-toggle-menu",{bubbles:!0,composed:!0}))},window.addEventListener("message",this._messageHandler)}disconnectedCallback(){this.iframe&&(this.removeChild(this.iframe),this.iframe=null),window.hass=void 0,this._messageHandler&&(window.removeEventListener("message",this._messageHandler),this._messageHandler=void 0)}}customElements.get("cafe-panel")||customElements.define("cafe-panel",m);
var d=Object.defineProperty;var o=(i,s,e)=>s in i?d(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e;var r=(i,s,e)=>o(i,typeof s!="symbol"?s+"":s,e);class m extends HTMLElement{constructor(){super(...arguments);r(this,"_messageHandler");r(this,"_resizeHandler");r(this,"iframe",null);r(this,"_hass")}applyHeight(){const e=this.getBoundingClientRect().top;this.style.height=`calc(100vh - ${Math.max(0,e)}px)`}set hass(e){var a;this._hass=e,window.hass=e;const t=(a=this.iframe)==null?void 0:a.contentWindow;t!=null&&t.setHass&&t.setHass(e)}get hass(){return this._hass}connectedCallback(){var a,h;this.style.display="block",this.style.width="100%",this.style.position="relative",this.applyHeight();const t=((h=(a=this._hass)==null?void 0:a.themes)==null?void 0:h.darkMode)??!1?"hsl(222.2, 84%, 4.9%)":"hsl(0, 0%, 100%)";this.iframe=document.createElement("iframe"),this.iframe.src="/cafe-hass/index.html",this.iframe.style.width="100%",this.iframe.style.height="100%",this.iframe.style.border="none",this.iframe.style.display="block",this.iframe.style.background=t,this.iframe.setAttribute("allow","clipboard-read *; clipboard-write *"),this.appendChild(this.iframe),this._messageHandler=n=>{var l;n.source===((l=this.iframe)==null?void 0:l.contentWindow)&&n.data&&n.data.type==="CAFE_TOGGLE_SIDEBAR"&&this.dispatchEvent(new Event("hass-toggle-menu",{bubbles:!0,composed:!0}))},window.addEventListener("message",this._messageHandler),this._resizeHandler=()=>this.applyHeight(),window.addEventListener("resize",this._resizeHandler),requestAnimationFrame(this._resizeHandler)}disconnectedCallback(){this.iframe&&(this.removeChild(this.iframe),this.iframe=null),window.hass=void 0,this._messageHandler&&(window.removeEventListener("message",this._messageHandler),this._messageHandler=void 0),this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=void 0)}}customElements.get("cafe-panel")||customElements.define("cafe-panel",m);
//# sourceMappingURL=panel-wrapper.js.map