bimatter-viewer-react 0.7.0 → 0.7.2

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.
package/lib/Model.d.ts CHANGED
@@ -7,11 +7,12 @@ type ModelProps = {
7
7
  modelID: number;
8
8
  data: BmtModelData;
9
9
  materialMode?: ViewerMaterialMode;
10
+ onUploadComplete?: (uploadedItemCount: number) => void;
10
11
  useWebGPU?: boolean;
11
12
  };
12
13
  export declare function parseModelMatrix(matrix?: string): Matrix4 | null;
13
14
  export declare function getModelCoordinationMatrix(data: BmtModelData): Matrix4 | null;
14
15
  export declare function getModelCoordinationMatrixSource(data: BmtModelData): string | undefined;
15
- declare function Model({ colorPaletteTexture, coordinationMatrix, modelID, data, materialMode: materialModeOverride, useWebGPU, }: ModelProps): import("react/jsx-runtime").JSX.Element;
16
+ declare function Model({ colorPaletteTexture, coordinationMatrix, modelID, data, materialMode: materialModeOverride, onUploadComplete, useWebGPU, }: ModelProps): import("react/jsx-runtime").JSX.Element;
16
17
  declare const _default: import("react").MemoExoticComponent<typeof Model>;
17
18
  export default _default;
@@ -15,9 +15,10 @@ type ModelUploadQueueProps = {
15
15
  groupRef: RefObject<Group | null>;
16
16
  items: UploadMeshData[];
17
17
  materialMode: ViewerMaterialMode;
18
+ onUploadComplete?: (uploadedItemCount: number) => void;
18
19
  uploadMode: ViewerUploadMode;
19
20
  useDoubleSideMaterial: boolean;
20
21
  useWebGPU: boolean;
21
22
  };
22
- export declare function ModelUploadQueue({ colorPaletteTexture, groupRef, items, materialMode, uploadMode, useDoubleSideMaterial, useWebGPU, }: ModelUploadQueueProps): null;
23
+ export declare function ModelUploadQueue({ colorPaletteTexture, groupRef, items, materialMode, onUploadComplete, uploadMode, useDoubleSideMaterial, useWebGPU, }: ModelUploadQueueProps): null;
23
24
  export {};
@@ -1,5 +1,6 @@
1
1
  import type { ColorRepresentation, Group } from "three";
2
- import type { SelectedStore, UserDevice, ViewerGridAxesVisibility, ViewerGridAxisSide, ViewerStoreApi } from "../store/ViewerStore";
2
+ import type { SelectedStore, UserDevice, ViewerGridAxesVisibility, ViewerGridAxisSide, ViewerLightingSettings, ViewerLightingSettingsUpdate, ViewerPostproductionActivePassFilter, ViewerStoreApi } from "../store/ViewerStore";
3
+ import type { ViewerPostproductionPassType } from "../types";
3
4
  import { type ViewerPropertiesApi } from "./ViewerPropertiesApi";
4
5
  import type { ViewerClippingApi } from "../utils/ClippingUtils";
5
6
  import type { ViewerColorConfigByModel, ViewerModelColorConfig } from "../utils/ColorsUtils/useElementColors";
@@ -92,6 +93,20 @@ export type ViewerModelsApi = {
92
93
  loadModels: (sources: ViewerModelSource[], options?: ViewerLoadModelsOptions) => Promise<ViewerLoadedModels>;
93
94
  reset: () => void;
94
95
  };
96
+ export type ViewerPostproductionApi = {
97
+ getAmbientLightColor: () => ColorRepresentation;
98
+ getAmbientLightIntensity: () => number;
99
+ getActivePassFilter: () => ViewerPostproductionActivePassFilter | null;
100
+ getDirectionalLightColor: () => ColorRepresentation;
101
+ getDirectionalLightIntensity: () => number;
102
+ getLighting: () => ViewerLightingSettings;
103
+ setAmbientLightColor: (color: ColorRepresentation) => void;
104
+ setAmbientLightIntensity: (intensity: number) => void;
105
+ setDirectionalLightColor: (color: ColorRepresentation) => void;
106
+ setDirectionalLightIntensity: (intensity: number) => void;
107
+ setLighting: (lighting: ViewerLightingSettingsUpdate) => void;
108
+ setPassFilter: (type: ViewerPostproductionPassType) => void;
109
+ };
95
110
  export type ViewerApi = {
96
111
  camera: ViewerCameraApi;
97
112
  clipping: ViewerClippingApi;
@@ -100,6 +115,7 @@ export type ViewerApi = {
100
115
  dimensions: ViewerDimensionsApi;
101
116
  geometryUtils: ViewerGeometryUtilsApi;
102
117
  models: ViewerModelsApi;
118
+ postproduction: ViewerPostproductionApi;
103
119
  properties: ViewerPropertiesApi;
104
120
  selector: ViewerSelectorApi;
105
121
  utils: ViewerUtilsApi;
package/lib/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { default as Viewer } from "./Viewer";
2
2
  export type { ViewerModelsData, ViewerProps } from "./Viewer";
3
- export type { ViewerMaterialMode, ViewerUploadMode } from "./types";
4
- export type { ViewerApi, ViewerCameraApi, ViewerCameraGetIntersection, ViewerClippingApi, ViewerColorsApi, ViewerBmtConverterOptions, ViewerConverterApi, ViewerDimensionsApi, ViewerGeometryUtilsApi, ViewerLoadModelsOptions, ViewerModelsApi, ViewerSelection, ViewerSelectorApi, ViewerUtilsApi, } from "./api/ViewerApi";
3
+ export type { ViewerMaterialMode, ViewerPostproductionPassType, ViewerUploadMode, } from "./types";
4
+ export type { ViewerApi, ViewerCameraApi, ViewerCameraGetIntersection, ViewerClippingApi, ViewerColorsApi, ViewerBmtConverterOptions, ViewerConverterApi, ViewerDimensionsApi, ViewerGeometryUtilsApi, ViewerLoadModelsOptions, ViewerModelsApi, ViewerPostproductionApi, ViewerSelection, ViewerSelectorApi, ViewerUtilsApi, } from "./api/ViewerApi";
5
5
  export type { ViewerModelLevel, ViewerModelLevelsByModel, ViewerPropertiesApi, ViewerPropertiesExcelOptions, } from "./api/ViewerPropertiesApi";
6
6
  export { BMTLoader } from "./Loaders/BmtLoader";
7
7
  export type { BmtGeometryChunkData, BmtParseCallbacks, BmtParseProgressData, BmtModelGeometryData, BmtGeomData, BmtIndexArray, BmtMaterialData, BmtElementProps, BmtModelData, BmtModelProps, BmtModelStructure, BmtModelStructureNode, BmtPropertyRecord, BmtPropertySet, BmtPropertyValue, } from "./Loaders/BmtLoader";
@@ -23,4 +23,4 @@ export { DimensionLine, DimensionsUtils, useDimensionsUtils, type DimensionUnit,
23
23
  export { createViewerStore } from "./store/ViewerStore";
24
24
  export { ViewerStoreProvider } from "./store/ViewerStoreProvider";
25
25
  export { useViewerStore, useViewerStoreApi } from "./store/useViewerStore";
26
- export type { SelectedStore, UserDevice, ViewerGridAxesVisibility, ViewerGridAxisSide, ViewerModelNamesStore, ViewerModelPropsStore, ViewerModelStructureStore, ViewerStore, ViewerStoreApi, } from "./store/ViewerStore";
26
+ export type { SelectedStore, UserDevice, ViewerGridAxesVisibility, ViewerGridAxisSide, ViewerLightSettings, ViewerLightingSettings, ViewerLightingSettingsUpdate, ViewerModelNamesStore, ViewerModelPropsStore, ViewerModelStructureStore, ViewerPostproductionActivePassFilter, ViewerStore, ViewerStoreApi, } from "./store/ViewerStore";