@procore/bim-webviewer-sdk 14.1.0 → 15.0.0-BIM-4050.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 (38) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/Procore.Bim.Webviewer.d.ts +67 -49
  3. package/dist/Procore.Bim.Webviewer.js +1 -1
  4. package/dist/types/src/Webviewer.d.ts +14 -3
  5. package/dist/types/src/api/HttpClient.d.ts +1 -0
  6. package/dist/types/src/api/analytic_events/analyticKeys.d.ts +6 -1
  7. package/dist/types/src/api/analytic_events/payloadFactories.d.ts +6 -1
  8. package/dist/types/src/components/LoadingComponent/LoadingComponent.d.ts +1 -0
  9. package/dist/types/src/components/Markup/SvgRenderer.d.ts +3 -3
  10. package/dist/types/src/components/RootComponent.d.ts +3 -3
  11. package/dist/types/src/components/ToolBarComponent/ToolBarComponent.d.ts +3 -3
  12. package/dist/types/src/components/{HomeViewpointManager/HomeViewpointManager.d.ts → ViewpointManager/ViewpointManager.d.ts} +2 -2
  13. package/dist/types/src/components/ViewpointManager/index.d.ts +1 -0
  14. package/dist/types/src/components/WindowModelObjectComponent/WindowModelObjectComponent.d.ts +1 -1
  15. package/dist/types/src/components/WindowSettingsComponent.d.ts +1 -1
  16. package/dist/types/src/components/WindowTreeViewComponent.d.ts +1 -1
  17. package/dist/types/src/components/WindowViewPropertiesComponent/WindowViewPropertiesComponent.d.ts +1 -1
  18. package/dist/types/src/controllers/Bootstrapper.d.ts +2 -3
  19. package/dist/types/src/controllers/{DomController.d.ts → DomController/DomController.d.ts} +4 -5
  20. package/dist/types/src/controllers/DomController/__tests__/DomController.test.d.ts +1 -0
  21. package/dist/types/src/controllers/DomController/__tests__/fitCanvasToSize.test.d.ts +1 -0
  22. package/dist/types/src/controllers/DomController/fitCanvasToSize.d.ts +4 -0
  23. package/dist/types/src/controllers/DomController/index.d.ts +1 -0
  24. package/dist/types/src/controllers/PubSubController.d.ts +1 -0
  25. package/dist/types/src/controllers/RenderController.d.ts +7 -6
  26. package/dist/types/src/controllers/RenderControllerProxy.d.ts +16 -3
  27. package/dist/types/src/controllers/RenderControllerWorker.d.ts +1 -1
  28. package/dist/types/src/pwfreader/PWF.d.ts +2 -0
  29. package/dist/types/src/pwfreader/streaming/PartitionProxy.d.ts +6 -1
  30. package/dist/types/src/sdk.d.ts +14 -1
  31. package/dist/types/src/sectioning/SectionController.d.ts +3 -3
  32. package/dist/types/src/types/WebviewerOptions.d.ts +4 -5
  33. package/dist/types/src/utils/ApiMetaData/index.d.ts +1 -0
  34. package/dist/types/src/utils/constants.d.ts +0 -1
  35. package/package.json +1 -1
  36. package/dist/types/src/components/HomeViewpointManager/index.d.ts +0 -1
  37. /package/dist/types/src/components/{HomeViewpointManager/__tests__/HomeViewpointManager.test.d.ts → ViewpointManager/__tests__/ViewpointManager.test.d.ts} +0 -0
  38. /package/dist/types/src/components/{HomeViewpointManager → ViewpointManager}/__tests__/fixtures.d.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -5,6 +5,43 @@ 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
+ - [Internal] Added properties to `download_completed` analytics event:
13
+ - `model_type` - standard or partitioned
14
+ - `model_cached` - whether or not the download completed via the browser cache
15
+ - `total_partitions_size` - the total size in bytes of all the prefetched partitions
16
+ - `total_partitions_size_compressed` - the total compressed size in bytes of all the prefetched partitions. If they are not compressed (which is currently the case) then it is the same as `total_partitions_size`.
17
+ - `num_partitions` - the number of partitions
18
+
19
+ ### Changed
20
+
21
+ - [Internal] Rename class, instances, and files `HomeViewpointManager` to `ViewpointManager`
22
+ - [Internal] Rename `ViewpointManager.activate` to `activateHomeViewpoint`
23
+
24
+ ## [15.0.0] - 2024-04-29
25
+
26
+ ### Added
27
+
28
+ - `model.getSnapshot` and `model.getSnapshotDataUrl` now take an optional `aspectRatio` parameter, e.g. `model.getSnapshot({ aspectRatio: { width: 640, height: 480 } })`
29
+ - When no `aspectRatio` parameter is present, it will return an image with the dimensions of the canvas
30
+ - 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.
31
+ - Added a Beta pill in loading screen when model is a large partitioned model.
32
+
33
+ ### Changed
34
+
35
+ - [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:
36
+ - `model.getSnapshot('#aabbcc')` must now be called as `model.getSnapshot({ color: '#aabbcc' })`
37
+
38
+ ### Fixed
39
+
40
+ - Fixes issues affecting the "Loading Screen" for Large Models:
41
+ - The progress bar was inaccurate when loading partitions files (first download only, w/ empty cache) - particularly on slow networks;
42
+ - The percentage left would indicate 100% just before the progress was reached the end;
43
+ - The "time left" estimates were completely wrong - indicating that there was less than 1 minute left for a solid 15 minutes for example.
44
+
8
45
  ## [14.1.0] - 2024-04-15
9
46
 
10
47
  ### Fixed
@@ -1,4 +1,4 @@
1
- declare type Attachment = {
1
+ export declare type Attachment = {
2
2
  id: number;
3
3
  content_type: string;
4
4
  name: string;
@@ -6,14 +6,14 @@ declare type Attachment = {
6
6
  url: string;
7
7
  };
8
8
 
9
- declare type AutodeskFormatClipBox = {
9
+ export declare type AutodeskFormatClipBox = {
10
10
  Type: 'OrientedBox3D';
11
11
  Version: 1;
12
12
  Box: [[number, number, number], [number, number, number]];
13
13
  Rotation: [number, number, number];
14
14
  };
15
15
 
16
- declare type AutodeskFormatClipPlane = {
16
+ export declare type AutodeskFormatClipPlane = {
17
17
  Type: 'ClipPlane';
18
18
  Version: 1;
19
19
  Normal: [number, number, number];
@@ -21,7 +21,7 @@ declare type AutodeskFormatClipPlane = {
21
21
  Enabled: boolean;
22
22
  };
23
23
 
24
- declare type BcfCameraPerspective = {
24
+ export declare type BcfCameraPerspective = {
25
25
  camera_view_point: {
26
26
  x: number;
27
27
  y: number;
@@ -53,22 +53,17 @@ export declare namespace Benchmark {
53
53
  const clear: () => void;
54
54
  }
55
55
 
56
- declare type BimFileUpload = {
56
+ export declare type BimFileUpload = {
57
57
  id: number;
58
58
  file_version: FileVersion;
59
59
  attachment: Attachment;
60
60
  };
61
61
 
62
- declare type BoundingBox = {
62
+ export declare type BoundingBox = {
63
63
  max: Vector3;
64
64
  min: Vector3;
65
65
  };
66
66
 
67
- declare type BoundingBox_2 = {
68
- min: number[];
69
- max: number[];
70
- };
71
-
72
67
  declare const Cache_2: {
73
68
  removeModel: (options: any) => Promise<boolean>;
74
69
  hasModel: (geometryBundle: GeometryBundle) => Promise<boolean>;
@@ -77,7 +72,7 @@ export { Cache_2 as Cache }
77
72
 
78
73
  declare type Camera = any;
79
74
 
80
- declare type CommonOptions = {
75
+ export declare type CommonOptions = {
81
76
  /**
82
77
  * Always required
83
78
  */
@@ -122,40 +117,42 @@ declare type CommonOptions = {
122
117
  bimFileId?: number;
123
118
  };
124
119
 
125
- declare type FeatureFlags = Partial<{
120
+ export declare type CssColor = RGB | RGBA | HEX | string;
121
+
122
+ export declare type FeatureFlags = Partial<{
126
123
  enableObjectTreeSearch: boolean;
127
124
  }>;
128
125
 
129
- declare type FileExtraction = {
126
+ export declare type FileExtraction = {
130
127
  id: number;
131
128
  extraction_items: FileExtractionItem[];
132
129
  bim_file_upload: BimFileUpload;
133
130
  };
134
131
 
135
- declare type FileExtractionItem = WebFormatExtractionItem | PropertiesExtractionItem;
132
+ export declare type FileExtractionItem = WebFormatExtractionItem | PropertiesExtractionItem;
136
133
 
137
- declare type FileExtractionModeOptions = CommonOptions & {
134
+ export declare type FileExtractionModeOptions = CommonOptions & {
138
135
  fileExtractionId: FileExtraction['id'];
139
136
  };
140
137
 
141
- declare type FileExtractionModePwfV1OverrideOptions = CommonOptions & PwfV1Bundle & {
138
+ export declare type FileExtractionModePwfV1OverrideOptions = CommonOptions & PwfV1Bundle & {
142
139
  fileExtractionId: FileExtraction['id'];
143
140
  };
144
141
 
145
- declare type FileExtractionModePwfV2OverrideOptions = CommonOptions & PwfV2Bundle & {
142
+ export declare type FileExtractionModePwfV2OverrideOptions = CommonOptions & PwfV2Bundle & {
146
143
  fileExtractionId: FileExtraction['id'];
147
144
  };
148
145
 
149
- declare type FileVersion = {
146
+ export declare type FileVersion = {
150
147
  id: number;
151
148
  file_id: number;
152
149
  };
153
150
 
154
- declare const FILTER_FIELD: {
151
+ export declare const FILTER_FIELD: {
155
152
  readonly NAME: "name";
156
153
  };
157
154
 
158
- declare type FilterField = (typeof FILTER_FIELD)[keyof typeof FILTER_FIELD];
155
+ export declare type FilterField = (typeof FILTER_FIELD)[keyof typeof FILTER_FIELD];
159
156
 
160
157
  /**
161
158
  * API Configurations
@@ -164,44 +161,46 @@ declare type FilterField = (typeof FILTER_FIELD)[keyof typeof FILTER_FIELD];
164
161
  * properties) in a variety of ways. These types attempt to accurately declare
165
162
  * the valid configurations that we support.
166
163
  */
167
- declare type GeometryBundle = {
164
+ export declare type GeometryBundle = {
168
165
  nodeUrl: GeometryFile['url'];
169
166
  meshnodeUrl: GeometryFile['url'];
170
167
  meshUrl?: GeometryFile['url'];
171
168
  manifestUrl?: GeometryFile['url'];
172
169
  };
173
170
 
174
- declare type GeometryFile = {
171
+ export declare type GeometryFile = {
175
172
  url: string;
176
173
  };
177
174
 
175
+ export declare type HEX = `#${string}`;
176
+
178
177
  declare type MetricId = string;
179
178
 
180
- declare type Model = {
179
+ export declare type Model = {
181
180
  id: number;
182
181
  };
183
182
 
184
- declare type ModelRevision = {
183
+ export declare type ModelRevision = {
185
184
  id: number;
186
185
  revision: number;
187
186
  viewpoints: ModelRevisionViewpoint[];
188
187
  };
189
188
 
190
- declare type ModelRevisionModePwfV1Options = CommonOptions & PwfV1Bundle & {
189
+ export declare type ModelRevisionModePwfV1Options = CommonOptions & PwfV1Bundle & {
191
190
  modelId: Model['id'];
192
191
  modelRevisionId: ModelRevision['id'];
193
192
  };
194
193
 
195
- declare type ModelRevisionModePwfV2Options = CommonOptions & PwfV2Bundle & {
194
+ export declare type ModelRevisionModePwfV2Options = CommonOptions & PwfV2Bundle & {
196
195
  modelId: Model['id'];
197
196
  modelRevisionId: ModelRevision['id'];
198
197
  };
199
198
 
200
- declare type ModelRevisionViewpoint = Viewpoint & {
199
+ export declare type ModelRevisionViewpoint = Viewpoint & {
201
200
  primary: boolean;
202
201
  };
203
202
 
204
- declare const NAV_MODE: {
203
+ export declare const NAV_MODE: {
205
204
  readonly DEFAULT: 0;
206
205
  readonly FLY: 1;
207
206
  readonly ORBIT: 2;
@@ -211,9 +210,14 @@ declare const NAV_MODE: {
211
210
  readonly SURVEY: 6;
212
211
  };
213
212
 
214
- declare type NavigationMode = (typeof NAV_MODE)[keyof typeof NAV_MODE];
213
+ export declare type NavigationMode = (typeof NAV_MODE)[keyof typeof NAV_MODE];
215
214
 
216
- declare type ObjectFilter = {
215
+ export declare type NodeBoundingBox = {
216
+ min: number[];
217
+ max: number[];
218
+ };
219
+
220
+ export declare type ObjectFilter = {
217
221
  filterField: FilterField;
218
222
  filterValue: string;
219
223
  };
@@ -233,31 +237,31 @@ declare type Point = {
233
237
  };
234
238
  };
235
239
 
236
- declare type ProcoreFormatClipPlane = {
240
+ export declare type ProcoreFormatClipPlane = {
237
241
  unit?: string;
238
242
  direction: Vector3;
239
243
  location: Vector3;
240
244
  };
241
245
 
242
- declare type Project = {
246
+ export declare type Project = {
243
247
  id: number;
244
248
  };
245
249
 
246
- declare type PropertiesExtractionItem = {
250
+ export declare type PropertiesExtractionItem = {
247
251
  item_type: 'Properties';
248
252
  artifact: {
249
253
  properties: PropertiesFile;
250
254
  };
251
255
  };
252
256
 
253
- declare type PropertiesFile = {
257
+ export declare type PropertiesFile = {
254
258
  id: number;
255
259
  url: string;
256
260
  };
257
261
 
258
- declare type PublicNode = {
262
+ export declare type PublicNode = {
259
263
  id: number;
260
- bbox: BoundingBox_2;
264
+ bbox: NodeBoundingBox;
261
265
  nodeType: number;
262
266
  hidden: boolean;
263
267
  selected: boolean;
@@ -266,20 +270,24 @@ declare type PublicNode = {
266
270
  children: number[];
267
271
  };
268
272
 
269
- declare type PwfV1Bundle = {
273
+ export declare type PwfV1Bundle = {
270
274
  nodeUrl: GeometryFile['url'];
271
275
  meshnodeUrl: GeometryFile['url'];
272
276
  meshUrl: GeometryFile['url'];
273
277
  };
274
278
 
275
- declare type PwfV2Bundle = {
279
+ export declare type PwfV2Bundle = {
276
280
  nodeUrl: GeometryFile['url'];
277
281
  meshnodeUrl: GeometryFile['url'];
278
282
  meshUrl: GeometryFile['url'];
279
283
  manifestUrl: GeometryFile['url'];
280
284
  };
281
285
 
282
- declare type SectionDataAutodeskFormat = {
286
+ export declare type RGB = `rgb(${number}, ${number}, ${number})`;
287
+
288
+ export declare type RGBA = `rgba(${number}, ${number}, ${number}, ${number})`;
289
+
290
+ export declare type SectionDataAutodeskFormat = {
283
291
  Type: 'ClipPlaneSet';
284
292
  Version: 1;
285
293
  Unit?: string;
@@ -289,7 +297,7 @@ declare type SectionDataAutodeskFormat = {
289
297
  Enabled: boolean;
290
298
  };
291
299
 
292
- declare type SectionDataProcoreFormat = ProcoreFormatClipPlane[];
300
+ export declare type SectionDataProcoreFormat = ProcoreFormatClipPlane[];
293
301
 
294
302
  export declare class TestRoutineRecorder {
295
303
  camera: Camera;
@@ -302,14 +310,14 @@ export declare class TestRoutineRecorder {
302
310
  print(): void;
303
311
  }
304
312
 
305
- declare type Tool = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
313
+ export declare type Tool = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
306
314
 
307
- declare type Vector2 = {
315
+ export declare type Vector2 = {
308
316
  x: number;
309
317
  y: number;
310
318
  };
311
319
 
312
- declare type Vector3 = {
320
+ export declare type Vector3 = {
313
321
  x: number;
314
322
  y: number;
315
323
  z: number;
@@ -317,13 +325,13 @@ declare type Vector3 = {
317
325
 
318
326
  export declare const version: string;
319
327
 
320
- declare type Viewpoint = {
328
+ export declare type Viewpoint = {
321
329
  camera_data: string;
322
330
  sections_data: string;
323
331
  redlines_data: string;
324
332
  };
325
333
 
326
- declare type WebFormatExtractionItem = {
334
+ export declare type WebFormatExtractionItem = {
327
335
  item_type: 'WebFormat';
328
336
  artifact: {
329
337
  web_format: {
@@ -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;