@ray-js/robot-map-sdk 0.0.3-beta-47 → 0.0.3-beta-49

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.
Files changed (43) hide show
  1. package/dist/constant/methods.js +1 -1
  2. package/dist/index.d.ts +199 -2
  3. package/dist/index.rjs.js +1 -1
  4. package/dist-app/assets/{index-VwsIvmhe.js → index-CY1T4TTF.js} +1 -1
  5. package/dist-app/index.html +1 -1
  6. package/dist-docs/404.html +2 -2
  7. package/dist-docs/assets/{app.CAcoFY26.js → app.voqo-XmY.js} +1 -1
  8. package/dist-docs/assets/chunks/@localSearchIndexroot.C8ORQZ5i.js +1 -0
  9. package/dist-docs/assets/chunks/{VPLocalSearchBox.UD2QNEXA.js → VPLocalSearchBox.Cx4AcJ2A.js} +1 -1
  10. package/dist-docs/assets/chunks/{theme.BcL9rPww.js → theme.kw_dRkmm.js} +2 -2
  11. package/dist-docs/assets/{guide_advanced-usage.md.Op4RP3gd.js → guide_advanced-usage.md.Bt5ROSu8.js} +43 -3
  12. package/dist-docs/assets/{guide_advanced-usage.md.Op4RP3gd.lean.js → guide_advanced-usage.md.Bt5ROSu8.lean.js} +1 -1
  13. package/dist-docs/assets/{guide_getting-started.md.BHgQcxq8.js → guide_getting-started.md.Cpb9H5v0.js} +1 -1
  14. package/dist-docs/assets/{reference_callbacks.md.-S6uhkXO.js → reference_callbacks.md.DgCt5RdP.js} +2 -2
  15. package/dist-docs/assets/{reference_callbacks.md.-S6uhkXO.lean.js → reference_callbacks.md.DgCt5RdP.lean.js} +1 -1
  16. package/dist-docs/assets/reference_config.md.C4_zYqWJ.js +61 -0
  17. package/dist-docs/assets/reference_config.md.C4_zYqWJ.lean.js +1 -0
  18. package/dist-docs/assets/{reference_data.md.B8JfrRhl.js → reference_data.md.DciSLVC8.js} +10 -3
  19. package/dist-docs/assets/{reference_data.md.B8JfrRhl.lean.js → reference_data.md.DciSLVC8.lean.js} +1 -1
  20. package/dist-docs/assets/{reference_methods.md.CO0IvYMn.js → reference_methods.md.DxIWUIJ-.js} +3 -3
  21. package/dist-docs/assets/{reference_methods.md.CO0IvYMn.lean.js → reference_methods.md.DxIWUIJ-.lean.js} +1 -1
  22. package/dist-docs/assets/reference_runtime.md.BA81waFW.js +19 -0
  23. package/dist-docs/assets/{reference_runtime.md.BMm5Nj3U.lean.js → reference_runtime.md.BA81waFW.lean.js} +1 -1
  24. package/dist-docs/assets/{reference_types.md.DkIhhJD0.js → reference_types.md.4zpYEKU_.js} +7 -2
  25. package/dist-docs/assets/{reference_types.md.DkIhhJD0.lean.js → reference_types.md.4zpYEKU_.lean.js} +1 -1
  26. package/dist-docs/guide/advanced-usage.html +46 -6
  27. package/dist-docs/guide/concepts.html +3 -3
  28. package/dist-docs/guide/getting-started.html +5 -5
  29. package/dist-docs/hashmap.json +1 -1
  30. package/dist-docs/index.html +3 -3
  31. package/dist-docs/reference/callbacks.html +5 -5
  32. package/dist-docs/reference/config.html +5 -5
  33. package/dist-docs/reference/data.html +13 -6
  34. package/dist-docs/reference/methods.html +6 -6
  35. package/dist-docs/reference/runtime.html +5 -5
  36. package/dist-docs/reference/types.html +10 -5
  37. package/dist-docs/reference/utils.html +3 -3
  38. package/package.json +1 -1
  39. package/dist-docs/assets/chunks/@localSearchIndexroot.BVVyfLDa.js +0 -1
  40. package/dist-docs/assets/reference_config.md.BCRDz_cF.js +0 -61
  41. package/dist-docs/assets/reference_config.md.BCRDz_cF.lean.js +0 -1
  42. package/dist-docs/assets/reference_runtime.md.BMm5Nj3U.js +0 -19
  43. /package/dist-docs/assets/{guide_getting-started.md.BHgQcxq8.lean.js → guide_getting-started.md.Cpb9H5v0.lean.js} +0 -0
@@ -1 +1 @@
1
- const e=["areRoomsAdjacent","getForbiddenSweepZones","getForbiddenMopZones","getCleanZones","getVirtualWalls","getSpots","getViewportCenterPoint","getMapCenterPoint","getWallPointsByViewportCenter","getForbiddenSweepZonePointsByViewportCenter","getForbiddenMopZonePointsByViewportCenter","getCleanZonePointsByViewportCenter","getSpotPointByViewportCenter","getEffectiveDividerPoints","getDividerEndPoints","isNearChargerOrRobot","isPointInAnyRoom","resetPanZoom","snapshot","snapshotByData"],o=["onMapFirstDrawed","onMapDrawed","onPathDrawed","onRoomPropertiesDrawed","onClickRoom","onClickRoomProperties","onRemoveForbiddenSweepZone","onRemoveForbiddenMopZone","onRemoveCleanZone","onRemoveVirtualWall","onUpdateForbiddenSweepZone","onUpdateForbiddenMopZone","onUpdateCleanZone","onUpdateVirtualWall","onUpdateSpot","onUpdateDivider","onClickForbiddenSweepZone","onClickForbiddenMopZone","onClickCleanZone","onClickVirtualWall","onClickSpot","onClickDetectedObject","onClickCustomElement"];export{e as MAP_API_METHODS,o as MAP_CALLBACK_METHODS};
1
+ const e=["areRoomsAdjacent","getForbiddenSweepZones","getForbiddenMopZones","getCleanZones","getVirtualWalls","getSpots","getWayPoints","getViewportCenterPoint","getMapCenterPoint","getWallPointsByViewportCenter","getForbiddenSweepZonePointsByViewportCenter","getForbiddenMopZonePointsByViewportCenter","getCleanZonePointsByViewportCenter","getSpotPointByViewportCenter","getEffectiveDividerPoints","getDividerEndPoints","isNearChargerOrRobot","isPointInAnyRoom","resetPanZoom","snapshot","snapshotByData"],o=["onMapFirstDrawed","onMapDrawed","onPathDrawed","onRoomPropertiesDrawed","onClickRoom","onClickRoomProperties","onRemoveForbiddenSweepZone","onRemoveForbiddenMopZone","onRemoveCleanZone","onRemoveVirtualWall","onUpdateForbiddenSweepZone","onUpdateForbiddenMopZone","onUpdateCleanZone","onUpdateVirtualWall","onUpdateSpot","onUpdateWayPoint","onUpdateDivider","onClickForbiddenSweepZone","onClickForbiddenMopZone","onClickCleanZone","onClickVirtualWall","onClickSpot","onClickWayPoint","onClickDetectedObject","onClickCustomElement","onClickMap"];export{e as MAP_API_METHODS,o as MAP_CALLBACK_METHODS};
package/dist/index.d.ts CHANGED
@@ -230,6 +230,27 @@ export declare type AppConfig = {
230
230
  /** 缩放系数 */
231
231
  scale: number
232
232
  }
233
+ /**
234
+ * 是否启用 RoomInfo 弹性缩放
235
+ *
236
+ * 启用后,RoomInfo 会根据地图缩放程度自动调整大小:
237
+ * - 地图缩小到一定程度时,缩小到 elasticMinScale
238
+ * - 正常缩放范围内,保持固定大小
239
+ * - 地图放大到一定程度时,放大到 elasticMaxScale
240
+ */
241
+ enableElasticScale: boolean
242
+ /**
243
+ * RoomInfo 最小弹性缩放倍数
244
+ *
245
+ * 当地图缩小到一定程度时,RoomInfo 会缩小到此倍数
246
+ */
247
+ elasticMinScale: number
248
+ /**
249
+ * RoomInfo 最大弹性缩放倍数
250
+ *
251
+ * 当地图放大到一定程度时,RoomInfo 会放大到此倍数
252
+ */
253
+ elasticMaxScale: number
233
254
  }
234
255
 
235
256
  /** 路径配置 */
@@ -649,6 +670,8 @@ export declare type ControlsConfig = {
649
670
  textFontFamily: string
650
671
  /** 文本字体粗细 */
651
672
  textFontWeight: TextStyleFontWeight
673
+ /** 单位 */
674
+ unit: MeasurementUnit
652
675
  /** 单位标签 */
653
676
  unitLabel: string
654
677
  /** 禁扫区域配置 */
@@ -661,6 +684,7 @@ export declare type ControlsConfig = {
661
684
  virtualWall: VirtualWallConfig
662
685
  /** 定点清扫配置 */
663
686
  spot: SpotConfig
687
+ wayPoint: WayPointConfig
664
688
  }
665
689
 
666
690
  declare class ControlsManager {
@@ -669,6 +693,7 @@ declare class ControlsManager {
669
693
  private cleanZoneMap;
670
694
  private virtualWallMap;
671
695
  private spotMap;
696
+ private wayPointMap;
672
697
  private divider;
673
698
  private unsubscribeFns;
674
699
  constructor();
@@ -804,6 +829,43 @@ declare class ControlsManager {
804
829
  * 比较两个定点清扫数据是否相等
805
830
  */
806
831
  private isSpotDataEqual;
832
+ /**
833
+ * 绘制途径点
834
+ * @param wayPoints 途径点数组
835
+ */
836
+ drawWayPoints(wayPoints: WayPointParam[]): void;
837
+ /**
838
+ * 清除所有途径点
839
+ */
840
+ clearAllWayPoints(): void;
841
+ /**
842
+ * 获取所有途径点数据
843
+ */
844
+ getWayPoints(): WayPointParam[];
845
+ /**
846
+ * 添加新途径点到 LAYER_CONTROLS
847
+ */
848
+ private addNewWayPoint;
849
+ /**
850
+ * 移除途径点
851
+ */
852
+ private removeWayPoint;
853
+ /**
854
+ * 获取途径点数据
855
+ */
856
+ private getWayPointsData;
857
+ /**
858
+ * 清除所有途径点
859
+ */
860
+ private clearAllWayPointsInternal;
861
+ /**
862
+ * 更新途径点编辑状态
863
+ */
864
+ private updateWayPointsEditState;
865
+ /**
866
+ * 比较两个途径点数据是否相等
867
+ */
868
+ private isWayPointDataEqual;
807
869
  /**
808
870
  * 处理分割房间ID变化
809
871
  */
@@ -1422,6 +1484,11 @@ declare class Interaction extends Container {
1422
1484
  lastTapPosition: Point | null;
1423
1485
  tapDistanceThreshold: number;
1424
1486
  tapDetectionEnabled: boolean;
1487
+ private mapClickStartPosition;
1488
+ private mapClickStartTime;
1489
+ private readonly mapClickTimeThreshold;
1490
+ private readonly mapClickMoveThreshold;
1491
+ private shouldSuppressMapClick;
1425
1492
  private isGestureHijacked;
1426
1493
  private hijackedPointerId;
1427
1494
  private isHijackPaused;
@@ -1429,6 +1496,7 @@ declare class Interaction extends Container {
1429
1496
  private viewportBounds;
1430
1497
  private boundResetAnimation;
1431
1498
  private debouncedStopWheelRender;
1499
+ private debouncedLogWheelScale;
1432
1500
  private interactionState;
1433
1501
  private throttledAntiScale;
1434
1502
  constructor();
@@ -1469,6 +1537,10 @@ declare class Interaction extends Container {
1469
1537
  * 销毁时清理事件监听
1470
1538
  */
1471
1539
  destroy(): void;
1540
+ /**
1541
+ * 处理抑制地图点击事件
1542
+ */
1543
+ private handleSuppressMapClick;
1472
1544
  /**
1473
1545
  * 处理手势劫持
1474
1546
  */
@@ -1491,6 +1563,7 @@ declare class Interaction extends Container {
1491
1563
  private onPointerDown;
1492
1564
  private onPointerUp;
1493
1565
  private detectDoubleTap;
1566
+ private detectMapClick;
1494
1567
  private handleDoubleTap;
1495
1568
  private onPointerMove;
1496
1569
  private applyPan;
@@ -1513,9 +1586,9 @@ declare type Managers = {
1513
1586
  roomsManager: RoomManager;
1514
1587
  };
1515
1588
 
1516
- export declare const MAP_API_METHODS: readonly ["areRoomsAdjacent", "getForbiddenSweepZones", "getForbiddenMopZones", "getCleanZones", "getVirtualWalls", "getSpots", "getViewportCenterPoint", "getMapCenterPoint", "getWallPointsByViewportCenter", "getForbiddenSweepZonePointsByViewportCenter", "getForbiddenMopZonePointsByViewportCenter", "getCleanZonePointsByViewportCenter", "getSpotPointByViewportCenter", "getEffectiveDividerPoints", "getDividerEndPoints", "isNearChargerOrRobot", "isPointInAnyRoom", "resetPanZoom", "snapshot", "snapshotByData"];
1589
+ export declare const MAP_API_METHODS: readonly ["areRoomsAdjacent", "getForbiddenSweepZones", "getForbiddenMopZones", "getCleanZones", "getVirtualWalls", "getSpots", "getWayPoints", "getViewportCenterPoint", "getMapCenterPoint", "getWallPointsByViewportCenter", "getForbiddenSweepZonePointsByViewportCenter", "getForbiddenMopZonePointsByViewportCenter", "getCleanZonePointsByViewportCenter", "getSpotPointByViewportCenter", "getEffectiveDividerPoints", "getDividerEndPoints", "isNearChargerOrRobot", "isPointInAnyRoom", "resetPanZoom", "snapshot", "snapshotByData"];
1517
1590
 
1518
- export declare const MAP_CALLBACK_METHODS: readonly ["onMapFirstDrawed", "onMapDrawed", "onPathDrawed", "onRoomPropertiesDrawed", "onClickRoom", "onClickRoomProperties", "onRemoveForbiddenSweepZone", "onRemoveForbiddenMopZone", "onRemoveCleanZone", "onRemoveVirtualWall", "onUpdateForbiddenSweepZone", "onUpdateForbiddenMopZone", "onUpdateCleanZone", "onUpdateVirtualWall", "onUpdateSpot", "onUpdateDivider", "onClickForbiddenSweepZone", "onClickForbiddenMopZone", "onClickCleanZone", "onClickVirtualWall", "onClickSpot", "onClickDetectedObject", "onClickCustomElement"];
1591
+ export declare const MAP_CALLBACK_METHODS: readonly ["onMapFirstDrawed", "onMapDrawed", "onPathDrawed", "onRoomPropertiesDrawed", "onClickRoom", "onClickRoomProperties", "onRemoveForbiddenSweepZone", "onRemoveForbiddenMopZone", "onRemoveCleanZone", "onRemoveVirtualWall", "onUpdateForbiddenSweepZone", "onUpdateForbiddenMopZone", "onUpdateCleanZone", "onUpdateVirtualWall", "onUpdateSpot", "onUpdateWayPoint", "onUpdateDivider", "onClickForbiddenSweepZone", "onClickForbiddenMopZone", "onClickCleanZone", "onClickVirtualWall", "onClickSpot", "onClickWayPoint", "onClickDetectedObject", "onClickCustomElement", "onClickMap"];
1519
1592
 
1520
1593
  /**
1521
1594
  * 地图 API 接口定义
@@ -1862,6 +1935,11 @@ declare class MapApplication extends Application implements MapApi {
1862
1935
  * @param spots - 定点清扫参数数组
1863
1936
  */
1864
1937
  drawSpots(spots: SpotParam[]): void;
1938
+ /**
1939
+ * 绘制途径点
1940
+ * @param wayPoints - 途径点参数数组
1941
+ */
1942
+ drawWayPoints(wayPoints: WayPointParam[]): void;
1865
1943
  /**
1866
1944
  * 绘制检测到的物体
1867
1945
  * @param objects - 检测物体参数数组
@@ -1902,6 +1980,12 @@ declare class MapApplication extends Application implements MapApi {
1902
1980
  * @returns 定点清扫数据数组
1903
1981
  */
1904
1982
  getSpots(): SpotParam[];
1983
+ /**
1984
+ * 获取当前地图上所有途径点数据
1985
+ *
1986
+ * @returns 途径点数据数组
1987
+ */
1988
+ getWayPoints(): WayPointParam[];
1905
1989
  /**
1906
1990
  * 获取分割线有效端点
1907
1991
  * @returns 分割线有效端点
@@ -2341,6 +2425,24 @@ export declare interface MapCallbacks {
2341
2425
  *
2342
2426
  */
2343
2427
  onUpdateSpot?: (spot: SpotParam) => void;
2428
+ /**
2429
+ * 更新途径点的回调
2430
+ *
2431
+ * 当用户操作途径点位置后触发。
2432
+ *
2433
+ * @param wayPoint - 更新后的途径点数据
2434
+ *
2435
+ */
2436
+ onUpdateWayPoint?: (wayPoint: WayPointParam) => void;
2437
+ /**
2438
+ * 点击途径点的回调
2439
+ *
2440
+ * 当用户点击途径点时触发。
2441
+ *
2442
+ * @param wayPoint - 被点击的途径点数据
2443
+ *
2444
+ */
2445
+ onClickWayPoint?: (wayPoint: WayPointParam) => void;
2344
2446
  /**
2345
2447
  * 点击禁扫区域回调
2346
2448
  *
@@ -2413,6 +2515,16 @@ export declare interface MapCallbacks {
2413
2515
  *
2414
2516
  */
2415
2517
  onUpdateDivider?: (divider: Point[]) => void;
2518
+ /**
2519
+ * 地图点击回调
2520
+ *
2521
+ * 当启用地图点击捕获(enableMapClickCapture)后,用户点击地图时触发。
2522
+ * 返回点击位置的地图坐标(基于原点坐标系)。
2523
+ *
2524
+ * @param point - 点击位置的地图坐标
2525
+ *
2526
+ */
2527
+ onClickMap?: (point: Point) => void;
2416
2528
  }
2417
2529
 
2418
2530
  /**
@@ -2608,6 +2720,9 @@ export declare type MapState = {
2608
2720
  */
2609
2721
  export declare type MapType = 'structured' | 'raster'
2610
2722
 
2723
+ /** 测量单位 */
2724
+ export declare type MeasurementUnit = 'meter' | 'feet' | 'centimeter'
2725
+
2611
2726
  declare class Obstacle extends Graphics {
2612
2727
  constructor();
2613
2728
  /**
@@ -3265,6 +3380,10 @@ export declare type RuntimeConfig = {
3265
3380
  editingVirtualWallIds: string[]
3266
3381
  /** 正在编辑的定点清扫ID列表 */
3267
3382
  editingSpotIds: string[]
3383
+ /** 正在编辑的途径点ID列表 */
3384
+ editingWayPointIds: string[]
3385
+ /** 启用地图点击坐标捕获 */
3386
+ enableMapClickCapture: boolean
3268
3387
  /** 地图旋转角度(度) */
3269
3388
  mapRotation: number
3270
3389
  /** 房间属性折叠的房间ID列表 */
@@ -3375,6 +3494,8 @@ export declare type SpotConfig = {
3375
3494
  strokeWidth: number
3376
3495
  /** 填充颜色 */
3377
3496
  fillColor: ColorSource
3497
+ /** 是否显示文本 */
3498
+ showText: boolean
3378
3499
  /** 文本颜色 */
3379
3500
  textColor: ColorSource
3380
3501
  /** 文本位置 */
@@ -3388,6 +3509,8 @@ export declare type SpotConfig = {
3388
3509
  isDashed: boolean
3389
3510
  /** 虚线数组 */
3390
3511
  dashArray: [number, number]
3512
+ /** 是否显示图标 */
3513
+ showIcon: boolean
3391
3514
  }
3392
3515
  /** 普通模式样式 */
3393
3516
  normal: {
@@ -3395,6 +3518,8 @@ export declare type SpotConfig = {
3395
3518
  isDashed: boolean
3396
3519
  /** 虚线数组 */
3397
3520
  dashArray: [number, number]
3521
+ /** 是否显示图标 */
3522
+ showIcon: boolean
3398
3523
  }
3399
3524
  }
3400
3525
 
@@ -3499,6 +3624,78 @@ export declare type VirtualWallParam = {
3499
3624
  points: Point[]
3500
3625
  }
3501
3626
 
3627
+ /** 途径点配置 */
3628
+ export declare type WayPointConfig = {
3629
+ /** 是否显示序号 */
3630
+ showOrder: boolean
3631
+ /** 编辑模式样式 */
3632
+ editing: {
3633
+ /** 图标资源路径 */
3634
+ iconSrc: string
3635
+ /** 图标大小 */
3636
+ iconSize: number
3637
+ /** 序号文本样式 */
3638
+ orderText: {
3639
+ /** 字体大小 */
3640
+ fontSize: number
3641
+ /** 字体名称 */
3642
+ fontFamily: string
3643
+ /** 字体粗细 */
3644
+ fontWeight: TextStyleFontWeight
3645
+ /** 字体颜色 */
3646
+ color: ColorSource
3647
+ }
3648
+ /** 序号容器样式 */
3649
+ orderContainer: {
3650
+ /** 容器大小(圆形直径) */
3651
+ size: number
3652
+ /** 背景颜色 */
3653
+ backgroundColor: ColorSource
3654
+ /** 垂直偏移量 */
3655
+ offsetY: number
3656
+ /** 水平偏移量 */
3657
+ offsetX: number
3658
+ }
3659
+ }
3660
+ /** 普通模式样式 */
3661
+ normal: {
3662
+ /** 图标资源路径 */
3663
+ iconSrc: string
3664
+ /** 图标大小 */
3665
+ iconSize: number
3666
+ /** 序号文本样式 */
3667
+ orderText: {
3668
+ /** 字体大小 */
3669
+ fontSize: number
3670
+ /** 字体名称 */
3671
+ fontFamily: string
3672
+ /** 字体粗细 */
3673
+ fontWeight: TextStyleFontWeight
3674
+ /** 字体颜色 */
3675
+ color: ColorSource
3676
+ }
3677
+ /** 序号容器样式 */
3678
+ orderContainer: {
3679
+ /** 容器大小(圆形直径) */
3680
+ size: number
3681
+ /** 背景颜色 */
3682
+ backgroundColor: ColorSource
3683
+ /** 垂直偏移量 */
3684
+ offsetY: number
3685
+ /** 水平偏移量 */
3686
+ offsetX: number
3687
+ }
3688
+ }
3689
+ }
3690
+
3691
+ /** 途径点参数 */
3692
+ export declare type WayPointParam = {
3693
+ /** 途径点ID */
3694
+ id: string
3695
+ /** 点坐标 */
3696
+ point: Point
3697
+ }
3698
+
3502
3699
  /** 区域配置 */
3503
3700
  export declare type ZoneConfig = {
3504
3701
  /** 最小尺寸 (米) */