@procore/bim-webviewer-sdk 17.3.0-rc.9 → 17.4.0-BM-923-request-persistent-storage.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.
Files changed (51) hide show
  1. package/CHANGELOG.md +62 -2
  2. package/dist/Procore.Bim.Webviewer.d.ts +49 -9
  3. package/dist/Procore.Bim.Webviewer.js +1 -1
  4. package/dist/types/src/api/analytic_events/analyticKeys.d.ts +2 -0
  5. package/dist/types/src/api/analytic_events/payloadFactories.d.ts +3 -1
  6. package/dist/types/src/api/bim_viewpoints.d.ts +5 -0
  7. package/dist/types/src/api/types/FileExtraction.d.ts +1 -0
  8. package/dist/types/src/components/ContextMenuComponent/ContextMenuComponent.d.ts +1 -0
  9. package/dist/types/src/components/LoadingComponent/LoadingComponent.d.ts +8 -6
  10. package/dist/types/src/components/ShortestDistanceComponent.d.ts +1 -0
  11. package/dist/types/src/components/ToolBarComponent/ToolBarComponent.d.ts +0 -2
  12. package/dist/types/src/controllers/PubSubController.d.ts +2 -1
  13. package/dist/types/src/controllers/RenderController.d.ts +1 -0
  14. package/dist/types/src/controllers/RenderControllerProxy.d.ts +1 -5
  15. package/dist/types/src/{navigation → hotkeys}/Hotkeys.d.ts +8 -5
  16. package/dist/types/src/hotkeys/__tests__/Hotkeys.test.d.ts +1 -0
  17. package/dist/types/src/measuring/DistanceLabel.d.ts +1 -0
  18. package/dist/types/src/measuring/FeatureTooltip/FeatureTooltip.d.ts +4 -0
  19. package/dist/types/src/measuring/MeasureToolUtils.d.ts +11 -8
  20. package/dist/types/src/measuring/MeasurementInterface.d.ts +1 -0
  21. package/dist/types/src/measuring/MeasurementManager.d.ts +6 -0
  22. package/dist/types/src/measuring/PointToPointController.d.ts +7 -10
  23. package/dist/types/src/measuring/PointToPointManager.d.ts +5 -0
  24. package/dist/types/src/measuring/__tests__/PointToPointFixtures.d.ts +30 -50
  25. package/dist/types/src/measuring/__tests__/fixtures.d.ts +17 -0
  26. package/dist/types/src/navigation/DefaultControl.d.ts +1 -0
  27. package/dist/types/src/navigation/__tests__/DefaultControl.test.d.ts +1 -0
  28. package/dist/types/src/picking/PickingController.d.ts +9 -1
  29. package/dist/types/src/procoregl/MeshTopology/__tests__/TopologyFixtures.d.ts +4 -1
  30. package/dist/types/src/pwfreader/v1/streaming/StreamedMeshServices.d.ts +2 -0
  31. package/dist/types/src/pwfreader/v2/PWFV2.d.ts +7 -0
  32. package/dist/types/src/pwfreader/v2/streaming/MeshData.d.ts +1 -0
  33. package/dist/types/src/pwfreader/v2/streaming/PartitionProxy.d.ts +7 -2
  34. package/dist/types/src/pwfreader/v2/streaming/StreamedMeshServices.d.ts +24 -3
  35. package/dist/types/src/sectioning/__tests__/fixtures.d.ts +4 -0
  36. package/dist/types/src/types/WebviewerOptions.d.ts +0 -4
  37. package/dist/types/src/types/setMeasurementSchema.d.ts +21 -0
  38. package/dist/types/src/utils/ApiMetaData/ApiMetaData.d.ts +4 -0
  39. package/dist/types/src/utils/ApiMetaData/__tests__/mocks.d.ts +3 -2
  40. package/dist/types/src/utils/ApiMetaData/index.d.ts +1 -0
  41. package/dist/types/src/utils/Enums.d.ts +1 -0
  42. package/dist/types/src/{pwfreader/v1/streaming → utils}/OPFSFile/MainThreadSyncAccessHandleFallback.d.ts +2 -1
  43. package/dist/types/src/{pwfreader/v1/streaming → utils}/OPFSFile/OPFSFile.d.ts +3 -2
  44. package/dist/types/src/utils/OPFSFile/__tests__/OPFSFile.test.d.ts +1 -0
  45. package/dist/types/src/utils/OPFSFile/index.d.ts +1 -0
  46. package/dist/types/src/utils/requestPersistentStorage/__tests__/requestPersistentStorage.test.d.ts +1 -0
  47. package/dist/types/src/utils/requestPersistentStorage/index.d.ts +1 -0
  48. package/dist/types/src/utils/requestPersistentStorage/requestPersistentStorage.d.ts +1 -0
  49. package/package.json +1 -1
  50. package/dist/types/src/pwfreader/v1/streaming/OPFSFile/index.d.ts +0 -1
  51. /package/dist/types/src/{navigation/Orbit → utils}/log.d.ts +0 -0
@@ -3,10 +3,31 @@ import type { PWFV2 } from '../PWFV2';
3
3
  import { MeshServices } from '../standard';
4
4
  import type { StreamedMeshnode } from './StreamedMeshnode';
5
5
  import { MeshObject } from '../objects/MeshObject';
6
+ import { MeshData } from './MeshData';
7
+ import { Mesh } from '../standard/Mesh';
8
+ import { OPFSFile } from '../../../utils/OPFSFile';
9
+ import type { ValidatedFeatureFlags } from '../../../types/WebviewerOptions';
10
+ import type { ResourceDiscriminator } from '../../../Webviewer';
6
11
  export declare class StreamedMeshServices extends MeshServices {
7
- constructor(pwf: PWFV2);
8
- getMeshObject(meshOffset: number): MeshObject;
12
+ private readonly featureFlags;
13
+ private meshIndexToOPFSRecord;
14
+ private opfsFile?;
15
+ private opfsOffset;
16
+ private resource;
17
+ constructor(params: {
18
+ pwf: PWFV2;
19
+ featureFlags: ValidatedFeatureFlags;
20
+ resource: ResourceDiscriminator;
21
+ });
22
+ initOPFS(): Promise<void>;
23
+ private deleteOPFSFile;
24
+ getOPFSFile(): OPFSFile | undefined;
25
+ closeOPFS(): Promise<void>;
26
+ writeMeshDataToOPFS(meshData: MeshData): Promise<void>;
27
+ getMeshObject(meshIndex: number): MeshObject;
9
28
  loadPartitionContainingMeshnode(streamedMeshnode: StreamedMeshnode): Promise<void>;
10
29
  getMeshGeometryForOffsets(meshOffset: number, meshnodeOffset: number): StreamedMeshGeometry | undefined;
11
- dispose(): void;
30
+ meshFromOffset(meshIndex: number): Mesh;
31
+ private getCompressedMeshDataFromOPFS;
32
+ dispose(): Promise<void>;
12
33
  }
@@ -2,7 +2,11 @@ import type { SectionDataAutodeskFormat, SectionDataProcoreFormat } from '../Sec
2
2
  export declare const procoreFormatUnitless: SectionDataProcoreFormat;
3
3
  export declare const procoreFormatInInches: SectionDataProcoreFormat;
4
4
  export declare const procoreFormatSixPlanesToBox: SectionDataProcoreFormat;
5
+ export declare const procoreFormatNonNormalizedPlane: SectionDataProcoreFormat;
6
+ export declare const procoreFormatNormalizedPlane: SectionDataProcoreFormat;
5
7
  export declare const autodeskFormatClipPlaneUnitless: SectionDataAutodeskFormat;
6
8
  export declare const autodeskFormatClipPlaneInInches: SectionDataAutodeskFormat;
9
+ export declare const autodeskFormatNonNormalizedPlane: SectionDataAutodeskFormat;
10
+ export declare const autodeskFormatNormalizedPlane: SectionDataAutodeskFormat;
7
11
  export declare const autodeskFormatOrientedBoxUnitless: SectionDataAutodeskFormat;
8
12
  export declare const autodeskFormatOrientedBoxInInches: SectionDataAutodeskFormat;
@@ -4,10 +4,6 @@ import { Model } from '../api/types/Model';
4
4
  import { ModelRevision } from '../api/types/ModelRevision';
5
5
  import type { Tool } from '../components/Tool';
6
6
  export type FeatureFlags = {
7
- /**
8
- * @beta Enables the new measurement mode Point to Point, which allows users to measure the distance between two points in the model.
9
- */
10
- enablePointToPoint: boolean;
11
7
  /**
12
8
  * @beta Enables writing mesh data to OPFS for partitioned models, which allows users to use features that use mesh data, notably Point to Point.
13
9
  */
@@ -0,0 +1,21 @@
1
+ export declare const setMeasurementSchema: {
2
+ type: string;
3
+ properties: {
4
+ enable: {
5
+ type: string;
6
+ };
7
+ options: {
8
+ type: string;
9
+ properties: {
10
+ measurementMode: {
11
+ type: string;
12
+ enum: string[];
13
+ };
14
+ };
15
+ additionalProperties: boolean;
16
+ default: {};
17
+ };
18
+ };
19
+ required: string[];
20
+ additionalProperties: boolean;
21
+ };
@@ -2,6 +2,7 @@ import { FileExtraction, PropertiesFile, FileVersion, Attachment } from '../../a
2
2
  import { ModelRevision } from '../../api/types/ModelRevision';
3
3
  import * as FileExtractions from '../../api/bim_file_extractions';
4
4
  import * as BimModelRevisions from '../../api/bim_model_revisions';
5
+ import * as BimViewpoints from '../../api/bim_viewpoints';
5
6
  import { Options, GeometryBundle } from '../../types/WebviewerOptions';
6
7
  import { InternalViewpoint } from '../../viewpoint/types';
7
8
  import { Model } from '../../api/types/Model';
@@ -14,6 +15,7 @@ export type ResourceBundle = ({
14
15
  type Api = {
15
16
  getBimFileExtraction: typeof FileExtractions.GetBimFileExtraction;
16
17
  getBimModelRevision: typeof BimModelRevisions.GetBimModelRevision;
18
+ getBimViewpoint: typeof BimViewpoints.GetBimViewpoint;
17
19
  };
18
20
  type ApiOptions = Partial<Api>;
19
21
  export declare const API_MODE: {
@@ -40,8 +42,10 @@ export declare class ApiMetaData {
40
42
  get companyId(): Promise<number>;
41
43
  get baseUrl(): Promise<string>;
42
44
  get fileExtractionIds(): Promise<number[]>;
45
+ get fileExtraction(): Promise<FileExtraction>;
43
46
  get modelRevision(): Promise<ModelRevision>;
44
47
  get homeViewpoint(): Promise<InternalViewpoint | undefined>;
45
48
  private get homeViewpointInModelRevisionMode();
49
+ private get homeViewpointInFileExtractionMode();
46
50
  }
47
51
  export {};
@@ -1,7 +1,8 @@
1
1
  import type { FileExtractionModePwfV2OverrideOptions, FileExtractionModePwfV1OverrideOptions, FileExtractionModeOptions, ModelRevisionModePwfV2OverrideOptions, ModelRevisionModePwfV1OverrideOptions, ModelRevisionModeOptions, FileExtractionModePwfV1OverrideResource, FileExtractionModePwfV2OverrideResource, ModelRevisionModePwfV1OverrideResource, ModelRevisionModePwfV2OverrideResource, ModelRevisionModeResource, ResourceOptions } from '../../../types/WebviewerOptions';
2
2
  import { FileExtraction } from '../../../api/types/FileExtraction';
3
- import { ModelRevision, ModelRevisionViewpoint } from '../../../api/types/ModelRevision';
3
+ import { ModelRevision } from '../../../api/types/ModelRevision';
4
4
  import { InternalViewpoint } from '../../../viewpoint/types';
5
+ import type { Viewpoint } from '../../../api/types/Viewpoint';
5
6
  export declare const projectId = 4;
6
7
  export declare const companyId = 1;
7
8
  export declare const fileExtractionId = 1;
@@ -67,6 +68,6 @@ export declare const modelRevisionModePwfV2OverrideResourceOptions: ResourceOpti
67
68
  export declare const modelRevisionModeResource: ModelRevisionModeResource;
68
69
  export declare const modelRevisionModeResourceOptions: ResourceOptions;
69
70
  export declare const fileExtraction: FileExtraction;
70
- export declare const homeViewpoint: ModelRevisionViewpoint;
71
+ export declare const viewpoint: Viewpoint;
71
72
  export declare const modelRevision: ModelRevision;
72
73
  export declare const bimHomeViewpoint: InternalViewpoint;
@@ -1,6 +1,7 @@
1
1
  import { ApiMetaData as _ApiMetaData } from './ApiMetaData';
2
2
  import { Options } from '../../types/WebviewerOptions';
3
3
  export { API_MODE, ApiMode } from './ApiMetaData';
4
+ export { ApiMetaData as ApiMetaDataInstance } from './ApiMetaData';
4
5
  export declare namespace ApiMetaData {
5
6
  let store: _ApiMetaData;
6
7
  const init: (initOptions: Options) => void;
@@ -54,4 +54,5 @@ export declare const ToolOrigin: Readonly<{
54
54
  TOOLBAR: "toolbar";
55
55
  API: "api";
56
56
  COACHMARK: "coachmark";
57
+ MEASUREMENT: "measurement";
57
58
  }>;
@@ -3,6 +3,7 @@ export declare class MainThreadSyncAccessHandleFallback implements FileSystemSyn
3
3
  private buffer;
4
4
  private path;
5
5
  constructor(path: string);
6
+ static clearOpenHandles(): void;
6
7
  close(): void;
7
8
  read(buffer: ArrayBuffer, options: {
8
9
  at: number;
@@ -10,7 +11,7 @@ export declare class MainThreadSyncAccessHandleFallback implements FileSystemSyn
10
11
  write(buffer: ArrayBuffer, options: {
11
12
  at: number;
12
13
  }): number;
13
- truncate(size: number): void;
14
+ truncate(newSize: number): void;
14
15
  flush(): void;
15
16
  getSize(): number;
16
17
  }
@@ -2,6 +2,7 @@ export declare const getFileHandleFromPath: (path: string, options?: {
2
2
  create?: boolean;
3
3
  }) => Promise<FileSystemFileHandle>;
4
4
  export declare const clearOPFS: () => Promise<void>;
5
+ export declare function nextIndexAvailable(folder: string, baseFileName: string, fileExtension: string): Promise<number>;
5
6
  export declare class OPFSFile {
6
7
  private path;
7
8
  private syncAccessHandle?;
@@ -13,7 +14,7 @@ export declare class OPFSFile {
13
14
  delete(): Promise<void>;
14
15
  close(): void;
15
16
  truncate(offset: number): void;
16
- write(buffer: ArrayBuffer, offset: number): number | undefined;
17
- read(offset: number, byteLength: number): ArrayBuffer;
17
+ write(buffer: ArrayBuffer, byteOffset?: number): number | undefined;
18
+ read(byteOffset?: number, byteLength?: number): ArrayBuffer;
18
19
  private updateReadStats;
19
20
  }
@@ -0,0 +1 @@
1
+ export { OPFSFile, nextIndexAvailable, clearOPFS, getFileHandleFromPath, } from './OPFSFile';
@@ -0,0 +1 @@
1
+ export { requestPersistentStorage } from './requestPersistentStorage';
@@ -0,0 +1 @@
1
+ export declare function requestPersistentStorage(): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@procore/bim-webviewer-sdk",
3
- "version": "17.3.0-rc.9",
3
+ "version": "17.4.0-BM-923-request-persistent-storage.0",
4
4
  "description": "Procore BIM Webviewer SDK",
5
5
  "main": "dist/Procore.Bim.Webviewer.js",
6
6
  "types": "dist/Procore.Bim.Webviewer.d.ts",
@@ -1 +0,0 @@
1
- export { OPFSFile } from './OPFSFile';