@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.
- package/README.md +3 -3
- package/android/build/.transforms/{f62cb96b2d1f78ca96ab35932dd530dc → c9d62bb333688ab562f51958998d5a48}/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/generated/source/buildConfig/debug/kyc/{transfergratis → SanctumKey}/com/BuildConfig.java +2 -2
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +1 -1
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +1 -1
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +2 -2
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/kyc/SanctumKey/com/BuildConfig.class +0 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +1 -1
- package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +1 -1
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +1 -1
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +1 -1
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/SanctumKey/com/SanctumKeySdkModule$definition$1$5$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/SanctumKey/com/SanctumKeySdkModule$definition$1$5$2.class +0 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/android/build/tmp/kotlin-classes/debug/kyc/SanctumKey/com/SanctumKeySdkModule$definition$lambda$5$$inlined$View$1.class +0 -0
- 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
- 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
- package/android/build/tmp/kotlin-classes/debug/kyc/{transfergratis/com/TransfergratisSdkModule.class → SanctumKey/com/SanctumKeySdkModule.class} +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/{transfergratis/com/TransfergratisSdkView.class → SanctumKey/com/SanctumKeySdkView.class} +0 -0
- package/android/build.gradle +2 -2
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/kyc/transfergratis/com/TransfergratisSdkModule.kt +6 -6
- package/android/src/main/java/kyc/transfergratis/com/TransfergratisSdkView.kt +2 -2
- package/build/package.json +9 -7
- package/build/src/App.d.ts +2 -2
- package/build/src/App.d.ts.map +1 -1
- package/build/src/App.js +2 -2
- package/build/src/App.js.map +1 -1
- package/build/src/{TransfergratisSdk.types.d.ts → SanctumKeySdk.types.d.ts} +3 -3
- package/build/src/SanctumKeySdk.types.d.ts.map +1 -0
- package/build/src/SanctumKeySdk.types.js +2 -0
- package/build/src/SanctumKeySdk.types.js.map +1 -0
- package/build/src/{TransfergratisSdkModule.d.ts → SanctumKeySdkModule.d.ts} +4 -4
- package/build/src/SanctumKeySdkModule.d.ts.map +1 -0
- package/build/src/{TransfergratisSdkModule.js → SanctumKeySdkModule.js} +2 -2
- package/build/src/SanctumKeySdkModule.js.map +1 -0
- package/build/src/{TransfergratisSdkModule.web.d.ts → SanctumKeySdkModule.web.d.ts} +4 -4
- package/build/src/SanctumKeySdkModule.web.d.ts.map +1 -0
- package/build/src/{TransfergratisSdkModule.web.js → SanctumKeySdkModule.web.js} +3 -3
- package/build/src/SanctumKeySdkModule.web.js.map +1 -0
- package/build/src/SanctumKeySdkView.d.ts +4 -0
- package/build/src/SanctumKeySdkView.d.ts.map +1 -0
- package/build/src/SanctumKeySdkView.js +7 -0
- package/build/src/SanctumKeySdkView.js.map +1 -0
- package/build/src/SanctumKeySdkView.web.d.ts +4 -0
- package/build/src/SanctumKeySdkView.web.d.ts.map +1 -0
- package/build/src/{TransfergratisSdkView.web.js → SanctumKeySdkView.web.js} +2 -2
- package/build/src/SanctumKeySdkView.web.js.map +1 -0
- package/build/src/api/axios.js +2 -2
- package/build/src/api/axios.js.map +1 -1
- package/build/src/components/EnhancedCameraView.d.ts.map +1 -1
- package/build/src/components/EnhancedCameraView.js +66 -338
- package/build/src/components/EnhancedCameraView.js.map +1 -1
- package/build/src/components/KYCElements/EmailVerificationTemplate.d.ts.map +1 -1
- package/build/src/components/KYCElements/EmailVerificationTemplate.js +93 -15
- package/build/src/components/KYCElements/EmailVerificationTemplate.js.map +1 -1
- package/build/src/components/KYCElements/IDCardCapture.d.ts.map +1 -1
- package/build/src/components/KYCElements/IDCardCapture.js +167 -695
- package/build/src/components/KYCElements/IDCardCapture.js.map +1 -1
- package/build/src/components/KYCElements/PhoneVerificationTemplate.d.ts.map +1 -1
- package/build/src/components/KYCElements/PhoneVerificationTemplate.js +269 -40
- package/build/src/components/KYCElements/PhoneVerificationTemplate.js.map +1 -1
- package/build/src/components/KYCElements/SelfieCapture.d.ts +1 -1
- package/build/src/components/KYCElements/SelfieCapture.d.ts.map +1 -1
- package/build/src/components/KYCElements/SelfieCapture.js +130 -192
- package/build/src/components/KYCElements/SelfieCapture.js.map +1 -1
- package/build/src/components/KYCElements/SelfieCaptureTemplate.d.ts.map +1 -1
- package/build/src/components/KYCElements/SelfieCaptureTemplate.js +131 -433
- package/build/src/components/KYCElements/SelfieCaptureTemplate.js.map +1 -1
- package/build/src/components/NativeCameraView.js +1 -1
- package/build/src/components/NativeCameraView.js.map +1 -1
- package/build/src/components/OverLay/IdCard.d.ts +3 -2
- package/build/src/components/OverLay/IdCard.d.ts.map +1 -1
- package/build/src/components/OverLay/IdCard.js +149 -141
- package/build/src/components/OverLay/IdCard.js.map +1 -1
- package/build/src/components/OverLay/SelfieOverlay.d.ts +2 -1
- package/build/src/components/OverLay/SelfieOverlay.d.ts.map +1 -1
- package/build/src/components/OverLay/SelfieOverlay.js +37 -95
- package/build/src/components/OverLay/SelfieOverlay.js.map +1 -1
- package/build/src/components/OverLay/type.d.ts +1 -0
- package/build/src/components/OverLay/type.d.ts.map +1 -1
- package/build/src/components/OverLay/type.js.map +1 -1
- package/build/src/components/Svgs/scanningLine.d.ts +2 -1
- package/build/src/components/Svgs/scanningLine.d.ts.map +1 -1
- package/build/src/components/Svgs/scanningLine.js +55 -51
- package/build/src/components/Svgs/scanningLine.js.map +1 -1
- package/build/src/config/KYCConfig.js +1 -1
- package/build/src/config/KYCConfig.js.map +1 -1
- package/build/src/config/allowedDomains.js +6 -6
- package/build/src/config/allowedDomains.js.map +1 -1
- package/build/src/hooks/useTemplateKYCFlow.d.ts.map +1 -1
- package/build/src/hooks/useTemplateKYCFlow.js +37 -38
- package/build/src/hooks/useTemplateKYCFlow.js.map +1 -1
- package/build/src/index.d.ts +3 -3
- package/build/src/index.d.ts.map +1 -1
- package/build/src/index.js +3 -3
- package/build/src/index.js.map +1 -1
- package/build/src/modules/api/CardAuthentification.d.ts +0 -5
- package/build/src/modules/api/CardAuthentification.d.ts.map +1 -1
- package/build/src/modules/api/CardAuthentification.js +114 -116
- package/build/src/modules/api/CardAuthentification.js.map +1 -1
- package/build/src/modules/api/KYCService.d.ts +11 -1
- package/build/src/modules/api/KYCService.d.ts.map +1 -1
- package/build/src/modules/api/KYCService.js +101 -38
- package/build/src/modules/api/KYCService.js.map +1 -1
- package/build/src/modules/camera/NativeCameraModule.js +17 -17
- package/build/src/modules/camera/NativeCameraModule.js.map +1 -1
- package/expo-module.config.json +2 -2
- package/ios/TransfergratisSdk.podspec +2 -2
- package/ios/TransfergratisSdkModule.swift +12 -12
- package/package.json +9 -7
- package/src/App.tsx +2 -2
- package/src/{TransfergratisSdk.types.ts → SanctumKeySdk.types.ts} +2 -2
- package/src/{TransfergratisSdkModule.ts → SanctumKeySdkModule.ts} +3 -3
- package/src/{TransfergratisSdkModule.web.ts → SanctumKeySdkModule.web.ts} +3 -3
- package/src/SanctumKeySdkView.tsx +11 -0
- package/src/{TransfergratisSdkView.web.tsx → SanctumKeySdkView.web.tsx} +2 -2
- package/src/api/axios.ts +2 -2
- package/src/components/EnhancedCameraView.tsx +81 -400
- package/src/components/KYCElements/EmailVerificationTemplate.tsx +115 -26
- package/src/components/KYCElements/IDCardCapture.tsx +228 -868
- package/src/components/KYCElements/PhoneVerificationTemplate.tsx +328 -60
- package/src/components/KYCElements/SelfieCapture.tsx +184 -213
- package/src/components/KYCElements/SelfieCaptureTemplate.tsx +330 -662
- package/src/components/NativeCameraView.tsx +1 -1
- package/src/components/OverLay/IdCard.tsx +218 -217
- package/src/components/OverLay/SelfieOverlay.tsx +56 -134
- package/src/components/OverLay/type.ts +1 -0
- package/src/components/Svgs/scanningLine.tsx +71 -72
- package/src/config/KYCConfig.ts +1 -1
- package/src/config/allowedDomains.ts +6 -6
- package/src/hooks/useTemplateKYCFlow.tsx +45 -39
- package/src/i18n/README.md +1 -1
- package/src/index.ts +3 -3
- package/src/modules/api/CardAuthentification.ts +202 -200
- package/src/modules/api/KYCService.ts +168 -53
- package/src/modules/camera/NativeCameraModule.ts +17 -17
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$1$5$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$1$5$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$View$1.class +0 -0
- package/build/src/TransfergratisSdk.types.d.ts.map +0 -1
- package/build/src/TransfergratisSdk.types.js +0 -2
- package/build/src/TransfergratisSdk.types.js.map +0 -1
- package/build/src/TransfergratisSdkModule.d.ts.map +0 -1
- package/build/src/TransfergratisSdkModule.js.map +0 -1
- package/build/src/TransfergratisSdkModule.web.d.ts.map +0 -1
- package/build/src/TransfergratisSdkModule.web.js.map +0 -1
- package/build/src/TransfergratisSdkView.d.ts +0 -4
- package/build/src/TransfergratisSdkView.d.ts.map +0 -1
- package/build/src/TransfergratisSdkView.js +0 -7
- package/build/src/TransfergratisSdkView.js.map +0 -1
- package/build/src/TransfergratisSdkView.web.d.ts +0 -4
- package/build/src/TransfergratisSdkView.web.d.ts.map +0 -1
- package/build/src/TransfergratisSdkView.web.js.map +0 -1
- package/src/TransfergratisSdkView.tsx +0 -11
- /package/android/build/.transforms/{532c0e65d82f446633d0a7dab2772198 → ab90740579f5bd05b27b4343ada2d1c9}/results.bin +0 -0
- /package/android/build/.transforms/{532c0e65d82f446633d0a7dab2772198 → ab90740579f5bd05b27b4343ada2d1c9}/transformed/classes/classes_dex/classes.dex +0 -0
- /package/android/build/.transforms/{f62cb96b2d1f78ca96ab35932dd530dc → c9d62bb333688ab562f51958998d5a48}/results.bin +0 -0
- /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('
|
|
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
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
11
|
-
const
|
|
12
|
-
const
|
|
46
|
+
// Center horizontally
|
|
47
|
+
const xMin = (screenWidth - boxWidth) / 2;
|
|
48
|
+
const xMax = xMin + boxWidth;
|
|
13
49
|
|
|
14
|
-
|
|
15
|
-
const
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
48
|
-
|
|
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
|
-
{/*
|
|
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=
|
|
69
|
-
y=
|
|
70
|
-
width={
|
|
71
|
-
height={
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
138
|
-
|
|
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
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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
|
-
|
|
204
|
+
svg: {
|
|
163
205
|
position: 'absolute',
|
|
164
206
|
top: 0,
|
|
165
207
|
left: 0,
|
|
166
|
-
|
|
167
|
-
height: '50%',
|
|
168
|
-
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
208
|
+
zIndex: 1,
|
|
169
209
|
},
|
|
170
|
-
|
|
210
|
+
topZone: {
|
|
171
211
|
position: 'absolute',
|
|
172
212
|
top: 0,
|
|
173
213
|
left: 0,
|
|
174
|
-
|
|
175
|
-
|
|
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
|
-
|
|
178
|
-
zIndex: 1000,
|
|
179
|
-
flexDirection: 'row',
|
|
225
|
+
instructionsContainer: {
|
|
180
226
|
alignItems: 'center',
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
paddingHorizontal:
|
|
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
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
231
|
+
instructionsBadge: {
|
|
232
|
+
backgroundColor: 'rgba(0,0,0,0.6)',
|
|
233
|
+
borderRadius: 8,
|
|
234
|
+
paddingVertical: 8,
|
|
235
|
+
paddingHorizontal: 14,
|
|
197
236
|
},
|
|
198
|
-
|
|
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
|
-
|
|
203
|
-
|
|
204
|
-
|
|
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: '
|
|
220
|
-
fontSize:
|
|
221
|
-
fontWeight: '
|
|
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: '
|
|
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
|
-
|
|
234
|
-
|
|
235
|
-
borderRadius:
|
|
267
|
+
helperPill: {
|
|
268
|
+
backgroundColor: 'rgba(255,255,255,0.1)',
|
|
269
|
+
paddingVertical: 8,
|
|
270
|
+
paddingHorizontal: 16,
|
|
271
|
+
borderRadius: 20,
|
|
236
272
|
},
|
|
237
|
-
|
|
238
|
-
|
|
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
|
-
|
|
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
|
+
});
|