@velion-la/onboarding-sdk-react-native 1.2.0-beta.1 → 1.2.0-beta.10

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 (63) hide show
  1. package/README.md +47 -17
  2. package/lib/commonjs/camera/DocumentCapture.js +57 -35
  3. package/lib/commonjs/camera/DocumentCapture.js.map +1 -1
  4. package/lib/commonjs/camera/LivenessCamera.js +137 -86
  5. package/lib/commonjs/camera/LivenessCamera.js.map +1 -1
  6. package/lib/commonjs/camera/MapAddressPicker.js +1 -1
  7. package/lib/commonjs/camera/MapAddressPicker.js.map +1 -1
  8. package/lib/commonjs/steps/DocumentsOcrStep.js +140 -20
  9. package/lib/commonjs/steps/DocumentsOcrStep.js.map +1 -1
  10. package/lib/commonjs/steps/LivenessMatchStep.js +101 -39
  11. package/lib/commonjs/steps/LivenessMatchStep.js.map +1 -1
  12. package/lib/commonjs/transport/irisWebSocket.js +38 -3
  13. package/lib/commonjs/transport/irisWebSocket.js.map +1 -1
  14. package/lib/commonjs/ui/icons/StepIcon.js +8 -3
  15. package/lib/commonjs/ui/icons/StepIcon.js.map +1 -1
  16. package/lib/commonjs/ui/overlays/LoadingOverlay.js +1 -1
  17. package/lib/commonjs/ui/overlays/LoadingOverlay.js.map +1 -1
  18. package/lib/commonjs/ui/overlays/RetryDialog.js +1 -1
  19. package/lib/commonjs/ui/overlays/RetryDialog.js.map +1 -1
  20. package/lib/commonjs/utils/jpegFromUri.js +54 -14
  21. package/lib/commonjs/utils/jpegFromUri.js.map +1 -1
  22. package/lib/module/camera/DocumentCapture.js +58 -36
  23. package/lib/module/camera/DocumentCapture.js.map +1 -1
  24. package/lib/module/camera/LivenessCamera.js +138 -87
  25. package/lib/module/camera/LivenessCamera.js.map +1 -1
  26. package/lib/module/camera/MapAddressPicker.js +1 -1
  27. package/lib/module/camera/MapAddressPicker.js.map +1 -1
  28. package/lib/module/steps/DocumentsOcrStep.js +140 -20
  29. package/lib/module/steps/DocumentsOcrStep.js.map +1 -1
  30. package/lib/module/steps/LivenessMatchStep.js +102 -40
  31. package/lib/module/steps/LivenessMatchStep.js.map +1 -1
  32. package/lib/module/transport/irisWebSocket.js +38 -3
  33. package/lib/module/transport/irisWebSocket.js.map +1 -1
  34. package/lib/module/ui/icons/StepIcon.js +8 -3
  35. package/lib/module/ui/icons/StepIcon.js.map +1 -1
  36. package/lib/module/ui/overlays/LoadingOverlay.js +1 -1
  37. package/lib/module/ui/overlays/LoadingOverlay.js.map +1 -1
  38. package/lib/module/ui/overlays/RetryDialog.js +1 -1
  39. package/lib/module/ui/overlays/RetryDialog.js.map +1 -1
  40. package/lib/module/utils/jpegFromUri.js +52 -14
  41. package/lib/module/utils/jpegFromUri.js.map +1 -1
  42. package/lib/typescript/camera/DocumentCapture.d.ts +15 -3
  43. package/lib/typescript/camera/DocumentCapture.d.ts.map +1 -1
  44. package/lib/typescript/camera/LivenessCamera.d.ts +35 -9
  45. package/lib/typescript/camera/LivenessCamera.d.ts.map +1 -1
  46. package/lib/typescript/steps/DocumentsOcrStep.d.ts.map +1 -1
  47. package/lib/typescript/steps/LivenessMatchStep.d.ts.map +1 -1
  48. package/lib/typescript/transport/irisWebSocket.d.ts.map +1 -1
  49. package/lib/typescript/ui/icons/StepIcon.d.ts +7 -2
  50. package/lib/typescript/ui/icons/StepIcon.d.ts.map +1 -1
  51. package/lib/typescript/utils/jpegFromUri.d.ts +31 -10
  52. package/lib/typescript/utils/jpegFromUri.d.ts.map +1 -1
  53. package/package.json +20 -14
  54. package/src/camera/DocumentCapture.tsx +59 -41
  55. package/src/camera/LivenessCamera.tsx +159 -86
  56. package/src/camera/MapAddressPicker.tsx +1 -1
  57. package/src/steps/DocumentsOcrStep.tsx +160 -18
  58. package/src/steps/LivenessMatchStep.tsx +112 -47
  59. package/src/transport/irisWebSocket.ts +32 -2
  60. package/src/ui/icons/StepIcon.tsx +9 -3
  61. package/src/ui/overlays/LoadingOverlay.tsx +1 -1
  62. package/src/ui/overlays/RetryDialog.tsx +1 -1
  63. package/src/utils/jpegFromUri.ts +54 -16
@@ -1,6 +1,11 @@
1
1
  /**
2
- * @fileoverview StepIcon — small wrapper around `MaterialIcons` (shipped with
3
- * `@expo/vector-icons`, which Expo SDK 54 includes by default).
2
+ * @fileoverview StepIcon — small wrapper around `MaterialIcons`, shipped with
3
+ * `@expo/vector-icons`.
4
+ *
5
+ * That package is an OPTIONAL peer dependency the host installs itself. It
6
+ * used to arrive for free because `expo` depended on it, but `expo@57` dropped
7
+ * that dependency, so relying on it silently blanked every step icon
8
+ * (OSDKR-21). Nothing here assumes it is present.
4
9
  *
5
10
  * Steps pass an icon by name (e.g. `<StepIcon name="badge" />`) and the
6
11
  * shell renders it inside the colored circle next to the title. When the
@@ -1 +1 @@
1
- {"version":3,"file":"StepIcon.d.ts","sourceRoot":"","sources":["../../../../src/ui/icons/StepIcon.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,MAAM,MAAM,gBAAgB,GACxB,OAAO,GACP,UAAU,GACV,iBAAiB,GACjB,OAAO,GACP,aAAa,GACb,cAAc,GACd,QAAQ,GACR,MAAM,GACN,cAAc,GACd,cAAc,GACd,MAAM,GACN,cAAc,GACd,aAAa,GACb,cAAc,CAAC;AAsBnB,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,gBAAgB,CAAC;IACvB,+DAA+D;IAC/D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAS,EAAE,KAAiB,EAAE,EAAE,aAAa,+BAY7E"}
1
+ {"version":3,"file":"StepIcon.d.ts","sourceRoot":"","sources":["../../../../src/ui/icons/StepIcon.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH,MAAM,MAAM,gBAAgB,GACxB,OAAO,GACP,UAAU,GACV,iBAAiB,GACjB,OAAO,GACP,aAAa,GACb,cAAc,GACd,QAAQ,GACR,MAAM,GACN,cAAc,GACd,cAAc,GACd,MAAM,GACN,cAAc,GACd,aAAa,GACb,cAAc,CAAC;AAuBnB,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,gBAAgB,CAAC;IACvB,+DAA+D;IAC/D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAS,EAAE,KAAiB,EAAE,EAAE,aAAa,+BAY7E"}
@@ -5,14 +5,23 @@
5
5
  * path into either base64 (for the Iris HMAC envelope) or raw bytes (for
6
6
  * binary WebSocket frames + direct PUT to signed URLs).
7
7
  *
8
- * Why not `fetch(uri).then(r => r.blob()).then(b => b.arrayBuffer())`?
8
+ * Why not `fetch(uri)`?
9
9
  *
10
- * React Native's Blob polyfill does NOT implement `Blob.arrayBuffer()`
11
- * (it's web-only). Calling it crashes with
12
- * `TypeError: blob.arrayBuffer is not a function`. The reliable path on
13
- * iOS + Android is the native `File.arrayBuffer()` from
14
- * `expo-file-system` v19+, which reads directly from disk into an
15
- * ArrayBuffer without going through the JS Blob bridge.
10
+ * Two independent reasons, and the second one is the load-bearing one now:
11
+ *
12
+ * 1. React Native's Blob polyfill does NOT implement `Blob.arrayBuffer()`
13
+ * (it's web-only) — calling it throws `blob.arrayBuffer is not a
14
+ * function`.
15
+ * 2. **`fetch` cannot read local files at all since Expo SDK 57.** Expo now
16
+ * replaces the global `fetch` (`expo/src/winter/runtime.native.ts`:
17
+ * `install('fetch', ...)`) with a native HTTP client, and that client does
18
+ * not handle the `file://` scheme. It answers with an empty body instead
19
+ * of failing, so anything reading a capture through `fetch` silently
20
+ * uploads 0 bytes (OSDKR-22). SDK 54 did not install it, which is why the
21
+ * old code worked.
22
+ *
23
+ * `File.arrayBuffer()` from `expo-file-system` reads straight from disk and is
24
+ * unaffected by either.
16
25
  */
17
26
  export interface JpegFromUri {
18
27
  bytes: Uint8Array;
@@ -20,10 +29,22 @@ export interface JpegFromUri {
20
29
  byteLength: number;
21
30
  }
22
31
  /**
23
- * Reads a `file://` URI into JPEG bytes + base64 representation.
32
+ * Reads a local file into raw bytes.
24
33
  *
25
- * Accepts both forms vision-camera returns (`/var/mobile/...` without a
26
- * scheme on iOS; `file:///data/...` on Android). Normalises to `file://`.
34
+ * Prefer this over `readJpegFromUri` when the caller only needs the bytes —
35
+ * uploads, for instance. It skips the base64 encoding, which is pure waste for
36
+ * a multi-megabyte video.
37
+ */
38
+ export declare function readBytesFromUri(uri: string): Promise<Uint8Array>;
39
+ /**
40
+ * Size of a local file in bytes, or `0` when it cannot be read.
41
+ *
42
+ * Reads the filesystem metadata instead of loading the contents, so it stays
43
+ * cheap enough to call before an upload.
44
+ */
45
+ export declare function byteLengthOfUri(uri: string): number;
46
+ /**
47
+ * Reads a `file://` URI into JPEG bytes + base64 representation.
27
48
  */
28
49
  export declare function readJpegFromUri(uri: string): Promise<JpegFromUri>;
29
50
  //# sourceMappingURL=jpegFromUri.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"jpegFromUri.d.ts","sourceRoot":"","sources":["../../../src/utils/jpegFromUri.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CASvE"}
1
+ {"version":3,"file":"jpegFromUri.d.ts","sourceRoot":"","sources":["../../../src/utils/jpegFromUri.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAKH,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB;AAYD;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAGvE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAOnD;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAIvE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velion-la/onboarding-sdk-react-native",
3
- "version": "1.2.0-beta.1",
3
+ "version": "1.2.0-beta.10",
4
4
  "description": "Native React Native SDK for the Velion Onboarding (KYC) flow: ID document OCR, passive + active liveness, device fingerprint, OTP verification, address picker, and personal / legal information forms.",
5
5
  "main": "./lib/commonjs/index.js",
6
6
  "module": "./lib/module/index.js",
@@ -58,28 +58,34 @@
58
58
  },
59
59
  "dependencies": {
60
60
  "@noble/hashes": "^1.5.0",
61
- "expo-application": "~7.0.0",
62
- "expo-constants": "~18.0.0",
63
- "expo-crypto": "~15.0.0",
64
- "expo-device": "~8.0.0",
65
- "expo-file-system": "~19.0.0",
66
- "expo-image-manipulator": "~14.0.0",
67
- "expo-keep-awake": "~15.0.0",
68
- "expo-location": "~19.0.0",
61
+ "expo-application": "~57.0.2",
62
+ "expo-constants": "~57.0.17",
63
+ "expo-crypto": "~57.0.2",
64
+ "expo-device": "~57.0.1",
65
+ "expo-file-system": "~57.0.6",
66
+ "expo-image-manipulator": "~57.0.16",
67
+ "expo-keep-awake": "~57.0.1",
68
+ "expo-location": "~57.0.16",
69
69
  "react-native-sse": "^1.2.1"
70
70
  },
71
71
  "peerDependencies": {
72
+ "@expo/vector-icons": ">=15.0.0",
72
73
  "@fingerprintjs/fingerprintjs-pro-react-native": ">=3.0.0",
73
- "expo": ">=54.0.0",
74
- "react": ">=19.0.0",
75
- "react-native": ">=0.81.0",
74
+ "expo": ">=57.0.0",
75
+ "react": ">=19.2.0",
76
+ "react-native": ">=0.86.0",
76
77
  "react-native-keyboard-controller": ">=1.18.0",
77
78
  "react-native-maps": ">=1.20.0",
79
+ "react-native-nitro-image": ">=0.15.0",
80
+ "react-native-nitro-modules": ">=0.37.0",
78
81
  "react-native-safe-area-context": ">=4.0.0",
79
82
  "react-native-svg": ">=15.0.0",
80
- "react-native-vision-camera": ">=4.6.0"
83
+ "react-native-vision-camera": ">=5.0.0"
81
84
  },
82
85
  "peerDependenciesMeta": {
86
+ "@expo/vector-icons": {
87
+ "optional": true
88
+ },
83
89
  "@fingerprintjs/fingerprintjs-pro-react-native": {
84
90
  "optional": true
85
91
  },
@@ -92,7 +98,7 @@
92
98
  },
93
99
  "devDependencies": {
94
100
  "@types/jest": "^29.5.12",
95
- "@types/react": "~19.1.0",
101
+ "@types/react": "~19.2.0",
96
102
  "del-cli": "^6.0.0",
97
103
  "jest": "^29.7.0",
98
104
  "react-native-builder-bob": "^0.40.0",
@@ -1,9 +1,21 @@
1
1
  /**
2
2
  * @fileoverview Full-screen document camera with an ID-1 frame guide.
3
3
  *
4
- * Uses `react-native-vision-camera` v4 in `photo` mode. Tapping the shutter
5
- * triggers `takePhoto()` with `qualityPrioritization: 'balanced'`; the file
6
- * URI is returned to the caller via `onCaptured`.
4
+ * Uses `react-native-vision-camera` v5. The shutter calls
5
+ * `capturePhotoToFile()`, which writes the JPEG to a temporary file and hands
6
+ * its path to the caller via `onCaptured`.
7
+ *
8
+ * NOTE: only the photo output is passed to `<Camera outputs={...}>`. The
9
+ * preview is NOT listed there — `<Camera>` creates its own `usePreviewOutput()`
10
+ * and prepends it internally (`outputs: [previewOutput, ...outputs]`). Passing
11
+ * one explicitly adds a second preview against the same layer, and the session
12
+ * then refuses the duplicate connection with "cannot be added to Camera
13
+ * Session!", on every device (OSDKR-20).
14
+ *
15
+ * We deliberately use `capturePhotoToFile()` rather than `capturePhoto()`:
16
+ * the caller only ever needs a path to crop and upload, and the file variant
17
+ * avoids holding a native `Photo` buffer in JS that would have to be
18
+ * `dispose()`d by hand on every branch, including the error paths.
7
19
  *
8
20
  * Visual: dark scrim with a transparent rectangular cutout (ID-1 ratio). The
9
21
  * cutout is both the visible guide AND the crop region: on capture we hand the
@@ -27,6 +39,8 @@ import {
27
39
  Camera,
28
40
  useCameraDevice,
29
41
  useCameraPermission,
42
+ usePhotoOutput,
43
+ type CameraRef,
30
44
  type PhotoFile,
31
45
  } from 'react-native-vision-camera';
32
46
  import type { DocumentOrientation, DocumentSide } from '../types';
@@ -83,11 +97,15 @@ export function DocumentCapture({
83
97
  const theme = useTheme();
84
98
  const insets = useSafeAreaInsets();
85
99
  const { width: screenW, height: screenH } = useWindowDimensions();
86
- const cameraRef = useRef<Camera>(null);
100
+ const cameraRef = useRef<CameraRef>(null);
101
+ // `quality` over speed — this frame goes to the backend OCR, and a soft or
102
+ // over-compressed capture is the difference between a readable document and
103
+ // a rejected one. The default `UHD_4_3` target resolution is kept.
104
+ const photoOutput = usePhotoOutput({ qualityPrioritization: 'quality' });
87
105
  // Cross-platform back-camera selection.
88
106
  //
89
- // iOS (especially 15 Pro / Pro Max with multi-lens systems): asking for
90
- // just 'back' returns the *wide-angle* device, whose ~20 cm minimum focus
107
+ // iOS (especially Pro models with multi-lens systems): asking for just
108
+ // 'back' returns the *wide-angle* device, whose ~20 cm minimum focus
91
109
  // distance produces blurry frames when the user holds the ID closer.
92
110
  // Passing the `physicalDevices` array makes vision-camera pick the
93
111
  // *virtual multi-camera* device, which lets iOS auto-switch to the
@@ -100,11 +118,7 @@ export function DocumentCapture({
100
118
  // harm anything. Continuous AF is the default focus mode on both
101
119
  // platforms, so cross-platform behaviour stays consistent.
102
120
  const device = useCameraDevice('back', {
103
- physicalDevices: [
104
- 'ultra-wide-angle-camera',
105
- 'wide-angle-camera',
106
- 'telephoto-camera',
107
- ],
121
+ physicalDevices: ['ultra-wide-angle', 'wide-angle', 'telephoto'],
108
122
  });
109
123
  const { hasPermission, requestPermission } = useCameraPermission();
110
124
  const [requestedOnce, setRequestedOnce] = useState(false);
@@ -134,25 +148,30 @@ export function DocumentCapture({
134
148
  return () => clearTimeout(t);
135
149
  }, [device, hasPermission]);
136
150
 
137
- // NOTE: we intentionally do NOT call `cameraRef.current.focus()` on mount
138
- // or before each shutter. iOS's continuous auto-focus runs by default and
139
- // is what makes the native Camera app feel sharp at any distance. Calling
140
- // `focus()` switches the device into single-shot/locked mode and DOES NOT
141
- // restore continuous AF afterwards (vision-camera v4 has no "resume AF"
142
- // API). The previous "autofocus on mount" + "autofocus before shutter"
143
- // calls were the cause of blurry captures on iPhone 15 Pro Max: they
144
- // pinned focus to the centre even after the user moved the phone, and
145
- // never re-engaged continuous AF.
151
+ // NOTE: we intentionally do NOT call `focusTo()` on mount or before each
152
+ // shutter. iOS's continuous auto-focus runs by default and is what makes
153
+ // the native Camera app feel sharp at any distance. Focusing explicitly
154
+ // switches the device into single-shot/locked mode and does not restore
155
+ // continuous AF on its own. The previous "autofocus on mount" + "autofocus
156
+ // before shutter" calls were the cause of blurry captures on iPhone 15 Pro
157
+ // Max: they pinned focus to the centre even after the user moved the phone,
158
+ // and never re-engaged continuous AF.
159
+ //
160
+ // v5 does expose `CameraRef.resetFocus()` to return the device to
161
+ // continuous AF, but we deliberately don't call it after a tap: the tap is
162
+ // the user asking us to hold focus there, and auto-releasing it would fight
163
+ // that intent. Focus re-engages when the component remounts for the next
164
+ // side of the document.
146
165
  //
147
166
  // Tap-to-focus is the one user-initiated override — when the user taps,
148
167
  // they're explicitly asking us to lock focus on that point.
149
- const supportsFocus = Boolean(device?.supportsFocus);
168
+ const supportsFocus = Boolean(device?.supportsFocusMetering);
150
169
 
151
170
  const handleTapToFocus = useCallback(
152
171
  (event: { nativeEvent: { locationX: number; locationY: number } }) => {
153
172
  if (!supportsFocus || !cameraRef.current) return;
154
173
  const { locationX, locationY } = event.nativeEvent;
155
- cameraRef.current.focus({ x: locationX, y: locationY }).catch(() => {
174
+ cameraRef.current.focusTo({ x: locationX, y: locationY }).catch(() => {
156
175
  // Ignore — focus rejection is non-fatal.
157
176
  });
158
177
  setFocusPoint({ x: locationX, y: locationY, key: Date.now() });
@@ -172,10 +191,10 @@ export function DocumentCapture({
172
191
  setShooting(true);
173
192
  setError(null);
174
193
  try {
175
- const photo = await cameraRef.current.takePhoto({
176
- flash: 'off',
177
- enableShutterSound: false,
178
- });
194
+ const photo = await photoOutput.capturePhotoToFile(
195
+ { flashMode: 'off', enableShutterSound: false },
196
+ {},
197
+ );
179
198
  // Await the caller's crop/compress so the processing overlay stays up
180
199
  // for the whole capture→preview gap (a few seconds), giving the user
181
200
  // feedback instead of an idle camera. On success the parent flips phase
@@ -188,7 +207,7 @@ export function DocumentCapture({
188
207
  } finally {
189
208
  setShooting(false);
190
209
  }
191
- }, [onCaptured, side, shooting, orientation, screenW, screenH]);
210
+ }, [onCaptured, photoOutput, side, shooting, orientation, screenW, screenH]);
192
211
 
193
212
  if (!hasPermission) {
194
213
  return (
@@ -250,24 +269,23 @@ export function DocumentCapture({
250
269
  ref={cameraRef}
251
270
  style={StyleSheet.absoluteFill}
252
271
  device={device}
253
- photo
254
- photoQualityBalance="quality"
255
- // Lock the captured photo to the *preview's* orientation (OSDKR-13).
256
- // vision-camera defaults to `outputOrientation="device"`, which emits
257
- // the photo in whatever orientation the phone is physically held —
258
- // even though this screen is locked to portrait and both the preview
259
- // and the ID-1 guide stay portrait. A user tilting the phone sideways
260
- // to frame a landscape card therefore got a photo rotated 90° from
261
- // what they framed, and the guide→photo crop mapping (which is in
262
- // screen space) landed on the wrong region. With `preview` the photo
263
- // always comes back in the orientation the user saw.
264
- outputOrientation="preview"
272
+ outputs={[photoOutput]}
273
+ // Lock the captured photo to the *interface* orientation (OSDKR-13).
274
+ // The alternative, `'device'`, emits the photo in whatever orientation
275
+ // the phone is physically held — even though this screen is locked to
276
+ // portrait and both the preview and the ID-1 guide stay portrait. A
277
+ // user tilting the phone sideways to frame a landscape card therefore
278
+ // got a photo rotated 90° from what they framed, and the guide→photo
279
+ // crop mapping (which is in screen space) landed on the wrong region.
280
+ // With `'interface'` the photo always comes back in the orientation
281
+ // the user saw. (This is v5's spelling of what v4 called
282
+ // `outputOrientation="preview"`.)
283
+ orientationSource="interface"
265
284
  // Explicit `cover`: the guide-crop math in `computeGuideCropRect`
266
285
  // assumes the preview center-crops the sensor frame to the screen
267
286
  // aspect ratio. `cover` is vision-camera's default, but we pin it so
268
287
  // the crop never silently drifts if that default changes.
269
288
  resizeMode="cover"
270
- enableZoomGesture={false}
271
289
  isActive
272
290
  />
273
291
  {/* Invisible pressable layer over the camera preview for tap-to-focus.
@@ -550,7 +568,7 @@ const styles = StyleSheet.create({
550
568
  backgroundColor: 'transparent',
551
569
  },
552
570
  processingOverlay: {
553
- ...StyleSheet.absoluteFillObject,
571
+ ...StyleSheet.absoluteFill,
554
572
  alignItems: 'center',
555
573
  justifyContent: 'center',
556
574
  gap: 14,