@ray-js/robot-map-sdk 0.0.3-beta-15 → 0.0.3-beta-16
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/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-BNlucUfz.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.Bobn6h_4.js} +1 -1
- package/dist-docs/assets/chunks/@localSearchIndexroot.CxpdiuDX.js +1 -0
- package/dist-docs/assets/chunks/{VPLocalSearchBox.BYPVcgMQ.js → VPLocalSearchBox.CyYHxxT2.js} +1 -1
- package/dist-docs/assets/chunks/{theme.C9MT_4iu.js → theme.DaEAh-YU.js} +2 -2
- package/dist-docs/assets/{guide_getting-started.md.cP-vLJIe.js → guide_getting-started.md.C3ofwaKA.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 +3 -3
- 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/{guide_getting-started.md.cP-vLJIe.lean.js → guide_getting-started.md.C3ofwaKA.lean.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Text as o,TextStyle as e}from"pixi.js";import{useAppService as
|
|
1
|
+
import{Text as o,TextStyle as e}from"pixi.js";import{useAppService as t}from"../../application/AppService.js";class n extends o{roomId;roomIndex;constructor(o){const n=t(),{nameLabel:i,colors:r}=n.roomConfig,m=o.colorIndex??o.index,s=r.name[m%r.name.length],l=new e({fontSize:i.fontSize,fontFamily:i.fontFamily,fontWeight:i.fontWeight,fill:s,align:"center"});super({text:o.name||"Unknown",style:l}),this.roomId=o.id,this.roomIndex=o.index,this.anchor.set(.5)}updateName(o){this.text=o}refreshColor(o){const e=t(),{colors:n}=e.roomConfig,i=e.getRoomData(this.roomId),r=i?.colorIndex??this.roomIndex,m=o??n.name[r%n.name.length];this.style.fill=m}}export{n as RoomName};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Container as e,Graphics as t,Text as o,TextStyle as i}from"pixi.js";import{useAppService as n}from"../../application/AppService.js";import{EnhancedSprite as s}from"../Base/EnhancedSprite.js";class r extends e{background;cleanModeIcon;suctionIcon;cisternIcon;cleanTimesIcon;orderContainer;orderBackground;orderText;bubble=null;isFolded=!1;roomId;
|
|
1
|
+
import{Container as e,Graphics as t,Text as o,TextStyle as i}from"pixi.js";import{useAppService as n}from"../../application/AppService.js";import{EnhancedSprite as s}from"../Base/EnhancedSprite.js";class r extends e{background;cleanModeIcon;suctionIcon;cisternIcon;cleanTimesIcon;orderContainer;orderBackground;orderText;bubble=null;isFolded=!1;roomId;roomIndex;constructor(r){super();const c=n(),l=c.roomConfig;this.roomId=r.id,this.roomIndex=r.index,this.background=new t;const{property:h,colors:{propertyTheme:d}}=l;l.property.foldable&&(this.bubble=new t);const a=d[(r.colorIndex??r.index)%d.length];this.cleanModeIcon=new s,this.cleanModeIcon.tint=a,this.cleanModeIcon.anchor.set(0,0),this.suctionIcon=new s,this.suctionIcon.tint=a,this.suctionIcon.anchor.set(0,0),this.cisternIcon=new s,this.cisternIcon.tint=a,this.cisternIcon.anchor.set(0,0),this.cleanTimesIcon=new s,this.cleanTimesIcon.tint=a,this.cleanTimesIcon.anchor.set(0,0),this.orderContainer=new e,this.orderBackground=new t,this.orderText=new o({text:"",style:new i({fontSize:h.cleanOrder.fontSize,fontFamily:h.cleanOrder.fontFamily,fontWeight:h.cleanOrder.fontWeight,fill:h.cleanOrder.color,align:"center",trim:!0})}),this.orderText.anchor.set(.5,.5),this.orderContainer.addChild(this.orderBackground),this.orderContainer.addChild(this.orderText),this.addChild(this.background),this.bubble&&this.addChild(this.bubble),this.addChild(this.cleanModeIcon),this.addChild(this.suctionIcon),this.addChild(this.cisternIcon),this.addChild(this.cleanTimesIcon),this.addChild(this.orderContainer),this.visible=c.runtimeSnapshot.showRoomProperty,this.updateProperty(r)}async updateProperty(e){await this.updateIcons(e),this.updateBackground()}getDisplayElements(e){const t=n(),{displayOrders:o}=t.roomConfig.property,{showRoomOrder:i,showRoomProperty:s}=t.runtimeSnapshot,r=e.order||0,c=i&&r>0,l=s&&o.includes("cleanMode"),h=s&&o.includes("suction"),d=s&&o.includes("cistern"),a=s&&o.includes("cleanTimes")&&e.cleanTimes>0,u={cleanMode:{element:this.cleanModeIcon,show:l,isOrder:!1},suction:{element:this.suctionIcon,show:h,isOrder:!1},cistern:{element:this.cisternIcon,show:d,isOrder:!1},cleanTimes:{element:this.cleanTimesIcon,show:a,isOrder:!1}},b=[];return c&&b.push({element:this.orderContainer,show:!0,isOrder:!0}),o.forEach(e=>{const t=u[e];t&&t.show&&b.push(t)}),{shouldShowOrder:c,shouldShowCleanMode:l,shouldShowSuction:h,shouldShowCistern:d,shouldShowCleanTimes:a,elementsToShow:b,orderValue:r}}async updateIcons(e){const t=n(),{iconWidth:o,iconHeight:i,container:s,cleanOrder:r,foldable:c,iconGap:l}=t.roomConfig.property,{propertyTheme:h}=t.roomConfig.colors,{paddingHorizontal:d,paddingVertical:a}=s,{shouldShowOrder:u,shouldShowCleanMode:b,shouldShowSuction:p,shouldShowCistern:g,shouldShowCleanTimes:m,elementsToShow:I,orderValue:f}=this.getDisplayElements(e);this.orderContainer.visible=u,this.cleanModeIcon.visible=b,this.suctionIcon.visible=p,this.cisternIcon.visible=g,this.cleanTimesIcon.visible=m,c&&this.isFolded&&(this.orderContainer.visible=!1,this.cleanModeIcon.visible=!1,this.suctionIcon.visible=!1,this.cisternIcon.visible=!1,this.cleanTimesIcon.visible=!1);const C=[];if(b&&C.push(this.cleanModeIcon.loadTextureAndSetSize(`cleanMode_${e.cleanMode}`,{width:o,height:i,sizeFixed:!1})),p&&C.push(this.suctionIcon.loadTextureAndSetSize(`fan_${e.suction}`,{width:o,height:i,sizeFixed:!1})),g&&C.push(this.cisternIcon.loadTextureAndSetSize(`water_${e.cistern}`,{width:o,height:i,sizeFixed:!1})),m){const t=e.cleanTimes||1;C.push(this.cleanTimesIcon.loadTextureAndSetSize(`cleanTimes${t}`,{width:o,height:i,sizeFixed:!1}))}if(await Promise.all(C),u){this.orderText.text=f.toString();const e=t.getRoomData(this.roomId),n=e?.colorIndex??this.roomIndex;this.orderBackground.clear(),this.orderBackground.setFillStyle({color:h[n%h.length]}),this.orderBackground.circle(o/2,i/2,o/2).fill(),this.orderText.position.set(o/2,i/2)}let y=d;I.forEach((e,t)=>{const{element:i,isOrder:n}=e;i.position.set(y,a),y+=o,t<I.length-1&&(y+=n?r.gapRight:l)})}updateBackground(){const e=n().roomConfig,{container:t,foldable:o}=e.property,{borderRadius:i,tailHeight:s,tailWidth:r,backgroundColor:c}=t,l=this.calculateContentWidth(),h=this.calculateContentHeight(),d=Math.min(r,l/2);if(this.background.clear(),this.bubble&&this.bubble.clear(),this.background.setFillStyle({color:c}),this.background.roundRect(0,0,l,h,i).fill(),o&&this.bubble){const e=(l-d)/2;this.bubble.setFillStyle({color:c}),this.bubble.poly([e,h-1,e+d,h-1,e+d/2,h+s]).fill()}}calculateContentWidth(){const e=n(),{iconWidth:t,container:o,cleanOrder:i,iconGap:s}=e.roomConfig.property,{paddingHorizontal:r}=o,c=e.getRoomData(this.roomId);if(!c)return 2*r;const{elementsToShow:l}=this.getDisplayElements(c);let h=r;return l.forEach((e,o)=>{const{isOrder:n}=e;h+=t,o<l.length-1&&(h+=n?i.gapRight:s)}),h+=r,h}calculateContentHeight(){const e=n().roomConfig,{iconHeight:t,container:o}=e.property;return o.paddingVertical+t+o.paddingVertical}getTotalHeight(){const e=n(),{foldable:t,container:o}=e.roomConfig.property,{tailHeight:i}=o;return this.calculateContentHeight()+(t?i:0)}getTotalWidth(){return this.calculateContentWidth()}setFolded(e){const t=n(),{foldable:o}=t.roomConfig.property;if(o)if(this.isFolded=e,e)this.background.visible=!1,this.cleanModeIcon.visible=!1,this.suctionIcon.visible=!1,this.cisternIcon.visible=!1,this.cleanTimesIcon.visible=!1,this.orderContainer.visible=!1,this.bubble&&(this.bubble.visible=!0,this.bubble.rotation=Math.PI,this.repositionFoldedBubble());else{this.background.visible=!0,this.bubble&&(this.bubble.visible=!0,this.bubble.rotation=0,this.bubble.position.set(0,0)),this.updateBackground();const e=t.getRoomData(this.roomId);e&&this.updateIcons(e)}}isFoldedState(){const e=n(),{foldable:t}=e.roomConfig.property;return!!t&&this.isFolded}repositionFoldedBubble(){const e=n(),{foldable:t}=e.roomConfig.property;if(!t||!this.bubble)return;const o=e.roomConfig,{tailHeight:i}=o.property.container,s=this.calculateContentWidth(),r=this.calculateContentHeight(),c=s/2;this.bubble.position.set(c,r+i/2)}refreshColor(){const e=n(),{propertyTheme:t}=e.roomConfig.colors,o=e.getRoomData(this.roomId),i=o?.colorIndex??this.roomIndex,s=t[i%t.length];if(this.cleanModeIcon&&(this.cleanModeIcon.tint=s),this.suctionIcon&&(this.suctionIcon.tint=s),this.cisternIcon&&(this.cisternIcon.tint=s),this.cleanTimesIcon&&(this.cleanTimesIcon.tint=s),this.orderBackground&&this.orderBackground.visible){const{property:o}=e.roomConfig,n=o.iconWidth,s=o.iconHeight;this.orderBackground.clear(),this.orderBackground.setFillStyle({color:t[i%t.length]}),this.orderBackground.circle(n/2,s/2,n/2).fill()}}destroy(){this.cleanModeIcon?.destroy(),this.suctionIcon?.destroy(),this.cisternIcon?.destroy(),this.cleanTimesIcon?.destroy(),super.destroy()}}export{r as RoomProperty};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Container as
|
|
1
|
+
import{Container as o,Graphics as t}from"pixi.js";import{useAppService as i}from"../../application/AppService.js";import{EnhancedSprite as e}from"../Base/EnhancedSprite.js";class c extends o{background;checkmarkIcon;bubble;roomIndex;roomId;constructor(o){super();const c=i().roomConfig;this.roomId=o.id,this.roomIndex=o.index,this.background=new t,this.bubble=new t;const{colors:{selectionIndicatorIcon:n}}=c;this.checkmarkIcon=new e,this.checkmarkIcon.tint=n[o.index%n.length],this.checkmarkIcon.anchor.set(0,0),this.addChild(this.background),this.addChild(this.bubble),this.addChild(this.checkmarkIcon),this.updateIndicator(o)}async updateIndicator(o){const t=i(),{roomSelectionMode:e,enableRoomSelection:c,selectRoomIds:n}=t.runtimeSnapshot;if(!c||"checkmark"!==e)return void(this.visible=!1);const r=n.includes(o.id);await this.showCheckmarkMode(r),this.updateBackground()}async showCheckmarkMode(o){const t=i(),{selectionIndicator:e}=t.roomConfig,{iconWidth:c,iconHeight:n}=e;if(o){this.visible=!0,this.checkmarkIcon.visible=!0,await this.checkmarkIcon.loadTextureAndSetSize("checkmark",{width:c,height:n,sizeFixed:!1});const o=e.containerWidth/2,t=e.containerHeight/2;this.checkmarkIcon.position.set(o-c/2,t-n/2)}else this.visible=!1}updateBackground(){const o=i(),{selectionIndicator:t,colors:e}=o.roomConfig,{containerWidth:c,containerHeight:n,strokeWidth:r,strokeColor:s,borderRadius:a,tailHeight:h,tailWidth:d}=t,l=o.getRoomData(this.roomId),k=l?.colorIndex??this.roomIndex,m=e.selectionIndicatorBackground[k%e.selectionIndicatorBackground.length];if(this.background.clear(),this.bubble.clear(),this.background.setFillStyle({color:m}).roundRect(0,0,c,n,a).fill().setStrokeStyle({color:s,width:r,alignment:0}).stroke(),h>0&&d>0){const o=(c-d)/2;this.bubble.setFillStyle({color:s});const t=n+r;this.bubble.poly([o,t-1,o+d,t-1,o+d/2,t+h]).fill()}}getTotalHeight(){const o=i(),{selectionIndicator:t}=o.roomConfig,{containerHeight:e,tailHeight:c,strokeWidth:n}=t;return e+n+(c>0?c:0)}getTotalWidth(){const o=i(),{selectionIndicator:t}=o.roomConfig;return t.containerWidth}async refreshColor(){const o=i().getRoomData(this.roomId);o&&await this.updateIndicator(o)}destroy(){this.checkmarkIcon?.destroy(),super.destroy()}}export{c as RoomSelectionIndicator};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{RoomName as o}from"./RoomName.js";import{RoomProperty as t}from"./RoomProperty.js";import{RoomSelectionIndicator as
|
|
1
|
+
import{RoomName as o}from"./RoomName.js";import{RoomProperty as t}from"./RoomProperty.js";import{RoomSelectionIndicator as e}from"./RoomSelectionIndicator.js";import{ClickHandler as i}from"../../mixins/ClickHandler.js";import{FixedSizeContainer as r}from"../Base/FixedSizeContainer.js";import{useAppService as s}from"../../application/AppService.js";class n extends r{roomId;roomName;roomProperty=null;roomSelectionIndicator=null;clickHandler=null;constructor(t){super();const e=s();this.enableRenderGroup(),this.roomId=t.id,t.centerPoint&&this.position.set(t.centerPoint.x,t.centerPoint.y),this.roomName=new o(t),this.roomName.visible=e.runtimeSnapshot.showRoomName,this.createRoomProperty(t),this.createRoomSelectionIndicator(t),this.updateLayout(),this.clickHandler=new i(this,{onClick:()=>{e.events?.onClickRoomProperties?.(t)}})}shouldShowRoomProperty(){const o=s(),{showRoomOrder:t,showRoomProperty:e,selectRoomIds:i,enableRoomSelection:r,roomSelectionMode:n}=o.runtimeSnapshot,m=o.getRoomData(this.roomId);if(!m)return!1;if(r&&"checkmark"===n&&i.includes(this.roomId))return!1;const a=t&&(m.order||0)>0,c=e&&(m.suction&&o.roomConfig.property.displayOrders.includes("suction")||m.cistern&&o.roomConfig.property.displayOrders.includes("cistern")||m.cleanTimes>0&&o.roomConfig.property.displayOrders.includes("cleanTimes"));return a||c}shouldShowRoomSelectionIndicator(){const o=s(),{enableRoomSelection:t,roomSelectionMode:e}=o.runtimeSnapshot;return t&&"checkmark"===e}updateRoomPropertyVisibility(){const o=s();if(this.roomProperty){if(this.shouldShowRoomProperty()){this.roomProperty.visible=!0;const t=o.runtimeSnapshot.roomPropertyFoldIds.includes(this.roomId);this.roomProperty.setFolded(t);const e=o.getRoomData(this.roomId);e&&this.roomProperty.updateProperty(e)}else this.roomProperty.visible=!1;this.updateLayout()}}async updateRoomSelectionIndicatorVisibility(){const o=s();if(this.roomSelectionIndicator){if(this.shouldShowRoomSelectionIndicator()){const t=o.getRoomData(this.roomId);t&&await this.roomSelectionIndicator.updateIndicator(t)}else this.roomSelectionIndicator.visible=!1;this.updateLayout()}}async createRoomProperty(o){const e=s();this.roomProperty&&(this.removeChild(this.roomProperty),this.roomProperty.destroy()),this.roomProperty=new t(o),await this.roomProperty.updateProperty(o),this.addChild(this.roomProperty),this.addChild(this.roomName),this.roomName.visible=e.runtimeSnapshot.showRoomName,this.updateRoomPropertyVisibility()}async createRoomSelectionIndicator(o){this.roomSelectionIndicator&&(this.removeChild(this.roomSelectionIndicator),this.roomSelectionIndicator.destroy()),this.roomSelectionIndicator=new e(o),this.addChild(this.roomSelectionIndicator),await this.updateRoomSelectionIndicatorVisibility()}updateLayout(){const o=s(),{property:{offsetY:t,offsetX:e},selectionIndicator:{offsetY:i,offsetX:r}}=o.roomConfig,n=this.roomProperty?.visible||!1,m=this.roomName.visible,a=this.roomSelectionIndicator?.visible||!1;if(n&&this.roomProperty)if(this.roomProperty.isFoldedState())this.roomProperty.position.set(e,-t);else{const o=this.roomProperty.getTotalHeight(),i=this.roomProperty.getTotalWidth();m?(this.roomProperty.position.set(-i/2+e,-t-o),this.roomName.position.set(0,0)):this.roomProperty.position.set(-i/2+e,-o/2-t)}if(a&&this.roomSelectionIndicator){const o=this.roomSelectionIndicator.getTotalHeight(),t=this.roomSelectionIndicator.getTotalWidth();m?(this.roomSelectionIndicator.position.set(-t/2+r,-i-o),this.roomName.position.set(0,0)):this.roomSelectionIndicator.position.set(-t/2+r,-o/2-i)}!m||n||a||this.roomName.position.set(0,0)}updateName(o){this.roomName.updateName(o)}updateRoomNameVisibility(o){this.roomName.visible=o,this.updateLayout()}updatePosition(o){this.position.set(o.x,o.y)}async refreshColor(){this.roomName&&this.roomName.refreshColor(),this.roomProperty&&this.roomProperty.refreshColor(),this.roomSelectionIndicator&&await this.roomSelectionIndicator.refreshColor()}destroy(){this.clickHandler?.destroy(),this.clickHandler=null,this.roomProperty?.destroy(),this.roomProperty=null,this.roomSelectionIndicator?.destroy(),this.roomSelectionIndicator=null,this.roomName?.destroy(),super.destroy()}}export{n as RoomInfo};
|