@procore/bim-webviewer-sdk 17.4.0 → 17.5.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 (31) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/Procore.Bim.Webviewer.d.ts +0 -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/components/ContextMenuComponent/ContextMenuComponent.d.ts +1 -0
  7. package/dist/types/src/components/LoadingComponent/LoadingComponent.d.ts +8 -6
  8. package/dist/types/src/components/ToolBarComponent/ToolBarComponent.d.ts +0 -1
  9. package/dist/types/src/controllers/PubSubController.d.ts +2 -1
  10. package/dist/types/src/controllers/RenderControllerProxy.d.ts +0 -2
  11. package/dist/types/src/measuring/MeasureToolUtils.d.ts +0 -5
  12. package/dist/types/src/measuring/MeasurementManager.d.ts +1 -0
  13. package/dist/types/src/measuring/PointToPointController.d.ts +1 -2
  14. package/dist/types/src/navigation/ZoomControl.d.ts +1 -0
  15. package/dist/types/src/procoregl/MeshTopology/Centroid.d.ts +2 -2
  16. package/dist/types/src/procoregl/MeshTopology/{HalfEdge.d.ts → Edge.d.ts} +12 -10
  17. package/dist/types/src/procoregl/MeshTopology/MeshTopology.d.ts +22 -8
  18. package/dist/types/src/procoregl/MeshTopology/Position.d.ts +2 -2
  19. package/dist/types/src/procoregl/MeshTopology/Segment.d.ts +18 -0
  20. package/dist/types/src/procoregl/MeshTopology/__tests__/Segment.test.d.ts +1 -0
  21. package/dist/types/src/procoregl/MeshTopology/index.d.ts +2 -1
  22. package/dist/types/src/sectioning/__tests__/fixtures.d.ts +4 -0
  23. package/dist/types/src/types/WebviewerOptions.d.ts +0 -4
  24. package/dist/types/src/utils/ApiMetaData/index.d.ts +1 -0
  25. package/dist/types/src/utils/MathHelper/MathHelper.d.ts +13 -0
  26. package/dist/types/src/utils/MathHelper/index.d.ts +1 -1
  27. package/dist/types/src/utils/requestPersistentStorage/__tests__/requestPersistentStorage.test.d.ts +1 -0
  28. package/dist/types/src/utils/requestPersistentStorage/index.d.ts +1 -0
  29. package/dist/types/src/utils/requestPersistentStorage/requestPersistentStorage.d.ts +1 -0
  30. package/package.json +2 -2
  31. /package/dist/types/src/procoregl/MeshTopology/__tests__/{HalfEdge.test.d.ts → Edge.test.d.ts} +0 -0
@@ -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>;
@@ -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 onPersistentStorageRequestPending;
35
+ private onPersistentStorageRequestResolved;
34
36
  private updateModelOpening;
35
37
  private updateInitProgressBar;
36
38
  }
@@ -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
+ persistentStorageRequestPending: "persistentStorageRequestPending";
75
+ persistentStorageRequestResolved: "persistentStorageRequestResolved";
75
76
  projectSettingsLoaded: "projectSettingsLoaded";
76
77
  projectSettingsUpdated: "projectSettingsUpdated";
77
78
  propertiesReady: "propertiesReady";
@@ -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;
@@ -289,7 +288,6 @@ export namespace RenderControllerProxy {
289
288
  let MEASURE: number;
290
289
  }
291
290
  }
292
- import { PubSubController } from './PubSubController';
293
291
  import { NavigationManager } from '../navigation/NavigationManager';
294
292
  import { RenderController } from './RenderController';
295
293
  import { RenderControllerWorker } from './RenderControllerWorker';
@@ -40,10 +40,5 @@ export declare function detectSnapFeature(intersectPoint: THREE.Vector3, line: T
40
40
  detectedSnapType: SnapType;
41
41
  detectedSnapPosition: THREE.Vector3;
42
42
  };
43
- export declare function getNormalFromPoints(point1: THREE.Vector3, point2: THREE.Vector3, point3: THREE.Vector3): THREE.Vector3;
44
- export declare function isNormalFacingCamera(normal: THREE.Vector3, cameraDirection: THREE.Vector3): boolean;
45
- export declare function arePlanesCoplanar(normal1: THREE.Vector3, point1: THREE.Vector3, normal2: THREE.Vector3, point2: THREE.Vector3): boolean;
46
- export declare function areNormalsSimilar(normal1: THREE.Vector3, normal2: THREE.Vector3): boolean;
47
43
  export declare function getSurfaceCursorAngle(camera: THREE.PerspectiveCamera, faceNormal: THREE.Vector3, intersection: THREE.Vector3, canvasWidth: number, canvasHeight: number): Vector3;
48
44
  export declare function getEdgeCursorAngle(start: Vector3, end: Vector3, camera: THREE.PerspectiveCamera, canvasWidth: number, canvasHeight: number): number;
49
- export declare function arePointsCollinear(p1: THREE.Vector3, p2: THREE.Vector3, p3: THREE.Vector3): boolean;
@@ -24,6 +24,7 @@ export declare class MeasurementManager {
24
24
  private onSectionBoxDisplayToggled;
25
25
  private onSectionBoxDisplayHoverUpdated;
26
26
  private onSelectTool;
27
+ private onHomeViewpointActivated;
27
28
  setGlobalOffset(params: Vector3): void;
28
29
  setMeasurementEnabled(params: {
29
30
  measurementMode?: MeasureMode;
@@ -22,9 +22,8 @@ export declare class PointToPointController {
22
22
  private readonly models;
23
23
  private readonly camera;
24
24
  private currentHoverMeshnodeIndex;
25
- private nearestMeshnodeIndex;
26
- nonManifoldMeshnodeIndices: Set<number>;
27
25
  private readonly meshTopologyCache;
26
+ private nearestMeshnodeIndex;
28
27
  private _enabled;
29
28
  private readonly globalOffset;
30
29
  private prevLastWorldIntersectionSnapResult;
@@ -4,5 +4,6 @@ export declare class ZoomControl implements WheelControl {
4
4
  constructor();
5
5
  onWheel: (event: WheelEvent) => void;
6
6
  handleZoom(event: WheelEvent, zoomSpeed: number): void;
7
+ private updateSectionHover;
7
8
  dispose(): void;
8
9
  }
@@ -1,10 +1,10 @@
1
1
  import { Position } from './Position';
2
- import { HalfEdge } from './HalfEdge';
2
+ import { Edge } from './Edge';
3
3
  import { SpatialObject } from './SpatialObject';
4
4
  export declare class Centroid implements SpatialObject {
5
5
  positions: Position[];
6
6
  position: Position;
7
- spoke: HalfEdge | null;
7
+ spoke: Edge | null;
8
8
  constructor(positions: Position[], position: Position);
9
9
  box3(): THREE.Box3;
10
10
  intersect(ray: THREE.Ray): THREE.Vector3 | null;
@@ -1,19 +1,20 @@
1
1
  import type { Position } from './Position';
2
2
  import type { Centroid } from './Centroid';
3
- export declare class HalfEdge {
3
+ export declare class Edge {
4
4
  org: Position;
5
5
  dest: Position;
6
6
  face: Centroid;
7
- next?: HalfEdge;
8
- prev?: HalfEdge;
9
- sym: HalfEdge | null;
7
+ next?: Edge;
8
+ prev?: Edge;
9
+ sym: Edge | null;
10
10
  id: number;
11
- private static _nextId;
11
+ vertexBasedID?: string;
12
+ protected static _nextId: number;
12
13
  static epsilon: number;
13
- static fromFace(face: Centroid): HalfEdge[];
14
- static makeEdge(org: Position, dest: Position, face: Centroid): HalfEdge;
15
- static makeNext(edge: HalfEdge, dest: Position, face: Centroid): HalfEdge;
16
- static connect(edge0: HalfEdge, edge1: HalfEdge, face: Centroid): HalfEdge;
14
+ static fromFace(face: Centroid): Edge[];
15
+ static makeEdge(org: Position, dest: Position, face: Centroid): Edge;
16
+ static makeNext(edge: Edge, dest: Position, face: Centroid): Edge;
17
+ static connect(edge0: Edge, edge1: Edge, face: Centroid): Edge;
17
18
  isBoundary(): boolean;
18
19
  isRidge(): boolean;
19
20
  isCrease(): boolean;
@@ -29,6 +30,7 @@ export declare class HalfEdge {
29
30
  };
30
31
  private constructor();
31
32
  private compareFaces;
33
+ protected idByVertices(): string;
32
34
  private signedVolumeOfTetrahedron;
33
- private static nextId;
35
+ protected static nextId(): number;
34
36
  }
@@ -1,27 +1,41 @@
1
1
  import { Position } from './Position';
2
2
  import { Centroid } from './Centroid';
3
- import { HalfEdge } from './HalfEdge';
3
+ import { Edge } from './Edge';
4
4
  import { Mesh } from '../../pwfreader/PWFTypes';
5
5
  export declare class MeshTopologyError extends Error {
6
6
  constructor(message: string);
7
7
  }
8
8
  export declare class MeshTopology {
9
- private positions;
10
9
  private edges;
10
+ private positions;
11
11
  private faces;
12
12
  private facesTree;
13
13
  private orphansByOrg;
14
14
  private orphansByDest;
15
- constructor(meshes: Mesh[]);
16
- forEachHalfEdge(callback: (edge: HalfEdge) => void): void;
15
+ private lastSurfaceDirection;
16
+ private lastSurfaceConstant;
17
+ private currentBoundaryLines;
18
+ constructor(meshes: Mesh[], handleNonManifold?: boolean);
19
+ clearCachedBoundaryLines(): void;
20
+ forEachEdge(callback: (edge: Edge) => void): void;
17
21
  forEachPosition(callback: (position: Position) => void): void;
18
22
  intersect(ray: THREE.Ray): Centroid | null;
19
- isManifold(): boolean;
20
23
  isEuler(): boolean;
21
- private extractFaces;
22
- private extractPositions;
24
+ creaseEdgesWithCameraForwardAndFaceNormal(cameraForward: THREE.Vector3, intersectionFaceNormal: THREE.Vector3, intersection: THREE.Vector3, matrixWorld: THREE.Matrix4, options: {
25
+ hideDifferentFaceNormal: boolean;
26
+ hideNonCoplanar: boolean;
27
+ faceNormalTolerance: number;
28
+ coplanarTolerance: number;
29
+ pointCollinearSQR: number;
30
+ }): {
31
+ start: THREE.Vector3;
32
+ end: THREE.Vector3;
33
+ }[];
34
+ isManifold(): boolean;
23
35
  private findOrphan;
24
36
  private addOrphan;
37
+ private extractPositions;
25
38
  private dedupePositionsAndFaces;
26
- orderFaceIndices(arr: [number, number, number]): [number, number, number];
39
+ private orderFaceIndices;
40
+ private extractFaces;
27
41
  }
@@ -1,8 +1,8 @@
1
- import { HalfEdge } from './HalfEdge';
1
+ import { Edge } from './Edge';
2
2
  export declare class Position {
3
3
  vertex: THREE.Vector3;
4
4
  normal: THREE.Vector3;
5
- spoke: HalfEdge | null;
5
+ spoke: Edge | null;
6
6
  id: number;
7
7
  private static _nextId;
8
8
  constructor(vertex: THREE.Vector3, normal: THREE.Vector3);
@@ -0,0 +1,18 @@
1
+ export declare class Segment {
2
+ l1: Segment | null;
3
+ l2: Segment | null;
4
+ private readonly line;
5
+ constructor(line: {
6
+ start: THREE.Vector3;
7
+ end: THREE.Vector3;
8
+ });
9
+ private like;
10
+ link(other: Segment, pointCollinearSQR?: number): void;
11
+ match(segments: Segment[], pointCollinearSQR?: number): void;
12
+ connectStart(): THREE.Vector3;
13
+ connectEnd(): THREE.Vector3;
14
+ connect(): {
15
+ start: THREE.Vector3;
16
+ end: THREE.Vector3;
17
+ };
18
+ }
@@ -1,5 +1,6 @@
1
1
  export { MeshTopology } from './MeshTopology';
2
2
  export { SpatialObject } from './SpatialObject';
3
- export { HalfEdge } from './HalfEdge';
4
3
  export { Position } from './Position';
5
4
  export { Centroid } from './Centroid';
5
+ export { Segment } from './Segment';
6
+ export { Edge } from './Edge';
@@ -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
  */
@@ -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;
@@ -17,3 +17,16 @@ export declare function toScreenPosition(params: {
17
17
  }): Vector3;
18
18
  export declare function serializeVector(vector: THREE.Vector3): string;
19
19
  export declare function normalizeLine(line: THREE.Line3): string;
20
+ export declare function isNormalFacingCamera(normal: THREE.Vector3, cameraDirection: THREE.Vector3): boolean;
21
+ export declare function areNormalsSimilar(normal1: THREE.Vector3, normal2: THREE.Vector3, FACE_NORMAL_TOLERANCE?: number): boolean;
22
+ export declare function arePlanesCoplanar(normal1: THREE.Vector3, point1: THREE.Vector3, normal2: THREE.Vector3, point2: THREE.Vector3, COPLANAR_TOLERANCE?: number): boolean;
23
+ export declare function getNormalFromPoints(point1: THREE.Vector3, point2: THREE.Vector3, point3: THREE.Vector3): THREE.Vector3;
24
+ export declare function vector3FuzzyEqual(a: THREE.Vector3, b: THREE.Vector3, epsilon: number): boolean;
25
+ export declare function areLinesParallel(line1: {
26
+ start: THREE.Vector3;
27
+ end: THREE.Vector3;
28
+ }, line2: {
29
+ start: THREE.Vector3;
30
+ end: THREE.Vector3;
31
+ }): boolean;
32
+ export declare function arePointsCollinear(p1: THREE.Vector3, p2: THREE.Vector3, p3: THREE.Vector3, POINT_COLLINEAR_SQR?: number): boolean;
@@ -1 +1 @@
1
- export { normalizeLine, serializeVector, toScreenPosition, translateToLocalCoord, translateToWorldCoord, } from './MathHelper';
1
+ export { normalizeLine, serializeVector, toScreenPosition, translateToLocalCoord, translateToWorldCoord, isNormalFacingCamera, areNormalsSimilar, arePlanesCoplanar, getNormalFromPoints, vector3FuzzyEqual, areLinesParallel, arePointsCollinear, } from './MathHelper';
@@ -0,0 +1 @@
1
+ export { requestPersistentStorage } from './requestPersistentStorage';
@@ -0,0 +1 @@
1
+ export declare function requestPersistentStorage(quickResolveTimeout?: number): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@procore/bim-webviewer-sdk",
3
- "version": "17.4.0",
3
+ "version": "17.5.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
+ }