@smplrspace/smplr-loader 2.19.1-beta.9 → 2.20.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.
@@ -2,10 +2,16 @@ import { ArcRotateCamera } from '@babylonjs/core/Cameras/arcRotateCamera';
2
2
  import { CSSProperties } from 'react';
3
3
  import { Dispatch } from 'react';
4
4
  import { FC } from 'react';
5
+ import { IMaybe } from 'mobx-state-tree';
6
+ import { IModelType } from 'mobx-state-tree';
7
+ import { IOptionalIType } from 'mobx-state-tree';
8
+ import { ISimpleType } from 'mobx-state-tree';
9
+ import { _NotCustomized } from 'mobx-state-tree';
5
10
  import { Reducer } from 'react';
6
11
  import { ReducerAction } from 'react';
7
12
  import { RefObject } from 'react';
8
13
  import { Scene } from '@babylonjs/core/scene';
14
+ import { SnapshotOut } from 'mobx-state-tree';
9
15
  import { UniversalCamera } from '@babylonjs/core/Cameras/universalCamera';
10
16
  import { VRDeviceOrientationFreeCamera } from '@babylonjs/core/Cameras/VR/vrDeviceOrientationFreeCamera';
11
17
 
@@ -405,15 +411,19 @@ declare type OnPickFn = (args: { coordinates: SmplrCoord3d; furnitureId?: string
405
411
  declare interface Opening {
406
412
  id: string;
407
413
  name: string;
414
+ type: OpeningType;
408
415
  dimensions: {
409
416
  width: number;
410
417
  height: number;
411
418
  baseHeight: number;
412
419
  };
413
- options: object;
420
+ options: SOWallOpeningOptions;
414
421
  coordinates: SmplrCoord3d[];
422
+ wallId: string;
415
423
  }
416
424
 
425
+ declare type OpeningType = 'door' | 'window';
426
+
417
427
  declare interface OrbitCamera extends ArcRotateCamera {
418
428
  smplrData: {
419
429
  persisted: boolean;
@@ -469,7 +479,7 @@ declare type PointDataLayer<D extends UnknownData = NoData> = BaseDataLayer<Poin
469
479
  declare type PointShapeOptions<D> = SphereOptions<D> | CubeOptions<D>;
470
480
 
471
481
  declare type PolygonData = BaseData & {
472
- coordinates: SmplrCoord2d[];
482
+ coordinates: SmplrCoord2d[] | SmplrCoord2d[][];
473
483
  };
474
484
 
475
485
  declare interface PolygonDataLayer<D extends UnknownData = NoData> extends BaseDataLayer<PolygonData, D> {
@@ -536,10 +546,10 @@ export declare class QueryClient {
536
546
  status: string;
537
547
  name: string;
538
548
  id: string;
549
+ definition?: {} | null | undefined;
539
550
  assetmap?: {} | null | undefined;
540
551
  created_at: string;
541
552
  modified_at: string;
542
- definition?: {} | null | undefined;
543
553
  embed_image?: string | null | undefined;
544
554
  short_code?: string | null | undefined;
545
555
  public_link_enabled: boolean;
@@ -548,10 +558,10 @@ export declare class QueryClient {
548
558
  status: string;
549
559
  name: string;
550
560
  id: string;
561
+ definition?: {} | null | undefined;
551
562
  assetmap?: {} | null | undefined;
552
563
  created_at: string;
553
564
  modified_at: string;
554
- definition?: {} | null | undefined;
555
565
  embed_image?: string | null | undefined;
556
566
  short_code?: string | null | undefined;
557
567
  public_link_enabled: boolean;
@@ -574,13 +584,15 @@ export declare class QueryClient {
574
584
  spaceId: string;
575
585
  furnitureId: string;
576
586
  }): Furniture | null;
577
- getFurnitureGroundFootprintById({ spaceId, furnitureId, }: {
587
+ getFurnitureGroundFootprintById({ spaceId, furnitureId, closed, }: {
578
588
  spaceId: string;
579
589
  furnitureId: string;
590
+ closed?: boolean;
580
591
  }): Promise<SmplrCoord2d[] | null>;
581
- getFurnitureGroundFootprintByIdFromCache({ spaceId, furnitureId, }: {
592
+ getFurnitureGroundFootprintByIdFromCache({ spaceId, furnitureId, closed, }: {
582
593
  spaceId: string;
583
594
  furnitureId: string;
595
+ closed?: boolean;
584
596
  }): SmplrCoord2d[] | null;
585
597
  getSpaceAssetmap(id: string): Promise<unknown>;
586
598
  getSpaceAssetmapFromCache(id: string): unknown;
@@ -588,12 +600,12 @@ export declare class QueryClient {
588
600
  line: SmplrCoord3d[];
589
601
  unit?: 'ft' | 'm' | 'cm' | 'mm';
590
602
  }): number;
591
- getPolygonArea({ polygon, unit }: {
592
- polygon: SmplrCoord2d[];
603
+ getPolygonArea({ polygon, unit, }: {
604
+ polygon: SmplrCoord2d[] | SmplrCoord2d[][];
593
605
  unit?: 'sqft' | 'sqm';
594
606
  }): number;
595
607
  getPolygonCenter({ polygon }: {
596
- polygon: SmplrCoord2d[];
608
+ polygon: SmplrCoord2d[] | SmplrCoord2d[][];
597
609
  }): SmplrCoord2d;
598
610
  getPointsBoundingBox({ points, padding }: {
599
611
  points: SmplrCoord2d[];
@@ -611,25 +623,25 @@ export declare class QueryClient {
611
623
  }): SmplrCoord2d[] | null;
612
624
  isPointInPolygon({ point, polygon }: {
613
625
  point: SmplrCoord2d;
614
- polygon: SmplrCoord2d[];
626
+ polygon: SmplrCoord2d[] | SmplrCoord2d[][];
615
627
  }): boolean;
616
628
  isFurnitureInPolygon({ spaceId, furnitureId, polygon, }: {
617
629
  spaceId: string;
618
630
  furnitureId: string;
619
- polygon: SmplrCoord2d[];
631
+ polygon: SmplrCoord2d[] | SmplrCoord2d[][];
620
632
  }): Promise<boolean | null>;
621
633
  isFurnitureInPolygonFromCache({ spaceId, furnitureId, polygon, }: {
622
634
  spaceId: string;
623
635
  furnitureId: string;
624
- polygon: SmplrCoord2d[];
636
+ polygon: SmplrCoord2d[] | SmplrCoord2d[][];
625
637
  }): boolean | null;
626
638
  getFurnitureInPolygon({ spaceId, polygon, }: {
627
639
  spaceId: string;
628
- polygon: SmplrCoord2d[];
640
+ polygon: SmplrCoord2d[] | SmplrCoord2d[][];
629
641
  }): Promise<Furniture[]>;
630
- getFurnitureInPolygonFromCache({ spaceId, polygon }: {
642
+ getFurnitureInPolygonFromCache({ spaceId, polygon, }: {
631
643
  spaceId: string;
632
- polygon: SmplrCoord2d[];
644
+ polygon: SmplrCoord2d[] | SmplrCoord2d[][];
633
645
  }): Furniture[];
634
646
  getPointsConcaveHull({ points, simplify, simplifyTolerance, }: {
635
647
  points: SmplrCoord2d[];
@@ -747,6 +759,9 @@ declare interface SmplrScene extends Scene {
747
759
 
748
760
  declare const smplrToCssColor: (c: string) => string;
749
761
 
762
+ declare interface SOWallOpeningOptions extends SnapshotOut<typeof WallOpeningOptions> {
763
+ }
764
+
750
765
  export declare class Space {
751
766
  private options;
752
767
  private viewerStarted;
@@ -835,7 +850,7 @@ declare interface Vector3Coord extends Vector2Coord {
835
850
  z: number;
836
851
  }
837
852
 
838
- export declare const version = "2.19.1-beta.9";
853
+ export declare const version = "2.20.0";
839
854
 
840
855
  declare interface ViewerOptions {
841
856
  mode?: CameraMode;
@@ -883,4 +898,36 @@ declare interface ViewerRendererHandle {
883
898
  clearAllEventListeners: EventEmitter['clearAllUserDefinedListeners']
884
899
  }
885
900
 
901
+ declare const WallOpeningOptions: IModelType< {
902
+ style: IOptionalIType<ISimpleType<string>, [undefined]>;
903
+ nbOfPanels: IOptionalIType<ISimpleType<number>, [undefined]>;
904
+ nbOfPanelsVertically: IOptionalIType<ISimpleType<number>, [undefined]>;
905
+ twoPanels: IOptionalIType<ISimpleType<boolean>, [undefined]>;
906
+ centerSplit: IOptionalIType<ISimpleType<boolean>, [undefined]>;
907
+ swapKnob: IOptionalIType<ISimpleType<boolean>, [undefined]>;
908
+ swapInOut: IOptionalIType<ISimpleType<boolean>, [undefined]>;
909
+ swapPanels: IOptionalIType<ISimpleType<boolean>, [undefined]>;
910
+ glass: IOptionalIType<ISimpleType<boolean>, [undefined]>;
911
+ openFrom: IOptionalIType<ISimpleType<string>, [undefined]>;
912
+ panelsOpened: IOptionalIType<ISimpleType<number>, [undefined]>;
913
+ openAngle: IOptionalIType<ISimpleType<number>, [undefined]>;
914
+ railingHeight: IMaybe<ISimpleType<number>>;
915
+ railingStyle: IOptionalIType<ISimpleType<string>, [undefined]>;
916
+ }, {
917
+ setStyle(style: string): void;
918
+ setNbOfPanels(nbOfPanels: number): void;
919
+ setNbOfPanelsVertically(nbOfPanelsVertically: number): void;
920
+ setCenterSplit(centerSplit: boolean): void;
921
+ setSwapKnob(swapKnob: boolean): void;
922
+ setSwapInOut(swapInOut: boolean): void;
923
+ setSwapPanels(swapPanels: boolean): void;
924
+ setTwoPanels(twoPanels: boolean): void;
925
+ setGlass(glass: boolean): void;
926
+ setOpenFrom(openFrom: string): void;
927
+ setPanelsOpened(panelsOpened: number): void;
928
+ setOpenAngle(openAngle: number): void;
929
+ setRailingHeight(railingHeight: number): void;
930
+ setRailingStyle(railingStyle: string): void;
931
+ }, _NotCustomized, _NotCustomized>;
932
+
886
933
  export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smplrspace/smplr-loader",
3
- "version": "2.19.1-beta.9",
3
+ "version": "2.20.0",
4
4
  "description": "NPM package to load a typed Smplr.js from CDN easily",
5
5
  "type": "module",
6
6
  "files": [