@procore/bim-webviewer-sdk 17.3.0-rc.2 → 17.3.0-rc.20

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 (45) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/Procore.Bim.Webviewer.d.ts +49 -10
  3. package/dist/Procore.Bim.Webviewer.js +1 -1
  4. package/dist/types/src/EscapeOperationsManager/EscapeOperationsManager.d.ts +21 -0
  5. package/dist/types/src/EscapeOperationsManager/__tests__/EscapeOperationsManager.test.d.ts +1 -0
  6. package/dist/types/src/EscapeOperationsManager/index.d.ts +1 -0
  7. package/dist/types/src/Webviewer.d.ts +1 -0
  8. package/dist/types/src/components/ContextMenuComponent/ContextMenuComponent.d.ts +9 -5
  9. package/dist/types/src/components/ContextMenuComponent/__tests__/ContextMenuComponent.test.d.ts +1 -0
  10. package/dist/types/src/components/ToolBarComponent/ToolBarComponent.d.ts +0 -1
  11. package/dist/types/src/controllers/RenderController.d.ts +1 -10
  12. package/dist/types/src/controllers/RenderControllerProxy.d.ts +5 -8
  13. package/dist/types/src/controllers/RenderControllerWorker.d.ts +1 -3
  14. package/dist/types/src/controllers/ShortestDistanceController.d.ts +0 -1
  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 +6 -0
  18. package/dist/types/src/measuring/FeatureTooltip/FeatureTooltip.d.ts +2 -0
  19. package/dist/types/src/measuring/MeasureToolUtils.d.ts +9 -8
  20. package/dist/types/src/measuring/MeasurementManager.d.ts +2 -0
  21. package/dist/types/src/measuring/MeasurementRenderer.d.ts +0 -1
  22. package/dist/types/src/measuring/PointToPointController.d.ts +7 -10
  23. package/dist/types/src/measuring/__tests__/PointToPointFixtures.d.ts +29 -50
  24. package/dist/types/src/navigation/DefaultControl.d.ts +1 -0
  25. package/dist/types/src/navigation/__tests__/DefaultControl.test.d.ts +1 -0
  26. package/dist/types/src/procoregl/MeshTopology/MeshTopology.d.ts +1 -0
  27. package/dist/types/src/procoregl/MeshTopology/__tests__/TopologyFixtures.d.ts +3 -0
  28. package/dist/types/src/pwfreader/PWF.d.ts +1 -2
  29. package/dist/types/src/pwfreader/PWFProxy.d.ts +1 -2
  30. package/dist/types/src/pwfreader/v1/PWFV1.d.ts +0 -2
  31. package/dist/types/src/pwfreader/v1/streaming/StreamedMeshServices.d.ts +2 -0
  32. package/dist/types/src/pwfreader/v2/PWFV2.d.ts +7 -2
  33. package/dist/types/src/pwfreader/v2/streaming/MeshData.d.ts +1 -0
  34. package/dist/types/src/pwfreader/v2/streaming/PartitionProxy.d.ts +7 -2
  35. package/dist/types/src/pwfreader/v2/streaming/StreamedMeshServices.d.ts +24 -3
  36. package/dist/types/src/types/setMeasurementSchema.d.ts +21 -0
  37. package/dist/types/src/utils/CameraHelper/CameraHelper.d.ts +8 -0
  38. package/dist/types/src/utils/CameraHelper/index.d.ts +1 -0
  39. package/dist/types/src/{pwfreader/v1/streaming → utils}/OPFSFile/MainThreadSyncAccessHandleFallback.d.ts +2 -1
  40. package/dist/types/src/{pwfreader/v1/streaming → utils}/OPFSFile/OPFSFile.d.ts +3 -2
  41. package/dist/types/src/utils/OPFSFile/__tests__/OPFSFile.test.d.ts +1 -0
  42. package/dist/types/src/utils/OPFSFile/index.d.ts +1 -0
  43. package/package.json +1 -1
  44. package/dist/types/src/pwfreader/v1/streaming/OPFSFile/index.d.ts +0 -1
  45. /package/dist/types/src/{navigation/Orbit → utils}/log.d.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -9,11 +9,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  ### Added
11
11
 
12
+ - ([#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
13
  - ([#1389](https://github.com/procore/bim-webviewer/pull/1389)) [QA Ignore] Fetching the model by only using model revision id in SDK side.
13
14
 
15
+ ### Changed
16
+
17
+ - ([#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.
18
+ - ([#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.
19
+ - ([#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
20
+ - ([#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.
21
+ - ([#1452])(https://github.com/procore/bim-webviewer/pull/1452) [Internal][QA Ignore] Add support for writing mesh data to OPFS for PWFv2 partitioned models. Effectively just copying over the implementation from v1.
22
+
14
23
  ### Fixed
15
24
 
16
25
  - ([#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.
26
+ - ([#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.
27
+ - ([#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.
28
+ - ([#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.
29
+ - ([#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.
30
+ - ([#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.
31
+ - ([#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.
32
+ - ([#1447](https://github.com/procore/bim-webviewer/pull/1447)) [Internal][QA Ignore] Fix `OPFSFile` median stats
33
+
34
+ ## [17.2.1] 2025-01-15
35
+
36
+ - ([#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.
17
37
 
18
38
  ## [17.2.0] 2024-12-13
19
39
 
@@ -57,6 +77,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
57
77
  - ([#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.
58
78
  - ([#1419](https://github.com/procore/bim-webviewer/pull/1419)) Fixed erroneous test mock data that was causing the whole test suite to fail.
59
79
 
80
+ ## [16.5.1] 2025-01-15
81
+
82
+ - ([#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.
83
+
60
84
  ## [16.5.0] 2024-11-08
61
85
 
62
86
  ### Added
@@ -149,6 +173,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
149
173
 
150
174
  - [Breaking Change] Removed `enableObjectTreeSearch` feature flag as it is now always enabled and cannot be disabled.
151
175
 
176
+ ## [15.5.1] 2025-01-15
177
+
178
+ - ([#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.
179
+
152
180
  ## [15.5.0] - 2024-08-02
153
181
 
154
182
  ### Added
@@ -367,6 +367,7 @@ declare class MeshData {
367
367
  faces(): Uint16Array;
368
368
  uploadToGPU(geometryFactory: StreamedGeometryFactory): StreamedMeshGeometry;
369
369
  uploadToGPUPreFetching(geometryFactory: StreamedGeometryFactory): StreamedMeshGeometry;
370
+ getCompressedMeshData(): ArrayBuffer;
370
371
  getUncompressedMeshData(): ArrayBuffer;
371
372
  }
372
373
 
@@ -507,8 +508,6 @@ declare type MeshnodeObject_2 = {
507
508
  selected: boolean;
508
509
  };
509
510
 
510
- declare type MeshnodeObject_3 = MeshnodeObject | MeshnodeObject_2;
511
-
512
511
  declare class MeshnodeServices {
513
512
  private meshnodeCount;
514
513
  private meshnodes;
@@ -835,6 +834,22 @@ export declare type ObjectFilter = {
835
834
  filterValue: string;
836
835
  };
837
836
 
837
+ declare class OPFSFile {
838
+ private path;
839
+ private syncAccessHandle?;
840
+ private directoryHandle?;
841
+ private fileName?;
842
+ private static stats;
843
+ constructor(path: string);
844
+ open(): Promise<void>;
845
+ delete(): Promise<void>;
846
+ close(): void;
847
+ truncate(offset: number): void;
848
+ write(buffer: ArrayBuffer, byteOffset?: number): number | undefined;
849
+ read(byteOffset?: number, byteLength?: number): ArrayBuffer;
850
+ private updateReadStats;
851
+ }
852
+
838
853
  export declare type Options = FileExtractionModePwfV2OverrideOptions | FileExtractionModePwfV1OverrideOptions | FileExtractionModeOptions | ModelRevisionModePwfV2OverrideOptions | ModelRevisionModePwfV1OverrideOptions | ModelRevisionModeOptions | ResourceOptions;
839
854
 
840
855
  declare type Palette = {
@@ -864,6 +879,7 @@ declare class Partition_2 {
864
879
 
865
880
  declare class PartitionProxy {
866
881
  private pwfPartitionProxy;
882
+ private meshServices;
867
883
  static numberOfPartitions: number;
868
884
  static numberOfPartitionsLoaded: number;
869
885
  static currentNumberOfDownloading: number;
@@ -874,7 +890,10 @@ declare class PartitionProxy {
874
890
  private _byteLength?;
875
891
  private _compressedByteLength?;
876
892
  private stats;
877
- constructor(pwfPartitionProxy: PWFPartitionProxy);
893
+ constructor(params: {
894
+ pwfPartitionProxy: PWFPartitionProxy;
895
+ meshServices: StreamedMeshServices;
896
+ });
878
897
  meshCount(): number;
879
898
  incrementMeshCount(numMeshes: number): void;
880
899
  vertexCount(): number;
@@ -892,7 +911,7 @@ declare class PartitionProxy {
892
911
  compressed: number;
893
912
  size: number;
894
913
  };
895
- static processPartitionProxiesAB(partitionProxiesAB: ArrayBuffer, callback: (partitionProxy: PartitionProxy) => void): void;
914
+ static processPartitionProxiesAB(partitionProxiesAB: ArrayBuffer, meshServices: StreamedMeshServices, callback: (partitionProxy: PartitionProxy) => void): void;
896
915
  static getPartitionProxies(partitionProxiesAB: ArrayBuffer): PWFPartitionProxy[];
897
916
  getContentOfPartitionUrl(): string;
898
917
  }
@@ -1025,7 +1044,6 @@ declare interface PWF {
1025
1044
  hasNode(id: number): boolean;
1026
1045
  loadAllMeshGeometryToGPU(): BootstrapperResult;
1027
1046
  loadAllPartitionProxies(): void;
1028
- getMeshDataForPartitionedModel(meshnodeIndex: number): Promise<MeshnodeObject_3>;
1029
1047
  captureModelStats(): void;
1030
1048
  getModelAnalyticsData(): ModelAnalyticsData;
1031
1049
  get virtualMeshnodeIndexOffset(): number;
@@ -1249,7 +1267,6 @@ declare class PWFV1 implements PWF {
1249
1267
  numFirstObjects(): number;
1250
1268
  breadthFirstTraversalNodes(callback: (n: Node_3 | Meshnode_2) => void): BootstrapperResult;
1251
1269
  getNamedNode(nodeId: number): Node_3;
1252
- getMeshDataForPartitionedModel(meshnodeIndex: number): Promise<MeshnodeObject>;
1253
1270
  captureModelStats(): number;
1254
1271
  private captureStandardModelStats;
1255
1272
  private capturePartitionedModelStats;
@@ -1268,6 +1285,7 @@ export declare type PwfV1Bundle = {
1268
1285
  declare class PWFV2 implements PWF {
1269
1286
  private readonly downloadMetaData;
1270
1287
  resourceId: number;
1288
+ resource: ResourceDiscriminator;
1271
1289
  streaming: boolean;
1272
1290
  nodeAB?: ArrayBuffer;
1273
1291
  meshnodeAB?: ArrayBuffer;
@@ -1290,14 +1308,18 @@ declare class PWFV2 implements PWF {
1290
1308
  meshnodeOffPointer: number;
1291
1309
  bvhTree?: BVHTree;
1292
1310
  _virtualMeshnodeIndexOffset: number;
1311
+ private readonly featureFlags;
1293
1312
  loadPartitionPromises: Promise<void>[];
1294
1313
  currentIndex: number;
1295
1314
  partitionProxies: PartitionProxy[];
1296
1315
  partitionsCache: LRUCache<string, Partition>;
1316
+ private meshServicesOPFSInitialized;
1297
1317
  constructor(params: {
1298
1318
  downloadMetaData: DownloadMetaData;
1299
1319
  resourceId: number;
1320
+ resource: ResourceDiscriminator;
1300
1321
  manifest: Manifest;
1322
+ featureFlags: ValidatedFeatureFlags;
1301
1323
  });
1302
1324
  setStandardModelBuffers(nodeAB: ArrayBuffer, meshnodeAB: ArrayBuffer, meshAB: ArrayBuffer): void;
1303
1325
  setPartitionedModelBuffers(nodeAB: ArrayBuffer, meshnodeAB: ArrayBuffer, partitionProxiesAB: ArrayBuffer): void;
@@ -1340,7 +1362,6 @@ declare class PWFV2 implements PWF {
1340
1362
  numFirstObjects(): number;
1341
1363
  breadthFirstTraversalNodes(callback: (n: Node_4 | Meshnode_3) => void): BootstrapperResult;
1342
1364
  getNamedNode(nodeId: number): Node_4;
1343
- getMeshDataForPartitionedModel(meshnodeIndex: number): Promise<MeshnodeObject_2>;
1344
1365
  captureModelStats(): number;
1345
1366
  private captureStandardModelStats;
1346
1367
  private capturePartitionedModelStats;
@@ -1447,11 +1468,27 @@ declare class StreamedMeshnodeServices_2 extends MeshnodeServices_2 {
1447
1468
  }
1448
1469
 
1449
1470
  declare class StreamedMeshServices extends MeshServices {
1450
- constructor(pwf: PWFV2);
1451
- getMeshObject(meshOffset: number): MeshObject_2;
1471
+ private readonly featureFlags;
1472
+ private meshIndexToOPFSRecord;
1473
+ private opfsFile?;
1474
+ private opfsOffset;
1475
+ private resource;
1476
+ constructor(params: {
1477
+ pwf: PWFV2;
1478
+ featureFlags: ValidatedFeatureFlags;
1479
+ resource: ResourceDiscriminator;
1480
+ });
1481
+ initOPFS(): Promise<void>;
1482
+ private deleteOPFSFile;
1483
+ getOPFSFile(): OPFSFile | undefined;
1484
+ closeOPFS(): Promise<void>;
1485
+ writeMeshDataToOPFS(meshData: MeshData): Promise<void>;
1486
+ getMeshObject(meshIndex: number): MeshObject_2;
1452
1487
  loadPartitionContainingMeshnode(streamedMeshnode: StreamedMeshnode): Promise<void>;
1453
1488
  getMeshGeometryForOffsets(meshOffset: number, meshnodeOffset: number): StreamedMeshGeometry | undefined;
1454
- dispose(): void;
1489
+ meshFromOffset(meshIndex: number): Mesh;
1490
+ private getCompressedMeshDataFromOPFS;
1491
+ dispose(): Promise<void>;
1455
1492
  }
1456
1493
 
1457
1494
  declare class StreamedMeshServices_2 extends MeshServices_2 {
@@ -1467,6 +1504,7 @@ declare class StreamedMeshServices_2 extends MeshServices_2 {
1467
1504
  });
1468
1505
  initOPFS(): Promise<void>;
1469
1506
  private deleteOPFSFile;
1507
+ getOPFSFile(): OPFSFile | undefined;
1470
1508
  closeOPFS(): Promise<void>;
1471
1509
  writeMeshDataToOPFS(meshData: MeshData_2): Promise<void>;
1472
1510
  getMeshObject(meshIndex: number): MeshObject;
@@ -1611,6 +1649,7 @@ export declare class Webviewer {
1611
1649
  options: Options;
1612
1650
  private readonly measurementRenderer;
1613
1651
  private readonly measurementManager;
1652
+ private readonly escapeOperationsManager;
1614
1653
  static readonly tools: {
1615
1654
  readonly ALL: 0;
1616
1655
  readonly BOTTOMTOOL: 1;