@procore/bim-webviewer-sdk 14.1.0 → 15.0.0-BIM-4002.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.
@@ -6,6 +6,7 @@ import { PublicNode } from './types/PublicNode';
6
6
  import { NavigationMode } from './navigation/NavigationModes';
7
7
  import { SectionDataAutodeskFormat, SectionDataProcoreFormat } from './sectioning/SectionController';
8
8
  import type { Viewpoint } from './api/types/Model';
9
+ import type { CssColor } from './components/Markup/SvgRenderer';
9
10
  export declare class Webviewer {
10
11
  options: Options;
11
12
  static readonly tools: {
@@ -53,9 +54,19 @@ export declare class Webviewer {
53
54
  position: Vector3;
54
55
  direction: Vector3;
55
56
  }>;
56
- getSnapshot: (color: string) => Promise<void>;
57
- getSnapshotDataUrl: (params?: {
58
- color: unknown;
57
+ getSnapshot: (params: {
58
+ color?: CssColor;
59
+ aspectRatio?: {
60
+ width: number;
61
+ height: number;
62
+ };
63
+ }) => Promise<void>;
64
+ getSnapshotDataUrl: (params: {
65
+ color?: CssColor;
66
+ aspectRatio?: {
67
+ width: number;
68
+ height: number;
69
+ };
59
70
  }) => Promise<string>;
60
71
  setLookAt: (x: number, y: number, z: number) => Promise<{
61
72
  position: Vector3;
@@ -9,3 +9,4 @@ export declare function getHeaders(): Record<string, string>;
9
9
  export declare let client: HttpClient;
10
10
  export declare let cachedClient: HttpClient;
11
11
  export declare function initHttpClient(options: Options): void;
12
+ export declare function disposeHttpClient(): void;
@@ -18,14 +18,19 @@ export declare const clientLoadings: {
18
18
  readonly initialization: `${string}.initialization`;
19
19
  readonly download_completed: `${string}.download_completed`;
20
20
  };
21
+ export type ModelType = 'standard' | 'partitioned' | undefined;
21
22
  export type BimModelsDownloadCompletedPayload = {
22
23
  time_to_download: number;
23
24
  web_viewer_version: string;
24
25
  file_name: string;
25
26
  file_type: string;
26
27
  input_file_size: number;
28
+ model_type: ModelType;
29
+ model_cached: boolean;
30
+ total_partitions_size?: number;
31
+ total_partitions_size_compressed?: number;
32
+ num_partitions?: number;
27
33
  };
28
- export type ModelType = 'standard' | 'partitioned' | undefined;
29
34
  export type ModelInitializationPayload = {
30
35
  success: boolean;
31
36
  start_timestamp: number;
@@ -1,5 +1,5 @@
1
1
  import type { PWF } from '../../pwfreader/PWF';
2
- import { ModelInitializationPayload, BimModelsDownloadCompletedPayload, InitializationTrackEventPayload } from './analyticKeys';
2
+ import { ModelInitializationPayload, BimModelsDownloadCompletedPayload, InitializationTrackEventPayload, ModelType } from './analyticKeys';
3
3
  export declare const getModelMetaData: () => Promise<{
4
4
  file_name: string;
5
5
  file_type: string;
@@ -20,4 +20,9 @@ export declare const getInitializationEventPayload: (params: {
20
20
  export declare const getInitializationTrackEventPayload: (eventPayload: ModelInitializationPayload) => Promise<InitializationTrackEventPayload>;
21
21
  export declare const getDownloadCompletedTrackEventPayload: (params: {
22
22
  timeToDownload: number;
23
+ modelType: ModelType;
24
+ modelCached: boolean;
25
+ totalPartitionsSize?: number | undefined;
26
+ totalPartitionsSizeCompressed?: number | undefined;
27
+ numPartitions?: number | undefined;
23
28
  }) => Promise<BimModelsDownloadCompletedPayload>;
@@ -30,6 +30,7 @@ export declare class LoadingComponent {
30
30
  private onModelInitializationFailed;
31
31
  private onFileTooBigError;
32
32
  private onPropertyServiceCheck;
33
+ private onModelTypeDetermined;
33
34
  private updateModelOpening;
34
35
  private updateInitProgressBar;
35
36
  }
@@ -20,10 +20,9 @@ export declare class Bootstrapper {
20
20
  static partitionUrlsToDownload: Set<string>;
21
21
  static estimatedInitializationSteps: number;
22
22
  static bootstrap(renderController: RenderController): Promise<void>;
23
- static setPartitionedMode(numPartitions: number): void;
23
+ static setPartitionsCount(numPartitions: number): void;
24
24
  static totalStepsCount(): number;
25
- static addDownloadSteps(url: string, count: number): void;
26
- static incrementPartitionStepsCount(): void;
25
+ static addDownloadSteps(count: number): void;
27
26
  static recordCompleteDownload(url: string, duration: number): void;
28
27
  static recordPartialDownload(url: string): void;
29
28
  static determineTotalStepsCount(): Promise<void>;
@@ -13,15 +13,14 @@ export class DomController {
13
13
  removePanel(panel: any): boolean;
14
14
  onResize(): void;
15
15
  onDoubleClick(evt: any): void;
16
- getSnapshot(color: any): Promise<void>;
16
+ getSnapshot(params: any): Promise<void>;
17
17
  setSectionBoxDisplayManager(sectionBoxDisplayManager: any): void;
18
18
  sectionBoxDisplayManager: any;
19
- getSnapshotDataUrl({ color, }: {
20
- color: any;
21
- }): Promise<any>;
19
+ getSnapshotDataUrl(params: any): Promise<any>;
22
20
  currentSnapshotPromise: any;
23
- buildSnapshotDataUrl({ color, }: {
21
+ buildSnapshotDataUrl({ color, aspectRatio, }?: {
24
22
  color?: string | undefined;
23
+ aspectRatio: any;
25
24
  }): Promise<string>;
26
25
  dispose(): void;
27
26
  }
@@ -0,0 +1,4 @@
1
+ export declare function fitCanvasToSize(canvas: HTMLCanvasElement, aspectRatio?: {
2
+ width?: number;
3
+ height?: number;
4
+ }): HTMLCanvasElement;
@@ -0,0 +1 @@
1
+ export { DomController } from './DomController';
@@ -51,6 +51,7 @@ export namespace PubSubController {
51
51
  measured: "measured";
52
52
  messages: "messages";
53
53
  modelTreeParentInteracted: "modelTreeParentInteracted";
54
+ modelTypeDetermined: "modelTypeDetermined";
54
55
  navigationChanged: "navigationChanged";
55
56
  navigationMouseDown: "navigationMouseDown";
56
57
  navigationMouseUp: "navigationMouseUp";
@@ -112,7 +112,7 @@ export class RenderController {
112
112
  getInitEventPayload(params: any): import("../api/analytic_events/analyticKeys").ModelInitializationPayload;
113
113
  launchAnimationLoop(): void;
114
114
  captureModelStats(): void;
115
- init(meshnodeAB: any, nodeAB: any, meshAB: any, manifest: any): Promise<void>;
115
+ init(meshnodeAB: any, nodeAB: any, meshAB: any, manifest: any, downloadMetaData: any): Promise<void>;
116
116
  nodeAB: any;
117
117
  meshnodeAB: any;
118
118
  meshAB: any;
@@ -120,6 +120,7 @@ export class RenderController {
120
120
  startTimestamp: number | undefined;
121
121
  startTime: number | undefined;
122
122
  sceneGraphName: any;
123
+ downloadMetaData: any;
123
124
  instantiateGeometryFactory(streaming: any, webGL2Context: any): GeometryFactory;
124
125
  onUpdateWithState(data: any): void;
125
126
  close(): boolean;
@@ -28,6 +28,15 @@ export class RenderControllerProxy {
28
28
  logInitializationTimes: any;
29
29
  projectId: any;
30
30
  baseUrl: any;
31
+ nodeUrl: any;
32
+ meshnodeUrl: any;
33
+ meshUrl: any;
34
+ manifestUrl: any;
35
+ fileExtractionId: any;
36
+ modelId: any;
37
+ modelRevisionId: any;
38
+ companyId: any;
39
+ accessToken: any;
31
40
  };
32
41
  processPWFArrayBuffers: (arrayBuffers: any, pwfFilePreCached: any) => void;
33
42
  messageToEvent: {
@@ -35,6 +44,10 @@ export class RenderControllerProxy {
35
44
  'Error: File size exception.': "fileTooBigError";
36
45
  };
37
46
  handleDownloadError: (message: any) => void;
47
+ downloadMetaData: {
48
+ timeToDownload: number;
49
+ modelCached: boolean;
50
+ };
38
51
  navmode: any;
39
52
  globalOffset: any;
40
53
  createRenderController(): void;
@@ -7,7 +7,7 @@ export class RenderControllerWorker {
7
7
  rejects: {};
8
8
  worker: any;
9
9
  globalPromiseId: number;
10
- init(meshnodeAB: any, nodeAB: any, meshAB: any, manifest: any): void;
10
+ init(meshnodeAB: any, nodeAB: any, meshAB: any, manifest: any, downloadMetaData: any): void;
11
11
  postSimpleMessage(fn: any, args: any): Promise<any>;
12
12
  postMessage(payload: any): Promise<any>;
13
13
  onUpdateWithState(data: any): Promise<any>;
@@ -11,6 +11,7 @@ export class PWF {
11
11
  sceneGraphName: any;
12
12
  isLogging: any;
13
13
  locale: any;
14
+ downloadMetaData: any;
14
15
  streaming: boolean;
15
16
  nodeServices: NodeServices | null;
16
17
  meshnodeServices: StreamedMeshnodeServices | MeshnodeServices | null;
@@ -98,6 +99,7 @@ export class PWF {
98
99
  };
99
100
  currentIndex: number | undefined;
100
101
  partitionProxies: PartitionProxy[] | undefined;
102
+ loadPartitionPromises: any[] | undefined;
101
103
  getNodeById(id: any): import("./shared/Node").Node;
102
104
  hasNode(id: any): boolean;
103
105
  globalOffset(): {
@@ -22,6 +22,8 @@ export declare class PartitionProxy {
22
22
  offsetTop: number;
23
23
  offsetLeft: number;
24
24
  };
25
+ private _byteLength?;
26
+ private _compressedByteLength?;
25
27
  static Stats: {
26
28
  PartitionsLoaded: number;
27
29
  MeshesLoaded: number;
@@ -36,7 +38,10 @@ export declare class PartitionProxy {
36
38
  setMeshnodes(meshnodes: StreamedMeshnode[]): void;
37
39
  loadPartitionData(callbackFn: (partition: Partition) => void): Promise<void>;
38
40
  loadPartition(factory: StreamedGeometryFactory): Promise<void>;
39
- loadPartitionSync(factory: StreamedGeometryFactory): void;
41
+ size(): {
42
+ compressed: number;
43
+ size: number;
44
+ };
40
45
  static processPartitionProxiesAB(partitionProxiesAB: Uint8Array, callback: (partitionProxy: PartitionProxy) => void): void;
41
46
  static getPartitionProxies(partitionProxiesAB: ArrayBuffer): PWFPartitionProxy[];
42
47
  getContentOfPartitionUrl(): string;
@@ -4,4 +4,5 @@ export { API_MODE, ApiMode } from './ApiMetaData';
4
4
  export declare namespace ApiMetaData {
5
5
  let store: _ApiMetaData;
6
6
  const init: (initOptions: Options) => void;
7
+ const dispose: () => void;
7
8
  }
@@ -2,4 +2,3 @@ export const EMPTY_SPACE_MESHNODE_INDEX: -1;
2
2
  export const EMPTY_SPACE_OBJECT_ID: -1;
3
3
  export const DEFAULT_FOV: 65;
4
4
  export const NO_CURRENT_NODE: -1;
5
- export const MAX_NUMBER_OF_DOWNLOADS_ALLOWED_IN_PARALLEL: 4;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@procore/bim-webviewer-sdk",
3
- "version": "14.1.0",
3
+ "version": "15.0.0-BIM-4002.0",
4
4
  "description": "Procore BIM Webviewer SDK",
5
5
  "main": "dist/Procore.Bim.Webviewer.js",
6
6
  "types": "dist/Procore.Bim.Webviewer.d.ts",