@thinkersteps_labs/3d-viewer-react-native 0.0.0-stage → 1.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.
Files changed (54) hide show
  1. package/dist/Viewer.d.ts +5 -0
  2. package/dist/Viewer.d.ts.map +1 -0
  3. package/dist/Viewer.js +73 -0
  4. package/dist/Viewer.js.map +1 -0
  5. package/dist/bridge/ar-launcher.d.ts +6 -0
  6. package/dist/bridge/ar-launcher.d.ts.map +1 -0
  7. package/dist/bridge/ar-launcher.js +18 -0
  8. package/dist/bridge/ar-launcher.js.map +1 -0
  9. package/dist/bridge/runtime-bundle.d.ts +2 -0
  10. package/dist/bridge/runtime-bundle.d.ts.map +1 -0
  11. package/dist/bridge/runtime-bundle.js +3 -0
  12. package/dist/bridge/runtime-bundle.js.map +1 -0
  13. package/dist/bridge/types.d.ts +110 -0
  14. package/dist/bridge/types.d.ts.map +1 -0
  15. package/dist/bridge/types.js +2 -0
  16. package/dist/bridge/types.js.map +1 -0
  17. package/dist/hooks/useViewerBridge.d.ts +16 -0
  18. package/dist/hooks/useViewerBridge.d.ts.map +1 -0
  19. package/dist/hooks/useViewerBridge.js +378 -0
  20. package/dist/hooks/useViewerBridge.js.map +1 -0
  21. package/dist/hooks/useViewerGestureLock.d.ts +23 -0
  22. package/dist/hooks/useViewerGestureLock.d.ts.map +1 -0
  23. package/dist/hooks/useViewerGestureLock.js +49 -0
  24. package/dist/hooks/useViewerGestureLock.js.map +1 -0
  25. package/dist/index.d.ts +9 -0
  26. package/dist/index.d.ts.map +1 -0
  27. package/dist/index.js +7 -0
  28. package/dist/index.js.map +1 -0
  29. package/dist/swatches/JewelryCustomizer.d.ts +13 -0
  30. package/dist/swatches/JewelryCustomizer.d.ts.map +1 -0
  31. package/dist/swatches/JewelryCustomizer.js +28 -0
  32. package/dist/swatches/JewelryCustomizer.js.map +1 -0
  33. package/dist/swatches/MetalSwatches.d.ts +13 -0
  34. package/dist/swatches/MetalSwatches.d.ts.map +1 -0
  35. package/dist/swatches/MetalSwatches.js +81 -0
  36. package/dist/swatches/MetalSwatches.js.map +1 -0
  37. package/dist/swatches/StoneSwatches.d.ts +13 -0
  38. package/dist/swatches/StoneSwatches.d.ts.map +1 -0
  39. package/dist/swatches/StoneSwatches.js +81 -0
  40. package/dist/swatches/StoneSwatches.js.map +1 -0
  41. package/dist/swatches/index.d.ts +5 -0
  42. package/dist/swatches/index.d.ts.map +1 -0
  43. package/dist/swatches/index.js +5 -0
  44. package/dist/swatches/index.js.map +1 -0
  45. package/dist/swatches/useJewelryCustomizer.d.ts +23 -0
  46. package/dist/swatches/useJewelryCustomizer.d.ts.map +1 -0
  47. package/dist/swatches/useJewelryCustomizer.js +25 -0
  48. package/dist/swatches/useJewelryCustomizer.js.map +1 -0
  49. package/dist/types.d.ts +66 -0
  50. package/dist/types.d.ts.map +1 -0
  51. package/dist/types.js +2 -0
  52. package/dist/types.js.map +1 -0
  53. package/package.json +48 -4
  54. package/README.md +0 -3
@@ -0,0 +1,378 @@
1
+ import { useCallback, useEffect, useRef, useState } from 'react';
2
+ import { AppState, Platform } from 'react-native';
3
+ import { launchPlatformAR } from '../bridge/ar-launcher.js';
4
+ const DEFAULT_RPC_TIMEOUT_MS = 15_000;
5
+ export function createViewerError(code, message, reqId) {
6
+ const err = new Error(message);
7
+ err.name = 'ViewerError';
8
+ err.code = code;
9
+ if (reqId)
10
+ err.reqId = reqId;
11
+ return err;
12
+ }
13
+ export function useViewerBridge(props) {
14
+ const webViewRef = useRef(null);
15
+ const isReadyRef = useRef(false);
16
+ const [isReady, setIsReady] = useState(false);
17
+ // Command queue for messages dispatched before VIEWER_READY
18
+ const commandQueueRef = useRef([]);
19
+ // Active RPC requests keyed by reqId
20
+ const pendingRequestsRef = useRef(new Map());
21
+ const reqCounterRef = useRef(0);
22
+ // Mutable cache of the latest state for crash recovery & fullscreen modal hydration
23
+ const lastKnownStateRef = useRef({
24
+ source: resolveSourceInput(props.source, props.src),
25
+ config: extractConfigFromProps(props),
26
+ });
27
+ // Keep latest callback refs to avoid stale closures in onMessage
28
+ const callbacksRef = useRef(props);
29
+ callbacksRef.current = props;
30
+ const sendCommand = useCallback((command) => {
31
+ // Update state cache for crash recovery / hydration
32
+ cacheOutboundCommand(command, lastKnownStateRef.current);
33
+ if (!isReadyRef.current || !webViewRef.current) {
34
+ commandQueueRef.current.push(command);
35
+ return;
36
+ }
37
+ webViewRef.current.postMessage(JSON.stringify(command));
38
+ }, []);
39
+ const flushCommandQueue = useCallback(() => {
40
+ if (!webViewRef.current || !isReadyRef.current)
41
+ return;
42
+ while (commandQueueRef.current.length > 0) {
43
+ const cmd = commandQueueRef.current.shift();
44
+ webViewRef.current.postMessage(JSON.stringify(cmd));
45
+ }
46
+ }, []);
47
+ const hydrateState = useCallback(() => {
48
+ if (!webViewRef.current || !isReadyRef.current)
49
+ return;
50
+ const { source, config } = lastKnownStateRef.current;
51
+ if (source) {
52
+ webViewRef.current.postMessage(JSON.stringify({ type: 'LOAD_MODEL', source }));
53
+ }
54
+ if (Object.keys(config).length > 0) {
55
+ webViewRef.current.postMessage(JSON.stringify({ type: 'APPLY_CONFIG', config }));
56
+ }
57
+ flushCommandQueue();
58
+ }, [flushCommandQueue]);
59
+ // Reject all pending RPC promises on unmount or crash
60
+ const clearPendingRequests = useCallback((reason) => {
61
+ pendingRequestsRef.current.forEach((pending, reqId) => {
62
+ clearTimeout(pending.timer);
63
+ pending.reject(createViewerError('BRIDGE_TIMEOUT', reason, reqId));
64
+ });
65
+ pendingRequestsRef.current.clear();
66
+ }, []);
67
+ // Inbound message handler from WebView
68
+ const handleMessage = useCallback((event) => {
69
+ let data;
70
+ try {
71
+ data = JSON.parse(event.nativeEvent.data);
72
+ }
73
+ catch {
74
+ return; // Ignore non-JSON messages
75
+ }
76
+ switch (data.type) {
77
+ case 'VIEWER_READY': {
78
+ isReadyRef.current = true;
79
+ setIsReady(true);
80
+ hydrateState();
81
+ break;
82
+ }
83
+ case 'VIEWER_LOADED': {
84
+ callbacksRef.current.onLoaded?.(data.parts, data.materials);
85
+ break;
86
+ }
87
+ case 'VIEWER_PROGRESS': {
88
+ callbacksRef.current.onProgress?.(data.progress);
89
+ break;
90
+ }
91
+ case 'PART_SELECTED': {
92
+ callbacksRef.current.onPartSelected?.({
93
+ meshId: data.meshId,
94
+ partId: data.partId,
95
+ type: data.partType,
96
+ });
97
+ break;
98
+ }
99
+ case 'INTERACTION_START': {
100
+ callbacksRef.current.onTouchInteractionChange?.(true);
101
+ break;
102
+ }
103
+ case 'INTERACTION_END': {
104
+ if (data.cameraState) {
105
+ lastKnownStateRef.current.config.cameraState = data.cameraState;
106
+ }
107
+ callbacksRef.current.onTouchInteractionChange?.(false);
108
+ break;
109
+ }
110
+ case 'SNAPSHOT_READY': {
111
+ const pending = pendingRequestsRef.current.get(data.reqId);
112
+ if (pending) {
113
+ clearTimeout(pending.timer);
114
+ pendingRequestsRef.current.delete(data.reqId);
115
+ pending.resolve(data.dataUrl);
116
+ }
117
+ break;
118
+ }
119
+ case 'AR_PAYLOAD_READY': {
120
+ const pending = pendingRequestsRef.current.get(data.reqId);
121
+ if (pending) {
122
+ clearTimeout(pending.timer);
123
+ pendingRequestsRef.current.delete(data.reqId);
124
+ pending.resolve(data);
125
+ }
126
+ break;
127
+ }
128
+ case 'VIEWER_ERROR': {
129
+ const viewerErr = createViewerError(data.code, data.message, data.reqId);
130
+ if (data.reqId && pendingRequestsRef.current.has(data.reqId)) {
131
+ const pending = pendingRequestsRef.current.get(data.reqId);
132
+ clearTimeout(pending.timer);
133
+ pendingRequestsRef.current.delete(data.reqId);
134
+ pending.reject(viewerErr);
135
+ }
136
+ callbacksRef.current.onError?.(viewerErr);
137
+ break;
138
+ }
139
+ }
140
+ }, [hydrateState]);
141
+ // Crash recovery handler for iOS WKWebView & Android RenderProcessGone
142
+ const handleWebViewProcessTerminated = useCallback(() => {
143
+ isReadyRef.current = false;
144
+ setIsReady(false);
145
+ clearPendingRequests('WebView GPU process terminated; reloading runtime.');
146
+ webViewRef.current?.reload();
147
+ }, [clearPendingRequests]);
148
+ // AppState lifecycle: pause render loop when backgrounded
149
+ useEffect(() => {
150
+ const subscription = AppState.addEventListener('change', (nextState) => {
151
+ if (!isReadyRef.current || !webViewRef.current)
152
+ return;
153
+ const shouldRender = nextState === 'active' && (callbacksRef.current.renderActive ?? true);
154
+ webViewRef.current.postMessage(JSON.stringify({
155
+ type: 'SET_RENDER_ACTIVE',
156
+ active: shouldRender,
157
+ }));
158
+ });
159
+ return () => {
160
+ subscription.remove();
161
+ clearPendingRequests('Viewer component unmounted.');
162
+ };
163
+ }, [clearPendingRequests]);
164
+ // Sync declarative prop changes to WebView
165
+ useEffect(() => {
166
+ const nextSource = resolveSourceInput(props.source, props.src);
167
+ if (nextSource &&
168
+ JSON.stringify(nextSource) !== JSON.stringify(lastKnownStateRef.current.source)) {
169
+ sendCommand({ type: 'LOAD_MODEL', source: nextSource });
170
+ }
171
+ }, [props.source, props.src, sendCommand]);
172
+ useEffect(() => {
173
+ const nextConfig = extractConfigFromProps(props);
174
+ lastKnownStateRef.current.config = {
175
+ ...lastKnownStateRef.current.config,
176
+ ...nextConfig,
177
+ };
178
+ if (isReadyRef.current) {
179
+ sendCommand({ type: 'APPLY_CONFIG', config: nextConfig });
180
+ }
181
+ }, [
182
+ props.metalColor,
183
+ props.stoneColor,
184
+ props.materialColors,
185
+ props.partColors,
186
+ props.environment,
187
+ props.exposure,
188
+ props.quality,
189
+ props.autoRotate,
190
+ props.fov,
191
+ props.shadows,
192
+ props.background,
193
+ sendCommand,
194
+ ]);
195
+ useEffect(() => {
196
+ if (typeof props.renderActive === 'boolean' && isReadyRef.current) {
197
+ sendCommand({ type: 'SET_RENDER_ACTIVE', active: props.renderActive });
198
+ }
199
+ }, [props.renderActive, sendCommand]);
200
+ // Imperative ViewerRef API
201
+ const createRpcRequest = useCallback((buildCommand, timeoutMs = DEFAULT_RPC_TIMEOUT_MS) => {
202
+ return new Promise((resolve, reject) => {
203
+ const reqId = `req_${++reqCounterRef.current}_${Date.now()}`;
204
+ const timer = setTimeout(() => {
205
+ pendingRequestsRef.current.delete(reqId);
206
+ const err = createViewerError('BRIDGE_TIMEOUT', `WebView RPC request (${reqId}) timed out after ${timeoutMs}ms`, reqId);
207
+ callbacksRef.current.onError?.(err);
208
+ reject(err);
209
+ }, timeoutMs);
210
+ pendingRequestsRef.current.set(reqId, { resolve, reject, timer });
211
+ sendCommand(buildCommand(reqId));
212
+ });
213
+ }, [sendCommand]);
214
+ const viewerRefMethods = {
215
+ applyConfig: (config) => sendCommand({ type: 'APPLY_CONFIG', config }),
216
+ setMetalColor: (color) => sendCommand({ type: 'SET_METAL', color }),
217
+ setStoneColor: (color) => sendCommand({ type: 'SET_STONE', color }),
218
+ setMaterialColor: (slotId, color) => sendCommand({ type: 'SET_MATERIAL_COLOR', slotId, color }),
219
+ clearMaterialColor: (slotId) => sendCommand({ type: 'CLEAR_MATERIAL_COLOR', slotId }),
220
+ setPartColor: (partId, color, slotIndex) => sendCommand({ type: 'SET_PART_COLOR', partId, color, slotIndex }),
221
+ clearPartColor: (partId, slotIndex) => sendCommand({ type: 'CLEAR_PART_COLOR', partId, slotIndex }),
222
+ setEnvironment: (environment, exposure) => sendCommand({ type: 'SET_ENVIRONMENT', environment, exposure }),
223
+ setRenderActive: (active) => sendCommand({ type: 'SET_RENDER_ACTIVE', active }),
224
+ startRotation: () => sendCommand({ type: 'SET_AUTO_ROTATE', enabled: true }),
225
+ stopRotation: () => sendCommand({ type: 'SET_AUTO_ROTATE', enabled: false }),
226
+ resetCamera: () => sendCommand({ type: 'RESET_CAMERA' }),
227
+ captureSnapshot: (options) => createRpcRequest((reqId) => ({
228
+ type: 'CAPTURE_SNAPSHOT',
229
+ reqId,
230
+ format: options?.format ?? 'png',
231
+ quality: options?.quality ?? 0.92,
232
+ })),
233
+ launchAR: async () => {
234
+ const platform = Platform.OS === 'ios' ? 'ios' : 'android';
235
+ const arSource = callbacksRef.current.arSource;
236
+ if (platform === 'ios') {
237
+ const usdzUrl = arSource?.iosUsdzUrl;
238
+ if (!usdzUrl) {
239
+ const err = createViewerError('AR_UNSUPPORTED', 'iOS AR Quick Look requires arSource.iosUsdzUrl (.usdz) to be provided.');
240
+ callbacksRef.current.onError?.(err);
241
+ throw err;
242
+ }
243
+ // Attempt in-WebView <a rel="ar"> launch first, fallback to Linking
244
+ const res = await createRpcRequest((reqId) => ({
245
+ type: 'EXPORT_AR_PAYLOAD',
246
+ reqId,
247
+ platform: 'ios',
248
+ usdzUrl,
249
+ }));
250
+ if (!res.launchedInWebView) {
251
+ await launchPlatformAR({ platform: 'ios', url: usdzUrl });
252
+ }
253
+ return;
254
+ }
255
+ // Android Scene Viewer flow
256
+ const fallbackGlb = arSource?.androidGlbUrl ?? extractStringUrl(lastKnownStateRef.current.source);
257
+ if (!fallbackGlb || !fallbackGlb.startsWith('https://')) {
258
+ const err = createViewerError('AR_UNSUPPORTED', 'Android Scene Viewer requires a public https:// GLB URL via arSource.androidGlbUrl or source.');
259
+ callbacksRef.current.onError?.(err);
260
+ throw err;
261
+ }
262
+ await launchPlatformAR({ platform: 'android', url: fallbackGlb });
263
+ },
264
+ };
265
+ return {
266
+ webViewRef,
267
+ isReady,
268
+ viewerRefMethods,
269
+ handleMessage,
270
+ handleWebViewProcessTerminated,
271
+ lastKnownStateRef,
272
+ };
273
+ }
274
+ // --- Internal Helpers ---
275
+ function resolveSourceInput(source, src) {
276
+ if (source) {
277
+ if (typeof source === 'object' && 'uri' in source && !('url' in source)) {
278
+ return { url: source.uri };
279
+ }
280
+ return source;
281
+ }
282
+ if (src)
283
+ return { url: src };
284
+ return undefined;
285
+ }
286
+ function extractStringUrl(source) {
287
+ if (!source)
288
+ return undefined;
289
+ if (typeof source === 'string')
290
+ return source;
291
+ if (typeof source === 'object' && 'url' in source && typeof source.url === 'string') {
292
+ return source.url;
293
+ }
294
+ return undefined;
295
+ }
296
+ function extractConfigFromProps(props) {
297
+ const config = {};
298
+ if (props.metalColor !== undefined)
299
+ config.metalColor = props.metalColor;
300
+ if (props.stoneColor !== undefined)
301
+ config.stoneColor = props.stoneColor;
302
+ if (props.materialColors !== undefined)
303
+ config.materialColors = props.materialColors;
304
+ if (props.partColors !== undefined)
305
+ config.partColors = props.partColors;
306
+ if (props.environment !== undefined)
307
+ config.environment = props.environment;
308
+ if (props.exposure !== undefined)
309
+ config.exposure = props.exposure;
310
+ if (props.quality !== undefined)
311
+ config.quality = props.quality;
312
+ if (props.autoRotate !== undefined)
313
+ config.autoRotate = props.autoRotate;
314
+ if (props.fov !== undefined)
315
+ config.fov = props.fov;
316
+ if (props.shadows !== undefined)
317
+ config.shadows = props.shadows;
318
+ if (props.background !== undefined)
319
+ config.background = props.background;
320
+ return config;
321
+ }
322
+ function cacheOutboundCommand(cmd, state) {
323
+ switch (cmd.type) {
324
+ case 'LOAD_MODEL':
325
+ state.source = cmd.source;
326
+ break;
327
+ case 'APPLY_CONFIG':
328
+ state.config = { ...state.config, ...cmd.config };
329
+ break;
330
+ case 'SET_METAL':
331
+ state.config.metalColor = cmd.color;
332
+ break;
333
+ case 'SET_STONE':
334
+ state.config.stoneColor = cmd.color;
335
+ break;
336
+ case 'SET_MATERIAL_COLOR':
337
+ state.config.materialColors = {
338
+ ...state.config.materialColors,
339
+ [cmd.slotId]: cmd.color,
340
+ };
341
+ break;
342
+ case 'CLEAR_MATERIAL_COLOR':
343
+ if (state.config.materialColors) {
344
+ const next = { ...state.config.materialColors };
345
+ delete next[cmd.slotId];
346
+ state.config.materialColors = next;
347
+ }
348
+ break;
349
+ case 'SET_PART_COLOR':
350
+ state.config.partColors = {
351
+ ...state.config.partColors,
352
+ [cmd.partId]: cmd.color,
353
+ };
354
+ break;
355
+ case 'CLEAR_PART_COLOR':
356
+ if (state.config.partColors) {
357
+ const next = { ...state.config.partColors };
358
+ delete next[cmd.partId];
359
+ state.config.partColors = next;
360
+ }
361
+ break;
362
+ case 'SET_ENVIRONMENT':
363
+ state.config.environment = cmd.environment;
364
+ if (cmd.exposure !== undefined)
365
+ state.config.exposure = cmd.exposure;
366
+ break;
367
+ case 'SET_AUTO_ROTATE':
368
+ state.config.autoRotate = cmd.enabled;
369
+ break;
370
+ case 'SET_QUALITY':
371
+ state.config.quality = cmd.quality;
372
+ break;
373
+ case 'RESET_CAMERA':
374
+ delete state.config.cameraState;
375
+ break;
376
+ }
377
+ }
378
+ //# sourceMappingURL=useViewerBridge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useViewerBridge.js","sourceRoot":"","sources":["../../src/hooks/useViewerBridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAkBjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAQ3D,MAAM,sBAAsB,GAAG,MAAM,CAAA;AAErC,MAAM,UAAU,iBAAiB,CAC/B,IAAqB,EACrB,OAAe,EACf,KAAc;IAEd,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,OAAO,CAAgB,CAAA;IAC7C,GAAG,CAAC,IAAI,GAAG,aAAa,CAAA;IACxB,GAAG,CAAC,IAAI,GAAG,IAAI,CAAA;IACf,IAAI,KAAK;QAAE,GAAG,CAAC,KAAK,GAAG,KAAK,CAAA;IAC5B,OAAO,GAAG,CAAA;AACZ,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAkB;IAChD,MAAM,UAAU,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAA;IAC/C,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;IAChC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAE7C,4DAA4D;IAC5D,MAAM,eAAe,GAAG,MAAM,CAAoB,EAAE,CAAC,CAAA;IA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CAAA;YACD,MAAK;QACP,KAAK,kBAAkB;YACrB,IAAI,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;gBAC5B,MAAM,IAAI,GAAG,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,CAAA;gBAC3C,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;gBACvB,KAAK,CAAC,MAAM,CAAC,UAAU,GAAG,IAAI,CAAA;YAChC,CAAC;YACD,MAAK;QACP,KAAK,iBAAiB;YACpB,KAAK,CAAC,MAAM,CAAC,WAAW,GAAG,GAAG,CAAC,WAAW,CAAA;YAC1C,IAAI,GAAG,CAAC,QAAQ,KAAK,SAAS;gBAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAA;YACpE,MAAK;QACP,KAAK,iBAAiB;YACpB,KAAK,CAAC,MAAM,CAAC,UAAU,GAAG,GAAG,CAAC,OAAO,CAAA;YACrC,MAAK;QACP,KAAK,aAAa;YAChB,KAAK,CAAC,MAAM,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAA;YAClC,MAAK;QACP,KAAK,cAAc;YACjB,OAAO,KAAK,CAAC,MAAM,CAAC,WAAW,CAAA;YAC/B,MAAK;IACT,CAAC;AACH,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { GestureResponderEvent } from 'react-native';
2
+ export interface UseViewerGestureLockOptions {
3
+ /** Ref to the parent ScrollView or FlatList */
4
+ scrollRef?: React.RefObject<{
5
+ setNativeProps?: (props: Record<string, unknown>) => void;
6
+ } | null>;
7
+ /** Optional callback fired when touch interaction begins or ends */
8
+ onTouchInteractionChange?: (isInteracting: boolean) => void;
9
+ /** Whether gesture locking is enabled (default: true) */
10
+ enabled?: boolean;
11
+ }
12
+ export interface UseViewerGestureLockReturn {
13
+ isInteracting: boolean;
14
+ lockScroll: () => void;
15
+ unlockScroll: () => void;
16
+ containerTouchProps: {
17
+ onTouchStart: (e: GestureResponderEvent) => void;
18
+ onTouchEnd: (e: GestureResponderEvent) => void;
19
+ onTouchCancel: (e: GestureResponderEvent) => void;
20
+ };
21
+ }
22
+ export declare function useViewerGestureLock({ scrollRef, onTouchInteractionChange, enabled, }?: UseViewerGestureLockOptions): UseViewerGestureLockReturn;
23
+ //# sourceMappingURL=useViewerGestureLock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useViewerGestureLock.d.ts","sourceRoot":"","sources":["../../src/hooks/useViewerGestureLock.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAEzD,MAAM,WAAW,2BAA2B;IAC1C,+CAA+C;IAC/C,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QAAE,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC,CAAA;IACjG,oEAAoE;IACpE,wBAAwB,CAAC,EAAE,CAAC,aAAa,EAAE,OAAO,KAAK,IAAI,CAAA;IAC3D,yDAAyD;IACzD,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,0BAA0B;IACzC,aAAa,EAAE,OAAO,CAAA;IACtB,UAAU,EAAE,MAAM,IAAI,CAAA;IACtB,YAAY,EAAE,MAAM,IAAI,CAAA;IACxB,mBAAmB,EAAE;QACnB,YAAY,EAAE,CAAC,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAA;QAChD,UAAU,EAAE,CAAC,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAA;QAC9C,aAAa,EAAE,CAAC,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAA;KAClD,CAAA;CACF;AAED,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,wBAAwB,EACxB,OAAc,GACf,GAAE,2BAAgC,GAAG,0BAA0B,CAqD/D"}
@@ -0,0 +1,49 @@
1
+ import { useCallback, useRef, useState } from 'react';
2
+ export function useViewerGestureLock({ scrollRef, onTouchInteractionChange, enabled = true, } = {}) {
3
+ const [isInteracting, setIsInteracting] = useState(false);
4
+ const isLockedRef = useRef(false);
5
+ const setParentScrollEnabled = useCallback((scrollEnabled) => {
6
+ if (!scrollRef?.current)
7
+ return;
8
+ // Synchronously disable/enable parent native ScrollView on the UI thread
9
+ if (typeof scrollRef.current.setNativeProps === 'function') {
10
+ scrollRef.current.setNativeProps({ scrollEnabled });
11
+ }
12
+ }, [scrollRef]);
13
+ const lockScroll = useCallback(() => {
14
+ if (!enabled || isLockedRef.current)
15
+ return;
16
+ isLockedRef.current = true;
17
+ setParentScrollEnabled(false);
18
+ setIsInteracting(true);
19
+ onTouchInteractionChange?.(true);
20
+ }, [enabled, setParentScrollEnabled, onTouchInteractionChange]);
21
+ const unlockScroll = useCallback(() => {
22
+ if (!isLockedRef.current)
23
+ return;
24
+ isLockedRef.current = false;
25
+ setParentScrollEnabled(true);
26
+ setIsInteracting(false);
27
+ onTouchInteractionChange?.(false);
28
+ }, [setParentScrollEnabled, onTouchInteractionChange]);
29
+ const onTouchStart = useCallback(() => {
30
+ lockScroll();
31
+ }, [lockScroll]);
32
+ const onTouchEnd = useCallback(() => {
33
+ unlockScroll();
34
+ }, [unlockScroll]);
35
+ const onTouchCancel = useCallback(() => {
36
+ unlockScroll();
37
+ }, [unlockScroll]);
38
+ return {
39
+ isInteracting,
40
+ lockScroll,
41
+ unlockScroll,
42
+ containerTouchProps: {
43
+ onTouchStart,
44
+ onTouchEnd,
45
+ onTouchCancel,
46
+ },
47
+ };
48
+ }
49
+ //# sourceMappingURL=useViewerGestureLock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useViewerGestureLock.js","sourceRoot":"","sources":["../../src/hooks/useViewerGestureLock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAuBrD,MAAM,UAA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,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE;QACpC,UAAU,EAAE,CAAA;IACd,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAA;IAEhB,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE;QAClC,YAAY,EAAE,CAAA;IAChB,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAA;IAElB,MAAM,aAAa,GAAG,WAAW,CAAC,GAAG,EAAE;QACrC,YAAY,EAAE,CAAA;IAChB,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAA;IAElB,OAAO;QACL,aAAa;QACb,UAAU;QACV,YAAY;QACZ,mBAAmB,EAAE;YACnB,YAAY;YACZ,UAAU;YACV,aAAa;SACd;KACF,CAAA;AACH,CAAC"}
@@ -0,0 +1,9 @@
1
+ export { Viewer, default } from './Viewer.js';
2
+ export type { ViewerProps, ViewerRef, ViewerError, ViewerErrorCode, MetalColorProp, StoneColorProp, ViewerSourceInput, PartInfo, MaterialSlotInfo, PartType, ViewerState, } from './types.js';
3
+ export type { ViewerConfigState, CameraSphericalState, OutboundCommand, InboundEvent, } from './bridge/types.js';
4
+ export { useViewerBridge } from './hooks/useViewerBridge.js';
5
+ export { useViewerGestureLock } from './hooks/useViewerGestureLock.js';
6
+ export { launchPlatformAR, buildAndroidSceneViewerIntent } from './bridge/ar-launcher.js';
7
+ export { DEFAULT_EMBEDDED_HTML } from './bridge/runtime-bundle.js';
8
+ export { MetalSwatches, type MetalSwatchesProps, StoneSwatches, type StoneSwatchesProps, useJewelryCustomizer, type UseJewelryCustomizerOptions, type UseJewelryCustomizerReturn, JewelryCustomizer, type JewelryCustomizerProps, } from './swatches/index.js';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC7C,YAAY,EACV,WAAW,EACX,SAAS,EACT,WAAW,EACX,eAAe,EACf,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,QAAQ,EACR,gBAAgB,EAChB,QAAQ,EACR,WAAW,GACZ,MAAM,YAAY,CAAA;AAEnB,YAAY,EACV,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,YAAY,GACb,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AACtE,OAAO,EAAE,gBAAgB,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAA;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAElE,OAAO,EACL,aAAa,EACb,KAAK,kBAAkB,EACvB,aAAa,EACb,KAAK,kBAAkB,EACvB,oBAAoB,EACpB,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAC/B,iBAAiB,EACjB,KAAK,sBAAsB,GAC5B,MAAM,qBAAqB,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ export { Viewer, default } from './Viewer.js';
2
+ export { useViewerBridge } from './hooks/useViewerBridge.js';
3
+ export { useViewerGestureLock } from './hooks/useViewerGestureLock.js';
4
+ export { launchPlatformAR, buildAndroidSceneViewerIntent } from './bridge/ar-launcher.js';
5
+ export { DEFAULT_EMBEDDED_HTML } from './bridge/runtime-bundle.js';
6
+ export { MetalSwatches, StoneSwatches, useJewelryCustomizer, JewelryCustomizer, } from './swatches/index.js';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAsB7C,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AACtE,OAAO,EAAE,gBAAgB,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAA;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAElE,OAAO,EACL,aAAa,EAEb,aAAa,EAEb,oBAAoB,EAGpB,iBAAiB,GAElB,MAAM,qBAAqB,CAAA"}
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { type StyleProp, type ViewStyle } from 'react-native';
3
+ import type { ViewerProps, ViewerRef } from '../types.js';
4
+ import { type UseJewelryCustomizerOptions } from './useJewelryCustomizer.js';
5
+ export interface JewelryCustomizerProps extends Omit<ViewerProps, 'metalColor' | 'stoneColor'>, UseJewelryCustomizerOptions {
6
+ containerStyle?: StyleProp<ViewStyle>;
7
+ viewerHeight?: number;
8
+ showMetalSwatches?: boolean;
9
+ showStoneSwatches?: boolean;
10
+ }
11
+ export declare const JewelryCustomizer: React.ForwardRefExoticComponent<JewelryCustomizerProps & React.RefAttributes<ViewerRef>>;
12
+ export default JewelryCustomizer;
13
+ //# sourceMappingURL=JewelryCustomizer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JewelryCustomizer.d.ts","sourceRoot":"","sources":["../../src/swatches/JewelryCustomizer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAIzD,OAAO,EAEL,KAAK,2BAA2B,EACjC,MAAM,2BAA2B,CAAA;AAElC,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,WAAW,EAAE,YAAY,GAAG,YAAY,CAAC,EACpD,2BAA2B;IAC7B,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IACrC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAC5B;AAED,eAAO,MAAM,iBAAiB,0FAqD7B,CAAA;AAYD,eAAe,iBAAiB,CAAA"}
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ import { View, StyleSheet, } from 'react-native';
4
+ import { Viewer } from '../Viewer.js';
5
+ import { MetalSwatches } from './MetalSwatches.js';
6
+ import { StoneSwatches } from './StoneSwatches.js';
7
+ import { useJewelryCustomizer, } from './useJewelryCustomizer.js';
8
+ export const JewelryCustomizer = forwardRef(function JewelryCustomizer(props, ref) {
9
+ const { defaultMetal, defaultStone, metalOptions, stoneOptions, containerStyle, viewerHeight = 360, showMetalSwatches = true, showStoneSwatches = true, style, ...viewerRest } = props;
10
+ const customizer = useJewelryCustomizer({
11
+ defaultMetal,
12
+ defaultStone,
13
+ metalOptions,
14
+ stoneOptions,
15
+ });
16
+ return (_jsxs(View, { style: [styles.container, containerStyle], children: [_jsx(View, { style: [{ height: viewerHeight }, style], children: _jsx(Viewer, { ref: ref, metalColor: customizer.metal, stoneColor: customizer.stone, ...viewerRest }) }), _jsxs(View, { style: styles.controls, children: [showMetalSwatches && (_jsx(MetalSwatches, { value: customizer.metal, onChange: (metalId) => customizer.setMetal(metalId), options: customizer.metalOptions })), showStoneSwatches && (_jsx(StoneSwatches, { value: customizer.stone, onChange: (stoneId) => customizer.setStone(stoneId), options: customizer.stoneOptions }))] })] }));
17
+ });
18
+ const styles = StyleSheet.create({
19
+ container: {
20
+ width: '100%',
21
+ },
22
+ controls: {
23
+ paddingHorizontal: 12,
24
+ paddingTop: 8,
25
+ },
26
+ });
27
+ export default JewelryCustomizer;
28
+ //# sourceMappingURL=JewelryCustomizer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JewelryCustomizer.js","sourceRoot":"","sources":["../../src/swatches/JewelryCustomizer.ts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CAAC,OAAO,CAAC,EACnD,OAAO,EAAE,UAAU,CAAC,YAAY,GAChC,CACH,EAEA,iBAAiB,IAAI,CACpB,KAAC,aAAa,IACZ,KAAK,EAAE,UAAU,CAAC,KAAK,EACvB,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,EACnD,OAAO,EAAE,UAAU,CAAC,YAAY,GAChC,CACH,IACI,IACF,CACR,CAAA;AACH,CAAC,CACF,CAAA;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,KAAK,EAAE,MAAM;KACd;IACD,QAAQ,EAAE;QACR,iBAAiB,EAAE,EAAE;QACrB,UAAU,EAAE,CAAC;KACd;CACF,CAAC,CAAA;AAEF,eAAe,iBAAiB,CAAA"}
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { type StyleProp, type ViewStyle } from 'react-native';
3
+ import { type MetalPreset, type MetalColorProp } from '@thinkersteps_labs/3d-viewer-core';
4
+ export interface MetalSwatchesProps {
5
+ value?: MetalColorProp;
6
+ onChange?: (metalId: string, preset?: MetalPreset) => void;
7
+ options?: MetalPreset[];
8
+ category?: 'all' | 'gold' | 'platinum-silver' | 'alternative';
9
+ showLabel?: boolean;
10
+ style?: StyleProp<ViewStyle>;
11
+ }
12
+ export declare function MetalSwatches({ value, onChange, options, category, showLabel, style, }: MetalSwatchesProps): React.JSX.Element;
13
+ //# sourceMappingURL=MetalSwatches.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MetalSwatches.d.ts","sourceRoot":"","sources":["../../src/swatches/MetalSwatches.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAML,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAA;AACrB,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,cAAc,EACpB,MAAM,mCAAmC,CAAA;AAE1C,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,cAAc,CAAA;IACtB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,IAAI,CAAA;IAC1D,OAAO,CAAC,EAAE,WAAW,EAAE,CAAA;IACvB,QAAQ,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,iBAAiB,GAAG,aAAa,CAAA;IAC7D,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAC7B;AAED,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,QAAQ,EACR,OAAiC,EACjC,QAAgB,EAChB,SAAgB,EAChB,KAAK,GACN,EAAE,kBAAkB,qBA2DpB"}