@transfergratis/react-native-sdk 0.1.22 → 0.1.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/android/src/main/AndroidManifest.xml +9 -4
  2. package/build/components/EnhancedCameraView.d.ts.map +1 -1
  3. package/build/components/EnhancedCameraView.js +26 -3
  4. package/build/components/EnhancedCameraView.js.map +1 -1
  5. package/build/components/EnhancedCameraView.web.d.ts.map +1 -1
  6. package/build/components/EnhancedCameraView.web.js +21 -0
  7. package/build/components/EnhancedCameraView.web.js.map +1 -1
  8. package/build/components/KYCElements/CameraCapture.d.ts.map +1 -1
  9. package/build/components/KYCElements/CameraCapture.js +4 -3
  10. package/build/components/KYCElements/CameraCapture.js.map +1 -1
  11. package/build/components/KYCElements/CountrySelectionTemplate.d.ts +5 -2
  12. package/build/components/KYCElements/CountrySelectionTemplate.d.ts.map +1 -1
  13. package/build/components/KYCElements/CountrySelectionTemplate.js +360 -101
  14. package/build/components/KYCElements/CountrySelectionTemplate.js.map +1 -1
  15. package/build/components/KYCElements/FileUpload.d.ts.map +1 -1
  16. package/build/components/KYCElements/FileUpload.js +5 -4
  17. package/build/components/KYCElements/FileUpload.js.map +1 -1
  18. package/build/components/KYCElements/FileUploadTemplate.d.ts.map +1 -1
  19. package/build/components/KYCElements/FileUploadTemplate.js +5 -4
  20. package/build/components/KYCElements/FileUploadTemplate.js.map +1 -1
  21. package/build/components/KYCElements/IDCardCapture.d.ts.map +1 -1
  22. package/build/components/KYCElements/IDCardCapture.js +193 -237
  23. package/build/components/KYCElements/IDCardCapture.js.map +1 -1
  24. package/build/components/KYCElements/LocationCaptureTemplate.d.ts.map +1 -1
  25. package/build/components/KYCElements/LocationCaptureTemplate.js +78 -37
  26. package/build/components/KYCElements/LocationCaptureTemplate.js.map +1 -1
  27. package/build/components/KYCElements/OrientationVideoCapture.js +3 -2
  28. package/build/components/KYCElements/OrientationVideoCapture.js.map +1 -1
  29. package/build/components/KYCElements/OrientationVideoCaptureEnhanced.js +3 -2
  30. package/build/components/KYCElements/OrientationVideoCaptureEnhanced.js.map +1 -1
  31. package/build/components/KYCElements/OrientationVideoCaptureFinal.js +3 -2
  32. package/build/components/KYCElements/OrientationVideoCaptureFinal.js.map +1 -1
  33. package/build/components/KYCElements/SelfieCapture.d.ts.map +1 -1
  34. package/build/components/KYCElements/SelfieCapture.js +4 -3
  35. package/build/components/KYCElements/SelfieCapture.js.map +1 -1
  36. package/build/components/KYCElements/SelfieCaptureTemplate.d.ts.map +1 -1
  37. package/build/components/KYCElements/SelfieCaptureTemplate.js +182 -39
  38. package/build/components/KYCElements/SelfieCaptureTemplate.js.map +1 -1
  39. package/build/components/KYCElements/WelcomeTemplate.d.ts +12 -0
  40. package/build/components/KYCElements/WelcomeTemplate.d.ts.map +1 -0
  41. package/build/components/KYCElements/WelcomeTemplate.js +243 -0
  42. package/build/components/KYCElements/WelcomeTemplate.js.map +1 -0
  43. package/build/components/TemplateKYCExample.d.ts +4 -2
  44. package/build/components/TemplateKYCExample.d.ts.map +1 -1
  45. package/build/components/TemplateKYCExample.js +5 -68
  46. package/build/components/TemplateKYCExample.js.map +1 -1
  47. package/build/components/TemplateKYCFlowRefactored.d.ts +2 -1
  48. package/build/components/TemplateKYCFlowRefactored.d.ts.map +1 -1
  49. package/build/components/TemplateKYCFlowRefactored.js +95 -9
  50. package/build/components/TemplateKYCFlowRefactored.js.map +1 -1
  51. package/build/components/example/DynamicTemplateExample.d.ts +10 -0
  52. package/build/components/example/DynamicTemplateExample.d.ts.map +1 -0
  53. package/build/components/example/DynamicTemplateExample.js +241 -0
  54. package/build/components/example/DynamicTemplateExample.js.map +1 -0
  55. package/build/config/allowedDomains.d.ts +30 -0
  56. package/build/config/allowedDomains.d.ts.map +1 -0
  57. package/build/config/allowedDomains.js +127 -0
  58. package/build/config/allowedDomains.js.map +1 -0
  59. package/build/hooks/useTemplateKYCFlow.d.ts.map +1 -1
  60. package/build/hooks/useTemplateKYCFlow.js +68 -43
  61. package/build/hooks/useTemplateKYCFlow.js.map +1 -1
  62. package/build/hooks/useTemplateLoader.d.ts +14 -0
  63. package/build/hooks/useTemplateLoader.d.ts.map +1 -0
  64. package/build/hooks/useTemplateLoader.js +85 -0
  65. package/build/hooks/useTemplateLoader.js.map +1 -0
  66. package/build/i18n/en/index.d.ts +9 -0
  67. package/build/i18n/en/index.d.ts.map +1 -1
  68. package/build/i18n/en/index.js +9 -0
  69. package/build/i18n/en/index.js.map +1 -1
  70. package/build/i18n/fr/index.d.ts +9 -0
  71. package/build/i18n/fr/index.d.ts.map +1 -1
  72. package/build/i18n/fr/index.js +9 -0
  73. package/build/i18n/fr/index.js.map +1 -1
  74. package/build/index.d.ts +5 -0
  75. package/build/index.d.ts.map +1 -1
  76. package/build/index.js +8 -0
  77. package/build/index.js.map +1 -1
  78. package/build/modules/api/CardAuthentification.js +1 -0
  79. package/build/modules/api/CardAuthentification.js.map +1 -1
  80. package/build/modules/api/KYCService.d.ts +4 -1
  81. package/build/modules/api/KYCService.d.ts.map +1 -1
  82. package/build/modules/api/KYCService.js +17 -5
  83. package/build/modules/api/KYCService.js.map +1 -1
  84. package/build/modules/api/TemplateService.d.ts +45 -0
  85. package/build/modules/api/TemplateService.d.ts.map +1 -0
  86. package/build/modules/api/TemplateService.js +145 -0
  87. package/build/modules/api/TemplateService.js.map +1 -0
  88. package/build/modules/api/types.d.ts +1 -0
  89. package/build/modules/api/types.d.ts.map +1 -1
  90. package/build/modules/api/types.js.map +1 -1
  91. package/build/types/KYC.types.d.ts +144 -4
  92. package/build/types/KYC.types.d.ts.map +1 -1
  93. package/build/types/KYC.types.js +15 -0
  94. package/build/types/KYC.types.js.map +1 -1
  95. package/build/utils/cropByObb.d.ts +1 -0
  96. package/build/utils/cropByObb.d.ts.map +1 -1
  97. package/build/utils/cropByObb.js +70 -0
  98. package/build/utils/cropByObb.js.map +1 -1
  99. package/build/utils/platformAlert.d.ts +20 -0
  100. package/build/utils/platformAlert.d.ts.map +1 -0
  101. package/build/utils/platformAlert.js +67 -0
  102. package/build/utils/platformAlert.js.map +1 -0
  103. package/build/utils/template-transformer.d.ts +10 -0
  104. package/build/utils/template-transformer.d.ts.map +1 -0
  105. package/build/utils/template-transformer.js +353 -0
  106. package/build/utils/template-transformer.js.map +1 -0
  107. package/build/web/WebKYCEntry.d.ts.map +1 -1
  108. package/build/web/WebKYCEntry.js +102 -20
  109. package/build/web/WebKYCEntry.js.map +1 -1
  110. package/package.json +1 -1
  111. package/src/components/EnhancedCameraView.tsx +31 -2
  112. package/src/components/EnhancedCameraView.web.tsx +24 -0
  113. package/src/components/KYCElements/CameraCapture.tsx +4 -3
  114. package/src/components/KYCElements/CountrySelectionTemplate.tsx +410 -113
  115. package/src/components/KYCElements/FileUpload.tsx +5 -4
  116. package/src/components/KYCElements/FileUploadTemplate.tsx +5 -4
  117. package/src/components/KYCElements/IDCardCapture.tsx +196 -254
  118. package/src/components/KYCElements/LocationCaptureTemplate.tsx +95 -44
  119. package/src/components/KYCElements/OrientationVideoCapture.tsx +2 -2
  120. package/src/components/KYCElements/OrientationVideoCaptureEnhanced.tsx +2 -2
  121. package/src/components/KYCElements/OrientationVideoCaptureFinal.tsx +2 -2
  122. package/src/components/KYCElements/SelfieCapture.tsx +4 -3
  123. package/src/components/KYCElements/SelfieCaptureTemplate.tsx +195 -41
  124. package/src/components/KYCElements/WelcomeTemplate.tsx +289 -0
  125. package/src/components/TemplateKYCExample.tsx +16 -71
  126. package/src/components/TemplateKYCFlowRefactored.tsx +121 -11
  127. package/src/components/example/DynamicTemplateExample.tsx +289 -0
  128. package/src/config/allowedDomains.ts +152 -0
  129. package/src/hooks/useTemplateKYCFlow.tsx +71 -46
  130. package/src/hooks/useTemplateLoader.ts +102 -0
  131. package/src/i18n/en/index.ts +10 -0
  132. package/src/i18n/fr/index.ts +9 -0
  133. package/src/index.ts +11 -0
  134. package/src/modules/api/CardAuthentification.ts +1 -1
  135. package/src/modules/api/KYCService.ts +18 -8
  136. package/src/modules/api/TemplateService.ts +167 -0
  137. package/src/modules/api/types.ts +1 -0
  138. package/src/types/KYC.types.ts +188 -3
  139. package/src/utils/cropByObb.ts +83 -3
  140. package/src/utils/platformAlert.ts +85 -0
  141. package/src/utils/template-transformer.ts +433 -0
  142. package/src/web/WebKYCEntry.tsx +122 -24
@@ -1,19 +1,24 @@
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
  <!-- Permissions nécessaires -->
6
7
  <uses-permission android:name="android.permission.CAMERA" />
7
8
  <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" />
9
+ <!-- READ_EXTERNAL_STORAGE is needed for Android < 13 (API 32) to access media files -->
10
+ <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
11
+ <!-- WRITE_EXTERNAL_STORAGE is ignored on Android 10+ (API 29+), kept for backward compatibility -->
12
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
13
+ <!-- READ_MEDIA_IMAGES for Android 13+ (API 33+) to access images via MediaStore API -->
14
+ <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
11
15
 
12
16
  <!-- Features nécessaires -->
13
17
  <uses-feature android:name="android.hardware.camera" android:required="true" />
14
18
  <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
15
19
 
16
- <application>
20
+ <application
21
+ android:requestLegacyExternalStorage="false">
17
22
  <!-- FileProvider pour partager les fichiers -->
18
23
  <provider
19
24
  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,KAAmD,MAAM,OAAO,CAAC;AAKxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAMzD,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAwUhE,CAAC"}
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,EA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B;QAC3C,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,EAAE;QAChB,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,WAAW,EAAE,CAAC;QACd,WAAW,EAAE,OAAO;KACrB;IACD,kBAAkB,EAAE;QAClB,eAAe,EAAE,OAAO;QACxB,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,EAAE;KACjB;IACD,qBAAqB,EAAE;QACrB,eAAe,EAAE,0BAA0B;KAC5C;IACD,eAAe,EAAE;QACf,eAAe,EAAE,wBAAwB;QACzC,WAAW,EAAE,SAAS;KACvB;IACD,oBAAoB,EAAE;QACpB,eAAe,EAAE,SAAS;KAC3B;IACD,iBAAiB,EAAE;QACjB,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,QAAQ;QACnB,MAAM,EAAE,EAAE;KACX;IACD,YAAY,EAAE;QACZ,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,EAAE;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,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AAE,EAAE;QACV,YAAY,EAAE,EAAE;QAChB,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,WAAW,EAAE,CAAC;QACd,WAAW,EAAE,OAAO;KACrB;IACD,kBAAkB,EAAE;QAClB,eAAe,EAAE,OAAO;QACxB,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,EAAE;KACjB;IACD,qBAAqB,EAAE;QACrB,eAAe,EAAE,0BAA0B;KAC5C;IACD,eAAe,EAAE;QACf,eAAe,EAAE,wBAAwB;QACzC,WAAW,EAAE,SAAS;KACvB;IACD,oBAAoB,EAAE;QACpB,eAAe,EAAE,SAAS;KAC3B;IACD,iBAAiB,EAAE;QACjB,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,QAAQ;QACnB,MAAM,EAAE,EAAE;KACX;IACD,YAAY,EAAE;QACZ,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,EAAE;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, 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;AAGzD,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA+YhE,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
@@ -1 +1 @@
1
- {"version":3,"file":"EnhancedCameraView.web.js","sourceRoot":"","sources":["../../src/components/EnhancedCameraView.web.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,QAAQ,EAAE,MAAM,cAAc,CAAC;AAIlF,MA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AChB,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,WAAW,EAAE,CAAC;QACd,WAAW,EAAE,OAAO;KACrB;IACD,kBAAkB,EAAE;QAClB,eAAe,EAAE,OAAO;QACxB,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,EAAE;KACjB;IACD,qBAAqB,EAAE;QACrB,eAAe,EAAE,0BAA0B;KAC5C;IACD,eAAe,EAAE;QACf,eAAe,EAAE,wBAAwB;QACzC,WAAW,EAAE,SAAS;KACvB;IACD,oBAAoB,EAAE;QACpB,eAAe,EAAE,SAAS;KAC3B;IACD,iBAAiB,EAAE;QACjB,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,QAAQ;QACnB,MAAM,EAAE,EAAE;KACX;IACD,YAAY,EAAE;QACZ,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,EAAE;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, Platform } from 'react-native';\nimport { EnhancedCameraViewProps } from './OverLay/type';\n\n\nexport const EnhancedCameraView: React.FC<EnhancedCameraViewProps> = ({\n instructions = 'Position yourself in the frame and tap the capture button',\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 // Vérification de plateforme - ce composant est uniquement pour le web\n if (Platform.OS !== 'web') {\n console.warn('EnhancedCameraView.web.tsx should only be used on web platform');\n return null;\n }\n const videoRef = useRef<HTMLVideoElement>(null);\n const canvasRef = useRef<HTMLCanvasElement>(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 [stream, setStream] = useState<MediaStream | null>(null);\n const [isRecordingVideo, setIsRecordingVideo] = useState(false);\n const [mediaRecorder, setMediaRecorder] = useState<MediaRecorder | null>(null);\n const [recordedChunks, setRecordedChunks] = useState<Blob[]>([]);\n\n console.log('cameraType', cameraType, recordedChunks);\n // Check permissions on component mount\n useEffect(() => {\n if (showCamera) {\n checkPermissions();\n }\n }, [showCamera]);\n\n // Cleanup stream on unmount\n useEffect(() => {\n return () => {\n if (stream) {\n stream.getTracks().forEach(track => track.stop());\n }\n };\n }, [stream]);\n\n const checkPermissions = async () => {\n try {\n if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {\n onError?.({ message: 'Camera not supported in this browser' });\n return;\n }\n\n // Test camera permission\n const stream = await navigator.mediaDevices.getUserMedia({ video: true });\n stream.getTracks().forEach(track => track.stop());\n\n setHasPermission(true);\n await startCamera();\n } catch (error) {\n console.error('Error checking permissions:', error);\n onError?.({ message: 'Camera permissions not granted' });\n }\n };\n\n const startCamera = async () => {\n try {\n if (stream) {\n stream.getTracks().forEach(track => track.stop());\n }\n\n const constraints = {\n video: {\n facingMode: cameraType === 'front' ? 'user' : 'environment',\n width: { ideal: quality === 'high' ? 1920 : quality === 'medium' ? 1280 : 640 },\n height: { ideal: quality === 'high' ? 1080 : quality === 'medium' ? 720 : 480 },\n },\n audio: enableVideo,\n };\n\n const newStream = await navigator.mediaDevices.getUserMedia(constraints);\n setStream(newStream);\n\n if (videoRef.current) {\n videoRef.current.srcObject = newStream;\n videoRef.current.onloadedmetadata = () => {\n setIsInitialized(true);\n };\n }\n } catch (error) {\n console.error('Error starting camera:', error);\n onError?.({ message: 'Failed to start camera' });\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 || 'Camera error occurred' });\n }, [onError]);\n\n console.log('isInitialized', onInitialized, onCameraError);\n\n const capturePhoto = useCallback(async () => {\n try {\n onCapture && onCapture({\n success: true\n })\n } catch (error) {\n console.error('Error taking photo:', error);\n onCapture?.({\n success: false,\n error: error instanceof Error ? error.message : 'Failed to capture photo',\n });\n }\n }, [isInitialized, onCapture, onError]);\n\n\n const captureSilentPhoto = useCallback(async () => {\n try {\n if (!videoRef.current || !canvasRef.current || !isInitialized) {\n onError?.({ message: 'Camera not ready' });\n return;\n }\n\n const video = videoRef.current;\n const canvas = canvasRef.current;\n const context = canvas.getContext('2d');\n\n if (!context) {\n onError?.({ message: 'Canvas context not available' });\n return;\n }\n\n // Set canvas dimensions to match video\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n\n // Draw the current video frame to canvas\n context.drawImage(video, 0, 0);\n\n // Convert to base64\n const imageDataUrl = canvas.toDataURL('image/jpeg', 0.8);\n\n onSilentCapture?.({\n success: true,\n path: imageDataUrl,\n });\n } catch (error) {\n console.error('Error taking photo:', error);\n onCapture?.({\n success: false,\n error: error instanceof Error ? error.message : 'Failed to capture photo',\n });\n }\n }, [isInitialized, onError, onSilentCapture]);\n\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 startVideoRecording = useCallback(async () => {\n try {\n if (!stream || !isInitialized) {\n onError?.({ message: 'Camera not ready' });\n return;\n }\n\n const chunks: Blob[] = [];\n setRecordedChunks(chunks);\n\n const recorder = new MediaRecorder(stream, {\n mimeType: 'video/webm;codecs=vp9',\n });\n\n recorder.ondataavailable = (event) => {\n if (event.data.size > 0) {\n chunks.push(event.data);\n }\n };\n\n recorder.onstop = () => {\n const blob = new Blob(chunks, { type: 'video/webm' });\n const url = URL.createObjectURL(blob);\n\n onVideoRecordingStop?.({\n success: true,\n path: url,\n });\n\n setRecordedChunks([]);\n setIsRecordingVideo(false);\n };\n\n recorder.onerror = (event) => {\n console.error('Recording error:', event);\n onVideoRecordingStop?.({\n success: false,\n error: 'Failed to record video',\n });\n setIsRecordingVideo(false);\n };\n\n setMediaRecorder(recorder);\n recorder.start();\n setIsRecordingVideo(true);\n onVideoRecordingStart?.();\n\n // Auto-stop after videoDuration seconds\n setTimeout(() => {\n if (recorder.state === 'recording') {\n recorder.stop();\n }\n }, videoDuration * 1000);\n\n } catch (error) {\n console.error('Error starting video recording:', error);\n onVideoRecordingStop?.({\n success: false,\n error: error instanceof Error ? error.message : 'Failed to start video recording',\n });\n }\n }, [isInitialized, stream, videoDuration, onVideoRecordingStart, onVideoRecordingStop, onError]);\n\n const stopVideoRecording = useCallback(async () => {\n try {\n if (mediaRecorder && mediaRecorder.state === 'recording') {\n mediaRecorder.stop();\n }\n } catch (error) {\n console.error('Error stopping video recording:', error);\n onError?.({ message: 'Failed to stop video recording' });\n }\n }, [mediaRecorder, onError]);\n\n const switchCamera = useCallback(async () => {\n setCameraType(current => current === 'front' ? 'back' : 'front');\n // Restart camera with new facing mode\n await startCamera();\n }, [cameraType]);\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 Camera permission required. Please grant permission to continue.\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 {/* Video element */}\n <video\n ref={videoRef}\n style={{\n position: 'absolute',\n width: '100%',\n height: '100%',\n objectFit: 'cover',\n }}\n autoPlay\n playsInline\n muted\n />\n\n {/* Hidden canvas for photo capture */}\n <canvas\n ref={canvasRef}\n style={{\n position: 'absolute',\n left: '-9999px',\n top: '-9999px',\n }}\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 {/* 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 && (\n <TouchableOpacity\n style={[\n styles.captureButton,\n isRecordingVideo && styles.recordingButton\n ]}\n onPress={isRecordingVideo ? stopVideoRecording : startVideoRecording}\n disabled={!isInitialized}\n >\n <View style={[\n styles.captureButtonInner,\n !isInitialized && styles.captureButtonDisabled,\n isRecordingVideo && 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 </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.web.js","sourceRoot":"","sources":["../../src/components/EnhancedCameraView.web.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,QAAQ,EAAE,MAAM,cAAc,CAAC;AAElF,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,MAAM,CAAC,MAAM,kBAAkB,GAAsC,CAAC,EACpE,YAAY,GAAG,2DAA2D,EAC1E,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,EACrB,oBAAoB,EACpB,aAAa,GAAG,EAAE,EAClB,eAA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EAAE,OAAO;KACrB;IACD,kBAAkB,EAAE;QAClB,eAAe,EAAE,OAAO;QACxB,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,EAAE;KACjB;IACD,qBAAqB,EAAE;QACrB,eAAe,EAAE,0BAA0B;KAC5C;IACD,eAAe,EAAE;QACf,eAAe,EAAE,wBAAwB;QACzC,WAAW,EAAE,SAAS;KACvB;IACD,oBAAoB,EAAE;QACpB,eAAe,EAAE,SAAS;KAC3B;IACD,iBAAiB,EAAE;QACjB,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,QAAQ;QACnB,MAAM,EAAE,EAAE;KACX;IACD,YAAY,EAAE;QACZ,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,EAAE;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;IACD,kBAAkB,EAAE;QAClB,QAAQ,EAAE,UAAU;QACpB,MAAM,EAAE,GAAG;QACX,SAAS,EAAE,QAAQ;QACnB,eAAe,EAAE,oBAAoB;QACrC,OAAO,EAAE,EAAE;QACX,YAAY,EAAE,EAAE;QAChB,MAAM,EAAE,IAAI;KACb;IACD,aAAa,EAAE;QACb,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,MAAM;KACnB;CACF,CAAC,CAAC","sourcesContent":["import React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { View, StyleSheet, TouchableOpacity, Text, Platform } from 'react-native';\nimport { EnhancedCameraViewProps } from './OverLay/type';\nimport { useI18n } from '../hooks/useI18n';\n\n\nexport const EnhancedCameraView: React.FC<EnhancedCameraViewProps> = ({\n instructions = 'Position yourself in the frame and tap the capture button',\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 \n // Vérification de plateforme - ce composant est uniquement pour le web\n if (Platform.OS !== 'web') {\n console.warn('EnhancedCameraView.web.tsx should only be used on web platform');\n return null;\n }\n const videoRef = useRef<HTMLVideoElement>(null);\n const canvasRef = useRef<HTMLCanvasElement>(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 [stream, setStream] = useState<MediaStream | null>(null);\n const [isRecordingVideo, setIsRecordingVideo] = useState(false);\n const [mediaRecorder, setMediaRecorder] = useState<MediaRecorder | null>(null);\n const [recordedChunks, setRecordedChunks] = useState<Blob[]>([]);\n\n console.log('cameraType', cameraType, recordedChunks);\n // Check permissions on component mount\n useEffect(() => {\n if (showCamera) {\n checkPermissions();\n }\n }, [showCamera]);\n\n // Cleanup stream on unmount\n useEffect(() => {\n return () => {\n if (stream) {\n stream.getTracks().forEach(track => track.stop());\n }\n };\n }, [stream]);\n\n const checkPermissions = async () => {\n try {\n if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {\n onError?.({ message: 'Camera not supported in this browser' });\n return;\n }\n\n // Test camera permission\n const stream = await navigator.mediaDevices.getUserMedia({ video: true });\n stream.getTracks().forEach(track => track.stop());\n\n setHasPermission(true);\n await startCamera();\n } catch (error) {\n console.error('Error checking permissions:', error);\n onError?.({ message: 'Camera permissions not granted' });\n }\n };\n\n const startCamera = async () => {\n try {\n if (stream) {\n stream.getTracks().forEach(track => track.stop());\n }\n\n const constraints = {\n video: {\n facingMode: cameraType === 'front' ? 'user' : 'environment',\n width: { ideal: quality === 'high' ? 1920 : quality === 'medium' ? 1280 : 640 },\n height: { ideal: quality === 'high' ? 1080 : quality === 'medium' ? 720 : 480 },\n },\n audio: enableVideo,\n };\n\n const newStream = await navigator.mediaDevices.getUserMedia(constraints);\n setStream(newStream);\n\n if (videoRef.current) {\n videoRef.current.srcObject = newStream;\n videoRef.current.onloadedmetadata = () => {\n setIsInitialized(true);\n };\n }\n } catch (error) {\n console.error('Error starting camera:', error);\n onError?.({ message: 'Failed to start camera' });\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 || 'Camera error occurred' });\n }, [onError]);\n\n console.log('isInitialized', onInitialized, onCameraError);\n\n const capturePhoto = useCallback(async () => {\n try {\n onCapture && onCapture({\n success: true\n })\n } catch (error) {\n console.error('Error taking photo:', error);\n onCapture?.({\n success: false,\n error: error instanceof Error ? error.message : 'Failed to capture photo',\n });\n }\n }, [isInitialized, onCapture, onError]);\n\n\n const captureSilentPhoto = useCallback(async () => {\n try {\n if (!videoRef.current || !canvasRef.current || !isInitialized) {\n onError?.({ message: 'Camera not ready' });\n return;\n }\n\n const video = videoRef.current;\n const canvas = canvasRef.current;\n const context = canvas.getContext('2d');\n\n if (!context) {\n onError?.({ message: 'Canvas context not available' });\n return;\n }\n\n // Set canvas dimensions to match video\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n\n // Draw the current video frame to canvas\n context.drawImage(video, 0, 0);\n\n // Convert to base64\n const imageDataUrl = canvas.toDataURL('image/jpeg', 0.8);\n\n onSilentCapture?.({\n success: true,\n path: imageDataUrl,\n });\n } catch (error) {\n console.error('Error taking photo:', error);\n onCapture?.({\n success: false,\n error: error instanceof Error ? error.message : 'Failed to capture photo',\n });\n }\n }, [isInitialized, onError, onSilentCapture]);\n\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 startVideoRecording = useCallback(async () => {\n try {\n if (!stream || !isInitialized) {\n onError?.({ message: 'Camera not ready' });\n return;\n }\n\n const chunks: Blob[] = [];\n setRecordedChunks(chunks);\n\n const recorder = new MediaRecorder(stream, {\n mimeType: 'video/webm;codecs=vp9',\n });\n\n recorder.ondataavailable = (event) => {\n if (event.data.size > 0) {\n chunks.push(event.data);\n }\n };\n\n recorder.onstop = () => {\n const blob = new Blob(chunks, { type: 'video/webm' });\n const url = URL.createObjectURL(blob);\n\n onVideoRecordingStop?.({\n success: true,\n path: url,\n });\n\n setRecordedChunks([]);\n setIsRecordingVideo(false);\n };\n\n recorder.onerror = (event) => {\n console.error('Recording error:', event);\n onVideoRecordingStop?.({\n success: false,\n error: 'Failed to record video',\n });\n setIsRecordingVideo(false);\n };\n\n setMediaRecorder(recorder);\n recorder.start();\n setIsRecordingVideo(true);\n onVideoRecordingStart?.();\n\n // Auto-stop after videoDuration seconds\n setTimeout(() => {\n if (recorder.state === 'recording') {\n recorder.stop();\n }\n }, videoDuration * 1000);\n\n } catch (error) {\n console.error('Error starting video recording:', error);\n onVideoRecordingStop?.({\n success: false,\n error: error instanceof Error ? error.message : 'Failed to start video recording',\n });\n }\n }, [isInitialized, stream, videoDuration, onVideoRecordingStart, onVideoRecordingStop, onError]);\n\n const stopVideoRecording = useCallback(async () => {\n try {\n if (mediaRecorder && mediaRecorder.state === 'recording') {\n mediaRecorder.stop();\n }\n } catch (error) {\n console.error('Error stopping video recording:', error);\n onError?.({ message: 'Failed to stop video recording' });\n }\n }, [mediaRecorder, onError]);\n\n const switchCamera = useCallback(async () => {\n setCameraType(current => current === 'front' ? 'back' : 'front');\n // Restart camera with new facing mode\n await startCamera();\n }, [cameraType]);\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 Camera permission required. Please grant permission to continue.\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 {/* Video element */}\n <video\n ref={videoRef}\n style={{\n position: 'absolute',\n width: '100%',\n height: '100%',\n objectFit: 'cover',\n }}\n autoPlay\n playsInline\n muted\n />\n\n {/* Hidden canvas for photo capture */}\n <canvas\n ref={canvasRef}\n style={{\n position: 'absolute',\n left: '-9999px',\n top: '-9999px',\n }}\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 {/* Analyzing indicator - Same as mobile */}\n {silentCaptureResult?.isAnalyzing && (\n <View style={styles.analyzingContainer}>\n <Text style={styles.analyzingText}>{t('camera.analyzing')}</Text>\n </View>\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 && (\n <TouchableOpacity\n style={[\n styles.captureButton,\n isRecordingVideo && styles.recordingButton\n ]}\n onPress={isRecordingVideo ? stopVideoRecording : startVideoRecording}\n disabled={!isInitialized}\n >\n <View style={[\n styles.captureButtonInner,\n !isInitialized && styles.captureButtonDisabled,\n isRecordingVideo && 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 </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 analyzingContainer: {\n position: 'absolute',\n bottom: 100,\n alignSelf: 'center',\n backgroundColor: 'rgba(0, 0, 0, 0.7)',\n padding: 10,\n borderRadius: 10,\n zIndex: 1000,\n },\n analyzingText: {\n color: 'white',\n fontSize: 16,\n fontWeight: 'bold',\n },\n}); "]}
@@ -1 +1 @@
1
- {"version":3,"file":"CameraCapture.d.ts","sourceRoot":"","sources":["../../../src/components/KYCElements/CameraCapture.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,UAAU,kBAAkB;IAC1B,OAAO,EAAE,UAAU,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAmHtD,CAAC"}
1
+ {"version":3,"file":"CameraCapture.d.ts","sourceRoot":"","sources":["../../../src/components/KYCElements/CameraCapture.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAKxC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,UAAU,kBAAkB;IAC1B,OAAO,EAAE,UAAU,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAmHtD,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import React, { useState } from 'react';
2
- import { View, Text, TouchableOpacity, StyleSheet, Image, Alert } from 'react-native';
2
+ import { View, Text, TouchableOpacity, StyleSheet, Image } from 'react-native';
3
+ import { showAlert } from '../../utils/platformAlert';
3
4
  import { EnhancedCameraView } from '../EnhancedCameraView';
4
5
  export const CameraCapture = ({ element, value, onValueChange, error, }) => {
5
6
  const [capturedImage, setCapturedImage] = useState(value || null);
@@ -23,11 +24,11 @@ export const CameraCapture = ({ element, value, onValueChange, error, }) => {
23
24
  setShowCamera(false);
24
25
  }
25
26
  else {
26
- Alert.alert('Erreur', result.error || 'Impossible de prendre la photo');
27
+ showAlert('Erreur', result.error || 'Impossible de prendre la photo');
27
28
  }
28
29
  };
29
30
  const handleError = (event) => {
30
- Alert.alert('Erreur', event.message);
31
+ showAlert('Erreur', event.message);
31
32
  setShowCamera(false);
32
33
  };
33
34
  const retakePicture = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"CameraCapture.js","sourceRoot":"","sources":["../../../src/components/KYCElements/CameraCapture.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAW3D,MAAM,CAAC,MAAM,aAAa,GAAiC,CAAC,EAC1D,OAAO,EACP,KAAK,EACL,aAAa,EACb,KAAK,GACN,EAAE,EAAE;IACH,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAgB,KAAK,IAAI,IAAI,CAAC,CAAC;IACjF,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEpD,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,IAAI;QAC3C,WAAW,EAAE,CAAC,GAAG,CAAC;QAClB,OAAO,EAAE,GAAG;QACZ,SAAS,EAAE,MAAM;QACjB,UAAU,EAAE,MAAM;QAClB,WAAW,EAAE,IAAI;QACjB,UAAU,EAAE,CAAC;QACb,OAAO,EAAE;YACP,SAAS,EAAE,IAAI;YACf,SAAS,EAAE,qCAAqC;SACjD;KACF,CAAC;IAEF,MAAM,aAAa,GAAG,CAAC,MAA2D,EAAE,EAAE;QACpF,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;YAClC,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAC9B,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAC3B,aAAa,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,M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e,EAAE,SAAS;QAC1B,YAAY,EAAE,EAAE;QAChB,WAAW,EAAE,CAAC;QACd,WAAW,EAAE,MAAM;KACpB;IACD,qBAAqB,EAAE;QACrB,QAAQ,EAAE,EAAE;QACZ,YAAY,EAAE,EAAE;KACjB;IACD,sBAAsB,EAAE;QACtB,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,MAAM;QACb,SAAS,EAAE,QAAQ;KACpB;CACF,CAAC,CAAC","sourcesContent":["import React, { useState } from 'react';\nimport { View, Text, TouchableOpacity, StyleSheet, Image, Alert } from 'react-native';\nimport { EnhancedCameraView } from '../EnhancedCameraView';\n\nimport { KYCElement } from '../../types/KYC.types';\n\ninterface CameraCaptureProps {\n element: KYCElement;\n value?: string;\n onValueChange: (value: string) => void;\n error?: string;\n}\n\nexport const CameraCapture: React.FC<CameraCaptureProps> = ({\n element,\n value,\n onValueChange,\n error,\n}) => {\n const [capturedImage, setCapturedImage] = useState<string | null>(value || null);\n const [showCamera, setShowCamera] = useState(false);\n\n const cameraConfig = element.cameraConfig || {\n aspectRatio: 4 / 3,\n quality: 0.8,\n flashMode: 'auto',\n cameraType: 'back',\n allowRetake: true,\n maxRetakes: 3,\n overlay: {\n showGuide: true,\n guideText: 'Placez votre document dans le cadre',\n }\n };\n\n const handleCapture = (result: { success: boolean; path?: string; error?: string }) => {\n if (result.success && result.path) {\n setCapturedImage(result.path);\n onValueChange(result.path);\n setShowCamera(false);\n } else {\n Alert.alert('Erreur', result.error || 'Impossible de prendre la photo');\n }\n };\n\n const handleError = (event: { message: string }) => {\n Alert.alert('Erreur', event.message);\n setShowCamera(false);\n };\n\n const retakePicture = () => {\n setCapturedImage(null);\n onValueChange('');\n setShowCamera(true);\n };\n\n if (showCamera) {\n return (\n <View style={[styles.container]}>\n <EnhancedCameraView\n instructions={cameraConfig.overlay?.guideText || 'Placez votre document dans le cadre'}\n showCamera={true}\n cameraType={cameraConfig.cameraType || 'back'}\n style={styles.camera}\n onCapture={handleCapture}\n onError={handleError}\n onClose={() => setShowCamera(false)}\n quality=\"high\"\n showCaptureButton={true}\n showSwitchCamera={true}\n enableFlash={cameraConfig.flashMode !== 'off'}\n />\n </View>\n );\n }\n\n if (capturedImage) {\n return (\n <View style={styles.container}>\n <Text style={styles.title}>{element.title}</Text>\n <Text style={styles.description}>{element.description}</Text>\n\n <View style={styles.imageContainer}>\n <Image source={{ uri: capturedImage }} style={styles.capturedImage} />\n </View>\n\n <View style={styles.buttonContainer}>\n {cameraConfig.allowRetake && (\n <TouchableOpacity style={styles.secondaryButton} onPress={retakePicture}>\n <Text style={styles.secondaryButtonText}>Reprendre</Text>\n </TouchableOpacity>\n )}\n <TouchableOpacity style={styles.primaryButton}>\n <Text style={styles.primaryButtonText}>Continuer</Text>\n </TouchableOpacity>\n </View>\n\n {error && (\n <Text style={styles.errorText}>{error}</Text>\n )}\n </View>\n );\n }\n\n return (\n <View style={{ maxWidth: 760, width: '100%', height: '100%' }}>\n <View style={styles.container}>\n <Text style={styles.title}>{element.title}</Text>\n <Text style={styles.description}>{element.description}</Text>\n\n <View style={styles.cameraContainer}>\n <TouchableOpacity\n style={styles.cameraPlaceholder}\n onPress={() => setShowCamera(true)}\n >\n <Text style={styles.cameraPlaceholderText}>📷</Text>\n <Text style={styles.cameraPlaceholderLabel}>\n {cameraConfig.overlay?.guideText || 'Appuyez pour ouvrir la caméra'}\n </Text>\n </TouchableOpacity>\n </View>\n\n {error && (\n <Text style={styles.errorText}>{error}</Text>\n )}\n </View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n padding: 16,\n\n },\n title: {\n fontSize: 24,\n fontWeight: 'bold',\n color: '#333',\n marginBottom: 8,\n textAlign: 'center',\n },\n description: {\n fontSize: 16,\n color: '#666',\n textAlign: 'center',\n marginBottom: 24,\n lineHeight: 22,\n },\n cameraContainer: {\n flex: 1,\n borderRadius: 12,\n overflow: 'hidden',\n marginBottom: 24,\n },\n camera: {\n flex: 1,\n },\n imageContainer: {\n flex: 1,\n borderRadius: 12,\n overflow: 'hidden',\n marginBottom: 24,\n },\n capturedImage: {\n width: '100%',\n height: '100%',\n resizeMode: 'contain',\n },\n buttonContainer: {\n flexDirection: 'row',\n justifyContent: 'space-around',\n alignItems: 'center',\n paddingHorizontal: 16,\n },\n captureButton: {\n width: 80,\n height: 80,\n borderRadius: 40,\n backgroundColor: 'white',\n justifyContent: 'center',\n alignItems: 'center',\n shadowColor: '#000',\n shadowOffset: {\n width: 0,\n height: 4,\n },\n shadowOpacity: 0.3,\n shadowRadius: 4.65,\n elevation: 8,\n },\n captureButtonDisabled: {\n opacity: 0.6,\n },\n captureButtonInner: {\n width: 60,\n height: 60,\n borderRadius: 30,\n backgroundColor: '#4CAF50',\n justifyContent: 'center',\n alignItems: 'center',\n },\n captureButtonText: {\n fontSize: 24,\n color: 'white',\n },\n primaryButton: {\n backgroundColor: '#4CAF50',\n paddingHorizontal: 32,\n paddingVertical: 16,\n borderRadius: 8,\n },\n primaryButtonText: {\n color: 'white',\n fontWeight: '600',\n fontSize: 16,\n },\n secondaryButton: {\n backgroundColor: '#e5e5e5',\n paddingHorizontal: 32,\n paddingVertical: 16,\n borderRadius: 8,\n },\n secondaryButtonText: {\n color: '#333',\n fontWeight: '600',\n fontSize: 16,\n },\n permissionButton: {\n backgroundColor: '#4CAF50',\n paddingHorizontal: 32,\n paddingVertical: 16,\n borderRadius: 8,\n marginTop: 16,\n },\n permissionButtonText: {\n color: 'white',\n fontWeight: '600',\n fontSize: 16,\n textAlign: 'center',\n },\n errorText: {\n color: '#dc2626',\n fontSize: 14,\n marginTop: 8,\n textAlign: 'center',\n },\n cameraPlaceholder: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n backgroundColor: '#f0f0f0',\n borderRadius: 12,\n borderWidth: 2,\n borderColor: '#ccc',\n },\n cameraPlaceholderText: {\n fontSize: 60,\n marginBottom: 10,\n },\n cameraPlaceholderLabel: {\n fontSize: 16,\n color: '#666',\n textAlign: 'center',\n },\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SAAS;QAC1B,YAAY,EAAE,EAAE;QAChB,WAAW,EAAE,CAAC;QACd,WAAW,EAAE,MAAM;KACpB;IACD,qBAAqB,EAAE;QACrB,QAAQ,EAAE,EAAE;QACZ,YAAY,EAAE,EAAE;KACjB;IACD,sBAAsB,EAAE;QACtB,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,MAAM;QACb,SAAS,EAAE,QAAQ;KACpB;CACF,CAAC,CAAC","sourcesContent":["import React, { useState } from 'react';\nimport { View, Text, TouchableOpacity, StyleSheet, Image } from 'react-native';\nimport { showAlert } from '../../utils/platformAlert';\nimport { EnhancedCameraView } from '../EnhancedCameraView';\n\nimport { KYCElement } from '../../types/KYC.types';\n\ninterface CameraCaptureProps {\n element: KYCElement;\n value?: string;\n onValueChange: (value: string) => void;\n error?: string;\n}\n\nexport const CameraCapture: React.FC<CameraCaptureProps> = ({\n element,\n value,\n onValueChange,\n error,\n}) => {\n const [capturedImage, setCapturedImage] = useState<string | null>(value || null);\n const [showCamera, setShowCamera] = useState(false);\n\n const cameraConfig = element.cameraConfig || {\n aspectRatio: 4 / 3,\n quality: 0.8,\n flashMode: 'auto',\n cameraType: 'back',\n allowRetake: true,\n maxRetakes: 3,\n overlay: {\n showGuide: true,\n guideText: 'Placez votre document dans le cadre',\n }\n };\n\n const handleCapture = (result: { success: boolean; path?: string; error?: string }) => {\n if (result.success && result.path) {\n setCapturedImage(result.path);\n onValueChange(result.path);\n setShowCamera(false);\n } else {\n showAlert('Erreur', result.error || 'Impossible de prendre la photo');\n }\n };\n\n const handleError = (event: { message: string }) => {\n showAlert('Erreur', event.message);\n setShowCamera(false);\n };\n\n const retakePicture = () => {\n setCapturedImage(null);\n onValueChange('');\n setShowCamera(true);\n };\n\n if (showCamera) {\n return (\n <View style={[styles.container]}>\n <EnhancedCameraView\n instructions={cameraConfig.overlay?.guideText || 'Placez votre document dans le cadre'}\n showCamera={true}\n cameraType={cameraConfig.cameraType || 'back'}\n style={styles.camera}\n onCapture={handleCapture}\n onError={handleError}\n onClose={() => setShowCamera(false)}\n quality=\"high\"\n showCaptureButton={true}\n showSwitchCamera={true}\n enableFlash={cameraConfig.flashMode !== 'off'}\n />\n </View>\n );\n }\n\n if (capturedImage) {\n return (\n <View style={styles.container}>\n <Text style={styles.title}>{element.title}</Text>\n <Text style={styles.description}>{element.description}</Text>\n\n <View style={styles.imageContainer}>\n <Image source={{ uri: capturedImage }} style={styles.capturedImage} />\n </View>\n\n <View style={styles.buttonContainer}>\n {cameraConfig.allowRetake && (\n <TouchableOpacity style={styles.secondaryButton} onPress={retakePicture}>\n <Text style={styles.secondaryButtonText}>Reprendre</Text>\n </TouchableOpacity>\n )}\n <TouchableOpacity style={styles.primaryButton}>\n <Text style={styles.primaryButtonText}>Continuer</Text>\n </TouchableOpacity>\n </View>\n\n {error && (\n <Text style={styles.errorText}>{error}</Text>\n )}\n </View>\n );\n }\n\n return (\n <View style={{ maxWidth: 760, width: '100%', height: '100%' }}>\n <View style={styles.container}>\n <Text style={styles.title}>{element.title}</Text>\n <Text style={styles.description}>{element.description}</Text>\n\n <View style={styles.cameraContainer}>\n <TouchableOpacity\n style={styles.cameraPlaceholder}\n onPress={() => setShowCamera(true)}\n >\n <Text style={styles.cameraPlaceholderText}>📷</Text>\n <Text style={styles.cameraPlaceholderLabel}>\n {cameraConfig.overlay?.guideText || 'Appuyez pour ouvrir la caméra'}\n </Text>\n </TouchableOpacity>\n </View>\n\n {error && (\n <Text style={styles.errorText}>{error}</Text>\n )}\n </View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n padding: 16,\n\n },\n title: {\n fontSize: 24,\n fontWeight: 'bold',\n color: '#333',\n marginBottom: 8,\n textAlign: 'center',\n },\n description: {\n fontSize: 16,\n color: '#666',\n textAlign: 'center',\n marginBottom: 24,\n lineHeight: 22,\n },\n cameraContainer: {\n flex: 1,\n borderRadius: 12,\n overflow: 'hidden',\n marginBottom: 24,\n },\n camera: {\n flex: 1,\n },\n imageContainer: {\n flex: 1,\n borderRadius: 12,\n overflow: 'hidden',\n marginBottom: 24,\n },\n capturedImage: {\n width: '100%',\n height: '100%',\n resizeMode: 'contain',\n },\n buttonContainer: {\n flexDirection: 'row',\n justifyContent: 'space-around',\n alignItems: 'center',\n paddingHorizontal: 16,\n },\n captureButton: {\n width: 80,\n height: 80,\n borderRadius: 40,\n backgroundColor: 'white',\n justifyContent: 'center',\n alignItems: 'center',\n shadowColor: '#000',\n shadowOffset: {\n width: 0,\n height: 4,\n },\n shadowOpacity: 0.3,\n shadowRadius: 4.65,\n elevation: 8,\n },\n captureButtonDisabled: {\n opacity: 0.6,\n },\n captureButtonInner: {\n width: 60,\n height: 60,\n borderRadius: 30,\n backgroundColor: '#4CAF50',\n justifyContent: 'center',\n alignItems: 'center',\n },\n captureButtonText: {\n fontSize: 24,\n color: 'white',\n },\n primaryButton: {\n backgroundColor: '#4CAF50',\n paddingHorizontal: 32,\n paddingVertical: 16,\n borderRadius: 8,\n },\n primaryButtonText: {\n color: 'white',\n fontWeight: '600',\n fontSize: 16,\n },\n secondaryButton: {\n backgroundColor: '#e5e5e5',\n paddingHorizontal: 32,\n paddingVertical: 16,\n borderRadius: 8,\n },\n secondaryButtonText: {\n color: '#333',\n fontWeight: '600',\n fontSize: 16,\n },\n permissionButton: {\n backgroundColor: '#4CAF50',\n paddingHorizontal: 32,\n paddingVertical: 16,\n borderRadius: 8,\n marginTop: 16,\n },\n permissionButtonText: {\n color: 'white',\n fontWeight: '600',\n fontSize: 16,\n textAlign: 'center',\n },\n errorText: {\n color: '#dc2626',\n fontSize: 14,\n marginTop: 8,\n textAlign: 'center',\n },\n cameraPlaceholder: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n backgroundColor: '#f0f0f0',\n borderRadius: 12,\n borderWidth: 2,\n borderColor: '#ccc',\n },\n cameraPlaceholderText: {\n fontSize: 60,\n marginBottom: 10,\n },\n cameraPlaceholderLabel: {\n fontSize: 16,\n color: '#666',\n textAlign: 'center',\n },\n}); "]}
@@ -2,8 +2,11 @@ import React from 'react';
2
2
  import { TemplateComponent, Country } from '../../types/KYC.types';
3
3
  interface CountrySelectionTemplateProps {
4
4
  component: TemplateComponent;
5
- value?: string;
6
- onValueChange: (value: Country) => void;
5
+ value?: any;
6
+ onValueChange: (value: Country & {
7
+ documentType?: string;
8
+ region?: string;
9
+ }) => void;
7
10
  error?: string;
8
11
  language?: string;
9
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CountrySelectionTemplate.d.ts","sourceRoot":"","sources":["../../../src/components/KYCElements/CountrySelectionTemplate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,iBAAiB,EAAyC,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAO1G,UAAU,6BAA6B;IACrC,SAAS,EAAE,iBAAiB,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,6BAA6B,CAkH5E,CAAC"}
1
+ {"version":3,"file":"CountrySelectionTemplate.d.ts","sourceRoot":"","sources":["../../../src/components/KYCElements/CountrySelectionTemplate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAyC,OAAO,EAAgB,MAAM,uBAAuB,CAAC;AAMxH,UAAU,6BAA6B;IACrC,SAAS,EAAE,iBAAiB,CAAC;IAC7B,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,aAAa,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG;QAAE,YAAY,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACrF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAYD,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,6BAA6B,CA0Z5E,CAAC"}