floor-editor-ts 1.3.4 → 1.3.6

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.
@@ -2,7 +2,17 @@
2
2
  export declare const FLOOR_CALLBACK_EVENT: "floor:callbackEvent";
3
3
  export declare function setAssignedCamerasSyncing(value: boolean): void;
4
4
  export declare function isAssignedCamerasSyncing(): boolean;
5
- export type FloorCallbackType = "save" | "autoSave" | "cameraRemoved" | "camerasRejected";
5
+ export type FloorCallbackType = "save" | "autoSave" | "camerasChanged" | "camerasRejected";
6
+ /** Dynamic camera props from host / furniture (always includes serial). */
7
+ export type CameraCallbackProps = Record<string, string> & {
8
+ serial: string;
9
+ };
10
+ export interface CamerasChangedData {
11
+ /** Cameras present after the change (e.g. undo restore, or host should select) */
12
+ added: CameraCallbackProps[];
13
+ /** Cameras no longer on the floor (e.g. delete / undo of add) */
14
+ removed: CameraCallbackProps[];
15
+ }
6
16
  export interface FloorCallbackPayload<T = unknown> {
7
17
  type: FloorCallbackType;
8
18
  data: T;
@@ -11,3 +21,9 @@ export type FloorCallbackDispatcher = (eventName: typeof FLOOR_CALLBACK_EVENT, d
11
21
  /** Wire from App so stores/utils can emit without prop drilling. */
12
22
  export declare function setFloorCallbackDispatcher(fn: FloorCallbackDispatcher | null): void;
13
23
  export declare function emitFloorCallback(type: FloorCallbackType, data: unknown): void;
24
+ export declare function emitCamerasChanged(data: CamerasChangedData): void;
25
+ export declare function cameraItemToCallbackProps(item: {
26
+ serial?: string;
27
+ name?: string;
28
+ props?: Record<string, string>;
29
+ }): CameraCallbackProps | null;
@@ -68,6 +68,8 @@ export interface FurnitureItem {
68
68
  locked?: boolean;
69
69
  name?: string;
70
70
  serial?: string;
71
+ /** Dynamic host fields for camera (and similar) — key = label, value = input */
72
+ props?: Record<string, string>;
71
73
  heatmapMatrix?: any;
72
74
  hasPerson?: boolean;
73
75
  showHeatmap?: boolean;
@@ -4,11 +4,18 @@ 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 {
7
+ /**
8
+ * Cameras assigned to the floor by the host app (bidirectional sync).
9
+ * `serial` is required (unique id, readonly in Properties).
10
+ * Any extra keys are shown dynamically in Camera Properties (label = key, input = value).
11
+ */
12
+ export type AssignedCamera = {
9
13
  serial: string;
10
- name: string;
11
- }
14
+ [key: string]: string | number | boolean | null | undefined;
15
+ };
16
+ /** Flatten host camera object into string props for furniture + UI. */
17
+ export declare function assignedCameraToProps(cam: AssignedCamera): Record<string, string>;
18
+ export declare function formatCameraPropLabel(key: string): string;
12
19
  export interface FloorEditorConfig {
13
20
  viewOnly: boolean;
14
21
  floorMaxWidth: number;
@@ -2,7 +2,7 @@ import { AssignedCamera } from '../../../lib/packageDefaults';
2
2
  /**
3
3
  * Sync host `assignedCameras` onto the active floor.
4
4
  * - Adds missing serials at floor center (non-overlapping)
5
- * - Updates names for existing serials
5
+ * - Updates dynamic props for existing serials
6
6
  * - Removes cameras whose serial is no longer assigned
7
7
  * - If floor has no walls, rejects adds and emits camerasRejected
8
8
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "floor-editor-ts",
3
3
  "private": false,
4
- "version": "1.3.4",
4
+ "version": "1.3.6",
5
5
  "type": "module",
6
6
  "main": "./dist/floor-editor.es.js",
7
7
  "module": "./dist/floor-editor.es.js",