@trustchex/react-native-sdk 1.355.1 → 1.357.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 (254) hide show
  1. package/README.md +2 -9
  2. package/TrustchexSDK.podspec +5 -4
  3. package/android/build.gradle +6 -4
  4. package/android/src/main/AndroidManifest.xml +1 -1
  5. package/android/src/main/java/com/trustchex/reactnativesdk/TrustchexSDKPackage.kt +45 -25
  6. package/android/src/main/java/com/trustchex/reactnativesdk/camera/TrustchexCameraManager.kt +168 -0
  7. package/android/src/main/java/com/trustchex/reactnativesdk/camera/TrustchexCameraView.kt +871 -0
  8. package/android/src/main/java/com/trustchex/reactnativesdk/mlkit/MLKitModule.kt +245 -0
  9. package/android/src/main/java/com/trustchex/reactnativesdk/mrz/MRZValidationModule.kt +785 -0
  10. package/android/src/main/java/com/trustchex/reactnativesdk/mrz/MRZValidator.kt +419 -0
  11. package/android/src/main/java/com/trustchex/reactnativesdk/opencv/OpenCVModule.kt +818 -0
  12. package/ios/Camera/TrustchexCameraManager.m +37 -0
  13. package/ios/Camera/TrustchexCameraManager.swift +125 -0
  14. package/ios/Camera/TrustchexCameraView.swift +1176 -0
  15. package/ios/MLKit/MLKitModule.m +23 -0
  16. package/ios/MLKit/MLKitModule.swift +250 -0
  17. package/ios/MRZValidation.m +39 -0
  18. package/ios/MRZValidation.swift +802 -0
  19. package/ios/MRZValidator.swift +466 -0
  20. package/ios/OpenCV/OpenCVModule.h +4 -0
  21. package/ios/OpenCV/OpenCVModule.mm +810 -0
  22. package/lib/module/Screens/Dynamic/IdentityDocumentEIDScanningScreen.js +2 -3
  23. package/lib/module/Screens/Dynamic/IdentityDocumentScanningScreen.js +1 -2
  24. package/lib/module/Screens/Dynamic/LivenessDetectionScreen.js +418 -193
  25. package/lib/module/Screens/Static/OTPVerificationScreen.js +11 -11
  26. package/lib/module/Screens/Static/QrCodeScanningScreen.js +5 -1
  27. package/lib/module/Screens/Static/ResultScreen.js +25 -2
  28. package/lib/module/Screens/Static/VerificationSessionCheckScreen.js +25 -7
  29. package/lib/module/Shared/Components/DebugNavigationPanel.js +234 -24
  30. package/lib/module/Shared/Components/EIDScanner.js +99 -9
  31. package/lib/module/Shared/Components/FaceCamera.js +170 -179
  32. package/lib/module/Shared/Components/IdentityDocumentCamera.js +2151 -771
  33. package/lib/module/Shared/Components/QrCodeScannerCamera.js +109 -107
  34. package/lib/module/Shared/Components/TrustchexCamera.js +122 -0
  35. package/lib/module/Shared/EIDReader/tlv/tlv.helpers.js +91 -0
  36. package/lib/module/Shared/EIDReader/tlv/tlv.utils.js +2 -124
  37. package/lib/module/Shared/EIDReader/tlv/tlvInputStream.js +4 -4
  38. package/lib/module/Shared/EIDReader/tlv/tlvOutputState.js +4 -4
  39. package/lib/module/Shared/EIDReader/tlv/tlvOutputStream.js +4 -4
  40. package/lib/module/Shared/Libs/analytics.utils.js +2 -2
  41. package/lib/module/Shared/Libs/debug.utils.js +132 -0
  42. package/lib/module/Shared/Libs/deeplink.utils.js +6 -5
  43. package/lib/module/Shared/Libs/demo.utils.js +13 -3
  44. package/lib/module/Shared/Libs/mrz.utils.js +1 -175
  45. package/lib/module/Shared/Libs/native-device-info.utils.js +12 -6
  46. package/lib/module/Shared/Libs/tts.utils.js +40 -6
  47. package/lib/module/Shared/Services/AnalyticsService.js +9 -8
  48. package/lib/module/Shared/Types/mrzFields.js +1 -0
  49. package/lib/module/Translation/Resources/en.js +87 -88
  50. package/lib/module/Translation/Resources/tr.js +84 -85
  51. package/lib/module/Trustchex.js +9 -2
  52. package/lib/module/index.js +1 -0
  53. package/lib/module/version.js +1 -1
  54. package/lib/typescript/src/Screens/Dynamic/IdentityDocumentEIDScanningScreen.d.ts.map +1 -1
  55. package/lib/typescript/src/Screens/Dynamic/IdentityDocumentScanningScreen.d.ts.map +1 -1
  56. package/lib/typescript/src/Screens/Dynamic/LivenessDetectionScreen.d.ts.map +1 -1
  57. package/lib/typescript/src/Screens/Static/OTPVerificationScreen.d.ts.map +1 -1
  58. package/lib/typescript/src/Screens/Static/QrCodeScanningScreen.d.ts.map +1 -1
  59. package/lib/typescript/src/Screens/Static/ResultScreen.d.ts.map +1 -1
  60. package/lib/typescript/src/Screens/Static/VerificationSessionCheckScreen.d.ts.map +1 -1
  61. package/lib/typescript/src/Shared/Components/DebugNavigationPanel.d.ts.map +1 -1
  62. package/lib/typescript/src/Shared/Components/EIDScanner.d.ts +2 -2
  63. package/lib/typescript/src/Shared/Components/EIDScanner.d.ts.map +1 -1
  64. package/lib/typescript/src/Shared/Components/FaceCamera.d.ts +18 -4
  65. package/lib/typescript/src/Shared/Components/FaceCamera.d.ts.map +1 -1
  66. package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.d.ts +3 -4
  67. package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.d.ts.map +1 -1
  68. package/lib/typescript/src/Shared/Components/QrCodeScannerCamera.d.ts +2 -1
  69. package/lib/typescript/src/Shared/Components/QrCodeScannerCamera.d.ts.map +1 -1
  70. package/lib/typescript/src/Shared/Components/TrustchexCamera.d.ts +124 -0
  71. package/lib/typescript/src/Shared/Components/TrustchexCamera.d.ts.map +1 -0
  72. package/lib/typescript/src/Shared/EIDReader/tlv/tlv.helpers.d.ts +11 -0
  73. package/lib/typescript/src/Shared/EIDReader/tlv/tlv.helpers.d.ts.map +1 -0
  74. package/lib/typescript/src/Shared/EIDReader/tlv/tlv.utils.d.ts +2 -39
  75. package/lib/typescript/src/Shared/EIDReader/tlv/tlv.utils.d.ts.map +1 -1
  76. package/lib/typescript/src/Shared/Libs/analytics.utils.d.ts.map +1 -1
  77. package/lib/typescript/src/Shared/Libs/debug.utils.d.ts +42 -0
  78. package/lib/typescript/src/Shared/Libs/debug.utils.d.ts.map +1 -0
  79. package/lib/typescript/src/Shared/Libs/deeplink.utils.d.ts.map +1 -1
  80. package/lib/typescript/src/Shared/Libs/demo.utils.d.ts.map +1 -1
  81. package/lib/typescript/src/Shared/Libs/http-client.d.ts.map +1 -1
  82. package/lib/typescript/src/Shared/Libs/mrz.utils.d.ts +0 -4
  83. package/lib/typescript/src/Shared/Libs/mrz.utils.d.ts.map +1 -1
  84. package/lib/typescript/src/Shared/Libs/native-device-info.utils.d.ts.map +1 -1
  85. package/lib/typescript/src/Shared/Libs/tts.utils.d.ts +4 -3
  86. package/lib/typescript/src/Shared/Libs/tts.utils.d.ts.map +1 -1
  87. package/lib/typescript/src/Shared/Services/AnalyticsService.d.ts.map +1 -1
  88. package/lib/typescript/src/Shared/Types/identificationInfo.d.ts +2 -2
  89. package/lib/typescript/src/Shared/Types/identificationInfo.d.ts.map +1 -1
  90. package/lib/typescript/src/Shared/Types/mrzFields.d.ts +11 -0
  91. package/lib/typescript/src/Shared/Types/mrzFields.d.ts.map +1 -0
  92. package/lib/typescript/src/Translation/Resources/en.d.ts +4 -5
  93. package/lib/typescript/src/Translation/Resources/en.d.ts.map +1 -1
  94. package/lib/typescript/src/Translation/Resources/tr.d.ts +4 -5
  95. package/lib/typescript/src/Translation/Resources/tr.d.ts.map +1 -1
  96. package/lib/typescript/src/Trustchex.d.ts +2 -0
  97. package/lib/typescript/src/Trustchex.d.ts.map +1 -1
  98. package/lib/typescript/src/index.d.ts +1 -0
  99. package/lib/typescript/src/index.d.ts.map +1 -1
  100. package/lib/typescript/src/version.d.ts +1 -1
  101. package/package.json +4 -35
  102. package/src/Screens/Dynamic/ContractAcceptanceScreen.tsx +1 -1
  103. package/src/Screens/Dynamic/IdentityDocumentEIDScanningScreen.tsx +7 -5
  104. package/src/Screens/Dynamic/IdentityDocumentScanningScreen.tsx +2 -3
  105. package/src/Screens/Dynamic/LivenessDetectionScreen.tsx +498 -216
  106. package/src/Screens/Static/OTPVerificationScreen.tsx +37 -31
  107. package/src/Screens/Static/QrCodeScanningScreen.tsx +8 -1
  108. package/src/Screens/Static/ResultScreen.tsx +136 -88
  109. package/src/Screens/Static/VerificationSessionCheckScreen.tsx +46 -13
  110. package/src/Shared/Components/DebugNavigationPanel.tsx +290 -34
  111. package/src/Shared/Components/EIDScanner.tsx +94 -16
  112. package/src/Shared/Components/FaceCamera.tsx +236 -203
  113. package/src/Shared/Components/IdentityDocumentCamera.tsx +3073 -1030
  114. package/src/Shared/Components/QrCodeScannerCamera.tsx +133 -127
  115. package/src/Shared/Components/TrustchexCamera.tsx +289 -0
  116. package/src/Shared/Config/camera-enhancement.config.ts +2 -2
  117. package/src/Shared/EIDReader/tlv/tlv.helpers.ts +96 -0
  118. package/src/Shared/EIDReader/tlv/tlv.utils.ts +2 -125
  119. package/src/Shared/EIDReader/tlv/tlvInputStream.ts +4 -4
  120. package/src/Shared/EIDReader/tlv/tlvOutputState.ts +4 -4
  121. package/src/Shared/EIDReader/tlv/tlvOutputStream.ts +4 -4
  122. package/src/Shared/Libs/analytics.utils.ts +48 -20
  123. package/src/Shared/Libs/debug.utils.ts +149 -0
  124. package/src/Shared/Libs/deeplink.utils.ts +7 -5
  125. package/src/Shared/Libs/demo.utils.ts +4 -0
  126. package/src/Shared/Libs/http-client.ts +12 -8
  127. package/src/Shared/Libs/mrz.utils.ts +1 -163
  128. package/src/Shared/Libs/native-device-info.utils.ts +12 -6
  129. package/src/Shared/Libs/tts.utils.ts +48 -6
  130. package/src/Shared/Services/AnalyticsService.ts +69 -24
  131. package/src/Shared/Types/identificationInfo.ts +2 -2
  132. package/src/Shared/Types/mrzFields.ts +29 -0
  133. package/src/Translation/Resources/en.ts +90 -100
  134. package/src/Translation/Resources/tr.ts +89 -97
  135. package/src/Translation/index.ts +1 -1
  136. package/src/Trustchex.tsx +21 -4
  137. package/src/index.tsx +14 -0
  138. package/src/version.ts +1 -1
  139. package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/barcodescanner/BarcodeScannerFrameProcessorPlugin.kt +0 -301
  140. package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/cropper/BitmapUtils.kt +0 -205
  141. package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/cropper/CropperPlugin.kt +0 -72
  142. package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/cropper/FrameMetadata.kt +0 -4
  143. package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/facedetector/FaceDetectorFrameProcessorPlugin.kt +0 -303
  144. package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/textrecognition/TextRecognitionFrameProcessorPlugin.kt +0 -115
  145. package/ios/VisionCameraPlugins/BarcodeScanner/BarcodeScannerFrameProcessorPlugin-Bridging-Header.h +0 -9
  146. package/ios/VisionCameraPlugins/BarcodeScanner/BarcodeScannerFrameProcessorPlugin.mm +0 -22
  147. package/ios/VisionCameraPlugins/BarcodeScanner/BarcodeScannerFrameProcessorPlugin.swift +0 -188
  148. package/ios/VisionCameraPlugins/Cropper/Cropper-Bridging-Header.h +0 -13
  149. package/ios/VisionCameraPlugins/Cropper/Cropper.h +0 -20
  150. package/ios/VisionCameraPlugins/Cropper/Cropper.mm +0 -22
  151. package/ios/VisionCameraPlugins/Cropper/Cropper.swift +0 -145
  152. package/ios/VisionCameraPlugins/Cropper/CropperUtils.swift +0 -49
  153. package/ios/VisionCameraPlugins/FaceDetector/FaceDetectorFrameProcessorPlugin-Bridging-Header.h +0 -4
  154. package/ios/VisionCameraPlugins/FaceDetector/FaceDetectorFrameProcessorPlugin.mm +0 -22
  155. package/ios/VisionCameraPlugins/FaceDetector/FaceDetectorFrameProcessorPlugin.swift +0 -320
  156. package/ios/VisionCameraPlugins/TextRecognition/TextRecognitionFrameProcessorPlugin-Bridging-Header.h +0 -4
  157. package/ios/VisionCameraPlugins/TextRecognition/TextRecognitionFrameProcessorPlugin.mm +0 -27
  158. package/ios/VisionCameraPlugins/TextRecognition/TextRecognitionFrameProcessorPlugin.swift +0 -144
  159. package/lib/module/Shared/Libs/camera.utils.js +0 -308
  160. package/lib/module/Shared/Libs/frame-enhancement.utils.js +0 -133
  161. package/lib/module/Shared/Libs/opencv.utils.js +0 -21
  162. package/lib/module/Shared/Libs/worklet.utils.js +0 -68
  163. package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useBarcodeScanner.js +0 -46
  164. package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useCameraPermissions.js +0 -35
  165. package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/index.js +0 -19
  166. package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/scanCodes.js +0 -26
  167. package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/types.js +0 -3
  168. package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/utils/convert.js +0 -197
  169. package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/utils/geometry.js +0 -101
  170. package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/utils/highlights.js +0 -60
  171. package/lib/module/Shared/VisionCameraPlugins/Cropper/index.js +0 -47
  172. package/lib/module/Shared/VisionCameraPlugins/FaceDetector/Camera.js +0 -42
  173. package/lib/module/Shared/VisionCameraPlugins/FaceDetector/detectFaces.js +0 -35
  174. package/lib/module/Shared/VisionCameraPlugins/FaceDetector/index.js +0 -4
  175. package/lib/module/Shared/VisionCameraPlugins/FaceDetector/types.js +0 -3
  176. package/lib/module/Shared/VisionCameraPlugins/TextRecognition/Camera.js +0 -56
  177. package/lib/module/Shared/VisionCameraPlugins/TextRecognition/PhotoRecognizer.js +0 -20
  178. package/lib/module/Shared/VisionCameraPlugins/TextRecognition/RemoveLanguageModel.js +0 -9
  179. package/lib/module/Shared/VisionCameraPlugins/TextRecognition/index.js +0 -6
  180. package/lib/module/Shared/VisionCameraPlugins/TextRecognition/scanText.js +0 -20
  181. package/lib/module/Shared/VisionCameraPlugins/TextRecognition/translateText.js +0 -19
  182. package/lib/module/Shared/VisionCameraPlugins/TextRecognition/types.js +0 -3
  183. package/lib/typescript/src/Shared/Libs/camera.utils.d.ts +0 -87
  184. package/lib/typescript/src/Shared/Libs/camera.utils.d.ts.map +0 -1
  185. package/lib/typescript/src/Shared/Libs/frame-enhancement.utils.d.ts +0 -25
  186. package/lib/typescript/src/Shared/Libs/frame-enhancement.utils.d.ts.map +0 -1
  187. package/lib/typescript/src/Shared/Libs/opencv.utils.d.ts +0 -3
  188. package/lib/typescript/src/Shared/Libs/opencv.utils.d.ts.map +0 -1
  189. package/lib/typescript/src/Shared/Libs/worklet.utils.d.ts +0 -9
  190. package/lib/typescript/src/Shared/Libs/worklet.utils.d.ts.map +0 -1
  191. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useBarcodeScanner.d.ts +0 -13
  192. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useBarcodeScanner.d.ts.map +0 -1
  193. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useCameraPermissions.d.ts +0 -6
  194. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useCameraPermissions.d.ts.map +0 -1
  195. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/index.d.ts +0 -12
  196. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/index.d.ts.map +0 -1
  197. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/scanCodes.d.ts +0 -3
  198. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/scanCodes.d.ts.map +0 -1
  199. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/types.d.ts +0 -52
  200. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/types.d.ts.map +0 -1
  201. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/convert.d.ts +0 -62
  202. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/convert.d.ts.map +0 -1
  203. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/geometry.d.ts +0 -34
  204. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/geometry.d.ts.map +0 -1
  205. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/highlights.d.ts +0 -32
  206. package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/highlights.d.ts.map +0 -1
  207. package/lib/typescript/src/Shared/VisionCameraPlugins/Cropper/index.d.ts +0 -23
  208. package/lib/typescript/src/Shared/VisionCameraPlugins/Cropper/index.d.ts.map +0 -1
  209. package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/Camera.d.ts +0 -9
  210. package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/Camera.d.ts.map +0 -1
  211. package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/detectFaces.d.ts +0 -3
  212. package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/detectFaces.d.ts.map +0 -1
  213. package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/index.d.ts +0 -3
  214. package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/index.d.ts.map +0 -1
  215. package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/types.d.ts +0 -79
  216. package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/types.d.ts.map +0 -1
  217. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/Camera.d.ts +0 -6
  218. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/Camera.d.ts.map +0 -1
  219. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/PhotoRecognizer.d.ts +0 -3
  220. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/PhotoRecognizer.d.ts.map +0 -1
  221. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/RemoveLanguageModel.d.ts +0 -3
  222. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/RemoveLanguageModel.d.ts.map +0 -1
  223. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/index.d.ts +0 -5
  224. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/index.d.ts.map +0 -1
  225. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/scanText.d.ts +0 -3
  226. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/scanText.d.ts.map +0 -1
  227. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/translateText.d.ts +0 -3
  228. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/translateText.d.ts.map +0 -1
  229. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/types.d.ts +0 -67
  230. package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/types.d.ts.map +0 -1
  231. package/src/Shared/Libs/camera.utils.ts +0 -345
  232. package/src/Shared/Libs/frame-enhancement.utils.ts +0 -217
  233. package/src/Shared/Libs/opencv.utils.ts +0 -40
  234. package/src/Shared/Libs/worklet.utils.ts +0 -72
  235. package/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useBarcodeScanner.ts +0 -79
  236. package/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useCameraPermissions.ts +0 -46
  237. package/src/Shared/VisionCameraPlugins/BarcodeScanner/index.ts +0 -60
  238. package/src/Shared/VisionCameraPlugins/BarcodeScanner/scanCodes.ts +0 -32
  239. package/src/Shared/VisionCameraPlugins/BarcodeScanner/types.ts +0 -82
  240. package/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/convert.ts +0 -195
  241. package/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/geometry.ts +0 -135
  242. package/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/highlights.ts +0 -84
  243. package/src/Shared/VisionCameraPlugins/Cropper/index.ts +0 -78
  244. package/src/Shared/VisionCameraPlugins/FaceDetector/Camera.tsx +0 -63
  245. package/src/Shared/VisionCameraPlugins/FaceDetector/detectFaces.ts +0 -44
  246. package/src/Shared/VisionCameraPlugins/FaceDetector/index.ts +0 -3
  247. package/src/Shared/VisionCameraPlugins/FaceDetector/types.ts +0 -99
  248. package/src/Shared/VisionCameraPlugins/TextRecognition/Camera.tsx +0 -76
  249. package/src/Shared/VisionCameraPlugins/TextRecognition/PhotoRecognizer.ts +0 -18
  250. package/src/Shared/VisionCameraPlugins/TextRecognition/RemoveLanguageModel.ts +0 -7
  251. package/src/Shared/VisionCameraPlugins/TextRecognition/index.ts +0 -7
  252. package/src/Shared/VisionCameraPlugins/TextRecognition/scanText.ts +0 -27
  253. package/src/Shared/VisionCameraPlugins/TextRecognition/translateText.ts +0 -21
  254. package/src/Shared/VisionCameraPlugins/TextRecognition/types.ts +0 -141
@@ -1,4 +1,4 @@
1
- import React, { useEffect } from 'react';
1
+ import React, { useEffect, useRef, useCallback, useState } from 'react';
2
2
  import {
3
3
  View,
4
4
  StyleSheet,
@@ -7,152 +7,144 @@ import {
7
7
  Text,
8
8
  Linking,
9
9
  Platform,
10
+ PermissionsAndroid,
11
+ TouchableOpacity,
12
+ type NativeSyntheticEvent,
10
13
  } from 'react-native';
11
14
  import {
12
- Camera,
13
- useCameraDevice,
14
- useCameraFormat,
15
- useCameraPermission,
16
- useFrameProcessor,
17
- type Orientation,
18
- } from 'react-native-vision-camera';
19
- import { useRunOnJS, useSharedValue } from 'react-native-worklets-core';
15
+ TrustchexCamera,
16
+ type TrustchexCameraHandle,
17
+ type Frame,
18
+ } from './TrustchexCamera';
20
19
  import { useKeepAwake } from '../Libs/native-keep-awake.utils';
21
20
  import { useIsFocused } from '@react-navigation/native';
22
21
  import { useTranslation } from 'react-i18next';
22
+ import { debugLog, logError } from '../Libs/debug.utils';
23
23
  import LottieView from 'lottie-react-native';
24
- import { type Barcode, scanCodes } from '../VisionCameraPlugins/BarcodeScanner';
25
24
  import StyledButton from './StyledButton';
26
25
  import { useTheme } from '../Contexts/ThemeContext';
26
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
27
27
 
28
28
  export interface QrCodeScannerCameraProps {
29
29
  onQrCodeScanned: (data: string) => void;
30
+ onClose?: () => void;
30
31
  }
31
32
 
32
- const QrCodeScannerCamera = ({ onQrCodeScanned }: QrCodeScannerCameraProps) => {
33
+ const QrCodeScannerCamera = ({
34
+ onQrCodeScanned,
35
+ onClose,
36
+ }: QrCodeScannerCameraProps) => {
33
37
  useKeepAwake();
34
38
  const theme = useTheme();
35
- const cameraPermission = useCameraPermission();
36
- const [permissionsRequested, setPermissionsRequested] = React.useState(false);
37
- const [isActive, setIsActive] = React.useState(false);
39
+ const insets = useSafeAreaInsets();
40
+ const cameraRef = useRef<TrustchexCameraHandle>(null);
41
+ const [hasPermission, setHasPermission] = useState(false);
42
+ const [permissionsRequested, setPermissionsRequested] = useState(false);
43
+ const [isActive, setIsActive] = useState(false);
38
44
  const isFocused = useIsFocused();
39
- const device = useCameraDevice('back', {
40
- physicalDevices: ['wide-angle-camera'],
41
- });
42
- const format = useCameraFormat(device, [
43
- {
44
- videoResolution: {
45
- width: 1920,
46
- height: 1080,
47
- },
48
- iso: 'max',
49
- photoHdr: false,
50
- videoHdr: false,
51
- },
52
- ]);
53
- const isCameraInitialized = useSharedValue(false);
54
45
  const { t } = useTranslation();
46
+ const lastScanTime = useRef(0);
47
+ const hasScanned = useRef(false);
55
48
 
56
49
  const isInScanningFrame = (
57
- code: Barcode,
50
+ boundingBox: { left: number; top: number; right: number; bottom: number },
58
51
  width: number,
59
- height: number,
60
- orientation: Orientation
52
+ height: number
61
53
  ) => {
54
+ // Match UI scanArea: top: '35%', left: '3%', right: '3%', bottom: '35%'
55
+ // Add 2% margin buffer to ensure code is comfortably inside frame
56
+ const marginBuffer = 0.02;
62
57
  const scanningFrame = {
63
- x: 0.35 * width,
64
- y: 0.03 * height,
65
- width: 0.3 * width,
66
- height: 0.94 * height,
58
+ left: width * (0.03 + marginBuffer),
59
+ top: height * (0.35 + marginBuffer),
60
+ right: width * (0.97 - marginBuffer),
61
+ bottom: height * (0.65 - marginBuffer),
67
62
  };
68
63
 
69
- if (orientation === 'landscape-right' || orientation === 'landscape-left') {
70
- // Adjust scanning frame for landscape orientation
71
- scanningFrame.x = 0.03 * height;
72
- scanningFrame.y = 0.35 * width;
73
- scanningFrame.width = 0.94 * height;
74
- scanningFrame.height = 0.3 * width;
75
- }
64
+ console.log(
65
+ `[QR Frame Check] Frame: ${width}x${height}, Scanning: left=${scanningFrame.left}, top=${scanningFrame.top}, right=${scanningFrame.right}, bottom=${scanningFrame.bottom}`
66
+ );
67
+ console.log(
68
+ `[QR Frame Check] Code bbox: left=${boundingBox.left}, top=${boundingBox.top}, right=${boundingBox.right}, bottom=${boundingBox.bottom}`
69
+ );
76
70
 
77
- // Assuming Barcode has a boundingBox property: { x, y, width, height }
78
- const boundingBox = code.boundingBox;
79
- if (!boundingBox) {
80
- return false;
81
- }
82
- const codeX = boundingBox.origin.x;
83
- const codeY = boundingBox.origin.y;
84
- const codeWidth = boundingBox.size.width;
85
- const codeHeight = boundingBox.size.height;
86
- const codeRight = codeX + codeWidth;
87
- const codeBottom = codeY + codeHeight;
88
- const frameRight = scanningFrame.x + scanningFrame.width;
89
- const frameBottom = scanningFrame.y + scanningFrame.height;
71
+ // Check if entire bounding box is within scanning frame (with margin buffer)
72
+ const isInFrame =
73
+ boundingBox.left >= scanningFrame.left &&
74
+ boundingBox.top >= scanningFrame.top &&
75
+ boundingBox.right <= scanningFrame.right &&
76
+ boundingBox.bottom <= scanningFrame.bottom;
90
77
 
91
- // Check if the code is within the scanning frame
92
- if (
93
- codeX >= scanningFrame.x &&
94
- codeY >= scanningFrame.y &&
95
- codeRight <= frameRight &&
96
- codeBottom <= frameBottom
97
- ) {
98
- return true;
99
- }
78
+ console.log(`[QR Frame Check] Is in frame: ${isInFrame}`);
100
79
 
101
- return false;
80
+ return isInFrame;
102
81
  };
103
82
 
104
- const handleQrCode = useRunOnJS(
105
- (
106
- code: Barcode,
107
- width: number,
108
- height: number,
109
- orientation: Orientation
110
- ) => {
111
- // TODO: Fix iOS coordinates - iOS coordinate system conversion may be incorrect
112
- // causing frame checking to fail. Need to verify coordinate normalization
113
- // between iOS Vision framework and React Native coordinate systems.
83
+ const handleFrame = useCallback(
84
+ async (event: NativeSyntheticEvent<{ frame: Frame }>) => {
85
+ if (hasScanned.current) return;
114
86
 
115
- // On iOS, skip frame checking and scan any QR code found
116
- if (Platform.OS === 'ios') {
117
- if (code.value) {
118
- onQrCodeScanned(code.value);
119
- }
120
- } else {
121
- // On Android, continue with frame checking
122
- if (isInScanningFrame(code, width, height, orientation) && code.value) {
123
- onQrCodeScanned(code.value);
87
+ const now = Date.now();
88
+ // Throttle to ~3 FPS for QR scanning
89
+ if (now - lastScanTime.current < 333) {
90
+ return;
91
+ }
92
+ lastScanTime.current = now;
93
+
94
+ const { frame } = event.nativeEvent;
95
+
96
+ try {
97
+ // Barcodes are already detected natively — read directly from frame
98
+ const barcodes = frame.barcodes;
99
+ if (!barcodes || barcodes.length !== 1) return;
100
+
101
+ const code = barcodes[0];
102
+
103
+ // Use frame checking on both platforms for consistent behavior
104
+ if (
105
+ code.boundingBox &&
106
+ isInScanningFrame(code.boundingBox, frame.width, frame.height) &&
107
+ code.rawValue
108
+ ) {
109
+ hasScanned.current = true;
110
+ onQrCodeScanned(code.rawValue);
124
111
  }
112
+ } catch (error) {
113
+ logError('[QrCodeScannerCamera] Error processing frame:', error);
125
114
  }
126
115
  },
127
116
  [onQrCodeScanned]
128
117
  );
129
118
 
130
- const frameProcessor = useFrameProcessor((frame) => {
131
- 'worklet';
132
-
133
- if (!isCameraInitialized.value) {
134
- return;
135
- }
136
-
137
- const codes = scanCodes(frame, { barcodeTypes: ['qr'] });
138
-
139
- if (codes && codes.length === 1) {
140
- handleQrCode(codes[0], frame.width, frame.height, frame.orientation);
141
- }
119
+ const handleCameraReady = useCallback(() => {
120
+ debugLog('QrCodeScannerCamera', '[QrCodeScannerCamera] Camera ready');
142
121
  }, []);
143
122
 
123
+ const handleCameraError = useCallback(
124
+ (event: NativeSyntheticEvent<{ error: string }>) => {
125
+ logError('[QrCodeScannerCamera] Camera error:', event.nativeEvent.error);
126
+ },
127
+ []
128
+ );
129
+
144
130
  useEffect(() => {
145
131
  const requestPermissions = async () => {
146
- if (!cameraPermission.hasPermission) {
147
- await cameraPermission.requestPermission();
132
+ if (Platform.OS === 'android') {
133
+ const granted = await PermissionsAndroid.request(
134
+ PermissionsAndroid.PERMISSIONS.CAMERA
135
+ );
136
+ setHasPermission(granted === PermissionsAndroid.RESULTS.GRANTED);
137
+ } else {
138
+ // iOS permissions handled by native camera
139
+ setHasPermission(true);
148
140
  }
149
141
  setPermissionsRequested(true);
150
142
  };
151
143
  requestPermissions();
152
- }, [cameraPermission]);
144
+ }, []);
153
145
 
154
146
  useEffect(() => {
155
- if (!!device && !!format && isFocused) {
147
+ if (isFocused && hasPermission) {
156
148
  setIsActive(true);
157
149
  } else {
158
150
  setIsActive(false);
@@ -161,7 +153,7 @@ const QrCodeScannerCamera = ({ onQrCodeScanned }: QrCodeScannerCameraProps) => {
161
153
  return () => {
162
154
  setIsActive(false);
163
155
  };
164
- }, [device, format, isFocused]);
156
+ }, [isFocused, hasPermission]);
165
157
 
166
158
  if (!permissionsRequested) {
167
159
  return (
@@ -171,8 +163,7 @@ const QrCodeScannerCamera = ({ onQrCodeScanned }: QrCodeScannerCameraProps) => {
171
163
  );
172
164
  }
173
165
 
174
- if (!cameraPermission.hasPermission) {
175
- // Camera permission denied by user - their choice, not actionable
166
+ if (!hasPermission) {
176
167
  return (
177
168
  <View style={styles.permissionContainer}>
178
169
  <Text style={styles.permissionText}>
@@ -190,32 +181,18 @@ const QrCodeScannerCamera = ({ onQrCodeScanned }: QrCodeScannerCameraProps) => {
190
181
  );
191
182
  }
192
183
 
193
- if (device == null) {
194
- // No camera device - device limitation, not actionable
195
- return (
196
- <View style={styles.permissionContainer}>
197
- <TextView style={styles.permissionText}>
198
- {t('general.noCameraDetected')}
199
- </TextView>
200
- </View>
201
- );
202
- }
203
-
204
184
  return (
205
185
  <View style={StyleSheet.absoluteFill}>
206
- <Camera
186
+ <TrustchexCamera
187
+ ref={cameraRef}
207
188
  style={StyleSheet.absoluteFill}
208
- frameProcessor={frameProcessor}
209
- device={device}
210
- format={format}
211
- isActive={isActive}
212
- photo={false}
213
- video={false}
214
- audio={false}
215
- onInitialized={() => {
216
- isCameraInitialized.value = true;
217
- }}
218
- fps={30}
189
+ cameraType="back"
190
+ enableFrameProcessing={isActive}
191
+ enableBarcodeScanning={isActive}
192
+ targetFps={30}
193
+ onFrameAvailable={handleFrame}
194
+ onCameraReady={handleCameraReady}
195
+ onCameraError={handleCameraError}
219
196
  />
220
197
  <View style={styles.topZone}>
221
198
  <TextView style={styles.topZoneText}>
@@ -233,6 +210,16 @@ const QrCodeScannerCamera = ({ onQrCodeScanned }: QrCodeScannerCameraProps) => {
233
210
  autoPlay
234
211
  />
235
212
  </View>
213
+ {onClose && (
214
+ <TouchableOpacity
215
+ onPress={onClose}
216
+ style={[styles.backButton, { top: Math.max(insets.top + 10, 50) }]}
217
+ hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
218
+ activeOpacity={0.7}
219
+ >
220
+ <TextView style={styles.backButtonText}>×</TextView>
221
+ </TouchableOpacity>
222
+ )}
236
223
  </View>
237
224
  );
238
225
  };
@@ -289,6 +276,25 @@ const styles = StyleSheet.create({
289
276
  fontWeight: 'bold',
290
277
  padding: 20,
291
278
  },
279
+ backButton: {
280
+ position: 'absolute',
281
+ top: 20,
282
+ left: 20,
283
+ width: 40,
284
+ height: 40,
285
+ borderRadius: 20,
286
+ backgroundColor: 'rgba(255, 255, 255, 0.3)',
287
+ justifyContent: 'center',
288
+ alignItems: 'center',
289
+ zIndex: 999,
290
+ elevation: 5,
291
+ },
292
+ backButtonText: {
293
+ color: 'white',
294
+ fontSize: 28,
295
+ fontWeight: 'bold',
296
+ lineHeight: 28,
297
+ },
292
298
  leftZone: {
293
299
  position: 'absolute',
294
300
  top: '35%',
@@ -0,0 +1,289 @@
1
+ import React, { useRef, useCallback } from 'react';
2
+ import {
3
+ requireNativeComponent,
4
+ type NativeSyntheticEvent,
5
+ StyleSheet,
6
+ type ViewStyle,
7
+ type StyleProp,
8
+ } from 'react-native';
9
+ import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
10
+ import { logError } from '../Libs/debug.utils';
11
+
12
+ // Native component interface
13
+ const TrustchexCameraViewNative =
14
+ requireNativeComponent<TrustchexCameraProps>('TrustchexCamera');
15
+
16
+ // Commands interface for Fabric
17
+ interface NativeCommands {
18
+ setFocusPoint: (
19
+ viewRef: React.ElementRef<typeof TrustchexCameraViewNative>,
20
+ x: number,
21
+ y: number
22
+ ) => void;
23
+ setExposureOffset: (
24
+ viewRef: React.ElementRef<typeof TrustchexCameraViewNative>,
25
+ offset: number
26
+ ) => void;
27
+ startRecording: (
28
+ viewRef: React.ElementRef<typeof TrustchexCameraViewNative>
29
+ ) => void;
30
+ stopRecording: (
31
+ viewRef: React.ElementRef<typeof TrustchexCameraViewNative>
32
+ ) => void;
33
+ cancelRecording: (
34
+ viewRef: React.ElementRef<typeof TrustchexCameraViewNative>
35
+ ) => void;
36
+ deleteRecording: (
37
+ viewRef: React.ElementRef<typeof TrustchexCameraViewNative>,
38
+ filePath: string
39
+ ) => void;
40
+ }
41
+
42
+ const Commands = codegenNativeCommands<NativeCommands>({
43
+ supportedCommands: [
44
+ 'setFocusPoint',
45
+ 'setExposureOffset',
46
+ 'startRecording',
47
+ 'stopRecording',
48
+ 'cancelRecording',
49
+ 'deleteRecording',
50
+ ],
51
+ });
52
+
53
+ // Frame data structure — ML Kit results come pre-processed from native
54
+ export interface Frame {
55
+ width: number;
56
+ height: number;
57
+ orientation: number;
58
+ timestamp: number;
59
+ brightness?: number; // Average Y-plane luminance (0-255), computed natively
60
+ base64Image?: string; // JPEG base64 (only when includeBase64 or faceDetection enabled)
61
+ // Native ML Kit results (populated when corresponding detection mode is enabled)
62
+ faces?: NativeFace[];
63
+ textBlocks?: NativeTextBlock[];
64
+ resultText?: string;
65
+ barcodes?: NativeBarcode[];
66
+ mrzResult?: NativeMRZResult;
67
+ }
68
+
69
+ export interface NativeFace {
70
+ bounds: { x: number; y: number; width: number; height: number };
71
+ yawAngle: number;
72
+ pitchAngle: number;
73
+ rollAngle: number;
74
+ smilingProbability?: number;
75
+ leftEyeOpenProbability?: number;
76
+ rightEyeOpenProbability?: number;
77
+ }
78
+
79
+ export interface NativeTextBlock {
80
+ text: string;
81
+ blockFrame?: {
82
+ x: number;
83
+ y: number;
84
+ width: number;
85
+ height: number;
86
+ boundingCenterX: number;
87
+ boundingCenterY: number;
88
+ };
89
+ cornerPoints?: Array<{ x: number; y: number }>;
90
+ }
91
+
92
+ export interface NativeBarcode {
93
+ rawValue: string;
94
+ displayValue: string;
95
+ format: number;
96
+ boundingBox?: { left: number; top: number; right: number; bottom: number };
97
+ cornerPoints?: Array<{ x: number; y: number }>;
98
+ }
99
+
100
+ export interface NativeMRZResult {
101
+ valid: boolean;
102
+ format: string;
103
+ error?: string;
104
+ documentCode?: string;
105
+ issuingState?: string;
106
+ documentNumber?: string;
107
+ lastName?: string;
108
+ firstName?: string;
109
+ birthDate?: string;
110
+ sex?: string;
111
+ expirationDate?: string;
112
+ nationality?: string;
113
+ optional1?: string;
114
+ optional2?: string;
115
+ rawLines?: string;
116
+ }
117
+
118
+ interface TrustchexCameraProps {
119
+ style?: StyleProp<ViewStyle>;
120
+ cameraType?: 'front' | 'back';
121
+ torchEnabled?: boolean;
122
+ enableFrameProcessing?: boolean;
123
+ targetFps?: number;
124
+ // ML Kit detection modes — processing runs natively, results arrive in Frame
125
+ enableFaceDetection?: boolean;
126
+ enableTextRecognition?: boolean;
127
+ enableBarcodeScanning?: boolean;
128
+ enableMrzValidation?: boolean;
129
+ includeBase64?: boolean;
130
+ onFrameAvailable?: (event: NativeSyntheticEvent<{ frame: Frame }>) => void;
131
+ onCameraReady?: (
132
+ event: NativeSyntheticEvent<{
133
+ minExposureOffset: number;
134
+ maxExposureOffset: number;
135
+ }>
136
+ ) => void;
137
+ onCameraError?: (event: NativeSyntheticEvent<{ error: string }>) => void;
138
+ onRecordingFinished?: (event: NativeSyntheticEvent<{ path: string }>) => void;
139
+ onRecordingError?: (event: NativeSyntheticEvent<{ error: string }>) => void;
140
+ }
141
+
142
+ export interface TrustchexCameraHandle {
143
+ setFocusPoint: (x: number, y: number) => void;
144
+ setExposureOffset: (offset: number) => void;
145
+ startRecording: (options: {
146
+ fileType?: string;
147
+ videoCodec?: string;
148
+ onRecordingFinished?: (video: { path: string }) => void;
149
+ onRecordingError?: (error: { error: string }) => void;
150
+ }) => void;
151
+ stopRecording: () => Promise<void>;
152
+ cancelRecording: () => Promise<void>;
153
+ deleteRecording: (filePath: string) => void;
154
+ }
155
+
156
+ export const TrustchexCamera = React.forwardRef<
157
+ TrustchexCameraHandle,
158
+ TrustchexCameraProps
159
+ >((props, ref) => {
160
+ const cameraRef = useRef(null);
161
+ const recordingCallbacksRef = useRef<{
162
+ onRecordingFinished?: (video: { path: string }) => void;
163
+ onRecordingError?: (error: { error: string }) => void;
164
+ }>({});
165
+
166
+ const handleRecordingFinished = useCallback(
167
+ (event: NativeSyntheticEvent<{ path: string }>) => {
168
+ recordingCallbacksRef.current.onRecordingFinished?.({
169
+ path: event.nativeEvent.path,
170
+ });
171
+ },
172
+ []
173
+ );
174
+
175
+ const handleRecordingError = useCallback(
176
+ (event: NativeSyntheticEvent<{ error: string }>) => {
177
+ recordingCallbacksRef.current.onRecordingError?.({
178
+ error: event.nativeEvent.error,
179
+ });
180
+ },
181
+ []
182
+ );
183
+
184
+ const setFocusPoint = useCallback((x: number, y: number) => {
185
+ try {
186
+ if (cameraRef.current) {
187
+ Commands.setFocusPoint(cameraRef.current, x, y);
188
+ }
189
+ } catch (error) {
190
+ logError('[TrustchexCamera] setFocusPoint error:', error);
191
+ }
192
+ }, []);
193
+
194
+ const setExposureOffset = useCallback((offset: number) => {
195
+ try {
196
+ if (cameraRef.current) {
197
+ Commands.setExposureOffset(cameraRef.current, offset);
198
+ }
199
+ } catch (error) {
200
+ logError('[TrustchexCamera] setExposureOffset error:', error);
201
+ }
202
+ }, []);
203
+
204
+ const startRecording = useCallback(
205
+ (options: {
206
+ fileType?: string;
207
+ videoCodec?: string;
208
+ onRecordingFinished?: (video: { path: string }) => void;
209
+ onRecordingError?: (error: { error: string }) => void;
210
+ }) => {
211
+ recordingCallbacksRef.current = {
212
+ onRecordingFinished: options.onRecordingFinished,
213
+ onRecordingError: options.onRecordingError,
214
+ };
215
+ try {
216
+ if (cameraRef.current) {
217
+ Commands.startRecording(cameraRef.current);
218
+ }
219
+ } catch (error) {
220
+ logError('[TrustchexCamera] startRecording error:', error);
221
+ options.onRecordingError?.({ error: (error as Error).message });
222
+ }
223
+ },
224
+ []
225
+ );
226
+
227
+ const stopRecording = useCallback(() => {
228
+ return new Promise<void>((resolve) => {
229
+ try {
230
+ if (cameraRef.current) {
231
+ Commands.stopRecording(cameraRef.current);
232
+ }
233
+ } catch (error) {
234
+ logError('[TrustchexCamera] stopRecording error:', error);
235
+ }
236
+ resolve();
237
+ });
238
+ }, []);
239
+
240
+ const cancelRecording = useCallback(() => {
241
+ return new Promise<void>((resolve) => {
242
+ // Clear callbacks to prevent stale onRecordingFinished from firing
243
+ recordingCallbacksRef.current = {};
244
+ try {
245
+ if (cameraRef.current) {
246
+ Commands.cancelRecording(cameraRef.current);
247
+ }
248
+ } catch (error) {
249
+ logError('[TrustchexCamera] cancelRecording error:', error);
250
+ }
251
+ resolve();
252
+ });
253
+ }, []);
254
+
255
+ const deleteRecording = useCallback((filePath: string) => {
256
+ try {
257
+ if (cameraRef.current) {
258
+ Commands.deleteRecording(cameraRef.current, filePath);
259
+ }
260
+ } catch (error) {
261
+ logError('[TrustchexCamera] deleteRecording error:', error);
262
+ }
263
+ }, []);
264
+
265
+ React.useImperativeHandle(ref, () => ({
266
+ setFocusPoint,
267
+ setExposureOffset,
268
+ startRecording,
269
+ stopRecording,
270
+ cancelRecording,
271
+ deleteRecording,
272
+ }));
273
+
274
+ return (
275
+ <TrustchexCameraViewNative
276
+ ref={cameraRef}
277
+ {...props}
278
+ onRecordingFinished={handleRecordingFinished}
279
+ onRecordingError={handleRecordingError}
280
+ style={[styles.camera, props.style]}
281
+ />
282
+ );
283
+ });
284
+
285
+ const styles = StyleSheet.create({
286
+ camera: {
287
+ flex: 1,
288
+ },
289
+ });
@@ -17,8 +17,8 @@ export const ENHANCEMENT_CONFIG = {
17
17
  mrzScanning: { low: 45, high: 130, target: 80 },
18
18
  },
19
19
  adaptiveStep: true,
20
- maxStepSize: 2, // Reduced from 3 for smoother transitions
21
- hysteresis: 5, // Dead zone to prevent oscillation
20
+ maxStepSize: 2, // Reduced from 3 for smoother transitions
21
+ hysteresis: 5, // Dead zone to prevent oscillation
22
22
  },
23
23
 
24
24
  contrast: {