fix: keep lazy editor release version synchronized

Issue: #337
User-Visible: yes
This commit is contained in:
Matysh
2026-08-28 12:47:30 +03:00
parent 568eae3fa4
commit 801e49092f
22 changed files with 158 additions and 144 deletions
@@ -1,111 +1,111 @@
{
"schema": 1,
"fingerprint": "b6d9eb672c772bca7fa08bf25b4525cc8bbf3084320f383f16ab86a535090444",
"fingerprint": "96c69e4400be9bc5c58d138a95af946a3cf0486ac19b272137ade84bb9b35878",
"entry": "houseplan-card.js",
"initialViewFiles": [
"houseplan-assets/houseplan-card-BC4jkFdL.js",
"houseplan-assets/houseplan-card-0bp2acAx.js",
"houseplan-card.js"
],
"initialViewGzipBytes": 255996,
"initialViewGzipBytes": 255993,
"lazyFiles": [
"houseplan-assets/de-VgE_9vb3.js",
"houseplan-assets/editor-D4KNbaO4.js",
"houseplan-assets/houseplan-editor-runtime-CkclHULh.js",
"houseplan-assets/houseplan-onboarding-runtime-10xYy-5C.js",
"houseplan-assets/space-deletion-4AkqAhAB.js"
"houseplan-assets/de-6NWhGw9L.js",
"houseplan-assets/editor-6tQQPtIj.js",
"houseplan-assets/houseplan-editor-runtime-B_ONl04j.js",
"houseplan-assets/houseplan-onboarding-runtime-BiFQfFve.js",
"houseplan-assets/space-deletion-TvTQ5fz7.js"
],
"lazyGzipBytes": 160369,
"lazyGzipBytes": 160368,
"lazyEditorFiles": [
"houseplan-assets/editor-D4KNbaO4.js",
"houseplan-assets/houseplan-editor-runtime-CkclHULh.js",
"houseplan-assets/space-deletion-4AkqAhAB.js"
"houseplan-assets/editor-6tQQPtIj.js",
"houseplan-assets/houseplan-editor-runtime-B_ONl04j.js",
"houseplan-assets/space-deletion-TvTQ5fz7.js"
],
"lazyEditorGzipBytes": 131842,
"lazyEditorGzipBytes": 131845,
"lazyOnboardingFiles": [
"houseplan-assets/houseplan-onboarding-runtime-10xYy-5C.js",
"houseplan-assets/space-deletion-4AkqAhAB.js"
"houseplan-assets/houseplan-onboarding-runtime-BiFQfFve.js",
"houseplan-assets/space-deletion-TvTQ5fz7.js"
],
"lazyOnboardingGzipBytes": 7202,
"lazyOnboardingGzipBytes": 7201,
"lazyLocaleFiles": [
"houseplan-assets/de-VgE_9vb3.js"
"houseplan-assets/de-6NWhGw9L.js"
],
"lazyLocaleGzipBytes": 21879,
"lazyLocaleGzipBytes": 21877,
"files": [
{
"path": "houseplan-assets/de-VgE_9vb3.js",
"sha256": "c2d257784f91d9a058f05072f9cba2106efd0cd9a6b94ae818e7be4f20fa4b9d",
"path": "houseplan-assets/de-6NWhGw9L.js",
"sha256": "a72feee3e2cc31e1c8897224fb9a8eaaf853d24ccab6482f21273ce7b451ae67",
"rawBytes": 71477,
"gzipBytes": 21879,
"gzipBytes": 21877,
"isEntry": false,
"imports": [],
"dynamicImports": []
},
{
"path": "houseplan-assets/editor-D4KNbaO4.js",
"sha256": "0e860dffab2381d2933e90c692415afe59bef5c700e189648837525759a18a1c",
"path": "houseplan-assets/editor-6tQQPtIj.js",
"sha256": "ee7ab8a2feb290f7e21da873a1df47d8712e69bdcab3aed0b57fee4305a880b1",
"rawBytes": 3831,
"gzipBytes": 1586,
"gzipBytes": 1584,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-BC4jkFdL.js"
"houseplan-assets/houseplan-card-0bp2acAx.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/houseplan-card-BC4jkFdL.js",
"sha256": "f35b914f03848bf2ce0cab0751a7cb8a14333cae50a72959ba67682cdc608efe",
"path": "houseplan-assets/houseplan-card-0bp2acAx.js",
"sha256": "2e4f5a4d3a78c2c89842bf3b375bada8d00efad5534fe81e1a32f03bfd43f99a",
"rawBytes": 909954,
"gzipBytes": 255813,
"gzipBytes": 255811,
"isEntry": false,
"imports": [],
"dynamicImports": [
"houseplan-assets/de-VgE_9vb3.js",
"houseplan-assets/editor-D4KNbaO4.js",
"houseplan-assets/houseplan-editor-runtime-CkclHULh.js",
"houseplan-assets/houseplan-onboarding-runtime-10xYy-5C.js"
"houseplan-assets/de-6NWhGw9L.js",
"houseplan-assets/editor-6tQQPtIj.js",
"houseplan-assets/houseplan-editor-runtime-B_ONl04j.js",
"houseplan-assets/houseplan-onboarding-runtime-BiFQfFve.js"
]
},
{
"path": "houseplan-assets/houseplan-editor-runtime-CkclHULh.js",
"sha256": "46d1de0ec73e313f68c02ef6f60bc18da43753f2ed7600c7a727da9dd8190e5f",
"rawBytes": 504952,
"gzipBytes": 129702,
"path": "houseplan-assets/houseplan-editor-runtime-B_ONl04j.js",
"sha256": "e362c070b2ae1eee9e91f346baa4ae46ad8e58a68cf49885a129abd42ce8dc2e",
"rawBytes": 504959,
"gzipBytes": 129706,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-BC4jkFdL.js",
"houseplan-assets/space-deletion-4AkqAhAB.js"
"houseplan-assets/houseplan-card-0bp2acAx.js",
"houseplan-assets/space-deletion-TvTQ5fz7.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/houseplan-onboarding-runtime-10xYy-5C.js",
"sha256": "6ecf6f79d2fc4879350b23d7fa63cc3cf500d7fe4a1dc5a45e29ce14c9bf9361",
"path": "houseplan-assets/houseplan-onboarding-runtime-BiFQfFve.js",
"sha256": "eb6b88d822151bb3ded528ecf03a2e3b698c86fd3ca887925df57fa1f896a698",
"rawBytes": 26356,
"gzipBytes": 6648,
"gzipBytes": 6646,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-BC4jkFdL.js",
"houseplan-assets/space-deletion-4AkqAhAB.js"
"houseplan-assets/houseplan-card-0bp2acAx.js",
"houseplan-assets/space-deletion-TvTQ5fz7.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/space-deletion-4AkqAhAB.js",
"sha256": "7c10b5615f8829be4250f294ed73ceca46d16333e6fa8daa6ae831a6a75022ef",
"path": "houseplan-assets/space-deletion-TvTQ5fz7.js",
"sha256": "e9573e60cc49ef932bf8b4d6ac2128c30312bf2c92f5b97ef8404edba7adbd86",
"rawBytes": 911,
"gzipBytes": 554,
"gzipBytes": 555,
"isEntry": false,
"imports": [],
"dynamicImports": []
},
{
"path": "houseplan-card.js",
"sha256": "12c839c490fc56475922b3979ec6b457e32554d6d66b2c7f13b3f50f03de573c",
"sha256": "a354023944e1da091a71a7c5cf0cc2b9d61207ec3ebef70c0afe6170aef8485e",
"rawBytes": 190,
"gzipBytes": 183,
"gzipBytes": 182,
"isEntry": true,
"imports": [
"houseplan-assets/houseplan-card-BC4jkFdL.js"
"houseplan-assets/houseplan-card-0bp2acAx.js"
],
"dynamicImports": []
}
@@ -1,4 +1,4 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="b6d9eb672c772bca7fa08bf25b4525cc8bbf3084320f383f16ab86a535090444";import{c as e,l as o,t,d2 as s,A as a,d3 as i,d4 as l,d5 as n,E as r,b as c}from"./houseplan-card-BC4jkFdL.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__="96c69e4400be9bc5c58d138a95af946a3cf0486ac19b272137ade84bb9b35878";import{c as e,l as o,t,d2 as s,A as a,d3 as i,d4 as l,d5 as n,E as r,b as c}from"./houseplan-card-0bp2acAx.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
.hass=${this.hass}
.data=${this._formData}
.schema=${e}
@@ -1,4 +1,4 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="b6d9eb672c772bca7fa08bf25b4525cc8bbf3084320f383f16ab86a535090444";import{bU as t,bV as s,bW as e,bX as o,aq as a,bY as l,c1 as i,bZ as h,b_ as n,b$ as c,c0 as r,b as p,A as _,cV as d,ap as u,ar as g,cW as m}from"./houseplan-card-BC4jkFdL.js";import{i as b,c as $,a as v,s as f,t as y}from"./space-deletion-4AkqAhAB.js";const w=1e3,D=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},S="b6d9eb672c772bca7fa08bf25b4525cc8bbf3084320f383f16ab86a535090444";class C{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)}))}}}}_openSpaceDialog(p,_){if(!this.host._serverStorage||!this.host._serverCfg)return void this.host._showToast(this.host._t("toast.integration_missing"));if("edit"===p){const i=this.host._serverCfg.spaces.find(t=>t.id===_);if(!i)return;const h=t(i),n=i.settings?.custom_fill&&"object"==typeof i.settings.custom_fill?s(i.settings.custom_fill):null,c="none"===h.fill?{...n||e,a:0}:n;return void(this.host._spaceDialog={mode:p,spaceId:_,title:i.title,planUrl:i.plan_url||null,planFile:null,source:i.plan_url?"file":"draw",showBorders:h.showBorders,showNames:h.showNames,zeroWallStyle:l(i),displayTouched:!0,hideDecor:h.hideDecor,hideOpenings:h.hideOpenings,roomColor:h.color,roomOpacity:h.opacity,fillMode:"none"===h.fill?"custom":h.fill,customFill:c,glowEnabled:h.glow,bgColor:h.bgColor,bgMode:"static"===i.settings?.bg_mode||"daynight"===i.settings?.bg_mode?i.settings.bg_mode:null,northDeg:a({},i.settings),sunRays:"boolean"==typeof i.settings?.sun_rays?i.settings.sun_rays:null,tempMin:h.tempMin,tempMax:h.tempMax,showLqi:h.showLqi??this.host._config?.show_signal??!0,cardFontScale:h.cardFontScale,labelTemp:h.labelTemp,labelHum:h.labelHum,labelLqi:h.labelLqi,labelLight:h.labelLight,cellCm:Number(i.cell_cm)>0?Number(i.cell_cm):5,cellCmInput:o(Number(i.cell_cm)>0?Number(i.cell_cm):5,this.host._imperial),cellCmTouched:!1,busy:!1})}const d=i(this.host._imperial);this.host._spaceDialog={mode:p,title:"",planUrl:null,planFile:null,...b(),hideDecor:!1,hideOpenings:!1,zeroWallStyle:"dashed",roomColor:r,roomOpacity:c,fillMode:"custom",customFill:{...e,a:0},glowEnabled:!0,bgColor:null,bgMode:"daynight",northDeg:null,sunRays:null,tempMin:n,tempMax:h,showLqi:this.host._config?.show_signal??!0,cardFontScale:1,labelTemp:!1,labelHum:!1,labelLqi:!1,labelLight:!1,cellCm:d,cellCmInput:o(d,this.host._imperial),cellCmTouched:!1,busy:!1}}async _pickPlanFile(t){const s=t.target,e=s.files?.[0];if(!e||!this.host._spaceDialog)return;const o={"image/svg+xml":"svg","image/png":"png","image/jpeg":"jpg","image/webp":"webp"}[e.type]||(e.name.toLowerCase().endsWith(".svg")?"svg":"");if(!o)return void this.host._showToast(this.host._t("toast.plan_formats"));const a=new Uint8Array(await e.arrayBuffer());let l="";for(let t=0;t<a.length;t+=32768)l+=String.fromCharCode(...a.subarray(t,t+32768));const i=btoa(l),h=URL.createObjectURL(e),n=await new Promise(t=>{const s=new Image;s.onload=()=>t(s.naturalWidth&&s.naturalHeight?s.naturalWidth/s.naturalHeight:1.414),s.onerror=()=>t(1.414),s.src=h});URL.revokeObjectURL(h),this.host._spaceDialog={...this.host._spaceDialog,planFile:{ext:o,b64:i,aspect:n,name:e.name}}}_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){if(confirm(this.host._t("confirm.delete_plan",{name:t})))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 p`<div class="savedplans muted">${this.host._t("space.loading")}</div>`;const s=t.saved||[];if(!s.length)return p`<div class="savedplans muted">${this.host._t("space.no_saved")}</div>`;return p`<div class="savedplans">
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="96c69e4400be9bc5c58d138a95af946a3cf0486ac19b272137ade84bb9b35878";import{bU as t,bV as s,bW as e,bX as o,aq as a,bY as l,c1 as i,bZ as h,b_ as n,b$ as c,c0 as r,b as p,A as _,cV as d,ap as u,ar as g,cW as m}from"./houseplan-card-0bp2acAx.js";import{i as b,c as $,a as v,s as y,t as f}from"./space-deletion-TvTQ5fz7.js";const w=1e3,D=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},S="96c69e4400be9bc5c58d138a95af946a3cf0486ac19b272137ade84bb9b35878";class C{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)}))}}}}_openSpaceDialog(p,_){if(!this.host._serverStorage||!this.host._serverCfg)return void this.host._showToast(this.host._t("toast.integration_missing"));if("edit"===p){const i=this.host._serverCfg.spaces.find(t=>t.id===_);if(!i)return;const h=t(i),n=i.settings?.custom_fill&&"object"==typeof i.settings.custom_fill?s(i.settings.custom_fill):null,c="none"===h.fill?{...n||e,a:0}:n;return void(this.host._spaceDialog={mode:p,spaceId:_,title:i.title,planUrl:i.plan_url||null,planFile:null,source:i.plan_url?"file":"draw",showBorders:h.showBorders,showNames:h.showNames,zeroWallStyle:l(i),displayTouched:!0,hideDecor:h.hideDecor,hideOpenings:h.hideOpenings,roomColor:h.color,roomOpacity:h.opacity,fillMode:"none"===h.fill?"custom":h.fill,customFill:c,glowEnabled:h.glow,bgColor:h.bgColor,bgMode:"static"===i.settings?.bg_mode||"daynight"===i.settings?.bg_mode?i.settings.bg_mode:null,northDeg:a({},i.settings),sunRays:"boolean"==typeof i.settings?.sun_rays?i.settings.sun_rays:null,tempMin:h.tempMin,tempMax:h.tempMax,showLqi:h.showLqi??this.host._config?.show_signal??!0,cardFontScale:h.cardFontScale,labelTemp:h.labelTemp,labelHum:h.labelHum,labelLqi:h.labelLqi,labelLight:h.labelLight,cellCm:Number(i.cell_cm)>0?Number(i.cell_cm):5,cellCmInput:o(Number(i.cell_cm)>0?Number(i.cell_cm):5,this.host._imperial),cellCmTouched:!1,busy:!1})}const d=i(this.host._imperial);this.host._spaceDialog={mode:p,title:"",planUrl:null,planFile:null,...b(),hideDecor:!1,hideOpenings:!1,zeroWallStyle:"dashed",roomColor:r,roomOpacity:c,fillMode:"custom",customFill:{...e,a:0},glowEnabled:!0,bgColor:null,bgMode:"daynight",northDeg:null,sunRays:null,tempMin:n,tempMax:h,showLqi:this.host._config?.show_signal??!0,cardFontScale:1,labelTemp:!1,labelHum:!1,labelLqi:!1,labelLight:!1,cellCm:d,cellCmInput:o(d,this.host._imperial),cellCmTouched:!1,busy:!1}}async _pickPlanFile(t){const s=t.target,e=s.files?.[0];if(!e||!this.host._spaceDialog)return;const o={"image/svg+xml":"svg","image/png":"png","image/jpeg":"jpg","image/webp":"webp"}[e.type]||(e.name.toLowerCase().endsWith(".svg")?"svg":"");if(!o)return void this.host._showToast(this.host._t("toast.plan_formats"));const a=new Uint8Array(await e.arrayBuffer());let l="";for(let t=0;t<a.length;t+=32768)l+=String.fromCharCode(...a.subarray(t,t+32768));const i=btoa(l),h=URL.createObjectURL(e),n=await new Promise(t=>{const s=new Image;s.onload=()=>t(s.naturalWidth&&s.naturalHeight?s.naturalWidth/s.naturalHeight:1.414),s.onerror=()=>t(1.414),s.src=h});URL.revokeObjectURL(h),this.host._spaceDialog={...this.host._spaceDialog,planFile:{ext:o,b64:i,aspect:n,name:e.name}}}_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){if(confirm(this.host._t("confirm.delete_plan",{name:t})))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 p`<div class="savedplans muted">${this.host._t("space.loading")}</div>`;const s=t.saved||[];if(!s.length)return p`<div class="savedplans muted">${this.host._t("space.no_saved")}</div>`;return p`<div class="savedplans">
${s.map(s=>{return p`
<div class="savedplan ${s.url===t.planUrl?"cur":""}">
<img src=${this.host._display(s.url)} alt="" loading="lazy" decoding="async" />
@@ -46,7 +46,7 @@ globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="b6d9eb672c772bca7fa08bf25b4525cc8bbf
<label>${this.host._t("space.plan_label")}</label>
<label class="srcrow">
<input type="radio" name="plansrc" .checked=${"file"===t.source}
@change=${()=>this.host._spaceDialog=f(t,"file")} />
@change=${()=>this.host._spaceDialog=y(t,"file")} />
<span>${this.host._t("space.source_file")}</span>
</label>
${"file"===t.source?p`<div class="planrow">
@@ -68,7 +68,7 @@ globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="b6d9eb672c772bca7fa08bf25b4525cc8bbf
${t.pickSaved?this._renderServerPlans(t):_}`:_}
<label class="srcrow">
<input type="radio" name="plansrc" .checked=${"draw"===t.source}
@change=${()=>this.host._spaceDialog=f(t,"draw")} />
@change=${()=>this.host._spaceDialog=y(t,"draw")} />
<span>${this.host._t("space.source_draw")}</span>
</label>
@@ -85,7 +85,7 @@ globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="b6d9eb672c772bca7fa08bf25b4525cc8bbf
<label class="dispsection">${this.host._t("space.display_section")}</label>
<label class="srcrow">
${this._boolInput(t.showBorders,s=>{this.host._spaceDialog=y(t,"showBorders",s)})}
${this._boolInput(t.showBorders,s=>{this.host._spaceDialog=f(t,"showBorders",s)})}
<span>${this.host._t("space.show_borders")}</span>
</label>
<label>${this.host._t("space.zero_wall_style")}</label>
@@ -99,7 +99,7 @@ globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="b6d9eb672c772bca7fa08bf25b4525cc8bbf
</select>
<div class="rhint">${this.host._t("space.zero_wall_help")}</div>
<label class="srcrow">
${this._boolInput(t.showNames,s=>{this.host._spaceDialog=y(t,"showNames",s)})}
${this._boolInput(t.showNames,s=>{this.host._spaceDialog=f(t,"showNames",s)})}
<span>${this.host._t("space.show_names")}</span>
</label>
<label class="srcrow">
@@ -1 +1 @@
function e(e,o){return{id:e,title:o,plan_url:null,view_box:[0,0,1,1],rooms:[],wall_segments:[]}}function o(e="file"){const o="draw"===e;return{source:e,showBorders:o,showNames:o,displayTouched:!1}}function r(e,o){if(e.displayTouched)return{...e,source:o};const r="draw"===o;return{...e,source:o,showBorders:r,showNames:r}}function s(e,o,r){return{...e,[o]:r,displayTouched:!0}}function t(e,o,r){const s=(e?.spaces||[]).find(e=>e?.id===r),t=new Set((s?.rooms||[]).map(e=>String(e?.id||"")).filter(Boolean)),n=[...new Set((e?.markers||[]).filter(e=>!0!==e?.removed&&"string"==typeof e?.id).filter(e=>e.space===r||"string"==typeof e.room_id&&t.has(e.room_id)||o?.[e.id]?.s===r).map(e=>e.id))].sort((e,o)=>e.localeCompare(o));return{markerIds:n,count:n.length}}globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="b6d9eb672c772bca7fa08bf25b4525cc8bbf3084320f383f16ab86a535090444";export{t as a,e as c,o as i,r as s,s as t};
function e(e,o){return{id:e,title:o,plan_url:null,view_box:[0,0,1,1],rooms:[],wall_segments:[]}}function o(e="file"){const o="draw"===e;return{source:e,showBorders:o,showNames:o,displayTouched:!1}}function r(e,o){if(e.displayTouched)return{...e,source:o};const r="draw"===o;return{...e,source:o,showBorders:r,showNames:r}}function s(e,o,r){return{...e,[o]:r,displayTouched:!0}}function t(e,o,r){const s=(e?.spaces||[]).find(e=>e?.id===r),t=new Set((s?.rooms||[]).map(e=>String(e?.id||"")).filter(Boolean)),a=[...new Set((e?.markers||[]).filter(e=>!0!==e?.removed&&"string"==typeof e?.id).filter(e=>e.space===r||"string"==typeof e.room_id&&t.has(e.room_id)||o?.[e.id]?.s===r).map(e=>e.id))].sort((e,o)=>e.localeCompare(o));return{markerIds:a,count:a.length}}globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="96c69e4400be9bc5c58d138a95af946a3cf0486ac19b272137ade84bb9b35878";export{t as a,e as c,o as i,r as s,s as t};
@@ -1 +1 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="b6d9eb672c772bca7fa08bf25b4525cc8bbf3084320f383f16ab86a535090444";export{d6 as HouseplanCard}from"./houseplan-assets/houseplan-card-BC4jkFdL.js";
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="96c69e4400be9bc5c58d138a95af946a3cf0486ac19b272137ade84bb9b35878";export{d6 as HouseplanCard}from"./houseplan-assets/houseplan-card-0bp2acAx.js";
+49 -49
View File
@@ -1,111 +1,111 @@
{
"schema": 1,
"fingerprint": "b6d9eb672c772bca7fa08bf25b4525cc8bbf3084320f383f16ab86a535090444",
"fingerprint": "96c69e4400be9bc5c58d138a95af946a3cf0486ac19b272137ade84bb9b35878",
"entry": "houseplan-card.js",
"initialViewFiles": [
"houseplan-assets/houseplan-card-BC4jkFdL.js",
"houseplan-assets/houseplan-card-0bp2acAx.js",
"houseplan-card.js"
],
"initialViewGzipBytes": 255996,
"initialViewGzipBytes": 255993,
"lazyFiles": [
"houseplan-assets/de-VgE_9vb3.js",
"houseplan-assets/editor-D4KNbaO4.js",
"houseplan-assets/houseplan-editor-runtime-CkclHULh.js",
"houseplan-assets/houseplan-onboarding-runtime-10xYy-5C.js",
"houseplan-assets/space-deletion-4AkqAhAB.js"
"houseplan-assets/de-6NWhGw9L.js",
"houseplan-assets/editor-6tQQPtIj.js",
"houseplan-assets/houseplan-editor-runtime-B_ONl04j.js",
"houseplan-assets/houseplan-onboarding-runtime-BiFQfFve.js",
"houseplan-assets/space-deletion-TvTQ5fz7.js"
],
"lazyGzipBytes": 160369,
"lazyGzipBytes": 160368,
"lazyEditorFiles": [
"houseplan-assets/editor-D4KNbaO4.js",
"houseplan-assets/houseplan-editor-runtime-CkclHULh.js",
"houseplan-assets/space-deletion-4AkqAhAB.js"
"houseplan-assets/editor-6tQQPtIj.js",
"houseplan-assets/houseplan-editor-runtime-B_ONl04j.js",
"houseplan-assets/space-deletion-TvTQ5fz7.js"
],
"lazyEditorGzipBytes": 131842,
"lazyEditorGzipBytes": 131845,
"lazyOnboardingFiles": [
"houseplan-assets/houseplan-onboarding-runtime-10xYy-5C.js",
"houseplan-assets/space-deletion-4AkqAhAB.js"
"houseplan-assets/houseplan-onboarding-runtime-BiFQfFve.js",
"houseplan-assets/space-deletion-TvTQ5fz7.js"
],
"lazyOnboardingGzipBytes": 7202,
"lazyOnboardingGzipBytes": 7201,
"lazyLocaleFiles": [
"houseplan-assets/de-VgE_9vb3.js"
"houseplan-assets/de-6NWhGw9L.js"
],
"lazyLocaleGzipBytes": 21879,
"lazyLocaleGzipBytes": 21877,
"files": [
{
"path": "houseplan-assets/de-VgE_9vb3.js",
"sha256": "c2d257784f91d9a058f05072f9cba2106efd0cd9a6b94ae818e7be4f20fa4b9d",
"path": "houseplan-assets/de-6NWhGw9L.js",
"sha256": "a72feee3e2cc31e1c8897224fb9a8eaaf853d24ccab6482f21273ce7b451ae67",
"rawBytes": 71477,
"gzipBytes": 21879,
"gzipBytes": 21877,
"isEntry": false,
"imports": [],
"dynamicImports": []
},
{
"path": "houseplan-assets/editor-D4KNbaO4.js",
"sha256": "0e860dffab2381d2933e90c692415afe59bef5c700e189648837525759a18a1c",
"path": "houseplan-assets/editor-6tQQPtIj.js",
"sha256": "ee7ab8a2feb290f7e21da873a1df47d8712e69bdcab3aed0b57fee4305a880b1",
"rawBytes": 3831,
"gzipBytes": 1586,
"gzipBytes": 1584,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-BC4jkFdL.js"
"houseplan-assets/houseplan-card-0bp2acAx.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/houseplan-card-BC4jkFdL.js",
"sha256": "f35b914f03848bf2ce0cab0751a7cb8a14333cae50a72959ba67682cdc608efe",
"path": "houseplan-assets/houseplan-card-0bp2acAx.js",
"sha256": "2e4f5a4d3a78c2c89842bf3b375bada8d00efad5534fe81e1a32f03bfd43f99a",
"rawBytes": 909954,
"gzipBytes": 255813,
"gzipBytes": 255811,
"isEntry": false,
"imports": [],
"dynamicImports": [
"houseplan-assets/de-VgE_9vb3.js",
"houseplan-assets/editor-D4KNbaO4.js",
"houseplan-assets/houseplan-editor-runtime-CkclHULh.js",
"houseplan-assets/houseplan-onboarding-runtime-10xYy-5C.js"
"houseplan-assets/de-6NWhGw9L.js",
"houseplan-assets/editor-6tQQPtIj.js",
"houseplan-assets/houseplan-editor-runtime-B_ONl04j.js",
"houseplan-assets/houseplan-onboarding-runtime-BiFQfFve.js"
]
},
{
"path": "houseplan-assets/houseplan-editor-runtime-CkclHULh.js",
"sha256": "46d1de0ec73e313f68c02ef6f60bc18da43753f2ed7600c7a727da9dd8190e5f",
"rawBytes": 504952,
"gzipBytes": 129702,
"path": "houseplan-assets/houseplan-editor-runtime-B_ONl04j.js",
"sha256": "e362c070b2ae1eee9e91f346baa4ae46ad8e58a68cf49885a129abd42ce8dc2e",
"rawBytes": 504959,
"gzipBytes": 129706,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-BC4jkFdL.js",
"houseplan-assets/space-deletion-4AkqAhAB.js"
"houseplan-assets/houseplan-card-0bp2acAx.js",
"houseplan-assets/space-deletion-TvTQ5fz7.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/houseplan-onboarding-runtime-10xYy-5C.js",
"sha256": "6ecf6f79d2fc4879350b23d7fa63cc3cf500d7fe4a1dc5a45e29ce14c9bf9361",
"path": "houseplan-assets/houseplan-onboarding-runtime-BiFQfFve.js",
"sha256": "eb6b88d822151bb3ded528ecf03a2e3b698c86fd3ca887925df57fa1f896a698",
"rawBytes": 26356,
"gzipBytes": 6648,
"gzipBytes": 6646,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-BC4jkFdL.js",
"houseplan-assets/space-deletion-4AkqAhAB.js"
"houseplan-assets/houseplan-card-0bp2acAx.js",
"houseplan-assets/space-deletion-TvTQ5fz7.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/space-deletion-4AkqAhAB.js",
"sha256": "7c10b5615f8829be4250f294ed73ceca46d16333e6fa8daa6ae831a6a75022ef",
"path": "houseplan-assets/space-deletion-TvTQ5fz7.js",
"sha256": "e9573e60cc49ef932bf8b4d6ac2128c30312bf2c92f5b97ef8404edba7adbd86",
"rawBytes": 911,
"gzipBytes": 554,
"gzipBytes": 555,
"isEntry": false,
"imports": [],
"dynamicImports": []
},
{
"path": "houseplan-card.js",
"sha256": "12c839c490fc56475922b3979ec6b457e32554d6d66b2c7f13b3f50f03de573c",
"sha256": "a354023944e1da091a71a7c5cf0cc2b9d61207ec3ebef70c0afe6170aef8485e",
"rawBytes": 190,
"gzipBytes": 183,
"gzipBytes": 182,
"isEntry": true,
"imports": [
"houseplan-assets/houseplan-card-BC4jkFdL.js"
"houseplan-assets/houseplan-card-0bp2acAx.js"
],
"dynamicImports": []
}
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="b6d9eb672c772bca7fa08bf25b4525cc8bbf3084320f383f16ab86a535090444";import{c as e,l as o,t,d2 as s,A as a,d3 as i,d4 as l,d5 as n,E as r,b as c}from"./houseplan-card-BC4jkFdL.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__="96c69e4400be9bc5c58d138a95af946a3cf0486ac19b272137ade84bb9b35878";import{c as e,l as o,t,d2 as s,A as a,d3 as i,d4 as l,d5 as n,E as r,b as c}from"./houseplan-card-0bp2acAx.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
.hass=${this.hass}
.data=${this._formData}
.schema=${e}
@@ -1,4 +1,4 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="b6d9eb672c772bca7fa08bf25b4525cc8bbf3084320f383f16ab86a535090444";import{bU as t,bV as s,bW as e,bX as o,aq as a,bY as l,c1 as i,bZ as h,b_ as n,b$ as c,c0 as r,b as p,A as _,cV as d,ap as u,ar as g,cW as m}from"./houseplan-card-BC4jkFdL.js";import{i as b,c as $,a as v,s as f,t as y}from"./space-deletion-4AkqAhAB.js";const w=1e3,D=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},S="b6d9eb672c772bca7fa08bf25b4525cc8bbf3084320f383f16ab86a535090444";class C{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)}))}}}}_openSpaceDialog(p,_){if(!this.host._serverStorage||!this.host._serverCfg)return void this.host._showToast(this.host._t("toast.integration_missing"));if("edit"===p){const i=this.host._serverCfg.spaces.find(t=>t.id===_);if(!i)return;const h=t(i),n=i.settings?.custom_fill&&"object"==typeof i.settings.custom_fill?s(i.settings.custom_fill):null,c="none"===h.fill?{...n||e,a:0}:n;return void(this.host._spaceDialog={mode:p,spaceId:_,title:i.title,planUrl:i.plan_url||null,planFile:null,source:i.plan_url?"file":"draw",showBorders:h.showBorders,showNames:h.showNames,zeroWallStyle:l(i),displayTouched:!0,hideDecor:h.hideDecor,hideOpenings:h.hideOpenings,roomColor:h.color,roomOpacity:h.opacity,fillMode:"none"===h.fill?"custom":h.fill,customFill:c,glowEnabled:h.glow,bgColor:h.bgColor,bgMode:"static"===i.settings?.bg_mode||"daynight"===i.settings?.bg_mode?i.settings.bg_mode:null,northDeg:a({},i.settings),sunRays:"boolean"==typeof i.settings?.sun_rays?i.settings.sun_rays:null,tempMin:h.tempMin,tempMax:h.tempMax,showLqi:h.showLqi??this.host._config?.show_signal??!0,cardFontScale:h.cardFontScale,labelTemp:h.labelTemp,labelHum:h.labelHum,labelLqi:h.labelLqi,labelLight:h.labelLight,cellCm:Number(i.cell_cm)>0?Number(i.cell_cm):5,cellCmInput:o(Number(i.cell_cm)>0?Number(i.cell_cm):5,this.host._imperial),cellCmTouched:!1,busy:!1})}const d=i(this.host._imperial);this.host._spaceDialog={mode:p,title:"",planUrl:null,planFile:null,...b(),hideDecor:!1,hideOpenings:!1,zeroWallStyle:"dashed",roomColor:r,roomOpacity:c,fillMode:"custom",customFill:{...e,a:0},glowEnabled:!0,bgColor:null,bgMode:"daynight",northDeg:null,sunRays:null,tempMin:n,tempMax:h,showLqi:this.host._config?.show_signal??!0,cardFontScale:1,labelTemp:!1,labelHum:!1,labelLqi:!1,labelLight:!1,cellCm:d,cellCmInput:o(d,this.host._imperial),cellCmTouched:!1,busy:!1}}async _pickPlanFile(t){const s=t.target,e=s.files?.[0];if(!e||!this.host._spaceDialog)return;const o={"image/svg+xml":"svg","image/png":"png","image/jpeg":"jpg","image/webp":"webp"}[e.type]||(e.name.toLowerCase().endsWith(".svg")?"svg":"");if(!o)return void this.host._showToast(this.host._t("toast.plan_formats"));const a=new Uint8Array(await e.arrayBuffer());let l="";for(let t=0;t<a.length;t+=32768)l+=String.fromCharCode(...a.subarray(t,t+32768));const i=btoa(l),h=URL.createObjectURL(e),n=await new Promise(t=>{const s=new Image;s.onload=()=>t(s.naturalWidth&&s.naturalHeight?s.naturalWidth/s.naturalHeight:1.414),s.onerror=()=>t(1.414),s.src=h});URL.revokeObjectURL(h),this.host._spaceDialog={...this.host._spaceDialog,planFile:{ext:o,b64:i,aspect:n,name:e.name}}}_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){if(confirm(this.host._t("confirm.delete_plan",{name:t})))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 p`<div class="savedplans muted">${this.host._t("space.loading")}</div>`;const s=t.saved||[];if(!s.length)return p`<div class="savedplans muted">${this.host._t("space.no_saved")}</div>`;return p`<div class="savedplans">
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="96c69e4400be9bc5c58d138a95af946a3cf0486ac19b272137ade84bb9b35878";import{bU as t,bV as s,bW as e,bX as o,aq as a,bY as l,c1 as i,bZ as h,b_ as n,b$ as c,c0 as r,b as p,A as _,cV as d,ap as u,ar as g,cW as m}from"./houseplan-card-0bp2acAx.js";import{i as b,c as $,a as v,s as y,t as f}from"./space-deletion-TvTQ5fz7.js";const w=1e3,D=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},S="96c69e4400be9bc5c58d138a95af946a3cf0486ac19b272137ade84bb9b35878";class C{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)}))}}}}_openSpaceDialog(p,_){if(!this.host._serverStorage||!this.host._serverCfg)return void this.host._showToast(this.host._t("toast.integration_missing"));if("edit"===p){const i=this.host._serverCfg.spaces.find(t=>t.id===_);if(!i)return;const h=t(i),n=i.settings?.custom_fill&&"object"==typeof i.settings.custom_fill?s(i.settings.custom_fill):null,c="none"===h.fill?{...n||e,a:0}:n;return void(this.host._spaceDialog={mode:p,spaceId:_,title:i.title,planUrl:i.plan_url||null,planFile:null,source:i.plan_url?"file":"draw",showBorders:h.showBorders,showNames:h.showNames,zeroWallStyle:l(i),displayTouched:!0,hideDecor:h.hideDecor,hideOpenings:h.hideOpenings,roomColor:h.color,roomOpacity:h.opacity,fillMode:"none"===h.fill?"custom":h.fill,customFill:c,glowEnabled:h.glow,bgColor:h.bgColor,bgMode:"static"===i.settings?.bg_mode||"daynight"===i.settings?.bg_mode?i.settings.bg_mode:null,northDeg:a({},i.settings),sunRays:"boolean"==typeof i.settings?.sun_rays?i.settings.sun_rays:null,tempMin:h.tempMin,tempMax:h.tempMax,showLqi:h.showLqi??this.host._config?.show_signal??!0,cardFontScale:h.cardFontScale,labelTemp:h.labelTemp,labelHum:h.labelHum,labelLqi:h.labelLqi,labelLight:h.labelLight,cellCm:Number(i.cell_cm)>0?Number(i.cell_cm):5,cellCmInput:o(Number(i.cell_cm)>0?Number(i.cell_cm):5,this.host._imperial),cellCmTouched:!1,busy:!1})}const d=i(this.host._imperial);this.host._spaceDialog={mode:p,title:"",planUrl:null,planFile:null,...b(),hideDecor:!1,hideOpenings:!1,zeroWallStyle:"dashed",roomColor:r,roomOpacity:c,fillMode:"custom",customFill:{...e,a:0},glowEnabled:!0,bgColor:null,bgMode:"daynight",northDeg:null,sunRays:null,tempMin:n,tempMax:h,showLqi:this.host._config?.show_signal??!0,cardFontScale:1,labelTemp:!1,labelHum:!1,labelLqi:!1,labelLight:!1,cellCm:d,cellCmInput:o(d,this.host._imperial),cellCmTouched:!1,busy:!1}}async _pickPlanFile(t){const s=t.target,e=s.files?.[0];if(!e||!this.host._spaceDialog)return;const o={"image/svg+xml":"svg","image/png":"png","image/jpeg":"jpg","image/webp":"webp"}[e.type]||(e.name.toLowerCase().endsWith(".svg")?"svg":"");if(!o)return void this.host._showToast(this.host._t("toast.plan_formats"));const a=new Uint8Array(await e.arrayBuffer());let l="";for(let t=0;t<a.length;t+=32768)l+=String.fromCharCode(...a.subarray(t,t+32768));const i=btoa(l),h=URL.createObjectURL(e),n=await new Promise(t=>{const s=new Image;s.onload=()=>t(s.naturalWidth&&s.naturalHeight?s.naturalWidth/s.naturalHeight:1.414),s.onerror=()=>t(1.414),s.src=h});URL.revokeObjectURL(h),this.host._spaceDialog={...this.host._spaceDialog,planFile:{ext:o,b64:i,aspect:n,name:e.name}}}_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){if(confirm(this.host._t("confirm.delete_plan",{name:t})))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 p`<div class="savedplans muted">${this.host._t("space.loading")}</div>`;const s=t.saved||[];if(!s.length)return p`<div class="savedplans muted">${this.host._t("space.no_saved")}</div>`;return p`<div class="savedplans">
${s.map(s=>{return p`
<div class="savedplan ${s.url===t.planUrl?"cur":""}">
<img src=${this.host._display(s.url)} alt="" loading="lazy" decoding="async" />
@@ -46,7 +46,7 @@ globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="b6d9eb672c772bca7fa08bf25b4525cc8bbf
<label>${this.host._t("space.plan_label")}</label>
<label class="srcrow">
<input type="radio" name="plansrc" .checked=${"file"===t.source}
@change=${()=>this.host._spaceDialog=f(t,"file")} />
@change=${()=>this.host._spaceDialog=y(t,"file")} />
<span>${this.host._t("space.source_file")}</span>
</label>
${"file"===t.source?p`<div class="planrow">
@@ -68,7 +68,7 @@ globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="b6d9eb672c772bca7fa08bf25b4525cc8bbf
${t.pickSaved?this._renderServerPlans(t):_}`:_}
<label class="srcrow">
<input type="radio" name="plansrc" .checked=${"draw"===t.source}
@change=${()=>this.host._spaceDialog=f(t,"draw")} />
@change=${()=>this.host._spaceDialog=y(t,"draw")} />
<span>${this.host._t("space.source_draw")}</span>
</label>
@@ -85,7 +85,7 @@ globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="b6d9eb672c772bca7fa08bf25b4525cc8bbf
<label class="dispsection">${this.host._t("space.display_section")}</label>
<label class="srcrow">
${this._boolInput(t.showBorders,s=>{this.host._spaceDialog=y(t,"showBorders",s)})}
${this._boolInput(t.showBorders,s=>{this.host._spaceDialog=f(t,"showBorders",s)})}
<span>${this.host._t("space.show_borders")}</span>
</label>
<label>${this.host._t("space.zero_wall_style")}</label>
@@ -99,7 +99,7 @@ globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="b6d9eb672c772bca7fa08bf25b4525cc8bbf
</select>
<div class="rhint">${this.host._t("space.zero_wall_help")}</div>
<label class="srcrow">
${this._boolInput(t.showNames,s=>{this.host._spaceDialog=y(t,"showNames",s)})}
${this._boolInput(t.showNames,s=>{this.host._spaceDialog=f(t,"showNames",s)})}
<span>${this.host._t("space.show_names")}</span>
</label>
<label class="srcrow">
@@ -1 +1 @@
function e(e,o){return{id:e,title:o,plan_url:null,view_box:[0,0,1,1],rooms:[],wall_segments:[]}}function o(e="file"){const o="draw"===e;return{source:e,showBorders:o,showNames:o,displayTouched:!1}}function r(e,o){if(e.displayTouched)return{...e,source:o};const r="draw"===o;return{...e,source:o,showBorders:r,showNames:r}}function s(e,o,r){return{...e,[o]:r,displayTouched:!0}}function t(e,o,r){const s=(e?.spaces||[]).find(e=>e?.id===r),t=new Set((s?.rooms||[]).map(e=>String(e?.id||"")).filter(Boolean)),n=[...new Set((e?.markers||[]).filter(e=>!0!==e?.removed&&"string"==typeof e?.id).filter(e=>e.space===r||"string"==typeof e.room_id&&t.has(e.room_id)||o?.[e.id]?.s===r).map(e=>e.id))].sort((e,o)=>e.localeCompare(o));return{markerIds:n,count:n.length}}globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="b6d9eb672c772bca7fa08bf25b4525cc8bbf3084320f383f16ab86a535090444";export{t as a,e as c,o as i,r as s,s as t};
function e(e,o){return{id:e,title:o,plan_url:null,view_box:[0,0,1,1],rooms:[],wall_segments:[]}}function o(e="file"){const o="draw"===e;return{source:e,showBorders:o,showNames:o,displayTouched:!1}}function r(e,o){if(e.displayTouched)return{...e,source:o};const r="draw"===o;return{...e,source:o,showBorders:r,showNames:r}}function s(e,o,r){return{...e,[o]:r,displayTouched:!0}}function t(e,o,r){const s=(e?.spaces||[]).find(e=>e?.id===r),t=new Set((s?.rooms||[]).map(e=>String(e?.id||"")).filter(Boolean)),a=[...new Set((e?.markers||[]).filter(e=>!0!==e?.removed&&"string"==typeof e?.id).filter(e=>e.space===r||"string"==typeof e.room_id&&t.has(e.room_id)||o?.[e.id]?.s===r).map(e=>e.id))].sort((e,o)=>e.localeCompare(o));return{markerIds:a,count:a.length}}globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="96c69e4400be9bc5c58d138a95af946a3cf0486ac19b272137ade84bb9b35878";export{t as a,e as c,o as i,r as s,s as t};
+1 -1
View File
@@ -1 +1 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="b6d9eb672c772bca7fa08bf25b4525cc8bbf3084320f383f16ab86a535090444";export{d6 as HouseplanCard}from"./houseplan-assets/houseplan-card-BC4jkFdL.js";
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="96c69e4400be9bc5c58d138a95af946a3cf0486ac19b272137ade84bb9b35878";export{d6 as HouseplanCard}from"./houseplan-assets/houseplan-card-0bp2acAx.js";
+2 -2
View File
@@ -11,8 +11,8 @@
- View now starts without downloading the three editors; their shared runtime
is loaded on first use and protected by one retry and a build-version check.
Release and test tooling now verify the complete multi-file frontend asset
tree rather than one JavaScript file
Release tooling verifies both runtime versions, while test tooling checks the
complete multi-file frontend asset tree rather than one JavaScript file
([#337](https://github.com/Matysh/houseplan-card/issues/337)).
- The wall-junction checks are honest at the boundaries: false refusals on
+2 -2
View File
@@ -17,8 +17,8 @@
- Режим просмотра теперь запускается без загрузки трёх редакторов: их общий
runtime подгружается при первом обращении и защищён повторной попыткой и
проверкой версии сборки. Релизные и тестовые инструменты проверяют всё дерево
frontend-ассетов, а не один JavaScript-файл
проверкой версии сборки. Релизные инструменты сверяют версии обоих runtime,
а тестовые — всё дерево frontend-ассетов, а не один JavaScript-файл
([#337](https://github.com/Matysh/houseplan-card/issues/337)).
- Проверки стыков стен стали честными на границах: ложные отказы на
+11 -11
View File
@@ -3,7 +3,7 @@
"fixture": "synthetic-only",
"chromium": "151.0.7922.34",
"oxipng": "oxipng 10.2.0",
"sourceFingerprint": "2eecd0f0f11d6e8db0760d0572337aed57370d4fcdd7b1f471594f2c75d04fcc",
"sourceFingerprint": "be9676025788af910419abcb7cd2896e99eb69619e5944639312c55661266c60",
"captureScriptSha256": "fe76c8e2e27501e9a377d7aa15dd6cba6a018d55c07deb602dbee097f0a0a5ba",
"command": "npm run build && node demo/docs/capture.mjs",
"scenarios": {
@@ -15,7 +15,7 @@
},
"theme": "dark",
"language": "en",
"sourceSha256": "2eecd0f0f11d6e8db0760d0572337aed57370d4fcdd7b1f471594f2c75d04fcc",
"sourceSha256": "be9676025788af910419abcb7cd2896e99eb69619e5944639312c55661266c60",
"imageSha256": "f8c9541c9d7fde462d0efba63dff70944dc03df76ce988eecaf2b269e2863a96"
},
"view-touch": {
@@ -26,7 +26,7 @@
},
"theme": "dark",
"language": "en",
"sourceSha256": "2eecd0f0f11d6e8db0760d0572337aed57370d4fcdd7b1f471594f2c75d04fcc",
"sourceSha256": "be9676025788af910419abcb7cd2896e99eb69619e5944639312c55661266c60",
"imageSha256": "21c6fe7d79ff5c878ade8e98a64cc90dfd7bcc66338c864fb5a0bd411471313d"
},
"space-create": {
@@ -37,7 +37,7 @@
},
"theme": "dark",
"language": "en",
"sourceSha256": "2eecd0f0f11d6e8db0760d0572337aed57370d4fcdd7b1f471594f2c75d04fcc",
"sourceSha256": "be9676025788af910419abcb7cd2896e99eb69619e5944639312c55661266c60",
"imageSha256": "f6d190f0b2ac9125cea68aea2ebbcdf9a7081ae2a3565ff253fb1ed0c4a56483"
},
"room-contour-close": {
@@ -48,7 +48,7 @@
},
"theme": "dark",
"language": "en",
"sourceSha256": "2eecd0f0f11d6e8db0760d0572337aed57370d4fcdd7b1f471594f2c75d04fcc",
"sourceSha256": "be9676025788af910419abcb7cd2896e99eb69619e5944639312c55661266c60",
"imageSha256": "ca8bb143d0d6679ff09f8e9c1f5ad68b2ca7cfd96a4740a4a650c251f55dfba5"
},
"plan-context-tray": {
@@ -59,7 +59,7 @@
},
"theme": "dark",
"language": "en",
"sourceSha256": "2eecd0f0f11d6e8db0760d0572337aed57370d4fcdd7b1f471594f2c75d04fcc",
"sourceSha256": "be9676025788af910419abcb7cd2896e99eb69619e5944639312c55661266c60",
"imageSha256": "06b67c5108f9ee29a226cc2920484ccffe0c79840aec09721072b25b91ef8f03"
},
"device-editor": {
@@ -70,7 +70,7 @@
},
"theme": "dark",
"language": "en",
"sourceSha256": "2eecd0f0f11d6e8db0760d0572337aed57370d4fcdd7b1f471594f2c75d04fcc",
"sourceSha256": "be9676025788af910419abcb7cd2896e99eb69619e5944639312c55661266c60",
"imageSha256": "9e435a6fe89564b9215b82a61fb7eae998266dd05483524ffa84160c35630e0c"
},
"device-display-preview": {
@@ -81,7 +81,7 @@
},
"theme": "dark",
"language": "en",
"sourceSha256": "2eecd0f0f11d6e8db0760d0572337aed57370d4fcdd7b1f471594f2c75d04fcc",
"sourceSha256": "be9676025788af910419abcb7cd2896e99eb69619e5944639312c55661266c60",
"imageSha256": "cc5abe1b3364bf9812bea6ea5cfa84f35120ff9639ed3c4c92958cb646a8caf7"
},
"background-editor": {
@@ -92,7 +92,7 @@
},
"theme": "dark",
"language": "en",
"sourceSha256": "2eecd0f0f11d6e8db0760d0572337aed57370d4fcdd7b1f471594f2c75d04fcc",
"sourceSha256": "be9676025788af910419abcb7cd2896e99eb69619e5944639312c55661266c60",
"imageSha256": "7e308a2b105fa6a9f788449ca30b8183375a32f0d0f8726f4a131e4f35527f57"
},
"room-card": {
@@ -103,7 +103,7 @@
},
"theme": "dark",
"language": "en",
"sourceSha256": "2eecd0f0f11d6e8db0760d0572337aed57370d4fcdd7b1f471594f2c75d04fcc",
"sourceSha256": "be9676025788af910419abcb7cd2896e99eb69619e5944639312c55661266c60",
"imageSha256": "f1bc10b478f7afc68e70cb4c37148f680b0bbd41d50a7d63a21067fc952ff134"
},
"device-info": {
@@ -114,7 +114,7 @@
},
"theme": "dark",
"language": "en",
"sourceSha256": "2eecd0f0f11d6e8db0760d0572337aed57370d4fcdd7b1f471594f2c75d04fcc",
"sourceSha256": "be9676025788af910419abcb7cd2896e99eb69619e5944639312c55661266c60",
"imageSha256": "2634cd7ead5720ce46ea4d6fa8f31006b740c520a73ddc97afe9a6d9d3b49778"
}
}
+8 -1
View File
@@ -17,14 +17,19 @@ export function versionFromTag(tag) {
return { version, prerelease: !!match[4] };
}
export function parseVersionSources({ packageJson, packageLock, manifest, constSource, cardSource }) {
export function parseVersionSources({
packageJson, packageLock, manifest, constSource, cardSource, editorRuntimeSource,
}) {
const pkg = JSON.parse(packageJson);
const lock = JSON.parse(packageLock);
const integration = JSON.parse(manifest);
const constMatch = /^VERSION\s*=\s*["']([^"']+)["']/m.exec(constSource);
const cardMatch = /\bCARD_VERSION\s*=\s*["']([^"']+)["']/m.exec(cardSource);
const editorRuntimeMatch = /\bCARD_VERSION\s*=\s*["']([^"']+)["']/m.exec(editorRuntimeSource);
if (!constMatch) throw new Error('VERSION is missing from custom_components/houseplan/const.py');
if (!cardMatch) throw new Error('CARD_VERSION is missing from src/houseplan-card.ts');
if (!editorRuntimeMatch)
throw new Error('CARD_VERSION is missing from src/houseplan-editor-runtime.ts');
return {
'package.json': pkg.version,
'package-lock.json': lock.version,
@@ -32,6 +37,7 @@ export function parseVersionSources({ packageJson, packageLock, manifest, constS
'custom_components/houseplan/manifest.json': integration.version,
'custom_components/houseplan/const.py': constMatch[1],
'src/houseplan-card.ts': cardMatch[1],
'src/houseplan-editor-runtime.ts': editorRuntimeMatch[1],
};
}
@@ -118,6 +124,7 @@ export function readReleaseContract(root = process.cwd()) {
manifest: read('custom_components/houseplan/manifest.json'),
constSource: read('custom_components/houseplan/const.py'),
cardSource: read('src/houseplan-card.ts'),
editorRuntimeSource: read('src/houseplan-editor-runtime.ts'),
}),
changelogRu: read('docs/CHANGELOG.ru.md'),
changelogEn: read('docs/CHANGELOG.md'),
+1 -1
View File
@@ -331,7 +331,7 @@ import {
} from './space-order';
import { applyOpeningMoves, mergeCollinearPartitions, spaceMergeGeometry } from './wall-merge';
const CARD_VERSION = '1.68.1';
const CARD_VERSION = '1.69.0-beta.1';
type ResizeLiveLabel = {
kind: 'length';
+8 -1
View File
@@ -63,9 +63,16 @@ test('version sources include every shipped authority and must match the tag', (
manifest: '{"version":"1.2.3-beta.4"}',
constSource: 'VERSION = "1.2.3-beta.4"',
cardSource: "const CARD_VERSION = '1.2.3-beta.4';",
editorRuntimeSource: "const CARD_VERSION = '1.2.3-beta.4';",
});
assert.equal(Object.keys(sources).length, 6);
assert.equal(Object.keys(sources).length, 7);
assert.equal(validateVersionSources('v1.2.3-beta.4', sources).version, '1.2.3-beta.4');
assert.throws(
() => validateVersionSources('v1.2.3-beta.4', {
...sources, 'src/houseplan-editor-runtime.ts': '1.2.3-beta.3',
}),
/src\/houseplan-editor-runtime\.ts="1\.2\.3-beta\.3"/,
);
assert.throws(
() => validateVersionSources('v1.2.3-beta.5', sources),
/Version 1\.2\.3-beta\.5 is not synchronized/,