@vizbl/react-room-viewer 0.0.14
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/dist/components/Footer.d.ts +1 -0
- package/dist/components/FrameWidthTabsField.d.ts +2 -0
- package/dist/components/Header.d.ts +1 -0
- package/dist/components/LogoSign.d.ts +1 -0
- package/dist/components/MaterialSelectField.d.ts +2 -0
- package/dist/components/MaterialSwiper.d.ts +1 -0
- package/dist/components/MattingField.d.ts +2 -0
- package/dist/components/RoomSwiper.d.ts +1 -0
- package/dist/components/SceneControlls.d.ts +0 -0
- package/dist/components/Swiper.d.ts +5 -0
- package/dist/components/scene/components/AR.d.ts +2 -0
- package/dist/components/scene/components/CanvasCaptureBridge.d.ts +8 -0
- package/dist/components/scene/components/CanvasWrapper.d.ts +7 -0
- package/dist/components/scene/components/Carpet.d.ts +9 -0
- package/dist/components/scene/components/Frame.d.ts +6 -0
- package/dist/components/scene/components/FramePart.d.ts +8 -0
- package/dist/components/scene/components/Matting.d.ts +8 -0
- package/dist/components/scene/components/Plane.d.ts +7 -0
- package/dist/components/scene/components/Poster.d.ts +7 -0
- package/dist/components/scene/components/Room.d.ts +1 -0
- package/dist/components/scene/components/RoomBackground.d.ts +1 -0
- package/dist/components/scene/hooks/useCarpetCanvases.d.ts +7 -0
- package/dist/components/scene/hooks/useCarpetInference.d.ts +9 -0
- package/dist/components/scene/hooks/useSceneHelpers.d.ts +4 -0
- package/dist/components/scene/hooks/useWallPose.d.ts +7 -0
- package/dist/components/scene/index.d.ts +1 -0
- package/dist/components/scene/lib/canvas.d.ts +1 -0
- package/dist/components/scene/lib/carpet-inference-export.d.ts +8 -0
- package/dist/components/scene/lib/carpet-inference.d.ts +12 -0
- package/dist/components/scene/lib/carpet-lighting.d.ts +9 -0
- package/dist/components/scene/lib/carpet-mask.d.ts +8 -0
- package/dist/components/scene/lib/carpet-pose.d.ts +3 -0
- package/dist/components/scene/lib/carpet-processing.d.ts +3 -0
- package/dist/components/scene/lib/carpet-rendering.d.ts +5 -0
- package/dist/components/scene/lib/room-image.d.ts +1 -0
- package/dist/config/index.d.ts +14 -0
- package/dist/container.d.ts +1 -0
- package/dist/context.d.ts +46 -0
- package/dist/dialog.d.ts +5 -0
- package/dist/hooks/useFrameWidthOptions.d.ts +5 -0
- package/dist/hooks/useMattingOptions.d.ts +5 -0
- package/dist/i18n.d.ts +90 -0
- package/dist/index.css +5085 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +4029 -0
- package/dist/locales/en/ns1.d.ts +42 -0
- package/dist/locales/ru/ns1.d.ts +42 -0
- package/dist/root.d.ts +12 -0
- package/dist/types/index.d.ts +45 -0
- package/dist/utils/core.d.ts +7 -0
- package/dist/utils/device.d.ts +3 -0
- package/dist/utils/id.d.ts +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/room-helpers.d.ts +5 -0
- package/dist/utils/scene-load.d.ts +10 -0
- package/dist/utils/segmentation.d.ts +8 -0
- package/package.json +81 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
declare const ns1: {
|
|
2
|
+
readonly matting: "Matting";
|
|
3
|
+
readonly material: "Material";
|
|
4
|
+
readonly chooseMaterial: "Choose material";
|
|
5
|
+
readonly frameWidth: "Frame width";
|
|
6
|
+
readonly close: "Close";
|
|
7
|
+
readonly uploadOwnPhoto: "Upload your photo";
|
|
8
|
+
readonly previousSlide: "Previous slide";
|
|
9
|
+
readonly nextSlide: "Next slide";
|
|
10
|
+
readonly mattingOptions: {
|
|
11
|
+
readonly none: "None";
|
|
12
|
+
};
|
|
13
|
+
readonly units: {
|
|
14
|
+
readonly cm: "cm";
|
|
15
|
+
};
|
|
16
|
+
readonly poweredBy: "Powered by Vizbl";
|
|
17
|
+
readonly ar: {
|
|
18
|
+
readonly viewInPlace: "View in place";
|
|
19
|
+
readonly scanQrCode: "Scan this QR code with your phone's camera to view the object in Augmented Reality";
|
|
20
|
+
};
|
|
21
|
+
readonly shareMessage: {
|
|
22
|
+
readonly poster: "Preview poster";
|
|
23
|
+
readonly carpet: "Preview carpet";
|
|
24
|
+
};
|
|
25
|
+
readonly rooms: {
|
|
26
|
+
readonly 'room-example-1': "Living room";
|
|
27
|
+
readonly 'room-example-2': "Bedroom";
|
|
28
|
+
readonly 'room-example-3': "Kitchen";
|
|
29
|
+
readonly 'room-example-4': "Hallway";
|
|
30
|
+
readonly 'room-example-5': "Dining room";
|
|
31
|
+
readonly 'room-example-6': "Office";
|
|
32
|
+
};
|
|
33
|
+
readonly scene: {
|
|
34
|
+
readonly tunePosition: "Tune position";
|
|
35
|
+
readonly position: "Position";
|
|
36
|
+
readonly share: "Share";
|
|
37
|
+
readonly angle: "Angle";
|
|
38
|
+
readonly rotation: "Rotation";
|
|
39
|
+
readonly reset: "Reset";
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export default ns1;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
declare const ns1: {
|
|
2
|
+
readonly matting: "Паспарту";
|
|
3
|
+
readonly material: "Материал";
|
|
4
|
+
readonly chooseMaterial: "Выберите материал";
|
|
5
|
+
readonly frameWidth: "Ширина рамки";
|
|
6
|
+
readonly close: "Закрыть";
|
|
7
|
+
readonly uploadOwnPhoto: "Загрузить свое фото";
|
|
8
|
+
readonly previousSlide: "Предыдущий слайд";
|
|
9
|
+
readonly nextSlide: "Следующий слайд";
|
|
10
|
+
readonly mattingOptions: {
|
|
11
|
+
readonly none: "Нет";
|
|
12
|
+
};
|
|
13
|
+
readonly units: {
|
|
14
|
+
readonly cm: "см";
|
|
15
|
+
};
|
|
16
|
+
readonly poweredBy: "Технологии Аризо";
|
|
17
|
+
readonly ar: {
|
|
18
|
+
readonly viewInPlace: "Просмотреть на месте";
|
|
19
|
+
readonly scanQrCode: "Отсканируйте этот QR-код камерой телефона, чтобы просмотреть объект в дополненной реальности";
|
|
20
|
+
};
|
|
21
|
+
readonly shareMessage: {
|
|
22
|
+
readonly poster: "Примерить постер";
|
|
23
|
+
readonly carpet: "Примерить ковер";
|
|
24
|
+
};
|
|
25
|
+
readonly rooms: {
|
|
26
|
+
readonly 'room-example-1': "Гостиная";
|
|
27
|
+
readonly 'room-example-2': "Спальня";
|
|
28
|
+
readonly 'room-example-3': "Кухня";
|
|
29
|
+
readonly 'room-example-4': "Прихожая";
|
|
30
|
+
readonly 'room-example-5': "Столовая";
|
|
31
|
+
readonly 'room-example-6': "Кабинет";
|
|
32
|
+
};
|
|
33
|
+
readonly scene: {
|
|
34
|
+
readonly tunePosition: "Настроить положение";
|
|
35
|
+
readonly position: "Положение";
|
|
36
|
+
readonly share: "Поделиться";
|
|
37
|
+
readonly angle: "Угол";
|
|
38
|
+
readonly rotation: "Поворот";
|
|
39
|
+
readonly reset: "Сбросить";
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export default ns1;
|
package/dist/root.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RoomViewerLanguage } from './i18n';
|
|
2
|
+
import type { RoomViewerResourceType } from './types';
|
|
3
|
+
export interface RoomViewerRootProps {
|
|
4
|
+
type: RoomViewerResourceType;
|
|
5
|
+
src?: string;
|
|
6
|
+
tinuuid?: string;
|
|
7
|
+
name: string;
|
|
8
|
+
language?: RoomViewerLanguage;
|
|
9
|
+
width?: number;
|
|
10
|
+
height?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function RoomViewerRoot({ type, src, tinuuid, name, height, width, language }: RoomViewerRootProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type * as THREE from 'three';
|
|
2
|
+
export interface PlanePosition {
|
|
3
|
+
z: number;
|
|
4
|
+
pitchDeg: number;
|
|
5
|
+
rollDeg: number;
|
|
6
|
+
}
|
|
7
|
+
export interface SideConfig extends PlanePosition {
|
|
8
|
+
id: string;
|
|
9
|
+
}
|
|
10
|
+
export interface RoomConfig {
|
|
11
|
+
camera: {
|
|
12
|
+
fov: number;
|
|
13
|
+
};
|
|
14
|
+
maskUrl?: string;
|
|
15
|
+
floor: PlanePosition;
|
|
16
|
+
walls: SideConfig[];
|
|
17
|
+
}
|
|
18
|
+
export interface NormalizedRoomConfig {
|
|
19
|
+
camera: {
|
|
20
|
+
fov: number;
|
|
21
|
+
};
|
|
22
|
+
maskUrl?: string;
|
|
23
|
+
surfaces: SideConfig[];
|
|
24
|
+
}
|
|
25
|
+
export interface Room {
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
image: string;
|
|
29
|
+
config: NormalizedRoomConfig;
|
|
30
|
+
}
|
|
31
|
+
export type RoomViewerResourcePoster = 'poster';
|
|
32
|
+
export type RoomViewerResourceCarpet = 'carpet';
|
|
33
|
+
export type RoomViewerResourceType = RoomViewerResourcePoster | RoomViewerResourceCarpet;
|
|
34
|
+
export interface ResourcePose {
|
|
35
|
+
position: THREE.Vector3Tuple;
|
|
36
|
+
quaternion: THREE.QuaternionTuple;
|
|
37
|
+
}
|
|
38
|
+
export interface PlaneUserData {
|
|
39
|
+
surfaceId: string;
|
|
40
|
+
}
|
|
41
|
+
export interface SegmentationClassMap {
|
|
42
|
+
classes: Uint8Array;
|
|
43
|
+
width: number;
|
|
44
|
+
height: number;
|
|
45
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { NormalizedRoomConfig, RoomConfig } from '../types';
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
export declare function calculatePlanePose(z: number, pitchDeg: number, rollDeg: number, camera: THREE.Camera): {
|
|
4
|
+
position: THREE.Vector3Tuple;
|
|
5
|
+
quaternion: THREE.QuaternionTuple;
|
|
6
|
+
};
|
|
7
|
+
export declare function normalizeRoomConfig(config: RoomConfig): NormalizedRoomConfig;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getNextGlobalId(prefix: string): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RoomViewerResourceType } from '../types';
|
|
2
|
+
export interface SceneLoadState {
|
|
3
|
+
layoutReady: boolean;
|
|
4
|
+
placementReady: boolean;
|
|
5
|
+
materialReady: boolean;
|
|
6
|
+
artifactsReady: boolean;
|
|
7
|
+
assetsReady: boolean;
|
|
8
|
+
prepareReady: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function getInitialSceneLoadState(type: RoomViewerResourceType): SceneLoadState;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SegmentationClassMap } from '../types';
|
|
2
|
+
export declare const FLOOR_SEGMENTATION_CLASS = 2;
|
|
3
|
+
export declare const CARPET_SEGMENTATION_CLASS = 3;
|
|
4
|
+
export declare function isFloorOrCarpetSegmentationClass(classId: number): boolean;
|
|
5
|
+
export declare function getFloorOrCarpetMaskCentroid(mask: SegmentationClassMap): {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
} | null;
|
package/package.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vizbl/react-room-viewer",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.0.14",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./style.css": "./dist/index.css"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"react": "^19.0.0",
|
|
20
|
+
"react-dom": "^19.0.0"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@google/model-viewer": "4.2.0",
|
|
24
|
+
"@radix-ui/react-dialog": "1.1.15",
|
|
25
|
+
"@radix-ui/react-radio-group": "^1.3.8",
|
|
26
|
+
"@radix-ui/react-select": "^2.2.6",
|
|
27
|
+
"@radix-ui/react-separator": "1.1.8",
|
|
28
|
+
"@radix-ui/react-slot": "1.2.4",
|
|
29
|
+
"@radix-ui/react-tabs": "^1.0.4",
|
|
30
|
+
"@react-three/drei": "^10.7.7",
|
|
31
|
+
"@react-three/fiber": "^9.5.0",
|
|
32
|
+
"@tanstack/react-query": "5.90.12",
|
|
33
|
+
"axios": "^1.13.2",
|
|
34
|
+
"class-variance-authority": "0.7.1",
|
|
35
|
+
"clsx": "2.1.1",
|
|
36
|
+
"culori": "^4.0.2",
|
|
37
|
+
"framer-motion": "^12.29.2",
|
|
38
|
+
"i18next": "^25.6.3",
|
|
39
|
+
"i18next-browser-languagedetector": "8.2.0",
|
|
40
|
+
"lucide-react": "0.553.0",
|
|
41
|
+
"next-themes": "^0.4.6",
|
|
42
|
+
"qrcode": "^1.5.4",
|
|
43
|
+
"radix-ui": "1.4.3",
|
|
44
|
+
"react-i18next": "^16.3.5",
|
|
45
|
+
"react-intersection-observer": "^10.0.0",
|
|
46
|
+
"react-zoom-pan-pinch": "3.7.0",
|
|
47
|
+
"swiper": "^12.1.0",
|
|
48
|
+
"tailwind-merge": "3.4.0",
|
|
49
|
+
"three": "^0.182.0",
|
|
50
|
+
"ua-parser-js": "^2.0.9"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@microsoft/api-extractor": "^7.58.0",
|
|
54
|
+
"@rsbuild/core": "1.7.1",
|
|
55
|
+
"@rsbuild/plugin-react": "1.4.2",
|
|
56
|
+
"@rsdoctor/rspack-plugin": "^1.5.2",
|
|
57
|
+
"@rslib/core": "0.18.4",
|
|
58
|
+
"@tailwindcss/postcss": "4.1.17",
|
|
59
|
+
"@types/react": "^19.2.4",
|
|
60
|
+
"@types/react-dom": "19.2.3",
|
|
61
|
+
"@types/three": "0.181.0",
|
|
62
|
+
"eslint": "9.39.1",
|
|
63
|
+
"postcss-prefix-selector": "2.1.1",
|
|
64
|
+
"react": "^19.2.0",
|
|
65
|
+
"react-dom": "^19.2.0",
|
|
66
|
+
"tailwindcss": "4.1.17",
|
|
67
|
+
"typescript": "^5.9.3",
|
|
68
|
+
"@vizbl/api": "0.0.1",
|
|
69
|
+
"@vizbl/typescript-config": "0.0.0",
|
|
70
|
+
"@vizbl/eslint-config": "0.0.1",
|
|
71
|
+
"@vizbl/ui": "0.1.3"
|
|
72
|
+
},
|
|
73
|
+
"scripts": {
|
|
74
|
+
"dev": "rslib build --watch",
|
|
75
|
+
"build": "rslib build",
|
|
76
|
+
"typecheck": "tsc --noEmit",
|
|
77
|
+
"lint": "eslint .",
|
|
78
|
+
"lint:fix": "eslint . --fix",
|
|
79
|
+
"rsdoctor": "RSDOCTOR=true rslib build"
|
|
80
|
+
}
|
|
81
|
+
}
|