@procore/bim-webviewer-sdk 17.1.0 → 17.2.0-BM-1195.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 (41) hide show
  1. package/CHANGELOG.md +35 -1
  2. package/dist/Procore.Bim.Webviewer.d.ts +49 -39
  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/api/types/FileExtraction.d.ts +2 -9
  9. package/dist/types/src/api/types/GeometryFileBundle.d.ts +10 -0
  10. package/dist/types/src/api/types/ModelRevision.d.ts +2 -0
  11. package/dist/types/src/components/ContextMenuComponent/ContextMenuComponent.d.ts +9 -5
  12. package/dist/types/src/components/ContextMenuComponent/__tests__/ContextMenuComponent.test.d.ts +1 -0
  13. package/dist/types/src/controllers/DomController/DomController.d.ts +2 -2
  14. package/dist/types/src/controllers/RenderController.d.ts +2 -10
  15. package/dist/types/src/controllers/RenderControllerProxy.d.ts +5 -5
  16. package/dist/types/src/controllers/RenderControllerWorker.d.ts +1 -3
  17. package/dist/types/src/controllers/ShortestDistanceController.d.ts +0 -1
  18. package/dist/types/src/measuring/DistanceLabel.d.ts +7 -0
  19. package/dist/types/src/measuring/MeasurementRenderer.d.ts +0 -1
  20. package/dist/types/src/measuring/PointToPointController.d.ts +4 -1
  21. package/dist/types/src/navigation/DefaultControl.d.ts +1 -0
  22. package/dist/types/src/navigation/__tests__/DefaultControl.test.d.ts +1 -0
  23. package/dist/types/src/procoregl/MeshTopology/MeshTopology.d.ts +1 -0
  24. package/dist/types/src/procoregl/MeshTopology/__tests__/TopologyFixtures.d.ts +1 -0
  25. package/dist/types/src/procoregl/Models/__tests__/Models.test.d.ts +2 -2
  26. package/dist/types/src/pwfreader/PWF.d.ts +2 -3
  27. package/dist/types/src/pwfreader/PWFProxy.d.ts +3 -2
  28. package/dist/types/src/pwfreader/__tests__/fixtures.d.ts +2 -2
  29. package/dist/types/src/pwfreader/v1/PWFV1.d.ts +3 -2
  30. package/dist/types/src/pwfreader/v1/streaming/OPFSFile/MainThreadSyncAccessHandleFallback.d.ts +4 -2
  31. package/dist/types/src/pwfreader/v1/streaming/OPFSFile/OPFSFile.d.ts +10 -2
  32. package/dist/types/src/pwfreader/v1/streaming/OPFSFile/__tests__/OPFSFile.test.d.ts +1 -0
  33. package/dist/types/src/pwfreader/v1/streaming/StreamedMeshServices.d.ts +5 -1
  34. package/dist/types/src/pwfreader/v2/PWFV2.d.ts +1 -3
  35. package/dist/types/src/sdk.d.ts +3 -2
  36. package/dist/types/src/types/WebviewerOptions.d.ts +31 -31
  37. package/dist/types/src/utils/ApiMetaData/ApiMetaData.d.ts +1 -0
  38. package/dist/types/src/utils/ApiMetaData/__tests__/mocks.d.ts +10 -7
  39. package/dist/types/src/utils/CameraHelper/CameraHelper.d.ts +8 -0
  40. package/dist/types/src/utils/CameraHelper/index.d.ts +1 -0
  41. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -5,11 +5,45 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
7
7
 
8
+ ## [Unreleased]
9
+
10
+ ### Added
11
+
12
+ - ([#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
+ ### Changed
15
+
16
+ - ([#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
+ - ([#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
19
+
20
+ ### Fixed
21
+
22
+ - ([#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
+ - ([#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
+ - ([#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.
26
+ - ([#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.
27
+ - ([#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.
28
+ - ([#1447](https://github.com/procore/bim-webviewer/pull/1447)) [Internal][QA Ignore] Fix `OPFSFile` median stats
29
+ - ([#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.
30
+
31
+ ## [17.2.0] 2024-12-13
32
+
33
+ ### Fixed
34
+
35
+ - ([#1417](https://github.com/procore/bim-webviewer/pull/1417)) The distance labels no longer impede the user's ability to zoom in and out and or rotate around the measurement midpoint.
36
+ - ([#1418](https://github.com/procore/bim-webviewer/pull/1418)) When `featureFlags.enableMeshDataOnOPFS` was enabled and a partitioned model was loaded, subsequent partitioned models in separate tabs would fail to load until the first one was closed. This has been fixed so that multiple partitioned models can be loaded in separate tabs.
37
+
38
+ ### Changed
39
+
40
+ - ([#1433](https://github.com/procore/bim-webviewer/pull/1433)) Large model loading screen message is changed
41
+
8
42
  ## [17.1.0] 2024-12-09
9
43
 
10
44
  ### Fixed
11
45
 
12
- - Hotfix global offset is not correct in floorplan componenet.
46
+ - Hotfix global offset is not correct in floorplan component.
13
47
 
14
48
  ## [17.0.0] 2024-12-03
15
49
 
@@ -188,6 +188,10 @@ export declare type FeatureFlags = {
188
188
  enableMeshDataOnOPFS: boolean;
189
189
  };
190
190
 
191
+ declare type File_2 = {
192
+ url: string;
193
+ };
194
+
191
195
  export declare type FileExtraction = {
192
196
  id: number;
193
197
  extraction_items: FileExtractionItem[];
@@ -200,17 +204,13 @@ export declare type FileExtractionModeOptions = CommonOptions & {
200
204
  fileExtractionId: FileExtraction['id'];
201
205
  };
202
206
 
203
- export declare type FileExtractionModePwfV1OverrideOptions = CommonOptions & PwfV1Bundle & {
204
- fileExtractionId: FileExtraction['id'];
205
- };
207
+ export declare type FileExtractionModePwfV1OverrideOptions = FileExtractionModeOptions & PwfV1Bundle;
206
208
 
207
209
  export declare type FileExtractionModePwfV1OverrideResource = PwfV1Bundle & {
208
210
  fileExtractionId: FileExtraction['id'];
209
211
  };
210
212
 
211
- export declare type FileExtractionModePwfV2OverrideOptions = CommonOptions & PwfV2Bundle & {
212
- fileExtractionId: FileExtraction['id'];
213
- };
213
+ export declare type FileExtractionModePwfV2OverrideOptions = FileExtractionModeOptions & PwfV2Bundle;
214
214
 
215
215
  export declare type FileExtractionModePwfV2OverrideResource = PwfV2Bundle & {
216
216
  fileExtractionId: FileExtraction['id'];
@@ -239,10 +239,10 @@ export declare type FilterField = (typeof FILTER_FIELD)[keyof typeof FILTER_FIEL
239
239
  * the valid configurations that we support.
240
240
  */
241
241
  export declare type GeometryBundle = {
242
- nodeUrl: GeometryFile['url'];
243
- meshnodeUrl: GeometryFile['url'];
244
- meshUrl?: GeometryFile['url'];
245
- manifestUrl?: GeometryFile['url'];
242
+ nodeUrl: string;
243
+ meshnodeUrl: string;
244
+ meshUrl?: string;
245
+ manifestUrl?: string;
246
246
  };
247
247
 
248
248
  declare class GeometryFactory {
@@ -264,8 +264,11 @@ declare class GeometryFactory {
264
264
  createMeshGeometry(_vertices: Float32Array, _faces: Uint16Array, _color: number, _opacity: number, _drawType: number): StreamedMeshGeometry;
265
265
  }
266
266
 
267
- export declare type GeometryFile = {
268
- url: string;
267
+ export declare type GeometryFileBundle = {
268
+ manifest_file?: File_2 | null;
269
+ mesh_file: File_2;
270
+ mesh_node_file: File_2;
271
+ node_file: File_2;
269
272
  };
270
273
 
271
274
  declare type GPUMeshData = {
@@ -504,8 +507,6 @@ declare type MeshnodeObject_2 = {
504
507
  selected: boolean;
505
508
  };
506
509
 
507
- declare type MeshnodeObject_3 = MeshnodeObject | MeshnodeObject_2;
508
-
509
510
  declare class MeshnodeServices {
510
511
  private meshnodeCount;
511
512
  private meshnodes;
@@ -618,24 +619,29 @@ export declare type ModelRevision = {
618
619
  id: number;
619
620
  revision: number;
620
621
  viewpoints: ModelRevisionViewpoint[];
622
+ geometry_file_bundle: GeometryFileBundle;
621
623
  };
622
624
 
623
- export declare type ModelRevisionModePwfV1Options = CommonOptions & PwfV1Bundle & {
625
+ export declare type ModelRevisionModeOptions = CommonOptions & {
624
626
  modelId: Model['id'];
625
627
  modelRevisionId: ModelRevision['id'];
626
628
  };
627
629
 
628
- export declare type ModelRevisionModePwfV1Resource = PwfV1Bundle & {
630
+ export declare type ModelRevisionModePwfV1OverrideOptions = ModelRevisionModeOptions & PwfV1Bundle;
631
+
632
+ export declare type ModelRevisionModePwfV1OverrideResource = PwfV1Bundle & {
629
633
  modelId: Model['id'];
630
634
  modelRevisionId: ModelRevision['id'];
631
635
  };
632
636
 
633
- export declare type ModelRevisionModePwfV2Options = CommonOptions & PwfV2Bundle & {
637
+ export declare type ModelRevisionModePwfV2OverrideOptions = ModelRevisionModeOptions & PwfV2Bundle;
638
+
639
+ export declare type ModelRevisionModePwfV2OverrideResource = PwfV2Bundle & {
634
640
  modelId: Model['id'];
635
641
  modelRevisionId: ModelRevision['id'];
636
642
  };
637
643
 
638
- export declare type ModelRevisionModePwfV2Resource = PwfV2Bundle & {
644
+ export declare type ModelRevisionModeResource = {
639
645
  modelId: Model['id'];
640
646
  modelRevisionId: ModelRevision['id'];
641
647
  };
@@ -827,7 +833,7 @@ export declare type ObjectFilter = {
827
833
  filterValue: string;
828
834
  };
829
835
 
830
- export declare type Options = FileExtractionModePwfV2OverrideOptions | FileExtractionModePwfV1OverrideOptions | FileExtractionModeOptions | ModelRevisionModePwfV2Options | ModelRevisionModePwfV1Options | ResourceOptions;
836
+ export declare type Options = FileExtractionModePwfV2OverrideOptions | FileExtractionModePwfV1OverrideOptions | FileExtractionModeOptions | ModelRevisionModePwfV2OverrideOptions | ModelRevisionModePwfV1OverrideOptions | ModelRevisionModeOptions | ResourceOptions;
831
837
 
832
838
  declare type Palette = {
833
839
  default?: Color;
@@ -985,7 +991,7 @@ declare interface PWF {
985
991
  parsePwfNodes(): BootstrapperResult;
986
992
  parsePwfMeshnodes(): BootstrapperResult;
987
993
  parsePwfMeshes(): void;
988
- initMeshServices(): void;
994
+ initMeshServices(): BootstrapperResult;
989
995
  initNodeServices(): void;
990
996
  initMeshnodeServices(): void;
991
997
  initNodeTree(): BootstrapperResult;
@@ -1017,7 +1023,6 @@ declare interface PWF {
1017
1023
  hasNode(id: number): boolean;
1018
1024
  loadAllMeshGeometryToGPU(): BootstrapperResult;
1019
1025
  loadAllPartitionProxies(): void;
1020
- getMeshDataForPartitionedModel(meshnodeIndex: number): Promise<MeshnodeObject_3>;
1021
1026
  captureModelStats(): void;
1022
1027
  getModelAnalyticsData(): ModelAnalyticsData;
1023
1028
  get virtualMeshnodeIndexOffset(): number;
@@ -1167,6 +1172,7 @@ declare interface PWFPartitionProxy_2 {
1167
1172
  declare class PWFV1 implements PWF {
1168
1173
  private readonly downloadMetaData;
1169
1174
  resourceId: number;
1175
+ resource: ResourceDiscriminator;
1170
1176
  streaming: boolean;
1171
1177
  nodeAB?: ArrayBuffer;
1172
1178
  meshnodeAB?: ArrayBuffer;
@@ -1196,6 +1202,7 @@ declare class PWFV1 implements PWF {
1196
1202
  constructor(params: {
1197
1203
  downloadMetaData: DownloadMetaData;
1198
1204
  resourceId: number;
1205
+ resource: ResourceDiscriminator;
1199
1206
  featureFlags: ValidatedFeatureFlags;
1200
1207
  });
1201
1208
  setStandardModelBuffers(nodeAB: ArrayBuffer, meshnodeAB: ArrayBuffer, meshAB: ArrayBuffer): void;
@@ -1239,7 +1246,6 @@ declare class PWFV1 implements PWF {
1239
1246
  numFirstObjects(): number;
1240
1247
  breadthFirstTraversalNodes(callback: (n: Node_3 | Meshnode_2) => void): BootstrapperResult;
1241
1248
  getNamedNode(nodeId: number): Node_3;
1242
- getMeshDataForPartitionedModel(meshnodeIndex: number): Promise<MeshnodeObject>;
1243
1249
  captureModelStats(): number;
1244
1250
  private captureStandardModelStats;
1245
1251
  private capturePartitionedModelStats;
@@ -1250,9 +1256,9 @@ declare class PWFV1 implements PWF {
1250
1256
  }
1251
1257
 
1252
1258
  export declare type PwfV1Bundle = {
1253
- nodeUrl: GeometryFile['url'];
1254
- meshnodeUrl: GeometryFile['url'];
1255
- meshUrl: GeometryFile['url'];
1259
+ nodeUrl: string;
1260
+ meshnodeUrl: string;
1261
+ meshUrl: string;
1256
1262
  };
1257
1263
 
1258
1264
  declare class PWFV2 implements PWF {
@@ -1296,7 +1302,7 @@ declare class PWFV2 implements PWF {
1296
1302
  parsePwfNodes(): BootstrapperResult;
1297
1303
  parsePwfMeshnodes(): BootstrapperResult;
1298
1304
  parsePwfMeshes(): void;
1299
- initMeshServices(): void;
1305
+ initMeshServices(): BootstrapperResult;
1300
1306
  initNodeServices(): void;
1301
1307
  initMeshnodeServices(): void;
1302
1308
  initNodeTree(): BootstrapperResult;
@@ -1330,7 +1336,6 @@ declare class PWFV2 implements PWF {
1330
1336
  numFirstObjects(): number;
1331
1337
  breadthFirstTraversalNodes(callback: (n: Node_4 | Meshnode_3) => void): BootstrapperResult;
1332
1338
  getNamedNode(nodeId: number): Node_4;
1333
- getMeshDataForPartitionedModel(meshnodeIndex: number): Promise<MeshnodeObject_2>;
1334
1339
  captureModelStats(): number;
1335
1340
  private captureStandardModelStats;
1336
1341
  private capturePartitionedModelStats;
@@ -1341,10 +1346,10 @@ declare class PWFV2 implements PWF {
1341
1346
  }
1342
1347
 
1343
1348
  export declare type PwfV2Bundle = {
1344
- nodeUrl: GeometryFile['url'];
1345
- meshnodeUrl: GeometryFile['url'];
1346
- meshUrl: GeometryFile['url'];
1347
- manifestUrl: GeometryFile['url'];
1349
+ nodeUrl: string;
1350
+ meshnodeUrl: string;
1351
+ meshUrl: string;
1352
+ manifestUrl: string;
1348
1353
  };
1349
1354
 
1350
1355
  declare type PWFVersion = `${number}.${number}`;
@@ -1356,7 +1361,13 @@ export declare const RENDER_MODE: {
1356
1361
 
1357
1362
  export declare type RenderMode = (typeof RENDER_MODE)[keyof typeof RENDER_MODE];
1358
1363
 
1359
- export declare type Resource = FileExtractionModePwfV1OverrideResource | FileExtractionModePwfV2OverrideResource | FileExtractionModeResource | ModelRevisionModePwfV1Resource | ModelRevisionModePwfV2Resource;
1364
+ export declare type Resource = FileExtractionModePwfV1OverrideResource | FileExtractionModePwfV2OverrideResource | FileExtractionModeResource | ModelRevisionModePwfV1OverrideResource | ModelRevisionModePwfV2OverrideResource | ModelRevisionModeResource;
1365
+
1366
+ declare type ResourceDiscriminator = {
1367
+ fileExtractionId: number;
1368
+ } | {
1369
+ modelRevisionId: number;
1370
+ };
1360
1371
 
1361
1372
  export declare type ResourceOptions = CommonOptions & {
1362
1373
  resources: Resource[];
@@ -1443,11 +1454,14 @@ declare class StreamedMeshServices_2 extends MeshServices_2 {
1443
1454
  private meshIndexToOPFSRecord;
1444
1455
  private opfsFile?;
1445
1456
  private opfsOffset;
1457
+ private resource;
1446
1458
  constructor(params: {
1447
1459
  pwf: PWFV1;
1448
1460
  featureFlags: ValidatedFeatureFlags;
1461
+ resource: ResourceDiscriminator;
1449
1462
  });
1450
1463
  initOPFS(): Promise<void>;
1464
+ private deleteOPFSFile;
1451
1465
  closeOPFS(): Promise<void>;
1452
1466
  writeMeshDataToOPFS(meshData: MeshData_2): Promise<void>;
1453
1467
  getMeshObject(meshIndex: number): MeshObject;
@@ -1455,7 +1469,7 @@ declare class StreamedMeshServices_2 extends MeshServices_2 {
1455
1469
  getMeshGeometryForOffsets(meshOffset: number, meshnodeOffset: number): StreamedMeshGeometry | undefined;
1456
1470
  meshFromOffset(meshIndex: number): Mesh_2;
1457
1471
  private getCompressedMeshDataFromOPFS;
1458
- dispose(): void;
1472
+ dispose(): Promise<void>;
1459
1473
  }
1460
1474
 
1461
1475
  export declare class TestRoutineRecorder {
@@ -1584,12 +1598,7 @@ export declare type Visibility = {
1584
1598
  export declare type WebFormatExtractionItem = {
1585
1599
  item_type: 'WebFormat';
1586
1600
  artifact: {
1587
- web_format: {
1588
- node_file: GeometryFile;
1589
- mesh_node_file: GeometryFile;
1590
- mesh_file: GeometryFile;
1591
- manifest_file?: GeometryFile;
1592
- };
1601
+ web_format: GeometryFileBundle;
1593
1602
  };
1594
1603
  };
1595
1604
 
@@ -1597,6 +1606,7 @@ export declare class Webviewer {
1597
1606
  options: Options;
1598
1607
  private readonly measurementRenderer;
1599
1608
  private readonly measurementManager;
1609
+ private readonly escapeOperationsManager;
1600
1610
  static readonly tools: {
1601
1611
  readonly ALL: 0;
1602
1612
  readonly BOTTOMTOOL: 1;