bimatter-viewer-react 0.7.1 → 0.7.3

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.
@@ -1,5 +1,6 @@
1
1
  import { type StoreApi } from "zustand/vanilla";
2
2
  import type { ColorRepresentation } from "three";
3
+ import type { ViewerPostproductionPassType } from "../types";
3
4
  import type { BmtModelProps, BmtModelStructure } from "../Loaders/BmtLoader";
4
5
  import type { ViewerApi } from "../api/ViewerApi";
5
6
  export type UserDevice = "pc" | "mobile";
@@ -13,16 +14,41 @@ export interface SelectedStore {
13
14
  export type ViewerModelPropsStore = Record<number, BmtModelProps>;
14
15
  export type ViewerModelStructureStore = Record<number, BmtModelStructure>;
15
16
  export type ViewerModelNamesStore = Record<number, string>;
17
+ export type ViewerLightSettings = {
18
+ color: ColorRepresentation;
19
+ intensity: number;
20
+ };
21
+ export type ViewerLightingSettings = {
22
+ ambient: ViewerLightSettings;
23
+ directional: ViewerLightSettings;
24
+ };
25
+ export type ViewerLightingSettingsUpdate = {
26
+ ambient?: Partial<ViewerLightSettings>;
27
+ directional?: Partial<ViewerLightSettings>;
28
+ };
29
+ export type ViewerPostproductionActivePassFilter = {
30
+ pass: unknown;
31
+ type: Exclude<ViewerPostproductionPassType, null>;
32
+ };
16
33
  export declare const DEFAULT_SELECTION_COLOR = "rgb(17, 148, 189)";
17
34
  export declare const DEFAULT_PRESELECTION_COLOR = "rgb(104, 198, 227)";
35
+ export declare const DEFAULT_AMBIENT_LIGHT_COLOR = "#ffffff";
36
+ export declare const DEFAULT_AMBIENT_LIGHT_INTENSITY = 1.5;
37
+ export declare const DEFAULT_DIRECTIONAL_LIGHT_COLOR = "#ffffff";
38
+ export declare const DEFAULT_DIRECTIONAL_LIGHT_INTENSITY = 1.5;
39
+ export declare const DEFAULT_POSTPRODUCTION_SATURATION = 0;
18
40
  export type ViewerStore = {
19
41
  api: ViewerApi | null;
20
42
  defaultHotkeysEnabled: boolean;
43
+ lighting: ViewerLightingSettings;
21
44
  modelNames: ViewerModelNamesStore;
22
45
  modelProps: ViewerModelPropsStore;
23
46
  modelStructure: ViewerModelStructureStore;
24
47
  gridAxesVisibility: ViewerGridAxesVisibility;
25
48
  preselectionColor: ColorRepresentation;
49
+ postproductionActivePassFilter: ViewerPostproductionActivePassFilter | null;
50
+ postproductionPassType: ViewerPostproductionPassType;
51
+ postproductionSaturation: number;
26
52
  selected: SelectedStore;
27
53
  selectionColor: ColorRepresentation;
28
54
  selectionInteractionDisabled: boolean;
@@ -33,11 +59,19 @@ export type ViewerStore = {
33
59
  setDefaultHotkeysEnabled: (enabled: boolean) => void;
34
60
  setGridAxesVisibility: (gridAxesVisibility: Partial<ViewerGridAxesVisibility>) => void;
35
61
  setGridAxisVisibility: (side: ViewerGridAxisSide, visible: boolean) => void;
62
+ setAmbientLightColor: (color: ColorRepresentation) => void;
63
+ setAmbientLightIntensity: (intensity: number) => void;
64
+ setDirectionalLightColor: (color: ColorRepresentation) => void;
65
+ setDirectionalLightIntensity: (intensity: number) => void;
36
66
  setShowGridAxes: (visible: boolean) => void;
67
+ setLighting: (lighting: ViewerLightingSettingsUpdate) => void;
37
68
  setModelNames: (modelNames: ViewerModelNamesStore) => void;
38
69
  setModelProps: (modelProps: ViewerModelPropsStore) => void;
39
70
  setModelStructure: (modelStructure: ViewerModelStructureStore) => void;
40
71
  setPreselectionColor: (color: ColorRepresentation) => void;
72
+ setPostproductionActivePassFilter: (filter: ViewerPostproductionActivePassFilter | null) => void;
73
+ setPostproductionPassType: (type: ViewerPostproductionPassType) => void;
74
+ setPostproductionSaturation: (saturation: number) => void;
41
75
  setSelectionColor: (color: ColorRepresentation) => void;
42
76
  setSelectionInteractionDisabled: (disabled: boolean) => void;
43
77
  setShowNavCube: (showNavCube: boolean) => void;
package/lib/types.d.ts CHANGED
@@ -9,4 +9,5 @@ export type ViewerCameraRef = RefObject<Camera | null>;
9
9
  export type ViewerControlsRef = RefObject<CameraControlsImpl | null>;
10
10
  export type ViewerLightRef = RefObject<DirectionalLight | null>;
11
11
  export type ViewerMaterialMode = "quality" | "performance";
12
+ export type ViewerPostproductionPassType = "N8AO" | "SSAO" | null;
12
13
  export type ViewerUploadMode = "smooth" | "balanced" | "fast";
package/package.json CHANGED
@@ -1,68 +1,68 @@
1
1
  {
2
- "name": "bimatter-viewer-react",
3
- "version": "0.7.1",
4
- "license": "PolyForm-Noncommercial-1.0.0",
5
- "type": "module",
6
- "main": "./lib/index.js",
7
- "module": "./lib/index.js",
8
- "types": "./lib/index.d.ts",
9
- "exports": {
10
- ".": {
11
- "types": "./lib/index.d.ts",
12
- "import": "./lib/index.js"
2
+ "name": "bimatter-viewer-react",
3
+ "version": "0.7.3",
4
+ "license": "PolyForm-Noncommercial-1.0.0",
5
+ "type": "module",
6
+ "main": "./lib/index.js",
7
+ "module": "./lib/index.js",
8
+ "types": "./lib/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./lib/index.d.ts",
12
+ "import": "./lib/index.js"
13
+ },
14
+ "./ifc-parser.wasm": "./public/ifc-parser.wasm"
13
15
  },
14
- "./ifc-parser.wasm": "./public/ifc-parser.wasm"
15
- },
16
- "files": [
17
- "README.md",
18
- "LICENSE.md",
19
- "lib",
20
- "public/ifc-parser.wasm"
21
- ],
22
- "scripts": {
23
- "dev": "vite",
24
- "build": "tsc -b && vite build",
25
- "build:lib": "vite build -c vite.lib.config.ts && tsc -p tsconfig.lib.json",
26
- "lint": "eslint .",
27
- "prepublishOnly": "npm run build:lib",
28
- "preview": "vite preview"
29
- },
30
- "dependencies": {
31
- "@react-three/drei": "^10.7.7",
32
- "@react-three/fiber": "^9.6.1",
33
- "pako": "^2.1.0",
34
- "three": "^0.184.0",
35
- "three-mesh-bvh": "^0.9.9",
36
- "web-ifc": "^0.0.77",
37
- "zustand": "^5.0.13"
38
- },
39
- "peerDependencies": {
40
- "react": "^19.2.5",
41
- "react-dom": "^19.2.5"
42
- },
43
- "devDependencies": {
44
- "@eslint/js": "^10.0.1",
45
- "@loaders.gl/core": "^4.4.2",
46
- "@loaders.gl/las": "^4.4.2",
47
- "@math.gl/types": "^4.1.0",
48
- "@react-three/drei": "^10.7.7",
49
- "@react-three/fiber": "^9.6.1",
50
- "@types/node": "^24.12.2",
51
- "@types/pako": "^2.0.4",
52
- "@types/react": "^19.2.14",
53
- "@types/react-dom": "^19.2.3",
54
- "@vitejs/plugin-react": "^6.0.1",
55
- "eslint": "^10.2.1",
56
- "eslint-plugin-react-hooks": "^7.1.1",
57
- "eslint-plugin-react-refresh": "^0.5.2",
58
- "globals": "^17.5.0",
59
- "lil-gui": "^0.21.0",
60
- "react": "^19.2.5",
61
- "react-dom": "^19.2.5",
62
- "three": "^0.184.0",
63
- "three-mesh-bvh": "^0.9.9",
64
- "typescript": "~6.0.2",
65
- "typescript-eslint": "^8.58.2",
66
- "vite": "^8.0.10"
67
- }
16
+ "files": [
17
+ "README.md",
18
+ "LICENSE.md",
19
+ "lib",
20
+ "public/ifc-parser.wasm"
21
+ ],
22
+ "scripts": {
23
+ "dev": "vite",
24
+ "build": "tsc -b && vite build",
25
+ "build:lib": "vite build -c vite.lib.config.ts && tsc -p tsconfig.lib.json",
26
+ "lint": "eslint .",
27
+ "prepublishOnly": "npm run build:lib",
28
+ "preview": "vite preview"
29
+ },
30
+ "dependencies": {
31
+ "@react-three/drei": "^10.7.7",
32
+ "@react-three/fiber": "^9.6.1",
33
+ "@react-three/postprocessing": "^3.0.4",
34
+ "pako": "^2.1.0",
35
+ "postprocessing": "^6.39.1",
36
+ "three": "^0.184.0",
37
+ "three-mesh-bvh": "^0.9.9",
38
+ "web-ifc": "^0.0.77",
39
+ "zustand": "^5.0.13"
40
+ },
41
+ "peerDependencies": {
42
+ "react": "^19.2.5",
43
+ "react-dom": "^19.2.5"
44
+ },
45
+ "devDependencies": {
46
+ "@eslint/js": "^10.0.1",
47
+ "@loaders.gl/core": "^4.4.2",
48
+ "@loaders.gl/las": "^4.4.2",
49
+ "@math.gl/types": "^4.1.0",
50
+ "@react-three/drei": "^10.7.7",
51
+ "@react-three/fiber": "^9.6.1",
52
+ "@types/node": "^24.12.2",
53
+ "@types/pako": "^2.0.4",
54
+ "@types/react": "^19.2.14",
55
+ "@types/react-dom": "^19.2.3",
56
+ "@vitejs/plugin-react": "^6.0.1",
57
+ "eslint": "^10.2.1",
58
+ "eslint-plugin-react-hooks": "^7.1.1",
59
+ "eslint-plugin-react-refresh": "^0.5.2",
60
+ "globals": "^17.5.0",
61
+ "lil-gui": "^0.21.0",
62
+ "react": "^19.2.5",
63
+ "react-dom": "^19.2.5",
64
+ "typescript": "~6.0.2",
65
+ "typescript-eslint": "^8.58.2",
66
+ "vite": "^8.0.10"
67
+ }
68
68
  }