@procore/bim-webviewer-sdk 17.3.0 → 17.4.0-BM-923-request-persistent-storage.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 (32) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/Procore.Bim.Webviewer.d.ts +1 -4
  3. package/dist/Procore.Bim.Webviewer.js +1 -1
  4. package/dist/types/src/api/analytic_events/analyticKeys.d.ts +1 -0
  5. package/dist/types/src/api/analytic_events/payloadFactories.d.ts +3 -1
  6. package/dist/types/src/api/bim_viewpoints.d.ts +5 -0
  7. package/dist/types/src/api/types/FileExtraction.d.ts +1 -0
  8. package/dist/types/src/components/ContextMenuComponent/ContextMenuComponent.d.ts +1 -0
  9. package/dist/types/src/components/LoadingComponent/LoadingComponent.d.ts +8 -6
  10. package/dist/types/src/components/ShortestDistanceComponent.d.ts +1 -0
  11. package/dist/types/src/components/ToolBarComponent/ToolBarComponent.d.ts +0 -1
  12. package/dist/types/src/controllers/PubSubController.d.ts +2 -1
  13. package/dist/types/src/controllers/RenderController.d.ts +1 -0
  14. package/dist/types/src/controllers/RenderControllerProxy.d.ts +1 -2
  15. package/dist/types/src/measuring/FeatureTooltip/FeatureTooltip.d.ts +2 -0
  16. package/dist/types/src/measuring/MeasureToolUtils.d.ts +2 -0
  17. package/dist/types/src/measuring/MeasurementInterface.d.ts +1 -0
  18. package/dist/types/src/measuring/MeasurementManager.d.ts +4 -1
  19. package/dist/types/src/measuring/PointToPointController.d.ts +4 -1
  20. package/dist/types/src/measuring/PointToPointManager.d.ts +3 -0
  21. package/dist/types/src/measuring/__tests__/PointToPointFixtures.d.ts +1 -0
  22. package/dist/types/src/picking/PickingController.d.ts +9 -1
  23. package/dist/types/src/procoregl/MeshTopology/__tests__/TopologyFixtures.d.ts +2 -1
  24. package/dist/types/src/sectioning/__tests__/fixtures.d.ts +4 -0
  25. package/dist/types/src/types/WebviewerOptions.d.ts +0 -4
  26. package/dist/types/src/utils/ApiMetaData/ApiMetaData.d.ts +4 -0
  27. package/dist/types/src/utils/ApiMetaData/__tests__/mocks.d.ts +3 -2
  28. package/dist/types/src/utils/ApiMetaData/index.d.ts +1 -0
  29. package/dist/types/src/utils/requestPersistentStorage/__tests__/requestPersistentStorage.test.d.ts +1 -0
  30. package/dist/types/src/utils/requestPersistentStorage/index.d.ts +1 -0
  31. package/dist/types/src/utils/requestPersistentStorage/requestPersistentStorage.d.ts +1 -0
  32. package/package.json +2 -2
@@ -148,6 +148,7 @@ export declare const MEASUREMENT_ORIGIN: {
148
148
  readonly ESC: "esc";
149
149
  readonly HOTKEY: "hotkey";
150
150
  readonly NAVIGATION_CHANGE: "navigation_change";
151
+ readonly HOME: "home";
151
152
  };
152
153
  export type MeasurementOrigin = (typeof MEASUREMENT_ORIGIN)[keyof typeof MEASUREMENT_ORIGIN];
153
154
  export declare const measurements: {
@@ -24,4 +24,6 @@ export declare const getDownloadCompletedTrackEventPayload: (params: {
24
24
  totalPartitionsSizeCompressed?: number;
25
25
  numPartitions?: number;
26
26
  }) => Promise<BimModelsDownloadCompletedPayload>;
27
- export declare const getEnvironmentTrackEventPayload: () => Promise<EnvironmentTrackEventPayload>;
27
+ export declare const getEnvironmentTrackEventPayload: (params: {
28
+ persisted: boolean;
29
+ }) => Promise<EnvironmentTrackEventPayload>;
@@ -0,0 +1,5 @@
1
+ import { Project } from './types/Project';
2
+ export declare const GetBimViewpoint: (params: {
3
+ projectId: Project["id"];
4
+ viewpointId: number;
5
+ }) => Promise<Response>;
@@ -37,5 +37,6 @@ export type FileExtraction = {
37
37
  id: number;
38
38
  extraction_items: FileExtractionItem[];
39
39
  bim_file_upload: BimFileUpload;
40
+ viewpoint_id?: number | null;
40
41
  };
41
42
  export type HolderType = 'FileVersion' | 'BimModelRevision';
@@ -25,6 +25,7 @@ export class ContextMenuComponent {
25
25
  globalOffset: any;
26
26
  objectCount: number;
27
27
  contextMenuMeshnodeIndex: number;
28
+ onMeasurementToggled(payload: any): void;
28
29
  isContextMenuBlocked(): Promise<any>;
29
30
  OnSelectedUpdated(): void;
30
31
  OnGetPropertyName(response: any): void;
@@ -12,13 +12,13 @@ export declare class LoadingComponent {
12
12
  private startTime;
13
13
  private readonly containerElement;
14
14
  private readonly modelInitializationElement;
15
- private propertyLoadingElement;
16
- private modelOpeningElement;
17
- private modelDownloadErrorElement;
18
- private modelInitializationFailedElement;
19
- private fileTooBigErrorElement;
15
+ private readonly allowPersistentStorageElement;
16
+ private readonly propertyLoadingElement;
17
+ private readonly modelOpeningElement;
18
+ private readonly modelDownloadErrorElement;
19
+ private readonly modelInitializationFailedElement;
20
+ private readonly fileTooBigErrorElement;
20
21
  constructor(props: LoadingComponentProps);
21
- private onAppStart;
22
22
  private onInitializationProgress;
23
23
  private getTimeEstimateMessage;
24
24
  private getEstimatedTimeLeft;
@@ -31,6 +31,8 @@ export declare class LoadingComponent {
31
31
  private onFileTooBigError;
32
32
  private onPropertyServiceCheck;
33
33
  private onModelTypeDetermined;
34
+ private onRequestingPersistentStorage;
35
+ private onPersistentStorageRequestResolved;
34
36
  private updateModelOpening;
35
37
  private updateInitProgressBar;
36
38
  }
@@ -13,6 +13,7 @@ export class ShortestDistanceComponent {
13
13
  pivot: import("three").Vector3;
14
14
  onHideUpdated(): Promise<void>;
15
15
  toggle(params: any): void;
16
+ setActive(active: any): void;
16
17
  clearDisplayElements(): void;
17
18
  removeCursors(): void;
18
19
  setGlobalOffset(params: any): void;
@@ -13,7 +13,6 @@ export class ToolBarComponent {
13
13
  tooltipManager: any;
14
14
  tooltipIds: {};
15
15
  toolbarMarginTop: number;
16
- multiMeasurementModesEnabled: any;
17
16
  currentMeasurementMode: string;
18
17
  toolStringMap: Readonly<{
19
18
  9: any;
@@ -42,7 +42,6 @@ export namespace PubSubController {
42
42
  initializationStart: "initializationStart";
43
43
  intersectPointClick: "intersectPointClick";
44
44
  isolateCompleted: "isolateCompleted";
45
- launchedAnimationLoop: "launchedAnimationLoop";
46
45
  mainThreadDebugGuiAdd: "mainThreadDebugGuiAdd";
47
46
  mainThreadDebugGuiDestroy: "mainThreadDebugGuiDestroy";
48
47
  markupDismissed: "markupDismissed";
@@ -72,6 +71,8 @@ export namespace PubSubController {
72
71
  objectUnhide: "objectUnhide";
73
72
  optionsChanged: "optionsChanged";
74
73
  allPartitionsDownloadComplete: "allPartitionsDownloadComplete";
74
+ requestingPersistentStorage: "requestingPersistentStorage";
75
+ persistentStorageRequestResolved: "persistentStorageRequestResolved";
75
76
  projectSettingsLoaded: "projectSettingsLoaded";
76
77
  projectSettingsUpdated: "projectSettingsUpdated";
77
78
  propertiesReady: "propertiesReady";
@@ -171,6 +171,7 @@ export class RenderController {
171
171
  intersection: import("../sdk").Vector3 | null;
172
172
  meshnodeIndex: number;
173
173
  faceNormal: import("../sdk").Vector3 | null;
174
+ nearestMeshnodeIndex?: number;
174
175
  };
175
176
  isMeshnodeSelected(virtualMeshnodeIndex: any): boolean;
176
177
  clickedOnSelectedObject(virtualMeshnodeIndex: any, rightClick: any): void;
@@ -2,7 +2,6 @@ export function RenderControllerProxy(options: any): void;
2
2
  export class RenderControllerProxy {
3
3
  constructor(options: any);
4
4
  cache: Promise<Cache>;
5
- pubsub: PubSubController;
6
5
  options: any;
7
6
  worker: any;
8
7
  enableWebWorker: any;
@@ -277,6 +276,7 @@ export class RenderControllerProxy {
277
276
  intersection: import("../sdk").Vector3 | null;
278
277
  meshnodeIndex: number;
279
278
  faceNormal: import("../sdk").Vector3 | null;
279
+ nearestMeshnodeIndex?: number;
280
280
  };
281
281
  }
282
282
  export namespace RenderControllerProxy {
@@ -288,7 +288,6 @@ export namespace RenderControllerProxy {
288
288
  let MEASURE: number;
289
289
  }
290
290
  }
291
- import { PubSubController } from './PubSubController';
292
291
  import { NavigationManager } from '../navigation/NavigationManager';
293
292
  import { RenderController } from './RenderController';
294
293
  import { RenderControllerWorker } from './RenderControllerWorker';
@@ -4,9 +4,11 @@ export declare class FeatureTooltip {
4
4
  private readonly bimMain;
5
5
  private readonly canvas;
6
6
  private timerId;
7
+ private delay;
7
8
  private readonly locale;
8
9
  constructor(params: {
9
10
  locale: string;
11
+ delay?: number;
10
12
  });
11
13
  private onMouseMove;
12
14
  private onWheel;
@@ -5,6 +5,7 @@ export declare const SNAP_TYPE: {
5
5
  readonly midpoint: "midpoint";
6
6
  readonly edge: "edge";
7
7
  readonly endpoint: "endpoint";
8
+ readonly intersection: "intersection";
8
9
  };
9
10
  export type SnapType = (typeof SNAP_TYPE)[keyof typeof SNAP_TYPE];
10
11
  export type ExtendedLine3 = THREE.Line3 & {
@@ -26,6 +27,7 @@ export declare function getIntersectionSnapAndOutline(params: {
26
27
  };
27
28
  clippingPlanes: THREE.Plane[];
28
29
  globalOffset: Vector3;
30
+ nearestObjectIntersectionLines: THREE.Line3[];
29
31
  }): {
30
32
  snapType: SnapType;
31
33
  snapPosition: THREE.Vector3;
@@ -12,4 +12,5 @@ export interface MeasurementInterface {
12
12
  }): void;
13
13
  getMeasurementProgress(): MeasurementState;
14
14
  resetMeasurement(): void;
15
+ setActive(active: boolean): void;
15
16
  }
@@ -21,7 +21,10 @@ export declare class MeasurementManager {
21
21
  }[];
22
22
  toolEnabled: boolean;
23
23
  });
24
- private onNavigationChanged;
24
+ private onSectionBoxDisplayToggled;
25
+ private onSectionBoxDisplayHoverUpdated;
26
+ private onSelectTool;
27
+ private onHomeViewpointActivated;
25
28
  setGlobalOffset(params: Vector3): void;
26
29
  setMeasurementEnabled(params: {
27
30
  measurementMode?: MeasureMode;
@@ -22,6 +22,7 @@ export declare class PointToPointController {
22
22
  private readonly models;
23
23
  private readonly camera;
24
24
  private currentHoverMeshnodeIndex;
25
+ private nearestMeshnodeIndex;
25
26
  nonManifoldMeshnodeIndices: Set<number>;
26
27
  private readonly meshTopologyCache;
27
28
  private _enabled;
@@ -30,7 +31,7 @@ export declare class PointToPointController {
30
31
  private lastWorldIntersectionSnapResult;
31
32
  private readonly debugGui;
32
33
  private readonly viewerRenderer;
33
- private renderController;
34
+ private readonly renderController;
34
35
  constructor(params: {
35
36
  pickingController: PickingController;
36
37
  renderController: RenderController;
@@ -46,8 +47,10 @@ export declare class PointToPointController {
46
47
  handleWheel(event: WheelEvent): Promise<void>;
47
48
  private computeIntersectionSnapResult;
48
49
  private getWorldIntersectionSnapResult;
50
+ private getNearestMeshnodeIntersectionLines;
49
51
  private publishIntersectionSnapResult;
50
52
  getMeshTopology(meshnode: Meshnode): MeshTopology | null;
53
+ private getFaceCount;
51
54
  private meshnodeTooComplex;
52
55
  private determineHoverState;
53
56
  }
@@ -27,9 +27,11 @@ export declare class PointToPointManager implements MeasurementInterface {
27
27
  private featureTooltip;
28
28
  private surfaceCursor;
29
29
  private edgeCursor;
30
+ private intersectionCursor;
30
31
  private midPointCursor;
31
32
  private endPointCursor;
32
33
  private dom;
34
+ private active;
33
35
  constructor(params: {
34
36
  apiController: ApiController;
35
37
  renderControllerProxy: RenderControllerProxy;
@@ -38,6 +40,7 @@ export declare class PointToPointManager implements MeasurementInterface {
38
40
  measurementRenderer: MeasurementRenderer;
39
41
  locale: string;
40
42
  });
43
+ setActive(active: boolean): void;
41
44
  setGlobalOffset(params: Vector3): void;
42
45
  getGlobalOffset(): THREE.Vector3;
43
46
  getTemporaryDistanceLabel(): DistanceLabel | null;
@@ -18,6 +18,7 @@ export declare const measurementObjectEnterObject1Payload: WorldIntersectionSnap
18
18
  export declare const measurementObjectEnterTooComplexPayload: WorldIntersectionSnapResult;
19
19
  export declare const measurementObjectEnterObject2Payload: WorldIntersectionSnapResult;
20
20
  export declare const measurementObjectMoveMidpointPayload: WorldIntersectionSnapResult;
21
+ export declare const measurementObjectEnterIntersectionPayload: WorldIntersectionSnapResult;
21
22
  export declare const measurementObjectMovePayload: WorldIntersectionSnapResult;
22
23
  export declare const measurementClippedObjectMovePayload: WorldIntersectionSnapResult;
23
24
  export declare const measurementObjectMoveComplexMeshPayload: WorldIntersectionSnapResult;
@@ -18,12 +18,20 @@ export declare class PickingController {
18
18
  getRayIntersectPoint(params: {
19
19
  event: MouseEvent;
20
20
  returnOnEdgeHitFailure: 'null' | 'bboxCenter';
21
+ findNearestMeshnodeIndex?: boolean;
21
22
  }): {
22
23
  intersection: Vector3 | null;
23
24
  meshnodeIndex: number;
24
25
  faceNormal: Vector3 | null;
26
+ nearestMeshnodeIndex?: number;
25
27
  };
28
+ private findNearestMeshnodeIndex;
26
29
  mouseToThreeRay(event: MouseEvent): THREE.Raycaster;
27
- extractId(event: MouseEvent): number;
30
+ extractMeshnodeIndex(event: {
31
+ offsetX: number;
32
+ offsetY: number;
33
+ }): number;
34
+ planeTestMesh(plane: THREE.Plane, meshnodeIndex: number): THREE.Line3[];
28
35
  private rayTestMesh;
36
+ private iterateMeshFaces;
29
37
  }
@@ -1,6 +1,7 @@
1
1
  import { MeshTopology } from '../MeshTopology';
2
+ import { PWFMeshMock } from './PWFMeshMock';
2
3
  import { Mesh } from '../../../pwfreader/PWFTypes';
3
- export declare const pwfFlatPair: Mesh;
4
+ export declare const pwfFlatPair: PWFMeshMock;
4
5
  export declare const flatPair: MeshTopology;
5
6
  export declare const flatRing: MeshTopology;
6
7
  export declare const flatRingOrphan: MeshTopology;
@@ -2,7 +2,11 @@ import type { SectionDataAutodeskFormat, SectionDataProcoreFormat } from '../Sec
2
2
  export declare const procoreFormatUnitless: SectionDataProcoreFormat;
3
3
  export declare const procoreFormatInInches: SectionDataProcoreFormat;
4
4
  export declare const procoreFormatSixPlanesToBox: SectionDataProcoreFormat;
5
+ export declare const procoreFormatNonNormalizedPlane: SectionDataProcoreFormat;
6
+ export declare const procoreFormatNormalizedPlane: SectionDataProcoreFormat;
5
7
  export declare const autodeskFormatClipPlaneUnitless: SectionDataAutodeskFormat;
6
8
  export declare const autodeskFormatClipPlaneInInches: SectionDataAutodeskFormat;
9
+ export declare const autodeskFormatNonNormalizedPlane: SectionDataAutodeskFormat;
10
+ export declare const autodeskFormatNormalizedPlane: SectionDataAutodeskFormat;
7
11
  export declare const autodeskFormatOrientedBoxUnitless: SectionDataAutodeskFormat;
8
12
  export declare const autodeskFormatOrientedBoxInInches: SectionDataAutodeskFormat;
@@ -4,10 +4,6 @@ import { Model } from '../api/types/Model';
4
4
  import { ModelRevision } from '../api/types/ModelRevision';
5
5
  import type { Tool } from '../components/Tool';
6
6
  export type FeatureFlags = {
7
- /**
8
- * @beta Enables the new measurement mode Point to Point, which allows users to measure the distance between two points in the model.
9
- */
10
- enablePointToPoint: boolean;
11
7
  /**
12
8
  * @beta Enables writing mesh data to OPFS for partitioned models, which allows users to use features that use mesh data, notably Point to Point.
13
9
  */
@@ -2,6 +2,7 @@ import { FileExtraction, PropertiesFile, FileVersion, Attachment } from '../../a
2
2
  import { ModelRevision } from '../../api/types/ModelRevision';
3
3
  import * as FileExtractions from '../../api/bim_file_extractions';
4
4
  import * as BimModelRevisions from '../../api/bim_model_revisions';
5
+ import * as BimViewpoints from '../../api/bim_viewpoints';
5
6
  import { Options, GeometryBundle } from '../../types/WebviewerOptions';
6
7
  import { InternalViewpoint } from '../../viewpoint/types';
7
8
  import { Model } from '../../api/types/Model';
@@ -14,6 +15,7 @@ export type ResourceBundle = ({
14
15
  type Api = {
15
16
  getBimFileExtraction: typeof FileExtractions.GetBimFileExtraction;
16
17
  getBimModelRevision: typeof BimModelRevisions.GetBimModelRevision;
18
+ getBimViewpoint: typeof BimViewpoints.GetBimViewpoint;
17
19
  };
18
20
  type ApiOptions = Partial<Api>;
19
21
  export declare const API_MODE: {
@@ -40,8 +42,10 @@ export declare class ApiMetaData {
40
42
  get companyId(): Promise<number>;
41
43
  get baseUrl(): Promise<string>;
42
44
  get fileExtractionIds(): Promise<number[]>;
45
+ get fileExtraction(): Promise<FileExtraction>;
43
46
  get modelRevision(): Promise<ModelRevision>;
44
47
  get homeViewpoint(): Promise<InternalViewpoint | undefined>;
45
48
  private get homeViewpointInModelRevisionMode();
49
+ private get homeViewpointInFileExtractionMode();
46
50
  }
47
51
  export {};
@@ -1,7 +1,8 @@
1
1
  import type { FileExtractionModePwfV2OverrideOptions, FileExtractionModePwfV1OverrideOptions, FileExtractionModeOptions, ModelRevisionModePwfV2OverrideOptions, ModelRevisionModePwfV1OverrideOptions, ModelRevisionModeOptions, FileExtractionModePwfV1OverrideResource, FileExtractionModePwfV2OverrideResource, ModelRevisionModePwfV1OverrideResource, ModelRevisionModePwfV2OverrideResource, ModelRevisionModeResource, ResourceOptions } from '../../../types/WebviewerOptions';
2
2
  import { FileExtraction } from '../../../api/types/FileExtraction';
3
- import { ModelRevision, ModelRevisionViewpoint } from '../../../api/types/ModelRevision';
3
+ import { ModelRevision } from '../../../api/types/ModelRevision';
4
4
  import { InternalViewpoint } from '../../../viewpoint/types';
5
+ import type { Viewpoint } from '../../../api/types/Viewpoint';
5
6
  export declare const projectId = 4;
6
7
  export declare const companyId = 1;
7
8
  export declare const fileExtractionId = 1;
@@ -67,6 +68,6 @@ export declare const modelRevisionModePwfV2OverrideResourceOptions: ResourceOpti
67
68
  export declare const modelRevisionModeResource: ModelRevisionModeResource;
68
69
  export declare const modelRevisionModeResourceOptions: ResourceOptions;
69
70
  export declare const fileExtraction: FileExtraction;
70
- export declare const homeViewpoint: ModelRevisionViewpoint;
71
+ export declare const viewpoint: Viewpoint;
71
72
  export declare const modelRevision: ModelRevision;
72
73
  export declare const bimHomeViewpoint: InternalViewpoint;
@@ -1,6 +1,7 @@
1
1
  import { ApiMetaData as _ApiMetaData } from './ApiMetaData';
2
2
  import { Options } from '../../types/WebviewerOptions';
3
3
  export { API_MODE, ApiMode } from './ApiMetaData';
4
+ export { ApiMetaData as ApiMetaDataInstance } from './ApiMetaData';
4
5
  export declare namespace ApiMetaData {
5
6
  let store: _ApiMetaData;
6
7
  const init: (initOptions: Options) => void;
@@ -0,0 +1 @@
1
+ export { requestPersistentStorage } from './requestPersistentStorage';
@@ -0,0 +1 @@
1
+ export declare function requestPersistentStorage(): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@procore/bim-webviewer-sdk",
3
- "version": "17.3.0",
3
+ "version": "17.4.0-BM-923-request-persistent-storage.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",
@@ -12,4 +12,4 @@
12
12
  ],
13
13
  "author": "Procore Technologies",
14
14
  "license": "SEE LICENSE IN LICENSE"
15
- }
15
+ }