feat: add room name switches to 3D view and editor toolbars

This commit is contained in:
jhartworks committed 2026-11-10 10:41:07 +01:00
1 parent aa834d0727
commit e3d02bbd58
4 files changed
+346 -331

No files matched your search

File diff suppressed because it is too large. Load diff
+3 -2
View File
@@ -4393,7 +4393,7 @@ ${i}`}else o=eh(s)}}catch(s){let l=s.message,a={not_json:"import_error_not_json"
color: var(--nf-soft); color: var(--nf-soft);
font-size: 13px; font-size: 13px;
} }
`]};customElements.get("nf-extensions")||customElements.define("nf-extensions",Nl);var go="handled",t_=["select","rect","polygon","wall","opening","furniture","stairs","outdoor","hole","roof","energy"],n_=new Set(["vertex","room","device","opening","furniture","rotate","resize","outdoor","roofmove","roofcorner","roofvertex","outvertex","solarmove","solarturn","bgmove","bgscale","bgrotate"]),Xi=10,He=t=>Math.round(t*1e3)/1e3,r_={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]},Bl=class extends Q{static properties={hass:{attribute:!1},building:{attribute:!1},narrow:{type:Boolean},packs:{attribute:!1},loadCardEditor:{attribute:!1},_doc:{state:!0},_doc3d:{state:!0},_split:{state:!0},_splitRatio:{state:!0},_wall3d:{state:!0},_solid3d:{state:!0},_sidePinned:{state:!0},_studio:{state:!0},_check:{state:!0},_keys:{state:!0},_note:{state:!0},_dims:{state:!0},_tour:{state:!0},_sideOpen:{state:!0},_floorId:{state:!0},_energyNote:{state:!0},_ctx:{state:!0},_fixedHint:{state:!0},_openingPreset:{state:!0},_measureLen:{state:!0},_rectSize:{state:!0},_tool:{state:!0},_wallView:{state:!0},_draft:{state:!0},_cursor:{state:!0},_guides:{state:!0},_view:{state:!0},_size:{state:!0},_canUndo:{state:!0},_canRedo:{state:!0},_arcEdit:{state:!0},_routeDraft:{state:!0}};doc3dTimer;tourChecked=!1;_pick=null;_pickTimer;fixedPan=!1;reframe3d=!1;pressTimer=0;pressStart=null;history=new Wi(100);lib=new Fi(()=>this.requestUpdate());side=new Ui(()=>this.requestUpdate());sel=new ji(()=>this.requestUpdate());host=this.makeHost();backup=this.makeBackup();roof=this.makeRoof();bg=this.makeBackground();settingsActions={useRoofSections:()=>{this.roof.useSections(),this._tool="roof"}};drag=null;pointers=new Map;pinch=null;fitted=!1;resizeObserver;constructor(){super(),this.narrow=!1,this._floorId=null,this._arcEdit=null,this._routeDraft=null,this.roof.sectionId=null,this.roof.solarId=null,this.roof.picking=!1,this.roof.windowId=null,this.roof.chimneyId=null,this._energyNote=null,this._openingPreset="door";let e=!1;try{e=localStorage.getItem("nextfloor.editor3d")==="1"}catch{}this._split=e,this._splitRatio=.55;try{let r=Number(localStorage.getItem("nextfloor.editorSplit"));r>=20&&r<=80&&(this._splitRatio=r/100)}catch{}this._wall3d="cut",this._solid3d=!1,this._doc3d=this._doc,this._sideOpen=!1;let n=!0;try{n=localStorage.getItem("nextfloor.sidePinned")!=="0"}catch{}this._sidePinned=n,this._studio=null,this._check=!1,this._keys=!1,this._note=null,this._dims=(()=>{try{return localStorage.getItem("nextfloor.plan_dims")==="1"}catch{return!1}})(),this._tour=null,this._measureLen=3,this._rectSize=[4,3],this._tool="select",this._wallView=null,this._draft=[],this._cursor=null,this._guides={},this._view={scale:50,ox:40,oy:40},this._size={w:800,h:600},this._canUndo=!1,this._canRedo=!1}t(e,n){return $e(this.hass,e,n)}measureState(){return{draft:this._draft,length:this._measureLen,rectSize:this._rectSize}}measureActions(){return{setLength:e=>this._measureLen=e,step:e=>this.measureStep(e),close:()=>this.closeDraft(),undo:()=>this._draft=this._draft.slice(0,-1),setRectSize:e=>this._rectSize=e,addRectangle:()=>this.rectBySize()}}arcActions(){return{edit:this._arcEdit,setEdit:e=>this._arcEdit=e,apply:e=>{if(!this.isAdmin||Math.abs(e.bulge)<.01)return;let n=this._doc,r=structuredClone(n),o=r.floors.find(c=>c.id===this._floorId);if(!o)return;let[i,s,l]=e.key.split(":");if(!(i==="wall"?Rf(o,s,e.bulge).length>0:Mf(o,s,Number(l),e.bulge))){this._arcEdit={...e,error:this.t("arc_too_wide")};return}this._arcEdit=null,this.setDoc(r,n)}}}freeWallActions(){return{update:e=>this.updateFreeWall(e),remove:()=>this.deleteFreeWall(),arc:this.arcActions(),lockButton:this.fixButton("wall",this.sel.wall??"")}}outdoorActions(){return{update:e=>this.updateOutdoor(e),setRectangle:(e,n)=>{let r=this.outdoorArea;r&&this.updateOutdoor({points:Ep(r,e,n)})},duplicate:()=>this.duplicateOutdoor(),remove:()=>this.deleteOutdoor(),removeCorner:e=>{let n=this.sel.outdoor;n&&this.change((r,o)=>{_p(o.outdoor.find(i=>i.id===n),e)})},lockButton:this.fixButton("outdoor",this.sel.outdoor??"")}}libraryActions(){return{add:e=>this.addFurniture(e),studio:()=>this.openStudio(null),packs:this.packs??[]}}openStudio(e){let n=e?G(e):void 0,r=n?.recipe&&e?.startsWith(`pack:${bn}:`)?n.id:null;this._studio={recipe:r&&n?.recipe?{...n.recipe}:Pl("cabinet",""),itemId:r,busy:!1,error:null},this._tool="furniture"}async saveStudio(){let e=this._studio;if(!e||!this.hass||!this.isAdmin)return;let n=this.hass.language??"en",r=gr().find(d=>d.id===bn),o=r?.items??[],i={...e.recipe,name:e.recipe.name||this.t(`studio_kind_${e.recipe.kind}`)},s=e.itemId??xg(i.name,o.map(d=>d.id)),l=qi(i,s,n),a={id:bn,name:r?.name??this.t("studio_pack_name"),publisher:r?.publisher??this.t("studio_pack_publisher"),release:(r?.release??0)+1,items:e.itemId?o.map(d=>d.id===s?l:d):[...o,l]};this._studio={...e,busy:!0,error:null};try{let{builtin:d,imported_at:u,...p}=a;await wr(this.hass,JSON.stringify({format:"nfpack",version:1,... Line truncated `]};customElements.get("nf-extensions")||customElements.define("nf-extensions",Nl);var go="handled",t_=["select","rect","polygon","wall","opening","furniture","stairs","outdoor","hole","roof","energy"],n_=new Set(["vertex","room","device","opening","furniture","rotate","resize","outdoor","roofmove","roofcorner","roofvertex","outvertex","solarmove","solarturn","bgmove","bgscale","bgrotate"]),Xi=10,He=t=>Math.round(t*1e3)/1e3,r_={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]},Bl=class extends Q{static properties={hass:{attribute:!1},building:{attribute:!1},narrow:{type:Boolean},roomLabels:{attribute:!1},packs:{attribute:!1},loadCardEditor:{attribute:!1},_doc:{state:!0},_doc3d:{state:!0},_split:{state:!0},_splitRatio:{state:!0},_wall3d:{state:!0},_solid3d:{state:!0},_sidePinned:{state:!0},_studio:{state:!0},_check:{state:!0},_keys:{state:!0},_note:{state:!0},_dims:{state:!0},_tour:{state:!0},_sideOpen:{state:!0},_floorId:{state:!0},_energyNote:{state:!0},_ctx:{state:!0},_fixedHint:{state:!0},_openingPreset:{state:!0},_measureLen:{state:!0},_rectSize:{state:!0},_tool:{state:!0},_wallView:{state:!0},_draft:{state:!0},_cursor:{state:!0},_guides:{state:!0},_view:{state:!0},_size:{state:!0},_canUndo:{state:!0},_canRedo:{state:!0},_arcEdit:{state:!0},_routeDraft:{state:!0}};doc3dTimer;tourChecked=!1;_pick=null;_pickTimer;fixedPan=!1;reframe3d=!1;pressTimer=0;pressStart=null;history=new Wi(100);lib=new Fi(()=>this.requestUpdate());side=new Ui(()=>this.requestUpdate());sel=new ji(()=>this.requestUpdate());host=this.makeHost();backup=this.makeBackup();roof=this.makeRoof();bg=this.makeBackground();settingsActions={useRoofSections:()=>{this.roof.useSections(),this._tool="roof"}};drag=null;pointers=new Map;pinch=null;fitted=!1;resizeObserver;constructor(){super(),this.narrow=!1,this.roomLabels=!0,this._floorId=null,this._arcEdit=null,this._routeDraft=null,this.roof.sectionId=null,this.roof.solarId=null,this.roof.picking=!1,this.roof.windowId=null,this.roof.chimneyId=null,this._energyNote=null,this._openingPreset="door";let e=!1;try{e=localStorage.getItem("nextfloor.editor3d")==="1"}catch{}this._split=e,this._splitRatio=.55;try{let r=Number(localStorage.getItem("nextfloor.editorSplit"));r>=20&&r<=80&&(this._splitRatio=r/100)}catch{}this._wall3d="cut",this._solid3d=!1,this._doc3d=this._doc,this._sideOpen=!1;let n=!0;try{n=localStorage.getItem("nextfloor.sidePinned")!=="0"}catch{}this._sidePinned=n,this._studio=null,this._check=!1,this._keys=!1,this._note=null,this._dims=(()=>{try{return localStorage.getItem("nextfloor.plan_dims")==="1"}catch{return!1}})(),this._tour=null,this._measureLen=3,this._rectSize=[4,3],this._tool="select",this._wallView=null,this._draft=[],this._cursor=null,this._guides={},this._view={scale:50,ox:40,oy:40},this._size={w:800,h:600},this._canUndo=!1,this._canRedo=!1}t(e,n){return $e(this.hass,e,n)}measureState(){return{draft:this._draft,length:this._measureLen,rectSize:this._rectSize}}measureActions(){return{setLength:e=>this._measureLen=e,step:e=>this.measureStep(e),close:()=>this.closeDraft(),undo:()=>this._draft=this._draft.slice(0,-1),setRectSize:e=>this._rectSize=e,addRectangle:()=>this.rectBySize()}}arcActions(){return{edit:this._arcEdit,setEdit:e=>this._arcEdit=e,apply:e=>{if(!this.isAdmin||Math.abs(e.bulge)<.01)return;let n=this._doc,r=structuredClone(n),o=r.floors.find(c=>c.id===this._floorId);if(!o)return;let[i,s,l]=e.key.split(":");if(!(i==="wall"?Rf(o,s,e.bulge).length>0:Mf(o,s,Number(l),e.bulge))){this._arcEdit={...e,error:this.t("arc_too_wide")};return}this._arcEdit=null,this.setDoc(r,n)}}}freeWallActions(){return{update:e=>this.updateFreeWall(e),remove:()=>this.deleteFreeWall(),arc:this.arcActions(),lockButton:this.fixButton("wall",this.sel.wall??"")}}outdoorActions(){return{update:e=>this.updateOutdoor(e),setRectangle:(e,n)=>{let r=this.outdoorArea;r&&this.updateOutdoor({points:Ep(r,e,n)})},duplicate:()=>this.duplicateOutdoor(),remove:()=>this.deleteOutdoor(),removeCorner:e=>{let n=this.sel.outdoor;n&&this.change((r,o)=>{_p(o.outdoor.find(i=>i.id===n),e)})},lockButton:this.fixButton("outdoor",this.sel.outdoor??"")}}libraryActions(){return{add:e=>this.addFurniture(e),studio:()=>this.openStudio(null),packs:this.packs??[]}}openStudio(e){let n=e?G(e):void 0,r=n?.recipe&&e?.startsWith(`pack:${bn}:`)?n.id:null;this._studio={recipe:r&&n?.recipe?{...n.recipe}:Pl("cabinet",""),itemId:r,busy:!1,error:null},this._tool="furniture"}async saveStudio(){let e=this._studio;if(!e||!this.hass||!this.isAdmin)return;let n=this.hass.language??"en",r=gr().find(d=>d.id===bn),o=r?.items??[],i={...e.recipe,name:e.recipe.name||this.t(`studio_kind_${e.recipe.kind}`)},s=e.itemId??xg(i.name,o.map(d=>d.id)),l=qi(i,s,n),a={id:bn,name:r?.name??this.t("studio_pack_name"),publisher:r?.publisher??this.t("studio_pack_publisher"),release:(r?.release??0)+1,items:e.itemId?o.map(d=>d.id===s?l:d):[...o,l]};this._studio={...e,busy:!0,error:null};try{let{builtin:d,imported_at:u,...p}=a;await wr(this.hass, Line truncated
>${s} >${s}
<input <input
type="number" type="number"
@@ -4472,7 +4472,7 @@ ${i}`}else o=eh(s)}}catch(s){let l=s.message,a={not_json:"import_error_not_json"
.selectedDevice=${this.sel.device} .selectedDevice=${this.sel.device}
.quality=${"auto"} .quality=${"auto"}
.floorThumbs=${!1} .floorThumbs=${!1}
.roomLabels=${!0} .roomLabels=${this.roomLabels}
.floorStack=${this.houseTool?"stacked":"single"} .floorStack=${this.houseTool?"stacked":"single"}
.panelOpen=${!1} .panelOpen=${!1}
.alerts=${!1} .alerts=${!1}
@@ -4526,6 +4526,7 @@ ${i}`}else o=eh(s)}}catch(s){let l=s.message,a={not_json:"import_error_not_json"
${this.t(`tool_${r}`)} ${this.t(`tool_${r}`)}
</button>`)} </button>`)}
</div> </div>
<button class="nf-chip nf-room-names-toggle" aria-pressed=${this.roomLabels} title=${this.t("room_names_toggle_hint")} @click=${()=>{this.roomLabels=!this.roomLabels,this.dispatchEvent(new CustomEvent("room-names-change",{detail:{value:this.roomLabels},bubbles:!0,composed:!0}))}}>${this.t("room_names_short")}</button>
<div class="nf-seg"> <div class="nf-seg">
<button ?disabled=${!this._canUndo} @click=${()=>this.undo()} title="Ctrl+Z">${this.t("undo")}</button> <button ?disabled=${!this._canUndo} @click=${()=>this.undo()} title="Ctrl+Z">${this.t("undo")}</button>
<button ?disabled=${!this._canRedo} @click=${()=>this.redo()} title="Ctrl+Y">${this.t("redo")}</button> <button ?disabled=${!this._canRedo} @click=${()=>this.redo()} title="Ctrl+Y">${this.t("redo")}</button>
+9 -1
View File
@@ -16,7 +16,7 @@ In **Kerninstanzen → Modules** wird dieses Repository verwendet:
Im Zahnrad des Eintrags den Branch **`symcon`** wählen und auf Aktualisierungen prüfen. Im Zahnrad des Eintrags den Branch **`symcon`** wählen und auf Aktualisierungen prüfen.
`main` enthält die Quellen für die Entwicklung, `symcon` die installierbare Bibliothek. `main` enthält die Quellen für die Entwicklung, `symcon` die installierbare Bibliothek.
Nach der Aktualisierung auf **0.2.9 / Build 12** die Konsole neu laden. Unter Nach der Aktualisierung auf **0.2.10 / Build 13** die Konsole neu laden. Unter
**Instanz hinzufügen → Hersteller NextFloor** erscheint **„NextFloor Designer und 3D-Kachel“**. **Instanz hinzufügen → Hersteller NextFloor** erscheint **„NextFloor Designer und 3D-Kachel“**.
### Für die Entwicklung ### Für die Entwicklung
@@ -46,6 +46,14 @@ Die Dateien unter `NextFloor/assets/` und `NextFloor/packs/` werden durch
Der Build prüft anschließend die Modulmetadaten und die installierbare Verzeichnisstruktur. Der Build prüft anschließend die Modulmetadaten und die installierbare Verzeichnisstruktur.
Dieselbe Prüfung lässt sich separat mit `node symcon/tests/validate-package.mjs` ausführen. Dieselbe Prüfung lässt sich separat mit `node symcon/tests/validate-package.mjs` ausführen.
## Änderungen in 0.2.10
- **Raumnamen** schaltet oben in der 3D-Ansicht und in der Werkzeugleiste des Editors
die Namen in 3D ein oder aus. Beide Ansichten verwenden dieselbe, im Browser gespeicherte
Einstellung. Die Namen im 2D-Plan bleiben davon unberührt.
- Die HTML-SDK-Kachel hat den Schalter ebenfalls oben in ihrer 3D-Ansicht. Notizen,
Geräte und Messwertkarten bleiben beim Ausblenden der Raumnamen sichtbar.
## Änderungen in 0.2.9 ## Änderungen in 0.2.9
- **Behang in 3D umkehren** und **Lamellen in 3D umkehren** ändern ausschließlich die - **Behang in 3D umkehren** und **Lamellen in 3D umkehren** ändern ausschließlich die
+2 -2
View File
@@ -6,7 +6,7 @@
"compatibility": { "compatibility": {
"version": "9.0" "version": "9.0"
}, },
"version": "0.2.9", "version": "0.2.10",
"build": 12, "build": 13,
"date": 1794297600 "date": 1794297600
} }