@transfergratis/react-native-sdk 0.1.23 → 0.1.25
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/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +12 -5
- package/android/build/intermediates/aar_main_jar/debug/syncDebugLibJars/classes.jar +0 -0
- package/android/build/intermediates/annotations_typedef_file/debug/extractDebugAnnotations/typedefs.txt +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -1
- package/android/build/intermediates/incremental/debug-mergeJavaRes/merge-state +0 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +61 -59
- package/android/build/intermediates/merged_java_res/debug/mergeDebugJavaResource/feature-transfergratis-react-native-sdk.jar +0 -0
- package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +12 -5
- 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/aar/transfergratis-react-native-sdk-debug.aar +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +26 -34
- package/android/src/main/AndroidManifest.xml +13 -5
- package/build/components/EnhancedCameraView.d.ts.map +1 -1
- package/build/components/EnhancedCameraView.js +26 -3
- package/build/components/EnhancedCameraView.js.map +1 -1
- package/build/components/EnhancedCameraView.web.d.ts.map +1 -1
- package/build/components/EnhancedCameraView.web.js +21 -0
- package/build/components/EnhancedCameraView.web.js.map +1 -1
- package/build/components/KYCElements/AdditionalDocumentsTemplate.d.ts +12 -0
- package/build/components/KYCElements/AdditionalDocumentsTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/AdditionalDocumentsTemplate.js +283 -0
- package/build/components/KYCElements/AdditionalDocumentsTemplate.js.map +1 -0
- package/build/components/KYCElements/CameraCapture.d.ts.map +1 -1
- package/build/components/KYCElements/CameraCapture.js +4 -3
- package/build/components/KYCElements/CameraCapture.js.map +1 -1
- package/build/components/KYCElements/CountrySelectionTemplate.d.ts +5 -2
- package/build/components/KYCElements/CountrySelectionTemplate.d.ts.map +1 -1
- package/build/components/KYCElements/CountrySelectionTemplate.js +360 -101
- package/build/components/KYCElements/CountrySelectionTemplate.js.map +1 -1
- package/build/components/KYCElements/EmailVerificationTemplate.d.ts +12 -0
- package/build/components/KYCElements/EmailVerificationTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/EmailVerificationTemplate.js +193 -0
- package/build/components/KYCElements/EmailVerificationTemplate.js.map +1 -0
- package/build/components/KYCElements/FileUpload.d.ts.map +1 -1
- package/build/components/KYCElements/FileUpload.js +5 -4
- package/build/components/KYCElements/FileUpload.js.map +1 -1
- package/build/components/KYCElements/FileUploadTemplate.d.ts.map +1 -1
- package/build/components/KYCElements/FileUploadTemplate.js +5 -4
- package/build/components/KYCElements/FileUploadTemplate.js.map +1 -1
- package/build/components/KYCElements/IDCardCapture.d.ts.map +1 -1
- package/build/components/KYCElements/IDCardCapture.js +356 -227
- package/build/components/KYCElements/IDCardCapture.js.map +1 -1
- package/build/components/KYCElements/LocationCaptureTemplate.d.ts.map +1 -1
- package/build/components/KYCElements/LocationCaptureTemplate.js +78 -37
- package/build/components/KYCElements/LocationCaptureTemplate.js.map +1 -1
- package/build/components/KYCElements/OrientationVideoCapture.d.ts +2 -0
- package/build/components/KYCElements/OrientationVideoCapture.d.ts.map +1 -1
- package/build/components/KYCElements/OrientationVideoCapture.js +5 -4
- package/build/components/KYCElements/OrientationVideoCapture.js.map +1 -1
- package/build/components/KYCElements/OrientationVideoCaptureEnhanced.d.ts +2 -0
- package/build/components/KYCElements/OrientationVideoCaptureEnhanced.d.ts.map +1 -1
- package/build/components/KYCElements/OrientationVideoCaptureEnhanced.js +5 -4
- package/build/components/KYCElements/OrientationVideoCaptureEnhanced.js.map +1 -1
- package/build/components/KYCElements/OrientationVideoCaptureFinal.d.ts +2 -0
- package/build/components/KYCElements/OrientationVideoCaptureFinal.d.ts.map +1 -1
- package/build/components/KYCElements/OrientationVideoCaptureFinal.js +5 -4
- package/build/components/KYCElements/OrientationVideoCaptureFinal.js.map +1 -1
- package/build/components/KYCElements/PersonalInformationTemplate.d.ts +12 -0
- package/build/components/KYCElements/PersonalInformationTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/PersonalInformationTemplate.js +120 -0
- package/build/components/KYCElements/PersonalInformationTemplate.js.map +1 -0
- package/build/components/KYCElements/PhoneVerificationTemplate.d.ts +12 -0
- package/build/components/KYCElements/PhoneVerificationTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/PhoneVerificationTemplate.js +185 -0
- package/build/components/KYCElements/PhoneVerificationTemplate.js.map +1 -0
- package/build/components/KYCElements/SelfieCapture.d.ts.map +1 -1
- package/build/components/KYCElements/SelfieCapture.js +4 -3
- package/build/components/KYCElements/SelfieCapture.js.map +1 -1
- package/build/components/KYCElements/SelfieCaptureTemplate.d.ts.map +1 -1
- package/build/components/KYCElements/SelfieCaptureTemplate.js +189 -42
- package/build/components/KYCElements/SelfieCaptureTemplate.js.map +1 -1
- package/build/components/KYCElements/WelcomeTemplate.d.ts +12 -0
- package/build/components/KYCElements/WelcomeTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/WelcomeTemplate.js +243 -0
- package/build/components/KYCElements/WelcomeTemplate.js.map +1 -0
- package/build/components/TemplateKYCExample.d.ts +8 -2
- package/build/components/TemplateKYCExample.d.ts.map +1 -1
- package/build/components/TemplateKYCExample.js +10 -97
- package/build/components/TemplateKYCExample.js.map +1 -1
- package/build/components/TemplateKYCFlowRefactored.d.ts +6 -1
- package/build/components/TemplateKYCFlowRefactored.d.ts.map +1 -1
- package/build/components/TemplateKYCFlowRefactored.js +108 -11
- package/build/components/TemplateKYCFlowRefactored.js.map +1 -1
- package/build/components/example/DynamicTemplateExample.d.ts +10 -0
- package/build/components/example/DynamicTemplateExample.d.ts.map +1 -0
- package/build/components/example/DynamicTemplateExample.js +241 -0
- package/build/components/example/DynamicTemplateExample.js.map +1 -0
- package/build/config/KYCConfig.d.ts +14 -0
- package/build/config/KYCConfig.d.ts.map +1 -0
- package/build/config/KYCConfig.js +26 -0
- package/build/config/KYCConfig.js.map +1 -0
- package/build/config/allowedDomains.d.ts +30 -0
- package/build/config/allowedDomains.d.ts.map +1 -0
- package/build/config/allowedDomains.js +112 -0
- package/build/config/allowedDomains.js.map +1 -0
- package/build/hooks/useOrientationVideo.d.ts +2 -1
- package/build/hooks/useOrientationVideo.d.ts.map +1 -1
- package/build/hooks/useOrientationVideo.js +3 -3
- package/build/hooks/useOrientationVideo.js.map +1 -1
- package/build/hooks/useTemplateKYCFlow.d.ts +6 -1
- package/build/hooks/useTemplateKYCFlow.d.ts.map +1 -1
- package/build/hooks/useTemplateKYCFlow.js +317 -34
- package/build/hooks/useTemplateKYCFlow.js.map +1 -1
- package/build/hooks/useTemplateLoader.d.ts +14 -0
- package/build/hooks/useTemplateLoader.d.ts.map +1 -0
- package/build/hooks/useTemplateLoader.js +85 -0
- package/build/hooks/useTemplateLoader.js.map +1 -0
- package/build/i18n/en/index.d.ts +49 -0
- package/build/i18n/en/index.d.ts.map +1 -1
- package/build/i18n/en/index.js +50 -1
- package/build/i18n/en/index.js.map +1 -1
- package/build/i18n/fr/index.d.ts +35 -0
- package/build/i18n/fr/index.d.ts.map +1 -1
- package/build/i18n/fr/index.js +36 -1
- package/build/i18n/fr/index.js.map +1 -1
- package/build/index.d.ts +6 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +10 -0
- package/build/index.js.map +1 -1
- package/build/modules/api/CardAuthentification.d.ts +24 -3
- package/build/modules/api/CardAuthentification.d.ts.map +1 -1
- package/build/modules/api/CardAuthentification.js +69 -10
- package/build/modules/api/CardAuthentification.js.map +1 -1
- package/build/modules/api/KYCService.d.ts +7 -7
- package/build/modules/api/KYCService.d.ts.map +1 -1
- package/build/modules/api/KYCService.js +108 -39
- package/build/modules/api/KYCService.js.map +1 -1
- package/build/modules/api/SelfieVerification.d.ts +3 -1
- package/build/modules/api/SelfieVerification.d.ts.map +1 -1
- package/build/modules/api/SelfieVerification.js +17 -1
- package/build/modules/api/SelfieVerification.js.map +1 -1
- package/build/modules/api/TemplateService.d.ts +44 -0
- package/build/modules/api/TemplateService.d.ts.map +1 -0
- package/build/modules/api/TemplateService.js +145 -0
- package/build/modules/api/TemplateService.js.map +1 -0
- package/build/types/KYC.types.d.ts +265 -4
- package/build/types/KYC.types.d.ts.map +1 -1
- package/build/types/KYC.types.js +15 -0
- package/build/types/KYC.types.js.map +1 -1
- package/build/types/env.types.d.ts +13 -0
- package/build/types/env.types.d.ts.map +1 -0
- package/build/types/env.types.js +2 -0
- package/build/types/env.types.js.map +1 -0
- package/build/utils/cropByObb.d.ts +1 -0
- package/build/utils/cropByObb.d.ts.map +1 -1
- package/build/utils/cropByObb.js +70 -0
- package/build/utils/cropByObb.js.map +1 -1
- package/build/utils/deviceDetection.d.ts +6 -0
- package/build/utils/deviceDetection.d.ts.map +1 -0
- package/build/utils/deviceDetection.js +12 -0
- package/build/utils/deviceDetection.js.map +1 -0
- package/build/utils/platformAlert.d.ts +20 -0
- package/build/utils/platformAlert.d.ts.map +1 -0
- package/build/utils/platformAlert.js +67 -0
- package/build/utils/platformAlert.js.map +1 -0
- package/build/utils/template-transformer.d.ts +10 -0
- package/build/utils/template-transformer.d.ts.map +1 -0
- package/build/utils/template-transformer.js +365 -0
- package/build/utils/template-transformer.js.map +1 -0
- package/build/web/WebKYCEntry.d.ts.map +1 -1
- package/build/web/WebKYCEntry.js +158 -32
- package/build/web/WebKYCEntry.js.map +1 -1
- package/package.json +1 -1
- package/plugin/build/withVisionCamera.js +3 -4
- package/plugin/src/withVisionCamera.js +3 -4
- package/plugin/src/withVisionCamera.ts +3 -4
- package/src/components/EnhancedCameraView.tsx +31 -2
- package/src/components/EnhancedCameraView.web.tsx +24 -0
- package/src/components/KYCElements/AdditionalDocumentsTemplate.tsx +346 -0
- package/src/components/KYCElements/CameraCapture.tsx +4 -3
- package/src/components/KYCElements/CountrySelectionTemplate.tsx +410 -113
- package/src/components/KYCElements/EmailVerificationTemplate.tsx +264 -0
- package/src/components/KYCElements/FileUpload.tsx +5 -4
- package/src/components/KYCElements/FileUploadTemplate.tsx +5 -4
- package/src/components/KYCElements/IDCardCapture.tsx +397 -254
- package/src/components/KYCElements/LocationCaptureTemplate.tsx +95 -44
- package/src/components/KYCElements/OrientationVideoCapture.tsx +6 -3
- package/src/components/KYCElements/OrientationVideoCaptureEnhanced.tsx +6 -3
- package/src/components/KYCElements/OrientationVideoCaptureFinal.tsx +6 -3
- package/src/components/KYCElements/PersonalInformationTemplate.tsx +158 -0
- package/src/components/KYCElements/PhoneVerificationTemplate.tsx +253 -0
- package/src/components/KYCElements/SelfieCapture.tsx +4 -3
- package/src/components/KYCElements/SelfieCaptureTemplate.tsx +201 -44
- package/src/components/KYCElements/WelcomeTemplate.tsx +289 -0
- package/src/components/TemplateKYCExample.tsx +37 -108
- package/src/components/TemplateKYCFlowRefactored.tsx +148 -12
- package/src/components/example/DynamicTemplateExample.tsx +289 -0
- package/src/config/KYCConfig.ts +34 -0
- package/src/config/allowedDomains.ts +133 -0
- package/src/hooks/useOrientationVideo.ts +5 -4
- package/src/hooks/useTemplateKYCFlow.tsx +347 -32
- package/src/hooks/useTemplateLoader.ts +102 -0
- package/src/i18n/en/index.ts +53 -2
- package/src/i18n/fr/index.ts +37 -1
- package/src/index.ts +14 -0
- package/src/modules/api/CardAuthentification.ts +76 -11
- package/src/modules/api/KYCService.ts +129 -45
- package/src/modules/api/SelfieVerification.ts +25 -3
- package/src/modules/api/TemplateService.ts +167 -0
- package/src/types/KYC.types.ts +331 -3
- package/src/types/env.types.ts +13 -0
- package/src/utils/cropByObb.ts +83 -3
- package/src/utils/deviceDetection.ts +11 -0
- package/src/utils/platformAlert.ts +86 -0
- package/src/utils/template-transformer.ts +445 -0
- package/src/web/WebKYCEntry.tsx +199 -50
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8"?>
|
|
2
2
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
+
xmlns:tools="http://schemas.android.com/tools"
|
|
3
4
|
package="kyc.transfergratis.com" >
|
|
4
5
|
|
|
5
6
|
<uses-sdk android:minSdkVersion="24" />
|
|
6
7
|
|
|
7
|
-
<!--
|
|
8
|
+
<!--
|
|
9
|
+
Permissions nécessaires pour KYC:
|
|
10
|
+
- CAMERA: pour capturer photos de documents et selfies
|
|
11
|
+
- RECORD_AUDIO: pour l'enregistrement vidéo (si nécessaire)
|
|
12
|
+
|
|
13
|
+
Note: READ_MEDIA_IMAGES et READ_EXTERNAL_STORAGE ne sont PAS nécessaires car:
|
|
14
|
+
- Les photos sont prises directement avec la caméra (pas besoin d'accéder à la galerie)
|
|
15
|
+
- Les photos sont sauvegardées dans le stockage interne de l'app (documentDirectory)
|
|
16
|
+
- La sélection de fichiers utilise le Photo Picker API d'Android qui ne nécessite pas de permissions
|
|
17
|
+
-->
|
|
8
18
|
<uses-permission android:name="android.permission.CAMERA" />
|
|
9
19
|
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
|
10
|
-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
|
11
|
-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
|
12
|
-
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
|
|
13
20
|
|
|
14
21
|
<!-- Features nécessaires -->
|
|
15
22
|
<uses-feature
|
|
@@ -19,7 +26,7 @@
|
|
|
19
26
|
android:name="android.hardware.camera.autofocus"
|
|
20
27
|
android:required="false" />
|
|
21
28
|
|
|
22
|
-
<application>
|
|
29
|
+
<application android:requestLegacyExternalStorage="false" >
|
|
23
30
|
|
|
24
31
|
<!-- FileProvider pour partager les fichiers -->
|
|
25
32
|
<provider
|
|
Binary file
|
|
File without changes
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#
|
|
1
|
+
#Fri Jan 30 10:38:04 WAT 2026
|
|
2
2
|
kyc.transfergratis.com.transfergratis-react-native-sdk-main-6\:/xml/file_paths.xml=/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/build/intermediates/packaged_res/debug/packageDebugResources/xml/file_paths.xml
|
|
@@ -1,61 +1,63 @@
|
|
|
1
1
|
1<?xml version="1.0" encoding="utf-8"?>
|
|
2
2
|
2<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
-
3
|
|
4
|
-
4
|
|
5
|
-
5
|
|
6
|
-
6
|
|
7
|
-
7
|
|
8
|
-
8
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
21
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
23
|
|
41
|
-
24
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
3
|
+
3 xmlns:tools="http://schemas.android.com/tools"
|
|
4
|
+
4 package="kyc.transfergratis.com" >
|
|
5
|
+
5
|
|
6
|
+
6 <uses-sdk android:minSdkVersion="24" />
|
|
7
|
+
7
|
|
8
|
+
8 <!--
|
|
9
|
+
9 Permissions nécessaires pour KYC:
|
|
10
|
+
10 - CAMERA: pour capturer photos de documents et selfies
|
|
11
|
+
11 - RECORD_AUDIO: pour l'enregistrement vidéo (si nécessaire)
|
|
12
|
+
12
|
|
13
|
+
13 Note: READ_MEDIA_IMAGES et READ_EXTERNAL_STORAGE ne sont PAS nécessaires car:
|
|
14
|
+
14 - Les photos sont prises directement avec la caméra (pas besoin d'accéder à la galerie)
|
|
15
|
+
15 - Les photos sont sauvegardées dans le stockage interne de l'app (documentDirectory)
|
|
16
|
+
16 - La sélection de fichiers utilise le Photo Picker API d'Android qui ne nécessite pas de permissions
|
|
17
|
+
17 -->
|
|
18
|
+
18 <uses-permission android:name="android.permission.CAMERA" />
|
|
19
|
+
18-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:16:5-65
|
|
20
|
+
18-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:16:22-62
|
|
21
|
+
19 <uses-permission android:name="android.permission.RECORD_AUDIO" />
|
|
22
|
+
19-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:17:5-71
|
|
23
|
+
19-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:17:22-68
|
|
24
|
+
20
|
|
25
|
+
21 <!-- Features nécessaires -->
|
|
26
|
+
22 <uses-feature
|
|
27
|
+
22-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:20:5-84
|
|
28
|
+
23 android:name="android.hardware.camera"
|
|
29
|
+
23-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:20:19-57
|
|
30
|
+
24 android:required="true" />
|
|
31
|
+
24-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:20:58-81
|
|
32
|
+
25 <uses-feature
|
|
33
|
+
25-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:21:5-95
|
|
34
|
+
26 android:name="android.hardware.camera.autofocus"
|
|
35
|
+
26-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:21:19-67
|
|
36
|
+
27 android:required="false" />
|
|
37
|
+
27-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:21:68-92
|
|
38
|
+
28
|
|
39
|
+
29 <application android:requestLegacyExternalStorage="false" >
|
|
40
|
+
29-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:23:5-35:19
|
|
41
|
+
29-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:24:9-53
|
|
42
|
+
30
|
|
43
|
+
31 <!-- FileProvider pour partager les fichiers -->
|
|
44
|
+
32 <provider
|
|
45
|
+
32-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:26:9-34:20
|
|
46
|
+
33 android:name="androidx.core.content.FileProvider"
|
|
47
|
+
33-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:27:13-62
|
|
48
|
+
34 android:authorities="${applicationId}.fileprovider"
|
|
49
|
+
34-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:28:13-64
|
|
50
|
+
35 android:exported="false"
|
|
51
|
+
35-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:29:13-37
|
|
52
|
+
36 android:grantUriPermissions="true" >
|
|
53
|
+
36-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:30:13-47
|
|
54
|
+
37 <meta-data
|
|
55
|
+
37-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:31:13-33:54
|
|
56
|
+
38 android:name="android.support.FILE_PROVIDER_PATHS"
|
|
57
|
+
38-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:32:17-67
|
|
58
|
+
39 android:resource="@xml/file_paths" />
|
|
59
|
+
39-->/Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:33:17-51
|
|
60
|
+
40 </provider>
|
|
61
|
+
41 </application>
|
|
62
|
+
42
|
|
63
|
+
43</manifest>
|
|
Binary file
|
package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml
CHANGED
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8"?>
|
|
2
2
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
+
xmlns:tools="http://schemas.android.com/tools"
|
|
3
4
|
package="kyc.transfergratis.com" >
|
|
4
5
|
|
|
5
6
|
<uses-sdk android:minSdkVersion="24" />
|
|
6
7
|
|
|
7
|
-
<!--
|
|
8
|
+
<!--
|
|
9
|
+
Permissions nécessaires pour KYC:
|
|
10
|
+
- CAMERA: pour capturer photos de documents et selfies
|
|
11
|
+
- RECORD_AUDIO: pour l'enregistrement vidéo (si nécessaire)
|
|
12
|
+
|
|
13
|
+
Note: READ_MEDIA_IMAGES et READ_EXTERNAL_STORAGE ne sont PAS nécessaires car:
|
|
14
|
+
- Les photos sont prises directement avec la caméra (pas besoin d'accéder à la galerie)
|
|
15
|
+
- Les photos sont sauvegardées dans le stockage interne de l'app (documentDirectory)
|
|
16
|
+
- La sélection de fichiers utilise le Photo Picker API d'Android qui ne nécessite pas de permissions
|
|
17
|
+
-->
|
|
8
18
|
<uses-permission android:name="android.permission.CAMERA" />
|
|
9
19
|
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
|
10
|
-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
|
11
|
-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
|
12
|
-
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
|
|
13
20
|
|
|
14
21
|
<!-- Features nécessaires -->
|
|
15
22
|
<uses-feature
|
|
@@ -19,7 +26,7 @@
|
|
|
19
26
|
android:name="android.hardware.camera.autofocus"
|
|
20
27
|
android:required="false" />
|
|
21
28
|
|
|
22
|
-
<application>
|
|
29
|
+
<application android:requestLegacyExternalStorage="false" >
|
|
23
30
|
|
|
24
31
|
<!-- FileProvider pour partager les fichiers -->
|
|
25
32
|
<provider
|
|
Binary file
|
|
Binary file
|
|
@@ -1,62 +1,54 @@
|
|
|
1
1
|
-- Merging decision tree log ---
|
|
2
2
|
manifest
|
|
3
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:2:1-
|
|
4
|
-
INJECTED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:2:1-
|
|
3
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:2:1-37:12
|
|
4
|
+
INJECTED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:2:1-37:12
|
|
5
5
|
package
|
|
6
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
6
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:4:5-37
|
|
7
7
|
INJECTED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml
|
|
8
|
+
xmlns:tools
|
|
9
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:3:5-51
|
|
8
10
|
xmlns:android
|
|
9
11
|
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:2:11-69
|
|
10
12
|
uses-permission#android.permission.CAMERA
|
|
11
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
13
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:16:5-65
|
|
12
14
|
android:name
|
|
13
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
15
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:16:22-62
|
|
14
16
|
uses-permission#android.permission.RECORD_AUDIO
|
|
15
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
17
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:17:5-71
|
|
16
18
|
android:name
|
|
17
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
18
|
-
uses-permission#android.permission.READ_EXTERNAL_STORAGE
|
|
19
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:8:5-80
|
|
20
|
-
android:name
|
|
21
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:8:22-77
|
|
22
|
-
uses-permission#android.permission.WRITE_EXTERNAL_STORAGE
|
|
23
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:9:5-81
|
|
24
|
-
android:name
|
|
25
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:9:22-78
|
|
26
|
-
uses-permission#android.permission.MANAGE_EXTERNAL_STORAGE
|
|
27
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:10:5-82
|
|
28
|
-
android:name
|
|
29
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:10:22-79
|
|
19
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:17:22-68
|
|
30
20
|
uses-feature#android.hardware.camera
|
|
31
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
21
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:20:5-84
|
|
32
22
|
android:required
|
|
33
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
23
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:20:58-81
|
|
34
24
|
android:name
|
|
35
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
25
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:20:19-57
|
|
36
26
|
uses-feature#android.hardware.camera.autofocus
|
|
37
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
27
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:21:5-95
|
|
38
28
|
android:required
|
|
39
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
29
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:21:68-92
|
|
40
30
|
android:name
|
|
41
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
31
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:21:19-67
|
|
42
32
|
application
|
|
43
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
33
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:23:5-35:19
|
|
34
|
+
android:requestLegacyExternalStorage
|
|
35
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:24:9-53
|
|
44
36
|
provider#androidx.core.content.FileProvider
|
|
45
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
37
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:26:9-34:20
|
|
46
38
|
android:grantUriPermissions
|
|
47
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
39
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:30:13-47
|
|
48
40
|
android:authorities
|
|
49
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
41
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:28:13-64
|
|
50
42
|
android:exported
|
|
51
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
43
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:29:13-37
|
|
52
44
|
android:name
|
|
53
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
45
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:27:13-62
|
|
54
46
|
meta-data#android.support.FILE_PROVIDER_PATHS
|
|
55
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
47
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:31:13-33:54
|
|
56
48
|
android:resource
|
|
57
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
49
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:33:17-51
|
|
58
50
|
android:name
|
|
59
|
-
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:
|
|
51
|
+
ADDED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml:32:17-67
|
|
60
52
|
uses-sdk
|
|
61
53
|
INJECTED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml reason: use-sdk injection requested
|
|
62
54
|
INJECTED from /Users/transfergratis/Documents/GitHub/KYC-User-Frontend/transfergratis-sdk/android/src/main/AndroidManifest.xml
|
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8"?>
|
|
2
2
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
+
xmlns:tools="http://schemas.android.com/tools"
|
|
3
4
|
package="kyc.transfergratis.com">
|
|
4
5
|
|
|
5
|
-
<!--
|
|
6
|
+
<!--
|
|
7
|
+
Permissions nécessaires pour KYC:
|
|
8
|
+
- CAMERA: pour capturer photos de documents et selfies
|
|
9
|
+
- RECORD_AUDIO: pour l'enregistrement vidéo (si nécessaire)
|
|
10
|
+
|
|
11
|
+
Note: READ_MEDIA_IMAGES et READ_EXTERNAL_STORAGE ne sont PAS nécessaires car:
|
|
12
|
+
- Les photos sont prises directement avec la caméra (pas besoin d'accéder à la galerie)
|
|
13
|
+
- Les photos sont sauvegardées dans le stockage interne de l'app (documentDirectory)
|
|
14
|
+
- La sélection de fichiers utilise le Photo Picker API d'Android qui ne nécessite pas de permissions
|
|
15
|
+
-->
|
|
6
16
|
<uses-permission android:name="android.permission.CAMERA" />
|
|
7
17
|
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
|
8
|
-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
|
9
|
-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
|
10
|
-
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
|
|
11
18
|
|
|
12
19
|
<!-- Features nécessaires -->
|
|
13
20
|
<uses-feature android:name="android.hardware.camera" android:required="true" />
|
|
14
21
|
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
|
|
15
22
|
|
|
16
|
-
<application
|
|
23
|
+
<application
|
|
24
|
+
android:requestLegacyExternalStorage="false">
|
|
17
25
|
<!-- FileProvider pour partager les fichiers -->
|
|
18
26
|
<provider
|
|
19
27
|
android:name="androidx.core.content.FileProvider"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnhancedCameraView.d.ts","sourceRoot":"","sources":["../../src/components/EnhancedCameraView.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"EnhancedCameraView.d.ts","sourceRoot":"","sources":["../../src/components/EnhancedCameraView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAKjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAMzD,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAqWhE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
1
|
+
import React, { useCallback, useEffect, useRef, useState, useMemo } from 'react';
|
|
2
2
|
import { View, StyleSheet, TouchableOpacity, Text } from 'react-native';
|
|
3
3
|
import { Camera, useCameraDevice } from 'react-native-vision-camera';
|
|
4
4
|
import VisionCameraModule from '../modules/camera/VisionCameraModule';
|
|
@@ -14,6 +14,29 @@ export const EnhancedCameraView = ({ showCamera, cameraType: initialCameraType =
|
|
|
14
14
|
const [refreshCamera, setRefreshCamera] = useState(false);
|
|
15
15
|
const device = useCameraDevice(cameraType);
|
|
16
16
|
console.log({ setCameraType, setFlash });
|
|
17
|
+
// Sélectionner le meilleur format disponible pour une qualité maximale
|
|
18
|
+
// Prioriser les formats avec une bonne résolution vidéo (pour la prévisualisation) ET photo (pour la capture)
|
|
19
|
+
const bestFormat = useMemo(() => {
|
|
20
|
+
if (!device || !device.formats || device.formats.length === 0) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
// Trier les formats en combinant la résolution vidéo (pour la prévisualisation) et photo (pour la capture)
|
|
24
|
+
// On priorise les formats avec une bonne résolution vidéo car c'est ce qui est affiché en temps réel
|
|
25
|
+
const sortedFormats = [...device.formats].sort((a, b) => {
|
|
26
|
+
// Résolution vidéo (pour la prévisualisation live)
|
|
27
|
+
const videoResolutionA = (a.videoWidth || 0) * (a.videoHeight || 0);
|
|
28
|
+
const videoResolutionB = (b.videoWidth || 0) * (b.videoHeight || 0);
|
|
29
|
+
// Résolution photo (pour la capture)
|
|
30
|
+
const photoResolutionA = (a.photoWidth || 0) * (a.photoHeight || 0);
|
|
31
|
+
const photoResolutionB = (b.photoWidth || 0) * (b.photoHeight || 0);
|
|
32
|
+
// Prioriser d'abord la résolution vidéo (prévisualisation), puis la résolution photo
|
|
33
|
+
if (videoResolutionB !== videoResolutionA) {
|
|
34
|
+
return videoResolutionB - videoResolutionA;
|
|
35
|
+
}
|
|
36
|
+
return photoResolutionB - photoResolutionA;
|
|
37
|
+
});
|
|
38
|
+
return sortedFormats[0];
|
|
39
|
+
}, [device]);
|
|
17
40
|
const checkPermissions = async () => {
|
|
18
41
|
try {
|
|
19
42
|
const hasAllPermissions = await VisionCameraModule.hasAllPermissions();
|
|
@@ -67,7 +90,7 @@ export const EnhancedCameraView = ({ showCamera, cameraType: initialCameraType =
|
|
|
67
90
|
}
|
|
68
91
|
catch (error) {
|
|
69
92
|
}
|
|
70
|
-
}, [isInitialized, onError, onSilentCapture]);
|
|
93
|
+
}, [isInitialized, onError, onSilentCapture, enableFlash, flash, silentCaptureResult]);
|
|
71
94
|
// Automatically take a silent photo every 5 seconds when ready
|
|
72
95
|
useEffect(() => {
|
|
73
96
|
if (!showCamera || !isInitialized) {
|
|
@@ -182,7 +205,7 @@ export const EnhancedCameraView = ({ showCamera, cameraType: initialCameraType =
|
|
|
182
205
|
return <View style={[styles.container, style]}/>;
|
|
183
206
|
}
|
|
184
207
|
return (<View style={[styles.container, style]}>
|
|
185
|
-
<Camera ref={camera} style={StyleSheet.absoluteFill} device={device} isActive={showCamera} photo={true} video={enableVideo} audio={enableVideo} onInitialized={onInitialized} onError={onCameraError}/>
|
|
208
|
+
<Camera ref={camera} style={StyleSheet.absoluteFill} device={device} isActive={showCamera} photo={true} video={enableVideo} audio={enableVideo} format={bestFormat} onInitialized={onInitialized} onError={onCameraError}/>
|
|
186
209
|
|
|
187
210
|
{/* Instructions */}
|
|
188
211
|
{/* {instructions && (
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnhancedCameraView.js","sourceRoot":"","sources":["../../src/components/EnhancedCameraView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,kBAAkB,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAKrC,MAAM,CAAC,MAAM,kBAAkB,GAAsC,CAAC,EACpE,UAAU,EACV,UAAU,EAAE,iBAAiB,GAAG,OAAO,EACvC,KAAK,EACL,SAAS,EACT,OAAO,EACP,OAAO,EACP,WAAW,GAAG,KAAK,EACnB,SAAS,GAAG,KAAK,EACjB,OAAO,GAAG,MAAM,EAChB,iBAAiB,GAAG,IAAI,EACxB,gBAAgB,GAAG,IAAI,EACvB,gBAAgB,EAChB,IAAI,EACJ,OAAO,GAAG,IAAI,EACd,WAAW,GAAG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AE;QACZ,SAAS,EAAE,QAAQ;QACnB,MAAM,EAAE,EAAE;KACX;IACD,WAAW,EAAE;QACX,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;QACT,aAAa,EAAE,MAAM;KACtB;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,UAAU;QACpB,WAAW,EAAE,OAAO;QACpB,eAAe,EAAE,aAAa;KAC/B;CACF,CAAC,CAAC","sourcesContent":["import React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { View, StyleSheet, TouchableOpacity, Text } from 'react-native';\nimport { Camera, useCameraDevice } from 'react-native-vision-camera';\nimport VisionCameraModule from '../modules/camera/VisionCameraModule';\nimport { useI18n } from '../hooks/useI18n';\nimport { EnhancedCameraViewProps } from './OverLay/type';\nimport { Button } from './ui/Button';\n\n\n\n\nexport const EnhancedCameraView: React.FC<EnhancedCameraViewProps> = ({ \n showCamera,\n cameraType: initialCameraType = 'front',\n style,\n onCapture,\n onError,\n onClose,\n enableFlash = false,\n enableHdr = false,\n quality = 'high',\n showCaptureButton = true,\n showSwitchCamera = true,\n overlayComponent,\n bbox,\n canFlip = true,\n enableVideo = false,\n isRecording = false,\n onVideoRecordingStart,\n onVideoRecordingStop,\n videoDuration = 10,\n onSilentCapture,\n silentCaptureResult,\n}) => {\n const { t } = useI18n();\n const camera = useRef<Camera>(null);\n const [cameraType, setCameraType] = useState<'front' | 'back'>(initialCameraType);\n const [hasPermission, setHasPermission] = useState(false);\n const [isInitialized, setIsInitialized] = useState(false);\n const [flash, setFlash] = useState<'off' | 'on' | 'auto'>('off');\n const [refreshCamera, setRefreshCamera] = useState(false);\n\n const device = useCameraDevice(cameraType);\n console.log({ setCameraType, setFlash });\n\n const checkPermissions = async () => {\n try {\n const hasAllPermissions = await VisionCameraModule.hasAllPermissions();\n console.log('hasAllPermissions', hasAllPermissions);\n if (!hasAllPermissions) {\n const granted = await VisionCameraModule.requestAllPermissions();\n console.log('granted', granted);\n if (!granted) {\n console.log('permissionRequired', t('camera.permissionRequired'));\n onError?.({ message: t('camera.permissionRequired') });\n return;\n }\n }\n setHasPermission(true);\n } catch (error) {\n console.error('Error checking permissions:', error);\n onError?.({ message: t('camera.errorOccurred') });\n }\n };\n\n // Check permissions on component mount\n useEffect(() => {\n if (showCamera) {\n checkPermissions();\n }\n }, [showCamera, refreshCamera]);\n\n\n\n const onInitialized = useCallback(() => {\n console.log('Camera initialized!');\n setIsInitialized(true);\n }, []);\n\n const onCameraError = useCallback((error: any) => {\n console.error('Camera error:', error);\n onError?.({ message: error.message || t('camera.errorOccurred') });\n }, [onError, t]);\n\n const captureSilentPhoto = useCallback(async () => {\n if (!camera.current || !isInitialized) {\n onError?.({ message: t('camera.notReady') });\n return;\n }\n console.log('silentCaptureResult', silentCaptureResult);\n if (silentCaptureResult?.isAnalyzing || silentCaptureResult?.success) {\n return;\n }\n try {\n const photo = await camera.current.takePhoto({\n enableShutterSound: true,\n flash: enableFlash ? flash : 'off',\n });\n\n const result = await VisionCameraModule.processPhotoResult(photo);\n onSilentCapture?.(result);\n } catch (error) {\n\n }\n }, [isInitialized, onError, onSilentCapture]);\n\n // Automatically take a silent photo every 5 seconds when ready\n useEffect(() => {\n if (!showCamera || !isInitialized) {\n return;\n }\n\n const intervalId = setInterval(() => {\n captureSilentPhoto();\n }, 5000);\n\n return () => clearInterval(intervalId);\n }, [showCamera, isInitialized, captureSilentPhoto]);\n\n const capturePhoto = useCallback(async () => {\n try {\n if (!camera.current || !isInitialized) {\n onError?.({ message: t('camera.notReady') });\n return;\n }\n if (silentCaptureResult?.success) {\n onCapture?.({\n success: true,\n path: silentCaptureResult.path,\n });\n return;\n }\n\n const photo = await camera.current.takePhoto({\n enableShutterSound: true,\n flash: enableFlash ? flash : 'off',\n });\n\n const result = await VisionCameraModule.processPhotoResult(photo);\n onCapture?.(result);\n } catch (error) {\n console.error('Error taking photo:', error);\n onCapture?.({\n success: false,\n error: error instanceof Error ? error.message : t('camera.failedToCapture'),\n });\n }\n }, [isInitialized, quality, flash, enableFlash, onCapture, onError]);\n\n const startVideoRecording = useCallback(async () => {\n try {\n if (!camera.current || !isInitialized) {\n onError?.({ message: t('camera.notReady') });\n return;\n }\n\n await camera.current.startRecording({\n onRecordingFinished: (video: any) => {\n onVideoRecordingStop?.({\n success: true,\n path: video.path,\n });\n },\n onRecordingError: (error: any) => {\n console.error('Recording error:', error);\n onVideoRecordingStop?.({\n success: false,\n error: error.message || t('camera.failedToStartRecording'),\n });\n },\n });\n\n onVideoRecordingStart?.();\n } catch (error) {\n console.error('Error starting video recording:', error);\n onVideoRecordingStop?.({\n success: false,\n error: error instanceof Error ? error.message : t('camera.failedToStartRecording'),\n });\n }\n }, [isInitialized, onVideoRecordingStart, onVideoRecordingStop, onError]);\n\n const stopVideoRecording = useCallback(async () => {\n try {\n if (!camera.current) {\n onError?.({ message: t('camera.notReady') });\n return;\n }\n\n await camera.current.stopRecording();\n } catch (error) {\n console.error('Error stopping video recording:', error);\n onError?.({ message: t('camera.failedToStopRecording') });\n }\n }, [onError]);\n\n // const switchCamera = useCallback(() => {\n // setCameraType(current => current === 'front' ? 'back' : 'front');\n // }, []);\n\n // const toggleFlash = useCallback(() => {\n // setFlash(current => {\n // switch (current) {\n // case 'off': return 'on';\n // case 'on': return 'auto';\n // case 'auto': return 'off';\n // default: return 'off';\n // }\n // });\n // }, []);\n\n if (!hasPermission) {\n return (\n <View style={[styles.container, style]}>\n <Text style={styles.permissionMessage}>\n {t('camera.permissionRequired')}\n </Text>\n <Button title=\"Refresh Camera\" onPress={() => setRefreshCamera(!refreshCamera)} />\n </View>\n );\n }\n\n if (!device) {\n return (\n <View style={[styles.container, style]}>\n <Text style={styles.errorMessage}>\n {t('camera.deviceNotAvailable')}\n </Text>\n </View>\n );\n }\n\n if (!showCamera) {\n return <View style={[styles.container, style]} />;\n }\n\n return (\n <View style={[styles.container, style]}>\n <Camera\n ref={camera}\n style={StyleSheet.absoluteFill}\n device={device}\n isActive={showCamera}\n photo={true}\n video={enableVideo}\n audio={enableVideo}\n onInitialized={onInitialized}\n onError={onCameraError}\n />\n\n {/* Instructions */}\n {/* {instructions && (\n <View style={styles.instructionsOverlay}>\n <Text style={styles.instructions}>{instructions}</Text>\n </View>\n )} */}\n\n {/* Custom overlay component */}\n {overlayComponent}\n\n {/* Bounding box overlay */}\n {bbox && (\n <View style={styles.bboxOverlay}>\n <View\n style={[\n styles.bbox,\n {\n left: `${bbox.xMin}%`,\n top: `${bbox.yMin}%`,\n width: `${bbox.xMax - bbox.xMin}%`,\n height: `${bbox.yMax - bbox.yMin}%`,\n borderColor: bbox.borderColor || '#2DBD60',\n borderWidth: bbox.borderWidth || 3,\n borderRadius: bbox.cornerRadius || 8,\n }\n ]}\n />\n </View>\n )}\n\n\n {/* Camera controls */}\n <View style={styles.controlsContainer}>\n {/* Flash button */}\n {/* {enableFlash && (\n <TouchableOpacity style={styles.controlButton} onPress={toggleFlash}>\n <Text style={styles.controlButtonText}>\n {flash === 'off' ? '⚡' : flash === 'on' ? '⚡️' : '✨'}\n </Text>\n </TouchableOpacity>\n )} */}\n\n {/* Capture button */}\n {showCaptureButton && !enableVideo && silentCaptureResult?.success && (\n <TouchableOpacity\n style={styles.captureButton}\n onPress={capturePhoto}\n disabled={!isInitialized}\n >\n <View style={[\n styles.captureButtonInner,\n !isInitialized && styles.captureButtonDisabled\n ]} />\n </TouchableOpacity>\n )}\n\n {/* Video recording button */}\n {showCaptureButton && enableVideo && silentCaptureResult?.success && (\n <TouchableOpacity\n style={[\n styles.captureButton,\n isRecording && styles.recordingButton\n ]}\n onPress={isRecording ? stopVideoRecording : startVideoRecording}\n disabled={!isInitialized}\n >\n <View style={[\n styles.captureButtonInner,\n !isInitialized && styles.captureButtonDisabled,\n isRecording && styles.recordingButtonInner\n ]} />\n </TouchableOpacity>\n )}\n\n {/* Switch camera button */}\n {/* {showSwitchCamera && canFlip && (\n <TouchableOpacity style={styles.controlButton} onPress={switchCamera}>\n <Text style={styles.controlButtonText}>🔄</Text>\n </TouchableOpacity>\n )} */}\n\n {silentCaptureResult?.isAnalyzing && (\n <View style={{ backgroundColor: 'rgba(0, 0, 0, 0.7)', padding: 10, borderRadius: 10 }}>\n <Text style={{ color: 'white', fontSize: 16, fontWeight: 'bold' }}>{t('camera.analyzing')}</Text>\n </View>\n )}\n </View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n backgroundColor: 'black',\n },\n instructionsOverlay: {\n position: 'absolute',\n top: 60,\n left: 20,\n right: 20,\n backgroundColor: 'rgba(0, 0, 0, 0.7)',\n padding: 15,\n // borderRadius: 10,\n zIndex: 1,\n },\n instructions: {\n color: 'white',\n fontSize: 16,\n textAlign: 'center',\n fontWeight: '500',\n },\n closeButton: {\n position: 'absolute',\n top: 50,\n right: 20,\n backgroundColor: 'rgba(0, 0, 0, 0.7)',\n width: 40,\n height: 40,\n borderRadius: 20,\n justifyContent: 'center',\n alignItems: 'center',\n zIndex: 2,\n },\n closeButtonText: {\n color: 'white',\n fontSize: 20,\n fontWeight: 'bold',\n },\n controlsContainer: {\n position: 'absolute',\n bottom: 40,\n left: 0,\n right: 0,\n flexDirection: 'row',\n justifyContent: 'space-around',\n alignItems: 'center',\n paddingHorizontal: 40,\n zIndex: 1,\n },\n controlButton: {\n backgroundColor: 'rgba(0, 0, 0, 0.7)',\n width: 50,\n height: 50,\n borderRadius: 25,\n justifyContent: 'center',\n alignItems: 'center',\n },\n controlButtonText: {\n fontSize: 24,\n },\n captureButton: {\n backgroundColor: 'rgba(255, 255, 255, 0.3)',\n width: 80,\n height: 80,\n borderRadius: 40,\n justifyContent: 'center',\n alignItems: 'center',\n borderWidth: 3,\n borderColor: 'white',\n },\n captureButtonInner: {\n backgroundColor: 'white',\n width: 60,\n height: 60,\n borderRadius: 30,\n },\n captureButtonDisabled: {\n backgroundColor: 'rgba(255, 255, 255, 0.5)',\n },\n recordingButton: {\n backgroundColor: 'rgba(255, 59, 48, 0.3)',\n borderColor: '#FF3B30',\n },\n recordingButtonInner: {\n backgroundColor: '#FF3B30',\n },\n permissionMessage: {\n color: 'white',\n fontSize: 16,\n textAlign: 'center',\n margin: 20,\n },\n errorMessage: {\n color: 'red',\n fontSize: 16,\n textAlign: 'center',\n margin: 20,\n },\n bboxOverlay: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n pointerEvents: 'none',\n },\n bbox: {\n position: 'absolute',\n borderStyle: 'solid',\n backgroundColor: 'transparent',\n },\n});"]}
|
|
1
|
+
{"version":3,"file":"EnhancedCameraView.js","sourceRoot":"","sources":["../../src/components/EnhancedCameraView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACjF,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,kBAAkB,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAKrC,MAAM,CAAC,MAAM,kBAAkB,GAAsC,CAAC,EACpE,UAAU,EACV,UAAU,EAAE,iBAAiB,GAAG,OAAO,EACvC,KAAK,EACL,SAAS,EACT,OAAO,EACP,OAAO,EACP,WAAW,GAAG,KAAK,EACnB,SAAS,GAAG,KAAK,EACjB,OAAO,GAAG,MAAM,EAChB,iBAAiB,GAAG,IAAI,EACxB,gBAAgB,GAAG,IAAI,EACvB,gBAAgB,EAChB,IAAI,EACJ,OAAO,GAAG,IAAI,EACd,WAAW,GAAG,KAAK,EACnB,WAAW,GAAG,KAAK,EACnB,qBAAqB,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B,MAAM,EAAE,EAAE;KACX;IACD,WAAW,EAAE;QACX,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;QACT,aAAa,EAAE,MAAM;KACtB;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,UAAU;QACpB,WAAW,EAAE,OAAO;QACpB,eAAe,EAAE,aAAa;KAC/B;CACF,CAAC,CAAC","sourcesContent":["import React, { useCallback, useEffect, useRef, useState, useMemo } from 'react';\nimport { View, StyleSheet, TouchableOpacity, Text } from 'react-native';\nimport { Camera, useCameraDevice } from 'react-native-vision-camera';\nimport VisionCameraModule from '../modules/camera/VisionCameraModule';\nimport { useI18n } from '../hooks/useI18n';\nimport { EnhancedCameraViewProps } from './OverLay/type';\nimport { Button } from './ui/Button';\n\n\n\n\nexport const EnhancedCameraView: React.FC<EnhancedCameraViewProps> = ({ \n showCamera,\n cameraType: initialCameraType = 'front',\n style,\n onCapture,\n onError,\n onClose,\n enableFlash = false,\n enableHdr = false,\n quality = 'high',\n showCaptureButton = true,\n showSwitchCamera = true,\n overlayComponent,\n bbox,\n canFlip = true,\n enableVideo = false,\n isRecording = false,\n onVideoRecordingStart,\n onVideoRecordingStop,\n videoDuration = 10,\n onSilentCapture,\n silentCaptureResult,\n}) => {\n const { t } = useI18n();\n const camera = useRef<Camera>(null);\n const [cameraType, setCameraType] = useState<'front' | 'back'>(initialCameraType);\n const [hasPermission, setHasPermission] = useState(false);\n const [isInitialized, setIsInitialized] = useState(false);\n const [flash, setFlash] = useState<'off' | 'on' | 'auto'>('off');\n const [refreshCamera, setRefreshCamera] = useState(false);\n\n const device = useCameraDevice(cameraType);\n console.log({ setCameraType, setFlash });\n\n // Sélectionner le meilleur format disponible pour une qualité maximale\n // Prioriser les formats avec une bonne résolution vidéo (pour la prévisualisation) ET photo (pour la capture)\n const bestFormat = useMemo(() => {\n if (!device || !device.formats || device.formats.length === 0) {\n return undefined;\n }\n \n // Trier les formats en combinant la résolution vidéo (pour la prévisualisation) et photo (pour la capture)\n // On priorise les formats avec une bonne résolution vidéo car c'est ce qui est affiché en temps réel\n const sortedFormats = [...device.formats].sort((a, b) => {\n // Résolution vidéo (pour la prévisualisation live)\n const videoResolutionA = (a.videoWidth || 0) * (a.videoHeight || 0);\n const videoResolutionB = (b.videoWidth || 0) * (b.videoHeight || 0);\n \n // Résolution photo (pour la capture)\n const photoResolutionA = (a.photoWidth || 0) * (a.photoHeight || 0);\n const photoResolutionB = (b.photoWidth || 0) * (b.photoHeight || 0);\n \n // Prioriser d'abord la résolution vidéo (prévisualisation), puis la résolution photo\n if (videoResolutionB !== videoResolutionA) {\n return videoResolutionB - videoResolutionA;\n }\n return photoResolutionB - photoResolutionA;\n });\n \n return sortedFormats[0];\n }, [device]);\n\n const checkPermissions = async () => {\n try {\n const hasAllPermissions = await VisionCameraModule.hasAllPermissions();\n console.log('hasAllPermissions', hasAllPermissions);\n if (!hasAllPermissions) {\n const granted = await VisionCameraModule.requestAllPermissions();\n console.log('granted', granted);\n if (!granted) {\n console.log('permissionRequired', t('camera.permissionRequired'));\n onError?.({ message: t('camera.permissionRequired') });\n return;\n }\n }\n setHasPermission(true);\n } catch (error) {\n console.error('Error checking permissions:', error);\n onError?.({ message: t('camera.errorOccurred') });\n }\n };\n\n // Check permissions on component mount\n useEffect(() => {\n if (showCamera) {\n checkPermissions();\n }\n }, [showCamera, refreshCamera]);\n\n\n\n const onInitialized = useCallback(() => {\n console.log('Camera initialized!');\n setIsInitialized(true);\n }, []);\n\n const onCameraError = useCallback((error: any) => {\n console.error('Camera error:', error);\n onError?.({ message: error.message || t('camera.errorOccurred') });\n }, [onError, t]);\n\n const captureSilentPhoto = useCallback(async () => {\n if (!camera.current || !isInitialized) {\n onError?.({ message: t('camera.notReady') });\n return;\n }\n console.log('silentCaptureResult', silentCaptureResult);\n if (silentCaptureResult?.isAnalyzing || silentCaptureResult?.success) {\n return;\n }\n try {\n const photo = await camera.current.takePhoto({\n enableShutterSound: true,\n flash: enableFlash ? flash : 'off',\n });\n\n const result = await VisionCameraModule.processPhotoResult(photo);\n onSilentCapture?.(result);\n } catch (error) {\n\n }\n }, [isInitialized, onError, onSilentCapture, enableFlash, flash, silentCaptureResult]);\n\n // Automatically take a silent photo every 5 seconds when ready\n useEffect(() => {\n if (!showCamera || !isInitialized) {\n return;\n }\n\n const intervalId = setInterval(() => {\n captureSilentPhoto();\n }, 5000);\n\n return () => clearInterval(intervalId);\n }, [showCamera, isInitialized, captureSilentPhoto]);\n\n const capturePhoto = useCallback(async () => {\n try {\n if (!camera.current || !isInitialized) {\n onError?.({ message: t('camera.notReady') });\n return;\n }\n if (silentCaptureResult?.success) {\n onCapture?.({\n success: true,\n path: silentCaptureResult.path,\n });\n return;\n }\n\n const photo = await camera.current.takePhoto({\n enableShutterSound: true,\n flash: enableFlash ? flash : 'off',\n });\n\n const result = await VisionCameraModule.processPhotoResult(photo);\n onCapture?.(result);\n } catch (error) {\n console.error('Error taking photo:', error);\n onCapture?.({\n success: false,\n error: error instanceof Error ? error.message : t('camera.failedToCapture'),\n });\n }\n }, [isInitialized, quality, flash, enableFlash, onCapture, onError]);\n\n const startVideoRecording = useCallback(async () => {\n try {\n if (!camera.current || !isInitialized) {\n onError?.({ message: t('camera.notReady') });\n return;\n }\n\n await camera.current.startRecording({\n onRecordingFinished: (video: any) => {\n onVideoRecordingStop?.({\n success: true,\n path: video.path,\n });\n },\n onRecordingError: (error: any) => {\n console.error('Recording error:', error);\n onVideoRecordingStop?.({\n success: false,\n error: error.message || t('camera.failedToStartRecording'),\n });\n },\n });\n\n onVideoRecordingStart?.();\n } catch (error) {\n console.error('Error starting video recording:', error);\n onVideoRecordingStop?.({\n success: false,\n error: error instanceof Error ? error.message : t('camera.failedToStartRecording'),\n });\n }\n }, [isInitialized, onVideoRecordingStart, onVideoRecordingStop, onError]);\n\n const stopVideoRecording = useCallback(async () => {\n try {\n if (!camera.current) {\n onError?.({ message: t('camera.notReady') });\n return;\n }\n\n await camera.current.stopRecording();\n } catch (error) {\n console.error('Error stopping video recording:', error);\n onError?.({ message: t('camera.failedToStopRecording') });\n }\n }, [onError]);\n\n // const switchCamera = useCallback(() => {\n // setCameraType(current => current === 'front' ? 'back' : 'front');\n // }, []);\n\n // const toggleFlash = useCallback(() => {\n // setFlash(current => {\n // switch (current) {\n // case 'off': return 'on';\n // case 'on': return 'auto';\n // case 'auto': return 'off';\n // default: return 'off';\n // }\n // });\n // }, []);\n\n if (!hasPermission) {\n return (\n <View style={[styles.container, style]}>\n <Text style={styles.permissionMessage}>\n {t('camera.permissionRequired')}\n </Text>\n <Button title=\"Refresh Camera\" onPress={() => setRefreshCamera(!refreshCamera)} />\n </View>\n );\n }\n\n if (!device) {\n return (\n <View style={[styles.container, style]}>\n <Text style={styles.errorMessage}>\n {t('camera.deviceNotAvailable')}\n </Text>\n </View>\n );\n }\n\n if (!showCamera) {\n return <View style={[styles.container, style]} />;\n }\n\n return (\n <View style={[styles.container, style]}>\n <Camera\n ref={camera}\n style={StyleSheet.absoluteFill}\n device={device}\n isActive={showCamera}\n photo={true}\n video={enableVideo}\n audio={enableVideo}\n format={bestFormat}\n onInitialized={onInitialized}\n onError={onCameraError}\n />\n\n {/* Instructions */}\n {/* {instructions && (\n <View style={styles.instructionsOverlay}>\n <Text style={styles.instructions}>{instructions}</Text>\n </View>\n )} */}\n\n {/* Custom overlay component */}\n {overlayComponent}\n\n {/* Bounding box overlay */}\n {bbox && (\n <View style={styles.bboxOverlay}>\n <View\n style={[\n styles.bbox,\n {\n left: `${bbox.xMin}%`,\n top: `${bbox.yMin}%`,\n width: `${bbox.xMax - bbox.xMin}%`,\n height: `${bbox.yMax - bbox.yMin}%`,\n borderColor: bbox.borderColor || '#2DBD60',\n borderWidth: bbox.borderWidth || 3,\n borderRadius: bbox.cornerRadius || 8,\n }\n ]}\n />\n </View>\n )}\n\n\n {/* Camera controls */}\n <View style={styles.controlsContainer}>\n {/* Flash button */}\n {/* {enableFlash && (\n <TouchableOpacity style={styles.controlButton} onPress={toggleFlash}>\n <Text style={styles.controlButtonText}>\n {flash === 'off' ? '⚡' : flash === 'on' ? '⚡️' : '✨'}\n </Text>\n </TouchableOpacity>\n )} */}\n\n {/* Capture button */}\n {showCaptureButton && !enableVideo && silentCaptureResult?.success && (\n <TouchableOpacity\n style={styles.captureButton}\n onPress={capturePhoto}\n disabled={!isInitialized}\n >\n <View style={[\n styles.captureButtonInner,\n !isInitialized && styles.captureButtonDisabled\n ]} />\n </TouchableOpacity>\n )}\n\n {/* Video recording button */}\n {showCaptureButton && enableVideo && silentCaptureResult?.success && (\n <TouchableOpacity\n style={[\n styles.captureButton,\n isRecording && styles.recordingButton\n ]}\n onPress={isRecording ? stopVideoRecording : startVideoRecording}\n disabled={!isInitialized}\n >\n <View style={[\n styles.captureButtonInner,\n !isInitialized && styles.captureButtonDisabled,\n isRecording && styles.recordingButtonInner\n ]} />\n </TouchableOpacity>\n )}\n\n {/* Switch camera button */}\n {/* {showSwitchCamera && canFlip && (\n <TouchableOpacity style={styles.controlButton} onPress={switchCamera}>\n <Text style={styles.controlButtonText}>🔄</Text>\n </TouchableOpacity>\n )} */}\n\n {silentCaptureResult?.isAnalyzing && (\n <View style={{ backgroundColor: 'rgba(0, 0, 0, 0.7)', padding: 10, borderRadius: 10 }}>\n <Text style={{ color: 'white', fontSize: 16, fontWeight: 'bold' }}>{t('camera.analyzing')}</Text>\n </View>\n )}\n </View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n backgroundColor: 'black',\n },\n instructionsOverlay: {\n position: 'absolute',\n top: 60,\n left: 20,\n right: 20,\n backgroundColor: 'rgba(0, 0, 0, 0.7)',\n padding: 15,\n // borderRadius: 10,\n zIndex: 1,\n },\n instructions: {\n color: 'white',\n fontSize: 16,\n textAlign: 'center',\n fontWeight: '500',\n },\n closeButton: {\n position: 'absolute',\n top: 50,\n right: 20,\n backgroundColor: 'rgba(0, 0, 0, 0.7)',\n width: 40,\n height: 40,\n borderRadius: 20,\n justifyContent: 'center',\n alignItems: 'center',\n zIndex: 2,\n },\n closeButtonText: {\n color: 'white',\n fontSize: 20,\n fontWeight: 'bold',\n },\n controlsContainer: {\n position: 'absolute',\n bottom: 40,\n left: 0,\n right: 0,\n flexDirection: 'row',\n justifyContent: 'space-around',\n alignItems: 'center',\n paddingHorizontal: 40,\n zIndex: 1,\n },\n controlButton: {\n backgroundColor: 'rgba(0, 0, 0, 0.7)',\n width: 50,\n height: 50,\n borderRadius: 25,\n justifyContent: 'center',\n alignItems: 'center',\n },\n controlButtonText: {\n fontSize: 24,\n },\n captureButton: {\n backgroundColor: 'rgba(255, 255, 255, 0.3)',\n width: 80,\n height: 80,\n borderRadius: 40,\n justifyContent: 'center',\n alignItems: 'center',\n borderWidth: 3,\n borderColor: 'white',\n },\n captureButtonInner: {\n backgroundColor: 'white',\n width: 60,\n height: 60,\n borderRadius: 30,\n },\n captureButtonDisabled: {\n backgroundColor: 'rgba(255, 255, 255, 0.5)',\n },\n recordingButton: {\n backgroundColor: 'rgba(255, 59, 48, 0.3)',\n borderColor: '#FF3B30',\n },\n recordingButtonInner: {\n backgroundColor: '#FF3B30',\n },\n permissionMessage: {\n color: 'white',\n fontSize: 16,\n textAlign: 'center',\n margin: 20,\n },\n errorMessage: {\n color: 'red',\n fontSize: 16,\n textAlign: 'center',\n margin: 20,\n },\n bboxOverlay: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n pointerEvents: 'none',\n },\n bbox: {\n position: 'absolute',\n borderStyle: 'solid',\n backgroundColor: 'transparent',\n },\n});"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnhancedCameraView.web.d.ts","sourceRoot":"","sources":["../../src/components/EnhancedCameraView.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAExE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"EnhancedCameraView.web.d.ts","sourceRoot":"","sources":["../../src/components/EnhancedCameraView.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAExE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAIzD,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAwZhE,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { View, StyleSheet, TouchableOpacity, Text, Platform } from 'react-native';
|
|
3
|
+
import { useI18n } from '../hooks/useI18n';
|
|
3
4
|
export const EnhancedCameraView = ({ instructions = 'Position yourself in the frame and tap the capture button', showCamera, cameraType: initialCameraType = 'front', style, onCapture, onError, onClose, enableFlash = false, enableHdr = false, quality = 'high', showCaptureButton = true, showSwitchCamera = true, overlayComponent, bbox, canFlip = true, enableVideo = false, isRecording = false, onVideoRecordingStart, onVideoRecordingStop, videoDuration = 10, onSilentCapture, silentCaptureResult, }) => {
|
|
5
|
+
const { t } = useI18n();
|
|
4
6
|
// Vérification de plateforme - ce composant est uniquement pour le web
|
|
5
7
|
if (Platform.OS !== 'web') {
|
|
6
8
|
console.warn('EnhancedCameraView.web.tsx should only be used on web platform');
|
|
@@ -272,6 +274,11 @@ export const EnhancedCameraView = ({ instructions = 'Position yourself in the fr
|
|
|
272
274
|
]}/>
|
|
273
275
|
</View>)}
|
|
274
276
|
|
|
277
|
+
{/* Analyzing indicator - Same as mobile */}
|
|
278
|
+
{silentCaptureResult?.isAnalyzing && (<View style={styles.analyzingContainer}>
|
|
279
|
+
<Text style={styles.analyzingText}>{t('camera.analyzing')}</Text>
|
|
280
|
+
</View>)}
|
|
281
|
+
|
|
275
282
|
{/* Camera controls */}
|
|
276
283
|
<View style={styles.controlsContainer}>
|
|
277
284
|
{/* Flash button */}
|
|
@@ -419,5 +426,19 @@ const styles = StyleSheet.create({
|
|
|
419
426
|
borderStyle: 'solid',
|
|
420
427
|
backgroundColor: 'transparent',
|
|
421
428
|
},
|
|
429
|
+
analyzingContainer: {
|
|
430
|
+
position: 'absolute',
|
|
431
|
+
bottom: 100,
|
|
432
|
+
alignSelf: 'center',
|
|
433
|
+
backgroundColor: 'rgba(0, 0, 0, 0.7)',
|
|
434
|
+
padding: 10,
|
|
435
|
+
borderRadius: 10,
|
|
436
|
+
zIndex: 1000,
|
|
437
|
+
},
|
|
438
|
+
analyzingText: {
|
|
439
|
+
color: 'white',
|
|
440
|
+
fontSize: 16,
|
|
441
|
+
fontWeight: 'bold',
|
|
442
|
+
},
|
|
422
443
|
});
|
|
423
444
|
//# sourceMappingURL=EnhancedCameraView.web.js.map
|