floor-editor-ts 1.3.2 → 1.3.4

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.
@@ -0,0 +1,13 @@
1
+ /** Unified host callback event name and payload shape. */
2
+ export declare const FLOOR_CALLBACK_EVENT: "floor:callbackEvent";
3
+ export declare function setAssignedCamerasSyncing(value: boolean): void;
4
+ export declare function isAssignedCamerasSyncing(): boolean;
5
+ export type FloorCallbackType = "save" | "autoSave" | "cameraRemoved" | "camerasRejected";
6
+ export interface FloorCallbackPayload<T = unknown> {
7
+ type: FloorCallbackType;
8
+ data: T;
9
+ }
10
+ export type FloorCallbackDispatcher = (eventName: typeof FLOOR_CALLBACK_EVENT, detail: FloorCallbackPayload) => void;
11
+ /** Wire from App so stores/utils can emit without prop drilling. */
12
+ export declare function setFloorCallbackDispatcher(fn: FloorCallbackDispatcher | null): void;
13
+ export declare function emitFloorCallback(type: FloorCallbackType, data: unknown): void;
@@ -4,6 +4,11 @@ export interface SiteCameraOption {
4
4
  serial: string;
5
5
  name: string;
6
6
  }
7
+ /** Cameras assigned to the floor by the host app (bidirectional sync). */
8
+ export interface AssignedCamera {
9
+ serial: string;
10
+ name: string;
11
+ }
7
12
  export interface FloorEditorConfig {
8
13
  viewOnly: boolean;
9
14
  floorMaxWidth: number;
@@ -16,6 +21,8 @@ export interface FloorEditorConfig {
16
21
  showCameraLabels?: boolean;
17
22
  cameraHeatmapMatrix?: number[][];
18
23
  siteCameras?: SiteCameraOption[];
24
+ /** Host-selected cameras to place/sync on the active floor */
25
+ assignedCameras?: AssignedCamera[];
19
26
  cameraThumbnail?: string;
20
27
  cameraThumbnailOpacity?: number;
21
28
  /** Canvas area outside the floor plan bounds */
@@ -0,0 +1,9 @@
1
+ import { AssignedCamera } from '../../../lib/packageDefaults';
2
+ /**
3
+ * Sync host `assignedCameras` onto the active floor.
4
+ * - Adds missing serials at floor center (non-overlapping)
5
+ * - Updates names for existing serials
6
+ * - Removes cameras whose serial is no longer assigned
7
+ * - If floor has no walls, rejects adds and emits camerasRejected
8
+ */
9
+ export declare function syncAssignedCameras(assigned: AssignedCamera[]): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "floor-editor-ts",
3
3
  "private": false,
4
- "version": "1.3.2",
4
+ "version": "1.3.4",
5
5
  "type": "module",
6
6
  "main": "./dist/floor-editor.es.js",
7
7
  "module": "./dist/floor-editor.es.js",