@archilogic/floor-plan-sdk 5.1.16 → 5.2.0

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/README.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  The @archilogic/floor-plan-sdk package enables you to create and embed interactive, customizable floor plans in the browser
4
4
 
5
+ > **Note:** The SDK uses ES 2022 features and may require transpilation for older browser support.
6
+
7
+ Check the detailed [documentation](https://developers.archilogic.com/floor-plan-engine/guide).
8
+
5
9
  ## Install
6
10
 
7
11
  ```bash
@@ -34,5 +38,3 @@ import { FloorPlanEngine } from 'https://esm.sh/@archilogic/floor-plan-sdk'
34
38
  const { FloorPlanEngine } = FloorPlanSdk
35
39
  </script>
36
40
  ```
37
-
38
- Check the detailed [documentation](https://developers.archilogic.com/floor-plan-engine/guide).
package/dist/fpe.d.ts CHANGED
@@ -67,8 +67,65 @@ declare type BackgroundOptions = {
67
67
  showGrid?: boolean;
68
68
  };
69
69
 
70
+ declare interface BaseData {
71
+ id: string;
72
+ name: string;
73
+ type: string;
74
+ customId: string;
75
+ customAttributes: SpaceGraphCustomAttributeValue;
76
+ /** dimensions in meters */
77
+ dimensions: {
78
+ width: number;
79
+ length: number;
80
+ height: number;
81
+ };
82
+ /**
83
+ * axis alignend bounding box in root space
84
+ * @example
85
+ * {
86
+ * min: [0, 0, 0],
87
+ * max: [1, 2, 1]
88
+ * }
89
+ * */
90
+ boundingBox: BoundingBox3d;
91
+ /** contour of the object aligned bounding box in root space */
92
+ boundingBoxContour: Polygon_2;
93
+ labelPoint: Vector2_2;
94
+ contour: PolygonWithHoles_2;
95
+ }
96
+
97
+ declare interface BaseFilter {
98
+ id?: StringComparator;
99
+ type?: StringComparator;
100
+ name?: StringComparator | NullComparator;
101
+ customId?: StringComparator | NullComparator;
102
+ customAttributes?: Record<string, StringComparator | NumberComparator | BooleanComparator | NullComparator>;
103
+ dimensions?: {
104
+ width?: NumberComparator;
105
+ length?: NumberComparator;
106
+ height?: NumberComparator;
107
+ };
108
+ }
109
+
70
110
  declare type BaseLayers = 'base' | 'scene' | 'preview' | 'annotation' | 'helper';
71
111
 
112
+ declare interface BaseSelect {
113
+ id?: boolean;
114
+ type?: boolean;
115
+ name?: boolean;
116
+ customId?: boolean;
117
+ customAttributes?: boolean | Record<string, boolean>;
118
+ dimensions?: boolean | {
119
+ width?: boolean;
120
+ length?: boolean;
121
+ height?: boolean;
122
+ };
123
+ boundingBox?: boolean;
124
+ boundingBoxContour?: boolean;
125
+ labelPoint?: boolean;
126
+ contour?: boolean;
127
+ }
128
+
72
129
  declare interface BaseShape {
73
130
  type: string;
74
131
  style?: ShapeStyle;
@@ -79,6 +136,12 @@ export declare interface BezierCurve extends BaseShape {
79
136
  points: Polygon;
80
137
  }
81
138
 
139
+ declare type BooleanComparator = boolean | {
140
+ eq: boolean;
141
+ } | {
142
+ neq: boolean;
143
+ };
144
+
82
145
  export declare type BoundingBox2d = {
83
146
  min: Vector2;
84
147
  max: Vector2;
@@ -251,6 +314,11 @@ declare type CustomStairsParametersJson = Partial<CustomStairsParameters>;
251
314
 
252
315
  declare type CustomStairsType = 'custom';
253
316
 
317
+ declare type DefaultSelect = {
318
+ id: true;
319
+ type: true;
320
+ };
321
+
254
322
  declare type DimensionParameters = {
255
323
  /** @minimum 0.01 */
256
324
  length: number;
@@ -313,6 +381,54 @@ declare interface EdgeSplitReturnValue {
313
381
  element?: LayoutEdgeElement;
314
382
  }
315
383
 
384
+ export declare interface ElementData extends BaseData {
385
+ type: LayoutElementJson['type'];
386
+ isExternal: boolean;
387
+ parameters: LayoutElementJson['parameters'];
388
+ category: string;
389
+ subCategory: string;
390
+ product: ProductData;
391
+ /** local transform for nested elements like openings, windows */
392
+ localTransform: SimpleTransform3d;
393
+ /** transform in root space */
394
+ transform: SimpleTransform3d;
395
+ /** local object aligned bounding box */
396
+ localBoundingBox: BoundingBox3d;
397
+ elements: ElementData[];
398
+ parent: ElementData;
399
+ }
400
+
401
+ export declare interface ElementFilter extends BaseFilter {
402
+ product?: ProductFilter;
403
+ category?: StringComparator;
404
+ subCategory?: StringComparator;
405
+ /** point query */
406
+ at?: Vector2_2;
407
+ /** 2d bounding box intersection */
408
+ within?: {
409
+ min: Vector2_2;
410
+ max: Vector2_2;
411
+ };
412
+ isExternal?: BooleanComparator;
413
+ }
414
+
415
+ declare type ElementQuery = {
416
+ select?: ElementSelect;
417
+ where?: ElementFilter;
418
+ };
419
+
420
+ export declare interface ElementSelect extends BaseSelect {
421
+ product?: ProductSelect | boolean;
422
+ category?: boolean;
423
+ subCategory?: boolean;
424
+ isExternal?: boolean;
425
+ localBoundingBox?: boolean;
426
+ localTransform?: boolean;
427
+ transform?: boolean;
428
+ parent?: ElementSelect | boolean;
429
+ elements?: ElementQuery | boolean;
430
+ }
431
+
316
432
  declare interface ExportImage {
317
433
  /** output format: png, jpg */
318
434
  format?: 'png' | 'jpg';
@@ -355,9 +471,9 @@ declare class FloorPlanCore {
355
471
  computed: FpeComputed;
356
472
  loader: FpeLoader;
357
473
  layout: SpaceGraphLayout;
358
- spaceGraph: SpaceGraph;
474
+ /* Excluded from this release type: spaceGraph */
475
+ /* Excluded from this release type: building */
359
476
  isBrowser: boolean;
360
- utils: any;
361
477
  location: {
362
478
  latitude: number;
363
479
  longitude: number;
@@ -387,15 +503,37 @@ declare class FloorPlanCore {
387
503
  * @returns {Promise.<Boolean, Error>} returns promise which resolves when loading is done
388
504
  */
389
505
  loadFloorById(floorId: string, accessTokenOptions?: TokenOptions): Promise<boolean | Error>;
506
+ /**
507
+ * Load a layout with its unique identifier the layoutId
508
+ * @param {string} layoutId id of the floor to load
509
+ * @param {AccessToken} accessTokenOptions Space API v2 [publishable](../space-api/v2/introduction.md#publishable-access-token) or [temporary](../space-api/v2/introduction.md#temporary-access-token) access token
510
+ * @returns {Promise.<Boolean, Error>} returns promise which resolves when loading is done
511
+ */
512
+ loadLayoutById(layoutId: string, accessTokenOptions?: TokenOptions): Promise<boolean | Error>;
390
513
  /**
391
514
  * Change options after the floor plan engine instance has been created
392
515
  */
393
516
  set(args?: FpeConfig): void;
517
+ /* Excluded from this release type: updateThemeFilter */
394
518
  getBoundingBox(margin?: number): BoundingBox2d;
519
+ getElements<S extends ElementSelect = DefaultSelect>(args?: {
520
+ select?: S;
521
+ where?: ElementFilter;
522
+ }): QueryPick<ElementData, S>[];
523
+ getElementsById<S extends ElementSelect = DefaultSelect>(args: {
524
+ select?: S;
525
+ id: string;
526
+ }): QueryPick<ElementData, S>;
527
+ getSpaces<S extends SpaceSelect = DefaultSelect>(args?: {
528
+ select?: S;
529
+ where?: SpaceFilter;
530
+ }): QueryPick<SpaceData, S>[];
531
+ getSpacesById<S extends SpaceSelect = DefaultSelect>(args: {
532
+ select?: S;
533
+ id: string;
534
+ }): QueryPick<SpaceData, S>;
395
535
  /**
396
- * Get a list of spaces and assets for a specific plan position
397
- * @param {*} position - plan position
398
- * @returns {Object} - list of spaces and assets
536
+ * @deprecated getResourcesFromPosition is deprecated and will be removed in the next version. use `floorPlan.getElements({ where: { at: [1, 4 ]}})`
399
537
  */
400
538
  getResourcesFromPosition(position: Vector2): {
401
539
  spaces: LayoutSpace[];
@@ -415,13 +553,15 @@ export declare class FloorPlanEngine extends FloorPlanCore {
415
553
  fpeNode?: HTMLElement;
416
554
  view: WebGlView;
417
555
  interaction: FpeInteraction;
556
+ /** @deprecated the layout property is deprecated and will be removed in the next version. use `floorPlan.getElements()` or `floorPlan.getSpaces()` */
557
+ layout: SpaceGraphLayout;
418
558
  availableHelpers: {
419
559
  [name: string]: typeof Helper;
420
560
  };
421
561
  helper: {
422
562
  [name: string]: Helper;
423
563
  };
424
- preventUpdateOnSpaceGraphEvent: boolean;
564
+ /* Excluded from this release type: preventUpdateOnSpaceGraphEvent */
425
565
  constructor({ container, options }?: {
426
566
  container?: Element;
427
567
  options?: FpeConfig;
@@ -440,7 +580,7 @@ export declare class FloorPlanEngine extends FloorPlanCore {
440
580
  */
441
581
  off<EventType extends FpeEvent, Context>(event: EventType, handler?: FpeEventHandler<EventType>, ctx?: Context): this;
442
582
  emit<EventType extends FpeEvent>(event: EventType, ...args: FpeEventMap[EventType]): this;
443
- handleDrop(evt: DragEvent): void;
583
+ /* Excluded from this release type: handleDrop */
444
584
  /**
445
585
  * Change options after the floor plan engine instance has been created
446
586
  * @param args - Startup options
@@ -448,14 +588,12 @@ export declare class FloorPlanEngine extends FloorPlanCore {
448
588
  set(args: FpeConfig): void;
449
589
  drawNodePreview(id: string, layout: SpaceGraphLayout, layer: PlanLayer, style?: ShapeStyle): void;
450
590
  drawNodeUpdate(id: string, style?: 'selected' | ShapeStyle | false): void;
451
- drawResourceUpdate({ resourceId }: {
452
- resourceId: string;
453
- }): void;
454
- mountFloorPlan(root: Element): void;
455
- initDrawing(): void;
456
- initDrawingEvents(): void;
457
- freeDrawingEvents(): void;
458
- generateUi(): void;
591
+ /* Excluded from this release type: drawResourceUpdate */
592
+ /* Excluded from this release type: mountFloorPlan */
593
+ /* Excluded from this release type: initDrawing */
594
+ /* Excluded from this release type: initDrawingEvents */
595
+ /* Excluded from this release type: freeDrawingEvents */
596
+ /* Excluded from this release type: generateUi */
459
597
  /**
460
598
  * Get a bounding box containing the layout, with some padding
461
599
  * @param layoutBoundingBox - bounding box of the layout, in meters.
@@ -529,12 +667,6 @@ export declare class FloorPlanEngine extends FloorPlanCore {
529
667
  * get plan layer by name
530
668
  */
531
669
  getLayer(id: any): PlanLayer;
532
- /**
533
- * create plan graphic
534
- * @deprecated use floorPlan.addLayer(<name>)
535
- * @returns
536
- */
537
- addPlanGraphic(): PlanLayer;
538
670
  /**
539
671
  * Adds a helper and removes previous instances of it
540
672
  */
@@ -553,7 +685,7 @@ export declare class FloorPlanEngine extends FloorPlanCore {
553
685
  /**
554
686
  * This is the place to give the floor plan your own style
555
687
  */
556
- declare type FloorPlanTheme = {
688
+ export declare type FloorPlanTheme = {
557
689
  /** define the background */
558
690
  background?: BackgroundOptions;
559
691
  /** wall contours are merged to one continuous outline, needed if you want white walls */
@@ -561,43 +693,20 @@ declare type FloorPlanTheme = {
561
693
  /** render assets with textures rather than solid colors */
562
694
  showAssetTextures?: boolean;
563
695
  fontFamily?: string;
564
- elements?: {
565
- byId?: Record<string, ShapeStyle>;
566
- floorPlan?: {
567
- grayscale: boolean;
568
- };
569
- roomStamp?: {
570
- /** show the area information in room stamps */
571
- roomStampDisplay?: ('usage' | 'area' | 'customId' | 'name' | 'id' | ['customAttribute', string])[];
572
- /** text color for room stamps */
573
- text?: Rgb;
574
- /** whether the room stamp text should have an outline to assist with contrast issues */
575
- textOutline?: boolean;
576
- };
577
- 'element:asset'?: ShapeStyle;
578
- 'element:beam'?: ShapeStyle;
579
- 'element:boundaryWall'?: ShapeStyle;
580
- 'element:casework'?: ShapeStyle;
581
- 'element:ceiling'?: ShapeStyle;
582
- 'element:column'?: ShapeStyle;
583
- 'element:curtainWall'?: ShapeStyle;
584
- 'element:door'?: ShapeStyle;
585
- 'element:floor'?: ShapeStyle;
586
- 'element:generic'?: ShapeStyle;
587
- 'element:kitchen'?: ShapeStyle;
588
- 'element:opening'?: ShapeStyle;
589
- 'element:railing'?: ShapeStyle;
590
- 'element:ramp'?: ShapeStyle;
591
- 'element:roof'?: ShapeStyle;
592
- 'element:slab'?: ShapeStyle;
593
- 'element:spaceDivider'?: ShapeStyle;
594
- 'element:stairFlight'?: ShapeStyle;
595
- 'element:stairs'?: ShapeStyle;
596
- 'element:wall'?: ShapeStyle;
597
- 'element:window'?: ShapeStyle;
598
- 'layout:space'?: SpaceShapeStyle;
599
- 'spatialGraph:edge'?: ShapeStyle;
696
+ roomStamps?: {
697
+ /** show the area information in room stamps */
698
+ roomStampDisplay?: ('usage' | 'area' | 'customId' | 'name' | 'id' | ['customAttribute', string])[];
699
+ /** text color for room stamps */
700
+ text?: Rgb;
701
+ /** whether the room stamp text should have an outline to assist with contrast issues */
702
+ textOutline?: boolean;
703
+ /** if set room stamps have a fixed size - otherwise they adapt to the zoom level */
704
+ fontSize?: number;
600
705
  };
706
+ byId?: StyleByKey;
707
+ byFilter?: ThemeStyles['byFilter'];
708
+ /* Excluded from this release type: byResolvedFilter */
709
+ byType?: ThemeStyles['byType'];
601
710
  };
602
711
 
603
712
  declare type FpeComputed = {
@@ -615,6 +724,7 @@ export declare interface FpeConfig extends StartupOptions {
615
724
  showFloorPlan?: boolean;
616
725
  showSpaceDividers?: boolean;
617
726
  showCeilingLamps?: boolean;
727
+ loadFloorLevel?: string | null;
618
728
  svgViewBoxDim?: number;
619
729
  svgMode?: boolean;
620
730
  destroyOnDomRemove?: boolean;
@@ -2251,6 +2361,28 @@ declare type NodesByType<NodeMap extends NodeTypeMap = {}> = {
2251
2361
 
2252
2362
  declare type NodeTypeMap = Record<string, any>;
2253
2363
 
2364
+ declare type NullComparator = {
2365
+ null: boolean;
2366
+ };
2367
+
2368
+ declare type NumberComparator = number | {
2369
+ eq: number;
2370
+ } | {
2371
+ neq: number;
2372
+ } | {
2373
+ in: number[];
2374
+ } | {
2375
+ nin: number[];
2376
+ } | {
2377
+ gt: number;
2378
+ } | {
2379
+ gte: number;
2380
+ } | {
2381
+ lt: number;
2382
+ } | {
2383
+ lte: number;
2384
+ };
2385
+
2254
2386
  declare interface NumberList extends SpaceGraphTypedValueJson {
2255
2387
  type: 'number:list';
2256
2388
  list: number[];
@@ -2375,6 +2507,8 @@ declare class PlanLayer {
2375
2507
 
2376
2508
  export declare type Polygon = Vector2[];
2377
2509
 
2510
+ declare type Polygon_2 = Vector2_2[];
2511
+
2378
2512
  export declare interface PolygonCurve extends BaseShape {
2379
2513
  type: 'curve:polygon';
2380
2514
  points: Polygon;
@@ -2392,6 +2526,8 @@ declare const PolygonCurveTypeValue = "curve:polygon";
2392
2526
  /** outer ring counter clockwise, inner rings ( holes ) clockwise */
2393
2527
  export declare type PolygonWithHoles = Polygon[];
2394
2528
 
2529
+ declare type PolygonWithHoles_2 = Vector2_2[][];
2530
+
2395
2531
  export declare interface PolygonWithHolesCurve extends BaseShape {
2396
2532
  type: 'curve:polygonWithHoles';
2397
2533
  polygons: PolygonWithHoles;
@@ -2422,8 +2558,33 @@ declare const PolylineCurveTypeValue = "curve:polyline";
2422
2558
 
2423
2559
  declare type PositionEntry = Vector3 | Vector3List | Vector3Range;
2424
2560
 
2561
+ export declare type PreserveViewbox = 'left-top' | 'left-center' | 'left-bottom' | 'center-top' | 'center-center' | 'center-bottom' | 'right-top' | 'right-center' | 'right-bottom' | 'screen-space';
2562
+
2425
2563
  declare type ProductAttributes = SpaceGraphProduct['attributes'];
2426
2564
 
2565
+ declare interface ProductData extends BaseData {
2566
+ type: SpaceGraphProduct['type'];
2567
+ category: string;
2568
+ subCategory: string;
2569
+ seatCapacity: number;
2570
+ }
2571
+
2572
+ declare interface ProductFilter extends BaseFilter {
2573
+ category?: StringComparator;
2574
+ subCategory?: StringComparator;
2575
+ seatCapacity?: NumberComparator;
2576
+ }
2577
+
2578
+ declare interface ProductSelect extends BaseSelect {
2579
+ category?: boolean;
2580
+ subCategory?: boolean;
2581
+ seatCapacity?: boolean;
2582
+ }
2583
+
2584
+ export declare type QueryPick<T, S> = {
2585
+ [K in keyof S as S[K] extends false | undefined ? never : K]: K extends keyof T ? S[K] extends true ? T[K] : S[K] extends ElementQuery ? QueryPick<ElementData, S[K]['select'] extends undefined ? DefaultSelect : NonNullable<S[K]['select']>>[] : S[K] extends object ? T[K] extends any[] ? QueryPick<T[K][number], S[K]>[] : QueryPick<T[K], S[K]> : never : never;
2586
+ };
2587
+
2427
2588
  export declare interface RectangleCurve extends BaseShape {
2428
2589
  type: 'curve:rectangle';
2429
2590
  position: Vector2;
@@ -2512,6 +2673,36 @@ declare interface ShapeStyle {
2512
2673
  alignment?: 0 | 0.5 | 1;
2513
2674
  }
2514
2675
 
2676
+ declare type SimpleTransform3d = {
2677
+ position: Vector3;
2678
+ rotation: number;
2679
+ };
2680
+
2681
+ export declare interface SpaceData extends BaseData {
2682
+ type: LayoutSpaceJson['type'];
2683
+ isExternal: boolean;
2684
+ category: string;
2685
+ subCategory: string;
2686
+ seatCapacity: number;
2687
+ area: number;
2688
+ elements: ElementData[];
2689
+ }
2690
+
2691
+ export declare interface SpaceFilter extends BaseFilter {
2692
+ category?: StringComparator;
2693
+ subCategory?: StringComparator;
2694
+ seatCapacity?: NumberComparator;
2695
+ isExternal?: BooleanComparator;
2696
+ area?: NumberComparator;
2697
+ /** point query */
2698
+ at?: Vector2_2;
2699
+ /** 2d bounding box intersection */
2700
+ within?: {
2701
+ min: Vector2_2;
2702
+ max: Vector2_2;
2703
+ };
2704
+ }
2705
+
2515
2706
  declare class SpaceGraph {
2516
2707
  spatialStructure: SpaceGraphSpatialStructure;
2517
2708
  products: SpaceGraphProduct[];
@@ -2660,8 +2851,14 @@ declare class SpaceGraphBuilding extends SpaceGraphSpatialStructureBase {
2660
2851
  type: SpaceGraphBuildingType;
2661
2852
  location: SpaceGraphLocation;
2662
2853
  floors: SpaceGraphFloor[];
2854
+ /** multiple floors can be on the same level */
2855
+ floorsByLevel: Record<string, SpaceGraphFloor[]>;
2663
2856
  constructor(id: string);
2664
2857
  copyForClone(building: SpaceGraphBuilding): void;
2858
+ /**
2859
+ * returns levels sorted by the vertical position of the first floor with that level
2860
+ */
2861
+ getLevelOrder(): string[];
2665
2862
  insertFloor(floor: SpaceGraphFloor): void;
2666
2863
  removeFloor(floor: SpaceGraphFloor): void;
2667
2864
  createFloor(id: string): SpaceGraphFloor;
@@ -2759,6 +2956,7 @@ declare const SpaceGraphEmbeddedMaterialTypeValue = "material:embedded";
2759
2956
  declare interface SpaceGraphEventMap {
2760
2957
  'spatial-structure-create': [SpaceGraphSpatialStructure];
2761
2958
  'spatial-structure-delete': [SpaceGraphSpatialStructure];
2959
+ 'floor-transform-change': [SpaceGraphFloor];
2762
2960
  'product-create': [SpaceGraphProduct];
2763
2961
  'product-delete': [SpaceGraphProduct];
2764
2962
  'material-create': [SpaceGraphMaterial];
@@ -2805,9 +3003,13 @@ declare class SpaceGraphFloor extends SpaceGraphSpatialStructureBase {
2805
3003
  parent: SpaceGraphBuilding | null;
2806
3004
  position: Vector3;
2807
3005
  rotation: number;
3006
+ level: string | null;
2808
3007
  layouts: SpaceGraphLayout[];
2809
3008
  constructor(id: string);
2810
3009
  copyForClone(floor: SpaceGraphFloor): void;
3010
+ setPosition(position: Vector3): void;
3011
+ setRotation(rotation: number): void;
3012
+ setTransform(position: Vector3, rotation: number): void;
2811
3013
  insertLayout(layout: SpaceGraphLayout): void;
2812
3014
  removeLayout(layout: SpaceGraphLayout): void;
2813
3015
  createLayout(id: string): SpaceGraphLayout;
@@ -2822,6 +3024,7 @@ declare interface SpaceGraphFloorJson extends SpaceGraphSpatialStructureBaseJson
2822
3024
  type: SpaceGraphFloorType;
2823
3025
  position: Vector3;
2824
3026
  rotation: number;
3027
+ level?: string;
2825
3028
  layouts: SpaceGraphLayoutJson[];
2826
3029
  }
2827
3030
 
@@ -3009,7 +3212,6 @@ declare type SpaceGraphProductAttributesJson = {
3009
3212
  };
3010
3213
 
3011
3214
  declare class SpaceGraphProductBase extends SpaceGraphNodeWithCustomAttributesBase {
3012
- #private;
3013
3215
  type: SpaceGraphProductType;
3014
3216
  attributes: SpaceGraphProductAttributes;
3015
3217
  instances: Set<LayoutAsset>;
@@ -3140,13 +3342,13 @@ declare type SpaceLabelMapping = {
3140
3342
  [label: string]: string;
3141
3343
  };
3142
3344
 
3143
- declare interface SpaceShapeStyle extends ShapeStyle {
3144
- usage?: {
3145
- [key: string]: ShapeStyle;
3146
- };
3147
- program?: {
3148
- [key: string]: ShapeStyle;
3149
- };
3345
+ export declare interface SpaceSelect extends BaseSelect {
3346
+ category?: boolean;
3347
+ subCategory?: boolean;
3348
+ isExternal?: boolean;
3349
+ area?: boolean;
3350
+ seatCapacity?: boolean;
3351
+ elements?: ElementQuery | boolean;
3150
3352
  }
3151
3353
 
3152
3354
  declare class SpatialGraphEdge extends SpatialGraphNodeBase {
@@ -3298,13 +3500,21 @@ declare type SpiralStairsType = 'spiral';
3298
3500
  declare interface StartupOptions {
3299
3501
  /** do not render elements of given types (e.g. 'element:asset', 'element:door', …), or 'roomStamp' */
3300
3502
  hideElements?: HideableElement[];
3301
- preserveViewbox?: string;
3503
+ /**
3504
+ * Controls how the viewport adjusts when the canvas container is resized.
3505
+ *
3506
+ * Alignment pairs anchor the viewport to a fixed point within the canvas:
3507
+ * - `'center-center'` (default), `'left-top'`, `'right-top'`, `'left-bottom'`, `'right-bottom'`
3508
+ *
3509
+ * Screen-space mode keeps the floor plan at the same absolute screen position:
3510
+ * - `'screen-space'` – compensates for the canvas element moving on screen
3511
+ * (e.g. when a sidebar opens/closes) so the plan stays visually stationary.
3512
+ */
3513
+ preserveViewbox?: PreserveViewbox;
3302
3514
  /** option to disable panning and zooming */
3303
3515
  panZoom?: boolean;
3304
3516
  /** if set, panning and zooming is restricted to the scene boundingbox plus the margin */
3305
3517
  panZoomMargin?: number;
3306
- /** if set room stamps have a fixed size - otherwise they adapt to the zoom level */
3307
- roomStampSize?: number;
3308
3518
  /** toggle overlaying UI elements */
3309
3519
  ui?: UI;
3310
3520
  /** floor plan theming */
@@ -3334,6 +3544,27 @@ declare type StraightStairsParametersJson = Partial<StraightStairsParameters>;
3334
3544
 
3335
3545
  declare type StraightStairsType = 'straight' | 'straightLanding';
3336
3546
 
3547
+ declare type StringComparator = string | {
3548
+ eq: string;
3549
+ } | {
3550
+ neq: string;
3551
+ } | {
3552
+ in: string[];
3553
+ } | {
3554
+ nin: string[];
3555
+ } | {
3556
+ contains: string;
3557
+ };
3558
+
3559
+ declare type StyleByKey = Record<string, ShapeStyle>;
3560
+
3561
+ declare type StyledFilter = {
3562
+ where: ElementFilter | SpaceFilter;
3563
+ style: ShapeStyle;
3564
+ };
3565
+
3566
+ declare type StyleFilter = StyledFilter;
3567
+
3337
3568
  declare interface SurfaceMaterials {
3338
3569
  [surface: string]: SpaceGraphMaterial;
3339
3570
  }
@@ -3396,6 +3627,39 @@ declare enum TextureFilter {
3396
3627
  Grayscale = 2
3397
3628
  }
3398
3629
 
3630
+ declare type ThemeStyles = {
3631
+ byId?: StyleByKey;
3632
+ byType?: {
3633
+ 'element:asset'?: ShapeStyle;
3634
+ 'element:beam'?: ShapeStyle;
3635
+ 'element:boundaryWall'?: ShapeStyle;
3636
+ 'element:casework'?: ShapeStyle;
3637
+ 'element:ceiling'?: ShapeStyle;
3638
+ 'element:column'?: ShapeStyle;
3639
+ 'element:curtainWall'?: ShapeStyle;
3640
+ 'element:door'?: ShapeStyle;
3641
+ 'element:floor'?: ShapeStyle;
3642
+ 'element:generic'?: ShapeStyle;
3643
+ 'element:kitchen'?: ShapeStyle;
3644
+ 'element:opening'?: ShapeStyle;
3645
+ 'element:railing'?: ShapeStyle;
3646
+ 'element:ramp'?: ShapeStyle;
3647
+ 'element:roof'?: ShapeStyle;
3648
+ 'element:slab'?: ShapeStyle;
3649
+ 'element:spaceDivider'?: ShapeStyle;
3650
+ 'element:stairFlight'?: ShapeStyle;
3651
+ 'element:stairs'?: ShapeStyle;
3652
+ 'element:wall'?: ShapeStyle;
3653
+ 'element:window'?: ShapeStyle;
3654
+ 'layout:space'?: ShapeStyle;
3655
+ 'spatialGraph:edge'?: ShapeStyle;
3656
+ 'annotation:floorPlanImage'?: ShapeStyle & {
3657
+ grayscale?: boolean;
3658
+ };
3659
+ };
3660
+ byFilter?: StyleFilter[];
3661
+ };
3662
+
3399
3663
  declare class Ticker {
3400
3664
  methods: {
3401
3665
  [name: string]: {
@@ -3498,7 +3762,7 @@ export declare type Vector2 = [number, number];
3498
3762
 
3499
3763
  declare type Vector2_2 = [number, number];
3500
3764
 
3501
- declare type Vector3 = [number, number, number];
3765
+ export declare type Vector3 = [number, number, number];
3502
3766
 
3503
3767
  declare interface Vector3List extends SpaceGraphTypedValueJson {
3504
3768
  type: 'vector3:list';
@@ -3528,8 +3792,10 @@ declare class WebGlView extends TinyEmitter {
3528
3792
  viewportInFocus: boolean;
3529
3793
  wallNodesToUpdate: any[];
3530
3794
  wallNodeUpdateInProgress: boolean;
3795
+ /* Excluded from this release type: floorContainers */
3796
+ roomStampLayers: Map<string, PlanLayer>;
3531
3797
  parentEl: HTMLElement;
3532
- _settings: FpeConfig;
3798
+ /* Excluded from this release type: _settings */
3533
3799
  /* Excluded from this release type: gfxLayers */
3534
3800
  redrawScene: () => void;
3535
3801
  /* Excluded from this release type: gfxNodes */
@@ -3541,7 +3807,9 @@ declare class WebGlView extends TinyEmitter {
3541
3807
  /* Excluded from this release type: _zoomTarget */
3542
3808
  _oldTime: number;
3543
3809
  ticker?: Ticker;
3810
+ _lastCanvasRect?: DOMRect;
3544
3811
  _resizeObserver?: ResizeObserver;
3812
+ _resizeRafId: number | null;
3545
3813
  on: (event: ViewEvent, callback: Function, ctx?: any) => this;
3546
3814
  once: (event: ViewEvent, callback: Function, ctx?: any) => this;
3547
3815
  off: (event: ViewEvent, callback?: Function) => this;