mirror of
https://github.com/Matysh/houseplan-card
synced 2026-09-28 19:01:34 +00:00
fix: await draft deletion through the card facade (#405)
Issue: #405 User-Visible: no
This commit is contained in:
@@ -1,125 +1,125 @@
|
||||
{
|
||||
"schema": 1,
|
||||
"fingerprint": "b36c2306f25315638c0178090efd6865650040c5565d6ad92430103558fe37db",
|
||||
"fingerprint": "2195ace683267664d035370d92e860e463a0a745074964ec60eb91b9460fe406",
|
||||
"entry": "houseplan-card.js",
|
||||
"initialViewFiles": [
|
||||
"houseplan-assets/houseplan-card-Bi2pkTUe.js",
|
||||
"houseplan-assets/houseplan-card-DXakp5oa.js",
|
||||
"houseplan-card.js"
|
||||
],
|
||||
"initialViewGzipBytes": 287370,
|
||||
"initialViewGzipBytes": 287369,
|
||||
"lazyFiles": [
|
||||
"houseplan-assets/backdrop-pick-BPPgYv_-.js",
|
||||
"houseplan-assets/de-r_k_qwtG.js",
|
||||
"houseplan-assets/editor-9X7zagKL.js",
|
||||
"houseplan-assets/fr-iDaS4KiM.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-pL7NqSUJ.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-Bzt-dklc.js"
|
||||
"houseplan-assets/backdrop-pick-YVCyO6A0.js",
|
||||
"houseplan-assets/de-BEGoVhHu.js",
|
||||
"houseplan-assets/editor-b0lFtnKI.js",
|
||||
"houseplan-assets/fr-BDUBoPOz.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-Bf-E2NBt.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-MR4ITSR4.js"
|
||||
],
|
||||
"lazyGzipBytes": 199383,
|
||||
"lazyGzipBytes": 199380,
|
||||
"lazyEditorFiles": [
|
||||
"houseplan-assets/backdrop-pick-BPPgYv_-.js",
|
||||
"houseplan-assets/editor-9X7zagKL.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-pL7NqSUJ.js"
|
||||
"houseplan-assets/backdrop-pick-YVCyO6A0.js",
|
||||
"houseplan-assets/editor-b0lFtnKI.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-Bf-E2NBt.js"
|
||||
],
|
||||
"lazyEditorGzipBytes": 144689,
|
||||
"lazyEditorGzipBytes": 144690,
|
||||
"lazyOnboardingFiles": [
|
||||
"houseplan-assets/backdrop-pick-BPPgYv_-.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-Bzt-dklc.js"
|
||||
"houseplan-assets/backdrop-pick-YVCyO6A0.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-MR4ITSR4.js"
|
||||
],
|
||||
"lazyOnboardingGzipBytes": 14031,
|
||||
"lazyOnboardingGzipBytes": 14029,
|
||||
"lazyLocaleFiles": [
|
||||
"houseplan-assets/de-r_k_qwtG.js",
|
||||
"houseplan-assets/fr-iDaS4KiM.js"
|
||||
"houseplan-assets/de-BEGoVhHu.js",
|
||||
"houseplan-assets/fr-BDUBoPOz.js"
|
||||
],
|
||||
"lazyLocaleGzipBytes": 47735,
|
||||
"lazyLocaleGzipBytes": 47731,
|
||||
"files": [
|
||||
{
|
||||
"path": "houseplan-assets/backdrop-pick-BPPgYv_-.js",
|
||||
"sha256": "af775ad674123c0fe86c1f367fddab92f6c95cc1a3a455709c46bee48b143872",
|
||||
"path": "houseplan-assets/backdrop-pick-YVCyO6A0.js",
|
||||
"sha256": "7eb697cfff4e5c645e5dc870c020d321bdbcc12a7cbb5fb69ff0fd3eaf8a4827",
|
||||
"rawBytes": 20636,
|
||||
"gzipBytes": 7072,
|
||||
"gzipBytes": 7070,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-Bi2pkTUe.js"
|
||||
"houseplan-assets/houseplan-card-DXakp5oa.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/de-r_k_qwtG.js",
|
||||
"sha256": "3495a17186b5f746f7465999ae6892033644d26b730c076ed83a08b6d118f0e6",
|
||||
"path": "houseplan-assets/de-BEGoVhHu.js",
|
||||
"sha256": "1e681536e02fb02a2626b3f3d73903bd2ceacdcb7b4310f1ebdabb67e8ea7857",
|
||||
"rawBytes": 79660,
|
||||
"gzipBytes": 24118,
|
||||
"gzipBytes": 24116,
|
||||
"isEntry": false,
|
||||
"imports": [],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/editor-9X7zagKL.js",
|
||||
"sha256": "795170e9a06f0bf8928a32e04463f4e897a9ac1c39ca73d8203ce182539150b1",
|
||||
"path": "houseplan-assets/editor-b0lFtnKI.js",
|
||||
"sha256": "52920f458ae8514f4ab6651a33845aa1b88d3741323f470e0231d2c911ce34dd",
|
||||
"rawBytes": 3826,
|
||||
"gzipBytes": 1582,
|
||||
"gzipBytes": 1581,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-Bi2pkTUe.js"
|
||||
"houseplan-assets/houseplan-card-DXakp5oa.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/fr-iDaS4KiM.js",
|
||||
"sha256": "2984c303f30680207d7a069105eae0654d618dda3d57149e1d08fa783b0bf811",
|
||||
"path": "houseplan-assets/fr-BDUBoPOz.js",
|
||||
"sha256": "59f029c824f5836d699de2034813e9bfd481c837bae50a81de358ff86c042f3b",
|
||||
"rawBytes": 81807,
|
||||
"gzipBytes": 23617,
|
||||
"gzipBytes": 23615,
|
||||
"isEntry": false,
|
||||
"imports": [],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/houseplan-card-Bi2pkTUe.js",
|
||||
"sha256": "4eb22945e063cc1cb1ea3dc7c32fe2c34a8ef66a6896243ffdbe23d06d699115",
|
||||
"path": "houseplan-assets/houseplan-card-DXakp5oa.js",
|
||||
"sha256": "f7940dd06a85c23dd2d28fd498a7a6305da32111e871f784351f3e0f5d91794b",
|
||||
"rawBytes": 1017921,
|
||||
"gzipBytes": 286572,
|
||||
"isEntry": false,
|
||||
"imports": [],
|
||||
"dynamicImports": [
|
||||
"houseplan-assets/de-r_k_qwtG.js",
|
||||
"houseplan-assets/editor-9X7zagKL.js",
|
||||
"houseplan-assets/fr-iDaS4KiM.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-pL7NqSUJ.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-Bzt-dklc.js"
|
||||
"houseplan-assets/de-BEGoVhHu.js",
|
||||
"houseplan-assets/editor-b0lFtnKI.js",
|
||||
"houseplan-assets/fr-BDUBoPOz.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-Bf-E2NBt.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-MR4ITSR4.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/houseplan-editor-runtime-pL7NqSUJ.js",
|
||||
"sha256": "8dc46cb722e0d1703cde49ace8587d2871e8acff44a19108ab5a6e78ef9957ae",
|
||||
"rawBytes": 527184,
|
||||
"gzipBytes": 136035,
|
||||
"path": "houseplan-assets/houseplan-editor-runtime-Bf-E2NBt.js",
|
||||
"sha256": "378202552bee2c88535b64244cba36ec1f1de7f21676bf6d177b3ab1931d209c",
|
||||
"rawBytes": 527211,
|
||||
"gzipBytes": 136039,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/backdrop-pick-BPPgYv_-.js",
|
||||
"houseplan-assets/houseplan-card-Bi2pkTUe.js"
|
||||
"houseplan-assets/backdrop-pick-YVCyO6A0.js",
|
||||
"houseplan-assets/houseplan-card-DXakp5oa.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/houseplan-onboarding-runtime-Bzt-dklc.js",
|
||||
"sha256": "d0ee6193635d42fff228dd4e0bf52ceec5075351032524cb50920887a128128f",
|
||||
"path": "houseplan-assets/houseplan-onboarding-runtime-MR4ITSR4.js",
|
||||
"sha256": "b26c1bed651ebef10d36bd435119b3a0e194cc5419999ccfc4ecdff9299c260c",
|
||||
"rawBytes": 28088,
|
||||
"gzipBytes": 6959,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/backdrop-pick-BPPgYv_-.js",
|
||||
"houseplan-assets/houseplan-card-Bi2pkTUe.js"
|
||||
"houseplan-assets/backdrop-pick-YVCyO6A0.js",
|
||||
"houseplan-assets/houseplan-card-DXakp5oa.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-card.js",
|
||||
"sha256": "3ce2c954888ca57942b9b3f138da95f1fa5177d5c9965a89d07d179c26ab3300",
|
||||
"sha256": "9317a9b6fcb643f24931d79e55a7ed692828058ccb9c9b811559c3854962175e",
|
||||
"rawBytes": 1183,
|
||||
"gzipBytes": 798,
|
||||
"gzipBytes": 797,
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-Bi2pkTUe.js"
|
||||
"houseplan-assets/houseplan-card-DXakp5oa.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
}
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+5
-5
@@ -1,14 +1,14 @@
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="b36c2306f25315638c0178090efd6865650040c5565d6ad92430103558fe37db";import{b as e,l as o,t,d8 as s,A as a,d9 as i,da as l,db as n,E as r,c}from"./houseplan-card-Bi2pkTUe.js";class h extends e{constructor(){super(...arguments),this._spaces=null,this._spacesLoading=!1,this._spacesAuthoritative=!1}setConfig(e){this._config=e}async _loadSpaces(){if(!this._spaces&&!this._spacesLoading&&this.hass){this._spacesLoading=!0;try{const e=await this.hass.callWS({type:"houseplan/config/get"});this._spaces=(e?.config?.spaces||[]).map(e=>({value:e.id,label:e.title||e.id})),this._spacesAuthoritative=!0}catch{this._spaces=[],this._spacesAuthoritative=!1}finally{this._spacesLoading=!1}}}get _lang(){return o(this.hass,this._config?.language)}get _floorToken(){const e=this._config?.floor;return"number"==typeof e?`__houseplan_yaml_floor_index__:${String(e)}`:null}get _formData(){const e={...this._config},o=this._floorToken;return o?e.floor=o:Object.prototype.hasOwnProperty.call(e,"floor")||(e.floor=""),e}get _schema(){const e=this._spaces||[],o=this._lang,a=[{value:"",label:t(o,"editor.floor_none")}],i=this._floorToken;i&&a.push({value:i,label:t(o,"editor.floor_index",{index:String(this._config?.floor)})});const l="string"==typeof this._config?.floor?this._config.floor:"";l&&!e.some(e=>e.value===l)&&a.push({value:l,label:l}),a.push(...e);const n="string"==typeof this._config?.default_floor?this._config.default_floor:"",r=[...e];return n&&!e.some(e=>e.value===n)&&r.unshift({value:n,label:n}),[{name:"title",selector:{text:{}}},{name:"floor",selector:{select:{mode:"dropdown",options:a}}},e.length?{name:"default_floor",selector:{select:{mode:"dropdown",options:r}}}:{name:"default_floor",selector:{text:{}}},{name:"language",selector:{select:{mode:"dropdown",options:s(t(o,"editor.lang_auto"),this._config?.language)}}},{name:"icon_size",selector:{number:{min:1,max:6,step:.1,mode:"box"}}},{name:"show_temperature",selector:{boolean:{}}},{name:"live_states",selector:{boolean:{}}},{name:"show_signal",selector:{boolean:{}}},{name:"kiosk",selector:{boolean:{}}},{name:"cycle",selector:{number:{min:0,max:3600,step:5,mode:"box"}}}]}render(){if(!this.hass||!this._config)return a;const e=i(this,l,o(this.hass,this._config.language));if("cold"===e)return n();if("warm"===e)return r;this._loadSpaces();const s=this._lang,h={title:t(s,"editor.title"),floor:t(s,"editor.floor"),default_floor:t(s,"editor.default_floor"),language:t(s,"editor.language"),icon_size:t(s,"editor.icon_size"),show_temperature:t(s,"editor.show_temperature"),live_states:t(s,"editor.live_states"),show_signal:t(s,"editor.show_signal"),kiosk:t(s,"editor.kiosk"),cycle:t(s,"editor.cycle")},f=this._schema,_=function(e,o,t){if(!t||null===o)return null;const s="string"==typeof e?.default_floor?e.default_floor:"";return!s||o.some(e=>e.value===s)?null:s}(this._config,this._spaces,this._spacesAuthoritative),d=e=>c`<ha-form
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="2195ace683267664d035370d92e860e463a0a745074964ec60eb91b9460fe406";import{b as e,l as o,t,d8 as s,A as a,d9 as i,da as l,db as n,E as r,c}from"./houseplan-card-DXakp5oa.js";class h extends e{constructor(){super(...arguments),this._spaces=null,this._spacesLoading=!1,this._spacesAuthoritative=!1}setConfig(e){this._config=e}async _loadSpaces(){if(!this._spaces&&!this._spacesLoading&&this.hass){this._spacesLoading=!0;try{const e=await this.hass.callWS({type:"houseplan/config/get"});this._spaces=(e?.config?.spaces||[]).map(e=>({value:e.id,label:e.title||e.id})),this._spacesAuthoritative=!0}catch{this._spaces=[],this._spacesAuthoritative=!1}finally{this._spacesLoading=!1}}}get _lang(){return o(this.hass,this._config?.language)}get _floorToken(){const e=this._config?.floor;return"number"==typeof e?`__houseplan_yaml_floor_index__:${String(e)}`:null}get _formData(){const e={...this._config},o=this._floorToken;return o?e.floor=o:Object.prototype.hasOwnProperty.call(e,"floor")||(e.floor=""),e}get _schema(){const e=this._spaces||[],o=this._lang,a=[{value:"",label:t(o,"editor.floor_none")}],i=this._floorToken;i&&a.push({value:i,label:t(o,"editor.floor_index",{index:String(this._config?.floor)})});const l="string"==typeof this._config?.floor?this._config.floor:"";l&&!e.some(e=>e.value===l)&&a.push({value:l,label:l}),a.push(...e);const n="string"==typeof this._config?.default_floor?this._config.default_floor:"",r=[...e];return n&&!e.some(e=>e.value===n)&&r.unshift({value:n,label:n}),[{name:"title",selector:{text:{}}},{name:"floor",selector:{select:{mode:"dropdown",options:a}}},e.length?{name:"default_floor",selector:{select:{mode:"dropdown",options:r}}}:{name:"default_floor",selector:{text:{}}},{name:"language",selector:{select:{mode:"dropdown",options:s(t(o,"editor.lang_auto"),this._config?.language)}}},{name:"icon_size",selector:{number:{min:1,max:6,step:.1,mode:"box"}}},{name:"show_temperature",selector:{boolean:{}}},{name:"live_states",selector:{boolean:{}}},{name:"show_signal",selector:{boolean:{}}},{name:"kiosk",selector:{boolean:{}}},{name:"cycle",selector:{number:{min:0,max:3600,step:5,mode:"box"}}}]}render(){if(!this.hass||!this._config)return a;const e=i(this,l,o(this.hass,this._config.language));if("cold"===e)return n();if("warm"===e)return r;this._loadSpaces();const s=this._lang,h={title:t(s,"editor.title"),floor:t(s,"editor.floor"),default_floor:t(s,"editor.default_floor"),language:t(s,"editor.language"),icon_size:t(s,"editor.icon_size"),show_temperature:t(s,"editor.show_temperature"),live_states:t(s,"editor.live_states"),show_signal:t(s,"editor.show_signal"),kiosk:t(s,"editor.kiosk"),cycle:t(s,"editor.cycle")},_=this._schema,f=function(e,o,t){if(!t||null===o)return null;const s="string"==typeof e?.default_floor?e.default_floor:"";return!s||o.some(e=>e.value===s)?null:s}(this._config,this._spaces,this._spacesAuthoritative),d=e=>c`<ha-form
|
||||
.hass=${this.hass}
|
||||
.data=${this._formData}
|
||||
.schema=${e}
|
||||
.computeLabel=${e=>h[e.name]||e.name}
|
||||
@value-changed=${this._valueChanged}
|
||||
></ha-form>`;return c`
|
||||
${d(f.slice(0,3))}
|
||||
${_?c`<div class="default-floor-error" role="alert"
|
||||
${d(_.slice(0,3))}
|
||||
${f?c`<div class="default-floor-error" role="alert"
|
||||
style="color:var(--error-color,#db4437);margin:-4px 0 12px;overflow-wrap:anywhere">
|
||||
${t(s,"editor.default_floor_missing",{id:_})}
|
||||
${t(s,"editor.default_floor_missing",{id:f})}
|
||||
</div>`:a}
|
||||
${d(f.slice(3))}
|
||||
${d(_.slice(3))}
|
||||
`}_valueChanged(e){const o={...this._config,...e.detail.value};""===o.floor?delete o.floor:o.floor===this._floorToken&&(o.floor=this._config?.floor);const t=new Event("config-changed",{bubbles:!0,composed:!0});t.detail={config:o},this.dispatchEvent(t)}}h.properties={hass:{attribute:!1},_config:{state:!0},_spaces:{state:!0}},customElements.get("houseplan-card-editor")||customElements.define("houseplan-card-editor",h);
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+3
-3
File diff suppressed because one or more lines are too long
+4
-4
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,4 +1,4 @@
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="b36c2306f25315638c0178090efd6865650040c5565d6ad92430103558fe37db";import{l as t,ar as s,A as e,t as o,c as a,bW as l,bX as i,bY as h,bZ as c,ao as n,b_ as r,c3 as p,b$ as _,c0 as d,c1 as u,c2 as g,cY as m,an as b,ap as $,cZ as v}from"./houseplan-card-Bi2pkTUe.js";import{i as f,c as y,e as w,r as D,a as k,b as S,s as C,t as M}from"./backdrop-pick-BPPgYv_-.js";const F=1e3,x=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},T="b36c2306f25315638c0178090efd6865650040c5565d6ad92430103558fe37db";class L{constructor(t){this.host=t,this._toggleServerPlans=async()=>{const t=this.host._spaceDialog;if(t)if(t.pickSaved)this.host._spaceDialog={...t,pickSaved:!1};else{this.host._spaceDialog={...t,pickSaved:!0,savedBusy:!0};try{const t=await this.host.hass.callWS({type:"houseplan/plans/list"}),s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:t?.plans||[],savedBusy:!1})}catch(t){const s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:[],savedBusy:!1}),this.host._showToast(this.host._t("toast.plans_list_failed",{err:this.host._errText(t)}))}}}}_help(l){const i=`${l}.aria`,h=t(this.host.hass,this.host._config?.language);return s(h,l)&&s(h,i)?a`<hp-help data-help-key=${l}
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="2195ace683267664d035370d92e860e463a0a745074964ec60eb91b9460fe406";import{l as t,ar as s,A as e,t as o,c as a,bW as l,bX as i,bY as h,bZ as c,ao as n,b_ as r,c3 as p,b$ as _,c0 as d,c1 as u,c2 as g,cY as m,an as b,ap as $,cZ as v}from"./houseplan-card-DXakp5oa.js";import{i as f,c as y,e as w,r as D,a as k,b as S,s as C,t as M}from"./backdrop-pick-YVCyO6A0.js";const F=1e3,x=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},T="2195ace683267664d035370d92e860e463a0a745074964ec60eb91b9460fe406";class L{constructor(t){this.host=t,this._toggleServerPlans=async()=>{const t=this.host._spaceDialog;if(t)if(t.pickSaved)this.host._spaceDialog={...t,pickSaved:!1};else{this.host._spaceDialog={...t,pickSaved:!0,savedBusy:!0};try{const t=await this.host.hass.callWS({type:"houseplan/plans/list"}),s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:t?.plans||[],savedBusy:!1})}catch(t){const s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:[],savedBusy:!1}),this.host._showToast(this.host._t("toast.plans_list_failed",{err:this.host._errText(t)}))}}}}_help(l){const i=`${l}.aria`,h=t(this.host.hass,this.host._config?.language);return s(h,l)&&s(h,i)?a`<hp-help data-help-key=${l}
|
||||
.text=${o(h,l)} .ariaLabel=${o(h,i)}></hp-help>`:e}_openSpaceDialog(t,s){if(!this.host._serverStorage||!this.host._serverCfg)return void this.host._showToast(this.host._t("toast.integration_missing"));if("edit"===t){const e=this.host._serverCfg.spaces.find(t=>t.id===s);if(!e)return;const o=l(e),a=e.settings?.custom_fill&&"object"==typeof e.settings.custom_fill?i(e.settings.custom_fill):null,p="none"===o.fill?{...a||h,a:0}:a;return void(this.host._spaceDialog={mode:t,spaceId:s,title:e.title,planUrl:e.plan_url||null,planFile:null,source:e.plan_url?"file":"draw",showBorders:o.showBorders,showNames:o.showNames,zeroWallStyle:r(e),displayTouched:!0,hideDecor:o.hideDecor,hideOpenings:o.hideOpenings,roomColor:o.color,roomOpacity:o.opacity,fillMode:"none"===o.fill?"custom":o.fill,customFill:p,glowEnabled:o.glow,bgColor:o.bgColor,bgMode:"static"===e.settings?.bg_mode||"daynight"===e.settings?.bg_mode?e.settings.bg_mode:null,northDeg:n({},e.settings),sunRays:"boolean"==typeof e.settings?.sun_rays?e.settings.sun_rays:null,tempMin:o.tempMin,tempMax:o.tempMax,showLqi:o.showLqi??this.host._config?.show_signal??!0,cardFontScale:o.cardFontScale,labelTemp:o.labelTemp,labelHum:o.labelHum,labelLqi:o.labelLqi,labelLight:o.labelLight,cellCm:Number(e.cell_cm)>0?Number(e.cell_cm):5,cellCmInput:c(Number(e.cell_cm)>0?Number(e.cell_cm):5,this.host._imperial),cellCmTouched:!1,busy:!1})}const e=p(this.host._imperial);this.host._spaceDialog={mode:t,title:"",planUrl:null,planFile:null,...f(),hideDecor:!1,hideOpenings:!1,zeroWallStyle:"dashed",roomColor:g,roomOpacity:u,fillMode:"custom",customFill:{...h,a:0},glowEnabled:!0,bgColor:null,bgMode:"daynight",northDeg:null,sunRays:null,tempMin:d,tempMax:_,showLqi:this.host._config?.show_signal??!0,cardFontScale:1,labelTemp:!1,labelHum:!1,labelLqi:!1,labelLight:!1,cellCm:e,cellCmInput:c(e,this.host._imperial),cellCmTouched:!1,busy:!1}}async _pickPlanFile(t){const s=t.target,e=s.files?.[0];if(!e||!this.host._spaceDialog)return;s.value="";const o=await y(e);if("reject"===o.kind)return void this.host._showToast(this.host._t("toast.plan_formats"));if("guard"===o.kind)return void(this.host._backdropGuard=o.state);const a=await w(e,o.ext,e.name);this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:a})}_renderBackdropGuard(){return D(this.host,t=>{this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:t})},()=>{this.host._backdropGuard=null},this.host.hass)??e}_useServerPlan(t){const s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,planUrl:t,planFile:null,pickSaved:!1,savedAspect:void 0},this.host._aspectJob=this._readPlanAspect(t))}async _readPlanAspect(t){for(let s=0;s<40;s++){const s=this.host._display(t);if(s){const e=await new Promise(t=>{const e=new Image;e.onload=()=>t(e.naturalWidth&&e.naturalHeight?e.naturalWidth/e.naturalHeight:0),e.onerror=()=>t(0),e.src=s}),o=this.host._spaceDialog;return o&&o.planUrl===t&&Number.isFinite(e)&&e>0?(this.host._spaceDialog={...o,savedAspect:e},e):0}if(await new Promise(t=>setTimeout(t,150)),this.host._spaceDialog?.planUrl!==t)return 0}return 0}async _deleteServerPlan(t){const s=this.host._spaceDialog,e=s?.saved?.find(s=>s.name===t);if(!s||!e||e.used_by.length||e.url===s.planUrl)return;const o=await this.host._confirmDanger({key:"delete-plan",kind:"destructive",title:this.host._t("confirm.delete_plan_title"),message:this.host._t("confirm.delete_plan_body"),objectName:t,confirmLabel:this.host._t("btn.delete"),cancelLabel:this.host._t("btn.cancel")}),a=this.host._spaceDialog,l=a?.saved?.find(s=>s.name===t);if(o&&a&&l&&l.url===e.url&&l.modified===e.modified&&!l.used_by.length&&l.url!==a.planUrl)try{await this.host.hass.callWS({type:"houseplan/plans/delete",name:t});const s=this.host._spaceDialog;s?.saved&&(this.host._spaceDialog={...s,saved:s.saved.filter(s=>s.name!==t)})}catch(t){this.host._showToast(this.host._t("toast.plan_delete_failed",{err:this.host._errText(t)}))}}_renderServerPlans(t){if(t.savedBusy)return a`<div class="savedplans muted">${this.host._t("space.loading")}</div>`;const s=t.saved||[];if(!s.length)return a`<div class="savedplans muted">${this.host._t("space.no_saved")}</div>`;return a`<div class="savedplans">
|
||||
${s.map(s=>{return a`
|
||||
<div class="savedplan ${s.url===t.planUrl?"cur":""}">
|
||||
@@ -1 +1 @@
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="b36c2306f25315638c0178090efd6865650040c5565d6ad92430103558fe37db";try{await import("./houseplan-assets/houseplan-card-Bi2pkTUe.js")}catch(e){if(!customElements.get("houseplan-card")){const l=String(navigator.language||"en").toLowerCase();const m=l.startsWith("ru")?"House Plan обновился — перезагрузите страницу (Ctrl+F5).":l.startsWith("de")?"House Plan wurde aktualisiert — bitte laden Sie die Seite neu (Strg+F5).":l.startsWith("fr")?"House Plan a été mis à jour — veuillez recharger la page (Ctrl+F5).":"House Plan was updated — please reload the page (Ctrl+F5).";customElements.define("houseplan-card",class extends HTMLElement{setConfig(){}getCardSize(){return 1}connectedCallback(){this.style.cssText="display:block;box-sizing:border-box;padding:16px;border:1px solid var(--divider-color,#e0e0e0);border-radius:var(--ha-card-border-radius,12px);background:var(--card-background-color,#fff);color:var(--primary-text-color,#212121);font:14px/1.4 var(--paper-font-body1_-_font-family,sans-serif)";this.textContent=m}})}console.error("[houseplan] stale entry: the main chunk is unavailable",e)}
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="2195ace683267664d035370d92e860e463a0a745074964ec60eb91b9460fe406";try{await import("./houseplan-assets/houseplan-card-DXakp5oa.js")}catch(e){if(!customElements.get("houseplan-card")){const l=String(navigator.language||"en").toLowerCase();const m=l.startsWith("ru")?"House Plan обновился — перезагрузите страницу (Ctrl+F5).":l.startsWith("de")?"House Plan wurde aktualisiert — bitte laden Sie die Seite neu (Strg+F5).":l.startsWith("fr")?"House Plan a été mis à jour — veuillez recharger la page (Ctrl+F5).":"House Plan was updated — please reload the page (Ctrl+F5).";customElements.define("houseplan-card",class extends HTMLElement{setConfig(){}getCardSize(){return 1}connectedCallback(){this.style.cssText="display:block;box-sizing:border-box;padding:16px;border:1px solid var(--divider-color,#e0e0e0);border-radius:var(--ha-card-border-radius,12px);background:var(--card-background-color,#fff);color:var(--primary-text-color,#212121);font:14px/1.4 var(--paper-font-body1_-_font-family,sans-serif)";this.textContent=m}})}console.error("[houseplan] stale entry: the main chunk is unavailable",e)}
|
||||
|
||||
@@ -13,7 +13,10 @@ const out = await page.evaluate(async () => {
|
||||
// The product owns dangerous confirmations through hp-confirm now. This
|
||||
// smoke covers geometry transactions, while smoke_danger_confirmation
|
||||
// exercises the real dialog; keep the decision deterministic here.
|
||||
c._confirmDanger = async () => true;
|
||||
let confirmDecision = true;
|
||||
c._confirmDanger = () => new Promise((resolve) => {
|
||||
setTimeout(() => resolve(confirmDecision), 0);
|
||||
});
|
||||
// Exercise hp-dialog's HA branch without depending on the Home Assistant
|
||||
// frontend in the standalone demo. The fixed one-line fallback below
|
||||
// reproduces ha-dialog-header's public custom-property contract: Houseplan
|
||||
@@ -190,15 +193,55 @@ const out = await page.evaluate(async () => {
|
||||
c._physicalDialog = null;
|
||||
await c.updateComplete;
|
||||
|
||||
c._physicalSel = { kind: 'partition', id: sp.partitions[0].id };
|
||||
await c._deletePhysicalSelection();
|
||||
const partitionId = sp.partitions[0].id;
|
||||
sp.openings = [{
|
||||
id: 'hosted-opening', type: 'door', width_cm: 90,
|
||||
host: { kind: 'partition', id: partitionId, t: 0.5 },
|
||||
}];
|
||||
c._physicalSel = { kind: 'partition', id: partitionId };
|
||||
const hostedDelete = c._deletePhysicalSelection();
|
||||
o.hostedPartitionDeleteReturnsPromise = typeof hostedDelete?.then === 'function';
|
||||
await hostedDelete;
|
||||
o.hostedPartitionWaitsForDecision = !!c._partitionDeleteDialog
|
||||
&& c._serverCfg.spaces[0].partitions?.some((partition) => partition.id === partitionId);
|
||||
c._partitionDeleteDialog = null;
|
||||
delete sp.openings;
|
||||
|
||||
c._physicalSel = { kind: 'partition', id: partitionId };
|
||||
const partitionDelete = c._deletePhysicalSelection();
|
||||
o.partitionDeleteReturnsPromise = typeof partitionDelete?.then === 'function';
|
||||
await partitionDelete;
|
||||
o.deleteRemovesPartition = !c._serverCfg.spaces[0].partitions;
|
||||
|
||||
const draftId = c._serverCfg.spaces[0].room_drafts[0].id;
|
||||
const historyBeforeCancel = c._geometryHistory.size;
|
||||
confirmDecision = false;
|
||||
c._physicalSel = { kind: 'draft', id: draftId, segment: 0 };
|
||||
await c._deletePhysicalSelection();
|
||||
const cancelledDelete = c._deletePhysicalSelection();
|
||||
o.cancelledDraftDeleteReturnsPromise = typeof cancelledDelete?.then === 'function';
|
||||
await cancelledDelete;
|
||||
o.cancelledDraftDeleteKeepsOutlineAndHistory = c._serverCfg.spaces[0].room_drafts?.[0]?.id === draftId
|
||||
&& c._geometryHistory.size === historyBeforeCancel;
|
||||
|
||||
confirmDecision = true;
|
||||
c._physicalSel = { kind: 'draft', id: draftId, segment: 0 };
|
||||
const draftDelete = c._deletePhysicalSelection();
|
||||
o.draftDeleteReturnsPromise = typeof draftDelete?.then === 'function';
|
||||
await draftDelete;
|
||||
o.deleteOnDraftRemovesWholeOutline = !c._serverCfg.spaces[0].room_drafts;
|
||||
|
||||
const columnId = c._serverCfg.spaces[0].wall_columns[0].id;
|
||||
c._physicalSel = { kind: 'column', id: columnId };
|
||||
const columnDelete = c._deletePhysicalSelection();
|
||||
o.columnDeleteReturnsPromise = typeof columnDelete?.then === 'function';
|
||||
await columnDelete;
|
||||
o.deleteRemovesColumn = !c._serverCfg.spaces[0].wall_columns;
|
||||
|
||||
c._physicalSel = null;
|
||||
const emptyDelete = c._deletePhysicalSelection();
|
||||
o.emptyDeleteReturnsPromise = typeof emptyDelete?.then === 'function';
|
||||
await emptyDelete;
|
||||
|
||||
drawAndFinish([400, 100], [500, 100], 120);
|
||||
o.invalidThicknessCreatesNothing = !c._serverCfg.spaces[0].partitions;
|
||||
|
||||
|
||||
Vendored
+54
-54
@@ -1,125 +1,125 @@
|
||||
{
|
||||
"schema": 1,
|
||||
"fingerprint": "b36c2306f25315638c0178090efd6865650040c5565d6ad92430103558fe37db",
|
||||
"fingerprint": "2195ace683267664d035370d92e860e463a0a745074964ec60eb91b9460fe406",
|
||||
"entry": "houseplan-card.js",
|
||||
"initialViewFiles": [
|
||||
"houseplan-assets/houseplan-card-Bi2pkTUe.js",
|
||||
"houseplan-assets/houseplan-card-DXakp5oa.js",
|
||||
"houseplan-card.js"
|
||||
],
|
||||
"initialViewGzipBytes": 287370,
|
||||
"initialViewGzipBytes": 287369,
|
||||
"lazyFiles": [
|
||||
"houseplan-assets/backdrop-pick-BPPgYv_-.js",
|
||||
"houseplan-assets/de-r_k_qwtG.js",
|
||||
"houseplan-assets/editor-9X7zagKL.js",
|
||||
"houseplan-assets/fr-iDaS4KiM.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-pL7NqSUJ.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-Bzt-dklc.js"
|
||||
"houseplan-assets/backdrop-pick-YVCyO6A0.js",
|
||||
"houseplan-assets/de-BEGoVhHu.js",
|
||||
"houseplan-assets/editor-b0lFtnKI.js",
|
||||
"houseplan-assets/fr-BDUBoPOz.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-Bf-E2NBt.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-MR4ITSR4.js"
|
||||
],
|
||||
"lazyGzipBytes": 199383,
|
||||
"lazyGzipBytes": 199380,
|
||||
"lazyEditorFiles": [
|
||||
"houseplan-assets/backdrop-pick-BPPgYv_-.js",
|
||||
"houseplan-assets/editor-9X7zagKL.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-pL7NqSUJ.js"
|
||||
"houseplan-assets/backdrop-pick-YVCyO6A0.js",
|
||||
"houseplan-assets/editor-b0lFtnKI.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-Bf-E2NBt.js"
|
||||
],
|
||||
"lazyEditorGzipBytes": 144689,
|
||||
"lazyEditorGzipBytes": 144690,
|
||||
"lazyOnboardingFiles": [
|
||||
"houseplan-assets/backdrop-pick-BPPgYv_-.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-Bzt-dklc.js"
|
||||
"houseplan-assets/backdrop-pick-YVCyO6A0.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-MR4ITSR4.js"
|
||||
],
|
||||
"lazyOnboardingGzipBytes": 14031,
|
||||
"lazyOnboardingGzipBytes": 14029,
|
||||
"lazyLocaleFiles": [
|
||||
"houseplan-assets/de-r_k_qwtG.js",
|
||||
"houseplan-assets/fr-iDaS4KiM.js"
|
||||
"houseplan-assets/de-BEGoVhHu.js",
|
||||
"houseplan-assets/fr-BDUBoPOz.js"
|
||||
],
|
||||
"lazyLocaleGzipBytes": 47735,
|
||||
"lazyLocaleGzipBytes": 47731,
|
||||
"files": [
|
||||
{
|
||||
"path": "houseplan-assets/backdrop-pick-BPPgYv_-.js",
|
||||
"sha256": "af775ad674123c0fe86c1f367fddab92f6c95cc1a3a455709c46bee48b143872",
|
||||
"path": "houseplan-assets/backdrop-pick-YVCyO6A0.js",
|
||||
"sha256": "7eb697cfff4e5c645e5dc870c020d321bdbcc12a7cbb5fb69ff0fd3eaf8a4827",
|
||||
"rawBytes": 20636,
|
||||
"gzipBytes": 7072,
|
||||
"gzipBytes": 7070,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-Bi2pkTUe.js"
|
||||
"houseplan-assets/houseplan-card-DXakp5oa.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/de-r_k_qwtG.js",
|
||||
"sha256": "3495a17186b5f746f7465999ae6892033644d26b730c076ed83a08b6d118f0e6",
|
||||
"path": "houseplan-assets/de-BEGoVhHu.js",
|
||||
"sha256": "1e681536e02fb02a2626b3f3d73903bd2ceacdcb7b4310f1ebdabb67e8ea7857",
|
||||
"rawBytes": 79660,
|
||||
"gzipBytes": 24118,
|
||||
"gzipBytes": 24116,
|
||||
"isEntry": false,
|
||||
"imports": [],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/editor-9X7zagKL.js",
|
||||
"sha256": "795170e9a06f0bf8928a32e04463f4e897a9ac1c39ca73d8203ce182539150b1",
|
||||
"path": "houseplan-assets/editor-b0lFtnKI.js",
|
||||
"sha256": "52920f458ae8514f4ab6651a33845aa1b88d3741323f470e0231d2c911ce34dd",
|
||||
"rawBytes": 3826,
|
||||
"gzipBytes": 1582,
|
||||
"gzipBytes": 1581,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-Bi2pkTUe.js"
|
||||
"houseplan-assets/houseplan-card-DXakp5oa.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/fr-iDaS4KiM.js",
|
||||
"sha256": "2984c303f30680207d7a069105eae0654d618dda3d57149e1d08fa783b0bf811",
|
||||
"path": "houseplan-assets/fr-BDUBoPOz.js",
|
||||
"sha256": "59f029c824f5836d699de2034813e9bfd481c837bae50a81de358ff86c042f3b",
|
||||
"rawBytes": 81807,
|
||||
"gzipBytes": 23617,
|
||||
"gzipBytes": 23615,
|
||||
"isEntry": false,
|
||||
"imports": [],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/houseplan-card-Bi2pkTUe.js",
|
||||
"sha256": "4eb22945e063cc1cb1ea3dc7c32fe2c34a8ef66a6896243ffdbe23d06d699115",
|
||||
"path": "houseplan-assets/houseplan-card-DXakp5oa.js",
|
||||
"sha256": "f7940dd06a85c23dd2d28fd498a7a6305da32111e871f784351f3e0f5d91794b",
|
||||
"rawBytes": 1017921,
|
||||
"gzipBytes": 286572,
|
||||
"isEntry": false,
|
||||
"imports": [],
|
||||
"dynamicImports": [
|
||||
"houseplan-assets/de-r_k_qwtG.js",
|
||||
"houseplan-assets/editor-9X7zagKL.js",
|
||||
"houseplan-assets/fr-iDaS4KiM.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-pL7NqSUJ.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-Bzt-dklc.js"
|
||||
"houseplan-assets/de-BEGoVhHu.js",
|
||||
"houseplan-assets/editor-b0lFtnKI.js",
|
||||
"houseplan-assets/fr-BDUBoPOz.js",
|
||||
"houseplan-assets/houseplan-editor-runtime-Bf-E2NBt.js",
|
||||
"houseplan-assets/houseplan-onboarding-runtime-MR4ITSR4.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/houseplan-editor-runtime-pL7NqSUJ.js",
|
||||
"sha256": "8dc46cb722e0d1703cde49ace8587d2871e8acff44a19108ab5a6e78ef9957ae",
|
||||
"rawBytes": 527184,
|
||||
"gzipBytes": 136035,
|
||||
"path": "houseplan-assets/houseplan-editor-runtime-Bf-E2NBt.js",
|
||||
"sha256": "378202552bee2c88535b64244cba36ec1f1de7f21676bf6d177b3ab1931d209c",
|
||||
"rawBytes": 527211,
|
||||
"gzipBytes": 136039,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/backdrop-pick-BPPgYv_-.js",
|
||||
"houseplan-assets/houseplan-card-Bi2pkTUe.js"
|
||||
"houseplan-assets/backdrop-pick-YVCyO6A0.js",
|
||||
"houseplan-assets/houseplan-card-DXakp5oa.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-assets/houseplan-onboarding-runtime-Bzt-dklc.js",
|
||||
"sha256": "d0ee6193635d42fff228dd4e0bf52ceec5075351032524cb50920887a128128f",
|
||||
"path": "houseplan-assets/houseplan-onboarding-runtime-MR4ITSR4.js",
|
||||
"sha256": "b26c1bed651ebef10d36bd435119b3a0e194cc5419999ccfc4ecdff9299c260c",
|
||||
"rawBytes": 28088,
|
||||
"gzipBytes": 6959,
|
||||
"isEntry": false,
|
||||
"imports": [
|
||||
"houseplan-assets/backdrop-pick-BPPgYv_-.js",
|
||||
"houseplan-assets/houseplan-card-Bi2pkTUe.js"
|
||||
"houseplan-assets/backdrop-pick-YVCyO6A0.js",
|
||||
"houseplan-assets/houseplan-card-DXakp5oa.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
},
|
||||
{
|
||||
"path": "houseplan-card.js",
|
||||
"sha256": "3ce2c954888ca57942b9b3f138da95f1fa5177d5c9965a89d07d179c26ab3300",
|
||||
"sha256": "9317a9b6fcb643f24931d79e55a7ed692828058ccb9c9b811559c3854962175e",
|
||||
"rawBytes": 1183,
|
||||
"gzipBytes": 798,
|
||||
"gzipBytes": 797,
|
||||
"isEntry": true,
|
||||
"imports": [
|
||||
"houseplan-assets/houseplan-card-Bi2pkTUe.js"
|
||||
"houseplan-assets/houseplan-card-DXakp5oa.js"
|
||||
],
|
||||
"dynamicImports": []
|
||||
}
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+5
-5
@@ -1,14 +1,14 @@
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="b36c2306f25315638c0178090efd6865650040c5565d6ad92430103558fe37db";import{b as e,l as o,t,d8 as s,A as a,d9 as i,da as l,db as n,E as r,c}from"./houseplan-card-Bi2pkTUe.js";class h extends e{constructor(){super(...arguments),this._spaces=null,this._spacesLoading=!1,this._spacesAuthoritative=!1}setConfig(e){this._config=e}async _loadSpaces(){if(!this._spaces&&!this._spacesLoading&&this.hass){this._spacesLoading=!0;try{const e=await this.hass.callWS({type:"houseplan/config/get"});this._spaces=(e?.config?.spaces||[]).map(e=>({value:e.id,label:e.title||e.id})),this._spacesAuthoritative=!0}catch{this._spaces=[],this._spacesAuthoritative=!1}finally{this._spacesLoading=!1}}}get _lang(){return o(this.hass,this._config?.language)}get _floorToken(){const e=this._config?.floor;return"number"==typeof e?`__houseplan_yaml_floor_index__:${String(e)}`:null}get _formData(){const e={...this._config},o=this._floorToken;return o?e.floor=o:Object.prototype.hasOwnProperty.call(e,"floor")||(e.floor=""),e}get _schema(){const e=this._spaces||[],o=this._lang,a=[{value:"",label:t(o,"editor.floor_none")}],i=this._floorToken;i&&a.push({value:i,label:t(o,"editor.floor_index",{index:String(this._config?.floor)})});const l="string"==typeof this._config?.floor?this._config.floor:"";l&&!e.some(e=>e.value===l)&&a.push({value:l,label:l}),a.push(...e);const n="string"==typeof this._config?.default_floor?this._config.default_floor:"",r=[...e];return n&&!e.some(e=>e.value===n)&&r.unshift({value:n,label:n}),[{name:"title",selector:{text:{}}},{name:"floor",selector:{select:{mode:"dropdown",options:a}}},e.length?{name:"default_floor",selector:{select:{mode:"dropdown",options:r}}}:{name:"default_floor",selector:{text:{}}},{name:"language",selector:{select:{mode:"dropdown",options:s(t(o,"editor.lang_auto"),this._config?.language)}}},{name:"icon_size",selector:{number:{min:1,max:6,step:.1,mode:"box"}}},{name:"show_temperature",selector:{boolean:{}}},{name:"live_states",selector:{boolean:{}}},{name:"show_signal",selector:{boolean:{}}},{name:"kiosk",selector:{boolean:{}}},{name:"cycle",selector:{number:{min:0,max:3600,step:5,mode:"box"}}}]}render(){if(!this.hass||!this._config)return a;const e=i(this,l,o(this.hass,this._config.language));if("cold"===e)return n();if("warm"===e)return r;this._loadSpaces();const s=this._lang,h={title:t(s,"editor.title"),floor:t(s,"editor.floor"),default_floor:t(s,"editor.default_floor"),language:t(s,"editor.language"),icon_size:t(s,"editor.icon_size"),show_temperature:t(s,"editor.show_temperature"),live_states:t(s,"editor.live_states"),show_signal:t(s,"editor.show_signal"),kiosk:t(s,"editor.kiosk"),cycle:t(s,"editor.cycle")},f=this._schema,_=function(e,o,t){if(!t||null===o)return null;const s="string"==typeof e?.default_floor?e.default_floor:"";return!s||o.some(e=>e.value===s)?null:s}(this._config,this._spaces,this._spacesAuthoritative),d=e=>c`<ha-form
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="2195ace683267664d035370d92e860e463a0a745074964ec60eb91b9460fe406";import{b as e,l as o,t,d8 as s,A as a,d9 as i,da as l,db as n,E as r,c}from"./houseplan-card-DXakp5oa.js";class h extends e{constructor(){super(...arguments),this._spaces=null,this._spacesLoading=!1,this._spacesAuthoritative=!1}setConfig(e){this._config=e}async _loadSpaces(){if(!this._spaces&&!this._spacesLoading&&this.hass){this._spacesLoading=!0;try{const e=await this.hass.callWS({type:"houseplan/config/get"});this._spaces=(e?.config?.spaces||[]).map(e=>({value:e.id,label:e.title||e.id})),this._spacesAuthoritative=!0}catch{this._spaces=[],this._spacesAuthoritative=!1}finally{this._spacesLoading=!1}}}get _lang(){return o(this.hass,this._config?.language)}get _floorToken(){const e=this._config?.floor;return"number"==typeof e?`__houseplan_yaml_floor_index__:${String(e)}`:null}get _formData(){const e={...this._config},o=this._floorToken;return o?e.floor=o:Object.prototype.hasOwnProperty.call(e,"floor")||(e.floor=""),e}get _schema(){const e=this._spaces||[],o=this._lang,a=[{value:"",label:t(o,"editor.floor_none")}],i=this._floorToken;i&&a.push({value:i,label:t(o,"editor.floor_index",{index:String(this._config?.floor)})});const l="string"==typeof this._config?.floor?this._config.floor:"";l&&!e.some(e=>e.value===l)&&a.push({value:l,label:l}),a.push(...e);const n="string"==typeof this._config?.default_floor?this._config.default_floor:"",r=[...e];return n&&!e.some(e=>e.value===n)&&r.unshift({value:n,label:n}),[{name:"title",selector:{text:{}}},{name:"floor",selector:{select:{mode:"dropdown",options:a}}},e.length?{name:"default_floor",selector:{select:{mode:"dropdown",options:r}}}:{name:"default_floor",selector:{text:{}}},{name:"language",selector:{select:{mode:"dropdown",options:s(t(o,"editor.lang_auto"),this._config?.language)}}},{name:"icon_size",selector:{number:{min:1,max:6,step:.1,mode:"box"}}},{name:"show_temperature",selector:{boolean:{}}},{name:"live_states",selector:{boolean:{}}},{name:"show_signal",selector:{boolean:{}}},{name:"kiosk",selector:{boolean:{}}},{name:"cycle",selector:{number:{min:0,max:3600,step:5,mode:"box"}}}]}render(){if(!this.hass||!this._config)return a;const e=i(this,l,o(this.hass,this._config.language));if("cold"===e)return n();if("warm"===e)return r;this._loadSpaces();const s=this._lang,h={title:t(s,"editor.title"),floor:t(s,"editor.floor"),default_floor:t(s,"editor.default_floor"),language:t(s,"editor.language"),icon_size:t(s,"editor.icon_size"),show_temperature:t(s,"editor.show_temperature"),live_states:t(s,"editor.live_states"),show_signal:t(s,"editor.show_signal"),kiosk:t(s,"editor.kiosk"),cycle:t(s,"editor.cycle")},_=this._schema,f=function(e,o,t){if(!t||null===o)return null;const s="string"==typeof e?.default_floor?e.default_floor:"";return!s||o.some(e=>e.value===s)?null:s}(this._config,this._spaces,this._spacesAuthoritative),d=e=>c`<ha-form
|
||||
.hass=${this.hass}
|
||||
.data=${this._formData}
|
||||
.schema=${e}
|
||||
.computeLabel=${e=>h[e.name]||e.name}
|
||||
@value-changed=${this._valueChanged}
|
||||
></ha-form>`;return c`
|
||||
${d(f.slice(0,3))}
|
||||
${_?c`<div class="default-floor-error" role="alert"
|
||||
${d(_.slice(0,3))}
|
||||
${f?c`<div class="default-floor-error" role="alert"
|
||||
style="color:var(--error-color,#db4437);margin:-4px 0 12px;overflow-wrap:anywhere">
|
||||
${t(s,"editor.default_floor_missing",{id:_})}
|
||||
${t(s,"editor.default_floor_missing",{id:f})}
|
||||
</div>`:a}
|
||||
${d(f.slice(3))}
|
||||
${d(_.slice(3))}
|
||||
`}_valueChanged(e){const o={...this._config,...e.detail.value};""===o.floor?delete o.floor:o.floor===this._floorToken&&(o.floor=this._config?.floor);const t=new Event("config-changed",{bubbles:!0,composed:!0});t.detail={config:o},this.dispatchEvent(t)}}h.properties={hass:{attribute:!1},_config:{state:!0},_spaces:{state:!0}},customElements.get("houseplan-card-editor")||customElements.define("houseplan-card-editor",h);
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+3
-3
File diff suppressed because one or more lines are too long
+4
-4
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,4 +1,4 @@
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="b36c2306f25315638c0178090efd6865650040c5565d6ad92430103558fe37db";import{l as t,ar as s,A as e,t as o,c as a,bW as l,bX as i,bY as h,bZ as c,ao as n,b_ as r,c3 as p,b$ as _,c0 as d,c1 as u,c2 as g,cY as m,an as b,ap as $,cZ as v}from"./houseplan-card-Bi2pkTUe.js";import{i as f,c as y,e as w,r as D,a as k,b as S,s as C,t as M}from"./backdrop-pick-BPPgYv_-.js";const F=1e3,x=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},T="b36c2306f25315638c0178090efd6865650040c5565d6ad92430103558fe37db";class L{constructor(t){this.host=t,this._toggleServerPlans=async()=>{const t=this.host._spaceDialog;if(t)if(t.pickSaved)this.host._spaceDialog={...t,pickSaved:!1};else{this.host._spaceDialog={...t,pickSaved:!0,savedBusy:!0};try{const t=await this.host.hass.callWS({type:"houseplan/plans/list"}),s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:t?.plans||[],savedBusy:!1})}catch(t){const s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:[],savedBusy:!1}),this.host._showToast(this.host._t("toast.plans_list_failed",{err:this.host._errText(t)}))}}}}_help(l){const i=`${l}.aria`,h=t(this.host.hass,this.host._config?.language);return s(h,l)&&s(h,i)?a`<hp-help data-help-key=${l}
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="2195ace683267664d035370d92e860e463a0a745074964ec60eb91b9460fe406";import{l as t,ar as s,A as e,t as o,c as a,bW as l,bX as i,bY as h,bZ as c,ao as n,b_ as r,c3 as p,b$ as _,c0 as d,c1 as u,c2 as g,cY as m,an as b,ap as $,cZ as v}from"./houseplan-card-DXakp5oa.js";import{i as f,c as y,e as w,r as D,a as k,b as S,s as C,t as M}from"./backdrop-pick-YVCyO6A0.js";const F=1e3,x=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},T="2195ace683267664d035370d92e860e463a0a745074964ec60eb91b9460fe406";class L{constructor(t){this.host=t,this._toggleServerPlans=async()=>{const t=this.host._spaceDialog;if(t)if(t.pickSaved)this.host._spaceDialog={...t,pickSaved:!1};else{this.host._spaceDialog={...t,pickSaved:!0,savedBusy:!0};try{const t=await this.host.hass.callWS({type:"houseplan/plans/list"}),s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:t?.plans||[],savedBusy:!1})}catch(t){const s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,saved:[],savedBusy:!1}),this.host._showToast(this.host._t("toast.plans_list_failed",{err:this.host._errText(t)}))}}}}_help(l){const i=`${l}.aria`,h=t(this.host.hass,this.host._config?.language);return s(h,l)&&s(h,i)?a`<hp-help data-help-key=${l}
|
||||
.text=${o(h,l)} .ariaLabel=${o(h,i)}></hp-help>`:e}_openSpaceDialog(t,s){if(!this.host._serverStorage||!this.host._serverCfg)return void this.host._showToast(this.host._t("toast.integration_missing"));if("edit"===t){const e=this.host._serverCfg.spaces.find(t=>t.id===s);if(!e)return;const o=l(e),a=e.settings?.custom_fill&&"object"==typeof e.settings.custom_fill?i(e.settings.custom_fill):null,p="none"===o.fill?{...a||h,a:0}:a;return void(this.host._spaceDialog={mode:t,spaceId:s,title:e.title,planUrl:e.plan_url||null,planFile:null,source:e.plan_url?"file":"draw",showBorders:o.showBorders,showNames:o.showNames,zeroWallStyle:r(e),displayTouched:!0,hideDecor:o.hideDecor,hideOpenings:o.hideOpenings,roomColor:o.color,roomOpacity:o.opacity,fillMode:"none"===o.fill?"custom":o.fill,customFill:p,glowEnabled:o.glow,bgColor:o.bgColor,bgMode:"static"===e.settings?.bg_mode||"daynight"===e.settings?.bg_mode?e.settings.bg_mode:null,northDeg:n({},e.settings),sunRays:"boolean"==typeof e.settings?.sun_rays?e.settings.sun_rays:null,tempMin:o.tempMin,tempMax:o.tempMax,showLqi:o.showLqi??this.host._config?.show_signal??!0,cardFontScale:o.cardFontScale,labelTemp:o.labelTemp,labelHum:o.labelHum,labelLqi:o.labelLqi,labelLight:o.labelLight,cellCm:Number(e.cell_cm)>0?Number(e.cell_cm):5,cellCmInput:c(Number(e.cell_cm)>0?Number(e.cell_cm):5,this.host._imperial),cellCmTouched:!1,busy:!1})}const e=p(this.host._imperial);this.host._spaceDialog={mode:t,title:"",planUrl:null,planFile:null,...f(),hideDecor:!1,hideOpenings:!1,zeroWallStyle:"dashed",roomColor:g,roomOpacity:u,fillMode:"custom",customFill:{...h,a:0},glowEnabled:!0,bgColor:null,bgMode:"daynight",northDeg:null,sunRays:null,tempMin:d,tempMax:_,showLqi:this.host._config?.show_signal??!0,cardFontScale:1,labelTemp:!1,labelHum:!1,labelLqi:!1,labelLight:!1,cellCm:e,cellCmInput:c(e,this.host._imperial),cellCmTouched:!1,busy:!1}}async _pickPlanFile(t){const s=t.target,e=s.files?.[0];if(!e||!this.host._spaceDialog)return;s.value="";const o=await y(e);if("reject"===o.kind)return void this.host._showToast(this.host._t("toast.plan_formats"));if("guard"===o.kind)return void(this.host._backdropGuard=o.state);const a=await w(e,o.ext,e.name);this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:a})}_renderBackdropGuard(){return D(this.host,t=>{this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:t})},()=>{this.host._backdropGuard=null},this.host.hass)??e}_useServerPlan(t){const s=this.host._spaceDialog;s&&(this.host._spaceDialog={...s,planUrl:t,planFile:null,pickSaved:!1,savedAspect:void 0},this.host._aspectJob=this._readPlanAspect(t))}async _readPlanAspect(t){for(let s=0;s<40;s++){const s=this.host._display(t);if(s){const e=await new Promise(t=>{const e=new Image;e.onload=()=>t(e.naturalWidth&&e.naturalHeight?e.naturalWidth/e.naturalHeight:0),e.onerror=()=>t(0),e.src=s}),o=this.host._spaceDialog;return o&&o.planUrl===t&&Number.isFinite(e)&&e>0?(this.host._spaceDialog={...o,savedAspect:e},e):0}if(await new Promise(t=>setTimeout(t,150)),this.host._spaceDialog?.planUrl!==t)return 0}return 0}async _deleteServerPlan(t){const s=this.host._spaceDialog,e=s?.saved?.find(s=>s.name===t);if(!s||!e||e.used_by.length||e.url===s.planUrl)return;const o=await this.host._confirmDanger({key:"delete-plan",kind:"destructive",title:this.host._t("confirm.delete_plan_title"),message:this.host._t("confirm.delete_plan_body"),objectName:t,confirmLabel:this.host._t("btn.delete"),cancelLabel:this.host._t("btn.cancel")}),a=this.host._spaceDialog,l=a?.saved?.find(s=>s.name===t);if(o&&a&&l&&l.url===e.url&&l.modified===e.modified&&!l.used_by.length&&l.url!==a.planUrl)try{await this.host.hass.callWS({type:"houseplan/plans/delete",name:t});const s=this.host._spaceDialog;s?.saved&&(this.host._spaceDialog={...s,saved:s.saved.filter(s=>s.name!==t)})}catch(t){this.host._showToast(this.host._t("toast.plan_delete_failed",{err:this.host._errText(t)}))}}_renderServerPlans(t){if(t.savedBusy)return a`<div class="savedplans muted">${this.host._t("space.loading")}</div>`;const s=t.saved||[];if(!s.length)return a`<div class="savedplans muted">${this.host._t("space.no_saved")}</div>`;return a`<div class="savedplans">
|
||||
${s.map(s=>{return a`
|
||||
<div class="savedplan ${s.url===t.planUrl?"cur":""}">
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="b36c2306f25315638c0178090efd6865650040c5565d6ad92430103558fe37db";try{await import("./houseplan-assets/houseplan-card-Bi2pkTUe.js")}catch(e){if(!customElements.get("houseplan-card")){const l=String(navigator.language||"en").toLowerCase();const m=l.startsWith("ru")?"House Plan обновился — перезагрузите страницу (Ctrl+F5).":l.startsWith("de")?"House Plan wurde aktualisiert — bitte laden Sie die Seite neu (Strg+F5).":l.startsWith("fr")?"House Plan a été mis à jour — veuillez recharger la page (Ctrl+F5).":"House Plan was updated — please reload the page (Ctrl+F5).";customElements.define("houseplan-card",class extends HTMLElement{setConfig(){}getCardSize(){return 1}connectedCallback(){this.style.cssText="display:block;box-sizing:border-box;padding:16px;border:1px solid var(--divider-color,#e0e0e0);border-radius:var(--ha-card-border-radius,12px);background:var(--card-background-color,#fff);color:var(--primary-text-color,#212121);font:14px/1.4 var(--paper-font-body1_-_font-family,sans-serif)";this.textContent=m}})}console.error("[houseplan] stale entry: the main chunk is unavailable",e)}
|
||||
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="2195ace683267664d035370d92e860e463a0a745074964ec60eb91b9460fe406";try{await import("./houseplan-assets/houseplan-card-DXakp5oa.js")}catch(e){if(!customElements.get("houseplan-card")){const l=String(navigator.language||"en").toLowerCase();const m=l.startsWith("ru")?"House Plan обновился — перезагрузите страницу (Ctrl+F5).":l.startsWith("de")?"House Plan wurde aktualisiert — bitte laden Sie die Seite neu (Strg+F5).":l.startsWith("fr")?"House Plan a été mis à jour — veuillez recharger la page (Ctrl+F5).":"House Plan was updated — please reload the page (Ctrl+F5).";customElements.define("houseplan-card",class extends HTMLElement{setConfig(){}getCardSize(){return 1}connectedCallback(){this.style.cssText="display:block;box-sizing:border-box;padding:16px;border:1px solid var(--divider-color,#e0e0e0);border-radius:var(--ha-card-border-radius,12px);background:var(--card-background-color,#fff);color:var(--primary-text-color,#212121);font:14px/1.4 var(--paper-font-body1_-_font-family,sans-serif)";this.textContent=m}})}console.error("[houseplan] stale entry: the main chunk is unavailable",e)}
|
||||
|
||||
@@ -105,6 +105,17 @@ function relocateEditorPatch(patch, cardSource, editorSource) {
|
||||
// `find` обязан встречаться в файле ровно один раз: патч, который ложится «куда
|
||||
// попало», проверяет не то, что объявлен проверять. Это контролирует --check.
|
||||
const MUTANT_DEFINITIONS = [
|
||||
{
|
||||
id: 'draft-delete-drops-the-promise',
|
||||
guard: 'node demo/smoke_free_walls.mjs',
|
||||
because: 'a delayed confirmation must keep the draft deletion pending all the way to the '
|
||||
+ 'card facade; dropping the runtime promise makes the smoke inspect stale geometry (#405)',
|
||||
patches: [{
|
||||
file: 'src/houseplan-editor-runtime.ts',
|
||||
find: " if (sel.kind === 'draft') { await this._deleteDraftWhole(); return; }",
|
||||
replace: " if (sel.kind === 'draft') { void this._deleteDraftWhole(); return; }",
|
||||
}],
|
||||
},
|
||||
{
|
||||
id: 'smoke-guard-blind-to-tail',
|
||||
guard: 'node demo/guard/verify-guard.mjs',
|
||||
|
||||
@@ -218,8 +218,9 @@ export class EditorSecondaryController {
|
||||
};
|
||||
}
|
||||
|
||||
runContext(capturedContext: string, currentContext: string, action: () => void): void {
|
||||
if (capturedContext === currentContext) action();
|
||||
runContext<T>(capturedContext: string, currentContext: string, action: () => T): T | undefined {
|
||||
if (capturedContext === currentContext) return action();
|
||||
return undefined;
|
||||
}
|
||||
|
||||
render(model: EditorSecondaryModel | null, blocked: boolean): TemplateResult {
|
||||
|
||||
@@ -7894,7 +7894,7 @@ export class HouseplanCard extends LitElement {
|
||||
return this._editorRuntimeOrThrow()._savePhysicalDialog();
|
||||
}
|
||||
|
||||
private _deletePhysicalSelection = (): void => {
|
||||
private _deletePhysicalSelection = (): Promise<void> => {
|
||||
return this._editorRuntimeOrThrow()._deletePhysicalSelection();
|
||||
}
|
||||
|
||||
@@ -8926,7 +8926,7 @@ export class HouseplanCard extends LitElement {
|
||||
return `${base}:none`;
|
||||
}
|
||||
|
||||
private _runEditorContext(contextId: string, action: () => void): void {
|
||||
private _runEditorContext<T>(contextId: string, action: () => T): T | undefined {
|
||||
return this._editorRuntimeOrThrow()._runEditorContext(contextId, action);
|
||||
}
|
||||
|
||||
|
||||
@@ -3070,11 +3070,11 @@ public _savePhysicalDialog = (): void => {
|
||||
if (!committed) this.host.requestUpdate();
|
||||
};
|
||||
|
||||
public _deletePhysicalSelection = (): void => {
|
||||
public _deletePhysicalSelection = async (): Promise<void> => {
|
||||
const sel = this.host._physicalSel;
|
||||
const sp = this.host._curSpaceCfg as any;
|
||||
if (!sel || !sp) return;
|
||||
if (sel.kind === 'draft') { this._deleteDraftWhole(); return; }
|
||||
if (sel.kind === 'draft') { await this._deleteDraftWhole(); return; }
|
||||
const before = this._geometrySnapshot();
|
||||
if (sel.kind === 'partition') {
|
||||
const hosted = (sp.openings || [])
|
||||
@@ -5287,8 +5287,10 @@ public _renderEditorGroupLauncher(group: EditorToolbarGroup): TemplateResult {
|
||||
);
|
||||
}
|
||||
|
||||
public _runEditorContext(contextId: string, action: () => void): void {
|
||||
this.host._editorSecondary.runContext(contextId, this.host._editorSecondaryContextId, action);
|
||||
public _runEditorContext<T>(contextId: string, action: () => T): T | undefined {
|
||||
return this.host._editorSecondary.runContext(
|
||||
contextId, this.host._editorSecondaryContextId, action,
|
||||
);
|
||||
}
|
||||
|
||||
public _renderEditorGroupModel(group: EditorToolbarGroup): EditorSecondaryModel {
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
|
||||
import { EditorSecondaryController } from '../test-build/editor-secondary.js';
|
||||
|
||||
const host = {
|
||||
root: () => ({}),
|
||||
requestUpdate() {},
|
||||
async updateComplete() {},
|
||||
clearTip() {},
|
||||
};
|
||||
|
||||
test('editor secondary context returns the current action result and rejects stale actions (#405)', async () => {
|
||||
const controller = new EditorSecondaryController(host);
|
||||
|
||||
assert.equal(controller.runContext('current', 'current', () => 42), 42);
|
||||
|
||||
const pending = Promise.resolve('finished');
|
||||
assert.equal(controller.runContext('current', 'current', () => pending), pending);
|
||||
assert.equal(await controller.runContext('current', 'current', () => pending), 'finished');
|
||||
|
||||
let staleCalled = false;
|
||||
assert.equal(controller.runContext('old', 'current', () => {
|
||||
staleCalled = true;
|
||||
return 'unexpected';
|
||||
}), undefined);
|
||||
assert.equal(staleCalled, false);
|
||||
});
|
||||
+1
-1
@@ -25,7 +25,7 @@
|
||||
"src/space-geometry.ts", "src/junction-limits.ts",
|
||||
"src/space-order.ts", "src/card-editor-validation.ts",
|
||||
"src/signing.ts", "src/initial-load.ts", "src/space-model-selection.ts", "src/space-dialog.ts",
|
||||
"src/visual-continuity.ts", "src/mode-transition.ts", "src/viewport-transition.ts", "src/editor-runtime-loader.ts", "src/pointer-modality.ts",
|
||||
"src/visual-continuity.ts", "src/mode-transition.ts", "src/viewport-transition.ts", "src/editor-runtime-loader.ts", "src/editor-secondary.ts", "src/pointer-modality.ts",
|
||||
"src/render-device-snapshot.ts",
|
||||
"src/command-stack.ts", "src/device-position-history.ts",
|
||||
"src/coordinate-canonicalization.ts",
|
||||
|
||||
Reference in New Issue
Block a user