floor-editor-ts 1.3.6 → 1.3.8
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/dist/floor-editor.es.js +534 -216
- package/dist/floor-editor.es.js.map +1 -1
- package/dist/src/lib/packageDefaults.d.ts +22 -2
- package/dist/src/lib/stores/assignedCamerasSync.d.ts +2 -0
- package/dist/src/lib/utils/canvasRenderer.d.ts +2 -1
- package/dist/src/lib/utils/heatmapColorScale.d.ts +39 -0
- package/package.json +1 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { Project } from '../../lib/models/types';
|
|
1
|
+
import { Floor, Project } from '../../lib/models/types';
|
|
2
|
+
import { HeatmapColorScale } from '../../lib/utils/heatmapColorScale';
|
|
3
|
+
export type { HeatmapColorLevel, HeatmapColorScale, } from '../../lib/utils/heatmapColorScale';
|
|
2
4
|
/** Camera from host app — used to assign floor camera furniture via select. */
|
|
3
5
|
export interface SiteCameraOption {
|
|
4
6
|
serial: string;
|
|
@@ -16,12 +18,19 @@ export type AssignedCamera = {
|
|
|
16
18
|
/** Flatten host camera object into string props for furniture + UI. */
|
|
17
19
|
export declare function assignedCameraToProps(cam: AssignedCamera): Record<string, string>;
|
|
18
20
|
export declare function formatCameraPropLabel(key: string): string;
|
|
21
|
+
/** How secondary TopBar tools (grid/furniture/history/area/settings) are shown. */
|
|
22
|
+
export type HeaderToolsMode = "full" | "compact" | "auto";
|
|
19
23
|
export interface FloorEditorConfig {
|
|
20
24
|
viewOnly: boolean;
|
|
21
25
|
floorMaxWidth: number;
|
|
22
26
|
floorMaxHeight: number;
|
|
23
27
|
heatmapEnabled: boolean;
|
|
24
28
|
heatmapMatrix: number[][];
|
|
29
|
+
/**
|
|
30
|
+
* Floor heatmap color scale from host.
|
|
31
|
+
* `gradient` (default) or `levels` with host-defined N bands — see docs/heatmap-host-standard.md §8.
|
|
32
|
+
*/
|
|
33
|
+
heatmapColorScale?: HeatmapColorScale;
|
|
25
34
|
projectName?: string;
|
|
26
35
|
selectedCameraSerial?: string | null;
|
|
27
36
|
showCameraCones?: boolean;
|
|
@@ -36,9 +45,20 @@ export interface FloorEditorConfig {
|
|
|
36
45
|
canvasBackground?: string;
|
|
37
46
|
/** Fill under the floor plan (inside wall bounds) */
|
|
38
47
|
floorPlateBackground?: string;
|
|
48
|
+
/**
|
|
49
|
+
* TopBar secondary tools layout:
|
|
50
|
+
* - `full` — separate icons (default)
|
|
51
|
+
* - `compact` — always fold into one Settings menu
|
|
52
|
+
* - `auto` — fold when header is narrow
|
|
53
|
+
*/
|
|
54
|
+
headerToolsMode?: HeaderToolsMode;
|
|
39
55
|
}
|
|
40
56
|
export declare const DEFAULT_CONFIG: FloorEditorConfig;
|
|
41
57
|
export declare function normalizeConfig(value: Partial<FloorEditorConfig> | null | undefined): FloorEditorConfig;
|
|
42
|
-
|
|
58
|
+
/**
|
|
59
|
+
* Accepts a full Project, `{ floors }`, a floors array, or a single Floor.
|
|
60
|
+
* Furniture (incl. cameras) is preserved as given.
|
|
61
|
+
*/
|
|
62
|
+
export declare function normalizeFloorData(data: Partial<Project> | Floor[] | Floor | null | undefined): Project;
|
|
43
63
|
/** Strip runtime-only fields before persisting or dispatching floor:save. */
|
|
44
64
|
export declare function exportProjectForSave(project: Project): Project;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { AssignedCamera } from '../../../lib/packageDefaults';
|
|
2
|
+
/** Call when host replaces floorData so load doesn't fight a stale sync set. */
|
|
3
|
+
export declare function resetAssignedCamerasSyncState(): void;
|
|
2
4
|
/**
|
|
3
5
|
* Sync host `assignedCameras` onto the active floor.
|
|
4
6
|
* - Adds missing serials at floor center (non-overlapping)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Point, Wall, Door, Window as Win, FurnitureItem, Stair, Column, Floor, Annotation, Room } from '../../../lib/models/types';
|
|
2
2
|
import { CanvasState } from '../../../lib/utils/canvasInteraction';
|
|
3
3
|
import { ProjectSettings } from '../../../lib/stores/settings';
|
|
4
|
+
import { HeatmapColorScale } from '../../../lib/utils/heatmapColorScale';
|
|
4
5
|
export declare function wallLength(w: Wall): number;
|
|
5
6
|
export declare function wallPointAt(w: Wall, t: number): Point;
|
|
6
7
|
export declare function wallTangentAt(w: Wall, t: number): Point;
|
|
@@ -49,4 +50,4 @@ export declare function drawMinimap(cs: CanvasState, minimapCanvas: HTMLCanvasEl
|
|
|
49
50
|
maxX: number;
|
|
50
51
|
maxY: number;
|
|
51
52
|
} | null): void;
|
|
52
|
-
export declare function drawFloorHeatmap(cs: CanvasState, floor: Floor, heatmapMatrix: number[][], detectedRooms: Room[]): void;
|
|
53
|
+
export declare function drawFloorHeatmap(cs: CanvasState, floor: Floor, heatmapMatrix: number[][], detectedRooms: Room[], colorScale?: HeatmapColorScale | null): void;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** Host-defined discrete heatmap band. */
|
|
2
|
+
export interface HeatmapColorLevel {
|
|
3
|
+
/** Inclusive lower bound for this band (see resolve rules). */
|
|
4
|
+
min: number;
|
|
5
|
+
/** Optional inclusive upper bound; if every level has max, use closed ranges. */
|
|
6
|
+
max?: number;
|
|
7
|
+
/** CSS color (hex / rgb / rgba). */
|
|
8
|
+
color: string;
|
|
9
|
+
/** Legend label — metadata for host; unused when drawing. */
|
|
10
|
+
label?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Floor heatmap color scale from host config.
|
|
14
|
+
* - `gradient`: value / max(matrix) → built-in continuous palette
|
|
15
|
+
* - `levels`: absolute thresholds + host colors (N bands, host-defined)
|
|
16
|
+
*/
|
|
17
|
+
export interface HeatmapColorScale {
|
|
18
|
+
mode: "gradient" | "levels";
|
|
19
|
+
levels?: HeatmapColorLevel[];
|
|
20
|
+
/** Cells with value <= hideBelow are not drawn. Default 0. */
|
|
21
|
+
hideBelow?: number;
|
|
22
|
+
}
|
|
23
|
+
export declare function normalizeHeatmapColorScale(value: unknown): HeatmapColorScale | undefined;
|
|
24
|
+
/** Fingerprint for heatmap offscreen cache invalidation. */
|
|
25
|
+
export declare function getHeatmapColorScaleKey(scale: HeatmapColorScale | null | undefined): string;
|
|
26
|
+
export declare function colorWithAlpha(color: string, alpha: number): string;
|
|
27
|
+
/**
|
|
28
|
+
* Resolve discrete band color for a cell value.
|
|
29
|
+
* @returns null → do not draw
|
|
30
|
+
*/
|
|
31
|
+
export declare function resolveHeatmapLevelColor(value: number, scale: HeatmapColorScale): {
|
|
32
|
+
color: string;
|
|
33
|
+
levelIndex: number;
|
|
34
|
+
levelCount: number;
|
|
35
|
+
} | null;
|
|
36
|
+
export declare function isLevelsColorScale(scale: HeatmapColorScale | null | undefined): scale is HeatmapColorScale & {
|
|
37
|
+
mode: "levels";
|
|
38
|
+
levels: HeatmapColorLevel[];
|
|
39
|
+
};
|