@thinkersteps_labs/3d-viewer-react-native 0.0.0-stage → 2.0.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.
- package/dist/Viewer.d.ts +5 -0
- package/dist/Viewer.d.ts.map +1 -0
- package/dist/Viewer.js +157 -0
- package/dist/Viewer.js.map +1 -0
- package/dist/bridge/ar-launcher.d.ts +6 -0
- package/dist/bridge/ar-launcher.d.ts.map +1 -0
- package/dist/bridge/ar-launcher.js +18 -0
- package/dist/bridge/ar-launcher.js.map +1 -0
- package/dist/bridge/runtime-bundle.d.ts +2 -0
- package/dist/bridge/runtime-bundle.d.ts.map +1 -0
- package/dist/bridge/runtime-bundle.js +3 -0
- package/dist/bridge/runtime-bundle.js.map +1 -0
- package/dist/bridge/runtime-entry.d.ts +2 -0
- package/dist/bridge/runtime-entry.d.ts.map +1 -0
- package/dist/bridge/runtime-entry.js +616 -0
- package/dist/bridge/runtime-entry.js.map +1 -0
- package/dist/bridge/types.d.ts +186 -0
- package/dist/bridge/types.d.ts.map +1 -0
- package/dist/bridge/types.js +2 -0
- package/dist/bridge/types.js.map +1 -0
- package/dist/hooks/useViewerBridge.d.ts +16 -0
- package/dist/hooks/useViewerBridge.d.ts.map +1 -0
- package/dist/hooks/useViewerBridge.js +565 -0
- package/dist/hooks/useViewerBridge.js.map +1 -0
- package/dist/hooks/useViewerGestureLock.d.ts +23 -0
- package/dist/hooks/useViewerGestureLock.d.ts.map +1 -0
- package/dist/hooks/useViewerGestureLock.js +49 -0
- package/dist/hooks/useViewerGestureLock.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/swatches/JewelryCustomizer.d.ts +16 -0
- package/dist/swatches/JewelryCustomizer.d.ts.map +1 -0
- package/dist/swatches/JewelryCustomizer.js +36 -0
- package/dist/swatches/JewelryCustomizer.js.map +1 -0
- package/dist/swatches/MetalSwatches.d.ts +13 -0
- package/dist/swatches/MetalSwatches.d.ts.map +1 -0
- package/dist/swatches/MetalSwatches.js +81 -0
- package/dist/swatches/MetalSwatches.js.map +1 -0
- package/dist/swatches/ShapeSelect.d.ts +15 -0
- package/dist/swatches/ShapeSelect.d.ts.map +1 -0
- package/dist/swatches/ShapeSelect.js +226 -0
- package/dist/swatches/ShapeSelect.js.map +1 -0
- package/dist/swatches/ShapeSwatches.d.ts +22 -0
- package/dist/swatches/ShapeSwatches.d.ts.map +1 -0
- package/dist/swatches/ShapeSwatches.js +144 -0
- package/dist/swatches/ShapeSwatches.js.map +1 -0
- package/dist/swatches/StoneSwatches.d.ts +13 -0
- package/dist/swatches/StoneSwatches.d.ts.map +1 -0
- package/dist/swatches/StoneSwatches.js +81 -0
- package/dist/swatches/StoneSwatches.js.map +1 -0
- package/dist/swatches/index.d.ts +7 -0
- package/dist/swatches/index.d.ts.map +1 -0
- package/dist/swatches/index.js +7 -0
- package/dist/swatches/index.js.map +1 -0
- package/dist/swatches/useJewelryCustomizer.d.ts +33 -0
- package/dist/swatches/useJewelryCustomizer.d.ts.map +1 -0
- package/dist/swatches/useJewelryCustomizer.js +43 -0
- package/dist/swatches/useJewelryCustomizer.js.map +1 -0
- package/dist/types.d.ts +103 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +50 -6
- package/README.md +0 -3
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import type { MetalColorProp, StoneColorProp, DiamondShape, DiamondQuality, ViewerSourceInput, PartInfo, MaterialSlotInfo, PartType, ViewerErrorCode, ViewerState, CameraPreset } from '../types.js';
|
|
2
|
+
export interface CameraSphericalState {
|
|
3
|
+
radius: number;
|
|
4
|
+
phi: number;
|
|
5
|
+
theta: number;
|
|
6
|
+
target: [number, number, number];
|
|
7
|
+
}
|
|
8
|
+
export interface ViewerConfigState {
|
|
9
|
+
metalColor?: MetalColorProp;
|
|
10
|
+
stoneColor?: StoneColorProp;
|
|
11
|
+
shape?: DiamondShape | string;
|
|
12
|
+
materialColors?: Record<string, string>;
|
|
13
|
+
partColors?: Record<string, string>;
|
|
14
|
+
environment?: string;
|
|
15
|
+
exposure?: number;
|
|
16
|
+
metalEnvUrl?: string;
|
|
17
|
+
gemEnvUrl?: string;
|
|
18
|
+
quality?: 'low' | 'medium' | 'high';
|
|
19
|
+
diamondQuality?: DiamondQuality;
|
|
20
|
+
autoRotate?: boolean;
|
|
21
|
+
autoRotateSpeed?: number;
|
|
22
|
+
minZoom?: number;
|
|
23
|
+
maxZoom?: number;
|
|
24
|
+
fov?: number;
|
|
25
|
+
shadows?: boolean;
|
|
26
|
+
background?: string | number;
|
|
27
|
+
cameraState?: CameraSphericalState;
|
|
28
|
+
}
|
|
29
|
+
export type OutboundCommand = {
|
|
30
|
+
type: 'LOAD_MODEL';
|
|
31
|
+
source: ViewerSourceInput;
|
|
32
|
+
} | {
|
|
33
|
+
type: 'LOAD_MODULAR';
|
|
34
|
+
components: Record<string, any>;
|
|
35
|
+
options?: any;
|
|
36
|
+
} | {
|
|
37
|
+
type: 'LOAD_COMPONENT';
|
|
38
|
+
slot: string;
|
|
39
|
+
source: any;
|
|
40
|
+
options?: any;
|
|
41
|
+
} | {
|
|
42
|
+
type: 'APPLY_CONFIG';
|
|
43
|
+
config: Partial<ViewerConfigState>;
|
|
44
|
+
} | {
|
|
45
|
+
type: 'SET_METAL';
|
|
46
|
+
color: MetalColorProp;
|
|
47
|
+
} | {
|
|
48
|
+
type: 'SET_STONE';
|
|
49
|
+
color: StoneColorProp;
|
|
50
|
+
} | {
|
|
51
|
+
type: 'SET_SHAPE';
|
|
52
|
+
shape: DiamondShape | string;
|
|
53
|
+
} | {
|
|
54
|
+
type: 'SET_MATERIAL_COLOR';
|
|
55
|
+
slotId: string;
|
|
56
|
+
color: string;
|
|
57
|
+
} | {
|
|
58
|
+
type: 'CLEAR_MATERIAL_COLOR';
|
|
59
|
+
slotId: string;
|
|
60
|
+
} | {
|
|
61
|
+
type: 'SET_PART_COLOR';
|
|
62
|
+
partId: string;
|
|
63
|
+
color: string;
|
|
64
|
+
slotIndex?: number;
|
|
65
|
+
} | {
|
|
66
|
+
type: 'CLEAR_PART_COLOR';
|
|
67
|
+
partId: string;
|
|
68
|
+
slotIndex?: number;
|
|
69
|
+
} | {
|
|
70
|
+
type: 'SET_ENVIRONMENT';
|
|
71
|
+
environment?: string;
|
|
72
|
+
exposure?: number;
|
|
73
|
+
} | {
|
|
74
|
+
type: 'SET_METAL_ENVIRONMENT';
|
|
75
|
+
url: string;
|
|
76
|
+
} | {
|
|
77
|
+
type: 'SET_GEM_ENVIRONMENT';
|
|
78
|
+
url: string;
|
|
79
|
+
} | {
|
|
80
|
+
type: 'SET_AUTO_ROTATE';
|
|
81
|
+
enabled: boolean;
|
|
82
|
+
speed?: number;
|
|
83
|
+
} | {
|
|
84
|
+
type: 'SET_RENDER_ACTIVE';
|
|
85
|
+
active: boolean;
|
|
86
|
+
} | {
|
|
87
|
+
type: 'SET_QUALITY';
|
|
88
|
+
quality: 'low' | 'medium' | 'high';
|
|
89
|
+
} | {
|
|
90
|
+
type: 'RESET_CAMERA';
|
|
91
|
+
} | {
|
|
92
|
+
type: 'SET_CAMERA_PRESET';
|
|
93
|
+
preset: CameraPreset;
|
|
94
|
+
} | {
|
|
95
|
+
type: 'SET_CAMERA_POSITION';
|
|
96
|
+
position: [number, number, number];
|
|
97
|
+
target: [number, number, number];
|
|
98
|
+
} | {
|
|
99
|
+
type: 'CLEAR_OVERRIDES';
|
|
100
|
+
} | {
|
|
101
|
+
type: 'GET_STATE';
|
|
102
|
+
reqId: string;
|
|
103
|
+
} | {
|
|
104
|
+
type: 'SET_STATE';
|
|
105
|
+
state: ViewerState;
|
|
106
|
+
} | {
|
|
107
|
+
type: 'CAPTURE_SNAPSHOT';
|
|
108
|
+
reqId: string;
|
|
109
|
+
format?: 'png' | 'jpeg';
|
|
110
|
+
quality?: number;
|
|
111
|
+
} | {
|
|
112
|
+
type: 'EXPORT_AR_PAYLOAD';
|
|
113
|
+
reqId: string;
|
|
114
|
+
platform: 'ios' | 'android';
|
|
115
|
+
usdzUrl?: string;
|
|
116
|
+
} | {
|
|
117
|
+
type: 'SET_DIAMOND_QUALITY';
|
|
118
|
+
quality: DiamondQuality;
|
|
119
|
+
} | {
|
|
120
|
+
type: 'FIT_TO_SCENE';
|
|
121
|
+
} | {
|
|
122
|
+
type: 'UNLOAD';
|
|
123
|
+
} | {
|
|
124
|
+
type: 'SET_PART_TYPE';
|
|
125
|
+
meshId: string;
|
|
126
|
+
partType: PartType;
|
|
127
|
+
} | {
|
|
128
|
+
type: 'GET_PARTS';
|
|
129
|
+
reqId: string;
|
|
130
|
+
} | {
|
|
131
|
+
type: 'GET_MATERIALS';
|
|
132
|
+
reqId: string;
|
|
133
|
+
};
|
|
134
|
+
export type InboundEvent = {
|
|
135
|
+
type: 'VIEWER_READY';
|
|
136
|
+
} | {
|
|
137
|
+
type: 'VIEWER_LOADED';
|
|
138
|
+
parts: PartInfo[];
|
|
139
|
+
materials: MaterialSlotInfo[];
|
|
140
|
+
} | {
|
|
141
|
+
type: 'VIEWER_PROGRESS';
|
|
142
|
+
progress: number;
|
|
143
|
+
} | {
|
|
144
|
+
type: 'PART_SELECTED';
|
|
145
|
+
meshId: string;
|
|
146
|
+
partId?: string;
|
|
147
|
+
partType: PartType;
|
|
148
|
+
slotIndex?: number;
|
|
149
|
+
slotId?: string;
|
|
150
|
+
materialName?: string;
|
|
151
|
+
} | {
|
|
152
|
+
type: 'STATE_READY';
|
|
153
|
+
reqId: string;
|
|
154
|
+
state: ViewerState;
|
|
155
|
+
} | {
|
|
156
|
+
type: 'VIEWER_CHANGE';
|
|
157
|
+
state: ViewerState;
|
|
158
|
+
} | {
|
|
159
|
+
type: 'INTERACTION_START';
|
|
160
|
+
} | {
|
|
161
|
+
type: 'INTERACTION_END';
|
|
162
|
+
cameraState?: CameraSphericalState;
|
|
163
|
+
} | {
|
|
164
|
+
type: 'SNAPSHOT_READY';
|
|
165
|
+
reqId: string;
|
|
166
|
+
dataUrl: string;
|
|
167
|
+
} | {
|
|
168
|
+
type: 'AR_PAYLOAD_READY';
|
|
169
|
+
reqId: string;
|
|
170
|
+
url: string;
|
|
171
|
+
launchedInWebView?: boolean;
|
|
172
|
+
} | {
|
|
173
|
+
type: 'VIEWER_ERROR';
|
|
174
|
+
code: ViewerErrorCode;
|
|
175
|
+
message: string;
|
|
176
|
+
reqId?: string;
|
|
177
|
+
} | {
|
|
178
|
+
type: 'PARTS_READY';
|
|
179
|
+
reqId: string;
|
|
180
|
+
parts: PartInfo[];
|
|
181
|
+
} | {
|
|
182
|
+
type: 'MATERIALS_READY';
|
|
183
|
+
reqId: string;
|
|
184
|
+
materials: MaterialSlotInfo[];
|
|
185
|
+
};
|
|
186
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/bridge/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,QAAQ,EACR,gBAAgB,EAChB,QAAQ,EACR,eAAe,EACf,WAAW,EACX,YAAY,EACb,MAAM,aAAa,CAAA;AAEpB,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;CACjC;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,cAAc,CAAA;IAC3B,UAAU,CAAC,EAAE,cAAc,CAAA;IAC3B,KAAK,CAAC,EAAE,YAAY,GAAG,MAAM,CAAA;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACvC,UA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,CAAA;CAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/bridge/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { WebView, WebViewMessageEvent } from 'react-native-webview';
|
|
2
|
+
import type { ViewerConfigState } from '../bridge/types.js';
|
|
3
|
+
import type { ViewerProps, ViewerRef, ViewerError, ViewerErrorCode, ViewerSourceInput } from '../types.js';
|
|
4
|
+
export declare function createViewerError(code: ViewerErrorCode, message: string, reqId?: string): ViewerError;
|
|
5
|
+
export declare function useViewerBridge(props: ViewerProps): {
|
|
6
|
+
webViewRef: import("react").MutableRefObject<WebView<{}> | null>;
|
|
7
|
+
isReady: boolean;
|
|
8
|
+
viewerRefMethods: ViewerRef;
|
|
9
|
+
handleMessage: (event: WebViewMessageEvent) => void;
|
|
10
|
+
handleWebViewProcessTerminated: () => void;
|
|
11
|
+
lastKnownStateRef: import("react").MutableRefObject<{
|
|
12
|
+
source?: ViewerSourceInput;
|
|
13
|
+
config: ViewerConfigState;
|
|
14
|
+
}>;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=useViewerBridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useViewerBridge.d.ts","sourceRoot":"","sources":["../../src/hooks/useViewerBridge.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AACxE,OAAO,KAAK,EAGV,iBAAiB,EAElB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EACV,WAAW,EACX,SAAS,EACT,WAAW,EACX,eAAe,EACf,iBAAiB,EAWlB,MAAM,aAAa,CAAA;AAWpB,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,MAAM,GACb,WAAW,CAMb;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW;;;;2BA2EtC,mBAAmB;;;iBA7DlB,iBAAiB;gBAClB,iBAAiB;;EA8a5B"}
|