@ray-js/robot-map 0.0.5-beta.12 → 0.0.5-beta.13
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/lib/RobotMap.d.ts +1 -1
- package/lib/RobotMap.js +10 -2
- package/lib/props.d.ts +7 -0
- package/package.json +2 -2
package/lib/RobotMap.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { AppOptions } from '@ray-js/robot-map-sdk';
|
|
3
3
|
import { RobotMapProps } from './props';
|
|
4
4
|
declare const RobotMap: {
|
|
5
|
-
({ map, path, roomProperties, forbiddenSweepZones, forbiddenMopZones, cleanZones, virtualWalls, spots, wayPoints, detectedObjects, customElements, customCarpets, onMapReady, config, runtime, ...callbacks }: RobotMapProps & AppOptions['events']): React.JSX.Element;
|
|
5
|
+
({ map, path, roomProperties, forbiddenSweepZones, forbiddenMopZones, cleanZones, virtualWalls, spots, wayPoints, detectedObjects, customElements, customCarpets, heatmap, onMapReady, config, runtime, ...callbacks }: RobotMapProps & AppOptions['events']): React.JSX.Element;
|
|
6
6
|
defaultProps: RobotMapProps;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
package/lib/RobotMap.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
-
const _excluded = ["map", "path", "roomProperties", "forbiddenSweepZones", "forbiddenMopZones", "cleanZones", "virtualWalls", "spots", "wayPoints", "detectedObjects", "customElements", "customCarpets", "onMapReady", "config", "runtime"];
|
|
3
|
+
const _excluded = ["map", "path", "roomProperties", "forbiddenSweepZones", "forbiddenMopZones", "cleanZones", "virtualWalls", "spots", "wayPoints", "detectedObjects", "customElements", "customCarpets", "heatmap", "onMapReady", "config", "runtime"];
|
|
4
4
|
import "core-js/modules/esnext.iterator.constructor.js";
|
|
5
5
|
import "core-js/modules/esnext.iterator.for-each.js";
|
|
6
6
|
import "core-js/modules/esnext.iterator.map.js";
|
|
@@ -34,6 +34,7 @@ const RobotMap = _ref => {
|
|
|
34
34
|
detectedObjects,
|
|
35
35
|
customElements,
|
|
36
36
|
customCarpets,
|
|
37
|
+
heatmap,
|
|
37
38
|
onMapReady,
|
|
38
39
|
config = {},
|
|
39
40
|
runtime = {}
|
|
@@ -57,7 +58,8 @@ const RobotMap = _ref => {
|
|
|
57
58
|
onReceiveDetectedObjects: () => {},
|
|
58
59
|
onReceiveCustomElements: () => {},
|
|
59
60
|
onUpdateRuntime: () => {},
|
|
60
|
-
onReceiveCustomCarpets: () => {}
|
|
61
|
+
onReceiveCustomCarpets: () => {},
|
|
62
|
+
onReceiveHeatmap: () => {}
|
|
61
63
|
});
|
|
62
64
|
const handleMessage = useCallback(event => {
|
|
63
65
|
if (invoke.current) {
|
|
@@ -106,6 +108,7 @@ const RobotMap = _ref => {
|
|
|
106
108
|
triggersRef.current.onReceiveCustomElements = invoke.current.bind('onReceiveCustomElements');
|
|
107
109
|
triggersRef.current.onUpdateRuntime = invoke.current.bind('onUpdateRuntime');
|
|
108
110
|
triggersRef.current.onReceiveCustomCarpets = invoke.current.bind('onReceiveCustomCarpets');
|
|
111
|
+
triggersRef.current.onReceiveHeatmap = invoke.current.bind('onReceiveHeatmap');
|
|
109
112
|
|
|
110
113
|
// 为每个需要的事件定义分发函数
|
|
111
114
|
Object.keys(CALLBACK_TO_EVENT_MAP).forEach(eventName => {
|
|
@@ -130,6 +133,11 @@ const RobotMap = _ref => {
|
|
|
130
133
|
triggersRef.current.onReceiveMap(map);
|
|
131
134
|
}
|
|
132
135
|
}, [map, mapApi]);
|
|
136
|
+
useEffect(() => {
|
|
137
|
+
if (mapApi && heatmap) {
|
|
138
|
+
triggersRef.current.onReceiveHeatmap(heatmap);
|
|
139
|
+
}
|
|
140
|
+
}, [heatmap, mapApi]);
|
|
133
141
|
useEffect(() => {
|
|
134
142
|
if (mapApi && path) {
|
|
135
143
|
triggersRef.current.onReceivePath(path);
|
package/lib/props.d.ts
CHANGED
|
@@ -105,6 +105,13 @@ export interface RobotMapProps {
|
|
|
105
105
|
* @description.en Control the various behavior states of the map at runtime
|
|
106
106
|
*/
|
|
107
107
|
runtime?: DeepPartialRuntimeConfig;
|
|
108
|
+
/**
|
|
109
|
+
* @description.zh 地图热力图点数据
|
|
110
|
+
* @description.en Map heatmap points data
|
|
111
|
+
* @description.zh 地图热力图点数据,用于定义地图热力图的样式和行为等
|
|
112
|
+
* @description.en Map heatmap points data, used to define the style and behavior of the map heatmap
|
|
113
|
+
*/
|
|
114
|
+
heatmap?: string;
|
|
108
115
|
/**
|
|
109
116
|
* @description.zh 地图初始化完成,API准备就绪的回调
|
|
110
117
|
* @description.en Callback when the map is initialized and the API is ready
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ray-js/robot-map",
|
|
3
|
-
"version": "0.0.5-beta.
|
|
3
|
+
"version": "0.0.5-beta.13",
|
|
4
4
|
"description": "机器人地图组件",
|
|
5
5
|
"main": "lib/index",
|
|
6
6
|
"files": [
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@ray-js/ray": "^1.7.39"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@ray-js/robot-map-sdk": "0.0.5-beta.
|
|
36
|
+
"@ray-js/robot-map-sdk": "0.0.5-beta.4",
|
|
37
37
|
"clsx": "^1.2.1",
|
|
38
38
|
"nanoid": "^5.1.6"
|
|
39
39
|
},
|