@sanctum-key/react-native-sdk 1.0.6 → 1.0.7

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 (206) hide show
  1. package/README.md +3 -3
  2. package/android/build/.transforms/{f62cb96b2d1f78ca96ab35932dd530dc → c9d62bb333688ab562f51958998d5a48}/transformed/classes/classes_dex/classes.dex +0 -0
  3. package/android/build/generated/source/buildConfig/debug/kyc/{transfergratis → SanctumKey}/com/BuildConfig.java +2 -2
  4. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +1 -1
  5. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +1 -1
  6. package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  7. package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  8. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +2 -2
  9. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/kyc/SanctumKey/com/BuildConfig.class +0 -0
  10. package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +1 -1
  11. package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +1 -1
  12. package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  13. package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +1 -1
  14. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  15. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  16. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  17. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
  18. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
  19. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  20. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  21. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
  22. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
  23. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  24. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  25. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  26. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  27. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  28. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  29. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
  30. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
  31. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  32. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
  33. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  34. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  35. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  36. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  37. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  38. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
  39. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
  40. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
  41. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  42. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  43. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  44. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  45. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  46. package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  47. package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
  48. package/android/build/outputs/logs/manifest-merger-debug-report.txt +1 -1
  49. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  50. package/android/build/tmp/kotlin-classes/debug/kyc/SanctumKey/com/SanctumKeySdkModule$definition$1$5$1.class +0 -0
  51. package/android/build/tmp/kotlin-classes/debug/kyc/SanctumKey/com/SanctumKeySdkModule$definition$1$5$2.class +0 -0
  52. package/android/build/tmp/kotlin-classes/debug/kyc/{transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$1.class → SanctumKey/com/SanctumKeySdkModule$definition$lambda$5$$inlined$AsyncFunction$1.class} +0 -0
  53. package/android/build/tmp/kotlin-classes/debug/kyc/{transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$2.class → SanctumKey/com/SanctumKeySdkModule$definition$lambda$5$$inlined$AsyncFunction$2.class} +0 -0
  54. package/android/build/tmp/kotlin-classes/debug/kyc/{transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$3.class → SanctumKey/com/SanctumKeySdkModule$definition$lambda$5$$inlined$AsyncFunction$3.class} +0 -0
  55. package/android/build/tmp/kotlin-classes/debug/kyc/{transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$4.class → SanctumKey/com/SanctumKeySdkModule$definition$lambda$5$$inlined$AsyncFunction$4.class} +0 -0
  56. package/android/build/tmp/kotlin-classes/debug/kyc/{transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$5.class → SanctumKey/com/SanctumKeySdkModule$definition$lambda$5$$inlined$AsyncFunction$5.class} +0 -0
  57. package/android/build/tmp/kotlin-classes/debug/kyc/{transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$6.class → SanctumKey/com/SanctumKeySdkModule$definition$lambda$5$$inlined$AsyncFunction$6.class} +0 -0
  58. package/android/build/tmp/kotlin-classes/debug/kyc/{transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$1.class → SanctumKey/com/SanctumKeySdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$1.class} +0 -0
  59. package/android/build/tmp/kotlin-classes/debug/kyc/{transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$2.class → SanctumKey/com/SanctumKeySdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$2.class} +0 -0
  60. package/android/build/tmp/kotlin-classes/debug/kyc/{transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$3.class → SanctumKey/com/SanctumKeySdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$3.class} +0 -0
  61. package/android/build/tmp/kotlin-classes/debug/kyc/{transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$4.class → SanctumKey/com/SanctumKeySdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$4.class} +0 -0
  62. package/android/build/tmp/kotlin-classes/debug/kyc/SanctumKey/com/SanctumKeySdkModule$definition$lambda$5$$inlined$View$1.class +0 -0
  63. package/android/build/tmp/kotlin-classes/debug/kyc/{transfergratis/com/TransfergratisSdkModule$definition$lambda$5$lambda$4$$inlined$Prop$1.class → SanctumKey/com/SanctumKeySdkModule$definition$lambda$5$lambda$4$$inlined$Prop$1.class} +0 -0
  64. package/android/build/tmp/kotlin-classes/debug/kyc/{transfergratis/com/TransfergratisSdkModule$definition$lambda$5$lambda$4$$inlined$Prop$2.class → SanctumKey/com/SanctumKeySdkModule$definition$lambda$5$lambda$4$$inlined$Prop$2.class} +0 -0
  65. package/android/build/tmp/kotlin-classes/debug/kyc/{transfergratis/com/TransfergratisSdkModule.class → SanctumKey/com/SanctumKeySdkModule.class} +0 -0
  66. package/android/build/tmp/kotlin-classes/debug/kyc/{transfergratis/com/TransfergratisSdkView.class → SanctumKey/com/SanctumKeySdkView.class} +0 -0
  67. package/android/build.gradle +2 -2
  68. package/android/src/main/AndroidManifest.xml +1 -1
  69. package/android/src/main/java/kyc/transfergratis/com/TransfergratisSdkModule.kt +6 -6
  70. package/android/src/main/java/kyc/transfergratis/com/TransfergratisSdkView.kt +2 -2
  71. package/build/package.json +9 -7
  72. package/build/src/App.d.ts +2 -2
  73. package/build/src/App.d.ts.map +1 -1
  74. package/build/src/App.js +2 -2
  75. package/build/src/App.js.map +1 -1
  76. package/build/src/{TransfergratisSdk.types.d.ts → SanctumKeySdk.types.d.ts} +3 -3
  77. package/build/src/SanctumKeySdk.types.d.ts.map +1 -0
  78. package/build/src/SanctumKeySdk.types.js +2 -0
  79. package/build/src/SanctumKeySdk.types.js.map +1 -0
  80. package/build/src/{TransfergratisSdkModule.d.ts → SanctumKeySdkModule.d.ts} +4 -4
  81. package/build/src/SanctumKeySdkModule.d.ts.map +1 -0
  82. package/build/src/{TransfergratisSdkModule.js → SanctumKeySdkModule.js} +2 -2
  83. package/build/src/SanctumKeySdkModule.js.map +1 -0
  84. package/build/src/{TransfergratisSdkModule.web.d.ts → SanctumKeySdkModule.web.d.ts} +4 -4
  85. package/build/src/SanctumKeySdkModule.web.d.ts.map +1 -0
  86. package/build/src/{TransfergratisSdkModule.web.js → SanctumKeySdkModule.web.js} +3 -3
  87. package/build/src/SanctumKeySdkModule.web.js.map +1 -0
  88. package/build/src/SanctumKeySdkView.d.ts +4 -0
  89. package/build/src/SanctumKeySdkView.d.ts.map +1 -0
  90. package/build/src/SanctumKeySdkView.js +7 -0
  91. package/build/src/SanctumKeySdkView.js.map +1 -0
  92. package/build/src/SanctumKeySdkView.web.d.ts +4 -0
  93. package/build/src/SanctumKeySdkView.web.d.ts.map +1 -0
  94. package/build/src/{TransfergratisSdkView.web.js → SanctumKeySdkView.web.js} +2 -2
  95. package/build/src/SanctumKeySdkView.web.js.map +1 -0
  96. package/build/src/api/axios.js +2 -2
  97. package/build/src/api/axios.js.map +1 -1
  98. package/build/src/components/EnhancedCameraView.d.ts.map +1 -1
  99. package/build/src/components/EnhancedCameraView.js +66 -338
  100. package/build/src/components/EnhancedCameraView.js.map +1 -1
  101. package/build/src/components/KYCElements/EmailVerificationTemplate.d.ts.map +1 -1
  102. package/build/src/components/KYCElements/EmailVerificationTemplate.js +93 -15
  103. package/build/src/components/KYCElements/EmailVerificationTemplate.js.map +1 -1
  104. package/build/src/components/KYCElements/IDCardCapture.d.ts.map +1 -1
  105. package/build/src/components/KYCElements/IDCardCapture.js +167 -695
  106. package/build/src/components/KYCElements/IDCardCapture.js.map +1 -1
  107. package/build/src/components/KYCElements/PhoneVerificationTemplate.d.ts.map +1 -1
  108. package/build/src/components/KYCElements/PhoneVerificationTemplate.js +269 -40
  109. package/build/src/components/KYCElements/PhoneVerificationTemplate.js.map +1 -1
  110. package/build/src/components/KYCElements/SelfieCapture.d.ts +1 -1
  111. package/build/src/components/KYCElements/SelfieCapture.d.ts.map +1 -1
  112. package/build/src/components/KYCElements/SelfieCapture.js +130 -192
  113. package/build/src/components/KYCElements/SelfieCapture.js.map +1 -1
  114. package/build/src/components/KYCElements/SelfieCaptureTemplate.d.ts.map +1 -1
  115. package/build/src/components/KYCElements/SelfieCaptureTemplate.js +131 -433
  116. package/build/src/components/KYCElements/SelfieCaptureTemplate.js.map +1 -1
  117. package/build/src/components/NativeCameraView.js +1 -1
  118. package/build/src/components/NativeCameraView.js.map +1 -1
  119. package/build/src/components/OverLay/IdCard.d.ts +3 -2
  120. package/build/src/components/OverLay/IdCard.d.ts.map +1 -1
  121. package/build/src/components/OverLay/IdCard.js +149 -141
  122. package/build/src/components/OverLay/IdCard.js.map +1 -1
  123. package/build/src/components/OverLay/SelfieOverlay.d.ts +2 -1
  124. package/build/src/components/OverLay/SelfieOverlay.d.ts.map +1 -1
  125. package/build/src/components/OverLay/SelfieOverlay.js +37 -95
  126. package/build/src/components/OverLay/SelfieOverlay.js.map +1 -1
  127. package/build/src/components/OverLay/type.d.ts +1 -0
  128. package/build/src/components/OverLay/type.d.ts.map +1 -1
  129. package/build/src/components/OverLay/type.js.map +1 -1
  130. package/build/src/components/Svgs/scanningLine.d.ts +2 -1
  131. package/build/src/components/Svgs/scanningLine.d.ts.map +1 -1
  132. package/build/src/components/Svgs/scanningLine.js +55 -51
  133. package/build/src/components/Svgs/scanningLine.js.map +1 -1
  134. package/build/src/config/KYCConfig.js +1 -1
  135. package/build/src/config/KYCConfig.js.map +1 -1
  136. package/build/src/config/allowedDomains.js +6 -6
  137. package/build/src/config/allowedDomains.js.map +1 -1
  138. package/build/src/hooks/useTemplateKYCFlow.d.ts.map +1 -1
  139. package/build/src/hooks/useTemplateKYCFlow.js +37 -38
  140. package/build/src/hooks/useTemplateKYCFlow.js.map +1 -1
  141. package/build/src/index.d.ts +3 -3
  142. package/build/src/index.d.ts.map +1 -1
  143. package/build/src/index.js +3 -3
  144. package/build/src/index.js.map +1 -1
  145. package/build/src/modules/api/CardAuthentification.d.ts +0 -5
  146. package/build/src/modules/api/CardAuthentification.d.ts.map +1 -1
  147. package/build/src/modules/api/CardAuthentification.js +114 -116
  148. package/build/src/modules/api/CardAuthentification.js.map +1 -1
  149. package/build/src/modules/api/KYCService.d.ts +11 -1
  150. package/build/src/modules/api/KYCService.d.ts.map +1 -1
  151. package/build/src/modules/api/KYCService.js +101 -38
  152. package/build/src/modules/api/KYCService.js.map +1 -1
  153. package/build/src/modules/camera/NativeCameraModule.js +17 -17
  154. package/build/src/modules/camera/NativeCameraModule.js.map +1 -1
  155. package/expo-module.config.json +2 -2
  156. package/ios/TransfergratisSdk.podspec +2 -2
  157. package/ios/TransfergratisSdkModule.swift +12 -12
  158. package/package.json +9 -7
  159. package/src/App.tsx +2 -2
  160. package/src/{TransfergratisSdk.types.ts → SanctumKeySdk.types.ts} +2 -2
  161. package/src/{TransfergratisSdkModule.ts → SanctumKeySdkModule.ts} +3 -3
  162. package/src/{TransfergratisSdkModule.web.ts → SanctumKeySdkModule.web.ts} +3 -3
  163. package/src/SanctumKeySdkView.tsx +11 -0
  164. package/src/{TransfergratisSdkView.web.tsx → SanctumKeySdkView.web.tsx} +2 -2
  165. package/src/api/axios.ts +2 -2
  166. package/src/components/EnhancedCameraView.tsx +81 -400
  167. package/src/components/KYCElements/EmailVerificationTemplate.tsx +115 -26
  168. package/src/components/KYCElements/IDCardCapture.tsx +228 -868
  169. package/src/components/KYCElements/PhoneVerificationTemplate.tsx +328 -60
  170. package/src/components/KYCElements/SelfieCapture.tsx +184 -213
  171. package/src/components/KYCElements/SelfieCaptureTemplate.tsx +330 -662
  172. package/src/components/NativeCameraView.tsx +1 -1
  173. package/src/components/OverLay/IdCard.tsx +218 -217
  174. package/src/components/OverLay/SelfieOverlay.tsx +56 -134
  175. package/src/components/OverLay/type.ts +1 -0
  176. package/src/components/Svgs/scanningLine.tsx +71 -72
  177. package/src/config/KYCConfig.ts +1 -1
  178. package/src/config/allowedDomains.ts +6 -6
  179. package/src/hooks/useTemplateKYCFlow.tsx +45 -39
  180. package/src/i18n/README.md +1 -1
  181. package/src/index.ts +3 -3
  182. package/src/modules/api/CardAuthentification.ts +202 -200
  183. package/src/modules/api/KYCService.ts +168 -53
  184. package/src/modules/camera/NativeCameraModule.ts +17 -17
  185. package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$1$5$1.class +0 -0
  186. package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$1$5$2.class +0 -0
  187. package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$View$1.class +0 -0
  188. package/build/src/TransfergratisSdk.types.d.ts.map +0 -1
  189. package/build/src/TransfergratisSdk.types.js +0 -2
  190. package/build/src/TransfergratisSdk.types.js.map +0 -1
  191. package/build/src/TransfergratisSdkModule.d.ts.map +0 -1
  192. package/build/src/TransfergratisSdkModule.js.map +0 -1
  193. package/build/src/TransfergratisSdkModule.web.d.ts.map +0 -1
  194. package/build/src/TransfergratisSdkModule.web.js.map +0 -1
  195. package/build/src/TransfergratisSdkView.d.ts +0 -4
  196. package/build/src/TransfergratisSdkView.d.ts.map +0 -1
  197. package/build/src/TransfergratisSdkView.js +0 -7
  198. package/build/src/TransfergratisSdkView.js.map +0 -1
  199. package/build/src/TransfergratisSdkView.web.d.ts +0 -4
  200. package/build/src/TransfergratisSdkView.web.d.ts.map +0 -1
  201. package/build/src/TransfergratisSdkView.web.js.map +0 -1
  202. package/src/TransfergratisSdkView.tsx +0 -11
  203. /package/android/build/.transforms/{532c0e65d82f446633d0a7dab2772198 → ab90740579f5bd05b27b4343ada2d1c9}/results.bin +0 -0
  204. /package/android/build/.transforms/{532c0e65d82f446633d0a7dab2772198 → ab90740579f5bd05b27b4343ada2d1c9}/transformed/classes/classes_dex/classes.dex +0 -0
  205. /package/android/build/.transforms/{f62cb96b2d1f78ca96ab35932dd530dc → c9d62bb333688ab562f51958998d5a48}/results.bin +0 -0
  206. /package/android/build/{intermediates/javac/debug/compileDebugJavaWithJavac/classes/kyc/transfergratis/com/BuildConfig.class → tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/BuildConfig.class.uniqueId0} +0 -0
@@ -10,7 +10,7 @@ export interface NativeCameraViewProps {
10
10
  onError?: (event: any) => void;
11
11
  }
12
12
 
13
- const NativeCameraViewComponent = requireNativeViewManager('TransfergratisSdk_TransfergratisSdkView');
13
+ const NativeCameraViewComponent = requireNativeViewManager('SanctumKeySdk_SanctumKeySdkView');
14
14
 
15
15
  export const NativeCameraView: React.FC<NativeCameraViewProps> = (props) => {
16
16
 
@@ -1,277 +1,278 @@
1
- import { Animated, Dimensions, StyleSheet, Text, View } from "react-native";
2
- import Svg, { Defs, Mask, Rect, Path } from "react-native-svg";
3
- import ScanningLine from "../Svgs/scanningLine";
4
- import { IdCardOverlayProps } from "./type";
5
- import StepOverlay from "./StepOverlay";
1
+ import React from 'react';
2
+ import {
3
+ Animated,
4
+ Dimensions,
5
+ Platform,
6
+ SafeAreaView,
7
+ StatusBar,
8
+ StyleSheet,
9
+ Text,
10
+ View,
11
+ } from 'react-native';
12
+ import Svg, {
13
+ Defs,
14
+ G,
15
+ LinearGradient,
16
+ Mask,
17
+ Path,
18
+ Rect,
19
+ Stop,
20
+ } from 'react-native-svg';
21
+ import ScanningLine from '../Svgs/scanningLine';
22
+ import StepOverlay from './StepOverlay';
23
+ import { IdCardOverlayProps } from './type';
6
24
 
25
+ const { width: screenWidth, height: screenHeight } = Dimensions.get('window');
7
26
 
27
+ const IdCardOverlay = ({
28
+ cornerOpacity,
29
+ instructions,
30
+ stepperProps,
31
+ isSuccess,
32
+ language = 'en',
33
+ // Note: xMinPercent, yMinPercent, etc. are intentionally ignored below
34
+ // to force a mathematically perfect ID card aspect ratio.
35
+ }: IdCardOverlayProps) => {
36
+ const AnimatedG = Animated.createAnimatedComponent(G);
8
37
 
38
+ // --- 🚨 GEOMETRY FIX: Perfect ID Card Ratio ---
39
+ // Standard ISO ID-1 ratio is 1.586 (85.6mm / 53.98mm)
40
+ const ID_ASPECT_RATIO = 1.586;
41
+
42
+ // Set width to 85% of the screen, and calculate perfect height
43
+ const boxWidth = screenWidth * 0.85;
44
+ const boxHeight = boxWidth / ID_ASPECT_RATIO;
9
45
 
10
- const IdCardOverlay = ({ xMin: xMinProps, yMin: yMinProps, xMax: xMaxProps, yMax: yMaxProps, cornerOpacity, instructions, cornerColor = "#4CAF50", stepperProps, isSuccess, language }: IdCardOverlayProps) => {
11
- const screenWidth = Dimensions.get('window').width;
12
- const screenHeight = Dimensions.get('window').height;
46
+ // Center horizontally
47
+ const xMin = (screenWidth - boxWidth) / 2;
48
+ const xMax = xMin + boxWidth;
13
49
 
14
- const boxWidth = xMaxProps - xMinProps;
15
- const boxHeight = yMaxProps - yMinProps;
50
+ // Center vertically (shifted slightly up for better holding ergonomics)
51
+ const yMin = (screenHeight - boxHeight) * 0.42;
52
+ const yMax = yMin + boxHeight;
16
53
 
17
-
54
+ // --- Clean, Professional Copy Formatting ---
55
+ const formatDocType = (type?: string) => {
56
+ if (!type) return 'document';
57
+ // e.g., "identity_card" -> "identity card"
58
+ return type.replace(/_/g, ' ').toLowerCase();
59
+ };
18
60
 
61
+ const getSideText = (side?: string) => {
62
+ // Using "recto/verso" for French as it is much more professional for documents
63
+ if (side === 'front') return language === 'en' ? 'front' : 'recto';
64
+ return language === 'en' ? 'back' : 'verso';
65
+ };
19
66
 
67
+ const docTypeFormatted = formatDocType(stepperProps?.selectedDocumentType);
68
+ const sideText = getSideText(stepperProps?.side);
20
69
 
70
+ const bottomTitle = language === 'en'
71
+ ? `Position the ${sideText} of your ${docTypeFormatted}`
72
+ : `Positionnez le ${sideText} de votre ${docTypeFormatted}`;
21
73
 
22
- // Calculer les coordonnées pour centrer le cadre
23
- const xMin = (screenWidth - boxWidth) / 2;
24
- const yMin = (screenHeight - boxHeight) / 3;
25
- const xMax = xMin + boxWidth;
26
- const yMax = yMin + boxHeight;
74
+ const bottomSubtitle = language === 'en'
75
+ ? 'Ensure all details are clear and readable.'
76
+ : 'Assurez-vous que tous les détails sont lisibles.';
27
77
 
28
- return (
29
- <View style={StyleSheet.absoluteFill}>
30
- {stepperProps ? (
31
- <StepOverlay {...stepperProps} />
32
- ) : null}
78
+ const helperText = language === 'en'
79
+ ? 'No glare • All corners visible • Hold steady'
80
+ : 'Pas de reflets • Coins visibles • Maintenez stable';
33
81
 
34
- <Animated.View style={[styles.topIntruction]}>
35
- <Text style={styles.topIntructionText}>
36
- 💡 {instructions}
37
- </Text>
38
- </Animated.View>
82
+ // --- SVG Constants ---
83
+ const CORNER_SIZE = 40;
84
+ const STROKE_WIDTH = 4;
85
+ const BORDER_RADIUS = 16; // Reduced slightly for a tighter, more realistic card feel
39
86
 
40
- <Svg
41
- height={screenHeight}
42
- width={screenWidth}
43
- style={styles.svg}
44
- >
87
+ return (
88
+ <View style={StyleSheet.absoluteFill} pointerEvents="box-none">
89
+ <StatusBar translucent backgroundColor="transparent" barStyle="light-content" />
90
+
91
+ {/* SVG Overlay */}
92
+ <Svg width={screenWidth} height={screenHeight} style={styles.svg}>
45
93
  <Defs>
46
94
  <Mask id="cameraMask">
47
- {/* Fond blanc - zone visible */}
48
- <Rect
49
- x="0"
50
- y="0"
51
- width={screenWidth}
52
- height={screenHeight}
53
- fill="white"
54
- />
55
- {/* Zone noire - zone masquée (transparente) */}
95
+ <Rect x="0" y="0" width={screenWidth} height={screenHeight} fill="white" />
96
+ {/* Transparent Cutout */}
56
97
  <Rect
57
98
  x={xMin}
58
99
  y={yMin}
59
100
  width={boxWidth}
60
101
  height={boxHeight}
102
+ rx={BORDER_RADIUS}
103
+ ry={BORDER_RADIUS}
61
104
  fill="black"
62
105
  />
63
106
  </Mask>
107
+ <LinearGradient id="scanBorderGradient" x1="0%" y1="0%" x2="100%" y2="100%">
108
+ <Stop offset="0%" stopColor="#4ADE80" />
109
+ <Stop offset="100%" stopColor="#22C55E" />
110
+ </LinearGradient>
64
111
  </Defs>
65
-
66
- {/* Overlay semi-transparent avec masque */}
112
+
113
+ {/* Dim background */}
114
+ <Rect x="0" y="0" width={screenWidth} height={screenHeight} fill="rgba(0,0,0,0.85)" mask="url(#cameraMask)" />
115
+
116
+ {/* Main Card Border */}
67
117
  <Rect
68
- x="0"
69
- y="0"
70
- width={screenWidth}
71
- height={screenHeight}
72
- fill="rgba(0, 0, 0, 0.5)"
73
- mask="url(#cameraMask)"
74
- />
75
-
76
- {/* Coins de la zone de capture - arrondis avec animation */}
77
- {/* Coin supérieur gauche */}
78
- <Path
79
- d={`M ${xMin + 15} ${yMin} Q ${xMin} ${yMin} ${xMin} ${yMin + 15} L ${xMin} ${yMin + 20}`}
80
- stroke={cornerColor}
81
- strokeWidth="8"
82
- fill="none"
83
- opacity={cornerOpacity}
84
- />
85
- <Path
86
- d={`M ${xMin + 20} ${yMin} L ${xMin + 15} ${yMin}`}
87
- stroke={cornerColor}
88
- strokeWidth="8"
89
- opacity={cornerOpacity}
90
- />
91
-
92
- {/* Coin supérieur droit */}
93
- <Path
94
- d={`M ${xMax - 15} ${yMin} Q ${xMax} ${yMin} ${xMax} ${yMin + 15} L ${xMax} ${yMin + 20}`}
95
- stroke={cornerColor}
96
- strokeWidth="8"
97
- fill="none"
98
- opacity={cornerOpacity}
99
- />
100
- <Path
101
- d={`M ${xMax - 20} ${yMin} L ${xMax - 15} ${yMin}`}
102
- stroke={cornerColor}
103
- strokeWidth="8"
104
- opacity={cornerOpacity}
105
- />
106
-
107
- {/* Coin inférieur gauche */}
108
- <Path
109
- d={`M ${xMin + 15} ${yMax} Q ${xMin} ${yMax} ${xMin} ${yMax - 15} L ${xMin} ${yMax - 20}`}
110
- stroke={cornerColor}
111
- strokeWidth="8"
112
- fill="none"
113
- opacity={cornerOpacity}
114
- />
115
- <Path
116
- d={`M ${xMin + 20} ${yMax} L ${xMin + 15} ${yMax}`}
117
- stroke={cornerColor}
118
- strokeWidth="8"
119
- opacity={cornerOpacity}
120
- />
121
-
122
- {/* Coin inférieur droit */}
123
- <Path
124
- d={`M ${xMax - 15} ${yMax} Q ${xMax} ${yMax} ${xMax} ${yMax - 15} L ${xMax} ${yMax - 20}`}
125
- stroke={cornerColor}
126
- strokeWidth="8"
127
- fill="none"
128
- opacity={cornerOpacity}
129
- />
130
- <Path
131
- d={`M ${xMax - 20} ${yMax} L ${xMax - 15} ${yMax}`}
132
- stroke={cornerColor}
133
- strokeWidth="8"
134
- opacity={cornerOpacity}
118
+ x={xMin}
119
+ y={yMin}
120
+ width={boxWidth}
121
+ height={boxHeight}
122
+ rx={BORDER_RADIUS}
123
+ ry={BORDER_RADIUS}
124
+ stroke="rgba(255,255,255,0.25)" // Subtle inner frame
125
+ strokeWidth={1.5}
126
+ fill="transparent"
135
127
  />
128
+
129
+ {/* Professional Corner Guides */}
130
+ <AnimatedG opacity={cornerOpacity || 1}>
131
+ {/* Top Left */}
132
+ <Path
133
+ d={`M ${xMin} ${yMin + CORNER_SIZE} L ${xMin} ${yMin + BORDER_RADIUS} Q ${xMin} ${yMin} ${xMin + BORDER_RADIUS} ${yMin} L ${xMin + CORNER_SIZE} ${yMin}`}
134
+ stroke="url(#scanBorderGradient)"
135
+ strokeWidth={STROKE_WIDTH}
136
+ strokeLinecap="round"
137
+ fill="none"
138
+ />
139
+ {/* Top Right */}
140
+ <Path
141
+ d={`M ${xMax - CORNER_SIZE} ${yMin} L ${xMax - BORDER_RADIUS} ${yMin} Q ${xMax} ${yMin} ${xMax} ${yMin + BORDER_RADIUS} L ${xMax} ${yMin + CORNER_SIZE}`}
142
+ stroke="url(#scanBorderGradient)"
143
+ strokeWidth={STROKE_WIDTH}
144
+ strokeLinecap="round"
145
+ fill="none"
146
+ />
147
+ {/* Bottom Left */}
148
+ <Path
149
+ d={`M ${xMin} ${yMax - CORNER_SIZE} L ${xMin} ${yMax - BORDER_RADIUS} Q ${xMin} ${yMax} ${xMin + BORDER_RADIUS} ${yMax} L ${xMin + CORNER_SIZE} ${yMax}`}
150
+ stroke="url(#scanBorderGradient)"
151
+ strokeWidth={STROKE_WIDTH}
152
+ strokeLinecap="round"
153
+ fill="none"
154
+ />
155
+ {/* Bottom Right */}
156
+ <Path
157
+ d={`M ${xMax - CORNER_SIZE} ${yMax} L ${xMax - BORDER_RADIUS} ${yMax} Q ${xMax} ${yMax} ${xMax} ${yMax - BORDER_RADIUS} L ${xMax} ${yMax - CORNER_SIZE}`}
158
+ stroke="url(#scanBorderGradient)"
159
+ strokeWidth={STROKE_WIDTH}
160
+ strokeLinecap="round"
161
+ fill="none"
162
+ />
163
+ </AnimatedG>
136
164
  </Svg>
137
- {isSuccess ? null : (
138
- <ScanningLine yMin={yMin} screenWidth={screenWidth} height={screenHeight} yMax={yMax} />
165
+
166
+ {/* Scanning animation */}
167
+ {!isSuccess && (
168
+ <ScanningLine yMin={yMin} yMax={yMax} screenWidth={screenWidth} height={screenHeight} />
139
169
  )}
140
- {/* <ScanningLine yMin={yMin} screenWidth={screenWidth} height={screenHeight} yMax={yMax} /> */}
141
170
 
142
- <View style={styles.bottomIntruction}>
143
- <Text style={styles.bottomTitle}>
144
- {language === "en" ? `Scan the ${stepperProps?.side === 'front' ? 'front' : 'back'} side of your ${stepperProps?.selectedDocumentType}.`:`Scanner de la face ${stepperProps?.side === 'front' ? 'avant' : 'arrière'} de votre ${stepperProps?.selectedDocumentType}.`}
145
-
146
- </Text>
147
- <Text style={styles.bottomSubtitle}>
148
- {
149
- language === "en"
150
- ? "Hold your ID card steady and make sure all corners are visible. Do not move your phone while the image is being captured."
151
- : "Maintenez votre carte d'identité stable et assurez-vous que tous les coins sont visibles. Ne déplacez pas votre téléphone pendant la capture."
152
- }
153
-
154
- </Text>
171
+ {/* Top UI Zone */}
172
+ <View style={[styles.topZone, { height: yMin }]} pointerEvents="box-none">
173
+ <SafeAreaView style={styles.safeAreaZone} pointerEvents="box-none">
174
+ {stepperProps && (
175
+ <View style={styles.stepperWrapper}>
176
+ <StepOverlay {...stepperProps} />
177
+ </View>
178
+ )}
179
+ {instructions && (
180
+ <View style={styles.instructionsContainer}>
181
+ <View style={styles.instructionsBadge}>
182
+ <Text style={styles.instructionsText}>{instructions}</Text>
183
+ </View>
184
+ </View>
185
+ )}
186
+ </SafeAreaView>
187
+ </View>
188
+
189
+ {/* Bottom UI Zone */}
190
+ <View style={[styles.bottomZone, { top: yMax + 30 }]} pointerEvents="box-none">
191
+ <Text style={styles.bottomTitle}>{bottomTitle}</Text>
192
+ <Text style={styles.bottomSubtitle}>{bottomSubtitle}</Text>
193
+ <View style={styles.helperPill}>
194
+ <Text style={styles.helperText}>{helperText}</Text>
195
+ </View>
155
196
  </View>
156
- </View>)
157
- }
197
+ </View>
198
+ );
199
+ };
158
200
 
159
201
  export default IdCardOverlay;
160
202
 
161
203
  const styles = StyleSheet.create({
162
- overlay: {
204
+ svg: {
163
205
  position: 'absolute',
164
206
  top: 0,
165
207
  left: 0,
166
- width: '100%',
167
- height: '50%',
168
- backgroundColor: 'rgba(0, 0, 0, 0.5)',
208
+ zIndex: 1,
169
209
  },
170
- svg: {
210
+ topZone: {
171
211
  position: 'absolute',
172
212
  top: 0,
173
213
  left: 0,
174
- width: '100%',
175
- height: '100%',
214
+ right: 0,
215
+ zIndex: 10,
216
+ justifyContent: 'flex-start',
217
+ },
218
+ safeAreaZone: {
219
+ flex: 1,
220
+ paddingTop: Platform.OS === 'android' ? (StatusBar.currentHeight || 0) + 8 : 8,
221
+ },
222
+ stepperWrapper: {
223
+ paddingHorizontal: 20,
176
224
  },
177
- topIntruction: {
178
- zIndex: 1000,
179
- flexDirection: 'row',
225
+ instructionsContainer: {
180
226
  alignItems: 'center',
181
- justifyContent: 'center',
182
- paddingVertical: 20,
183
- paddingHorizontal: 10,
184
- marginHorizontal: 20,
185
- marginTop: 10,
186
- backgroundColor: "#FDE04730",
187
- borderColor: "#FDE047",
188
- borderWidth: 1,
189
- borderRadius: 10,
190
- gap: 10,
227
+ marginTop: 'auto',
228
+ marginBottom: 24,
229
+ paddingHorizontal: 20,
191
230
  },
192
- topIntructionText: {
193
- color: '#FDE047',
194
- fontSize: 14,
195
- fontWeight: 'bold',
196
- textAlign: 'center',
231
+ instructionsBadge: {
232
+ backgroundColor: 'rgba(0,0,0,0.6)',
233
+ borderRadius: 8,
234
+ paddingVertical: 8,
235
+ paddingHorizontal: 14,
197
236
  },
198
- bottomIntruction: {
237
+ instructionsText: {
238
+ color: '#FFFFFF',
239
+ fontSize: 13,
240
+ fontWeight: '500',
241
+ letterSpacing: 0.3,
242
+ },
243
+ bottomZone: {
199
244
  position: 'absolute',
200
245
  bottom: 0,
201
246
  left: 0,
202
- width: '100%',
203
- height: '35%',
204
- paddingHorizontal: 20,
205
- },
206
- bottomIntructionTextBold: {
207
- color: 'white',
208
- fontSize: 16,
209
- fontWeight: 'bold',
210
- textAlign: 'center',
211
- },
212
- bottomIntructionText: {
213
- color: 'white',
214
- fontSize: 14,
215
- fontWeight: 'bold',
216
- textAlign: 'center',
247
+ right: 0,
248
+ zIndex: 10,
249
+ alignItems: 'center',
250
+ paddingHorizontal: 24,
217
251
  },
218
252
  bottomTitle: {
219
- color: 'white',
220
- fontSize: 25,
221
- fontWeight: 'bold',
253
+ color: '#FFFFFF',
254
+ fontSize: 18,
255
+ fontWeight: '600',
222
256
  textAlign: 'center',
257
+ letterSpacing: 0.3,
258
+ marginBottom: 6,
223
259
  },
224
260
  bottomSubtitle: {
225
- color: 'white',
226
- marginTop: 15,
261
+ color: 'rgba(255,255,255,0.7)',
227
262
  fontSize: 14,
228
- fontWeight: '500',
229
263
  textAlign: 'center',
264
+ fontWeight: '400',
265
+ marginBottom: 20,
230
266
  },
231
-
232
-
233
- image: {
234
- position: 'absolute',
235
- borderRadius: 10,
267
+ helperPill: {
268
+ backgroundColor: 'rgba(255,255,255,0.1)',
269
+ paddingVertical: 8,
270
+ paddingHorizontal: 16,
271
+ borderRadius: 20,
236
272
  },
237
- stepperContainer: {
238
- flexDirection: 'row',
239
- alignItems: 'center',
240
- justifyContent: 'space-between',
241
- paddingHorizontal: 20,
242
- paddingVertical: 15,
243
- // backgroundColor: 'rgba(0, 0, 0, 0.5)',
244
- zIndex: 1000,
245
- },
246
- stepperItem: {
247
- flex: 1,
248
- alignItems: 'center',
249
- justifyContent: 'center',
250
- },
251
- stepperDetails: {
252
-
253
- alignItems: 'center',
254
- justifyContent: 'center',
255
- },
256
- stepperItemText: {
257
- color: 'white',
258
- fontSize: 20,
259
- fontWeight: 'bold',
260
- },
261
- stepperDetailsText: {
262
- color: 'white',
273
+ helperText: {
274
+ color: 'rgba(255,255,255,0.9)',
263
275
  fontSize: 12,
264
276
  fontWeight: '500',
265
277
  },
266
- back: {
267
- // flex: 1,
268
- alignItems: 'center',
269
- justifyContent: 'center',
270
- },
271
- next: {
272
- flex: 1,
273
- alignItems: 'center',
274
- justifyContent: 'center',
275
- },
276
-
277
- })
278
+ });