@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
package/CHANGELOG.md CHANGED
@@ -9,20 +9,72 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  ### Added
11
11
 
12
+ - ([#1492](https://github.com/procore/bim-webviewer/pull/1492)) Make a request for persistent storage (`navigator.storage.persist`) during load time.
13
+ - In Firefox, this will prompt the user to allow persistent storage, which, when granted, will increase the amount of disk space made available to the current origin. While this prompt is displayed, the loading screen (enabled with `tools: [Webviewer.tools.LOADING]`) will display a message directing the user to "Allow Persistent Storage".
14
+
15
+ ### Changed
16
+
17
+ - ([#1486](https://github.com/procore/bim-webviewer/pull/1486)) [Internal] Loading screen no longer listens to `launchedAnimationLoop` event as it did not seem necessary.
18
+
19
+ ### Fixed
20
+
21
+ - ([#1479](https://github.com/procore/bim-webviewer/pull/1479)) `model.addSectionPlane` and `model.setSectionsData` will now normalize plane directions.
22
+ - Prior to this change, passing non-normalized plane directions was basically bad data and would yield surprising results.
23
+ - ([#1477](https://github.com/procore/bim-webviewer/pull/1477)) Subsequent calls to Cache.removeModel will no longer result in an error
24
+ - ([#1475](https://github.com/procore/bim-webviewer/pull/1475)) Fixed an issue where the right click context menu would remain open after the measurement tool has been enabled.
25
+ - ([#1481](https://github.com/procore/bim-webviewer/pull/1481)) Fixed an erroneous interaction between any active measurement mode and the home viewpoint button. Now the measurement mode gets deactivated and fixed orbit, if active, will switch to default navigation when the home viewpoint button is clicked (also works for hotkeys).
26
+ - ([#1489](https://github.com/procore/bim-webviewer/pull/1489)) [Internal][QA Ignore] Fix cypress test for the events test on the measure button in the bottom toolbar.
27
+
28
+ ### Removed
29
+
30
+ - ([#1492](https://github.com/procore/bim-webviewer/pull/1492)) [Breaking Change] Removed `launchedAnimationLoop` event. You can instead listen to `renderReady` event.
31
+ - ([#1480](https://github.com/procore/bim-webviewer/pull/1480)) Removed the feature flag `enablePointToPoint` as Point to Point is now a standard feature.
32
+
33
+ ## [17.4.0] 2025-01-31
34
+
35
+ ### Added
36
+
37
+ - ([#1466](https://github.com/procore/bim-webviewer/pull/1466)) Point to point measurement will now snap to intersections between meshes.
38
+ - ([#1469](https://github.com/procore/bim-webviewer/pull/1469)) Models loaded with a `fileExtractionId` now apply the viewpoint associated with that file extraction (if there is one) when the model is loaded.
39
+
40
+ ### Changed
41
+
42
+ - ([#1460](https://github.com/procore/bim-webviewer/pull/1460)) Measurement Tool will no longer display any visuals prior to making a measurement while hovering over a section plane when the Section Box tool is enabled. This is to prevent confusion over the interactions between the two tools.
43
+ - ([#1467](https://github.com/procore/bim-webviewer/pull/1467)) [Internal][QA Ignore] `updateProcore` script now updates `document-viewer-ui-service`.
44
+
45
+ ### Fixed
46
+
47
+ - ([#1476](https://github.com/procore/bim-webviewer/pull/1476)) While measurement tool is enabled, quick switch to a different navigation mode using the keyboard/mouse shortcuts no longer disables the measurement tool.
48
+
49
+ ## [17.3.0] 2025-01-17
50
+
51
+ ### Added
52
+
53
+ - ([#1440](https://github.com/procore/bim-webviewer/pull/1440)) Added clipping of the point to point outline that appears when a user hovers over a mesh/surface, respecting the applied section box/plane.
12
54
  - ([#1389](https://github.com/procore/bim-webviewer/pull/1389)) [QA Ignore] Fetching the model by only using model revision id in SDK side.
13
55
 
14
56
  ### Changed
15
57
 
16
58
  - ([#1415](https://github.com/procore/bim-webviewer/pull/1415)) Changed the priority of the escape key operations to place resetting the measurement below closing the floor plan modal, but above closing any open windows.
17
59
  - ([#1416](https://github.com/procore/bim-webviewer/pull/1416)) When the Measurement Tool is enabled, the context menu for mouse right click button will no longer display.
18
- - ([#1442](https://github.com/procore/bim-webviewer/pull/1442)) [Internal] Refactor Shortest Distance Measurement to get mesh data in the same code path for both standard and partitioned models. For partitioned models this means it no longer fetches the partition from cache for the mesh data and instead reads it from OPFS
60
+ - ([#1444](https://github.com/procore/bim-webviewer/pull/1444)) While Measurement Tool is enabled, changing to a different navigation mode other than the default navigation mode will now disable the Measurement Tool. Additionally, when enabling the Measurement Tool, the default navigation mode will be set regardless of the current navigation mode.
61
+ - ([#1446](https://github.com/procore/bim-webviewer/pull/1446)) Hotkey refactoring. Additionally, the SDK method `setMeasurement` can now be used even if the Measurement Tool is not added to the `options.tools` array when initializing the Web Viewer. This allows third party developers to enable the Measurement Tool after the Web Viewer has been initialized.
19
62
 
20
63
  ### Fixed
21
64
 
22
65
  - ([#1422](https://github.com/procore/bim-webviewer/pull/1422)) Fixed an issue where the crosshair cursor wouldn't appear when enabling the point-to-point measurement tool, requiring users to hover over a mesh and then move into empty space.
23
66
  - ([#1423](https://github.com/procore/bim-webviewer/pull/1423)) Fixed bug that caused the temporary distance label to reappear in the scene when zooming in even when it was hidden behind the camera.
24
- - ([#1414](https://github.com/procore/bim-webviewer/pull/1414)) [Internal][QA Ignore] Removes noisy console logs from the PointToPointController when a user of p2p hovers over non-manifold meshes.
25
67
  - ([#1445](https://github.com/procore/bim-webviewer/pull/1445)) Fixed UI bug in which the footer line of the Settings dialog was on top of the Measurement Units dropdown menu.
68
+ - ([#1448](https://github.com/procore/bim-webviewer/pull/1448)) Fixed an issue where the cursor was not updated to the default one if the section box was disabled while the resize cursor was applied.
69
+ - ([#1449](https://github.com/procore/bim-webviewer/pull/1449)) Fixed bug in which the point to point feature tooltip was not hiding when zooming in/out as it does when moving the mouse around. It now behaves exactly as it does when moving the mouse around.
70
+ - ([#1450](https://github.com/procore/bim-webviewer/pull/1450)) Fixes the issue with opening the same large model multiple times, on separate tabs of the same Safari browser instance.
71
+ - ([#1451](https://github.com/procore/bim-webviewer/pull/1451)) Fixed issue with SDK method `setMeasurement` not working as expected when disabling the measurement tool while the tool is enabled and the optional `measurementMode` parameter is set to a different mode than the current mode.
72
+ - ([#1462](https://github.com/procore/bim-webviewer/pull/1462)) Fixed bug that was causing the temporary distance label to flicker its visibility when zooming out past a certain limit. This limit makes sure to hide the label so it doesn't occlude the line.
73
+ - ([#1464](https://github.com/procore/bim-webviewer/pull/1464)) Fixed bug in which the fixed orbit stayed active after the point-to-point tool was toggled off.
74
+
75
+ ## [17.2.1] 2025-01-15
76
+
77
+ - ([#1453](https://github.com/procore/bim-webviewer/pull/1453)) Fix issue where models that have beyond a certain number of nodes in the object tree would fail to load in Chrome v132 (which released 2025-01-14). Chrome v131 did not seem to have this issue.
26
78
 
27
79
  ## [17.2.0] 2024-12-13
28
80
 
@@ -66,6 +118,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66
118
  - ([#1399](https://github.com/procore/bim-webviewer/pull/1399)) When zooming in and/or out while the point to point measurement tool is active, the mouse cursor and intersection snap results now automatically update and the temporary distance label stays in the midpoint of the measuring line.
67
119
  - ([#1419](https://github.com/procore/bim-webviewer/pull/1419)) Fixed erroneous test mock data that was causing the whole test suite to fail.
68
120
 
121
+ ## [16.5.1] 2025-01-15
122
+
123
+ - ([#1453](https://github.com/procore/bim-webviewer/pull/1453)) Fix issue where models that have beyond a certain number of nodes in the object tree would fail to load in Chrome v132 (which released 2025-01-14). Chrome v131 did not seem to have this issue.
124
+
69
125
  ## [16.5.0] 2024-11-08
70
126
 
71
127
  ### Added
@@ -158,6 +214,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
158
214
 
159
215
  - [Breaking Change] Removed `enableObjectTreeSearch` feature flag as it is now always enabled and cannot be disabled.
160
216
 
217
+ ## [15.5.1] 2025-01-15
218
+
219
+ - ([#1453](https://github.com/procore/bim-webviewer/pull/1453)) Fix issue where models that have beyond a certain number of nodes in the object tree would fail to load in Chrome v132 (which released 2025-01-14). Chrome v131 did not seem to have this issue.
220
+
161
221
  ## [15.5.0] - 2024-08-02
162
222
 
163
223
  ### Added
@@ -178,10 +178,6 @@ export declare namespace ErrorLogger {
178
178
  }
179
179
 
180
180
  export declare type FeatureFlags = {
181
- /**
182
- * @beta Enables the new measurement mode Point to Point, which allows users to measure the distance between two points in the model.
183
- */
184
- enablePointToPoint: boolean;
185
181
  /**
186
182
  * @beta Enables writing mesh data to OPFS for partitioned models, which allows users to use features that use mesh data, notably Point to Point.
187
183
  */
@@ -196,6 +192,7 @@ export declare type FileExtraction = {
196
192
  id: number;
197
193
  extraction_items: FileExtractionItem[];
198
194
  bim_file_upload: BimFileUpload;
195
+ viewpoint_id?: number | null;
199
196
  };
200
197
 
201
198
  export declare type FileExtractionItem = WebFormatExtractionItem | PropertiesExtractionItem;
@@ -367,6 +364,7 @@ declare class MeshData {
367
364
  faces(): Uint16Array;
368
365
  uploadToGPU(geometryFactory: StreamedGeometryFactory): StreamedMeshGeometry;
369
366
  uploadToGPUPreFetching(geometryFactory: StreamedGeometryFactory): StreamedMeshGeometry;
367
+ getCompressedMeshData(): ArrayBuffer;
370
368
  getUncompressedMeshData(): ArrayBuffer;
371
369
  }
372
370
 
@@ -833,6 +831,22 @@ export declare type ObjectFilter = {
833
831
  filterValue: string;
834
832
  };
835
833
 
834
+ declare class OPFSFile {
835
+ private path;
836
+ private syncAccessHandle?;
837
+ private directoryHandle?;
838
+ private fileName?;
839
+ private static stats;
840
+ constructor(path: string);
841
+ open(): Promise<void>;
842
+ delete(): Promise<void>;
843
+ close(): void;
844
+ truncate(offset: number): void;
845
+ write(buffer: ArrayBuffer, byteOffset?: number): number | undefined;
846
+ read(byteOffset?: number, byteLength?: number): ArrayBuffer;
847
+ private updateReadStats;
848
+ }
849
+
836
850
  export declare type Options = FileExtractionModePwfV2OverrideOptions | FileExtractionModePwfV1OverrideOptions | FileExtractionModeOptions | ModelRevisionModePwfV2OverrideOptions | ModelRevisionModePwfV1OverrideOptions | ModelRevisionModeOptions | ResourceOptions;
837
851
 
838
852
  declare type Palette = {
@@ -862,6 +876,7 @@ declare class Partition_2 {
862
876
 
863
877
  declare class PartitionProxy {
864
878
  private pwfPartitionProxy;
879
+ private meshServices;
865
880
  static numberOfPartitions: number;
866
881
  static numberOfPartitionsLoaded: number;
867
882
  static currentNumberOfDownloading: number;
@@ -872,7 +887,10 @@ declare class PartitionProxy {
872
887
  private _byteLength?;
873
888
  private _compressedByteLength?;
874
889
  private stats;
875
- constructor(pwfPartitionProxy: PWFPartitionProxy);
890
+ constructor(params: {
891
+ pwfPartitionProxy: PWFPartitionProxy;
892
+ meshServices: StreamedMeshServices;
893
+ });
876
894
  meshCount(): number;
877
895
  incrementMeshCount(numMeshes: number): void;
878
896
  vertexCount(): number;
@@ -890,7 +908,7 @@ declare class PartitionProxy {
890
908
  compressed: number;
891
909
  size: number;
892
910
  };
893
- static processPartitionProxiesAB(partitionProxiesAB: ArrayBuffer, callback: (partitionProxy: PartitionProxy) => void): void;
911
+ static processPartitionProxiesAB(partitionProxiesAB: ArrayBuffer, meshServices: StreamedMeshServices, callback: (partitionProxy: PartitionProxy) => void): void;
894
912
  static getPartitionProxies(partitionProxiesAB: ArrayBuffer): PWFPartitionProxy[];
895
913
  getContentOfPartitionUrl(): string;
896
914
  }
@@ -1264,6 +1282,7 @@ export declare type PwfV1Bundle = {
1264
1282
  declare class PWFV2 implements PWF {
1265
1283
  private readonly downloadMetaData;
1266
1284
  resourceId: number;
1285
+ resource: ResourceDiscriminator;
1267
1286
  streaming: boolean;
1268
1287
  nodeAB?: ArrayBuffer;
1269
1288
  meshnodeAB?: ArrayBuffer;
@@ -1286,14 +1305,18 @@ declare class PWFV2 implements PWF {
1286
1305
  meshnodeOffPointer: number;
1287
1306
  bvhTree?: BVHTree;
1288
1307
  _virtualMeshnodeIndexOffset: number;
1308
+ private readonly featureFlags;
1289
1309
  loadPartitionPromises: Promise<void>[];
1290
1310
  currentIndex: number;
1291
1311
  partitionProxies: PartitionProxy[];
1292
1312
  partitionsCache: LRUCache<string, Partition>;
1313
+ private meshServicesOPFSInitialized;
1293
1314
  constructor(params: {
1294
1315
  downloadMetaData: DownloadMetaData;
1295
1316
  resourceId: number;
1317
+ resource: ResourceDiscriminator;
1296
1318
  manifest: Manifest;
1319
+ featureFlags: ValidatedFeatureFlags;
1297
1320
  });
1298
1321
  setStandardModelBuffers(nodeAB: ArrayBuffer, meshnodeAB: ArrayBuffer, meshAB: ArrayBuffer): void;
1299
1322
  setPartitionedModelBuffers(nodeAB: ArrayBuffer, meshnodeAB: ArrayBuffer, partitionProxiesAB: ArrayBuffer): void;
@@ -1442,11 +1465,27 @@ declare class StreamedMeshnodeServices_2 extends MeshnodeServices_2 {
1442
1465
  }
1443
1466
 
1444
1467
  declare class StreamedMeshServices extends MeshServices {
1445
- constructor(pwf: PWFV2);
1446
- getMeshObject(meshOffset: number): MeshObject_2;
1468
+ private readonly featureFlags;
1469
+ private meshIndexToOPFSRecord;
1470
+ private opfsFile?;
1471
+ private opfsOffset;
1472
+ private resource;
1473
+ constructor(params: {
1474
+ pwf: PWFV2;
1475
+ featureFlags: ValidatedFeatureFlags;
1476
+ resource: ResourceDiscriminator;
1477
+ });
1478
+ initOPFS(): Promise<void>;
1479
+ private deleteOPFSFile;
1480
+ getOPFSFile(): OPFSFile | undefined;
1481
+ closeOPFS(): Promise<void>;
1482
+ writeMeshDataToOPFS(meshData: MeshData): Promise<void>;
1483
+ getMeshObject(meshIndex: number): MeshObject_2;
1447
1484
  loadPartitionContainingMeshnode(streamedMeshnode: StreamedMeshnode): Promise<void>;
1448
1485
  getMeshGeometryForOffsets(meshOffset: number, meshnodeOffset: number): StreamedMeshGeometry | undefined;
1449
- dispose(): void;
1486
+ meshFromOffset(meshIndex: number): Mesh;
1487
+ private getCompressedMeshDataFromOPFS;
1488
+ dispose(): Promise<void>;
1450
1489
  }
1451
1490
 
1452
1491
  declare class StreamedMeshServices_2 extends MeshServices_2 {
@@ -1462,6 +1501,7 @@ declare class StreamedMeshServices_2 extends MeshServices_2 {
1462
1501
  });
1463
1502
  initOPFS(): Promise<void>;
1464
1503
  private deleteOPFSFile;
1504
+ getOPFSFile(): OPFSFile | undefined;
1465
1505
  closeOPFS(): Promise<void>;
1466
1506
  writeMeshDataToOPFS(meshData: MeshData_2): Promise<void>;
1467
1507
  getMeshObject(meshIndex: number): MeshObject;