@procore/bim-webviewer-sdk 16.6.0-rc.2 → 16.6.0-rc.21

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 (80) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/Procore.Bim.Webviewer.d.ts +164 -2354
  3. package/dist/Procore.Bim.Webviewer.js +1 -1
  4. package/dist/types/src/Webviewer.d.ts +5 -8
  5. package/dist/types/src/api/analytic_events/analyticKeys.d.ts +52 -29
  6. package/dist/types/src/api/analytic_events/index.d.ts +1 -1
  7. package/dist/types/src/api/analytic_events/payloadFactories.d.ts +10 -9
  8. package/dist/types/src/components/ContextMenuComponent/ContextMenuComponent.d.ts +1 -1
  9. package/dist/types/src/components/RootComponent.d.ts +3 -3
  10. package/dist/types/src/components/ShortestDistanceComponent.d.ts +7 -5
  11. package/dist/types/src/components/ToolBarComponent/ToolBarComponent.d.ts +1 -0
  12. package/dist/types/src/components/ToolBarComponent/ToolbarButton/SplitButton.d.ts +7 -5
  13. package/dist/types/src/components/WindowModelObjectComponent/VirtualizedList.d.ts +1 -1
  14. package/dist/types/src/components/WindowModelObjectComponent/WindowModelObjectComponent.d.ts +3 -3
  15. package/dist/types/src/components/WindowTreeComponent.d.ts +0 -1
  16. package/dist/types/src/components/WindowTreeViewComponent.d.ts +2 -3
  17. package/dist/types/src/components/WindowViewPropertiesComponent/WindowViewPropertiesComponent.d.ts +3 -3
  18. package/dist/types/src/components/__tests__/ShortestDisanceFixtures.d.ts +21 -0
  19. package/dist/types/src/controllers/ApiController/ApiController.d.ts +2 -2
  20. package/dist/types/src/controllers/CacheController.d.ts +3 -2
  21. package/dist/types/src/controllers/DatabaseController.d.ts +2 -1
  22. package/dist/types/src/controllers/DomController/DomController.d.ts +0 -1
  23. package/dist/types/src/controllers/PubSubController.d.ts +3 -1
  24. package/dist/types/src/controllers/RenderController.d.ts +20 -27
  25. package/dist/types/src/controllers/RenderControllerProxy.d.ts +14 -16
  26. package/dist/types/src/controllers/RenderControllerWorker.d.ts +1 -0
  27. package/dist/types/src/controllers/RenderStatusType.d.ts +4 -4
  28. package/dist/types/src/controllers/__tests__/fixtures.d.ts +4 -1
  29. package/dist/types/src/measuring/MeasurementInterface.d.ts +10 -5
  30. package/dist/types/src/measuring/MeasurementManager.d.ts +9 -9
  31. package/dist/types/src/measuring/MeasurementRenderer.d.ts +1 -5
  32. package/dist/types/src/measuring/PointToPointController.d.ts +6 -0
  33. package/dist/types/src/measuring/PointToPointManager.d.ts +19 -8
  34. package/dist/types/src/measuring/__tests__/PointToPointFixtures.d.ts +5 -4
  35. package/dist/types/src/measuring/createPointToPointLineDrawingDebugGui.d.ts +0 -5
  36. package/dist/types/src/messages.d.ts +7 -7
  37. package/dist/types/src/navigation/DefaultControl.d.ts +0 -11
  38. package/dist/types/src/navigation/Orbit/calcNewPosition.d.ts +0 -1
  39. package/dist/types/src/navigation/Orbit/getQuatToCylinderSpace.d.ts +0 -1
  40. package/dist/types/src/navigation/__tests__/FixedOrbitControl.test.d.ts +1 -0
  41. package/dist/types/src/navigation/__tests__/ZoomControl.test.d.ts +1 -0
  42. package/dist/types/src/procoregl/HiddenNodeServices/HiddenNodeServices.d.ts +1 -1
  43. package/dist/types/src/procoregl/HiddenNodeServices/rangify.d.ts +2 -8
  44. package/dist/types/src/procoregl/Models/Models.d.ts +5 -6
  45. package/dist/types/src/procoregl/PartitionsRenderer.d.ts +3 -3
  46. package/dist/types/src/procoregl/ProcoreGeometries/ProcoreArrow.d.ts +0 -1
  47. package/dist/types/src/procoregl/ProcoreGeometries/StubbyArrow.d.ts +0 -1
  48. package/dist/types/src/procoregl/SectionDisplay/getCursorDirectionFromCameraToPlane.d.ts +1 -2
  49. package/dist/types/src/pwfreader/PWF.d.ts +4 -2
  50. package/dist/types/src/pwfreader/PWFCache.d.ts +1 -1
  51. package/dist/types/src/pwfreader/PWFProxy.d.ts +5 -2
  52. package/dist/types/src/pwfreader/PWFTypes.d.ts +0 -5
  53. package/dist/types/src/pwfreader/v1/PWFModelParser.d.ts +2 -5
  54. package/dist/types/src/pwfreader/v1/PWFV1.d.ts +9 -3
  55. package/dist/types/src/pwfreader/v1/impl/bufferReader/MeshnodeBufferReader.d.ts +2 -5
  56. package/dist/types/src/pwfreader/v1/standard/MeshServices.d.ts +1 -0
  57. package/dist/types/src/pwfreader/v1/streaming/MeshData.d.ts +1 -0
  58. package/dist/types/src/pwfreader/v1/streaming/OPFSFile/MainThreadSyncAccessHandleFallback.d.ts +14 -0
  59. package/dist/types/src/pwfreader/v1/streaming/OPFSFile/OPFSFile.d.ts +12 -0
  60. package/dist/types/src/pwfreader/v1/streaming/OPFSFile/index.d.ts +1 -0
  61. package/dist/types/src/pwfreader/v1/streaming/PartitionProxy.d.ts +7 -2
  62. package/dist/types/src/pwfreader/v1/streaming/StreamedMeshServices.d.ts +18 -2
  63. package/dist/types/src/pwfreader/v2/Manifest.d.ts +3 -3
  64. package/dist/types/src/pwfreader/v2/PWFV2.d.ts +4 -2
  65. package/dist/types/src/pwfreader/v2/standard/MeshServices.d.ts +1 -0
  66. package/dist/types/src/pwfreader/v2/streaming/StreamedMeshServices.d.ts +1 -0
  67. package/dist/types/src/sdk.d.ts +1 -0
  68. package/dist/types/src/sectioning/utils.d.ts +0 -1
  69. package/dist/types/src/threeShaking.d.ts +47 -47
  70. package/dist/types/src/types/WebviewerOptions.d.ts +8 -3
  71. package/dist/types/src/unit_util.d.ts +5 -3
  72. package/dist/types/src/utils/Benchmark/MainThreadBenchmark.d.ts +2 -2
  73. package/dist/types/src/utils/DebugGui/MainThreadDebugGui.d.ts +1 -1
  74. package/dist/types/src/utils/DebugGui/WorkerDebugGui.d.ts +1 -1
  75. package/dist/types/src/utils/ZoomExtents/__tests__/computePoseToFitBoxFromPosition.test.d.ts +0 -1
  76. package/dist/types/src/utils/ZoomExtents/computeRefinedBbox.d.ts +2 -3
  77. package/dist/types/src/utils/ZoomExtents/utils.d.ts +0 -1
  78. package/dist/types/src/utils/i18n.d.ts +1 -1
  79. package/dist/types/src/validateOptions/checkTools.d.ts +1 -1
  80. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { PWF } from '../PWF';
2
- import { GlobalOffset, ModelAnalyticsData } from '../PWFTypes';
2
+ import { ModelAnalyticsData } from '../PWFTypes';
3
3
  import type { DownloadMetaData } from '../../procoregl/Models/Models';
4
4
  import { PWFModelParser } from './PWFModelParser';
5
5
  import { PWFNode } from './interface/PWFNode';
@@ -22,6 +22,7 @@ import { Partition } from './streaming/Partition';
22
22
  import { GeometryFactory } from '../../procoregl/GeometryFactory';
23
23
  import type { BootstrapperResult } from '../../controllers/Bootstrapper';
24
24
  import { Manifest } from './Manifest';
25
+ import { Vector3 } from '../../types/Math';
25
26
  export declare class PWFV2 implements PWF {
26
27
  private readonly downloadMetaData;
27
28
  resourceId: number;
@@ -88,7 +89,7 @@ export declare class PWFV2 implements PWF {
88
89
  loadAllPartitionProxies(): void;
89
90
  prefetchPartitions(geometryFactory: StreamedGeometryFactory): BootstrapperResult;
90
91
  setGeometryFactory(geometryFactory: GeometryFactory): void;
91
- globalOffset(): GlobalOffset;
92
+ globalOffset(): Vector3;
92
93
  root(): Node;
93
94
  forEachMeshnode(callback: (meshnode: Meshnode) => void): void;
94
95
  forEachNode(callback: (node: Node) => void): void;
@@ -104,4 +105,5 @@ export declare class PWFV2 implements PWF {
104
105
  getModelAnalyticsData(): ModelAnalyticsData;
105
106
  get virtualMeshnodeIndexOffset(): number;
106
107
  set virtualMeshnodeIndexOffset(value: number);
108
+ dispose(): void;
107
109
  }
@@ -24,4 +24,5 @@ export declare class MeshServices {
24
24
  private loadToGPU;
25
25
  getMeshObject(meshOffset: number): MeshObject;
26
26
  private loadMeshGeometryToGPU;
27
+ dispose(): void;
27
28
  }
@@ -8,4 +8,5 @@ export declare class StreamedMeshServices extends MeshServices {
8
8
  getMeshObject(meshOffset: number): MeshObject;
9
9
  loadPartitionContainingMeshnode(streamedMeshnode: StreamedMeshnode): Promise<void>;
10
10
  getMeshGeometryForOffsets(meshOffset: number, meshnodeOffset: number): StreamedMeshGeometry | undefined;
11
+ dispose(): void;
11
12
  }
@@ -34,6 +34,7 @@ export type { PaletteParams } from './types/Palette';
34
34
  export type { Uom, DisplayUnit } from './unit_util';
35
35
  export { UOM, DISPLAY_UNIT_ABBREVIATIONS as DISPLAY_UNIT } from './unit_util';
36
36
  export type { ProjectSettings } from './controllers/SettingsController';
37
+ export { MEASURE_MODES, type MeasureMode, } from './measuring/MeasurementManager';
37
38
  declare const version: string;
38
39
  export { version };
39
40
  export { ErrorLogger } from './utils/Error';
@@ -1,4 +1,3 @@
1
- import { THREE } from '../threeShaking';
2
1
  import { Vector3, BoundingBox } from '../types/Math';
3
2
  export declare const transformToThreePlane: (distance: number, normal: Vector3, rotation: Vector3 | null, center: THREE.Vector3 | undefined | null, offset: THREE.Vector3) => THREE.Plane;
4
3
  export declare const validateBoundary: (min: Vector3 | null, max: Vector3 | null) => boolean;
@@ -47,50 +47,50 @@ export namespace THREE {
47
47
  export { WebGLRenderer };
48
48
  export { WebGLRenderTarget };
49
49
  }
50
- import { AmbientLight } from "three/src/lights/AmbientLight";
51
- import { Box3 } from "three/src/math/Box3";
52
- import { BoxGeometry } from "three/src/geometries/BoxGeometry";
53
- import { BufferAttribute } from "three/src/core/BufferAttribute";
54
- import { BufferGeometry } from "three/src/core/BufferGeometry";
55
- import { Clock } from "three/src/core/Clock";
56
- import { Color } from "three/src/math/Color";
57
- import { Cylindrical } from "three/src/math/Cylindrical";
58
- import { DirectionalLight } from "three/src/lights/DirectionalLight";
59
- import { DoubleSide } from "three/src/constants";
60
- import { Euler } from "three/src/math/Euler";
61
- import { EdgesGeometry } from "three/src/geometries/EdgesGeometry";
62
- import { Face3 } from "three/src/core/Face3";
63
- import { FaceColors } from "three/src/constants";
64
- import { Frustum } from "three/src/math/Frustum";
65
- import { Geometry } from "three/src/core/Geometry";
66
- import { LessDepth } from "three/src/constants";
67
- import { Line3 } from "three/src/math/Line3";
68
- import { LinearFilter } from "three/src/constants";
69
- import { LineBasicMaterial } from "three/src/materials/LineBasicMaterial";
70
- import { LineSegments } from "three/src/objects/LineSegments";
71
- import { _Math } from "three/src/math/Math";
72
- import { Matrix3 } from "three/src/math/Matrix3";
73
- import { Matrix4 } from "three/src/math/Matrix4";
74
- import { Mesh } from "three/src/objects/Mesh";
75
- import { MeshBasicMaterial } from "three/src/materials/MeshBasicMaterial";
76
- import { MeshLambertMaterial } from "three/src/materials/MeshLambertMaterial";
77
- import { MOUSE } from "three/src/constants";
78
- import { Object3D } from "three/src/core/Object3D";
79
- import { OrthographicCamera } from "three/src/cameras/OrthographicCamera";
80
- import { PerspectiveCamera } from "three/src/cameras/PerspectiveCamera";
81
- import { Plane } from "three/src/math/Plane";
82
- import { PlaneGeometry } from "three/src/geometries/PlaneGeometry";
83
- import { Quaternion } from "three/src/math/Quaternion";
84
- import { RawShaderMaterial } from "three/src/materials/RawShaderMaterial";
85
- import { Ray } from "three/src/math/Ray";
86
- import { Raycaster } from "three/src/core/Raycaster";
87
- import { RGBAFormat } from "three/src/constants";
88
- import { Scene } from "three/src/scenes/Scene";
89
- import { ShaderMaterial } from "three/src/materials/ShaderMaterial";
90
- import { Spherical } from "three/src/math/Spherical";
91
- import { Triangle } from "three/src/math/Triangle";
92
- import { Vector2 } from "three/src/math/Vector2";
93
- import { Vector3 } from "three/src/math/Vector3";
94
- import { VertexColors } from "three/src/constants";
95
- import { WebGLRenderer } from "three/src/renderers/WebGLRenderer";
96
- import { WebGLRenderTarget } from "three/src/renderers/WebGLRenderTarget";
50
+ import { AmbientLight } from 'three/src/lights/AmbientLight';
51
+ import { Box3 } from 'three/src/math/Box3';
52
+ import { BoxGeometry } from 'three/src/geometries/BoxGeometry';
53
+ import { BufferAttribute } from 'three/src/core/BufferAttribute';
54
+ import { BufferGeometry } from 'three/src/core/BufferGeometry';
55
+ import { Clock } from 'three/src/core/Clock';
56
+ import { Color } from 'three/src/math/Color';
57
+ import { Cylindrical } from 'three/src/math/Cylindrical';
58
+ import { DirectionalLight } from 'three/src/lights/DirectionalLight';
59
+ import { DoubleSide } from 'three/src/constants';
60
+ import { Euler } from 'three/src/math/Euler';
61
+ import { EdgesGeometry } from 'three/src/geometries/EdgesGeometry';
62
+ import { Face3 } from 'three/src/core/Face3';
63
+ import { FaceColors } from 'three/src/constants';
64
+ import { Frustum } from 'three/src/math/Frustum';
65
+ import { Geometry } from 'three/src/core/Geometry';
66
+ import { LessDepth } from 'three/src/constants';
67
+ import { Line3 } from 'three/src/math/Line3';
68
+ import { LinearFilter } from 'three/src/constants';
69
+ import { LineBasicMaterial } from 'three/src/materials/LineBasicMaterial';
70
+ import { LineSegments } from 'three/src/objects/LineSegments';
71
+ import { _Math } from 'three/src/math/Math';
72
+ import { Matrix3 } from 'three/src/math/Matrix3';
73
+ import { Matrix4 } from 'three/src/math/Matrix4';
74
+ import { Mesh } from 'three/src/objects/Mesh';
75
+ import { MeshBasicMaterial } from 'three/src/materials/MeshBasicMaterial';
76
+ import { MeshLambertMaterial } from 'three/src/materials/MeshLambertMaterial';
77
+ import { MOUSE } from 'three/src/constants';
78
+ import { Object3D } from 'three/src/core/Object3D';
79
+ import { OrthographicCamera } from 'three/src/cameras/OrthographicCamera';
80
+ import { PerspectiveCamera } from 'three/src/cameras/PerspectiveCamera';
81
+ import { Plane } from 'three/src/math/Plane';
82
+ import { PlaneGeometry } from 'three/src/geometries/PlaneGeometry';
83
+ import { Quaternion } from 'three/src/math/Quaternion';
84
+ import { RawShaderMaterial } from 'three/src/materials/RawShaderMaterial';
85
+ import { Ray } from 'three/src/math/Ray';
86
+ import { Raycaster } from 'three/src/core/Raycaster';
87
+ import { RGBAFormat } from 'three/src/constants';
88
+ import { Scene } from 'three/src/scenes/Scene';
89
+ import { ShaderMaterial } from 'three/src/materials/ShaderMaterial';
90
+ import { Spherical } from 'three/src/math/Spherical';
91
+ import { Triangle } from 'three/src/math/Triangle';
92
+ import { Vector2 } from 'three/src/math/Vector2';
93
+ import { Vector3 } from 'three/src/math/Vector3';
94
+ import { VertexColors } from 'three/src/constants';
95
+ import { WebGLRenderer } from 'three/src/renderers/WebGLRenderer';
96
+ import { WebGLRenderTarget } from 'three/src/renderers/WebGLRenderTarget';
@@ -3,12 +3,17 @@ import { FileExtraction, GeometryFile } from '../api/types/FileExtraction';
3
3
  import { Model } from '../api/types/Model';
4
4
  import { ModelRevision } from '../api/types/ModelRevision';
5
5
  import type { Tool } from '../components/Tool';
6
- export type FeatureFlags = Partial<{
6
+ export type FeatureFlags = {
7
7
  /**
8
8
  * @beta Enables the new measurement mode Point to Point, which allows users to measure the distance between two points in the model.
9
9
  */
10
10
  enablePointToPoint: boolean;
11
- }>;
11
+ /**
12
+ * @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
+ */
14
+ enableMeshDataOnOPFS: boolean;
15
+ };
16
+ export type ValidatedFeatureFlags = Readonly<FeatureFlags>;
12
17
  export type CommonOptions = {
13
18
  /**
14
19
  * Always required
@@ -48,7 +53,7 @@ export type CommonOptions = {
48
53
  multiselect?: boolean;
49
54
  selection?: string;
50
55
  enableWebWorker?: boolean;
51
- featureFlags?: FeatureFlags;
56
+ featureFlags?: Partial<FeatureFlags>;
52
57
  logInitializationTimes?: boolean;
53
58
  sceneGraph?: string;
54
59
  bimFileId?: number;
@@ -14,6 +14,8 @@ declare const UOM_METRIC_LENGTH: {
14
14
  readonly km: "km";
15
15
  };
16
16
  export declare const UOM: {
17
+ readonly rad: "rad";
18
+ readonly deg: "°";
17
19
  readonly cdsqm: "cd/m²";
18
20
  readonly cuum: "um³";
19
21
  readonly cumm: "mm³";
@@ -87,9 +89,9 @@ export declare const UnitUtil: {
87
89
  getEquivalentUnitForDisplayUnit: (fromUnit: Uom, displayUnit: DisplayUnit) => Uom;
88
90
  convertUnit: (value: number, fromUnit: Uom, toUnit: Uom) => number;
89
91
  formatUnit: (value: number, unit: Uom, options?: {
90
- fixed?: number | undefined;
91
- precision?: number | undefined;
92
- locale?: string | undefined;
92
+ fixed?: number;
93
+ precision?: number;
94
+ locale?: string;
93
95
  }) => string;
94
96
  };
95
97
  export {};
@@ -4,8 +4,8 @@ type OnLogCallback = (result: number) => void;
4
4
  export declare namespace MainThreadBenchmark {
5
5
  const engage: (params: {
6
6
  metricId: MetricId;
7
- onEnd?: OnEndCallback | undefined;
8
- onLog?: OnLogCallback | undefined;
7
+ onEnd?: OnEndCallback;
8
+ onLog?: OnLogCallback;
9
9
  }) => void;
10
10
  const isRunning: (metricId: MetricId) => boolean;
11
11
  const hasStarted: (metricId: MetricId) => boolean;
@@ -3,7 +3,7 @@ type Target = {
3
3
  [key: string]: any;
4
4
  };
5
5
  export declare namespace MainThreadDebugGui {
6
- const add: <T extends Target>(obj: T, configureStore?: ((store: GuiStore<T>) => void) | undefined, onChange?: ((...args: any[]) => void) | undefined) => T;
6
+ const add: <T extends Target>(obj: T, configureStore?: (store: GuiStore<T>) => void, onChange?: (...args: any[]) => void) => T;
7
7
  const destroy: () => void;
8
8
  }
9
9
  export {};
@@ -4,7 +4,7 @@ type Target = {
4
4
  [key: string]: any;
5
5
  };
6
6
  export declare namespace WorkerDebugGui {
7
- export const add: <T extends Target>(obj: T, configureStore?: ((store: GuiStore<T>) => void) | undefined, onChange?: ((...args: any[]) => void) | undefined) => T;
7
+ export const add: <T extends Target>(obj: T, configureStore?: (store: GuiStore<T>) => void, onChange?: (...args: any[]) => void) => T;
8
8
  type UpdateParams = {
9
9
  id: ProxyId;
10
10
  keyPath: string[];
@@ -1,3 +1,2 @@
1
- import { THREE } from '../../../threeShaking';
2
1
  export declare const getBboxSizeFromSphereRadius: (d: number, fov: number) => number;
3
2
  export declare const worldToModelSpace: (up: THREE.Vector3, vec: THREE.Vector3) => import("three").Vector3;
@@ -1,4 +1,3 @@
1
- import { THREE } from '../../threeShaking';
2
1
  import type { Meshnode } from '../../pwfreader/PWFTypes';
3
2
  export declare const computeRefinedBbox: (params: {
4
3
  bbox: THREE.Box3;
@@ -7,9 +6,9 @@ export declare const computeRefinedBbox: (params: {
7
6
  }) => THREE.Box3;
8
7
  declare const _default: {
9
8
  computeRefinedBbox: (params: {
10
- bbox: import("three").Box3;
9
+ bbox: THREE.Box3;
11
10
  meshnodes: Meshnode[];
12
11
  spaceJunkEliminationThreshold: number;
13
- }) => import("three").Box3;
12
+ }) => THREE.Box3;
14
13
  };
15
14
  export default _default;
@@ -1,4 +1,3 @@
1
- import { THREE } from '../../threeShaking';
2
1
  import { BoundingBox } from '../../types/Math';
3
2
  export declare const bboxToBox3: (bbox: BoundingBox) => THREE.Box3;
4
3
  type ComputeOptimalCameraDistanceFromBboxCenterParams = {
@@ -1,5 +1,5 @@
1
1
  export namespace i18n {
2
- const localCache: {};
2
+ let localCache: {};
3
3
  function __(locale: any, phrase: any): any;
4
4
  function fallbackLanguage(locale: any, phrase: any): any;
5
5
  }
@@ -2,6 +2,6 @@ import { Options } from '../types/WebviewerOptions';
2
2
  type AllTools = 0;
3
3
  type Tools = Required<Options['tools'][]>;
4
4
  type CheckToolsParam = Tools | AllTools | undefined;
5
- export declare const isAllTools: (tools: CheckToolsParam) => tools is 0;
5
+ export declare const isAllTools: (tools: CheckToolsParam) => tools is AllTools;
6
6
  export declare const checkTools: (tools: CheckToolsParam) => void;
7
7
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@procore/bim-webviewer-sdk",
3
- "version": "16.6.0-rc.2",
3
+ "version": "16.6.0-rc.21",
4
4
  "description": "Procore BIM Webviewer SDK",
5
5
  "main": "dist/Procore.Bim.Webviewer.js",
6
6
  "types": "dist/Procore.Bim.Webviewer.d.ts",