@ray-js/robot-map 0.0.8-beta.3 → 0.0.8-beta.5

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 CHANGED
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
- import { AppOptions } from '@ray-js/robot-map-sdk';
3
2
  import { RobotMapProps } from './props';
4
3
  declare const RobotMap: {
5
- ({ map, path, roomProperties, forbiddenSweepZones, forbiddenMopZones, cleanZones, virtualWalls, spots, wayPoints, detectedObjects, customElements, customCarpets, furnitures, heatmap, onMapReady, config, runtime, ...callbacks }: RobotMapProps & AppOptions['events']): React.JSX.Element;
4
+ ({ map, path, roomProperties, forbiddenSweepZones, forbiddenMopZones, cleanZones, virtualWalls, spots, wayPoints, detectedObjects, customElements, customCarpets, furnitures, heatmap, onMapReady, config, runtime, ...callbacks }: RobotMapProps): React.JSX.Element;
6
5
  defaultProps: RobotMapProps;
7
6
  displayName: string;
8
7
  };
package/lib/props.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { DeepPartialAppConfig, DeepPartialRuntimeConfig, RoomProperty, ZoneParam, VirtualWallParam, DetectedObjectParam, CustomElementParam, MapState, PathState, Point, RoomData, SpotParam, WayPointParam, CustomCarpetParam, IconPoint, FurnitureParam } from '@ray-js/robot-map-sdk';
1
+ import { DeepPartialAppConfig, DeepPartialRuntimeConfig, RoomProperty, ZoneParam, VirtualWallParam, SpotParam, WayPointParam, DetectedObjectParam, CustomElementParam, CustomCarpetParam, FurnitureParam, MapCallbacks } from '@ray-js/robot-map-sdk';
2
2
  import { MapApi } from './types';
3
3
  /**
4
4
  * 机器人地图组件属性接口
@@ -6,7 +6,7 @@ import { MapApi } from './types';
6
6
  * 定义了机器人地图组件的所有属性,包括地图数据、配置选项、事件回调等。
7
7
  * Robot map component props interface that defines all properties including map data, configuration options, event callbacks, etc.
8
8
  */
9
- export interface RobotMapProps {
9
+ export interface RobotMapProps extends MapCallbacks {
10
10
  /**
11
11
  * @description.zh 地图数据
12
12
  * @description.en Map data
@@ -127,299 +127,5 @@ export interface RobotMapProps {
127
127
  * @param mapApi - 可供使用的地图 API 函数对象,所有方法返回 Promise / Available map API functions object, all methods return Promise
128
128
  */
129
129
  onMapReady?: (mapApi: MapApi) => void;
130
- /**
131
- * @description.zh 地图首次绘制完成回调
132
- * @description.en Callback when the map is first drawn
133
- * @description.zh 当地图首次加载并绘制完成后触发,通常用于移除Loading状态。与 onMapDrawed 不同,此回调只在首次绘制时触发一次。
134
- * @description.en Triggered when the map is first loaded and drawn, usually used to remove the loading state. Unlike onMapDrawed, this callback is only triggered once on the first draw.
135
- * @param.zh mapState - 地图状态信息,包含地图ID、原点、尺寸等信息
136
- * @param.en mapState - Map state information including map ID, origin, dimensions, etc.
137
- */
138
- onMapFirstDrawed?: (mapState: MapState) => void;
139
- onCarpetsUpdated?: (carpets: CustomCarpetParam[]) => void;
140
- /**
141
- * @description.zh 地图绘制完成回调
142
- * @description.en Callback when the map is drawn
143
- * @description.zh 当地图数据解析并绘制完成后触发。
144
- * @description.en Triggered when map data is parsed and drawn.
145
- * @param.zh mapState - 地图状态信息,包含地图ID、原点、尺寸等信息
146
- * @param.en mapState - Map state information including map ID, origin, dimensions, etc.
147
- */
148
- onMapDrawed?: (mapState: MapState) => void;
149
- /**
150
- * @description.zh 路径绘制完成回调
151
- * @description.en Callback when the path is drawn
152
- * @description.zh 当机器人路径数据绘制完成后触发。
153
- * @description.en Triggered when robot path data is drawn.
154
- * @param.zh pathState - 路径状态信息,包含路径ID、类型、机器人位置等
155
- * @param.en pathState - Path state information including path ID, type, robot position, etc.
156
- */
157
- onPathDrawed?: (pathState: PathState) => void;
158
- /**
159
- * @description.zh 房间信息绘制完成回调
160
- * @description.en Callback when room properties are drawn
161
- * @description.zh 当房间属性信息绘制完成后触发。
162
- * @description.en Triggered when room property information is drawn.
163
- * @param.zh rooms - 房间属性信息数组
164
- * @param.en rooms - Array of room property information
165
- */
166
- onRoomPropertiesDrawed?: (rooms: RoomProperty[]) => void;
167
- /**
168
- * @description.zh 点击房间回调
169
- * @description.en Callback when clicking on a room
170
- * @description.zh 当用户点击地图上的房间区域时触发。
171
- * @description.en Triggered when user clicks on a room area on the map.
172
- * @param.zh room - 被点击的房间信息
173
- * @param.en room - Clicked room information
174
- */
175
- onClickRoom?: (room: Partial<RoomData>) => void;
176
- /**
177
- * @description.zh 点击房间信息回调
178
- * @description.en Callback when clicking on room properties
179
- * @description.zh 当用户点击房间的属性信息图标时触发。
180
- * @description.en Triggered when user clicks on the room property information icon.
181
- * @param.zh room - 被点击的房间信息
182
- * @param.en room - Clicked room information
183
- */
184
- onClickRoomProperties?: (room: Partial<RoomData>) => void;
185
- /**
186
- * @description.zh 点击禁扫区域删除按钮的回调
187
- * @description.en Callback when clicking the delete button of forbidden sweep zone
188
- * @description.zh 当用户点击禁扫区域删除按钮时触发。
189
- * @description.en Triggered when user clicks the delete button of forbidden sweep zone.
190
- * @param.zh id - 被删除的禁扫区域ID
191
- * @param.en id - ID of the deleted forbidden sweep zone
192
- */
193
- onRemoveForbiddenSweepZone?: (id: string) => void;
194
- /**
195
- * @description.zh 点击禁拖区域删除按钮的回调
196
- * @description.en Callback when clicking the delete button of forbidden mop zone
197
- * @description.zh 当用户点击禁拖区域删除按钮时触发。
198
- * @description.en Triggered when user clicks the delete button of forbidden mop zone.
199
- * @param.zh id - 被删除的禁拖区域ID
200
- * @param.en id - ID of the deleted forbidden mop zone
201
- */
202
- onRemoveForbiddenMopZone?: (id: string) => void;
203
- /**
204
- * @description.zh 点击清扫区域删除按钮的回调
205
- * @description.en Callback when clicking the delete button of clean zone
206
- * @description.zh 当用户点击清扫区域删除按钮时触发。
207
- * @description.en Triggered when user clicks the delete button of clean zone.
208
- * @param.zh id - 被删除的清扫区域ID
209
- * @param.en id - ID of the deleted clean zone
210
- */
211
- onRemoveCleanZone?: (id: string) => void;
212
- /**
213
- * @description.zh 点击虚拟墙删除按钮的回调
214
- * @description.en Callback when clicking the delete button of virtual wall
215
- * @description.zh 当用户点击虚拟墙删除按钮时触发。
216
- * @description.en Triggered when user clicks the delete button of virtual wall.
217
- * @param.zh id - 被删除的虚拟墙ID
218
- * @param.en id - ID of the deleted virtual wall
219
- */
220
- onRemoveVirtualWall?: (id: string) => void;
221
- /**
222
- * @description.zh 更新禁扫区域的回调
223
- * @description.en Callback when updating forbidden sweep zone
224
- * @description.zh 当用户操作禁扫区域(如拖拽、缩放)后触发。
225
- * @description.en Triggered when user operates forbidden sweep zone (such as dragging, scaling).
226
- * @param.zh zone - 更新后的禁扫区域数据
227
- * @param.en zone - Updated forbidden sweep zone data
228
- */
229
- onUpdateForbiddenSweepZone?: (zone: ZoneParam) => void;
230
- /**
231
- * @description.zh 更新禁拖区域的回调
232
- * @description.en Callback when updating forbidden mop zone
233
- * @description.zh 当用户操作禁拖区域(如拖拽、缩放)后触发。
234
- * @description.en Triggered when user operates forbidden mop zone (such as dragging, scaling).
235
- * @param.zh zone - 更新后的禁拖区域数据
236
- * @param.en zone - Updated forbidden mop zone data
237
- */
238
- onUpdateForbiddenMopZone?: (zone: ZoneParam) => void;
239
- /**
240
- * @description.zh 更新清扫区域的回调
241
- * @description.en Callback when updating clean zone
242
- * @description.zh 当用户操作清扫区域(如拖拽、缩放)后触发。
243
- * @description.en Triggered when user operates clean zone (such as dragging, scaling).
244
- * @param.zh zone - 更新后的清扫区域数据
245
- * @param.en zone - Updated clean zone data
246
- */
247
- onUpdateCleanZone?: (zone: ZoneParam) => void;
248
- /**
249
- * @description.zh 更新虚拟墙的回调
250
- * @description.en Callback when updating virtual wall
251
- * @description.zh 当用户操作虚拟墙(如拖拽、旋转)后触发。
252
- * @description.en Triggered when user operates virtual wall (such as dragging, rotating).
253
- * @param.zh wall - 更新后的虚拟墙数据
254
- * @param.en wall - Updated virtual wall data
255
- */
256
- onUpdateVirtualWall?: (wall: VirtualWallParam) => void;
257
- /**
258
- * @description.zh 更新定点清扫的回调
259
- * @description.en Callback when updating spot clean
260
- * @description.zh 当用户操作定点清扫位置后触发。
261
- * @description.en Triggered when user operates spot clean position.
262
- * @param.zh spot - 更新后的定点清扫数据
263
- * @param.en spot - Updated spot clean data
264
- */
265
- onUpdateSpot?: (spot: SpotParam) => void;
266
- /**
267
- * @description.zh 更新途经点的回调
268
- * @description.en Callback when updating way point
269
- * @description.zh 当用户操作途经点后触发。
270
- * @description.en Triggered when user operates way point.
271
- * @param.zh wayPoint - 更新后的途经点数据
272
- * @param.en wayPoint - Updated way point data
273
- */
274
- onUpdateWayPoint?: (wayPoint: WayPointParam) => void;
275
- /**
276
- * @description.zh 点击禁扫区域回调
277
- * @description.en Callback when clicking forbidden sweep zone
278
- * @description.zh 当用户点击禁扫区域时触发。
279
- * @description.en Triggered when user clicks forbidden sweep zone.
280
- * @param.zh zone - 被点击的禁扫区域数据
281
- * @param.en zone - Clicked forbidden sweep zone data
282
- */
283
- onClickForbiddenSweepZone?: (zone: ZoneParam) => void;
284
- /**
285
- * @description.zh 点击禁拖区域回调
286
- * @description.en Callback when clicking forbidden mop zone
287
- * @description.zh 当用户点击禁拖区域时触发。
288
- * @description.en Triggered when user clicks forbidden mop zone.
289
- * @param.zh zone - 被点击的禁拖区域数据
290
- * @param.en zone - Clicked forbidden mop zone data
291
- */
292
- onClickForbiddenMopZone?: (zone: ZoneParam) => void;
293
- /**
294
- * @description.zh 点击清扫区域回调
295
- * @description.en Callback when clicking clean zone
296
- * @description.zh 当用户点击清扫区域时触发。
297
- * @description.en Triggered when user clicks clean zone.
298
- * @param.zh zone - 被点击的清扫区域数据
299
- * @param.en zone - Clicked clean zone data
300
- */
301
- onClickCleanZone?: (zone: ZoneParam) => void;
302
- /**
303
- * @description.zh 点击虚拟墙回调
304
- * @description.en Callback when clicking virtual wall
305
- * @description.zh 当用户点击虚拟墙时触发。
306
- * @description.en Triggered when user clicks virtual wall.
307
- * @param.zh wall - 被点击的虚拟墙数据
308
- * @param.en wall - Clicked virtual wall data
309
- */
310
- onClickVirtualWall?: (wall: VirtualWallParam) => void;
311
- /**
312
- * @description.zh 点击定点清扫回调
313
- * @description.en Callback when clicking spot clean
314
- * @description.zh 当用户点击定点清扫点时触发。
315
- * @description.en Triggered when user clicks spot clean point.
316
- * @param.zh spot - 被点击的定点清扫数据
317
- * @param.en spot - Clicked spot clean data
318
- */
319
- onClickSpot?: (spot: SpotParam) => void;
320
- /**
321
- * @description.zh 点击途经点回调
322
- * @description.en Callback when clicking way point
323
- * @description.zh 当用户点击途经点时触发。
324
- * @description.en Triggered when user clicks way point.
325
- * @param.zh wayPoint - 被点击的途经点数据
326
- * @param.en wayPoint - Clicked way point data
327
- */
328
- onClickWayPoint?: (wayPoint: WayPointParam) => void;
329
- /**
330
- * @description.zh 点击检测物体回调
331
- * @description.en Callback when clicking detected object
332
- * @description.zh 当用户点击地图上的检测物体时触发。
333
- * @description.en Triggered when user clicks detected object on the map.
334
- * @param.zh object - 被点击的检测物体数据
335
- * @param.en object - Clicked detected object data
336
- */
337
- onClickDetectedObject?: (object: DetectedObjectParam) => void;
338
- /**
339
- * @description.zh 点击自定义元素回调
340
- * @description.en Callback when clicking custom element
341
- * @description.zh 当用户点击自定义元素时触发。
342
- * @description.en Triggered when user clicks custom element.
343
- * @param.zh element - 被点击的自定义元素数据
344
- * @param.en element - Clicked custom element data
345
- */
346
- onClickCustomElement?: (element: CustomElementParam) => void;
347
- /**
348
- * @description.zh 点击家具回调
349
- * @description.en Callback when clicking furniture
350
- * @description.zh 当用户点击家具时触发。
351
- * @description.en Triggered when user clicks furniture.
352
- * @param.zh furniture - 被点击的家具数据
353
- * @param.en furniture - Clicked furniture data
354
- */
355
- onClickFurniture?: (furniture: FurnitureParam) => void;
356
- /**
357
- * @description.zh 更新家具回调
358
- * @description.en Callback when updating furniture
359
- * @description.zh 当用户操作家具(如拖拽、旋转、缩放)后触发。
360
- * @description.en Triggered when user updates furniture (such as drag, rotate or scale).
361
- * @param.zh furniture - 更新后的家具数据
362
- * @param.en furniture - Updated furniture data
363
- */
364
- onUpdateFurniture?: (furniture: FurnitureParam) => void;
365
- /**
366
- * @description.zh 删除家具回调
367
- * @description.en Callback when removing furniture
368
- * @description.zh 当用户删除家具时触发。
369
- * @description.en Triggered when user removes furniture.
370
- * @param.zh id - 被删除的家具ID
371
- * @param.en id - ID of removed furniture
372
- */
373
- onRemoveFurniture?: (id: string) => void;
374
- /**
375
- * @description.zh 更新分割线回调
376
- * @description.en Callback when updating divider
377
- * @description.zh 当用户操作分割线(如拖拽端点、移动整条线)后触发。
378
- * @description.en Triggered when user operates divider (such as dragging endpoints, moving the entire line).
379
- * @param.zh divider - 更新后的分割线数据
380
- * @param.en divider - Updated divider data
381
- */
382
- onUpdateDivider?: (divider: Point[]) => void;
383
- /**
384
- * @description.zh 点击地图回调
385
- * @description.en Callback when clicking map
386
- * @description.zh 当用户点击地图时触发。
387
- * @description.en Triggered when user clicks map.
388
- * @param.zh point - 被点击的点数据
389
- * @param.en point - Clicked point data
390
- */
391
- onClickMap?: (point: Point) => void;
392
- /**
393
- * @description.zh 点击机器人回调
394
- * @description.en Callback when clicking robot
395
- * @description.zh 当用户点击机器人时触发。
396
- * @description.en Triggered when user clicks robot.
397
- * @param.zh robot - 被点击的机器人数据
398
- * @param.en robot - Clicked robot data
399
- */
400
- onClickRobot?: (robot: IconPoint) => void;
401
- /**
402
- * @description.zh 点击充电桩回调
403
- * @description.en Callback when clicking charging station
404
- * @description.zh 当用户点击充电桩时触发。
405
- * @description.en Triggered when user clicks charging station.
406
- * @param.zh chargingStation - 被点击的充电桩数据
407
- * @param.en chargingStation - Clicked charging station data
408
- */
409
- onClickChargingStation?: (chargingStation: IconPoint) => void;
410
- /**
411
- * @description.zh 手势开始回调
412
- * @description.en Callback when gesture starts
413
- * @description.zh 当用户开始手势操作时触发。
414
- * @description.en Triggered when user starts gesture operation.
415
- */
416
- onGestureStart?: () => void;
417
- /**
418
- * @description.zh 手势结束回调
419
- * @description.en Callback when gesture ends
420
- * @description.zh 当用户结束手势操作时触发。
421
- * @description.en Triggered when user ends gesture operation.
422
- */
423
- onGestureEnd?: () => void;
424
130
  }
425
131
  export declare const robotMapDefaultProps: RobotMapProps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/robot-map",
3
- "version": "0.0.8-beta.3",
3
+ "version": "0.0.8-beta.5",
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.14-beta.3",
36
+ "@ray-js/robot-map-sdk": "0.0.14-beta.5",
37
37
  "clsx": "^1.2.1",
38
38
  "nanoid": "^5.1.6"
39
39
  },