@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
package/README.md CHANGED
@@ -82,6 +82,8 @@ npm install @velion-la/onboarding-sdk-react-native
82
82
  ```bash
83
83
  npm install \
84
84
  react-native-vision-camera \
85
+ react-native-nitro-modules \
86
+ react-native-nitro-image \
85
87
  react-native-svg \
86
88
  react-native-sse \
87
89
  expo-application expo-crypto expo-device expo-image-manipulator expo-keep-awake expo-location \
@@ -138,15 +140,36 @@ That is why they are optional: an existing integration keeps working untouched.
138
140
  > the error above, check for a second copy of `react-native-reanimated` in your
139
141
  > tree (`npm ls react-native-reanimated`) and pin it with an `overrides` block.
140
142
 
143
+ ### 5. Optional peer dependencies (step header icons)
144
+
145
+ ```bash
146
+ npx expo install @expo/vector-icons
147
+ ```
148
+
149
+ Needed only for the Material icon shown next to each step title. Pure JS, so
150
+ it needs no native rebuild.
151
+
152
+ > **Upgrading from an older Expo SDK?** This package used to arrive as a
153
+ > dependency of `expo`, but **SDK 57 dropped it**. An app that never installed
154
+ > it explicitly will lose its step icons on upgrade, with a `[StepIcon]` warning
155
+ > in the logs.
156
+
157
+ Without it the SDK still mounts and every step works; only the icons are
158
+ replaced by a neutral placeholder. Set `VelionTheme.hideStepIcons = true` to
159
+ remove the circle entirely.
160
+
141
161
  ### Supported versions
142
162
 
143
163
  | Package | Minimum | Tested against |
144
164
  |---|---|---|
145
- | `react` | `>=19.0.0` | `19.1.0` |
146
- | `react-native` | `>=0.81.0` | `0.81.5` |
147
- | `expo` | `>=54.0.0` | `~54.0.34` |
148
- | `react-native-vision-camera` | `>=4.6.0` | `4.7.x` |
149
- | `react-native-keyboard-controller` (optional) | `>=1.18.0` | `1.18.5` |
165
+ | `react` | `>=19.2.0` | `19.2.3` |
166
+ | `react-native` | `>=0.86.0` | `0.86.3` |
167
+ | `expo` | `>=57.0.0` | `~57.0.20` |
168
+ | `react-native-vision-camera` | `>=5.0.0` | `5.2.3` |
169
+ | `react-native-nitro-modules` | `>=0.37.0` | `0.37.1` |
170
+ | `react-native-nitro-image` | `>=0.15.0` | `0.15.2` |
171
+ | `@expo/vector-icons` (optional) | `>=15.0.0` | `15.1.1` |
172
+ | `react-native-keyboard-controller` (optional) | `>=1.18.0` | `1.21.9` |
150
173
 
151
174
  ---
152
175
 
@@ -158,19 +181,17 @@ and `android/` folders generated (either a bare React Native project or
158
181
 
159
182
  ### Expo plugins (`app.json` / `app.config.js`)
160
183
 
184
+ > **`react-native-vision-camera` has no plugin entry.** v5 does not ship an
185
+ > Expo config plugin, so the camera permission strings it used to generate must
186
+ > be declared by hand: `NSCameraUsageDescription` under `ios.infoPlist` and
187
+ > `android.permission.CAMERA` under `android.permissions`. Both are shown in
188
+ > the snippet after this one.
189
+
161
190
  ```jsonc
162
191
  {
163
192
  "expo": {
164
193
  "plugins": [
165
194
  "expo-dev-client",
166
- [
167
- "react-native-vision-camera",
168
- {
169
- "cameraPermissionText": "$(PRODUCT_NAME) needs access to your camera to capture your ID document and run the liveness check.",
170
- "enableMicrophonePermission": false,
171
- "enableCodeScanner": false
172
- }
173
- ],
174
195
  [
175
196
  "expo-location",
176
197
  {
@@ -553,10 +574,19 @@ Equivalences:
553
574
  ### Step header icons
554
575
 
555
576
  Each step renders a themed icon (Material Icons) inside a circle of
556
- `primaryColor` next to the title. They come from `@expo/vector-icons`, which
557
- Expo SDK 54+ ships by default. In bare React Native projects without Expo,
558
- install it separately (`npm install @expo/vector-icons`) or enable
559
- `hideStepIcons` to skip the dependency.
577
+ `primaryColor` next to the title. They come from `@expo/vector-icons`, an
578
+ optional peer dependency you install yourself:
579
+
580
+ ```bash
581
+ npx expo install @expo/vector-icons
582
+ ```
583
+
584
+ > Expo used to ship this package as a dependency of `expo`, but **SDK 57
585
+ > dropped it**, so an app upgrading from an older SDK has to add it explicitly
586
+ > or the icons silently disappear.
587
+
588
+ Skip it and enable `hideStepIcons` if you would rather not add the dependency —
589
+ the flow renders fine without it.
560
590
 
561
591
  ### Color mode
562
592
 
@@ -17,9 +17,21 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
17
17
  /**
18
18
  * @fileoverview Full-screen document camera with an ID-1 frame guide.
19
19
  *
20
- * Uses `react-native-vision-camera` v4 in `photo` mode. Tapping the shutter
21
- * triggers `takePhoto()` with `qualityPrioritization: 'balanced'`; the file
22
- * URI is returned to the caller via `onCaptured`.
20
+ * Uses `react-native-vision-camera` v5. The shutter calls
21
+ * `capturePhotoToFile()`, which writes the JPEG to a temporary file and hands
22
+ * its path to the caller via `onCaptured`.
23
+ *
24
+ * NOTE: only the photo output is passed to `<Camera outputs={...}>`. The
25
+ * preview is NOT listed there — `<Camera>` creates its own `usePreviewOutput()`
26
+ * and prepends it internally (`outputs: [previewOutput, ...outputs]`). Passing
27
+ * one explicitly adds a second preview against the same layer, and the session
28
+ * then refuses the duplicate connection with "cannot be added to Camera
29
+ * Session!", on every device (OSDKR-20).
30
+ *
31
+ * We deliberately use `capturePhotoToFile()` rather than `capturePhoto()`:
32
+ * the caller only ever needs a path to crop and upload, and the file variant
33
+ * avoids holding a native `Photo` buffer in JS that would have to be
34
+ * `dispose()`d by hand on every branch, including the error paths.
23
35
  *
24
36
  * Visual: dark scrim with a transparent rectangular cutout (ID-1 ratio). The
25
37
  * cutout is both the visible guide AND the crop region: on capture we hand the
@@ -53,10 +65,16 @@ function DocumentCapture({
53
65
  height: screenH
54
66
  } = (0, _reactNative.useWindowDimensions)();
55
67
  const cameraRef = (0, _react.useRef)(null);
68
+ // `quality` over speed — this frame goes to the backend OCR, and a soft or
69
+ // over-compressed capture is the difference between a readable document and
70
+ // a rejected one. The default `UHD_4_3` target resolution is kept.
71
+ const photoOutput = (0, _reactNativeVisionCamera.usePhotoOutput)({
72
+ qualityPrioritization: 'quality'
73
+ });
56
74
  // Cross-platform back-camera selection.
57
75
  //
58
- // iOS (especially 15 Pro / Pro Max with multi-lens systems): asking for
59
- // just 'back' returns the *wide-angle* device, whose ~20 cm minimum focus
76
+ // iOS (especially Pro models with multi-lens systems): asking for just
77
+ // 'back' returns the *wide-angle* device, whose ~20 cm minimum focus
60
78
  // distance produces blurry frames when the user holds the ID closer.
61
79
  // Passing the `physicalDevices` array makes vision-camera pick the
62
80
  // *virtual multi-camera* device, which lets iOS auto-switch to the
@@ -69,7 +87,7 @@ function DocumentCapture({
69
87
  // harm anything. Continuous AF is the default focus mode on both
70
88
  // platforms, so cross-platform behaviour stays consistent.
71
89
  const device = (0, _reactNativeVisionCamera.useCameraDevice)('back', {
72
- physicalDevices: ['ultra-wide-angle-camera', 'wide-angle-camera', 'telephoto-camera']
90
+ physicalDevices: ['ultra-wide-angle', 'wide-angle', 'telephoto']
73
91
  });
74
92
  const {
75
93
  hasPermission,
@@ -98,26 +116,31 @@ function DocumentCapture({
98
116
  return () => clearTimeout(t);
99
117
  }, [device, hasPermission]);
100
118
 
101
- // NOTE: we intentionally do NOT call `cameraRef.current.focus()` on mount
102
- // or before each shutter. iOS's continuous auto-focus runs by default and
103
- // is what makes the native Camera app feel sharp at any distance. Calling
104
- // `focus()` switches the device into single-shot/locked mode and DOES NOT
105
- // restore continuous AF afterwards (vision-camera v4 has no "resume AF"
106
- // API). The previous "autofocus on mount" + "autofocus before shutter"
107
- // calls were the cause of blurry captures on iPhone 15 Pro Max: they
108
- // pinned focus to the centre even after the user moved the phone, and
109
- // never re-engaged continuous AF.
119
+ // NOTE: we intentionally do NOT call `focusTo()` on mount or before each
120
+ // shutter. iOS's continuous auto-focus runs by default and is what makes
121
+ // the native Camera app feel sharp at any distance. Focusing explicitly
122
+ // switches the device into single-shot/locked mode and does not restore
123
+ // continuous AF on its own. The previous "autofocus on mount" + "autofocus
124
+ // before shutter" calls were the cause of blurry captures on iPhone 15 Pro
125
+ // Max: they pinned focus to the centre even after the user moved the phone,
126
+ // and never re-engaged continuous AF.
127
+ //
128
+ // v5 does expose `CameraRef.resetFocus()` to return the device to
129
+ // continuous AF, but we deliberately don't call it after a tap: the tap is
130
+ // the user asking us to hold focus there, and auto-releasing it would fight
131
+ // that intent. Focus re-engages when the component remounts for the next
132
+ // side of the document.
110
133
  //
111
134
  // Tap-to-focus is the one user-initiated override — when the user taps,
112
135
  // they're explicitly asking us to lock focus on that point.
113
- const supportsFocus = Boolean(device?.supportsFocus);
136
+ const supportsFocus = Boolean(device?.supportsFocusMetering);
114
137
  const handleTapToFocus = (0, _react.useCallback)(event => {
115
138
  if (!supportsFocus || !cameraRef.current) return;
116
139
  const {
117
140
  locationX,
118
141
  locationY
119
142
  } = event.nativeEvent;
120
- cameraRef.current.focus({
143
+ cameraRef.current.focusTo({
121
144
  x: locationX,
122
145
  y: locationY
123
146
  }).catch(() => {
@@ -141,10 +164,10 @@ function DocumentCapture({
141
164
  setShooting(true);
142
165
  setError(null);
143
166
  try {
144
- const photo = await cameraRef.current.takePhoto({
145
- flash: 'off',
167
+ const photo = await photoOutput.capturePhotoToFile({
168
+ flashMode: 'off',
146
169
  enableShutterSound: false
147
- });
170
+ }, {});
148
171
  // Await the caller's crop/compress so the processing overlay stays up
149
172
  // for the whole capture→preview gap (a few seconds), giving the user
150
173
  // feedback instead of an idle camera. On success the parent flips phase
@@ -161,7 +184,7 @@ function DocumentCapture({
161
184
  } finally {
162
185
  setShooting(false);
163
186
  }
164
- }, [onCaptured, side, shooting, orientation, screenW, screenH]);
187
+ }, [onCaptured, photoOutput, side, shooting, orientation, screenW, screenH]);
165
188
  if (!hasPermission) {
166
189
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
167
190
  style: [styles.permission, {
@@ -229,26 +252,25 @@ function DocumentCapture({
229
252
  ref: cameraRef,
230
253
  style: _reactNative.StyleSheet.absoluteFill,
231
254
  device: device,
232
- photo: true,
233
- photoQualityBalance: "quality"
234
- // Lock the captured photo to the *preview's* orientation (OSDKR-13).
235
- // vision-camera defaults to `outputOrientation="device"`, which emits
236
- // the photo in whatever orientation the phone is physically held —
237
- // even though this screen is locked to portrait and both the preview
238
- // and the ID-1 guide stay portrait. A user tilting the phone sideways
239
- // to frame a landscape card therefore got a photo rotated 90° from
240
- // what they framed, and the guide→photo crop mapping (which is in
241
- // screen space) landed on the wrong region. With `preview` the photo
242
- // always comes back in the orientation the user saw.
255
+ outputs: [photoOutput]
256
+ // Lock the captured photo to the *interface* orientation (OSDKR-13).
257
+ // The alternative, `'device'`, emits the photo in whatever orientation
258
+ // the phone is physically held — even though this screen is locked to
259
+ // portrait and both the preview and the ID-1 guide stay portrait. A
260
+ // user tilting the phone sideways to frame a landscape card therefore
261
+ // got a photo rotated 90° from what they framed, and the guide→photo
262
+ // crop mapping (which is in screen space) landed on the wrong region.
263
+ // With `'interface'` the photo always comes back in the orientation
264
+ // the user saw. (This is v5's spelling of what v4 called
265
+ // `outputOrientation="preview"`.)
243
266
  ,
244
- outputOrientation: "preview"
267
+ orientationSource: "interface"
245
268
  // Explicit `cover`: the guide-crop math in `computeGuideCropRect`
246
269
  // assumes the preview center-crops the sensor frame to the screen
247
270
  // aspect ratio. `cover` is vision-camera's default, but we pin it so
248
271
  // the crop never silently drifts if that default changes.
249
272
  ,
250
273
  resizeMode: "cover",
251
- enableZoomGesture: false,
252
274
  isActive: true
253
275
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
254
276
  style: _reactNative.StyleSheet.absoluteFill,
@@ -549,7 +571,7 @@ const styles = _reactNative.StyleSheet.create({
549
571
  backgroundColor: 'transparent'
550
572
  },
551
573
  processingOverlay: {
552
- ..._reactNative.StyleSheet.absoluteFillObject,
574
+ ..._reactNative.StyleSheet.absoluteFill,
553
575
  alignItems: 'center',
554
576
  justifyContent: 'center',
555
577
  gap: 14,
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","_reactNative","_reactNativeSvg","_interopRequireWildcard","_reactNativeVisionCamera","_theme","_Button","_useSafeAreaInsets","_documentCrop","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","DocumentCapture","side","orientation","instructions","captureLabel","permissionDeniedLabel","retryLabel","cancelLabel","processingLabel","onCaptured","onCancel","theme","useTheme","insets","useSafeAreaInsets","width","screenW","height","screenH","useWindowDimensions","cameraRef","useRef","device","useCameraDevice","physicalDevices","hasPermission","requestPermission","useCameraPermission","requestedOnce","setRequestedOnce","useState","shooting","setShooting","error","setError","deviceTimeout","setDeviceTimeout","focusPoint","setFocusPoint","useEffect","setTimeout","clearTimeout","supportsFocus","Boolean","handleTapToFocus","useCallback","event","current","locationX","locationY","nativeEvent","focus","x","y","catch","key","Date","now","handleShutter","photo","takePhoto","flash","enableShutterSound","cutout","computeCutout","err","Error","message","String","jsxs","View","style","styles","permission","backgroundColor","children","jsx","Text","permissionText","color","textColor","row","Button","variant","label","onPress","fullWidth","actionBtn","ActivityIndicator","primaryColor","root","Camera","ref","StyleSheet","absoluteFill","photoQualityBalance","outputOrientation","resizeMode","enableZoomGesture","isActive","Pressable","accessibilityLabel","DocumentMaskOverlay","pointerEvents","focusRing","left","FOCUS_RING_SIZE","top","topBar","iconBtn","iconBtnText","instructionsText","bottomBar","bottom","errorText","accessibilityRole","accessibilityState","disabled","shutter","borderColor","withAlpha","shutterDisabled","shutterCore","processingOverlay","size","processingText","CORNER_LENGTH","CORNER_THICKNESS","CUTOUT_RADIUS","DIM_COLOR","cutoutW","cutoutH","R","Defs","Mask","id","Rect","fill","rx","ry","mask","position","corner","cornerTL","borderTopLeftRadius","cornerTR","borderTopRightRadius","cornerBL","borderBottomLeftRadius","cornerBR","borderBottomRightRadius","create","flex","alignItems","justifyContent","padding","gap","textAlign","fontSize","lineHeight","flexDirection","maxWidth","right","borderRadius","fontWeight","paddingHorizontal","paddingVertical","overflow","borderWidth","opacity","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","absoluteFillObject"],"sourceRoot":"../../../src","sources":["camera/DocumentCapture.tsx"],"mappings":";;;;;;AAeA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,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ACDvB,SAAS,EAAE;IACTqC,QAAQ,EAAE,UAAU;IACpB9H,KAAK,EAAE2F,eAAe;IACtBzF,MAAM,EAAEyF,eAAe;IACvByD,YAAY,EAAEzD,eAAe,GAAG,CAAC;IACjC8D,WAAW,EAAE,CAAC;IACdjD,WAAW,EAAE,SAAS;IACtB7C,eAAe,EAAE;EACnB,CAAC;EACDiD,iBAAiB,EAAE;IACjB,GAAG9B,uBAAU,CAACiF,kBAAkB;IAChCrB,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBE,GAAG,EAAE,EAAE;IACPlF,eAAe,EAAE;EACnB,CAAC;EACDmD,cAAc,EAAE;IACd9C,KAAK,EAAE,SAAS;IAChB+E,QAAQ,EAAE,EAAE;IACZM,UAAU,EAAE,KAAK;IACjBP,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_react","require","_reactNative","_reactNativeSvg","_interopRequireWildcard","_reactNativeVisionCamera","_theme","_Button","_useSafeAreaInsets","_documentCrop","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","DocumentCapture","side","orientation","instructions","captureLabel","permissionDeniedLabel","retryLabel","cancelLabel","processingLabel","onCaptured","onCancel","theme","useTheme","insets","useSafeAreaInsets","width","screenW","height","screenH","useWindowDimensions","cameraRef","useRef","photoOutput","usePhotoOutput","qualityPrioritization","device","useCameraDevice","physicalDevices","hasPermission","requestPermission","useCameraPermission","requestedOnce","setRequestedOnce","useState","shooting","setShooting","error","setError","deviceTimeout","setDeviceTimeout","focusPoint","setFocusPoint","useEffect","setTimeout","clearTimeout","supportsFocus","Boolean","supportsFocusMetering","handleTapToFocus","useCallback","event","current","locationX","locationY","nativeEvent","focusTo","x","y","catch","key","Date","now","handleShutter","photo","capturePhotoToFile","flashMode","enableShutterSound","cutout","computeCutout","err","Error","message","String","jsxs","View","style","styles","permission","backgroundColor","children","jsx","Text","permissionText","color","textColor","row","Button","variant","label","onPress","fullWidth","actionBtn","ActivityIndicator","primaryColor","root","Camera","ref","StyleSheet","absoluteFill","outputs","orientationSource","resizeMode","isActive","Pressable","accessibilityLabel","DocumentMaskOverlay","pointerEvents","focusRing","left","FOCUS_RING_SIZE","top","topBar","iconBtn","iconBtnText","instructionsText","bottomBar","bottom","errorText","accessibilityRole","accessibilityState","disabled","shutter","borderColor","withAlpha","shutterDisabled","shutterCore","processingOverlay","size","processingText","CORNER_LENGTH","CORNER_THICKNESS","CUTOUT_RADIUS","DIM_COLOR","cutoutW","cutoutH","R","Defs","Mask","id","Rect","fill","rx","ry","mask","position","corner","cornerTL","borderTopLeftRadius","cornerTR","borderTopRightRadius","cornerBL","borderBottomLeftRadius","cornerBR","borderBottomRightRadius","create","flex","alignItems","justifyContent","padding","gap","textAlign","fontSize","lineHeight","flexDirection","maxWidth","right","borderRadius","fontWeight","paddingHorizontal","paddingVertical","overflow","borderWidth","opacity","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth"],"sourceRoot":"../../../src","sources":["camera/DocumentCapture.tsx"],"mappings":";;;;;;AA2BA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAAE,eAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,wBAAA,GAAAJ,OAAA;AASA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAP,OAAA;AACA,IAAAQ,aAAA,GAAAR,OAAA;AAAuE,IAAAS,WAAA,GAAAT,OAAA;AAAA,SAAAG,wBAAAO,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAT,uBAAA,YAAAA,CAAAO,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,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G7B,uBAAU,CAACC,YAAY;IAC1B0D,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBE,GAAG,EAAE,EAAE;IACPjF,eAAe,EAAE;EACnB,CAAC;EACDkD,cAAc,EAAE;IACd7C,KAAK,EAAE,SAAS;IAChB8E,QAAQ,EAAE,EAAE;IACZM,UAAU,EAAE,KAAK;IACjBP,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
@@ -17,18 +17,39 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
17
17
  * @fileoverview Liveness camera surface — front-facing vision-camera with an
18
18
  * oval mask, status pill, and capture loop driven by the parent step.
19
19
  *
20
- * Capture strategy: vision-camera v4 frame processors run on a worklet thread
21
- * and don't expose the JPEG bytes back to JS without a custom native plugin.
22
- * We avoid that complication by using `takePhoto({ qualityPrioritization:
23
- * 'speed' })` on a JS-level interval (matches the `setInterval` pattern in
24
- * `web/LivenessModule.ts`). Real-world FPS lands around 3–8 fps which is
25
- * sufficient for Iris's challenge cadence.
20
+ * Capture strategy: the web SDK grabs JPEG frames from the live video
21
+ * element. We do the Android equivalent: `takeSnapshot()` of the preview
22
+ * (the same pixels the user framed in the oval). Still-photo capture on
23
+ * the same session as the evidence recorder produced blurry JPEGs that
24
+ * Iris rejected as `LOW_SHARPNESS` and MiniFAS scored as a screen replay.
25
+ *
26
+ * `takeSnapshot()` is Android-only. iOS falls back to a photo output with
27
+ * `qualityPrioritization: 'quality'` (not `'speed'` — that is ZSL and
28
+ * starves when video is running).
29
+ *
30
+ * Preview snapshots are selfie-mirrored. We un-mirror before encoding so
31
+ * Iris sees real-world yaw (OSDKR-23). The on-screen preview stays mirrored.
32
+ *
33
+ * NOTE: the preview is deliberately NOT in `<Camera outputs={...}>`.
34
+ * `<Camera>` creates its own and prepends it (`outputs: [previewOutput,
35
+ * ...outputs]`); passing one explicitly adds a duplicate preview connection
36
+ * that the session refuses (OSDKR-20).
26
37
  *
27
38
  * The parent owns the loop and the WebSocket — this component just exposes a
28
39
  * `captureFrame` ref so the step can drive the timing while the camera stays
29
40
  * mounted across challenges.
30
41
  */
31
42
 
43
+ /**
44
+ * The recorded liveness video, as this component reports it upwards.
45
+ *
46
+ * vision-camera v5 hands `onRecordingFinished` a bare file path, while the
47
+ * upload pipeline also wants the duration for the `liveness-verify` metadata.
48
+ * We read the duration off the `Recorder` before finalising and re-assemble
49
+ * both here, so the step keeps consuming one object instead of two loose
50
+ * values.
51
+ */
52
+
32
53
  /**
33
54
  * Visual cue applied to the oval guide. The parent maps the current Iris
34
55
  * challenge to one of these so the oval animates in a way that reinforces
@@ -41,21 +62,48 @@ const LivenessCamera = exports.LivenessCamera = /*#__PURE__*/(0, _react.forwardR
41
62
  const insets = (0, _useSafeAreaInsets.useSafeAreaInsets)();
42
63
  const cameraRef = (0, _react.useRef)(null);
43
64
  const device = (0, _reactNativeVisionCamera.useCameraDevice)('front');
44
- // Pick a 720p / 30-fps format so the recorded mp4 stays a few MB instead
45
- // of the device-default 1080p–4K bitrate (a 30 s session can otherwise
46
- // produce a 50–80 MB file that times out on mobile uplinks). The face
47
- // visibility for liveness evidence is fine at 720p. Constraints are
48
- // ordered by priority — vision-camera picks the closest match.
49
- const format = (0, _reactNativeVisionCamera.useCameraFormat)(device, [{
50
- videoResolution: {
51
- width: 1280,
52
- height: 720
53
- }
54
- }, {
55
- fps: 30
56
- }, {
57
- videoStabilizationMode: 'off'
58
- }]);
65
+ // Stills at MAXIMIZE_QUALITY, used on iOS and on Android unless the switch
66
+ // above selects the preview snapshot.
67
+ // Capture WELL ABOVE the wire size on purpose (OSDKR-23).
68
+ //
69
+ // Iris scores sharpness as the Laplacian variance of the face region in
70
+ // the frame we send, and that number depends on how much we downscaled to
71
+ // get there. Downsampling concentrates detail and averages out sensor
72
+ // noise, so a 720 px frame derived from a large capture is measurably
73
+ // sharper than one captured at ~720 px natively.
74
+ //
75
+ // The spike had this at HD_4_3 (768x1024), reasoning that the frame gets
76
+ // resized to 720 anyway. It does — but that is a 0.94x scale, which keeps
77
+ // all of the lens softness and noise reduction of the native capture. On a
78
+ // Motorola Edge 30 Neo it measured `sharpness_quality` 0.16 average and
79
+ // 0.216 peak against a 0.35 threshold, with good lighting and a 312x470 px
80
+ // face: not a framing problem, a resolution one.
81
+ //
82
+ // FHD_4_3 gives a 2x linear downscale to the 720 px wire size at a
83
+ // fraction of the cost of the 12 MP default. Escalate to
84
+ // `CommonResolutions.UHD_4_3` — what iOS used when it passed the gate — if
85
+ // the measured sharpness is still short.
86
+ const photoOutput = (0, _reactNativeVisionCamera.usePhotoOutput)({
87
+ qualityPrioritization: 'quality',
88
+ targetResolution: _reactNativeVisionCamera.CommonResolutions.FHD_4_3,
89
+ quality: 0.9
90
+ });
91
+ // Pin the recording to 720p so the mp4 stays a few MB instead of the
92
+ // device-default 1080p–4K bitrate (a 30 s session can otherwise produce a
93
+ // 50–80 MB file that times out on mobile uplinks). Face visibility for
94
+ // liveness evidence is fine at 720p. Audio off — the backend never uses it
95
+ // and recording it would demand the microphone permission.
96
+ const videoOutput = (0, _reactNativeVisionCamera.useVideoOutput)({
97
+ targetResolution: _reactNativeVisionCamera.CommonResolutions.HD_16_9,
98
+ // ~2 Mbps. NOTE the unit: v5 takes bits per second, where v4's
99
+ // `videoBitRate` prop took megabits — passing `2` here would ask for
100
+ // 2 bps and produce an unusable file. The device default (~8 Mbps at
101
+ // 720p) yields a 38 MB file for a 30 s session; ~2 Mbps is plenty for
102
+ // face visibility as compliance evidence and lands around 7–8 MB.
103
+ targetBitRate: 2_000_000,
104
+ enableAudio: false,
105
+ fileType: 'mp4'
106
+ });
59
107
  const {
60
108
  hasPermission,
61
109
  requestPermission
@@ -81,14 +129,12 @@ const LivenessCamera = exports.LivenessCamera = /*#__PURE__*/(0, _react.forwardR
81
129
  }, [device, hasPermission]);
82
130
  const takeFrame = (0, _react.useCallback)(async () => {
83
131
  if (inFlightRef.current) return null;
84
- const camera = cameraRef.current;
85
- if (!camera) return null;
86
132
  inFlightRef.current = true;
87
133
  try {
88
- return await camera.takePhoto({
89
- flash: 'off',
134
+ return await photoOutput.capturePhotoToFile({
135
+ flashMode: 'off',
90
136
  enableShutterSound: false
91
- });
137
+ }, {});
92
138
  } catch {
93
139
  // Frame failures are non-fatal — the parent loop just retries on the
94
140
  // next tick. Keep the camera mounted.
@@ -96,39 +142,56 @@ const LivenessCamera = exports.LivenessCamera = /*#__PURE__*/(0, _react.forwardR
96
142
  } finally {
97
143
  inFlightRef.current = false;
98
144
  }
99
- }, []);
145
+ }, [photoOutput]);
100
146
 
101
- // Recording is best-effort and orthogonal to the frame loop. We track an
102
- // `isRecording` flag so `stopVideoRecording` is idempotent even if the
103
- // parent calls it twice (e.g. on SESSION_COMPLETE and again on unmount).
104
- const recordingRef = (0, _react.useRef)(false);
105
- const startVideoRecording = (0, _react.useCallback)(opts => {
106
- const camera = cameraRef.current;
107
- if (!camera) {
108
- throw new Error('Camera is not mounted; cannot start recording.');
147
+ // Recording is best-effort and orthogonal to the frame loop. We keep the
148
+ // live `Recorder` in a ref so `stopVideoRecording` is idempotent even if
149
+ // the parent calls it twice (e.g. on SESSION_COMPLETE and again on
150
+ // unmount). In v5 a Recorder is single-use: one is created per recording
151
+ // and discarded once it finishes.
152
+ const recorderRef = (0, _react.useRef)(null);
153
+ // Duration read off the Recorder just before finalising. v5's
154
+ // `onRecordingFinished` only carries the file path, but the upload
155
+ // pipeline reports the duration in the `liveness-verify` metadata.
156
+ const recordedDurationRef = (0, _react.useRef)(undefined);
157
+ const startVideoRecording = (0, _react.useCallback)(async opts => {
158
+ if (recorderRef.current) return;
159
+ const recorder = await videoOutput.createRecorder({});
160
+ recorderRef.current = recorder;
161
+ recordedDurationRef.current = undefined;
162
+ try {
163
+ await recorder.startRecording(filePath => {
164
+ const duration = recordedDurationRef.current ?? (typeof recorder.recordedDuration === 'number' ? recorder.recordedDuration : undefined);
165
+ recorderRef.current = null;
166
+ opts.onRecordingFinished({
167
+ path: filePath,
168
+ duration
169
+ });
170
+ }, error => {
171
+ recorderRef.current = null;
172
+ opts.onRecordingError(error);
173
+ });
174
+ } catch (err) {
175
+ // Startup failed, so neither callback will ever fire — release the
176
+ // ref here or every later start would short-circuit on it.
177
+ recorderRef.current = null;
178
+ throw err;
109
179
  }
110
- if (recordingRef.current) return;
111
- recordingRef.current = true;
112
- camera.startRecording({
113
- fileType: 'mp4',
114
- videoCodec: 'h264',
115
- flash: 'off',
116
- onRecordingFinished: video => {
117
- recordingRef.current = false;
118
- opts.onRecordingFinished(video);
119
- },
120
- onRecordingError: err => {
121
- recordingRef.current = false;
122
- opts.onRecordingError(err);
123
- }
124
- });
125
- }, []);
180
+ }, [videoOutput]);
126
181
  const stopVideoRecording = (0, _react.useCallback)(async () => {
127
- const camera = cameraRef.current;
128
- if (!camera || !recordingRef.current) return;
129
- await camera.stopRecording();
130
- // recordingRef is cleared inside onRecordingFinished/onRecordingError to
131
- // avoid a window where a follow-up start() races with the unfinished stop.
182
+ const recorder = recorderRef.current;
183
+ if (!recorder) return;
184
+ // Read the duration BEFORE stopping: once the recording is finalised the
185
+ // counter is no longer meaningful, and `onRecordingFinished` does not
186
+ // carry it.
187
+ try {
188
+ recordedDurationRef.current = typeof recorder.recordedDuration === 'number' ? recorder.recordedDuration : undefined;
189
+ } catch {
190
+ recordedDurationRef.current = undefined;
191
+ }
192
+ await recorder.stopRecording();
193
+ // recorderRef is cleared inside onRecordingFinished/onRecordingError to
194
+ // avoid a window where a follow-up start races with the unfinished stop.
132
195
  }, []);
133
196
  (0, _react.useImperativeHandle)(ref, () => ({
134
197
  takeFrame,
@@ -202,39 +265,27 @@ const LivenessCamera = exports.LivenessCamera = /*#__PURE__*/(0, _react.forwardR
202
265
  ref: cameraRef,
203
266
  style: _reactNative.StyleSheet.absoluteFill,
204
267
  device: device
205
- // `format` and `fps` cap the sensor output to 720p / 30 fps so the
206
- // recorded mp4 lands in the few-MB range instead of the device
207
- // default (which on modern iPhones is 1080p–4K @ 60 fps).
268
+ // Android: preview + video only. Photo stills on the same session
269
+ // as the recorder were the LOW_SHARPNESS / MiniFAS failure.
270
+ // iOS: photo + video; snapshot is not available.
208
271
  ,
209
- ...(format ? {
210
- format
211
- } : {}),
212
- fps: 30
213
- // Cap the encoder to ~2 Mbps. The default `'normal'` setting maps
214
- // to ~8 Mbps for 720p, producing a 38 MB file for a 30 s session;
215
- // ~2 Mbps is plenty for face visibility (compliance evidence) and
216
- // keeps a 30 s recording around 7-8 MB.
272
+ outputs: [photoOutput, videoOutput]
273
+ // Cap the sensor at 30 fps. Resolution and bit-rate are set on the
274
+ // video output itself (see `useVideoOutput` above).
217
275
  ,
218
- videoBitRate: 2
219
- // Lock the recorded video orientation to the preview view's so it
220
- // is never upside-down or sideways on the back-office player.
221
- ,
222
- outputOrientation: "preview",
223
- photo: true
224
- // Enable mp4/h264 recording in parallel with takePhoto(). vision-camera
225
- // v4 supports both surfaces on the same <Camera>; the recording runs
226
- // best-effort and does not affect the frame cadence sent to Iris.
276
+ constraints: [{
277
+ fps: 30
278
+ }]
279
+ // Lock the recorded video orientation to the interface's so it is
280
+ // never upside-down or sideways on the back-office player. (v5's
281
+ // spelling of what v4 called `outputOrientation="preview"`.)
227
282
  ,
228
- video: true,
229
- audio: false,
230
- photoQualityBalance: "speed"
231
- // Keep the vision-camera default (`isMirrored=true` for front cam):
232
- // overriding it to `false` causes a v4 iOS bug where the tkhd matrix
233
- // is written rotated −90° instead of +90°, leaving the recorded mp4
234
- // upside-down. The JPEG frames we send to Iris are un-mirrored
235
- // separately in `captureAndSend` via a horizontal flip with
236
- // expo-image-manipulator, so TURN_LEFT/RIGHT still maps to the
237
- // real-world yaw.
283
+ orientationSource: "interface"
284
+ // We keep the front camera's default mirroring rather than forcing
285
+ // `isMirrored=false`: in v4 that override triggered an iOS bug where
286
+ // the tkhd matrix was written rotated −90° instead of +90°, leaving
287
+ // the mp4 upside-down. Preview snapshots are un-mirrored in
288
+ // `takeFrame` before they go to Iris (OSDKR-23).
238
289
  ,
239
290
  isActive: true
240
291
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(OvalOverlay, {