feat: expose decor default color in main toolbar

Issue: #360
User-Visible: yes
This commit is contained in:
Sergey Matyunin
2026-08-29 11:48:50 +03:00
parent e21f02b295
commit 822c8000a2
24 changed files with 323 additions and 148 deletions
@@ -1,113 +1,113 @@
{
"schema": 1,
"fingerprint": "85e7ae377037b95fd5b83256bfa219e51d7803958451f6464ebda60012fb992c",
"fingerprint": "b76f28b2db2f8889fefaa8ea917e3afbad86383c2ea21d1fec3eba92af67c5b6",
"entry": "houseplan-card.js",
"initialViewFiles": [
"houseplan-assets/houseplan-card-DixNXV2a.js",
"houseplan-assets/houseplan-card-DCggDxve.js",
"houseplan-card.js"
],
"initialViewGzipBytes": 273721,
"initialViewGzipBytes": 273697,
"lazyFiles": [
"houseplan-assets/backdrop-pick-CvepstVV.js",
"houseplan-assets/de-BM8NCrN8.js",
"houseplan-assets/editor-DXpLF1rD.js",
"houseplan-assets/houseplan-editor-runtime-D0P8ibWI.js",
"houseplan-assets/houseplan-onboarding-runtime-B0QF2bj1.js"
"houseplan-assets/backdrop-pick-qoGkr9B3.js",
"houseplan-assets/de-CDaPitbg.js",
"houseplan-assets/editor-CasKiVVQ.js",
"houseplan-assets/houseplan-editor-runtime-DpcuLOlh.js",
"houseplan-assets/houseplan-onboarding-runtime-g7xdzkz_.js"
],
"lazyGzipBytes": 168963,
"lazyGzipBytes": 168977,
"lazyEditorFiles": [
"houseplan-assets/backdrop-pick-CvepstVV.js",
"houseplan-assets/editor-DXpLF1rD.js",
"houseplan-assets/houseplan-editor-runtime-D0P8ibWI.js"
"houseplan-assets/backdrop-pick-qoGkr9B3.js",
"houseplan-assets/editor-CasKiVVQ.js",
"houseplan-assets/houseplan-editor-runtime-DpcuLOlh.js"
],
"lazyEditorGzipBytes": 139669,
"lazyEditorGzipBytes": 139700,
"lazyOnboardingFiles": [
"houseplan-assets/backdrop-pick-CvepstVV.js",
"houseplan-assets/houseplan-onboarding-runtime-B0QF2bj1.js"
"houseplan-assets/backdrop-pick-qoGkr9B3.js",
"houseplan-assets/houseplan-onboarding-runtime-g7xdzkz_.js"
],
"lazyOnboardingGzipBytes": 9452,
"lazyOnboardingGzipBytes": 9445,
"lazyLocaleFiles": [
"houseplan-assets/de-BM8NCrN8.js"
"houseplan-assets/de-CDaPitbg.js"
],
"lazyLocaleGzipBytes": 22798,
"lazyLocaleGzipBytes": 22783,
"files": [
{
"path": "houseplan-assets/backdrop-pick-CvepstVV.js",
"sha256": "65ed051c27c29cf09b6d749a776c5800b69ea1d14e36938615256d0024a1e145",
"path": "houseplan-assets/backdrop-pick-qoGkr9B3.js",
"sha256": "e3bf2e1ca0f3352a31390d29596c901b60d3451bd65acb11045a4d2b9ab666a6",
"rawBytes": 6967,
"gzipBytes": 2956,
"gzipBytes": 2951,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-DixNXV2a.js"
"houseplan-assets/houseplan-card-DCggDxve.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/de-BM8NCrN8.js",
"sha256": "f8f403962be68c64e940567d287986f3835f59b1ebbdc19646ada9bbd5d8ab04",
"path": "houseplan-assets/de-CDaPitbg.js",
"sha256": "968d659500403eee7ab7c8a0d6159621972df977b0b52a20c324921b6e309e09",
"rawBytes": 74836,
"gzipBytes": 22798,
"gzipBytes": 22783,
"isEntry": false,
"imports": [],
"dynamicImports": []
},
{
"path": "houseplan-assets/editor-DXpLF1rD.js",
"sha256": "fdc4c87382df8f2a107d09ffe9b64ce7f6c6286d6da98b1a165f330f425526cb",
"path": "houseplan-assets/editor-CasKiVVQ.js",
"sha256": "c0ec3ab48e3d7a5bb767f02e7519ecdff932e4cb70a34f562a67b65f322c2350",
"rawBytes": 3831,
"gzipBytes": 1586,
"gzipBytes": 1581,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-DixNXV2a.js"
"houseplan-assets/houseplan-card-DCggDxve.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/houseplan-card-DixNXV2a.js",
"sha256": "7641bc6da5f2fbc6d28dec1ec387c212e6ecc350bcb62ad7dd0379fc4aafb1ad",
"path": "houseplan-assets/houseplan-card-DCggDxve.js",
"sha256": "57bd9d474cdccceed23e0acf6b309ea216a29debf5eed20657ba978307b80133",
"rawBytes": 964180,
"gzipBytes": 272965,
"gzipBytes": 272947,
"isEntry": false,
"imports": [],
"dynamicImports": [
"houseplan-assets/de-BM8NCrN8.js",
"houseplan-assets/editor-DXpLF1rD.js",
"houseplan-assets/houseplan-editor-runtime-D0P8ibWI.js",
"houseplan-assets/houseplan-onboarding-runtime-B0QF2bj1.js"
"houseplan-assets/de-CDaPitbg.js",
"houseplan-assets/editor-CasKiVVQ.js",
"houseplan-assets/houseplan-editor-runtime-DpcuLOlh.js",
"houseplan-assets/houseplan-onboarding-runtime-g7xdzkz_.js"
]
},
{
"path": "houseplan-assets/houseplan-editor-runtime-D0P8ibWI.js",
"sha256": "09a45a472cf44fd6b06a0ae633167c13c6c0a9a34e7231d74e42adc081d42df4",
"rawBytes": 522926,
"gzipBytes": 135127,
"path": "houseplan-assets/houseplan-editor-runtime-DpcuLOlh.js",
"sha256": "4d0827d46f53b2ed22be6bf7a16dd9ab4fa97a04d340f236165eb6cd281891f9",
"rawBytes": 523356,
"gzipBytes": 135168,
"isEntry": false,
"imports": [
"houseplan-assets/backdrop-pick-CvepstVV.js",
"houseplan-assets/houseplan-card-DixNXV2a.js"
"houseplan-assets/backdrop-pick-qoGkr9B3.js",
"houseplan-assets/houseplan-card-DCggDxve.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/houseplan-onboarding-runtime-B0QF2bj1.js",
"sha256": "6d5f232a64ac14cb753720f2072980afddbc2ee782edd8fa1f5d3aabc9a4797d",
"path": "houseplan-assets/houseplan-onboarding-runtime-g7xdzkz_.js",
"sha256": "292254483f1dd92dccbafc1600335127cf50206b5a58e53972ef514c7368c9f6",
"rawBytes": 26195,
"gzipBytes": 6496,
"gzipBytes": 6494,
"isEntry": false,
"imports": [
"houseplan-assets/backdrop-pick-CvepstVV.js",
"houseplan-assets/houseplan-card-DixNXV2a.js"
"houseplan-assets/backdrop-pick-qoGkr9B3.js",
"houseplan-assets/houseplan-card-DCggDxve.js"
],
"dynamicImports": []
},
{
"path": "houseplan-card.js",
"sha256": "761e7cb26d6b198817e11d7e73a1fa8c602f129e6b91de424360c81d063d1e07",
"sha256": "c463ada4a8f02a5decf4a62a425cffb08f7d8ef22ec9c964e05474dce8b8aa16",
"rawBytes": 1089,
"gzipBytes": 756,
"gzipBytes": 750,
"isEntry": true,
"imports": [
"houseplan-assets/houseplan-card-DixNXV2a.js"
"houseplan-assets/houseplan-card-DCggDxve.js"
],
"dynamicImports": []
}
File diff suppressed because one or more lines are too long
@@ -1,14 +1,14 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="85e7ae377037b95fd5b83256bfa219e51d7803958451f6464ebda60012fb992c";import{c as e,l as o,t,cZ as s,A as a,c_ as i,c$ as l,d0 as n,E as r,b as c}from"./houseplan-card-DixNXV2a.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__="b76f28b2db2f8889fefaa8ea917e3afbad86383c2ea21d1fec3eba92af67c5b6";import{c as e,l as o,t,cZ as s,A as a,c_ as i,c$ as l,d0 as n,E as r,b as c}from"./houseplan-card-DCggDxve.js";class f 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,f={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")},h=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}
.computeLabel=${e=>h[e.name]||e.name}
.computeLabel=${e=>f[e.name]||e.name}
@value-changed=${this._valueChanged}
></ha-form>`;return c`
${d(f.slice(0,3))}
${d(h.slice(0,3))}
${_?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:_})}
</div>`:a}
${d(f.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);
${d(h.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)}}f.properties={hass:{attribute:!1},_config:{state:!0},_spaces:{state:!0}},customElements.get("houseplan-card-editor")||customElements.define("houseplan-card-editor",f);
@@ -1,4 +1,4 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="85e7ae377037b95fd5b83256bfa219e51d7803958451f6464ebda60012fb992c";import{bT as t,bU as s,bV as e,bW as o,aq as a,bX as l,c0 as i,bY as h,bZ as c,b_ as n,b$ as r,A as p,b as _,cR as d,ap as u,ar as g,cS as m}from"./houseplan-card-DixNXV2a.js";import{i as b,c as $,e as v,r as f,a as y,b as w,s as D,t as S}from"./backdrop-pick-CvepstVV.js";const k=1e3,C=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},M="85e7ae377037b95fd5b83256bfa219e51d7803958451f6464ebda60012fb992c";class F{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),c=i.settings?.custom_fill&&"object"==typeof i.settings.custom_fill?s(i.settings.custom_fill):null,n="none"===h.fill?{...c||e,a:0}:c;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:n,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:n,fillMode:"custom",customFill:{...e,a:0},glowEnabled:!0,bgColor:null,bgMode:"daynight",northDeg:null,sunRays:null,tempMin:c,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;s.value="";const o=await $(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 v(e,o.ext,e.name);this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:a})}_renderBackdropGuard(){return f(this.host,t=>{this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:t})},()=>{this.host._backdropGuard=null},this.host.hass)??p}_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 _`<div class="savedplans muted">${this.host._t("space.loading")}</div>`;const s=t.saved||[];if(!s.length)return _`<div class="savedplans muted">${this.host._t("space.no_saved")}</div>`;return _`<div class="savedplans">
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="b76f28b2db2f8889fefaa8ea917e3afbad86383c2ea21d1fec3eba92af67c5b6";import{bT as t,bU as s,bV as e,bW as o,aq as a,bX as l,c0 as i,bY as h,bZ as c,b_ as n,b$ as r,A as p,b as _,cR as d,ap as u,ar as g,cS as m}from"./houseplan-card-DCggDxve.js";import{i as b,c as $,e as v,r as f,a as y,b as w,s as D,t as S}from"./backdrop-pick-qoGkr9B3.js";const k=1e3,C=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},M="b76f28b2db2f8889fefaa8ea917e3afbad86383c2ea21d1fec3eba92af67c5b6";class F{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),c=i.settings?.custom_fill&&"object"==typeof i.settings.custom_fill?s(i.settings.custom_fill):null,n="none"===h.fill?{...c||e,a:0}:c;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:n,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:n,fillMode:"custom",customFill:{...e,a:0},glowEnabled:!0,bgColor:null,bgMode:"daynight",northDeg:null,sunRays:null,tempMin:c,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;s.value="";const o=await $(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 v(e,o.ext,e.name);this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:a})}_renderBackdropGuard(){return f(this.host,t=>{this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:t})},()=>{this.host._backdropGuard=null},this.host.hass)??p}_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 _`<div class="savedplans muted">${this.host._t("space.loading")}</div>`;const s=t.saved||[];if(!s.length)return _`<div class="savedplans muted">${this.host._t("space.no_saved")}</div>`;return _`<div class="savedplans">
${s.map(s=>{return _`
<div class="savedplan ${s.url===t.planUrl?"cur":""}">
<img src=${this.host._display(s.url)} alt="" loading="lazy" decoding="async" />
@@ -1 +1 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="85e7ae377037b95fd5b83256bfa219e51d7803958451f6464ebda60012fb992c";try{await import("./houseplan-assets/houseplan-card-DixNXV2a.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).":"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__="b76f28b2db2f8889fefaa8ea917e3afbad86383c2ea21d1fec3eba92af67c5b6";try{await import("./houseplan-assets/houseplan-card-DCggDxve.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).":"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)}
+125 -8
View File
@@ -126,24 +126,102 @@ const res = await page.evaluate(async () => {
c._decorSel = null; c._decorTool = 'select'; c._furnPalette = null;
c._cfgEpoch = (c._cfgEpoch || 0) + 1;
c.requestUpdate(); await c.updateComplete;
// The compact colour/opacity control must escape the clipped editor/dialog
// surface through the browser top layer and remain inside the viewport.
// #360: the shared session default is permanently available in the primary
// toolbar, while the drawing context keeps its existing synchronized picker.
c._decorTool = 'line'; c.requestUpdate(); await c.updateComplete;
const picker = sr().querySelector('.editor-secondary hp-color-opacity');
out.transientStyleLivesInContextTray = !!picker
&& !sr().querySelector('.decorbar hp-color-opacity');
const trigger = picker?.shadowRoot?.querySelector('.trigger');
const mainPicker = () => sr().querySelector('.decorbar hp-color-opacity.decor-default-color');
out.defaultStyleLivesInMainBarAndContextTray = !!picker && !!mainPicker();
const toolsWithDefault = [];
for (const tool of ['select', 'backdrop', 'line', 'rect', 'ellipse', 'text', 'furniture', 'erase']) {
c._decorTool = tool; c.requestUpdate(); await c.updateComplete;
toolsWithDefault.push(!!mainPicker());
}
out.defaultStyleVisibleForEveryDecorTool = toolsWithDefault.every(Boolean);
c._decorTool = 'line'; c.requestUpdate(); await c.updateComplete;
const originalDecorStyle = { ...c._decorStyle };
const originalDecorForDefaultProbe = JSON.parse(JSON.stringify(c._decorList));
const existingDefaultProbe = {
id: 'dc-default-existing', kind: 'line', x1: 0.05, y1: 0.05, x2: 0.1, y2: 0.05,
color: '#112233', opacity: 0.8, width_cm: 3,
};
c._curSpaceCfg.decor = [existingDefaultProbe];
c._decorStyle = {
...c._decorStyle, fill: true, fillColor: '#fedcba', fillOpacity: 0.23,
};
c._cfgEpoch = (c._cfgEpoch || 0) + 1;
c.requestUpdate(); await c.updateComplete;
mainPicker().dispatchEvent(new CustomEvent('hp-color-opacity-change', {
detail: { color: '#2468ac', opacity: 0.37 }, bubbles: true, composed: true,
}));
await c.updateComplete;
const contextAfterMain = sr().querySelector('.editor-secondary hp-color-opacity');
out.mainPickerUpdatesOneSessionDefault = c._decorStyle.color === '#2468ac'
&& c._decorStyle.opacity === 0.37
&& contextAfterMain?.color === '#2468ac' && contextAfterMain?.opacity === 0.37;
out.mainPickerLeavesExistingObjectsUntouched =
JSON.stringify(c._decorList[0]) === JSON.stringify(existingDefaultProbe);
contextAfterMain.dispatchEvent(new CustomEvent('hp-color-opacity-change', {
detail: { color: '#3579bd', opacity: 0.46 }, bubbles: true, composed: true,
}));
await c.updateComplete;
out.contextPickerUpdatesMainPicker = c._decorStyle.color === '#3579bd'
&& c._decorStyle.opacity === 0.46
&& mainPicker()?.color === '#3579bd' && mainPicker()?.opacity === 0.46;
const gDefault = c._gridPitch;
for (const [kind, a, b] of [
['line', [gDefault * 2, gDefault * 2], [gDefault * 6, gDefault * 2]],
['rect', [gDefault * 8, gDefault * 2], [gDefault * 12, gDefault * 6]],
['ellipse', [gDefault * 14, gDefault * 2], [gDefault * 18, gDefault * 6]],
]) {
c._decorDraft = { kind, a, b, pid: 370 };
c._decorCommitDraft();
}
c._decorTool = 'text'; c._decorTextDialog = null;
c._decorPointerDown({
target: sr().querySelector('.stage'), preventDefault() {}, pointerType: 'mouse', pointerId: 371,
clientX: sr().querySelector('.stage').getBoundingClientRect().left + 12,
clientY: sr().querySelector('.stage').getBoundingClientRect().top + 12,
});
const textInheritsDefault = c._decorTextDialog?.color === '#3579bd'
&& c._decorTextDialog?.opacity === 0.46;
c._decorTextDialog = { ...c._decorTextDialog, text: 'Default probe' };
c._decorSaveText();
c._furnPalette = { symbol: 'chair', w: 45, h: 45 };
c._furnPlace([gDefault * 24, gDefault * 12], true);
await c.updateComplete;
const createdByDefault = c._decorList.filter((shape) => shape.id !== existingDefaultProbe.id);
out.everyNewDecorKindUsesMainDefault = textInheritsDefault
&& ['line', 'rect', 'ellipse', 'text', 'furniture'].every((kind) =>
createdByDefault.some((shape) => shape.kind === kind
&& shape.color === '#3579bd' && shape.opacity === 0.46));
out.mainDefaultDoesNotOverwriteShapeFill = ['rect', 'ellipse'].every((kind) => {
const shape = createdByDefault.find((entry) => entry.kind === kind);
return shape?.fill === true && shape?.fill_color === '#fedcba'
&& shape?.fill_opacity === 0.23;
});
c._curSpaceCfg.decor = originalDecorForDefaultProbe;
c._decorStyle = originalDecorStyle;
c._decorSel = null; c._decorTool = 'line'; c._furnPalette = null;
c._cfgEpoch = (c._cfgEpoch || 0) + 1;
c.requestUpdate(); await c.updateComplete;
// The compact colour/opacity control must escape the clipped editor/dialog
// surface through the browser top layer and remain inside the viewport.
const popoverPicker = sr().querySelector('.editor-secondary hp-color-opacity');
const trigger = popoverPicker?.shadowRoot?.querySelector('.trigger');
trigger?.click();
await picker?.updateComplete;
await popoverPicker?.updateComplete;
await new Promise((resolve) => requestAnimationFrame(() => requestAnimationFrame(resolve)));
const popup = picker?.shadowRoot?.querySelector('.picker');
const popup = popoverPicker?.shadowRoot?.querySelector('.picker');
const popupRect = popup?.getBoundingClientRect();
out.colorPickerUsesTopLayer = !!popup?.matches(':popover-open');
out.colorPickerInsideViewport = !!popupRect
&& popupRect.left >= 0 && popupRect.top >= 0
&& popupRect.right <= innerWidth && popupRect.bottom <= innerHeight;
trigger?.click();
await picker?.updateComplete;
await popoverPicker?.updateComplete;
// seven tools (the six drawing ones + «Мебель», docs/FURNITURE.md) plus
// «Картинка-подложка», which f1 offers because it HAS a picture
// (docs/BACKDROP.md §2); a hand-drawn space still shows seven
@@ -362,6 +440,8 @@ const res = await page.evaluate(async () => {
&& editedProbe?.width_cm === 6.5 && editedProbe?.width === undefined
&& editedProbe?.line_style === 'dashed'
&& c._decorShapeDialog === null;
out.objectDialogRefreshesMainDefault = c._decorStyle.color === '#123456'
&& sr().querySelector('.decorbar hp-color-opacity.decor-default-color')?.color === '#123456';
out.dashedLineRendered = !!probe()?.getAttribute('stroke-dasharray');
c._undoGeometry(); await c.updateComplete;
const undoSolid = !c._decorList.find((x) => x.id === 'dcprobe')?.line_style;
@@ -452,6 +532,43 @@ const res = await page.evaluate(async () => {
out.deleteKey = c._decorList.length === n1 - 1;
return out;
});
await page.setViewportSize({ width: 560, height: 820 });
Object.assign(res, await page.evaluate(async () => {
const c = window.__card;
const sr = () => c.shadowRoot || c.renderRoot;
c._setMode('decor');
await c.updateComplete;
const tools = sr().querySelector('.decorbar .editbar-tools');
const end = sr().querySelector('.decorbar .editbar-end');
const picker = sr().querySelector('.decorbar hp-color-opacity.decor-default-color');
const trigger = picker?.shadowRoot?.querySelector('.trigger');
const toolsRect = tools?.getBoundingClientRect();
const endRect = end?.getBoundingClientRect();
const themeStates = [];
for (const darkMode of [false, true]) {
c.hass = { ...c.hass, themes: { ...(c.hass.themes || {}), darkMode } };
await c.updateComplete;
const rect = trigger?.getBoundingClientRect();
themeStates.push(!!rect && rect.width === 40 && rect.height === 40
&& getComputedStyle(trigger).visibility === 'visible');
}
trigger?.click();
await picker?.updateComplete;
await new Promise((resolve) => requestAnimationFrame(() => requestAnimationFrame(resolve)));
const popupRect = picker?.shadowRoot?.querySelector('.picker')?.getBoundingClientRect();
const popupInside = !!popupRect && popupRect.left >= 0 && popupRect.top >= 0
&& popupRect.right <= innerWidth && popupRect.bottom <= innerHeight;
trigger?.click();
await picker?.updateComplete;
return {
narrowToolbarKeepsToolsAndCloseApart: !!toolsRect && !!endRect
&& toolsRect.right <= endRect.left + 0.5
&& sr().querySelectorAll('.decorbar .btn.dtool').length === 8
&& !!sr().querySelector('.decorbar .barclose'),
narrowToolbarKeepsDefaultPickerUsable: !!picker && popupInside,
defaultPickerReadableInLightAndDark: themeStates.every(Boolean),
};
}));
// значение плашки зафиксировано числом: 12 клеток × cell_cm 5 = 0.60 m, 0°
checkAll(res, { lineBadgeText: '0.60 m · 0°' });
await finish(browser, res);
+50 -50
View File
@@ -1,113 +1,113 @@
{
"schema": 1,
"fingerprint": "85e7ae377037b95fd5b83256bfa219e51d7803958451f6464ebda60012fb992c",
"fingerprint": "b76f28b2db2f8889fefaa8ea917e3afbad86383c2ea21d1fec3eba92af67c5b6",
"entry": "houseplan-card.js",
"initialViewFiles": [
"houseplan-assets/houseplan-card-DixNXV2a.js",
"houseplan-assets/houseplan-card-DCggDxve.js",
"houseplan-card.js"
],
"initialViewGzipBytes": 273721,
"initialViewGzipBytes": 273697,
"lazyFiles": [
"houseplan-assets/backdrop-pick-CvepstVV.js",
"houseplan-assets/de-BM8NCrN8.js",
"houseplan-assets/editor-DXpLF1rD.js",
"houseplan-assets/houseplan-editor-runtime-D0P8ibWI.js",
"houseplan-assets/houseplan-onboarding-runtime-B0QF2bj1.js"
"houseplan-assets/backdrop-pick-qoGkr9B3.js",
"houseplan-assets/de-CDaPitbg.js",
"houseplan-assets/editor-CasKiVVQ.js",
"houseplan-assets/houseplan-editor-runtime-DpcuLOlh.js",
"houseplan-assets/houseplan-onboarding-runtime-g7xdzkz_.js"
],
"lazyGzipBytes": 168963,
"lazyGzipBytes": 168977,
"lazyEditorFiles": [
"houseplan-assets/backdrop-pick-CvepstVV.js",
"houseplan-assets/editor-DXpLF1rD.js",
"houseplan-assets/houseplan-editor-runtime-D0P8ibWI.js"
"houseplan-assets/backdrop-pick-qoGkr9B3.js",
"houseplan-assets/editor-CasKiVVQ.js",
"houseplan-assets/houseplan-editor-runtime-DpcuLOlh.js"
],
"lazyEditorGzipBytes": 139669,
"lazyEditorGzipBytes": 139700,
"lazyOnboardingFiles": [
"houseplan-assets/backdrop-pick-CvepstVV.js",
"houseplan-assets/houseplan-onboarding-runtime-B0QF2bj1.js"
"houseplan-assets/backdrop-pick-qoGkr9B3.js",
"houseplan-assets/houseplan-onboarding-runtime-g7xdzkz_.js"
],
"lazyOnboardingGzipBytes": 9452,
"lazyOnboardingGzipBytes": 9445,
"lazyLocaleFiles": [
"houseplan-assets/de-BM8NCrN8.js"
"houseplan-assets/de-CDaPitbg.js"
],
"lazyLocaleGzipBytes": 22798,
"lazyLocaleGzipBytes": 22783,
"files": [
{
"path": "houseplan-assets/backdrop-pick-CvepstVV.js",
"sha256": "65ed051c27c29cf09b6d749a776c5800b69ea1d14e36938615256d0024a1e145",
"path": "houseplan-assets/backdrop-pick-qoGkr9B3.js",
"sha256": "e3bf2e1ca0f3352a31390d29596c901b60d3451bd65acb11045a4d2b9ab666a6",
"rawBytes": 6967,
"gzipBytes": 2956,
"gzipBytes": 2951,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-DixNXV2a.js"
"houseplan-assets/houseplan-card-DCggDxve.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/de-BM8NCrN8.js",
"sha256": "f8f403962be68c64e940567d287986f3835f59b1ebbdc19646ada9bbd5d8ab04",
"path": "houseplan-assets/de-CDaPitbg.js",
"sha256": "968d659500403eee7ab7c8a0d6159621972df977b0b52a20c324921b6e309e09",
"rawBytes": 74836,
"gzipBytes": 22798,
"gzipBytes": 22783,
"isEntry": false,
"imports": [],
"dynamicImports": []
},
{
"path": "houseplan-assets/editor-DXpLF1rD.js",
"sha256": "fdc4c87382df8f2a107d09ffe9b64ce7f6c6286d6da98b1a165f330f425526cb",
"path": "houseplan-assets/editor-CasKiVVQ.js",
"sha256": "c0ec3ab48e3d7a5bb767f02e7519ecdff932e4cb70a34f562a67b65f322c2350",
"rawBytes": 3831,
"gzipBytes": 1586,
"gzipBytes": 1581,
"isEntry": false,
"imports": [
"houseplan-assets/houseplan-card-DixNXV2a.js"
"houseplan-assets/houseplan-card-DCggDxve.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/houseplan-card-DixNXV2a.js",
"sha256": "7641bc6da5f2fbc6d28dec1ec387c212e6ecc350bcb62ad7dd0379fc4aafb1ad",
"path": "houseplan-assets/houseplan-card-DCggDxve.js",
"sha256": "57bd9d474cdccceed23e0acf6b309ea216a29debf5eed20657ba978307b80133",
"rawBytes": 964180,
"gzipBytes": 272965,
"gzipBytes": 272947,
"isEntry": false,
"imports": [],
"dynamicImports": [
"houseplan-assets/de-BM8NCrN8.js",
"houseplan-assets/editor-DXpLF1rD.js",
"houseplan-assets/houseplan-editor-runtime-D0P8ibWI.js",
"houseplan-assets/houseplan-onboarding-runtime-B0QF2bj1.js"
"houseplan-assets/de-CDaPitbg.js",
"houseplan-assets/editor-CasKiVVQ.js",
"houseplan-assets/houseplan-editor-runtime-DpcuLOlh.js",
"houseplan-assets/houseplan-onboarding-runtime-g7xdzkz_.js"
]
},
{
"path": "houseplan-assets/houseplan-editor-runtime-D0P8ibWI.js",
"sha256": "09a45a472cf44fd6b06a0ae633167c13c6c0a9a34e7231d74e42adc081d42df4",
"rawBytes": 522926,
"gzipBytes": 135127,
"path": "houseplan-assets/houseplan-editor-runtime-DpcuLOlh.js",
"sha256": "4d0827d46f53b2ed22be6bf7a16dd9ab4fa97a04d340f236165eb6cd281891f9",
"rawBytes": 523356,
"gzipBytes": 135168,
"isEntry": false,
"imports": [
"houseplan-assets/backdrop-pick-CvepstVV.js",
"houseplan-assets/houseplan-card-DixNXV2a.js"
"houseplan-assets/backdrop-pick-qoGkr9B3.js",
"houseplan-assets/houseplan-card-DCggDxve.js"
],
"dynamicImports": []
},
{
"path": "houseplan-assets/houseplan-onboarding-runtime-B0QF2bj1.js",
"sha256": "6d5f232a64ac14cb753720f2072980afddbc2ee782edd8fa1f5d3aabc9a4797d",
"path": "houseplan-assets/houseplan-onboarding-runtime-g7xdzkz_.js",
"sha256": "292254483f1dd92dccbafc1600335127cf50206b5a58e53972ef514c7368c9f6",
"rawBytes": 26195,
"gzipBytes": 6496,
"gzipBytes": 6494,
"isEntry": false,
"imports": [
"houseplan-assets/backdrop-pick-CvepstVV.js",
"houseplan-assets/houseplan-card-DixNXV2a.js"
"houseplan-assets/backdrop-pick-qoGkr9B3.js",
"houseplan-assets/houseplan-card-DCggDxve.js"
],
"dynamicImports": []
},
{
"path": "houseplan-card.js",
"sha256": "761e7cb26d6b198817e11d7e73a1fa8c602f129e6b91de424360c81d063d1e07",
"sha256": "c463ada4a8f02a5decf4a62a425cffb08f7d8ef22ec9c964e05474dce8b8aa16",
"rawBytes": 1089,
"gzipBytes": 756,
"gzipBytes": 750,
"isEntry": true,
"imports": [
"houseplan-assets/houseplan-card-DixNXV2a.js"
"houseplan-assets/houseplan-card-DCggDxve.js"
],
"dynamicImports": []
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,14 +1,14 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="85e7ae377037b95fd5b83256bfa219e51d7803958451f6464ebda60012fb992c";import{c as e,l as o,t,cZ as s,A as a,c_ as i,c$ as l,d0 as n,E as r,b as c}from"./houseplan-card-DixNXV2a.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__="b76f28b2db2f8889fefaa8ea917e3afbad86383c2ea21d1fec3eba92af67c5b6";import{c as e,l as o,t,cZ as s,A as a,c_ as i,c$ as l,d0 as n,E as r,b as c}from"./houseplan-card-DCggDxve.js";class f 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,f={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")},h=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}
.computeLabel=${e=>h[e.name]||e.name}
.computeLabel=${e=>f[e.name]||e.name}
@value-changed=${this._valueChanged}
></ha-form>`;return c`
${d(f.slice(0,3))}
${d(h.slice(0,3))}
${_?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:_})}
</div>`:a}
${d(f.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);
${d(h.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)}}f.properties={hass:{attribute:!1},_config:{state:!0},_spaces:{state:!0}},customElements.get("houseplan-card-editor")||customElements.define("houseplan-card-editor",f);
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="85e7ae377037b95fd5b83256bfa219e51d7803958451f6464ebda60012fb992c";import{bT as t,bU as s,bV as e,bW as o,aq as a,bX as l,c0 as i,bY as h,bZ as c,b_ as n,b$ as r,A as p,b as _,cR as d,ap as u,ar as g,cS as m}from"./houseplan-card-DixNXV2a.js";import{i as b,c as $,e as v,r as f,a as y,b as w,s as D,t as S}from"./backdrop-pick-CvepstVV.js";const k=1e3,C=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},M="85e7ae377037b95fd5b83256bfa219e51d7803958451f6464ebda60012fb992c";class F{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),c=i.settings?.custom_fill&&"object"==typeof i.settings.custom_fill?s(i.settings.custom_fill):null,n="none"===h.fill?{...c||e,a:0}:c;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:n,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:n,fillMode:"custom",customFill:{...e,a:0},glowEnabled:!0,bgColor:null,bgMode:"daynight",northDeg:null,sunRays:null,tempMin:c,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;s.value="";const o=await $(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 v(e,o.ext,e.name);this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:a})}_renderBackdropGuard(){return f(this.host,t=>{this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:t})},()=>{this.host._backdropGuard=null},this.host.hass)??p}_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 _`<div class="savedplans muted">${this.host._t("space.loading")}</div>`;const s=t.saved||[];if(!s.length)return _`<div class="savedplans muted">${this.host._t("space.no_saved")}</div>`;return _`<div class="savedplans">
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="b76f28b2db2f8889fefaa8ea917e3afbad86383c2ea21d1fec3eba92af67c5b6";import{bT as t,bU as s,bV as e,bW as o,aq as a,bX as l,c0 as i,bY as h,bZ as c,b_ as n,b$ as r,A as p,b as _,cR as d,ap as u,ar as g,cS as m}from"./houseplan-card-DCggDxve.js";import{i as b,c as $,e as v,r as f,a as y,b as w,s as D,t as S}from"./backdrop-pick-qoGkr9B3.js";const k=1e3,C=t=>{if(!t.trim())return null;const s=Number(t.replace(",","."));return Number.isFinite(s)?s:null},M="b76f28b2db2f8889fefaa8ea917e3afbad86383c2ea21d1fec3eba92af67c5b6";class F{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),c=i.settings?.custom_fill&&"object"==typeof i.settings.custom_fill?s(i.settings.custom_fill):null,n="none"===h.fill?{...c||e,a:0}:c;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:n,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:n,fillMode:"custom",customFill:{...e,a:0},glowEnabled:!0,bgColor:null,bgMode:"daynight",northDeg:null,sunRays:null,tempMin:c,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;s.value="";const o=await $(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 v(e,o.ext,e.name);this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:a})}_renderBackdropGuard(){return f(this.host,t=>{this.host._spaceDialog&&(this.host._spaceDialog={...this.host._spaceDialog,planFile:t})},()=>{this.host._backdropGuard=null},this.host.hass)??p}_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 _`<div class="savedplans muted">${this.host._t("space.loading")}</div>`;const s=t.saved||[];if(!s.length)return _`<div class="savedplans muted">${this.host._t("space.no_saved")}</div>`;return _`<div class="savedplans">
${s.map(s=>{return _`
<div class="savedplan ${s.url===t.planUrl?"cur":""}">
<img src=${this.host._display(s.url)} alt="" loading="lazy" decoding="async" />
+1 -1
View File
@@ -1 +1 @@
globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="85e7ae377037b95fd5b83256bfa219e51d7803958451f6464ebda60012fb992c";try{await import("./houseplan-assets/houseplan-card-DixNXV2a.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).":"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__="b76f28b2db2f8889fefaa8ea917e3afbad86383c2ea21d1fec3eba92af67c5b6";try{await import("./houseplan-assets/houseplan-card-DCggDxve.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).":"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)}
+5
View File
@@ -8,6 +8,11 @@
cycle to at most twenty
([#366](https://github.com/Matysh/houseplan-card/issues/366)).
- The Background editor now keeps its default colour and opacity on the main
toolbar for every tool. One choice applies to new lines, shape outlines, text
and furniture without changing existing objects or independent shape fills
([#360](https://github.com/Matysh/houseplan-card/issues/360)).
- Furniture outline width now follows plan zoom like the same physical width
on lines and shapes, while independent width/depth resizing still keeps
horizontal, vertical and diagonal strokes equally thick
+5
View File
@@ -13,6 +13,11 @@
пересчётов геометрии вместо ~сотни за цикл — не больше двадцати
([#366](https://github.com/Matysh/houseplan-card/issues/366)).
- Редактор подложки теперь постоянно показывает основной цвет и прозрачность на
главной панели при любом инструменте. Один выбор применяется к новым линиям,
контурам фигур, тексту и мебели, не меняя готовые объекты и независимую
заливку фигур ([#360](https://github.com/Matysh/houseplan-card/issues/360)).
- Толщина контура мебели теперь меняется вместе с масштабом плана, как та же
физическая толщина у линий и фигур, а независимое изменение ширины и глубины
предмета по-прежнему не искажает горизонтальные, вертикальные и диагональные
+10 -7
View File
@@ -77,13 +77,16 @@ rectangle or sofa does not make its outline thicker. A legacy object with render
pixel-identical until edited or explicitly optimised; conversion is
`width_cm = width / GRID_PITCH × cell_cm`.
The active drawing tool's values are session defaults for newly drawn objects.
They live in the shared context tray over the stage rather than changing the
height of the permanent editor toolbar. Colour is a compact swatch; its popover
owns both the native colour field and opacity. Double-click properties edit an
existing object without creating a second style model. Select actions and the
furniture palette use variants of the same overlay host, so opening them never
refits the plan.
The primary toolbar always exposes the shared session-default colour and
opacity for new lines, shape outlines, text and furniture. The same picker also
remains in the applicable drawing context tray; both surfaces read and write one
style state. Width, fill and other active-tool values stay in the context tray
over the stage rather than changing the height of the permanent editor toolbar.
Double-click properties edit an existing object without creating a second style
model: saving colour/opacity for an existing line, shape or furniture item also
becomes the visible default for the next object, as before. Shape fill remains
independent. Select actions and the furniture palette use variants of the same
overlay host, so opening them never refits the plan.
Line style is intentionally absent from the drawing toolbar. Every new and
legacy line is Solid by default. Double-click a line with **Select** to switch
+14 -3
View File
@@ -1253,10 +1253,21 @@ Power=`off`/`unavailable` подавляет даже устаревший ак
Картинка подложки интерактивна только в своём инструменте. В остальных инструментах этого редактора она показана с непрозрачностью `0.5`, а в просмотре и других редакторах — `1.0`.
Цвет контура/текста/мебели и его прозрачность задаются общим компактным полем: нажмите на образец цвета, чтобы открыть выбор цвета и прозрачности. Толщина и размер текста хранятся физически и показываются в сантиметрах или дюймах. Поэтому при приближении плана контур мебели становится толще вместе с остальными физическими линиями, а при отдалении — тоньше; изменение ширины и глубины самого предмета толщину не искажает. Для прямоугольника и овала заливка имеет собственные цвет и прозрачность. Большие размеры в свойствах показываются в метрах или футах.
Цвет контура/текста/мебели и его прозрачность заранее задаются общим компактным
полем на основной панели: оно постоянно доступно при любом инструменте и влияет
только на новые элементы. Нажмите на образец, чтобы открыть выбор цвета и
прозрачности. Такое же поле остаётся в параметрах подходящего инструмента; оба
показывают один default. Сохранённый цвет существующей линии, фигуры или мебели
становится default следующего объекта, но не перекрашивает остальные готовые
элементы. Толщина и размер текста хранятся физически и показываются в
сантиметрах или дюймах. Поэтому при приближении плана контур мебели становится
толще вместе с остальными физическими линиями, а при отдалении — тоньше;
изменение ширины и глубины самого предмета толщину не искажает. Для
прямоугольника и овала заливка имеет собственные цвет и прозрачность. Большие
размеры в свойствах показываются в метрах или футах.
Параметры нового объекта показываются в общей суб-панели над холстом только
для применимого инструмента. При выборе готового объекта эта же панель
Остальные параметры нового объекта показываются в общей суб-панели над холстом
только для применимого инструмента. При выборе готового объекта эта же панель
показывает «Свойства» и «Удалить». Палитра мебели использует расширенный вариант
той же поверхности и также не меняет высоту или масштаб рабочей области.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 KiB

After

Width:  |  Height:  |  Size: 291 KiB

+9
View File
@@ -5409,6 +5409,15 @@ public _renderDecorBar(): TemplateResult {
</button>`,
)}
${this.host._editorToolbarGroups.map((group) => this._renderEditorGroupLauncher(group))}
<hp-color-opacity class="decor-default-color"
.label=${this.host._t('decor.color')}
.color=${this.host._decorStyle.color}
.opacity=${this.host._decorStyle.opacity}
.opacityLabel=${this.host._t('space.opacity')}
.pickerLabels=${this.host._colorPickerLabels}
@hp-color-opacity-change=${(e: CustomEvent<{ color: string; opacity: number }>) =>
(this.host._decorStyle = { ...this.host._decorStyle, ...e.detail })}>
</hp-color-opacity>
<button class="btn ghost" @click=${() => this._undoGeometry()} ?disabled=${!undoName}
title=${undoName ? this.host._t('history.undo_named', { name: undoName }) : this.host._t('history.undo_empty')}>
<ha-icon icon="mdi:undo-variant"></ha-icon>${this.host._t('history.undo')}
+11 -2
View File
@@ -54,8 +54,17 @@ test('the shared component keeps its API and contains no nested native color pic
'public color', 'public opacity', 'public disabled', 'public showOpacity',
'hp-color-opacity-change', 'detail: { color: normalized, opacity: clamped }',
]) assert.match(component, new RegExp(token.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')));
assert.equal((card.match(/<hp-color-opacity/g) || []).length, 13);
assert.equal((card.match(/\.pickerLabels=\$\{this\._colorPickerLabels\}/g) || []).length, 13);
const pickerCount = (card.match(/<hp-color-opacity/g) || []).length;
assert.ok(pickerCount > 0);
assert.equal((card.match(/\.pickerLabels=\$\{this\._colorPickerLabels\}/g) || []).length, pickerCount,
'every production picker uses the shared localized labels without a brittle call-site count');
const defaultPickerStart = card.indexOf('<hp-color-opacity class="decor-default-color"');
const defaultPickerEnd = card.indexOf('</hp-color-opacity>', defaultPickerStart);
assert.ok(defaultPickerStart >= 0 && defaultPickerEnd > defaultPickerStart);
const defaultPicker = card.slice(defaultPickerStart, defaultPickerEnd);
assert.match(defaultPicker, /\.color=\$\{this\._decorStyle\.color\}/);
assert.match(defaultPicker, /\.opacity=\$\{this\._decorStyle\.opacity\}/);
assert.match(defaultPicker, /this\._decorStyle = \{ \.\.\.this\._decorStyle, \.\.\.e\.detail \}/);
assert.equal((card.match(/\.showOpacity=\$\{false\}/g) || []).length, 4,
'Glow, ripple and both background pickers stay color-only');
assert.equal((card.match(/\.showOpacity=\$\{true\}/g) || []).length, 2,