@procore/bim-webviewer-sdk 15.0.0 → 15.1.0-rc.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 (43) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/Procore.Bim.Webviewer.d.ts +70 -50
  3. package/dist/Procore.Bim.Webviewer.js +1 -1
  4. package/dist/types/src/Webviewer.d.ts +6 -1
  5. package/dist/types/src/api/HttpClient.d.ts +1 -0
  6. package/dist/types/src/api/analytic_events/analyticKeys.d.ts +7 -6
  7. package/dist/types/src/api/analytic_events/index.d.ts +1 -1
  8. package/dist/types/src/api/analytic_events/payloadFactories.d.ts +6 -1
  9. package/dist/types/src/api/types/Model.d.ts +8 -0
  10. package/dist/types/src/components/Markup/SvgRenderer.d.ts +3 -3
  11. package/dist/types/src/components/RootComponent.d.ts +3 -3
  12. package/dist/types/src/components/ToolBarComponent/ToolBarComponent.d.ts +4 -3
  13. package/dist/types/src/components/{HomeViewpointManager/HomeViewpointManager.d.ts → ViewpointManager/ViewpointManager.d.ts} +5 -3
  14. package/dist/types/src/components/ViewpointManager/index.d.ts +1 -0
  15. package/dist/types/src/components/WindowModelObjectComponent/WindowModelObjectComponent.d.ts +1 -1
  16. package/dist/types/src/components/WindowSettingsComponent.d.ts +1 -1
  17. package/dist/types/src/components/WindowTreeViewComponent.d.ts +1 -1
  18. package/dist/types/src/components/WindowViewPropertiesComponent/WindowViewPropertiesComponent.d.ts +1 -1
  19. package/dist/types/src/controllers/PubSubController.d.ts +1 -0
  20. package/dist/types/src/controllers/RenderController.d.ts +11 -8
  21. package/dist/types/src/controllers/RenderControllerProxy.d.ts +20 -5
  22. package/dist/types/src/controllers/RenderControllerWorker.d.ts +5 -3
  23. package/dist/types/src/procoregl/HiddenNodeServices/HiddenNodeServices.d.ts +6 -1
  24. package/dist/types/src/procoregl/HiddenNodeServices/__tests__/rangify.test.d.ts +1 -0
  25. package/dist/types/src/procoregl/HiddenNodeServices/rangify.d.ts +14 -0
  26. package/dist/types/src/procoregl/PartitionsRenderer.d.ts +2 -2
  27. package/dist/types/src/procoregl/PartitionsRendererImpl.d.ts +3 -2
  28. package/dist/types/src/procoregl/StandardRenderer.d.ts +2 -2
  29. package/dist/types/src/procoregl/StandardRendererImpl.d.ts +3 -2
  30. package/dist/types/src/procoregl/ViewerRenderer.d.ts +3 -2
  31. package/dist/types/src/pwfreader/PWF.d.ts +3 -0
  32. package/dist/types/src/pwfreader/shared/NodeServices.d.ts +2 -0
  33. package/dist/types/src/pwfreader/streaming/PartitionProxy.d.ts +6 -1
  34. package/dist/types/src/sdk.d.ts +15 -1
  35. package/dist/types/src/sectioning/SectionController.d.ts +3 -3
  36. package/dist/types/src/types/WebviewerOptions.d.ts +4 -5
  37. package/dist/types/src/utils/ApiMetaData/index.d.ts +1 -0
  38. package/dist/types/src/utils/Stack.d.ts +6 -4
  39. package/dist/types/src/utils/constants.d.ts +9 -4
  40. package/package.json +1 -1
  41. package/dist/types/src/components/HomeViewpointManager/index.d.ts +0 -1
  42. /package/dist/types/src/components/{HomeViewpointManager/__tests__/HomeViewpointManager.test.d.ts → ViewpointManager/__tests__/ViewpointManager.test.d.ts} +0 -0
  43. /package/dist/types/src/components/{HomeViewpointManager → ViewpointManager}/__tests__/fixtures.d.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -5,6 +5,16 @@ 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.1.0] - 2024-05-13
9
+
10
+ ## Added
11
+
12
+ - Add `model.getVisibility` and `model.setVisibility` methods.
13
+ - These methods interact with the visibility portion of the viewpoints schema defined by the `bim_viewpoints` endpoint (https://developers.procore.com/reference/rest/v1/bim-viewpoints?version=1.0)
14
+ - `Viewpoint`s now include `visibility`, but `model.get/setViewpoint` do not yet do anything with it. It will behave as if you had called `model.get/setVisibility` in a future release.
15
+ - Added `model.getRenderMode` and `model.setRenderMode` methods.
16
+ - Exposed more types used as params or return types for the SDK
17
+
8
18
  ## [15.0.0] - 2024-04-29
9
19
 
10
20
  ### Added
@@ -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,42 +117,42 @@ declare type CommonOptions = {
122
117
  bimFileId?: number;
123
118
  };
124
119
 
125
- declare type CssColor = RGB | RGBA | HEX | string;
120
+ export declare type CssColor = RGB | RGBA | HEX | string;
126
121
 
127
- declare type FeatureFlags = Partial<{
122
+ export declare type FeatureFlags = Partial<{
128
123
  enableObjectTreeSearch: boolean;
129
124
  }>;
130
125
 
131
- declare type FileExtraction = {
126
+ export declare type FileExtraction = {
132
127
  id: number;
133
128
  extraction_items: FileExtractionItem[];
134
129
  bim_file_upload: BimFileUpload;
135
130
  };
136
131
 
137
- declare type FileExtractionItem = WebFormatExtractionItem | PropertiesExtractionItem;
132
+ export declare type FileExtractionItem = WebFormatExtractionItem | PropertiesExtractionItem;
138
133
 
139
- declare type FileExtractionModeOptions = CommonOptions & {
134
+ export declare type FileExtractionModeOptions = CommonOptions & {
140
135
  fileExtractionId: FileExtraction['id'];
141
136
  };
142
137
 
143
- declare type FileExtractionModePwfV1OverrideOptions = CommonOptions & PwfV1Bundle & {
138
+ export declare type FileExtractionModePwfV1OverrideOptions = CommonOptions & PwfV1Bundle & {
144
139
  fileExtractionId: FileExtraction['id'];
145
140
  };
146
141
 
147
- declare type FileExtractionModePwfV2OverrideOptions = CommonOptions & PwfV2Bundle & {
142
+ export declare type FileExtractionModePwfV2OverrideOptions = CommonOptions & PwfV2Bundle & {
148
143
  fileExtractionId: FileExtraction['id'];
149
144
  };
150
145
 
151
- declare type FileVersion = {
146
+ export declare type FileVersion = {
152
147
  id: number;
153
148
  file_id: number;
154
149
  };
155
150
 
156
- declare const FILTER_FIELD: {
151
+ export declare const FILTER_FIELD: {
157
152
  readonly NAME: "name";
158
153
  };
159
154
 
160
- declare type FilterField = (typeof FILTER_FIELD)[keyof typeof FILTER_FIELD];
155
+ export declare type FilterField = (typeof FILTER_FIELD)[keyof typeof FILTER_FIELD];
161
156
 
162
157
  /**
163
158
  * API Configurations
@@ -166,46 +161,46 @@ declare type FilterField = (typeof FILTER_FIELD)[keyof typeof FILTER_FIELD];
166
161
  * properties) in a variety of ways. These types attempt to accurately declare
167
162
  * the valid configurations that we support.
168
163
  */
169
- declare type GeometryBundle = {
164
+ export declare type GeometryBundle = {
170
165
  nodeUrl: GeometryFile['url'];
171
166
  meshnodeUrl: GeometryFile['url'];
172
167
  meshUrl?: GeometryFile['url'];
173
168
  manifestUrl?: GeometryFile['url'];
174
169
  };
175
170
 
176
- declare type GeometryFile = {
171
+ export declare type GeometryFile = {
177
172
  url: string;
178
173
  };
179
174
 
180
- declare type HEX = `#${string}`;
175
+ export declare type HEX = `#${string}`;
181
176
 
182
177
  declare type MetricId = string;
183
178
 
184
- declare type Model = {
179
+ export declare type Model = {
185
180
  id: number;
186
181
  };
187
182
 
188
- declare type ModelRevision = {
183
+ export declare type ModelRevision = {
189
184
  id: number;
190
185
  revision: number;
191
186
  viewpoints: ModelRevisionViewpoint[];
192
187
  };
193
188
 
194
- declare type ModelRevisionModePwfV1Options = CommonOptions & PwfV1Bundle & {
189
+ export declare type ModelRevisionModePwfV1Options = CommonOptions & PwfV1Bundle & {
195
190
  modelId: Model['id'];
196
191
  modelRevisionId: ModelRevision['id'];
197
192
  };
198
193
 
199
- declare type ModelRevisionModePwfV2Options = CommonOptions & PwfV2Bundle & {
194
+ export declare type ModelRevisionModePwfV2Options = CommonOptions & PwfV2Bundle & {
200
195
  modelId: Model['id'];
201
196
  modelRevisionId: ModelRevision['id'];
202
197
  };
203
198
 
204
- declare type ModelRevisionViewpoint = Viewpoint & {
199
+ export declare type ModelRevisionViewpoint = Viewpoint & {
205
200
  primary: boolean;
206
201
  };
207
202
 
208
- declare const NAV_MODE: {
203
+ export declare const NAV_MODE: {
209
204
  readonly DEFAULT: 0;
210
205
  readonly FLY: 1;
211
206
  readonly ORBIT: 2;
@@ -215,9 +210,14 @@ declare const NAV_MODE: {
215
210
  readonly SURVEY: 6;
216
211
  };
217
212
 
218
- declare type NavigationMode = (typeof NAV_MODE)[keyof typeof NAV_MODE];
213
+ export declare type NavigationMode = (typeof NAV_MODE)[keyof typeof NAV_MODE];
214
+
215
+ export declare type NodeBoundingBox = {
216
+ min: number[];
217
+ max: number[];
218
+ };
219
219
 
220
- declare type ObjectFilter = {
220
+ export declare type ObjectFilter = {
221
221
  filterField: FilterField;
222
222
  filterValue: string;
223
223
  };
@@ -237,31 +237,31 @@ declare type Point = {
237
237
  };
238
238
  };
239
239
 
240
- declare type ProcoreFormatClipPlane = {
240
+ export declare type ProcoreFormatClipPlane = {
241
241
  unit?: string;
242
242
  direction: Vector3;
243
243
  location: Vector3;
244
244
  };
245
245
 
246
- declare type Project = {
246
+ export declare type Project = {
247
247
  id: number;
248
248
  };
249
249
 
250
- declare type PropertiesExtractionItem = {
250
+ export declare type PropertiesExtractionItem = {
251
251
  item_type: 'Properties';
252
252
  artifact: {
253
253
  properties: PropertiesFile;
254
254
  };
255
255
  };
256
256
 
257
- declare type PropertiesFile = {
257
+ export declare type PropertiesFile = {
258
258
  id: number;
259
259
  url: string;
260
260
  };
261
261
 
262
- declare type PublicNode = {
262
+ export declare type PublicNode = {
263
263
  id: number;
264
- bbox: BoundingBox_2;
264
+ bbox: NodeBoundingBox;
265
265
  nodeType: number;
266
266
  hidden: boolean;
267
267
  selected: boolean;
@@ -270,24 +270,31 @@ declare type PublicNode = {
270
270
  children: number[];
271
271
  };
272
272
 
273
- declare type PwfV1Bundle = {
273
+ export declare type PwfV1Bundle = {
274
274
  nodeUrl: GeometryFile['url'];
275
275
  meshnodeUrl: GeometryFile['url'];
276
276
  meshUrl: GeometryFile['url'];
277
277
  };
278
278
 
279
- declare type PwfV2Bundle = {
279
+ export declare type PwfV2Bundle = {
280
280
  nodeUrl: GeometryFile['url'];
281
281
  meshnodeUrl: GeometryFile['url'];
282
282
  meshUrl: GeometryFile['url'];
283
283
  manifestUrl: GeometryFile['url'];
284
284
  };
285
285
 
286
- declare type RGB = `rgb(${number}, ${number}, ${number})`;
286
+ export declare const RENDER_MODE: {
287
+ readonly SHADED: "shaded";
288
+ readonly XRAY: "xray";
289
+ };
290
+
291
+ export declare type RenderMode = (typeof RENDER_MODE)[keyof typeof RENDER_MODE];
292
+
293
+ export declare type RGB = `rgb(${number}, ${number}, ${number})`;
287
294
 
288
- declare type RGBA = `rgba(${number}, ${number}, ${number}, ${number})`;
295
+ export declare type RGBA = `rgba(${number}, ${number}, ${number}, ${number})`;
289
296
 
290
- declare type SectionDataAutodeskFormat = {
297
+ export declare type SectionDataAutodeskFormat = {
291
298
  Type: 'ClipPlaneSet';
292
299
  Version: 1;
293
300
  Unit?: string;
@@ -297,7 +304,7 @@ declare type SectionDataAutodeskFormat = {
297
304
  Enabled: boolean;
298
305
  };
299
306
 
300
- declare type SectionDataProcoreFormat = ProcoreFormatClipPlane[];
307
+ export declare type SectionDataProcoreFormat = ProcoreFormatClipPlane[];
301
308
 
302
309
  export declare class TestRoutineRecorder {
303
310
  camera: Camera;
@@ -310,14 +317,14 @@ export declare class TestRoutineRecorder {
310
317
  print(): void;
311
318
  }
312
319
 
313
- declare type Tool = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
320
+ export declare type Tool = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
314
321
 
315
- declare type Vector2 = {
322
+ export declare type Vector2 = {
316
323
  x: number;
317
324
  y: number;
318
325
  };
319
326
 
320
- declare type Vector3 = {
327
+ export declare type Vector3 = {
321
328
  x: number;
322
329
  y: number;
323
330
  z: number;
@@ -325,13 +332,22 @@ declare type Vector3 = {
325
332
 
326
333
  export declare const version: string;
327
334
 
328
- declare type Viewpoint = {
335
+ export declare type Viewpoint = {
329
336
  camera_data: string;
330
337
  sections_data: string;
331
338
  redlines_data: string;
339
+ visibility?: Visibility;
340
+ };
341
+
342
+ export declare type Visibility = {
343
+ default_visibility: boolean;
344
+ exceptions: {
345
+ object_ids: number[];
346
+ object_ranges: [number, number][];
347
+ };
332
348
  };
333
349
 
334
- declare type WebFormatExtractionItem = {
350
+ export declare type WebFormatExtractionItem = {
335
351
  item_type: 'WebFormat';
336
352
  artifact: {
337
353
  web_format: {
@@ -507,6 +523,8 @@ export declare class Webviewer {
507
523
  } | null>;
508
524
  setXRayMode: () => void;
509
525
  setNormalMode: () => void;
526
+ setRenderMode: (mode: RenderMode) => void;
527
+ getRenderMode: () => Promise<RenderMode>;
510
528
  getObject: (id: number, objectTreeName?: string) => Promise<PublicNode | undefined>;
511
529
  getObjects: (objectIds: number[], objectTreeName?: string) => Promise<PublicNode[]>;
512
530
  getNumObjectsSelected: (method: string) => Promise<{
@@ -534,6 +552,8 @@ export declare class Webviewer {
534
552
  clearObjectTreeFilter: () => Promise<void>;
535
553
  getViewpoint: () => Promise<Viewpoint>;
536
554
  setViewpoint: (viewpoint: Viewpoint) => Promise<void>;
555
+ getVisibility: () => Promise<Visibility>;
556
+ setVisibility: (visibility: Visibility) => Promise<void>;
537
557
  };
538
558
  api: {
539
559
  getNamesForObjects: (ids: number[]) => Promise<any>;