@ray-js/robot-map-sdk 0.0.3-beta-15 → 0.0.3-beta-17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/floorType1.png.js +1 -1
- package/dist/assets/floorType2.png.js +1 -1
- package/dist/assets/floorType3.png.js +1 -1
- package/dist/components/RoomInfo/RoomName.js +1 -1
- package/dist/components/RoomInfo/RoomProperty.js +1 -1
- package/dist/components/RoomInfo/RoomSelectionIndicator.js +1 -1
- package/dist/components/RoomInfo/index.js +1 -1
- package/dist/index.rjs.js +1 -1
- package/dist/managers/RoomManager.js +1 -1
- package/dist-app/assets/{index-5OxGJGfN.js → index-B_jB_pJB.js} +1 -1
- package/dist-app/index.html +1 -1
- package/dist-docs/404.html +2 -2
- package/dist-docs/assets/{app.D8xBQf4O.js → app.D0On3-3L.js} +1 -1
- package/dist-docs/assets/chunks/@localSearchIndexroot.B_iumuO8.js +1 -0
- package/dist-docs/assets/chunks/{VPLocalSearchBox.BYPVcgMQ.js → VPLocalSearchBox.CSbb03M9.js} +1 -1
- package/dist-docs/assets/chunks/{theme.C9MT_4iu.js → theme.2ZwgBjKx.js} +2 -2
- package/dist-docs/assets/{guide_getting-started.md.cP-vLJIe.js → guide_getting-started.md.B6NTuxbm.js} +1 -1
- package/dist-docs/assets/reference_config.md.B_3LcfVp.js +41 -0
- package/dist-docs/assets/{reference_config.md.DMdXIa91.lean.js → reference_config.md.B_3LcfVp.lean.js} +1 -1
- package/dist-docs/guide/advanced-usage.html +3 -3
- package/dist-docs/guide/concepts.html +3 -3
- package/dist-docs/guide/getting-started.html +5 -5
- package/dist-docs/hashmap.json +1 -1
- package/dist-docs/index.html +3 -3
- package/dist-docs/reference/callbacks.html +3 -3
- package/dist-docs/reference/config.html +5 -5
- package/dist-docs/reference/data.html +3 -3
- package/dist-docs/reference/methods.html +3 -3
- package/dist-docs/reference/runtime.html +3 -3
- package/dist-docs/reference/types.html +3 -3
- package/dist-docs/reference/utils.html +3 -3
- package/package.json +1 -1
- package/dist-docs/assets/chunks/@localSearchIndexroot.DB7O_MhQ.js +0 -1
- package/dist-docs/assets/reference_config.md.DMdXIa91.js +0 -41
- /package/dist-docs/assets/{guide_getting-started.md.cP-vLJIe.lean.js → guide_getting-started.md.B6NTuxbm.lean.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Container as o}from"pixi.js";import{LAYER_ROOM_INFO as t}from"../application/AppContainer.js";import{RoomInfo as i}from"../components/RoomInfo/index.js";import{RoomFloorType as e}from"../components/RoomFloorType/index.js";import{subscribeKey as r}from"valtio/vanilla/utils";import{Logger as s}from"../utils/logger.js";import{useAppService as n}from"../application/AppService.js";class a{unsubscribeFns=[];roomInfoContainer=new o;roomInfoMap=new Map;roomDisplayMap=new Map;roomFloorType=new e;constructor(){const o=n();o.appContainer.addToLayer(t,this.roomInfoContainer);const i=r(o.runtime,"showRoomFloorType",o=>{s.log(`[runtime] showRoomFloorType: ${o}`),o?this.updateFloorTypes():this.roomFloorType.clearFloorTypes()}),e=r(o.runtime,"showRoomProperty",o=>{s.log(`[runtime] showRoomProperty: ${o}`),this.updateAllRoomPropertyVisibility()}),a=r(o.runtime,"showRoomOrder",o=>{s.log(`[runtime] showRoomOrder: ${o}`),this.updateAllRoomPropertyVisibility()}),
|
|
1
|
+
import{Container as o}from"pixi.js";import{LAYER_ROOM_INFO as t}from"../application/AppContainer.js";import{RoomInfo as i}from"../components/RoomInfo/index.js";import{RoomFloorType as e}from"../components/RoomFloorType/index.js";import{subscribeKey as r}from"valtio/vanilla/utils";import{Logger as s}from"../utils/logger.js";import{useAppService as n}from"../application/AppService.js";class a{unsubscribeFns=[];roomInfoContainer=new o;roomInfoMap=new Map;roomDisplayMap=new Map;roomFloorType=new e;constructor(){const o=n();o.appContainer.addToLayer(t,this.roomInfoContainer);const i=r(o.runtime,"showRoomFloorType",o=>{s.log(`[runtime] showRoomFloorType: ${o}`),o?this.updateFloorTypes():this.roomFloorType.clearFloorTypes()}),e=r(o.runtime,"showRoomProperty",o=>{s.log(`[runtime] showRoomProperty: ${o}`),this.updateAllRoomPropertyVisibility()}),a=r(o.runtime,"showRoomOrder",o=>{s.log(`[runtime] showRoomOrder: ${o}`),this.updateAllRoomPropertyVisibility()}),l=r(o.runtime,"roomPropertyFoldIds",o=>{s.log(`[runtime] roomPropertyFoldIds: ${o}`),this.updateAllRoomPropertyVisibility()}),m=r(o.runtime,"showRoomName",o=>{s.log(`[runtime] showRoomName: ${o}`),this.updateAllRoomNameVisibility(o)}),p=r(o.runtime,"enableRoomSelection",o=>{s.log(`[runtime] enableRoomSelection: ${o}`),this.updateAllRoomPropertyVisibility(),this.updateAllRoomSelectionIndicatorVisibility()}),c=r(o.runtime,"selectRoomIds",o=>{s.log(`[runtime] selectRoomIds: ${o}`),this.updateAllRoomPropertyVisibility(),this.updateAllRoomSelectionIndicatorVisibility()}),d=r(o.runtime,"roomSelectionMode",o=>{s.log(`[runtime] roomSelectionMode: ${o}`),this.updateAllRoomPropertyVisibility(),this.updateAllRoomSelectionIndicatorVisibility()});this.unsubscribeFns.push(i,e,a,l,m,p,c,d)}drawRoomProperty(o){const t=n();return this.roomDisplayMap.clear(),o.forEach((o,i)=>{const e=t.mapManager.getRoomById(o.id),r={...o,centerPoint:e?.centerPoint||null,index:i,colorIndex:e?.colorIndex};this.roomDisplayMap.set(o.id,r)}),this.updateRoomInfoDisplay(),this.updateFloorTypes(),!0}updateRoomInfoDisplay(){if(0===this.roomDisplayMap.size)return;const o=Array.from(this.roomDisplayMap.values()).filter(o=>null!==o.centerPoint);this.clearRoomInfos(),o.forEach(o=>{this.createRoomInfo(o)})}createRoomInfo(o){const t=new i(o);this.roomInfoContainer.addChild(t),this.roomInfoMap.set(o.id,t)}updateRoomName(o,t){const i=this.roomInfoMap.get(o);i&&i.updateName(t)}updateRoomPosition(o,t){const i=this.roomDisplayMap.get(o);i&&(i.centerPoint=t);const e=this.roomInfoMap.get(o);e&&e.updatePosition(t)}clearRoomInfos(){this.roomInfoMap.forEach(o=>{o.destroy()}),this.roomInfoMap.clear(),this.roomInfoContainer.removeChildren()}getRoomPropertyById(o){return this.roomDisplayMap.get(o)}refresh(){const o=n();this.roomFloorType.clearFloorTypes(),this.roomDisplayMap.forEach((t,i)=>{const e=o.mapManager.getRoomById(i),r=e?.centerPoint||null;if(t.centerPoint!==r){t.centerPoint=r;const o=this.roomInfoMap.get(i);o&&r&&o.updatePosition(r)}const s=e?.colorIndex;if(t.colorIndex!==s&&void 0!==s){t.colorIndex=s;const o=this.roomInfoMap.get(i);o&&o.refreshColor()}}),this.updateRoomInfoDisplay(),this.updateFloorTypes()}updateAllRoomPropertyVisibility(){this.roomInfoMap.forEach(o=>{o.updateRoomPropertyVisibility()})}updateAllRoomNameVisibility(o){this.roomInfoMap.forEach(t=>{t.updateRoomNameVisibility(o)})}updateAllRoomSelectionIndicatorVisibility(){this.roomInfoMap.forEach(o=>{o.updateRoomSelectionIndicatorVisibility()})}async updateFloorTypes(){const o=n(),t=o.mapManager.roomFill.getRoomGraphicsMap();t.size>0&&(await this.roomFloorType.createFloorTypes(t),o.getApp().renderOnceNextFrame())}destroy(){this.clearRoomInfos(),this.roomInfoContainer.destroy(),this.roomFloorType.destroy(),this.unsubscribeFns.forEach(o=>o()),this.unsubscribeFns=[]}}export{a as RoomManager};
|