floor-editor-ts 1.3.9 → 1.3.10

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.
@@ -128,18 +128,21 @@ export interface GuideLine {
128
128
  orientation: 'horizontal' | 'vertical';
129
129
  position: number;
130
130
  }
131
- /** Floor overlay zone (not tied to walls). Independent of heatmap. */
131
+ /** Floor overlay area (not tied to walls). Independent of heatmap. 1 area ↔ 1 camera. */
132
132
  export type ZoneShape = 'rectangle' | 'triangle' | 'polygon';
133
133
  export interface Zone {
134
134
  id: string;
135
+ /** Display name — normally from assignedCameras[].area */
135
136
  name: string;
136
137
  shape: ZoneShape;
137
138
  /** Closed polygon vertices (first point not repeated). */
138
139
  points: Point[];
139
- /** Stroke + label color (hex). */
140
+ /** Stroke + label color — normally from assignedCameras[].areaColor */
140
141
  color: string;
141
142
  /** Soft fill alpha inside polygon. Default ~0.1 */
142
143
  fillOpacity?: number;
144
+ /** Linked camera serial (assignedCameras item). */
145
+ cameraSerial?: string;
143
146
  }
144
147
  export interface BackgroundImage {
145
148
  dataUrl: string;
@@ -144,8 +144,20 @@ export declare function moveTextAnnotation(id: string, position: {
144
144
  x: number;
145
145
  y: number;
146
146
  }): void;
147
- export declare function addZone(shape: ZoneShape, points: Point[], name?: string, color?: string): string;
148
- export declare function updateZone(id: string, updates: Partial<Pick<Zone, 'name' | 'color' | 'fillOpacity' | 'points' | 'shape'>>): void;
147
+ export type AddZoneOptions = {
148
+ name?: string;
149
+ color?: string;
150
+ cameraSerial?: string;
151
+ fillOpacity?: number;
152
+ };
153
+ export declare function addZone(shape: ZoneShape, points: Point[], nameOrOpts?: string | AddZoneOptions, colorArg?: string): string;
154
+ /**
155
+ * Create area for a camera, or replace geometry if that camera already has an area.
156
+ */
157
+ export declare function upsertCameraZone(shape: ZoneShape, points: Point[], opts: AddZoneOptions & {
158
+ cameraSerial: string;
159
+ }): string;
160
+ export declare function updateZone(id: string, updates: Partial<Pick<Zone, 'name' | 'color' | 'fillOpacity' | 'points' | 'shape' | 'cameraSerial'>>): void;
149
161
  /** Live drag without undo snapshot (commit with updateZone / endUndoGroup). */
150
162
  export declare function moveZonePoints(id: string, points: Point[]): void;
151
163
  export declare function removeZone(id: string): void;
@@ -4,6 +4,15 @@ export declare const DEFAULT_ZONE_FILL_OPACITY = 0.1;
4
4
  /** Default rect half-size in world units (cm). */
5
5
  export declare const DEFAULT_ZONE_SIZE = 200;
6
6
  export declare function nextZoneColor(existingCount: number): string;
7
+ /** Resolve area label + color from host assigned camera fields. */
8
+ export declare function resolveCameraAreaStyle(source: {
9
+ area?: unknown;
10
+ areaColor?: unknown;
11
+ props?: Record<string, string>;
12
+ } | null | undefined, fallbackIndex?: number): {
13
+ name: string;
14
+ color: string;
15
+ };
7
16
  export declare function rectPoints(x1: number, y1: number, x2: number, y2: number): Point[];
8
17
  /** Isosceles triangle pointing up, centered at `c`. */
9
18
  export declare function trianglePoints(c: Point, size?: number): Point[];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "floor-editor-ts",
3
3
  "private": false,
4
- "version": "1.3.9",
4
+ "version": "1.3.10",
5
5
  "type": "module",
6
6
  "main": "./dist/floor-editor.es.js",
7
7
  "module": "./dist/floor-editor.es.js",