@procore/bim-webviewer-sdk 14.1.0 → 15.0.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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,27 @@ 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
+ ## [15.0.0] - 2024-04-29
9
+
10
+ ### Added
11
+
12
+ - `model.getSnapshot` and `model.getSnapshotDataUrl` now take an optional `aspectRatio` parameter, e.g. `model.getSnapshot({ aspectRatio: { width: 640, height: 480 } })`
13
+ - When no `aspectRatio` parameter is present, it will return an image with the dimensions of the canvas
14
+ - When a `aspectRatio` parameter is present, it will return an image with the maximum dimensions that fit in the current canvas that match the aspect ratio. This may be smaller or larger than the values passed depending on the size of the canvas.
15
+ - Added a Beta pill in loading screen when model is a large partitioned model.
16
+
17
+ ### Changed
18
+
19
+ - [Breaking Change] `model.getSnapshot` now expects a params object instead of individual params. It only had one optional argument so there is just one change:
20
+ - `model.getSnapshot('#aabbcc')` must now be called as `model.getSnapshot({ color: '#aabbcc' })`
21
+
22
+ ### Fixed
23
+
24
+ - Fixes issues affecting the "Loading Screen" for Large Models:
25
+ - The progress bar was inaccurate when loading partitions files (first download only, w/ empty cache) - particularly on slow networks;
26
+ - The percentage left would indicate 100% just before the progress was reached the end;
27
+ - The "time left" estimates were completely wrong - indicating that there was less than 1 minute left for a solid 15 minutes for example.
28
+
8
29
  ## [14.1.0] - 2024-04-15
9
30
 
10
31
  ### Fixed
@@ -122,6 +122,8 @@ declare type CommonOptions = {
122
122
  bimFileId?: number;
123
123
  };
124
124
 
125
+ declare type CssColor = RGB | RGBA | HEX | string;
126
+
125
127
  declare type FeatureFlags = Partial<{
126
128
  enableObjectTreeSearch: boolean;
127
129
  }>;
@@ -175,6 +177,8 @@ declare type GeometryFile = {
175
177
  url: string;
176
178
  };
177
179
 
180
+ declare type HEX = `#${string}`;
181
+
178
182
  declare type MetricId = string;
179
183
 
180
184
  declare type Model = {
@@ -279,6 +283,10 @@ declare type PwfV2Bundle = {
279
283
  manifestUrl: GeometryFile['url'];
280
284
  };
281
285
 
286
+ declare type RGB = `rgb(${number}, ${number}, ${number})`;
287
+
288
+ declare type RGBA = `rgba(${number}, ${number}, ${number}, ${number})`;
289
+
282
290
  declare type SectionDataAutodeskFormat = {
283
291
  Type: 'ClipPlaneSet';
284
292
  Version: 1;
@@ -382,9 +390,19 @@ export declare class Webviewer {
382
390
  position: Vector3;
383
391
  direction: Vector3;
384
392
  }>;
385
- getSnapshot: (color: string) => Promise<void>;
386
- getSnapshotDataUrl: (params?: {
387
- color: unknown;
393
+ getSnapshot: (params: {
394
+ color?: CssColor;
395
+ aspectRatio?: {
396
+ width: number;
397
+ height: number;
398
+ };
399
+ }) => Promise<void>;
400
+ getSnapshotDataUrl: (params: {
401
+ color?: CssColor;
402
+ aspectRatio?: {
403
+ width: number;
404
+ height: number;
405
+ };
388
406
  }) => Promise<string>;
389
407
  setLookAt: (x: number, y: number, z: number) => Promise<{
390
408
  position: Vector3;