@transfergratis/react-native-sdk 0.1.15 → 0.1.17
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/build/components/KYCElements/IDCardCapture.js +1 -1
- package/build/components/KYCElements/IDCardCapture.js.map +1 -1
- package/build/i18n/en/index.d.ts +1 -0
- package/build/i18n/en/index.d.ts.map +1 -1
- package/build/i18n/en/index.js +2 -1
- package/build/i18n/en/index.js.map +1 -1
- package/build/i18n/fr/index.d.ts +1 -0
- package/build/i18n/fr/index.d.ts.map +1 -1
- package/build/i18n/fr/index.js +2 -1
- package/build/i18n/fr/index.js.map +1 -1
- package/build/modules/camera/VisionCameraModule.d.ts.map +1 -1
- package/build/modules/camera/VisionCameraModule.js +49 -9
- package/build/modules/camera/VisionCameraModule.js.map +1 -1
- package/build/utils/pathToBase64.d.ts.map +1 -1
- package/build/utils/pathToBase64.js +25 -9
- package/build/utils/pathToBase64.js.map +1 -1
- package/package.json +1 -1
- package/src/components/KYCElements/IDCardCapture.tsx +1 -1
- package/src/i18n/en/index.ts +2 -1
- package/src/i18n/fr/index.ts +2 -1
- package/src/modules/camera/VisionCameraModule.ts +47 -9
- package/src/utils/pathToBase64.ts +22 -8
|
@@ -394,7 +394,7 @@ export const IDCardCapture = ({ component, value = {}, onValueChange, error, lan
|
|
|
394
394
|
<ScrollView style={styles.previewItemContainer} showsVerticalScrollIndicator={false}>
|
|
395
395
|
<View key={currentSide} style={styles.sideContainer}>
|
|
396
396
|
<Text style={styles.sideTitle}>
|
|
397
|
-
{currentSide === 'front' ? 'Recto' : '
|
|
397
|
+
{t('kyc.idCardCapture.captureTitle', { side: currentSide === 'front' ? locale === 'en' ? 'Front' : 'Recto' : locale === 'en' ? 'Back' : 'Verso' })}
|
|
398
398
|
</Text>
|
|
399
399
|
<Text style={{ fontSize: 14, color: '#666', textAlign: 'center', marginBottom: 16, lineHeight: 22 }}>
|
|
400
400
|
{getLocalizedText(component.instructions)}
|
|
@@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B,WAAW,EAAE,EAAE;KAChB;IACD,gBAAgB,EAAE;QAChB,QAAQ,EAAE,EAAE;KAEb;IACD,gBAAgB,EAAE;QAChB,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,MAAM;KACd;IACD,iBAAiB,EAAE;QACjB,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,MAAM;QACb,UAAU,EAAE,MAAM;KACnB;CACF,CAAC,CAAC","sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport { View, Text, TouchableOpacity, StyleSheet, Image, Alert, ScrollView, Dimensions } from 'react-native';\nimport { EnhancedCameraView } from '../EnhancedCameraView';\nimport { TemplateComponent, IDCardConfig, LocalizedText, GovernmentDocumentType, ISilentCaptureResult, IBbox } from '../../types/KYC.types';\nimport IdCardOverlay from '../OverLay/IdCard';\nimport { useTemplateKYCFlowContext } from '../../hooks/useTemplateKYCFlow';\nimport { useI18n } from '../../hooks/useI18n';\nimport { Button } from '../ui/Button';\nimport { removeDuplicates } from '../../utils/remove-duplicate';\nimport { backVerification, checkTemplateType, frontVerification } from '../../modules/api/CardAuthentification';\nimport { getDocumentTypeInfo } from '../../utils/get-document-type-info';\nimport pathToBase64 from '../../utils/pathToBase64';\nimport { truncateFields } from '../../modules/api/KYCService';\nimport { cropByObb, cropImageWithBBox } from '../../utils/cropByObb';\nimport { logger } from '../../utils/logger';\n\n\ninterface IIDCardPayload {\n dir: string;\n file: string;\n mrz: string;\n templatePath?: string;\n}\n\ninterface IDCardCaptureProps {\n component: TemplateComponent;\n value?: Record<string, IIDCardPayload>;\n onValueChange: (value: Record<string, IIDCardPayload | string>) => void;\n error?: string;\n language?: string;\n currentSide?: string; // Nouveau prop pour spécifier le côté actuel\n}\n\nexport const IDCardCapture: React.FC<IDCardCaptureProps> = ({\n component,\n value = {},\n onValueChange,\n error,\n language = 'en',\n}) => {\n const { t, locale } = useI18n();\n const [showCamera, setShowCamera] = useState(false);\n const [capturedImages, setCapturedImages] = useState<Record<string, IIDCardPayload>>(value || {});\n const [cropImageUri, setCropImageUri] = useState<string>('');\n const [currentSide, setCurrentSide] = useState<string>('front');\n // Stocker les bbox par côté pour pouvoir restaurer les images croppées\n const [bboxBySide, setBboxBySide] = useState<Record<string, IBbox>>({});\n const [selectedDocumentType, setSelectedDocumentType] = useState<{\n type: GovernmentDocumentType;\n region: string;\n }>({\n type: 'identity_card',\n region: 'root'\n });\n const [showDocumentSelection, setShowDocumentSelection] = useState(\n {\n documentSelection: true,\n regionSelection: false\n }\n );\n const [silentCaptureResult, setSilentCaptureResult] = useState<ISilentCaptureResult>({ success: false, isAnalyzing: false });\n // const [imageNaturalSize, setImageNaturalSize] = useState<{ width: number; height: number } | null>(null);\n\n const { actions, state, } = useTemplateKYCFlowContext();\n const config = component.config as IDCardConfig;\n\n\n\n const getLocalizedText = (text: LocalizedText | Record<string, LocalizedText>): string => {\n // console.log(\"text\", text, JSON.stringify(component, null, 2));\n if (text && typeof text[currentSide] === 'object' && text[currentSide][locale]) {\n return text[currentSide][locale] || '';\n }\n return \"\";\n };\n\n const countryData = useMemo(() => {\n const geCountryID = Object.keys(state.componentData).find((c: string) => c === \"6\");\n\n if (geCountryID) {\n const countryMapping = state.componentData[geCountryID];\n return countryMapping;\n }\n return null;\n }, [state.componentData]);\n\n\n const availableDocumentTypes = useMemo(() => {\n const newconfig: GovernmentDocumentType[] = [];\n\n if (countryData) {\n const countryMapping = Object.keys(countryData?.regionMapping);\n if (countryMapping && Array.isArray(countryMapping)) {\n countryMapping.forEach((c) => {\n newconfig.push(c as GovernmentDocumentType);\n });\n }\n }\n logger.log(\"newconfig\", truncateFields(newconfig));\n return newconfig;\n }, []);\n\n\n useEffect(() => {\n logger.log(\"cropImageUri\", JSON.stringify(truncateFields({ box: silentCaptureResult }), null, 2));\n if (capturedImages[currentSide]?.dir && silentCaptureResult?.bbox) {\n cropImageWithBBox(capturedImages[currentSide].dir, silentCaptureResult.bbox)?.then((uri) => {\n setCropImageUri(uri);\n });\n }\n }, [capturedImages[currentSide]?.dir, silentCaptureResult?.bbox])\n\n\n\n const cameraConfig = {\n aspectRatio: 4 / 3,\n quality: 0.8,\n flashMode: 'auto' as const,\n cameraType: 'back' as const,\n allowRetake: true,\n maxRetakes: 3,\n overlay: {\n showGuide: true,\n guideText: selectedDocumentType ? (locale === 'en' ? getDocumentTypeInfo(selectedDocumentType.type).instructions.en : getDocumentTypeInfo(selectedDocumentType.type).instructions.fr) : getLocalizedText(component.instructions as Record<string, LocalizedText>),\n bbox: selectedDocumentType && config.bbox_configs[selectedDocumentType.type] ? config.bbox_configs[selectedDocumentType.type] : {\n xMin: 20,\n yMin: 140,\n xMax: 370,\n yMax: 340,\n borderColor: '#2DBD60',\n borderWidth: 3,\n cornerRadius: 8\n }\n\n }\n };\n\n const retakePicture = (currentSide: string) => {\n setShowCamera(true);\n actions.showCustomStepper(false);\n setCapturedImages({ ...capturedImages, [currentSide]: { dir: '', file: '', mrz: '' } });\n setSilentCaptureResult((prev) => ({ path: '', success: false, isAnalyzing: false, error: '' }));\n setCropImageUri('');\n onValueChange({ ...value, [currentSide]: { dir: '', file: '', mrz: '' } });\n };\n\n const hasRegions = useCallback((documentType: GovernmentDocumentType): { hasRegions: boolean, regionMapping: string[] } => {\n const regionMapping = countryData?.regionMapping[documentType as GovernmentDocumentType];\n if (regionMapping && Object.keys(regionMapping).length > 1) {\n return {\n hasRegions: true,\n regionMapping: Object.keys(regionMapping)\n };\n }\n return {\n hasRegions: false,\n regionMapping: []\n };\n }, [countryData]);\n\n\n const getCurrentSideVerification = (currentSide: string) => {\n const regionMapping = countryData?.regionMapping[selectedDocumentType?.type as GovernmentDocumentType];\n const authMethod: string[] = [];\n const mrzTypes: string[] = [];\n\n const key = selectedDocumentType?.region?.trim()?.length > 0 ? selectedDocumentType?.region?.trim() : 'root';\n // console.log(\"regionMapping\", JSON.stringify(regionMapping, null, 2), selectedDocumentType?.region);\n // const key = selectedDocumentType?.region as keyof typeof regionMapping;\n\n if (regionMapping?.[key] && Array.isArray(regionMapping[key])) {\n regionMapping[key].forEach((item: any) => {\n if (item[currentSide as keyof typeof item]) {\n authMethod.push(item[currentSide as keyof typeof item]);\n if (item?.mrz_type) {\n mrzTypes.push(item?.mrz_type);\n }\n }\n });\n }\n\n logger.log(\"regionMapping\", JSON.stringify(truncateFields({ regionMapping, selectedDocumentType: selectedDocumentType?.region, key }), null, 2));\n\n return { authMethod: removeDuplicates(authMethod), mrzTypes: removeDuplicates(mrzTypes), regionMapping: regionMapping, key: key };\n }\n\n const getCorrespondingMrzType = (templatePath: string, mapping: any, selectedDocumentType: string = \"root\") => {\n if (!mapping[selectedDocumentType]) return null;\n\n // Extraire le nom du fichier depuis le template_path\n const fileName = templatePath.split(\"/\").pop()?.replace(\".jpg\", \"\").replace(\".png\", \"\");\n\n if (!fileName) return null;\n\n // Normaliser en .py\n const pyName = `${fileName}.py`; // ex: cameroon_id_back_3_1.py\n\n // Chercher dans la liste\n const found = mapping[selectedDocumentType].find((item: any) => item.py_file === pyName);\n\n return found?.mrz_type || null;\n }\n\n const handleSilentCapture = async (result: { success: boolean; path?: string; error?: string }) => {\n if (silentCaptureResult.isAnalyzing) {\n return;\n }\n if (result.success && result.path) {\n setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: true, success: false, error: '' }));\n let templatePath = silentCaptureResult.templatePath || '';\n let templateBbox: IBbox | undefined;\n\n const regionMappings = getCurrentSideVerification(currentSide)\n // logger.log(\"regionMappings\", JSON.stringify(truncateFields({regionMappings, templatePath}), null, 2));\n if (regionMappings.authMethod.includes('MRZ') && templatePath.length === 0) {\n try {\n const templateType = await checkTemplateType({ path: result.path || '', docType: selectedDocumentType?.type as GovernmentDocumentType, docRegion: countryData?.code || \"\", postfix: currentSide });\n\n if (templateType.template_path) {\n templatePath = templateType.template_path;\n logger.log(\"templatePath\", templatePath);\n setSilentCaptureResult((prev) => ({ ...prev, templatePath: templatePath }));\n }\n if (templateType.card_obb) {\n let bbox: IBbox | undefined;\n try {\n const crop = await cropByObb(result?.path || '', (templateType as any).card_obb);\n bbox = crop.bbox;\n templateBbox = bbox;\n } catch { }\n }\n } catch (e: any) {\n logger.log(\"error checking template type\", truncateFields(e));\n setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, success: false, error: e?.message || 'Erreur de vérification du template' }));\n }\n }\n logger.log(\"templatePath before front verification\", templatePath);\n if (currentSide === 'front') {\n\n frontVerification(\n {\n path: result.path,\n regionMapping: regionMappings,\n selectedDocumentType: selectedDocumentType?.type || '',\n code: countryData?.code || '',\n currentSide: currentSide,\n templatePath: templatePath,\n mrzType: getCorrespondingMrzType(templatePath, regionMappings.regionMapping, regionMappings.key || '') || '',\n }).then((mrz) => {\n logger.log(\"front verification result\", truncateFields(mrz));\n const bbox = (mrz as any)?.bbox || templateBbox;\n setSilentCaptureResult((prev) => ({\n ...prev, \n path: result.path,\n templatePath: templatePath,\n bbox: bbox, success: true,\n mrz: JSON.stringify(mrz), isAnalyzing: false,\n country: countryData?.code,\n documentType: selectedDocumentType?.type,\n }),\n );\n // Stocker le bbox pour ce côté\n if (bbox && typeof bbox === 'object') {\n setBboxBySide((prev) => ({ ...prev, [currentSide]: bbox }));\n }\n\n }).catch((e: any) => {\n logger.log(\"error front verification\", truncateFields(e));\n setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, templatePath: templatePath, success: false, error: e?.message || 'Erreur de détection du MRZ' }));\n // Alert.alert('Erreur', e?.message || 'Erreur de détection du MRZ');\n })\n } else {\n backVerification({\n path: result.path,\n regionMapping: getCurrentSideVerification(currentSide),\n selectedDocumentType: selectedDocumentType?.type || '',\n code: countryData?.code || '',\n currentSide: currentSide,\n templatePath: templatePath,\n mrzType: getCorrespondingMrzType(templatePath, regionMappings.regionMapping, regionMappings.key || '') || '',\n }).then((mrz) => {\n logger.log(\"back verification result\", truncateFields(mrz));\n const bbox = (mrz as any)?.bbox || templateBbox;\n setSilentCaptureResult((prev) => ({\n ...prev, path: result.path, bbox: bbox,\n success: true, mrz: JSON.stringify(mrz), isAnalyzing: false,\n country: countryData?.code,\n documentType: selectedDocumentType?.type,\n \n }));\n // Stocker le bbox pour ce côté\n if (bbox && typeof bbox === 'object') {\n setBboxBySide((prev) => ({ ...prev, [currentSide]: bbox }));\n }\n }).catch((e: any) => {\n logger.log(\"error back verification\", truncateFields(e));\n setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, templatePath: templatePath, success: false, error: e?.message || 'Erreur de détection du MRZ' }));\n // Alert.alert('Erreur', e?.message || 'Erreur de détection du MRZ');\n })\n }\n\n }\n }\n\n // Handle capture\n const handleCapture = async (result: { success: boolean; path?: string; error?: string }) => {\n if (silentCaptureResult.path) {\n const base64 = await pathToBase64(silentCaptureResult.path);\n\n logger.log(\"silentCaptureResult captured\", JSON.stringify(truncateFields(silentCaptureResult), null, 2));\n const newImages = { ...capturedImages, [currentSide]: { dir: silentCaptureResult.path, file: base64, mrz: silentCaptureResult.mrz || \"\", templatePath: silentCaptureResult.templatePath } };\n setCapturedImages(newImages);\n if (silentCaptureResult.country && silentCaptureResult.documentType) {\n onValueChange({\n ...newImages,\n country: silentCaptureResult.country,\n documentType: silentCaptureResult.documentType,\n });\n }\n setShowCamera(false);\n actions.showCustomStepper(true);\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\n\n\n\n useEffect(() => {\n actions.showCustomStepper(!showCamera);\n }, [showCamera]);\n\n\n\n\n\n\n const handleDocumentTypeSelection = (docType: GovernmentDocumentType) => {\n setSelectedDocumentType({ type: docType, region: hasRegions(docType) ? '' : 'root' });\n setSilentCaptureResult((prev) => ({ ...prev, templatePath: '', bbox: undefined, success: false, isAnalyzing: false, error: '', path: '', mrz: '', country: '', documentType: '' }));\n setCapturedImages((prev) => ({ ...prev, front: { dir: '', file: '', mrz: '' }, back: { dir: '', file: '', mrz: '' } }));\n };\n const handleRegionSelection = (region: string) => {\n setSelectedDocumentType((prev) => ({ ...prev, region: region }));\n };\n\n // Interface de sélection du type de document\n if (showDocumentSelection.documentSelection || showDocumentSelection.regionSelection) {\n return (\n <View style={styles.root}>\n <View style={styles.container}>\n\n <Text style={styles.title}>{getLocalizedText(component.labels)}</Text>\n <Text style={styles.description}>{getLocalizedText(component.instructions)}</Text>\n\n <ScrollView style={styles.documentTypesContainer} showsVerticalScrollIndicator={false}>\n {showDocumentSelection.documentSelection ? availableDocumentTypes.map((docType) => {\n const docInfo = getDocumentTypeInfo(docType);\n return (\n <TouchableOpacity\n key={docType}\n style={[styles.documentTypeButton, { backgroundColor: selectedDocumentType?.type === docType ? '#2DBD6030' : '#F8F9FA', borderColor: selectedDocumentType?.type === docType ? '#2DBD60' : '#E9ECEF', borderWidth: 2 }]}\n onPress={() => handleDocumentTypeSelection(docType)}\n >\n <View style={[styles.documentTypeIconContainer, { backgroundColor: 'gray', }]}>\n <Text style={styles.documentTypeIcon}>{docInfo.icon}</Text>\n </View>\n <Text style={styles.documentTypeName}>\n {docInfo.name[language as keyof typeof docInfo.name] || docInfo.name.en}\n </Text>\n <Text style={styles.documentTypeArrow}>→</Text>\n </TouchableOpacity>\n );\n }) : null}\n {showDocumentSelection.regionSelection ?\n hasRegions(selectedDocumentType?.type || 'identity_card').regionMapping.map((region) => {\n return (\n <TouchableOpacity key={region} onPress={() => handleRegionSelection(region)}\n style={[styles.documentTypeButton, { backgroundColor: selectedDocumentType?.region === region ? '#2DBD6030' : '#F8F9FA', borderColor: selectedDocumentType?.region === region ? '#2DBD60' : '#E9ECEF', borderWidth: 2 }]}\n\n >\n <Text>{region}</Text>\n </TouchableOpacity>\n );\n }) : null}\n </ScrollView>\n <Button title={t('common.next')} onPress={() => {\n if (!selectedDocumentType) {\n Alert.alert(t('common.error'), t('validation.required'));\n return;\n }\n\n if (showDocumentSelection.regionSelection) {\n logger.log(\"showDocumentSelection\", JSON.stringify(truncateFields(showDocumentSelection), null, 2));\n setShowDocumentSelection({\n documentSelection: false,\n regionSelection: false\n });\n setShowCamera(true);\n actions.showCustomStepper(false);\n return;\n } else {\n if (hasRegions(selectedDocumentType?.type)?.hasRegions) {\n setShowDocumentSelection({\n documentSelection: false,\n regionSelection: true\n });\n } else {\n setShowDocumentSelection({\n documentSelection: false,\n regionSelection: false\n });\n setShowCamera(true);\n actions.showCustomStepper(false);\n }\n }\n\n }}\n variant={selectedDocumentType ? 'primary' : \"neutral\"}\n size=\"large\"\n fullWidth\n />\n\n\n {error && (\n <Text style={styles.errorText}>{error}</Text>\n )}\n </View>\n </View>\n );\n }\n\n\n\n if (showCamera) {\n\n return (\n <View style={styles.cameraContainer}>\n <EnhancedCameraView\n showCamera={true}\n cameraType={cameraConfig.cameraType}\n style={styles.camera}\n onCapture={handleCapture}\n onError={handleError}\n onClose={() => setShowCamera(false)}\n quality=\"high\"\n showCaptureButton={true}\n showSwitchCamera={true}\n onSilentCapture={handleSilentCapture}\n silentCaptureResult={silentCaptureResult}\n enableFlash={cameraConfig.flashMode === 'auto' || cameraConfig.flashMode === 'on'}\n overlayComponent={<IdCardOverlay\n xMin={cameraConfig.overlay.bbox.xMin}\n yMin={cameraConfig.overlay.bbox.yMin}\n xMax={cameraConfig.overlay.bbox.xMax}\n yMax={cameraConfig.overlay.bbox.yMax}\n instructions={cameraConfig.overlay.guideText}\n cornerOpacity={cameraConfig.overlay.bbox.cornerRadius || 0 as number}\n isSuccess={silentCaptureResult.success}\n language={state.currentLanguage}\n stepperProps={{\n back: () => {\n if (currentSide === 'back') {\n setCurrentSide('front');\n setShowCamera(false);\n setShowDocumentSelection({\n documentSelection: false,\n regionSelection: false\n });\n // Si une image front existe, on la restaure pour l'afficher\n if (capturedImages['front']?.dir) {\n // Restaurer l'état de capture du front pour afficher l'image\n const frontImage = capturedImages['front'];\n const frontBbox = bboxBySide['front'];\n setSilentCaptureResult((prev) => ({\n path: frontImage.dir,\n success: true,\n isAnalyzing: false,\n error: '',\n mrz: frontImage.mrz || '',\n templatePath: frontImage.templatePath || '',\n country: silentCaptureResult.country,\n documentType: silentCaptureResult.documentType,\n bbox: frontBbox // Restaurer le bbox pour recalculer le cropImageUri\n }));\n // Le useEffect va automatiquement recalculer le cropImageUri si bbox existe\n } else {\n // Pas d'image front, on réinitialise\n setSilentCaptureResult((prev) => ({ path: '', success: false, isAnalyzing: false, error: '', templatePath: '' }));\n }\n } else {\n setShowDocumentSelection({\n documentSelection: true,\n regionSelection: false\n });\n actions.showCustomStepper(true);\n }\n },\n selectedDocumentType: locale === 'en' ? getDocumentTypeInfo(selectedDocumentType?.type || \"identity_card\").name.en : getDocumentTypeInfo(selectedDocumentType?.type || \"identity_card\").name.fr || '',\n step: state.currentComponentIndex + 1,\n totalSteps: state.template.components.length,\n side: currentSide,\n }}\n />\n }\n />\n </View>\n );\n }\n\n\n return (\n <View style={styles.root}>\n <View style={styles.previewContainer}>\n <ScrollView style={styles.previewItemContainer} showsVerticalScrollIndicator={false}>\n <View key={currentSide} style={styles.sideContainer}>\n <Text style={styles.sideTitle}>\n {currentSide === 'front' ? 'Recto' : 'Verso'} de la carte d'identité\n </Text>\n <Text style={{ fontSize: 14, color: '#666', textAlign: 'center', marginBottom: 16, lineHeight: 22 }}>\n {getLocalizedText(component.instructions)}\n </Text>\n\n <View style={{ alignItems: 'center', justifyContent: 'center', flexDirection: \"column\", gap: 16 }}>\n <View\n style={{\n width: '100%',\n height: 200,\n borderRadius: 12,\n padding: 1,\n overflow: 'hidden',\n // Shadow for iOS\n shadowColor: '#000',\n shadowOffset: { width: 0, height: 4 },\n shadowOpacity: 0.18,\n shadowRadius: 8,\n // Shadow for Android\n elevation: 8,\n backgroundColor: '#fff', // Needed for shadow to show on iOS\n }}\n >\n {cropImageUri ? (\n <Image\n source={{ uri: cropImageUri }}\n style={{\n width: '100%',\n height: 200,\n borderRadius: 12,\n resizeMode: 'cover',\n }}\n />\n ) : null}\n {silentCaptureResult.path ? (<Image\n source={{ uri: silentCaptureResult.path }}\n style={{\n width: '100%',\n height: 200,\n borderRadius: 12,\n resizeMode: 'cover',\n }}\n />) : null}\n\n </View>\n {/* retake button */}\n <Button title={t('kyc.idCardCapture.retakeButton')} onPress={() => {\n retakePicture(currentSide);\n }}\n variant=\"outline\"\n size=\"medium\"\n fullWidth\n\n />\n <Button title={t('common.next')} onPress={() => {\n if (currentSide === 'back' || selectedDocumentType?.type === 'passport') {\n actions.nextComponent();\n return;\n } else {\n setShowCamera(true);\n setCurrentSide('back');\n setSilentCaptureResult((prev) => ({ path: '', success: false, isAnalyzing: false, error: '', mrz: '', templatePath: '' }));\n setCropImageUri('');\n }\n }}\n variant=\"primary\"\n size=\"large\"\n fullWidth\n />\n </View>\n </View>\n </ScrollView>\n\n\n\n {error && (\n <Text style={styles.errorText}>{error}</Text>\n )}\n </View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n root: {\n flex: 1,\n maxWidth: 760,\n width: '100%',\n },\n container: {\n backgroundColor: 'white',\n margin: 10,\n borderRadius: 10,\n paddingVertical: 16,\n paddingHorizontal: 16,\n // shadow\n shadowColor: '#000',\n shadowOffset: { width: 0, height: 2 },\n shadowOpacity: 0.35,\n shadowRadius: 4.84,\n elevation: 10,\n // padding: 16,\n },\n cameraContainer: {\n flex: 1,\n width: '100%',\n height: '100%',\n },\n previewContainer: {\n width: '100%',\n backgroundColor: 'white',\n margin: 10,\n borderRadius: 10,\n paddingVertical: 16,\n paddingHorizontal: 16,\n },\n previewItemContainer: {\n\n // marginBottom: 24,\n },\n title: {\n fontSize: 24,\n fontWeight: 'bold',\n color: '#333',\n marginBottom: 8,\n textAlign: 'center',\n },\n subtitle: {\n fontSize: 18,\n color: '#666',\n textAlign: 'center',\n marginBottom: 16,\n },\n sideInfo: {\n fontSize: 14,\n color: '#888',\n textAlign: 'center',\n marginBottom: 16,\n fontStyle: 'italic',\n },\n description: {\n fontSize: 16,\n color: '#666',\n textAlign: 'center',\n marginBottom: 24,\n lineHeight: 22,\n },\n sidesContainer: {\n flex: 1,\n },\n sideContainer: {\n marginBottom: 24,\n },\n sideTitle: {\n fontSize: 25,\n fontWeight: 'bold',\n color: '#000',\n marginBottom: 12,\n textAlign: 'center',\n },\n captureButton: {\n borderWidth: 2,\n borderColor: '#2DBD60',\n borderStyle: 'dashed',\n borderRadius: 12,\n padding: 32,\n alignItems: 'center',\n backgroundColor: '#f0f9f0',\n },\n captureIcon: {\n fontSize: 48,\n marginBottom: 16,\n },\n captureText: {\n fontSize: 16,\n color: '#2DBD60',\n fontWeight: '600',\n },\n capturedImageContainer: {\n position: 'relative',\n },\n capturedImage: {\n width: '100%',\n height: 200,\n borderRadius: 12,\n resizeMode: 'contain',\n backgroundColor: '#f0f0f0',\n },\n retakeButton: {\n position: 'absolute',\n top: 8,\n right: 8,\n backgroundColor: 'rgba(0, 0, 0, 0.7)',\n paddingHorizontal: 12,\n paddingVertical: 6,\n borderRadius: 6,\n },\n retakeButtonText: {\n color: 'white',\n fontSize: 12,\n fontWeight: '600',\n },\n camera: {\n flex: 1,\n },\n completionContainer: {\n marginTop: 24,\n alignItems: 'center',\n },\n completionText: {\n fontSize: 16,\n color: '#2DBD60',\n fontWeight: '600',\n marginBottom: 16,\n },\n primaryButton: {\n paddingHorizontal: 32,\n paddingVertical: 16,\n borderRadius: 8,\n // minWidth: 120,\n alignItems: 'center',\n backgroundColor: '#2DBD60',\n },\n primaryButtonText: {\n color: 'white',\n fontWeight: '600',\n fontSize: 16,\n },\n errorText: {\n color: '#dc2626',\n fontSize: 14,\n marginTop: 8,\n textAlign: 'center',\n },\n documentTypesContainer: {\n // flex: 1,\n // marginBottom: 16,\n // paddingHorizontal: 16,\n maxHeight: Dimensions.get('window').height - 400,\n },\n documentTypeButton: {\n flexDirection: 'row',\n alignItems: 'center',\n backgroundColor: '#F8F9FA',\n padding: 16,\n marginBottom: 12,\n borderRadius: 12,\n borderWidth: 1,\n borderColor: '#E9ECEF',\n },\n documentTypeIconContainer: {\n\n width: 40, height: 40,\n borderRadius: 10,\n alignItems: 'center',\n justifyContent: 'center',\n marginRight: 16,\n },\n documentTypeIcon: {\n fontSize: 24,\n\n },\n documentTypeName: {\n flex: 1,\n fontSize: 16,\n fontWeight: '600',\n color: '#333',\n },\n documentTypeArrow: {\n fontSize: 18,\n color: '#666',\n fontWeight: 'bold',\n },\n}); "]}
|
|
1
|
+
{"version":3,"file":"IDCardCapture.js","sourceRoot":"","sources":["../../../src/components/KYCElements/IDCardCapture.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC9G,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,aAAa,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAChH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAmB5C,MAAM,CAAC,MAAM,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AC,CAAC,MAAM,GAAG,GAAG;KACjD;IACD,kBAAkB,EAAE;QAClB,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;QACpB,eAAe,EAAE,SAAS;QAC1B,OAAO,EAAE,EAAE;QACX,YAAY,EAAE,EAAE;QAChB,YAAY,EAAE,EAAE;QAChB,WAAW,EAAE,CAAC;QACd,WAAW,EAAE,SAAS;KACvB;IACD,yBAAyB,EAAE;QAEzB,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE;QACrB,YAAY,EAAE,EAAE;QAChB,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;QACxB,WAAW,EAAE,EAAE;KAChB;IACD,gBAAgB,EAAE;QAChB,QAAQ,EAAE,EAAE;KAEb;IACD,gBAAgB,EAAE;QAChB,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,MAAM;KACd;IACD,iBAAiB,EAAE;QACjB,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,MAAM;QACb,UAAU,EAAE,MAAM;KACnB;CACF,CAAC,CAAC","sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport { View, Text, TouchableOpacity, StyleSheet, Image, Alert, ScrollView, Dimensions } from 'react-native';\nimport { EnhancedCameraView } from '../EnhancedCameraView';\nimport { TemplateComponent, IDCardConfig, LocalizedText, GovernmentDocumentType, ISilentCaptureResult, IBbox } from '../../types/KYC.types';\nimport IdCardOverlay from '../OverLay/IdCard';\nimport { useTemplateKYCFlowContext } from '../../hooks/useTemplateKYCFlow';\nimport { useI18n } from '../../hooks/useI18n';\nimport { Button } from '../ui/Button';\nimport { removeDuplicates } from '../../utils/remove-duplicate';\nimport { backVerification, checkTemplateType, frontVerification } from '../../modules/api/CardAuthentification';\nimport { getDocumentTypeInfo } from '../../utils/get-document-type-info';\nimport pathToBase64 from '../../utils/pathToBase64';\nimport { truncateFields } from '../../modules/api/KYCService';\nimport { cropByObb, cropImageWithBBox } from '../../utils/cropByObb';\nimport { logger } from '../../utils/logger';\n\n\ninterface IIDCardPayload {\n dir: string;\n file: string;\n mrz: string;\n templatePath?: string;\n}\n\ninterface IDCardCaptureProps {\n component: TemplateComponent;\n value?: Record<string, IIDCardPayload>;\n onValueChange: (value: Record<string, IIDCardPayload | string>) => void;\n error?: string;\n language?: string;\n currentSide?: string; // Nouveau prop pour spécifier le côté actuel\n}\n\nexport const IDCardCapture: React.FC<IDCardCaptureProps> = ({\n component,\n value = {},\n onValueChange,\n error,\n language = 'en',\n}) => {\n const { t, locale } = useI18n();\n const [showCamera, setShowCamera] = useState(false);\n const [capturedImages, setCapturedImages] = useState<Record<string, IIDCardPayload>>(value || {});\n const [cropImageUri, setCropImageUri] = useState<string>('');\n const [currentSide, setCurrentSide] = useState<string>('front');\n // Stocker les bbox par côté pour pouvoir restaurer les images croppées\n const [bboxBySide, setBboxBySide] = useState<Record<string, IBbox>>({});\n const [selectedDocumentType, setSelectedDocumentType] = useState<{\n type: GovernmentDocumentType;\n region: string;\n }>({\n type: 'identity_card',\n region: 'root'\n });\n const [showDocumentSelection, setShowDocumentSelection] = useState(\n {\n documentSelection: true,\n regionSelection: false\n }\n );\n const [silentCaptureResult, setSilentCaptureResult] = useState<ISilentCaptureResult>({ success: false, isAnalyzing: false });\n // const [imageNaturalSize, setImageNaturalSize] = useState<{ width: number; height: number } | null>(null);\n\n const { actions, state, } = useTemplateKYCFlowContext();\n const config = component.config as IDCardConfig;\n\n\n\n const getLocalizedText = (text: LocalizedText | Record<string, LocalizedText>): string => {\n // console.log(\"text\", text, JSON.stringify(component, null, 2));\n if (text && typeof text[currentSide] === 'object' && text[currentSide][locale]) {\n return text[currentSide][locale] || '';\n }\n return \"\";\n };\n\n const countryData = useMemo(() => {\n const geCountryID = Object.keys(state.componentData).find((c: string) => c === \"6\");\n\n if (geCountryID) {\n const countryMapping = state.componentData[geCountryID];\n return countryMapping;\n }\n return null;\n }, [state.componentData]);\n\n\n const availableDocumentTypes = useMemo(() => {\n const newconfig: GovernmentDocumentType[] = [];\n\n if (countryData) {\n const countryMapping = Object.keys(countryData?.regionMapping);\n if (countryMapping && Array.isArray(countryMapping)) {\n countryMapping.forEach((c) => {\n newconfig.push(c as GovernmentDocumentType);\n });\n }\n }\n logger.log(\"newconfig\", truncateFields(newconfig));\n return newconfig;\n }, []);\n\n\n useEffect(() => {\n logger.log(\"cropImageUri\", JSON.stringify(truncateFields({ box: silentCaptureResult }), null, 2));\n if (capturedImages[currentSide]?.dir && silentCaptureResult?.bbox) {\n cropImageWithBBox(capturedImages[currentSide].dir, silentCaptureResult.bbox)?.then((uri) => {\n setCropImageUri(uri);\n });\n }\n }, [capturedImages[currentSide]?.dir, silentCaptureResult?.bbox])\n\n\n\n const cameraConfig = {\n aspectRatio: 4 / 3,\n quality: 0.8,\n flashMode: 'auto' as const,\n cameraType: 'back' as const,\n allowRetake: true,\n maxRetakes: 3,\n overlay: {\n showGuide: true,\n guideText: selectedDocumentType ? (locale === 'en' ? getDocumentTypeInfo(selectedDocumentType.type).instructions.en : getDocumentTypeInfo(selectedDocumentType.type).instructions.fr) : getLocalizedText(component.instructions as Record<string, LocalizedText>),\n bbox: selectedDocumentType && config.bbox_configs[selectedDocumentType.type] ? config.bbox_configs[selectedDocumentType.type] : {\n xMin: 20,\n yMin: 140,\n xMax: 370,\n yMax: 340,\n borderColor: '#2DBD60',\n borderWidth: 3,\n cornerRadius: 8\n }\n\n }\n };\n\n const retakePicture = (currentSide: string) => {\n setShowCamera(true);\n actions.showCustomStepper(false);\n setCapturedImages({ ...capturedImages, [currentSide]: { dir: '', file: '', mrz: '' } });\n setSilentCaptureResult((prev) => ({ path: '', success: false, isAnalyzing: false, error: '' }));\n setCropImageUri('');\n onValueChange({ ...value, [currentSide]: { dir: '', file: '', mrz: '' } });\n };\n\n const hasRegions = useCallback((documentType: GovernmentDocumentType): { hasRegions: boolean, regionMapping: string[] } => {\n const regionMapping = countryData?.regionMapping[documentType as GovernmentDocumentType];\n if (regionMapping && Object.keys(regionMapping).length > 1) {\n return {\n hasRegions: true,\n regionMapping: Object.keys(regionMapping)\n };\n }\n return {\n hasRegions: false,\n regionMapping: []\n };\n }, [countryData]);\n\n\n const getCurrentSideVerification = (currentSide: string) => {\n const regionMapping = countryData?.regionMapping[selectedDocumentType?.type as GovernmentDocumentType];\n const authMethod: string[] = [];\n const mrzTypes: string[] = [];\n\n const key = selectedDocumentType?.region?.trim()?.length > 0 ? selectedDocumentType?.region?.trim() : 'root';\n // console.log(\"regionMapping\", JSON.stringify(regionMapping, null, 2), selectedDocumentType?.region);\n // const key = selectedDocumentType?.region as keyof typeof regionMapping;\n\n if (regionMapping?.[key] && Array.isArray(regionMapping[key])) {\n regionMapping[key].forEach((item: any) => {\n if (item[currentSide as keyof typeof item]) {\n authMethod.push(item[currentSide as keyof typeof item]);\n if (item?.mrz_type) {\n mrzTypes.push(item?.mrz_type);\n }\n }\n });\n }\n\n logger.log(\"regionMapping\", JSON.stringify(truncateFields({ regionMapping, selectedDocumentType: selectedDocumentType?.region, key }), null, 2));\n\n return { authMethod: removeDuplicates(authMethod), mrzTypes: removeDuplicates(mrzTypes), regionMapping: regionMapping, key: key };\n }\n\n const getCorrespondingMrzType = (templatePath: string, mapping: any, selectedDocumentType: string = \"root\") => {\n if (!mapping[selectedDocumentType]) return null;\n\n // Extraire le nom du fichier depuis le template_path\n const fileName = templatePath.split(\"/\").pop()?.replace(\".jpg\", \"\").replace(\".png\", \"\");\n\n if (!fileName) return null;\n\n // Normaliser en .py\n const pyName = `${fileName}.py`; // ex: cameroon_id_back_3_1.py\n\n // Chercher dans la liste\n const found = mapping[selectedDocumentType].find((item: any) => item.py_file === pyName);\n\n return found?.mrz_type || null;\n }\n\n const handleSilentCapture = async (result: { success: boolean; path?: string; error?: string }) => {\n if (silentCaptureResult.isAnalyzing) {\n return;\n }\n if (result.success && result.path) {\n setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: true, success: false, error: '' }));\n let templatePath = silentCaptureResult.templatePath || '';\n let templateBbox: IBbox | undefined;\n\n const regionMappings = getCurrentSideVerification(currentSide)\n // logger.log(\"regionMappings\", JSON.stringify(truncateFields({regionMappings, templatePath}), null, 2));\n if (regionMappings.authMethod.includes('MRZ') && templatePath.length === 0) {\n try {\n const templateType = await checkTemplateType({ path: result.path || '', docType: selectedDocumentType?.type as GovernmentDocumentType, docRegion: countryData?.code || \"\", postfix: currentSide });\n\n if (templateType.template_path) {\n templatePath = templateType.template_path;\n logger.log(\"templatePath\", templatePath);\n setSilentCaptureResult((prev) => ({ ...prev, templatePath: templatePath }));\n }\n if (templateType.card_obb) {\n let bbox: IBbox | undefined;\n try {\n const crop = await cropByObb(result?.path || '', (templateType as any).card_obb);\n bbox = crop.bbox;\n templateBbox = bbox;\n } catch { }\n }\n } catch (e: any) {\n logger.log(\"error checking template type\", truncateFields(e));\n setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, success: false, error: e?.message || 'Erreur de vérification du template' }));\n }\n }\n logger.log(\"templatePath before front verification\", templatePath);\n if (currentSide === 'front') {\n\n frontVerification(\n {\n path: result.path,\n regionMapping: regionMappings,\n selectedDocumentType: selectedDocumentType?.type || '',\n code: countryData?.code || '',\n currentSide: currentSide,\n templatePath: templatePath,\n mrzType: getCorrespondingMrzType(templatePath, regionMappings.regionMapping, regionMappings.key || '') || '',\n }).then((mrz) => {\n logger.log(\"front verification result\", truncateFields(mrz));\n const bbox = (mrz as any)?.bbox || templateBbox;\n setSilentCaptureResult((prev) => ({\n ...prev, \n path: result.path,\n templatePath: templatePath,\n bbox: bbox, success: true,\n mrz: JSON.stringify(mrz), isAnalyzing: false,\n country: countryData?.code,\n documentType: selectedDocumentType?.type,\n }),\n );\n // Stocker le bbox pour ce côté\n if (bbox && typeof bbox === 'object') {\n setBboxBySide((prev) => ({ ...prev, [currentSide]: bbox }));\n }\n\n }).catch((e: any) => {\n logger.log(\"error front verification\", truncateFields(e));\n setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, templatePath: templatePath, success: false, error: e?.message || 'Erreur de détection du MRZ' }));\n // Alert.alert('Erreur', e?.message || 'Erreur de détection du MRZ');\n })\n } else {\n backVerification({\n path: result.path,\n regionMapping: getCurrentSideVerification(currentSide),\n selectedDocumentType: selectedDocumentType?.type || '',\n code: countryData?.code || '',\n currentSide: currentSide,\n templatePath: templatePath,\n mrzType: getCorrespondingMrzType(templatePath, regionMappings.regionMapping, regionMappings.key || '') || '',\n }).then((mrz) => {\n logger.log(\"back verification result\", truncateFields(mrz));\n const bbox = (mrz as any)?.bbox || templateBbox;\n setSilentCaptureResult((prev) => ({\n ...prev, path: result.path, bbox: bbox,\n success: true, mrz: JSON.stringify(mrz), isAnalyzing: false,\n country: countryData?.code,\n documentType: selectedDocumentType?.type,\n \n }));\n // Stocker le bbox pour ce côté\n if (bbox && typeof bbox === 'object') {\n setBboxBySide((prev) => ({ ...prev, [currentSide]: bbox }));\n }\n }).catch((e: any) => {\n logger.log(\"error back verification\", truncateFields(e));\n setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, templatePath: templatePath, success: false, error: e?.message || 'Erreur de détection du MRZ' }));\n // Alert.alert('Erreur', e?.message || 'Erreur de détection du MRZ');\n })\n }\n\n }\n }\n\n // Handle capture\n const handleCapture = async (result: { success: boolean; path?: string; error?: string }) => {\n if (silentCaptureResult.path) {\n const base64 = await pathToBase64(silentCaptureResult.path);\n\n logger.log(\"silentCaptureResult captured\", JSON.stringify(truncateFields(silentCaptureResult), null, 2));\n const newImages = { ...capturedImages, [currentSide]: { dir: silentCaptureResult.path, file: base64, mrz: silentCaptureResult.mrz || \"\", templatePath: silentCaptureResult.templatePath } };\n setCapturedImages(newImages);\n if (silentCaptureResult.country && silentCaptureResult.documentType) {\n onValueChange({\n ...newImages,\n country: silentCaptureResult.country,\n documentType: silentCaptureResult.documentType,\n });\n }\n setShowCamera(false);\n actions.showCustomStepper(true);\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\n\n\n\n useEffect(() => {\n actions.showCustomStepper(!showCamera);\n }, [showCamera]);\n\n\n\n\n\n\n const handleDocumentTypeSelection = (docType: GovernmentDocumentType) => {\n setSelectedDocumentType({ type: docType, region: hasRegions(docType) ? '' : 'root' });\n setSilentCaptureResult((prev) => ({ ...prev, templatePath: '', bbox: undefined, success: false, isAnalyzing: false, error: '', path: '', mrz: '', country: '', documentType: '' }));\n setCapturedImages((prev) => ({ ...prev, front: { dir: '', file: '', mrz: '' }, back: { dir: '', file: '', mrz: '' } }));\n };\n const handleRegionSelection = (region: string) => {\n setSelectedDocumentType((prev) => ({ ...prev, region: region }));\n };\n\n // Interface de sélection du type de document\n if (showDocumentSelection.documentSelection || showDocumentSelection.regionSelection) {\n return (\n <View style={styles.root}>\n <View style={styles.container}>\n\n <Text style={styles.title}>{getLocalizedText(component.labels)}</Text>\n <Text style={styles.description}>{getLocalizedText(component.instructions)}</Text>\n\n <ScrollView style={styles.documentTypesContainer} showsVerticalScrollIndicator={false}>\n {showDocumentSelection.documentSelection ? availableDocumentTypes.map((docType) => {\n const docInfo = getDocumentTypeInfo(docType);\n return (\n <TouchableOpacity\n key={docType}\n style={[styles.documentTypeButton, { backgroundColor: selectedDocumentType?.type === docType ? '#2DBD6030' : '#F8F9FA', borderColor: selectedDocumentType?.type === docType ? '#2DBD60' : '#E9ECEF', borderWidth: 2 }]}\n onPress={() => handleDocumentTypeSelection(docType)}\n >\n <View style={[styles.documentTypeIconContainer, { backgroundColor: 'gray', }]}>\n <Text style={styles.documentTypeIcon}>{docInfo.icon}</Text>\n </View>\n <Text style={styles.documentTypeName}>\n {docInfo.name[language as keyof typeof docInfo.name] || docInfo.name.en}\n </Text>\n <Text style={styles.documentTypeArrow}>→</Text>\n </TouchableOpacity>\n );\n }) : null}\n {showDocumentSelection.regionSelection ?\n hasRegions(selectedDocumentType?.type || 'identity_card').regionMapping.map((region) => {\n return (\n <TouchableOpacity key={region} onPress={() => handleRegionSelection(region)}\n style={[styles.documentTypeButton, { backgroundColor: selectedDocumentType?.region === region ? '#2DBD6030' : '#F8F9FA', borderColor: selectedDocumentType?.region === region ? '#2DBD60' : '#E9ECEF', borderWidth: 2 }]}\n\n >\n <Text>{region}</Text>\n </TouchableOpacity>\n );\n }) : null}\n </ScrollView>\n <Button title={t('common.next')} onPress={() => {\n if (!selectedDocumentType) {\n Alert.alert(t('common.error'), t('validation.required'));\n return;\n }\n\n if (showDocumentSelection.regionSelection) {\n logger.log(\"showDocumentSelection\", JSON.stringify(truncateFields(showDocumentSelection), null, 2));\n setShowDocumentSelection({\n documentSelection: false,\n regionSelection: false\n });\n setShowCamera(true);\n actions.showCustomStepper(false);\n return;\n } else {\n if (hasRegions(selectedDocumentType?.type)?.hasRegions) {\n setShowDocumentSelection({\n documentSelection: false,\n regionSelection: true\n });\n } else {\n setShowDocumentSelection({\n documentSelection: false,\n regionSelection: false\n });\n setShowCamera(true);\n actions.showCustomStepper(false);\n }\n }\n\n }}\n variant={selectedDocumentType ? 'primary' : \"neutral\"}\n size=\"large\"\n fullWidth\n />\n\n\n {error && (\n <Text style={styles.errorText}>{error}</Text>\n )}\n </View>\n </View>\n );\n }\n\n\n\n if (showCamera) {\n\n return (\n <View style={styles.cameraContainer}>\n <EnhancedCameraView\n showCamera={true}\n cameraType={cameraConfig.cameraType}\n style={styles.camera}\n onCapture={handleCapture}\n onError={handleError}\n onClose={() => setShowCamera(false)}\n quality=\"high\"\n showCaptureButton={true}\n showSwitchCamera={true}\n onSilentCapture={handleSilentCapture}\n silentCaptureResult={silentCaptureResult}\n enableFlash={cameraConfig.flashMode === 'auto' || cameraConfig.flashMode === 'on'}\n overlayComponent={<IdCardOverlay\n xMin={cameraConfig.overlay.bbox.xMin}\n yMin={cameraConfig.overlay.bbox.yMin}\n xMax={cameraConfig.overlay.bbox.xMax}\n yMax={cameraConfig.overlay.bbox.yMax}\n instructions={cameraConfig.overlay.guideText}\n cornerOpacity={cameraConfig.overlay.bbox.cornerRadius || 0 as number}\n isSuccess={silentCaptureResult.success}\n language={state.currentLanguage}\n stepperProps={{\n back: () => {\n if (currentSide === 'back') {\n setCurrentSide('front');\n setShowCamera(false);\n setShowDocumentSelection({\n documentSelection: false,\n regionSelection: false\n });\n // Si une image front existe, on la restaure pour l'afficher\n if (capturedImages['front']?.dir) {\n // Restaurer l'état de capture du front pour afficher l'image\n const frontImage = capturedImages['front'];\n const frontBbox = bboxBySide['front'];\n setSilentCaptureResult((prev) => ({\n path: frontImage.dir,\n success: true,\n isAnalyzing: false,\n error: '',\n mrz: frontImage.mrz || '',\n templatePath: frontImage.templatePath || '',\n country: silentCaptureResult.country,\n documentType: silentCaptureResult.documentType,\n bbox: frontBbox // Restaurer le bbox pour recalculer le cropImageUri\n }));\n // Le useEffect va automatiquement recalculer le cropImageUri si bbox existe\n } else {\n // Pas d'image front, on réinitialise\n setSilentCaptureResult((prev) => ({ path: '', success: false, isAnalyzing: false, error: '', templatePath: '' }));\n }\n } else {\n setShowDocumentSelection({\n documentSelection: true,\n regionSelection: false\n });\n actions.showCustomStepper(true);\n }\n },\n selectedDocumentType: locale === 'en' ? getDocumentTypeInfo(selectedDocumentType?.type || \"identity_card\").name.en : getDocumentTypeInfo(selectedDocumentType?.type || \"identity_card\").name.fr || '',\n step: state.currentComponentIndex + 1,\n totalSteps: state.template.components.length,\n side: currentSide,\n }}\n />\n }\n />\n </View>\n );\n }\n\n\n return (\n <View style={styles.root}>\n <View style={styles.previewContainer}>\n <ScrollView style={styles.previewItemContainer} showsVerticalScrollIndicator={false}>\n <View key={currentSide} style={styles.sideContainer}>\n <Text style={styles.sideTitle}>\n {t('kyc.idCardCapture.captureTitle', { side: currentSide === 'front' ? locale === 'en' ? 'Front' : 'Recto' : locale === 'en' ? 'Back' : 'Verso' })}\n </Text>\n <Text style={{ fontSize: 14, color: '#666', textAlign: 'center', marginBottom: 16, lineHeight: 22 }}>\n {getLocalizedText(component.instructions)}\n </Text>\n\n <View style={{ alignItems: 'center', justifyContent: 'center', flexDirection: \"column\", gap: 16 }}>\n <View\n style={{\n width: '100%',\n height: 200,\n borderRadius: 12,\n padding: 1,\n overflow: 'hidden',\n // Shadow for iOS\n shadowColor: '#000',\n shadowOffset: { width: 0, height: 4 },\n shadowOpacity: 0.18,\n shadowRadius: 8,\n // Shadow for Android\n elevation: 8,\n backgroundColor: '#fff', // Needed for shadow to show on iOS\n }}\n >\n {cropImageUri ? (\n <Image\n source={{ uri: cropImageUri }}\n style={{\n width: '100%',\n height: 200,\n borderRadius: 12,\n resizeMode: 'cover',\n }}\n />\n ) : null}\n {silentCaptureResult.path ? (<Image\n source={{ uri: silentCaptureResult.path }}\n style={{\n width: '100%',\n height: 200,\n borderRadius: 12,\n resizeMode: 'cover',\n }}\n />) : null}\n\n </View>\n {/* retake button */}\n <Button title={t('kyc.idCardCapture.retakeButton')} onPress={() => {\n retakePicture(currentSide);\n }}\n variant=\"outline\"\n size=\"medium\"\n fullWidth\n\n />\n <Button title={t('common.next')} onPress={() => {\n if (currentSide === 'back' || selectedDocumentType?.type === 'passport') {\n actions.nextComponent();\n return;\n } else {\n setShowCamera(true);\n setCurrentSide('back');\n setSilentCaptureResult((prev) => ({ path: '', success: false, isAnalyzing: false, error: '', mrz: '', templatePath: '' }));\n setCropImageUri('');\n }\n }}\n variant=\"primary\"\n size=\"large\"\n fullWidth\n />\n </View>\n </View>\n </ScrollView>\n\n\n\n {error && (\n <Text style={styles.errorText}>{error}</Text>\n )}\n </View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n root: {\n flex: 1,\n maxWidth: 760,\n width: '100%',\n },\n container: {\n backgroundColor: 'white',\n margin: 10,\n borderRadius: 10,\n paddingVertical: 16,\n paddingHorizontal: 16,\n // shadow\n shadowColor: '#000',\n shadowOffset: { width: 0, height: 2 },\n shadowOpacity: 0.35,\n shadowRadius: 4.84,\n elevation: 10,\n // padding: 16,\n },\n cameraContainer: {\n flex: 1,\n width: '100%',\n height: '100%',\n },\n previewContainer: {\n width: '100%',\n backgroundColor: 'white',\n margin: 10,\n borderRadius: 10,\n paddingVertical: 16,\n paddingHorizontal: 16,\n },\n previewItemContainer: {\n\n // marginBottom: 24,\n },\n title: {\n fontSize: 24,\n fontWeight: 'bold',\n color: '#333',\n marginBottom: 8,\n textAlign: 'center',\n },\n subtitle: {\n fontSize: 18,\n color: '#666',\n textAlign: 'center',\n marginBottom: 16,\n },\n sideInfo: {\n fontSize: 14,\n color: '#888',\n textAlign: 'center',\n marginBottom: 16,\n fontStyle: 'italic',\n },\n description: {\n fontSize: 16,\n color: '#666',\n textAlign: 'center',\n marginBottom: 24,\n lineHeight: 22,\n },\n sidesContainer: {\n flex: 1,\n },\n sideContainer: {\n marginBottom: 24,\n },\n sideTitle: {\n fontSize: 25,\n fontWeight: 'bold',\n color: '#000',\n marginBottom: 12,\n textAlign: 'center',\n },\n captureButton: {\n borderWidth: 2,\n borderColor: '#2DBD60',\n borderStyle: 'dashed',\n borderRadius: 12,\n padding: 32,\n alignItems: 'center',\n backgroundColor: '#f0f9f0',\n },\n captureIcon: {\n fontSize: 48,\n marginBottom: 16,\n },\n captureText: {\n fontSize: 16,\n color: '#2DBD60',\n fontWeight: '600',\n },\n capturedImageContainer: {\n position: 'relative',\n },\n capturedImage: {\n width: '100%',\n height: 200,\n borderRadius: 12,\n resizeMode: 'contain',\n backgroundColor: '#f0f0f0',\n },\n retakeButton: {\n position: 'absolute',\n top: 8,\n right: 8,\n backgroundColor: 'rgba(0, 0, 0, 0.7)',\n paddingHorizontal: 12,\n paddingVertical: 6,\n borderRadius: 6,\n },\n retakeButtonText: {\n color: 'white',\n fontSize: 12,\n fontWeight: '600',\n },\n camera: {\n flex: 1,\n },\n completionContainer: {\n marginTop: 24,\n alignItems: 'center',\n },\n completionText: {\n fontSize: 16,\n color: '#2DBD60',\n fontWeight: '600',\n marginBottom: 16,\n },\n primaryButton: {\n paddingHorizontal: 32,\n paddingVertical: 16,\n borderRadius: 8,\n // minWidth: 120,\n alignItems: 'center',\n backgroundColor: '#2DBD60',\n },\n primaryButtonText: {\n color: 'white',\n fontWeight: '600',\n fontSize: 16,\n },\n errorText: {\n color: '#dc2626',\n fontSize: 14,\n marginTop: 8,\n textAlign: 'center',\n },\n documentTypesContainer: {\n // flex: 1,\n // marginBottom: 16,\n // paddingHorizontal: 16,\n maxHeight: Dimensions.get('window').height - 400,\n },\n documentTypeButton: {\n flexDirection: 'row',\n alignItems: 'center',\n backgroundColor: '#F8F9FA',\n padding: 16,\n marginBottom: 12,\n borderRadius: 12,\n borderWidth: 1,\n borderColor: '#E9ECEF',\n },\n documentTypeIconContainer: {\n\n width: 40, height: 40,\n borderRadius: 10,\n alignItems: 'center',\n justifyContent: 'center',\n marginRight: 16,\n },\n documentTypeIcon: {\n fontSize: 24,\n\n },\n documentTypeName: {\n flex: 1,\n fontSize: 16,\n fontWeight: '600',\n color: '#333',\n },\n documentTypeArrow: {\n fontSize: 18,\n color: '#666',\n fontWeight: 'bold',\n },\n}); "]}
|
package/build/i18n/en/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/i18n/en/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/i18n/en/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6Nd,CAAC"}
|
package/build/i18n/en/index.js
CHANGED
|
@@ -81,7 +81,8 @@ export const en = {
|
|
|
81
81
|
usePhotoButton: 'Use This Photo',
|
|
82
82
|
processing: 'Processing image...',
|
|
83
83
|
success: 'ID captured successfully',
|
|
84
|
-
error: 'Failed to capture ID. Please try again.'
|
|
84
|
+
error: 'Failed to capture ID. Please try again.',
|
|
85
|
+
captureTitle: '%{side} side of your government document',
|
|
85
86
|
},
|
|
86
87
|
// Selfie Capture
|
|
87
88
|
selfieCapture: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/i18n/en/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,EAAE,GAAG;IAChB,qBAAqB;IACrB,MAAM,EAAE;QACN,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,UAAU;QACpB,MAAM,EAAE,QAAQ;QAChB,OAAO,EAAE,SAAS;QAClB,MAAM,EAAE,QAAQ;QAChB,KAAK,EAAE,OAAO;QACd,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,YAAY;QACrB,KAAK,EAAE,OAAO;QACd,OAAO,EAAE,SAAS;QAClB,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,aAAa;KACpB;IAED,WAAW;IACX,GAAG,EAAE;QACH,KAAK,EAAE,uBAAuB;QAC9B,QAAQ,EAAE,iDAAiD;QAC3D,IAAI,EAAE,6BAA6B;QAEnC,iBAAiB;QACjB,cAAc,EAAE;YACd,KAAK,EAAE,kCAAkC;YACzC,WAAW,EAAE,iFAAiF;YAC9F,WAAW,EAAE,oBAAoB;YACjC,YAAY,EAAE,oBAAoB;YAClC,gBAAgB,EAAE;gBAChB,4BAA4B;gBAC5B,0BAA0B;gBAC1B,4BAA4B;aAC7B;SACF;QAED,mBAAmB;QACnB,eAAe,EAAE;YACf,KAAK,EAAE,0BAA0B;YACjC,WAAW,EAAE,4GAA4G;YACzH,YAAY,EAAE,iBAAiB;YAC/B,gBAAgB,EAAE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ements\n common: {\n next: 'Next',\n previous: 'Previous',\n continue: 'Continue',\n cancel: 'Cancel',\n confirm: 'Confirm',\n submit: 'Submit',\n retry: 'Retry',\n close: 'Close',\n back: 'Back',\n loading: 'Loading...',\n error: 'Error',\n success: 'Success',\n warning: 'Warning',\n info: 'Information',\n },\n\n // KYC Flow\n kyc: {\n title: 'Identity Verification',\n subtitle: 'Complete your identity verification to continue',\n step: 'Step %{current} of %{total}',\n \n // Initialization\n initialization: {\n title: 'Welcome to Identity Verification',\n description: 'We need to verify your identity to comply with regulations and ensure security.',\n startButton: 'Start Verification',\n requirements: 'What you\\'ll need:',\n requirementsList: [\n 'Valid government-issued ID',\n 'Good lighting for photos',\n 'Stable internet connection'\n ]\n },\n\n // Location Capture\n locationCapture: {\n title: 'Secure Your Verification',\n description: 'Allow location access to help us protect your account and prevent fraudulent activity during verification.',\n howThisHelps: 'How this helps:',\n howThisHelpsList: '• Verifies your device location matches your identity\\n• Detects and prevents unauthorized access\\n• Ensures compliance with security regulations',\n permissionDeniedTitle: 'Permission denied',\n permissionDeniedMessage: 'Location permission is required to continue.',\n locationDisabledTitle: 'Location disabled',\n locationDisabledMessage: 'Please enable location services on your device to continue.',\n errorTitle: 'Error',\n errorMessage: 'Unable to retrieve your location. Please try again.',\n obtained: 'Location obtained',\n latitudeLabel: 'Latitude',\n longitudeLabel: 'Longitude',\n accuracyLabel: 'Accuracy',\n resetButton: 'Reset',\n enableButton: 'Enable Location Access',\n fetching: 'Fetching...'\n },\n\n // Country Selection\n countrySelection: {\n title: 'Select Your Country',\n subtitle: 'Choose the country that issued your ID document',\n searchPlaceholder: 'Search for your country...',\n noResults: 'No countries found',\n selectCountry: 'Select Country'\n },\n\n // ID Card Capture\n idCardCapture: {\n title: 'Capture Your ID Document',\n subtitle: 'Take a clear photo of your ID document',\n frontSide: 'Front Side',\n backSide: 'Back Side',\n instructions: {\n title: 'Instructions:',\n list: [\n 'Place your ID on a flat surface',\n 'Ensure good lighting',\n 'Keep the entire document in frame',\n 'Avoid glare and shadows'\n ]\n },\n captureButton: 'Capture Photo',\n retakeButton: 'Retake',\n usePhotoButton: 'Use This Photo',\n processing: 'Processing image...',\n success: 'ID captured successfully',\n error: 'Failed to capture ID. Please try again.'\n },\n\n // Selfie Capture\n selfieCapture: {\n title: 'Take a Selfie',\n subtitle: 'Take a clear selfie for identity verification',\n instructions: {\n title: 'Instructions:',\n list: [\n 'Look directly at the camera',\n 'Ensure good lighting on your face',\n 'Remove glasses and hats',\n 'Keep a neutral expression'\n ]\n },\n captureButton: 'Take Selfie',\n retakeButton: 'Retake',\n usePhotoButton: 'Use This Photo',\n processing: 'Processing selfie...',\n success: 'Selfie captured successfully',\n error: 'Failed to capture selfie. Please try again.'\n },\n\n // File Upload\n fileUpload: {\n title: 'Upload Document',\n subtitle: 'Upload a clear photo of your document',\n selectFile: 'Select File',\n uploadButton: 'Upload',\n dragDropText: 'Drag and drop your file here, or click to select',\n supportedFormats: 'Supported formats: JPG, PNG, PDF',\n maxSize: 'Max file size: 10MB',\n processing: 'Processing file...',\n success: 'File uploaded successfully',\n error: 'Failed to upload file. Please try again.'\n },\n\n // Verification Progress\n verificationProgress: {\n title: 'Verifying Your Identity',\n subtitle: 'Please wait while we verify your information',\n steps: {\n analyzing: 'Analyzing documents...',\n extracting: 'Extracting information...',\n verifying: 'Verifying identity...',\n complete: 'Verification complete'\n },\n retrying: 'Retrying ( %{current} / %{max} )',\n estimatedTime: 'Estimated time: 2-3 minutes',\n status: {\n pending: 'Pending',\n processing: 'Processing',\n completed: 'Completed',\n failed: 'Failed',\n retry: 'Retry'\n }\n },\n\n // Review and Submit\n reviewSubmit: {\n title: 'Review Your Information',\n subtitle: 'Please review the information we extracted',\n personalInfo: 'Personal Information',\n documentInfo: 'Document Information',\n editButton: 'Edit',\n submitButton: 'Submit for Verification',\n confirmMessage: 'Are you sure you want to submit this information?',\n processing: 'Submitting...',\n success: 'Information submitted successfully',\n error: 'Failed to submit information. Please try again.',\n selfieSide: {\n center: 'Center',\n right: 'Right',\n left: 'Left'\n }\n },\n\n // Cancel Confirmation\n cancelConfirmation: {\n title: 'Are you sure you want to cancel?',\n message: 'You will lose all your progress.',\n cancelButton: 'Cancel',\n confirmButton: 'OK'\n }\n },\n\n // Camera and Media\n camera: {\n permissionTitle: 'Camera Permission Required',\n permissionMessage: 'We need access to your camera to capture your ID and selfie.',\n permissionButton: 'Grant Permission',\n settingsButton: 'Open Settings',\n notAvailable: 'Camera not available',\n switchCamera: 'Switch Camera',\n flashOn: 'Flash On',\n flashOff: 'Flash Off',\n capturePhoto: 'Capture Photo',\n processing: 'Processing...',\n permissionRequired: 'Camera permission required. Please grant permission to continue.',\n deviceNotAvailable: 'Camera device not available',\n notReady: 'Camera not ready',\n analyzing: 'Analyzing...',\n errorOccurred: 'Camera error occurred',\n failedToCapture: 'Failed to capture photo',\n failedToStartRecording: 'Failed to start video recording',\n failedToStopRecording: 'Failed to stop video recording'\n },\n\n // Errors\n errors: {\n networkError: 'Network error. Please check your connection.',\n serverError: 'Server error. Please try again later.',\n validationError: 'Please check your information and try again.',\n cameraError: 'Camera error. Please try again.',\n fileError: 'File error. Please try again.',\n timeoutError: 'Request timeout. Please try again.',\n unknownError: 'An unknown error occurred. Please try again.'\n },\n\n // Validation messages\n validation: {\n required: 'This field is required',\n invalidEmail: 'Please enter a valid email address',\n invalidPhone: 'Please enter a valid phone number',\n invalidDate: 'Please enter a valid date',\n minLength: 'Must be at least %{min} characters',\n maxLength: 'Must be no more than %{max} characters',\n invalidFormat: 'Invalid format',\n fileTooLarge: 'File is too large',\n fileTypeNotSupported: 'File type not supported'\n }\n};\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/i18n/en/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,EAAE,GAAG;IAChB,qBAAqB;IACrB,MAAM,EAAE;QACN,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,UAAU;QAC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EAAE,kEAAkE;QACtF,kBAAkB,EAAE,6BAA6B;QACjD,QAAQ,EAAE,kBAAkB;QAC5B,SAAS,EAAE,cAAc;QACzB,aAAa,EAAE,uBAAuB;QACtC,eAAe,EAAE,yBAAyB;QAC1C,sBAAsB,EAAE,iCAAiC;QACzD,qBAAqB,EAAE,gCAAgC;KACxD;IAED,SAAS;IACT,MAAM,EAAE;QACN,YAAY,EAAE,8CAA8C;QAC5D,WAAW,EAAE,uCAAuC;QACpD,eAAe,EAAE,8CAA8C;QAC/D,WAAW,EAAE,iCAAiC;QAC9C,SAAS,EAAE,+BAA+B;QAC1C,YAAY,EAAE,oCAAoC;QAClD,YAAY,EAAE,8CAA8C;KAC7D;IAED,sBAAsB;IACtB,UAAU,EAAE;QACV,QAAQ,EAAE,wBAAwB;QAClC,YAAY,EAAE,oCAAoC;QAClD,YAAY,EAAE,mCAAmC;QACjD,WAAW,EAAE,2BAA2B;QACxC,SAAS,EAAE,oCAAoC;QAC/C,SAAS,EAAE,wCAAwC;QACnD,aAAa,EAAE,gBAAgB;QAC/B,YAAY,EAAE,mBAAmB;QACjC,oBAAoB,EAAE,yBAAyB;KAChD;CACF,CAAC","sourcesContent":["export const en = {\n // Common UI elements\n common: {\n next: 'Next',\n previous: 'Previous',\n continue: 'Continue',\n cancel: 'Cancel',\n confirm: 'Confirm',\n submit: 'Submit',\n retry: 'Retry',\n close: 'Close',\n back: 'Back',\n loading: 'Loading...',\n error: 'Error',\n success: 'Success',\n warning: 'Warning',\n info: 'Information',\n },\n\n // KYC Flow\n kyc: {\n title: 'Identity Verification',\n subtitle: 'Complete your identity verification to continue',\n step: 'Step %{current} of %{total}',\n \n // Initialization\n initialization: {\n title: 'Welcome to Identity Verification',\n description: 'We need to verify your identity to comply with regulations and ensure security.',\n startButton: 'Start Verification',\n requirements: 'What you\\'ll need:',\n requirementsList: [\n 'Valid government-issued ID',\n 'Good lighting for photos',\n 'Stable internet connection'\n ]\n },\n\n // Location Capture\n locationCapture: {\n title: 'Secure Your Verification',\n description: 'Allow location access to help us protect your account and prevent fraudulent activity during verification.',\n howThisHelps: 'How this helps:',\n howThisHelpsList: '• Verifies your device location matches your identity\\n• Detects and prevents unauthorized access\\n• Ensures compliance with security regulations',\n permissionDeniedTitle: 'Permission denied',\n permissionDeniedMessage: 'Location permission is required to continue.',\n locationDisabledTitle: 'Location disabled',\n locationDisabledMessage: 'Please enable location services on your device to continue.',\n errorTitle: 'Error',\n errorMessage: 'Unable to retrieve your location. Please try again.',\n obtained: 'Location obtained',\n latitudeLabel: 'Latitude',\n longitudeLabel: 'Longitude',\n accuracyLabel: 'Accuracy',\n resetButton: 'Reset',\n enableButton: 'Enable Location Access',\n fetching: 'Fetching...'\n },\n\n // Country Selection\n countrySelection: {\n title: 'Select Your Country',\n subtitle: 'Choose the country that issued your ID document',\n searchPlaceholder: 'Search for your country...',\n noResults: 'No countries found',\n selectCountry: 'Select Country'\n },\n\n // ID Card Capture\n idCardCapture: {\n title: 'Capture Your ID Document',\n subtitle: 'Take a clear photo of your ID document',\n frontSide: 'Front Side',\n backSide: 'Back Side',\n instructions: {\n title: 'Instructions:',\n list: [\n 'Place your ID on a flat surface',\n 'Ensure good lighting',\n 'Keep the entire document in frame',\n 'Avoid glare and shadows'\n ]\n },\n captureButton: 'Capture Photo',\n retakeButton: 'Retake',\n usePhotoButton: 'Use This Photo',\n processing: 'Processing image...',\n success: 'ID captured successfully',\n error: 'Failed to capture ID. Please try again.',\n captureTitle: '%{side} side of your government document',\n },\n\n // Selfie Capture\n selfieCapture: {\n title: 'Take a Selfie',\n subtitle: 'Take a clear selfie for identity verification',\n instructions: {\n title: 'Instructions:',\n list: [\n 'Look directly at the camera',\n 'Ensure good lighting on your face',\n 'Remove glasses and hats',\n 'Keep a neutral expression'\n ]\n },\n captureButton: 'Take Selfie',\n retakeButton: 'Retake',\n usePhotoButton: 'Use This Photo',\n processing: 'Processing selfie...',\n success: 'Selfie captured successfully',\n error: 'Failed to capture selfie. Please try again.'\n },\n\n // File Upload\n fileUpload: {\n title: 'Upload Document',\n subtitle: 'Upload a clear photo of your document',\n selectFile: 'Select File',\n uploadButton: 'Upload',\n dragDropText: 'Drag and drop your file here, or click to select',\n supportedFormats: 'Supported formats: JPG, PNG, PDF',\n maxSize: 'Max file size: 10MB',\n processing: 'Processing file...',\n success: 'File uploaded successfully',\n error: 'Failed to upload file. Please try again.'\n },\n\n // Verification Progress\n verificationProgress: {\n title: 'Verifying Your Identity',\n subtitle: 'Please wait while we verify your information',\n steps: {\n analyzing: 'Analyzing documents...',\n extracting: 'Extracting information...',\n verifying: 'Verifying identity...',\n complete: 'Verification complete'\n },\n retrying: 'Retrying ( %{current} / %{max} )',\n estimatedTime: 'Estimated time: 2-3 minutes',\n status: {\n pending: 'Pending',\n processing: 'Processing',\n completed: 'Completed',\n failed: 'Failed',\n retry: 'Retry'\n }\n },\n\n // Review and Submit\n reviewSubmit: {\n title: 'Review Your Information',\n subtitle: 'Please review the information we extracted',\n personalInfo: 'Personal Information',\n documentInfo: 'Document Information',\n editButton: 'Edit',\n submitButton: 'Submit for Verification',\n confirmMessage: 'Are you sure you want to submit this information?',\n processing: 'Submitting...',\n success: 'Information submitted successfully',\n error: 'Failed to submit information. Please try again.',\n selfieSide: {\n center: 'Center',\n right: 'Right',\n left: 'Left'\n }\n },\n\n // Cancel Confirmation\n cancelConfirmation: {\n title: 'Are you sure you want to cancel?',\n message: 'You will lose all your progress.',\n cancelButton: 'Cancel',\n confirmButton: 'OK'\n }\n },\n\n // Camera and Media\n camera: {\n permissionTitle: 'Camera Permission Required',\n permissionMessage: 'We need access to your camera to capture your ID and selfie.',\n permissionButton: 'Grant Permission',\n settingsButton: 'Open Settings',\n notAvailable: 'Camera not available',\n switchCamera: 'Switch Camera',\n flashOn: 'Flash On',\n flashOff: 'Flash Off',\n capturePhoto: 'Capture Photo',\n processing: 'Processing...',\n permissionRequired: 'Camera permission required. Please grant permission to continue.',\n deviceNotAvailable: 'Camera device not available',\n notReady: 'Camera not ready',\n analyzing: 'Analyzing...',\n errorOccurred: 'Camera error occurred',\n failedToCapture: 'Failed to capture photo',\n failedToStartRecording: 'Failed to start video recording',\n failedToStopRecording: 'Failed to stop video recording'\n },\n\n // Errors\n errors: {\n networkError: 'Network error. Please check your connection.',\n serverError: 'Server error. Please try again later.',\n validationError: 'Please check your information and try again.',\n cameraError: 'Camera error. Please try again.',\n fileError: 'File error. Please try again.',\n timeoutError: 'Request timeout. Please try again.',\n unknownError: 'An unknown error occurred. Please try again.'\n },\n\n // Validation messages\n validation: {\n required: 'This field is required',\n invalidEmail: 'Please enter a valid email address',\n invalidPhone: 'Please enter a valid phone number',\n invalidDate: 'Please enter a valid date',\n minLength: 'Must be at least %{min} characters',\n maxLength: 'Must be no more than %{max} characters',\n invalidFormat: 'Invalid format',\n fileTooLarge: 'File is too large',\n fileTypeNotSupported: 'File type not supported'\n }\n};\n"]}
|
package/build/i18n/fr/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/i18n/fr/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/i18n/fr/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6Nd,CAAC"}
|
package/build/i18n/fr/index.js
CHANGED
|
@@ -81,7 +81,8 @@ export const fr = {
|
|
|
81
81
|
usePhotoButton: 'Utiliser Cette Photo',
|
|
82
82
|
processing: 'Traitement de l\'image...',
|
|
83
83
|
success: 'Document d\'identité capturé avec succès',
|
|
84
|
-
error: 'Échec de la capture du document. Veuillez réessayer.'
|
|
84
|
+
error: 'Échec de la capture du document. Veuillez réessayer.',
|
|
85
|
+
captureTitle: '%{side} de votre document d\'identité',
|
|
85
86
|
},
|
|
86
87
|
// Selfie Capture
|
|
87
88
|
selfieCapture: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/i18n/fr/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,EAAE,GAAG;IAChB,qBAAqB;IACrB,MAAM,EAAE;QACN,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,SAAS;QACjB,OAAO,EAAE,WAAW;QACpB,MAAM,EAAE,WAAW;QACnB,KAAK,EAAE,WAAW;QAClB,KAAK,EAAE,QAAQ;QACf,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,eAAe;QACxB,KAAK,EAAE,QAAQ;QACf,OAAO,EAAE,QAAQ;QACjB,OAAO,EAAE,eAAe;QACxB,IAAI,EAAE,aAAa;KACpB;IAED,WAAW;IACX,GAAG,EAAE;QACH,KAAK,EAAE,0BAA0B;QACjC,QAAQ,EAAE,yDAAyD;QACnE,IAAI,EAAE,+BAA+B;QAErC,iBAAiB;QACjB,cAAc,EAAE;YACd,KAAK,EAAE,4CAA4C;YACnD,WAAW,EAAE,gGAAgG;YAC7G,WAAW,EAAE,2BAA2B;YACxC,YAAY,EAAE,6BAA6B;YAC3C,gBAAgB,EAAE;gBAChB,yCAAyC;gBACzC,kCAAkC;gBAClC,+BAA+B;aAChC;SACF;QAED,mBAAmB;QACnB,eAAe,EAAE;YACf,KAAK,EAAE,8BAA8B;YACrC,WAAW,EAAE,gJAAgJ;YAC7J,YAAY,EAAE,qBAAqB;YACnC,gBAAgB,EAAE,qLAAqL;YACvM,qBAAqB,EAAE,oBAAoB;YAC3C,uBAAuB,EAAE,8DAA8D;YACvF,qBAAqB,EAAE,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K,EAAE,oCAAoC;YAC3C,OAAO,EAAE,kCAAkC;YAC3C,YAAY,EAAE,SAAS;YACvB,aAAa,EAAE,IAAI;SACpB;KACF;IAED,mBAAmB;IACnB,MAAM,EAAE;QACN,eAAe,EAAE,2BAA2B;QAC5C,iBAAiB,EAAE,oGAAoG;QACvH,gBAAgB,EAAE,wBAAwB;QAC1C,cAAc,EAAE,uBAAuB;QACvC,YAAY,EAAE,uBAAuB;QACrC,YAAY,EAAE,mBAAmB;QACjC,OAAO,EAAE,cAAc;QACvB,QAAQ,EAAE,iBAAiB;QAC3B,YAAY,EAAE,kBAAkB;QAChC,UAAU,EAAE,eAAe;QAC3B,kBAAkB,EAAE,4EAA4E;QAChG,kBAAkB,EAAE,+BAA+B;QACnD,QAAQ,EAAE,kBAAkB;QAC5B,SAAS,EAAE,qBAAqB;QAChC,aAAa,EAAE,2BAA2B;QAC1C,eAAe,EAAE,2BAA2B;QAC5C,sBAAsB,EAAE,+CAA+C;QACvE,qBAAqB,EAAE,8CAA8C;KACtE;IAED,SAAS;IACT,MAAM,EAAE;QACN,YAAY,EAAE,mDAAmD;QACjE,WAAW,EAAE,+CAA+C;QAC5D,eAAe,EAAE,kDAAkD;QACnE,WAAW,EAAE,oCAAoC;QACjD,SAAS,EAAE,qCAAqC;QAChD,YAAY,EAAE,+CAA+C;QAC7D,YAAY,EAAE,0DAA0D;KACzE;IAED,UAAU,EAAE;QACV,QAAQ,EAAE,0BAA0B;QACpC,YAAY,EAAE,0CAA0C;QACxD,YAAY,EAAE,+CAA+C;QAC7D,WAAW,EAAE,iCAAiC;QAC9C,SAAS,EAAE,yCAAyC;QACpD,SAAS,EAAE,uCAAuC;QAClD,aAAa,EAAE,iBAAiB;QAChC,YAAY,EAAE,yBAAyB;QACvC,oBAAoB,EAAE,8BAA8B;KACrD;CAEF,CAAC","sourcesContent":["export const fr = {\n // Common UI elements\n common: {\n next: 'Suivant',\n previous: 'Précédent',\n continue: 'Continuer',\n cancel: 'Annuler',\n confirm: 'Confirmer',\n submit: 'Soumettre',\n retry: 'Réessayer',\n close: 'Fermer',\n back: 'Retour',\n loading: 'Chargement...',\n error: 'Erreur',\n success: 'Succès',\n warning: 'Avertissement',\n info: 'Information',\n },\n\n // KYC Flow\n kyc: {\n title: 'Vérification d\\'Identité',\n subtitle: 'Complétez votre vérification d\\'identité pour continuer',\n step: 'Étape %{current} sur %{total}',\n\n // Initialization\n initialization: {\n title: 'Bienvenue dans la Vérification d\\'Identité',\n description: 'Nous devons vérifier votre identité pour respecter les réglementations et assurer la sécurité.',\n startButton: 'Commencer la Vérification',\n requirements: 'Ce dont vous aurez besoin :',\n requirementsList: [\n 'Une pièce d\\'identité officielle valide',\n 'Un bon éclairage pour les photos',\n 'Une connexion internet stable'\n ]\n },\n\n // Location Capture\n locationCapture: {\n title: 'Sécurisez Votre Vérification',\n description: 'Autorisez l\\'accès à la localisation pour nous aider à protéger votre compte et à prévenir les activités frauduleuses pendant la vérification.',\n howThisHelps: 'Comment cela aide :',\n howThisHelpsList: '• Vérifie que la localisation de votre appareil correspond à votre identité\\n• Détecte et empêche les accès non autorisés\\n• Garantit la conformité aux réglementations de sécurité',\n permissionDeniedTitle: 'Permission refusée',\n permissionDeniedMessage: 'La permission de localisation est nécessaire pour continuer.',\n locationDisabledTitle: 'Localisation désactivée',\n locationDisabledMessage: 'Veuillez activer la localisation sur votre appareil pour continuer.',\n errorTitle: 'Erreur',\n errorMessage: 'Impossible de récupérer votre localisation. Veuillez réessayer.',\n obtained: 'Localisation obtenue',\n latitudeLabel: 'Latitude',\n longitudeLabel: 'Longitude',\n accuracyLabel: 'Précision',\n resetButton: 'Réinitialiser',\n enableButton: 'Activer l\\'accès à la localisation',\n fetching: 'Récupération...'\n },\n\n // Country Selection\n countrySelection: {\n title: 'Sélectionnez Votre Pays',\n subtitle: 'Choisissez le pays qui a émis votre document d\\'identité',\n searchPlaceholder: 'Recherchez votre pays...',\n noResults: 'Aucun pays trouvé',\n selectCountry: 'Sélectionner le Pays'\n },\n\n // ID Card Capture\n idCardCapture: {\n title: 'Capturez Votre Document d\\'Identité',\n subtitle: 'Prenez une photo claire de votre document d\\'identité',\n frontSide: 'Face Avant',\n backSide: 'Face Arrière',\n instructions: {\n title: 'Instructions :',\n list: [\n 'Placez votre pièce d\\'identité sur une surface plane',\n 'Assurez-vous d\\'un bon éclairage',\n 'Gardez tout le document dans le cadre',\n 'Évitez les reflets et les ombres'\n ]\n },\n captureButton: 'Prendre la Photo',\n retakeButton: 'Reprendre',\n usePhotoButton: 'Utiliser Cette Photo',\n processing: 'Traitement de l\\'image...',\n success: 'Document d\\'identité capturé avec succès',\n error: 'Échec de la capture du document. Veuillez réessayer.'\n },\n\n // Selfie Capture\n selfieCapture: {\n title: 'Prenez un Selfie',\n subtitle: 'Prenez un selfie clair pour la vérification d\\'identité',\n instructions: {\n title: 'Instructions :',\n list: [\n 'Regardez directement la caméra',\n 'Assurez-vous d\\'un bon éclairage sur votre visage',\n 'Retirez les lunettes et les chapeaux',\n 'Gardez une expression neutre'\n ]\n },\n captureButton: 'Prendre le Selfie',\n retakeButton: 'Reprendre',\n usePhotoButton: 'Utiliser Cette Photo',\n processing: 'Traitement du selfie...',\n success: 'Selfie capturé avec succès',\n error: 'Échec de la capture du selfie. Veuillez réessayer.'\n },\n\n // File Upload\n fileUpload: {\n title: 'Télécharger le Document',\n subtitle: 'Téléchargez une photo claire de votre document',\n selectFile: 'Sélectionner le Fichier',\n uploadButton: 'Télécharger',\n dragDropText: 'Glissez-déposez votre fichier ici, ou cliquez pour sélectionner',\n supportedFormats: 'Formats supportés : JPG, PNG, PDF',\n maxSize: 'Taille maximale : 10MB',\n processing: 'Traitement du fichier...',\n success: 'Fichier téléchargé avec succès',\n error: 'Échec du téléchargement. Veuillez réessayer.'\n },\n\n // Verification Progress\n verificationProgress: {\n title: 'Vérification de Votre Identité',\n subtitle: 'Veuillez patienter pendant que nous vérifions vos informations',\n steps: {\n analyzing: 'Analyse des documents...',\n extracting: 'Extraction des informations...',\n verifying: 'Vérification de l\\'identité...',\n complete: 'Vérification terminée'\n },\n retrying: 'Réessayer ( %{current}/ %{max} )',\n estimatedTime: 'Temps estimé : 2-3 minutes',\n status: {\n pending: 'En attente',\n processing: 'En cours',\n completed: 'Terminé',\n failed: 'Échoué',\n retry: 'Réessayer'\n }\n },\n\n // Review and Submit\n reviewSubmit: {\n title: 'Vérifiez Vos Informations',\n subtitle: 'Veuillez vérifier les informations que nous avons extraites',\n personalInfo: 'Informations Personnelles',\n documentInfo: 'Informations du Document',\n editButton: 'Modifier',\n submitButton: 'Soumettre pour Vérification',\n confirmMessage: 'Êtes-vous sûr de vouloir soumettre ces informations ?',\n processing: 'Soumission...',\n success: 'Informations soumises avec succès',\n error: 'Échec de la soumission. Veuillez réessayer.',\n selfieSide: {\n center: 'Face',\n right: 'Droite',\n left: 'Gauche'\n }\n },\n\n // Confirmation d'annulation\n cancelConfirmation: {\n title: 'Êtes-vous sûr de vouloir annuler ?',\n message: 'Vous perdrez tout votre progrès.',\n cancelButton: 'Annuler',\n confirmButton: 'OK'\n }\n },\n\n // Camera and Media\n camera: {\n permissionTitle: 'Permission Caméra Requise',\n permissionMessage: 'Nous avons besoin d\\'accéder à votre caméra pour capturer votre pièce d\\'identité et votre selfie.',\n permissionButton: 'Accorder la Permission',\n settingsButton: 'Ouvrir les Paramètres',\n notAvailable: 'Caméra non disponible',\n switchCamera: 'Changer de Caméra',\n flashOn: 'Flash Activé',\n flashOff: 'Flash Désactivé',\n capturePhoto: 'Prendre la Photo',\n processing: 'Traitement...',\n permissionRequired: 'Permission caméra requise. Veuillez accorder la permission pour continuer.',\n deviceNotAvailable: 'Appareil photo non disponible',\n notReady: 'Caméra pas prête',\n analyzing: 'Analyse en cours...',\n errorOccurred: 'Erreur de caméra survenue',\n failedToCapture: 'Échec de la capture photo',\n failedToStartRecording: 'Échec du démarrage de l\\'enregistrement vidéo',\n failedToStopRecording: 'Échec de l\\'arrêt de l\\'enregistrement vidéo'\n },\n\n // Errors\n errors: {\n networkError: 'Erreur réseau. Veuillez vérifier votre connexion.',\n serverError: 'Erreur serveur. Veuillez réessayer plus tard.',\n validationError: 'Veuillez vérifier vos informations et réessayer.',\n cameraError: 'Erreur caméra. Veuillez réessayer.',\n fileError: 'Erreur fichier. Veuillez réessayer.',\n timeoutError: 'Délai d\\'attente dépassé. Veuillez réessayer.',\n unknownError: 'Une erreur inconnue s\\'est produite. Veuillez réessayer.'\n },\n\n validation: {\n required: 'Ce champ est obligatoire',\n invalidEmail: 'Veuillez entrer une adresse email valide',\n invalidPhone: 'Veuillez entrer un numéro de téléphone valide',\n invalidDate: 'Veuillez entrer une date valide',\n minLength: 'Doit contenir au moins {min} caractères',\n maxLength: 'Ne doit pas dépasser {max} caractères',\n invalidFormat: 'Format invalide',\n fileTooLarge: 'Fichier trop volumineux',\n fileTypeNotSupported: 'Type de fichier non supporté'\n }\n\n};\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/i18n/fr/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,EAAE,GAAG;IAChB,qBAAqB;IACrB,MAAM,EAAE;QACN,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,SAAS;QACjB,OAAO,EAAE,WAAW;QACpB,MAAM,EAAE,WAAW;QACnB,KAAK,EAAE,WAAW;QAClB,KAAK,EAAE,QAAQ;QACf,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,eAAe;QACxB,KAAK,EAAE,QAAQ;QACf,OAAO,EAAE,QAAQ;QACjB,OAAO,EAAE,eAAe;QACxB,IAAI,EAAE,aAAa;KACpB;IAED,WAAW;IACX,GAAG,EAAE;QACH,KAAK,EAAE,0BAA0B;QACjC,QAAQ,EAAE,yDAAyD;QACnE,IAAI,EAAE,+BAA+B;QAErC,iBAAiB;QACjB,cAAc,EAAE;YACd,KAAK,EAAE,4CAA4C;YACnD,WAAW,EA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AE,0DAA0D;KACzE;IAED,UAAU,EAAE;QACV,QAAQ,EAAE,0BAA0B;QACpC,YAAY,EAAE,0CAA0C;QACxD,YAAY,EAAE,+CAA+C;QAC7D,WAAW,EAAE,iCAAiC;QAC9C,SAAS,EAAE,yCAAyC;QACpD,SAAS,EAAE,uCAAuC;QAClD,aAAa,EAAE,iBAAiB;QAChC,YAAY,EAAE,yBAAyB;QACvC,oBAAoB,EAAE,8BAA8B;KACrD;CAEF,CAAC","sourcesContent":["export const fr = {\n // Common UI elements\n common: {\n next: 'Suivant',\n previous: 'Précédent',\n continue: 'Continuer',\n cancel: 'Annuler',\n confirm: 'Confirmer',\n submit: 'Soumettre',\n retry: 'Réessayer',\n close: 'Fermer',\n back: 'Retour',\n loading: 'Chargement...',\n error: 'Erreur',\n success: 'Succès',\n warning: 'Avertissement',\n info: 'Information',\n },\n\n // KYC Flow\n kyc: {\n title: 'Vérification d\\'Identité',\n subtitle: 'Complétez votre vérification d\\'identité pour continuer',\n step: 'Étape %{current} sur %{total}',\n\n // Initialization\n initialization: {\n title: 'Bienvenue dans la Vérification d\\'Identité',\n description: 'Nous devons vérifier votre identité pour respecter les réglementations et assurer la sécurité.',\n startButton: 'Commencer la Vérification',\n requirements: 'Ce dont vous aurez besoin :',\n requirementsList: [\n 'Une pièce d\\'identité officielle valide',\n 'Un bon éclairage pour les photos',\n 'Une connexion internet stable'\n ]\n },\n\n // Location Capture\n locationCapture: {\n title: 'Sécurisez Votre Vérification',\n description: 'Autorisez l\\'accès à la localisation pour nous aider à protéger votre compte et à prévenir les activités frauduleuses pendant la vérification.',\n howThisHelps: 'Comment cela aide :',\n howThisHelpsList: '• Vérifie que la localisation de votre appareil correspond à votre identité\\n• Détecte et empêche les accès non autorisés\\n• Garantit la conformité aux réglementations de sécurité',\n permissionDeniedTitle: 'Permission refusée',\n permissionDeniedMessage: 'La permission de localisation est nécessaire pour continuer.',\n locationDisabledTitle: 'Localisation désactivée',\n locationDisabledMessage: 'Veuillez activer la localisation sur votre appareil pour continuer.',\n errorTitle: 'Erreur',\n errorMessage: 'Impossible de récupérer votre localisation. Veuillez réessayer.',\n obtained: 'Localisation obtenue',\n latitudeLabel: 'Latitude',\n longitudeLabel: 'Longitude',\n accuracyLabel: 'Précision',\n resetButton: 'Réinitialiser',\n enableButton: 'Activer l\\'accès à la localisation',\n fetching: 'Récupération...'\n },\n\n // Country Selection\n countrySelection: {\n title: 'Sélectionnez Votre Pays',\n subtitle: 'Choisissez le pays qui a émis votre document d\\'identité',\n searchPlaceholder: 'Recherchez votre pays...',\n noResults: 'Aucun pays trouvé',\n selectCountry: 'Sélectionner le Pays'\n },\n\n // ID Card Capture\n idCardCapture: {\n title: 'Capturez Votre Document d\\'Identité',\n subtitle: 'Prenez une photo claire de votre document d\\'identité',\n frontSide: 'Face Avant',\n backSide: 'Face Arrière',\n instructions: {\n title: 'Instructions :',\n list: [\n 'Placez votre pièce d\\'identité sur une surface plane',\n 'Assurez-vous d\\'un bon éclairage',\n 'Gardez tout le document dans le cadre',\n 'Évitez les reflets et les ombres'\n ]\n },\n captureButton: 'Prendre la Photo',\n retakeButton: 'Reprendre',\n usePhotoButton: 'Utiliser Cette Photo',\n processing: 'Traitement de l\\'image...',\n success: 'Document d\\'identité capturé avec succès',\n error: 'Échec de la capture du document. Veuillez réessayer.',\n captureTitle: '%{side} de votre document d\\'identité',\n },\n\n // Selfie Capture\n selfieCapture: {\n title: 'Prenez un Selfie',\n subtitle: 'Prenez un selfie clair pour la vérification d\\'identité',\n instructions: {\n title: 'Instructions :',\n list: [\n 'Regardez directement la caméra',\n 'Assurez-vous d\\'un bon éclairage sur votre visage',\n 'Retirez les lunettes et les chapeaux',\n 'Gardez une expression neutre'\n ]\n },\n captureButton: 'Prendre le Selfie',\n retakeButton: 'Reprendre',\n usePhotoButton: 'Utiliser Cette Photo',\n processing: 'Traitement du selfie...',\n success: 'Selfie capturé avec succès',\n error: 'Échec de la capture du selfie. Veuillez réessayer.'\n },\n\n // File Upload\n fileUpload: {\n title: 'Télécharger le Document',\n subtitle: 'Téléchargez une photo claire de votre document',\n selectFile: 'Sélectionner le Fichier',\n uploadButton: 'Télécharger',\n dragDropText: 'Glissez-déposez votre fichier ici, ou cliquez pour sélectionner',\n supportedFormats: 'Formats supportés : JPG, PNG, PDF',\n maxSize: 'Taille maximale : 10MB',\n processing: 'Traitement du fichier...',\n success: 'Fichier téléchargé avec succès',\n error: 'Échec du téléchargement. Veuillez réessayer.'\n },\n\n // Verification Progress\n verificationProgress: {\n title: 'Vérification de Votre Identité',\n subtitle: 'Veuillez patienter pendant que nous vérifions vos informations',\n steps: {\n analyzing: 'Analyse des documents...',\n extracting: 'Extraction des informations...',\n verifying: 'Vérification de l\\'identité...',\n complete: 'Vérification terminée'\n },\n retrying: 'Réessayer ( %{current}/ %{max} )',\n estimatedTime: 'Temps estimé : 2-3 minutes',\n status: {\n pending: 'En attente',\n processing: 'En cours',\n completed: 'Terminé',\n failed: 'Échoué',\n retry: 'Réessayer'\n }\n },\n\n // Review and Submit\n reviewSubmit: {\n title: 'Vérifiez Vos Informations',\n subtitle: 'Veuillez vérifier les informations que nous avons extraites',\n personalInfo: 'Informations Personnelles',\n documentInfo: 'Informations du Document',\n editButton: 'Modifier',\n submitButton: 'Soumettre pour Vérification',\n confirmMessage: 'Êtes-vous sûr de vouloir soumettre ces informations ?',\n processing: 'Soumission...',\n success: 'Informations soumises avec succès',\n error: 'Échec de la soumission. Veuillez réessayer.',\n selfieSide: {\n center: 'Face',\n right: 'Droite',\n left: 'Gauche'\n }\n },\n\n // Confirmation d'annulation\n cancelConfirmation: {\n title: 'Êtes-vous sûr de vouloir annuler ?',\n message: 'Vous perdrez tout votre progrès.',\n cancelButton: 'Annuler',\n confirmButton: 'OK'\n }\n },\n\n // Camera and Media\n camera: {\n permissionTitle: 'Permission Caméra Requise',\n permissionMessage: 'Nous avons besoin d\\'accéder à votre caméra pour capturer votre pièce d\\'identité et votre selfie.',\n permissionButton: 'Accorder la Permission',\n settingsButton: 'Ouvrir les Paramètres',\n notAvailable: 'Caméra non disponible',\n switchCamera: 'Changer de Caméra',\n flashOn: 'Flash Activé',\n flashOff: 'Flash Désactivé',\n capturePhoto: 'Prendre la Photo',\n processing: 'Traitement...',\n permissionRequired: 'Permission caméra requise. Veuillez accorder la permission pour continuer.',\n deviceNotAvailable: 'Appareil photo non disponible',\n notReady: 'Caméra pas prête',\n analyzing: 'Analyse en cours...',\n errorOccurred: 'Erreur de caméra survenue',\n failedToCapture: 'Échec de la capture photo',\n failedToStartRecording: 'Échec du démarrage de l\\'enregistrement vidéo',\n failedToStopRecording: 'Échec de l\\'arrêt de l\\'enregistrement vidéo'\n },\n\n // Errors\n errors: {\n networkError: 'Erreur réseau. Veuillez vérifier votre connexion.',\n serverError: 'Erreur serveur. Veuillez réessayer plus tard.',\n validationError: 'Veuillez vérifier vos informations et réessayer.',\n cameraError: 'Erreur caméra. Veuillez réessayer.',\n fileError: 'Erreur fichier. Veuillez réessayer.',\n timeoutError: 'Délai d\\'attente dépassé. Veuillez réessayer.',\n unknownError: 'Une erreur inconnue s\\'est produite. Veuillez réessayer.'\n },\n\n validation: {\n required: 'Ce champ est obligatoire',\n invalidEmail: 'Veuillez entrer une adresse email valide',\n invalidPhone: 'Veuillez entrer un numéro de téléphone valide',\n invalidDate: 'Veuillez entrer une date valide',\n minLength: 'Doit contenir au moins {min} caractères',\n maxLength: 'Ne doit pas dépasser {max} caractères',\n invalidFormat: 'Format invalide',\n fileTooLarge: 'Fichier trop volumineux',\n fileTypeNotSupported: 'Type de fichier non supporté'\n }\n\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisionCameraModule.d.ts","sourceRoot":"","sources":["../../../src/modules/camera/VisionCameraModule.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,YAAY,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"VisionCameraModule.d.ts","sourceRoot":"","s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'react-native';
|
|
|
2
2
|
import { Camera } from 'react-native-vision-camera';
|
|
3
3
|
/**
|
|
4
4
|
* Backward-compatible file copy function
|
|
5
|
-
* Tries new File API first (Expo SDK 54+), then
|
|
6
|
-
* Never uses the deprecated regular import to avoid errors
|
|
5
|
+
* Tries new File API first (Expo SDK 54+), then legacy API, then regular import for SDK 53
|
|
7
6
|
*/
|
|
8
7
|
async function copyFileCompat(from, to) {
|
|
9
8
|
// Try new File API first (Expo SDK 54+)
|
|
@@ -33,15 +32,37 @@ async function copyFileCompat(from, to) {
|
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
34
|
catch (error) {
|
|
36
|
-
//
|
|
35
|
+
// Legacy not available (SDK 53 or earlier), fall through to regular import
|
|
36
|
+
// Check if it's a "module not found" error (SDK 53) vs other error
|
|
37
37
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
38
|
-
|
|
38
|
+
if (errorMessage.includes('Cannot find module') || errorMessage.includes('Module not found')) {
|
|
39
|
+
// SDK 53 or earlier - use regular import as fallback
|
|
40
|
+
// This will show a deprecation warning on SDK 54+, but is necessary for SDK 53 compatibility
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
// Other error, re-throw
|
|
44
|
+
throw new Error(`Unable to copy file: legacy FileSystem API error. Error: ${errorMessage}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
// Fallback to regular import for SDK 53 and earlier
|
|
48
|
+
// Note: This will show a deprecation warning on SDK 54+, but is necessary for backward compatibility
|
|
49
|
+
try {
|
|
50
|
+
// @ts-ignore
|
|
51
|
+
const FileSystem = require('expo-file-system');
|
|
52
|
+
if (FileSystem && FileSystem.copyAsync && typeof FileSystem.copyAsync === 'function') {
|
|
53
|
+
await FileSystem.copyAsync({ from, to });
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
59
|
+
throw new Error(`Unable to copy file: all FileSystem APIs failed. Last error: ${errorMessage}`);
|
|
39
60
|
}
|
|
40
|
-
throw new Error('Unable to copy file:
|
|
61
|
+
throw new Error('Unable to copy file: no compatible FileSystem API found');
|
|
41
62
|
}
|
|
42
63
|
/**
|
|
43
64
|
* Get document directory path in a backward-compatible way
|
|
44
|
-
*
|
|
65
|
+
* Supports SDK 53 (regular import) and SDK 54+ (legacy or new API)
|
|
45
66
|
*/
|
|
46
67
|
function getDocumentDirectory() {
|
|
47
68
|
try {
|
|
@@ -65,11 +86,30 @@ function getDocumentDirectory() {
|
|
|
65
86
|
}
|
|
66
87
|
}
|
|
67
88
|
catch (error) {
|
|
68
|
-
// Legacy
|
|
89
|
+
// Legacy not available (SDK 53 or earlier), fall through to regular import
|
|
90
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
91
|
+
if (errorMessage.includes('Cannot find module') || errorMessage.includes('Module not found')) {
|
|
92
|
+
// SDK 53 or earlier - use regular import as fallback
|
|
93
|
+
// This will show a deprecation warning on SDK 54+, but is necessary for SDK 53 compatibility
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
// Other error, continue to fallback
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// Fallback to regular import for SDK 53 and earlier
|
|
100
|
+
// Note: This will show a deprecation warning on SDK 54+, but is necessary for backward compatibility
|
|
101
|
+
try {
|
|
102
|
+
// @ts-ignore
|
|
103
|
+
const FileSystem = require('expo-file-system');
|
|
104
|
+
if (FileSystem && FileSystem.documentDirectory) {
|
|
105
|
+
return FileSystem.documentDirectory;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
69
109
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
70
|
-
throw new Error(`Unable to get document directory:
|
|
110
|
+
throw new Error(`Unable to get document directory: all FileSystem APIs failed. Last error: ${errorMessage}`);
|
|
71
111
|
}
|
|
72
|
-
throw new Error('Unable to get document directory:
|
|
112
|
+
throw new Error('Unable to get document directory: no compatible FileSystem API found');
|
|
73
113
|
}
|
|
74
114
|
export class VisionCameraModule {
|
|
75
115
|
static instance;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisionCameraModule.js","sourceRoot":"","sources":["../../../src/modules/camera/VisionCameraModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,MAAM,EAAmD,MAAM,4BAA4B,CAAC;AAErG;;;;GAIG;AACH,KAAK,UAAU,cAAc,CAAC,IAAY,EAAE,EAAU;IACpD,wCAAwC;IACxC,IAAI,CAAC;QACH,kDAAkD;QAClD,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAC7C,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;YACvC,MAAM,UAAU,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;YAClC,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC;YAC9B,2CAA2C;YAC3C,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC1B,OAAO;QACT,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,8CAA8C;QAC9C,yBAAyB;IAC3B,CAAC;IAED,6DAA6D;IAC7D,4DAA4D;IAC5D,IAAI,CAAC;QACH,mDAAmD;QACnD,MAAM,gBAAgB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;QAC5D,IAAI,gBAAgB,IAAI,gBAAgB,CAAC,SAAS,IAAI,OAAO,gBAAgB,CAAC,SAAS,KAAK,UAAU,EAAE,CAAC;YACvG,MAAM,gBAAgB,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;YAC/C,OAAO;QACT,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,kDAAkD;QAClD,MAAM,YAA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KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;aAChE,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAED,eAAe,kBAAkB,CAAC,WAAW,EAAE,CAAC","sourcesContent":["import { Platform } from 'react-native';\nimport { Camera, CameraDevice, CameraPermissionStatus, PhotoFile } from 'react-native-vision-camera';\n\n/**\n * Backward-compatible file copy function\n * Tries new File API first (Expo SDK 54+), then falls back to legacy API\n * Never uses the deprecated regular import to avoid errors\n */\nasync function copyFileCompat(from: string, to: string): Promise<void> {\n // Try new File API first (Expo SDK 54+)\n try {\n // @ts-ignore - File API might not be in types yet\n const { File } = require('expo-file-system');\n if (File && typeof File === 'function') {\n const sourceFile = new File(from);\n const destFile = new File(to);\n // File.copy() is synchronous but may throw\n sourceFile.copy(destFile);\n return;\n }\n } catch (error) {\n // New API not available or failed, try legacy\n // Continue to legacy API\n }\n\n // Try legacy API from expo-file-system/legacy (Expo SDK 54+)\n // This is the recommended way to avoid deprecation warnings\n try {\n // @ts-ignore - legacy export might not be in types\n const LegacyFileSystem = require('expo-file-system/legacy');\n if (LegacyFileSystem && LegacyFileSystem.copyAsync && typeof LegacyFileSystem.copyAsync === 'function') {\n await LegacyFileSystem.copyAsync({ from, to });\n return;\n }\n } catch (error) {\n // If legacy is not available, throw a clear error\n const errorMessage = error instanceof Error ? error.message : String(error);\n throw new Error(`Unable to copy file: legacy FileSystem API not available. Error: ${errorMessage}`);\n }\n\n throw new Error('Unable to copy file: legacy FileSystem API loaded but copyAsync method not found');\n}\n\n/**\n * Get document directory path in a backward-compatible way\n * Never uses the deprecated regular import to avoid errors\n */\nfunction getDocumentDirectory(): string {\n try {\n // Try new Paths API first (Expo SDK 54+)\n // @ts-ignore\n const { Paths } = require('expo-file-system');\n if (Paths?.document) {\n return Paths.document.uri;\n }\n } catch (_) {\n // New API not available, try legacy\n }\n\n // Try legacy API from expo-file-system/legacy (Expo SDK 54+)\n // This is the recommended way to avoid deprecation warnings\n try {\n // @ts-ignore\n const LegacyFileSystem = require('expo-file-system/legacy');\n if (LegacyFileSystem && LegacyFileSystem.documentDirectory) {\n return LegacyFileSystem.documentDirectory;\n }\n } catch (error) {\n // Legacy should be available in SDK 54+, but if not, throw a clear error\n const errorMessage = error instanceof Error ? error.message : String(error);\n throw new Error(`Unable to get document directory: legacy FileSystem API not available. Error: ${errorMessage}`);\n }\n\n throw new Error('Unable to get document directory: legacy FileSystem API loaded but documentDirectory not found');\n}\n\nexport interface CameraCaptureResult {\n success: boolean;\n path?: string;\n error?: string;\n}\n\nexport interface CameraPermissions {\n camera: CameraPermissionStatus;\n microphone: CameraPermissionStatus;\n}\n\nexport class VisionCameraModule {\n private static instance: VisionCameraModule;\n\n public static getInstance(): VisionCameraModule {\n if (!VisionCameraModule.instance) {\n VisionCameraModule.instance = new VisionCameraModule();\n }\n return VisionCameraModule.instance;\n }\n\n /**\n * Get available camera devices\n */\n async getCameraDevices(): Promise<CameraDevice[]> {\n try {\n const devices = Camera.getAvailableCameraDevices();\n return devices;\n } catch (error) {\n console.error('Error getting camera devices:', error);\n return [];\n }\n }\n\n /**\n * Get the best available device for selfies (front camera)\n */\n async getFrontCameraDevice(): Promise<CameraDevice | null> {\n try {\n const devices = await this.getCameraDevices();\n const frontCamera = devices.find(device => device.position === 'front');\n return frontCamera || null;\n } catch (error) {\n console.error('Error getting front camera:', error);\n return null;\n }\n }\n\n /**\n * Get the best available device for document capture (back camera)\n */\n async getBackCameraDevice(): Promise<CameraDevice | null> {\n try {\n const devices = await this.getCameraDevices();\n const backCamera = devices.find(device => device.position === 'back');\n return backCamera || null;\n } catch (error) {\n console.error('Error getting back camera:', error);\n return null;\n }\n }\n\n /**\n * Request camera permissions\n */\n async requestCameraPermission(): Promise<boolean> {\n try {\n const permission = await Camera.requestCameraPermission();\n return permission === 'granted';\n } catch (error) {\n console.error('Error requesting camera permission:', error);\n return false;\n }\n }\n\n /**\n * Request microphone permissions\n */\n async requestMicrophonePermission(): Promise<boolean> {\n try {\n const permission = await Camera.requestMicrophonePermission();\n return permission === 'granted';\n } catch (error) {\n console.error('Error requesting microphone permission:', error);\n return false;\n }\n }\n\n /**\n * Get current permission status\n */\n async getPermissionStatus(): Promise<CameraPermissions> {\n try {\n const cameraStatus = await Camera.getCameraPermissionStatus();\n const microphoneStatus = await Camera.getMicrophonePermissionStatus();\n\n return {\n camera: cameraStatus,\n microphone: microphoneStatus,\n };\n } catch (error) {\n console.error('Error getting permission status:', error);\n return {\n camera: 'denied',\n microphone: 'denied',\n };\n }\n }\n\n /**\n * Check if all required permissions are granted\n */\n async hasAllPermissions(): Promise<boolean> {\n try {\n const status = await this.getPermissionStatus();\n console.log('status', status);\n return status.camera === 'granted';\n } catch (error) {\n console.error('Error checking permissions:', error);\n return false;\n }\n }\n\n /**\n * Request all required permissions\n */\n async requestAllPermissions(): Promise<boolean> {\n try {\n const [cameraGranted, microphoneGranted] = await Promise.all([\n this.requestCameraPermission(),\n this.requestMicrophonePermission(),\n ]);\n\n return cameraGranted && microphoneGranted;\n } catch (error) {\n console.error('Error requesting permissions:', error);\n return false;\n }\n }\n\n /**\n * Check if camera is available\n */\n async isCameraAvailable(): Promise<boolean> {\n try {\n if (Platform.OS === 'web') {\n return false; // Vision Camera doesn't support web\n }\n\n const devices = await this.getCameraDevices();\n return devices.length > 0;\n } catch (error) {\n console.error('Error checking camera availability:', error);\n return false;\n }\n }\n\n /**\n * Process photo capture result\n */\n async processPhotoResult(photo: PhotoFile): Promise<CameraCaptureResult> {\n try {\n const documentDir = getDocumentDirectory();\n const newPath = documentDir + `photo_${Date.now()}.jpg`;\n\n await copyFileCompat(`file://${photo.path}`, newPath);\n\n return {\n success: true,\n path: newPath,\n };\n } catch (error) {\n console.error('Error processing photo result:', error);\n return {\n success: false,\n error: error instanceof Error ? error.message : 'Unknown error processing photo',\n };\n }\n }\n\n /**\n * Legacy method for backward compatibility\n * @deprecated Use VisionCameraView component instead\n */\n async openCameraWithInstructions(instructions: string): Promise<CameraCaptureResult> {\n console.warn('openCameraWithInstructions is deprecated. Use VisionCameraView component instead.');\n\n try {\n const hasPermissions = await this.requestAllPermissions();\n if (!hasPermissions) {\n return {\n success: false,\n error: 'Camera permissions not granted',\n };\n }\n\n const isAvailable = await this.isCameraAvailable();\n if (!isAvailable) {\n return {\n success: false,\n error: 'Camera not available',\n };\n }\n\n // Return a placeholder result since this should be handled by the component\n return {\n success: true,\n path: `mock_photo_${Date.now()}.jpg`,\n };\n } catch (error) {\n console.error('Error in openCameraWithInstructions:', error);\n return {\n success: false,\n error: error instanceof Error ? error.message : 'Unknown error',\n };\n }\n }\n}\n\nexport default VisionCameraModule.getInstance();"]}
|
|
1
|
+
{"version":3,"file":"VisionCameraModule.js","sourceRoot":"","sources":["../../../src/modules/camera/VisionCameraModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,MAAM,EAAmD,MAAM,4BAA4B,CAAC;AAErG;;;GAGG;AACH,KAAK,UAAU,cAAc,CAAC,IAAY,EAAE,EAAU;IACpD,wCAAwC;IACxC,IAAI,CAAC;QACH,kDAAkD;QAClD,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAC7C,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;YACvC,MAAM,UAAU,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;YAClC,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC;YAC9B,2CAA2C;YAC3C,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC1B,OAAO;QACT,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,8CAA8C;QAC9C,yBAAyB;IAC3B,CAAC;IAED,6DAA6D;IAC7D,4DAA4D;IAC5D,IAAI,CAAC;QACH,mDAAmD;Q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CAAC;YAED,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACnD,IAAI,CAAC,WAAW,EAAE,CAAC;gBACjB,OAAO;oBACL,OAAO,EAAE,KAAK;oBACd,KAAK,EAAE,sBAAsB;iBAC9B,CAAC;YACJ,CAAC;YAED,4EAA4E;YAC5E,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,IAAI,EAAE,cAAc,IAAI,CAAC,GAAG,EAAE,MAAM;aACrC,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,sCAAsC,EAAE,KAAK,CAAC,CAAC;YAC7D,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;aAChE,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAED,eAAe,kBAAkB,CAAC,WAAW,EAAE,CAAC","sourcesContent":["import { Platform } from 'react-native';\nimport { Camera, CameraDevice, CameraPermissionStatus, PhotoFile } from 'react-native-vision-camera';\n\n/**\n * Backward-compatible file copy function\n * Tries new File API first (Expo SDK 54+), then legacy API, then regular import for SDK 53\n */\nasync function copyFileCompat(from: string, to: string): Promise<void> {\n // Try new File API first (Expo SDK 54+)\n try {\n // @ts-ignore - File API might not be in types yet\n const { File } = require('expo-file-system');\n if (File && typeof File === 'function') {\n const sourceFile = new File(from);\n const destFile = new File(to);\n // File.copy() is synchronous but may throw\n sourceFile.copy(destFile);\n return;\n }\n } catch (error) {\n // New API not available or failed, try legacy\n // Continue to legacy API\n }\n\n // Try legacy API from expo-file-system/legacy (Expo SDK 54+)\n // This is the recommended way to avoid deprecation warnings\n try {\n // @ts-ignore - legacy export might not be in types\n const LegacyFileSystem = require('expo-file-system/legacy');\n if (LegacyFileSystem && LegacyFileSystem.copyAsync && typeof LegacyFileSystem.copyAsync === 'function') {\n await LegacyFileSystem.copyAsync({ from, to });\n return;\n }\n } catch (error) {\n // Legacy not available (SDK 53 or earlier), fall through to regular import\n // Check if it's a \"module not found\" error (SDK 53) vs other error\n const errorMessage = error instanceof Error ? error.message : String(error);\n if (errorMessage.includes('Cannot find module') || errorMessage.includes('Module not found')) {\n // SDK 53 or earlier - use regular import as fallback\n // This will show a deprecation warning on SDK 54+, but is necessary for SDK 53 compatibility\n } else {\n // Other error, re-throw\n throw new Error(`Unable to copy file: legacy FileSystem API error. Error: ${errorMessage}`);\n }\n }\n\n // Fallback to regular import for SDK 53 and earlier\n // Note: This will show a deprecation warning on SDK 54+, but is necessary for backward compatibility\n try {\n // @ts-ignore\n const FileSystem = require('expo-file-system');\n if (FileSystem && FileSystem.copyAsync && typeof FileSystem.copyAsync === 'function') {\n await FileSystem.copyAsync({ from, to });\n return;\n }\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n throw new Error(`Unable to copy file: all FileSystem APIs failed. Last error: ${errorMessage}`);\n }\n\n throw new Error('Unable to copy file: no compatible FileSystem API found');\n}\n\n/**\n * Get document directory path in a backward-compatible way\n * Supports SDK 53 (regular import) and SDK 54+ (legacy or new API)\n */\nfunction getDocumentDirectory(): string {\n try {\n // Try new Paths API first (Expo SDK 54+)\n // @ts-ignore\n const { Paths } = require('expo-file-system');\n if (Paths?.document) {\n return Paths.document.uri;\n }\n } catch (_) {\n // New API not available, try legacy\n }\n\n // Try legacy API from expo-file-system/legacy (Expo SDK 54+)\n // This is the recommended way to avoid deprecation warnings\n try {\n // @ts-ignore\n const LegacyFileSystem = require('expo-file-system/legacy');\n if (LegacyFileSystem && LegacyFileSystem.documentDirectory) {\n return LegacyFileSystem.documentDirectory;\n }\n } catch (error) {\n // Legacy not available (SDK 53 or earlier), fall through to regular import\n const errorMessage = error instanceof Error ? error.message : String(error);\n if (errorMessage.includes('Cannot find module') || errorMessage.includes('Module not found')) {\n // SDK 53 or earlier - use regular import as fallback\n // This will show a deprecation warning on SDK 54+, but is necessary for SDK 53 compatibility\n } else {\n // Other error, continue to fallback\n }\n }\n\n // Fallback to regular import for SDK 53 and earlier\n // Note: This will show a deprecation warning on SDK 54+, but is necessary for backward compatibility\n try {\n // @ts-ignore\n const FileSystem = require('expo-file-system');\n if (FileSystem && FileSystem.documentDirectory) {\n return FileSystem.documentDirectory;\n }\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n throw new Error(`Unable to get document directory: all FileSystem APIs failed. Last error: ${errorMessage}`);\n }\n\n throw new Error('Unable to get document directory: no compatible FileSystem API found');\n}\n\nexport interface CameraCaptureResult {\n success: boolean;\n path?: string;\n error?: string;\n}\n\nexport interface CameraPermissions {\n camera: CameraPermissionStatus;\n microphone: CameraPermissionStatus;\n}\n\nexport class VisionCameraModule {\n private static instance: VisionCameraModule;\n\n public static getInstance(): VisionCameraModule {\n if (!VisionCameraModule.instance) {\n VisionCameraModule.instance = new VisionCameraModule();\n }\n return VisionCameraModule.instance;\n }\n\n /**\n * Get available camera devices\n */\n async getCameraDevices(): Promise<CameraDevice[]> {\n try {\n const devices = Camera.getAvailableCameraDevices();\n return devices;\n } catch (error) {\n console.error('Error getting camera devices:', error);\n return [];\n }\n }\n\n /**\n * Get the best available device for selfies (front camera)\n */\n async getFrontCameraDevice(): Promise<CameraDevice | null> {\n try {\n const devices = await this.getCameraDevices();\n const frontCamera = devices.find(device => device.position === 'front');\n return frontCamera || null;\n } catch (error) {\n console.error('Error getting front camera:', error);\n return null;\n }\n }\n\n /**\n * Get the best available device for document capture (back camera)\n */\n async getBackCameraDevice(): Promise<CameraDevice | null> {\n try {\n const devices = await this.getCameraDevices();\n const backCamera = devices.find(device => device.position === 'back');\n return backCamera || null;\n } catch (error) {\n console.error('Error getting back camera:', error);\n return null;\n }\n }\n\n /**\n * Request camera permissions\n */\n async requestCameraPermission(): Promise<boolean> {\n try {\n const permission = await Camera.requestCameraPermission();\n return permission === 'granted';\n } catch (error) {\n console.error('Error requesting camera permission:', error);\n return false;\n }\n }\n\n /**\n * Request microphone permissions\n */\n async requestMicrophonePermission(): Promise<boolean> {\n try {\n const permission = await Camera.requestMicrophonePermission();\n return permission === 'granted';\n } catch (error) {\n console.error('Error requesting microphone permission:', error);\n return false;\n }\n }\n\n /**\n * Get current permission status\n */\n async getPermissionStatus(): Promise<CameraPermissions> {\n try {\n const cameraStatus = await Camera.getCameraPermissionStatus();\n const microphoneStatus = await Camera.getMicrophonePermissionStatus();\n\n return {\n camera: cameraStatus,\n microphone: microphoneStatus,\n };\n } catch (error) {\n console.error('Error getting permission status:', error);\n return {\n camera: 'denied',\n microphone: 'denied',\n };\n }\n }\n\n /**\n * Check if all required permissions are granted\n */\n async hasAllPermissions(): Promise<boolean> {\n try {\n const status = await this.getPermissionStatus();\n console.log('status', status);\n return status.camera === 'granted';\n } catch (error) {\n console.error('Error checking permissions:', error);\n return false;\n }\n }\n\n /**\n * Request all required permissions\n */\n async requestAllPermissions(): Promise<boolean> {\n try {\n const [cameraGranted, microphoneGranted] = await Promise.all([\n this.requestCameraPermission(),\n this.requestMicrophonePermission(),\n ]);\n\n return cameraGranted && microphoneGranted;\n } catch (error) {\n console.error('Error requesting permissions:', error);\n return false;\n }\n }\n\n /**\n * Check if camera is available\n */\n async isCameraAvailable(): Promise<boolean> {\n try {\n if (Platform.OS === 'web') {\n return false; // Vision Camera doesn't support web\n }\n\n const devices = await this.getCameraDevices();\n return devices.length > 0;\n } catch (error) {\n console.error('Error checking camera availability:', error);\n return false;\n }\n }\n\n /**\n * Process photo capture result\n */\n async processPhotoResult(photo: PhotoFile): Promise<CameraCaptureResult> {\n try {\n const documentDir = getDocumentDirectory();\n const newPath = documentDir + `photo_${Date.now()}.jpg`;\n\n await copyFileCompat(`file://${photo.path}`, newPath);\n\n return {\n success: true,\n path: newPath,\n };\n } catch (error) {\n console.error('Error processing photo result:', error);\n return {\n success: false,\n error: error instanceof Error ? error.message : 'Unknown error processing photo',\n };\n }\n }\n\n /**\n * Legacy method for backward compatibility\n * @deprecated Use VisionCameraView component instead\n */\n async openCameraWithInstructions(instructions: string): Promise<CameraCaptureResult> {\n console.warn('openCameraWithInstructions is deprecated. Use VisionCameraView component instead.');\n\n try {\n const hasPermissions = await this.requestAllPermissions();\n if (!hasPermissions) {\n return {\n success: false,\n error: 'Camera permissions not granted',\n };\n }\n\n const isAvailable = await this.isCameraAvailable();\n if (!isAvailable) {\n return {\n success: false,\n error: 'Camera not available',\n };\n }\n\n // Return a placeholder result since this should be handled by the component\n return {\n success: true,\n path: `mock_photo_${Date.now()}.jpg`,\n };\n } catch (error) {\n console.error('Error in openCameraWithInstructions:', error);\n return {\n success: false,\n error: error instanceof Error ? error.message : 'Unknown error',\n };\n }\n }\n}\n\nexport default VisionCameraModule.getInstance();"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pathToBase64.d.ts","sourceRoot":"","sources":["../../src/utils/pathToBase64.ts"],"names":[],"mappings":"AAAA,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"pathToBase64.d.ts","sourceRoot":"","sources":["../../src/utils/pathToBase64.ts"],"names":[],"mappings":"AAAA,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA0D/D;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -8,19 +8,35 @@ export async function pathToBase64(uri) {
|
|
|
8
8
|
}
|
|
9
9
|
// Try Expo FileSystem if available (React Native + Expo)
|
|
10
10
|
try {
|
|
11
|
-
//
|
|
11
|
+
// Try legacy API from expo-file-system/legacy first (Expo SDK 54+)
|
|
12
12
|
// This is the recommended way to avoid deprecation warnings
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
try {
|
|
14
|
+
// @ts-ignore - legacy export might not be in types
|
|
15
|
+
const LegacyFileSystem = require('expo-file-system/legacy');
|
|
16
|
+
if (LegacyFileSystem?.readAsStringAsync) {
|
|
17
|
+
const base64 = await LegacyFileSystem.readAsStringAsync(uri, { encoding: LegacyFileSystem.EncodingType.Base64 });
|
|
18
|
+
if (base64)
|
|
19
|
+
return base64;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
catch (legacyError) {
|
|
23
|
+
// Legacy not available (SDK 53 or earlier), try regular import
|
|
24
|
+
const errorMessage = legacyError instanceof Error ? legacyError.message : String(legacyError);
|
|
25
|
+
if (errorMessage.includes('Cannot find module') || errorMessage.includes('Module not found')) {
|
|
26
|
+
// SDK 53 or earlier - use regular import as fallback
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
const FileSystem = require('expo-file-system');
|
|
29
|
+
if (FileSystem?.readAsStringAsync) {
|
|
30
|
+
const base64 = await FileSystem.readAsStringAsync(uri, { encoding: FileSystem.EncodingType.Base64 });
|
|
31
|
+
if (base64)
|
|
32
|
+
return base64;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
// If it's a different error, continue to other strategies
|
|
20
36
|
}
|
|
21
37
|
}
|
|
22
38
|
catch (_) {
|
|
23
|
-
//
|
|
39
|
+
// All FileSystem APIs failed, fall back to other strategies (fetch + FileReader)
|
|
24
40
|
}
|
|
25
41
|
// Generic fetch + FileReader strategy (works on web; often works on RN for file:// URIs)
|
|
26
42
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pathToBase64.js","sourceRoot":"","sources":["../../src/utils/pathToBase64.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,GAAW;IAC5C,IAAI,CAAC,GAAG;QAAE,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAE3D,gDAAgD;IAChD,IAAI,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC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C,OAAO,CAAC,GAAG,CAAC,CAAC;QACxC,OAAO,UAAU,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IACzE,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,0BAA0B;IAC5B,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;AACnE,CAAC;AAED,eAAe,YAAY,CAAC","sourcesContent":["export async function pathToBase64(uri: string): Promise<string> {\n if (!uri) throw new Error('pathToBase64: uri is required');\n\n // If already a data URI, return the base64 part\n if (uri.startsWith('data:')) {\n const commaIndex = uri.indexOf(',');\n return commaIndex !== -1 ? uri.substring(commaIndex + 1) : uri;\n }\n\n // Try Expo FileSystem if available (React Native + Expo)\n try {\n // Try legacy API from expo-file-system/legacy first (Expo SDK 54+)\n // This is the recommended way to avoid deprecation warnings\n try {\n // @ts-ignore - legacy export might not be in types\n const LegacyFileSystem = require('expo-file-system/legacy');\n if (LegacyFileSystem?.readAsStringAsync) {\n const base64 = await LegacyFileSystem.readAsStringAsync(uri, { encoding: LegacyFileSystem.EncodingType.Base64 });\n if (base64) return base64;\n }\n } catch (legacyError) {\n // Legacy not available (SDK 53 or earlier), try regular import\n const errorMessage = legacyError instanceof Error ? legacyError.message : String(legacyError);\n if (errorMessage.includes('Cannot find module') || errorMessage.includes('Module not found')) {\n // SDK 53 or earlier - use regular import as fallback\n // @ts-ignore\n const FileSystem = require('expo-file-system');\n if (FileSystem?.readAsStringAsync) {\n const base64 = await FileSystem.readAsStringAsync(uri, { encoding: FileSystem.EncodingType.Base64 });\n if (base64) return base64;\n }\n }\n // If it's a different error, continue to other strategies\n }\n } catch (_) {\n // All FileSystem APIs failed, fall back to other strategies (fetch + FileReader)\n }\n\n // Generic fetch + FileReader strategy (works on web; often works on RN for file:// URIs)\n try {\n const response = await fetch(uri);\n const blob = await response.blob();\n const dataUrl = await new Promise<string>((resolve, reject) => {\n const reader = new FileReader();\n reader.onloadend = () => {\n if (typeof reader.result === 'string') resolve(reader.result);\n else reject(new Error('Failed to convert blob to data URL'));\n };\n reader.onerror = reject;\n reader.readAsDataURL(blob);\n });\n const commaIndex = dataUrl.indexOf(',');\n return commaIndex !== -1 ? dataUrl.substring(commaIndex + 1) : dataUrl;\n } catch (err) {\n // continue to final error\n }\n\n throw new Error('pathToBase64: unable to convert uri to base64');\n}\n\nexport default pathToBase64;\n\n\n"]}
|
package/package.json
CHANGED
|
@@ -522,7 +522,7 @@ export const IDCardCapture: React.FC<IDCardCaptureProps> = ({
|
|
|
522
522
|
<ScrollView style={styles.previewItemContainer} showsVerticalScrollIndicator={false}>
|
|
523
523
|
<View key={currentSide} style={styles.sideContainer}>
|
|
524
524
|
<Text style={styles.sideTitle}>
|
|
525
|
-
{currentSide === 'front' ? 'Recto' : '
|
|
525
|
+
{t('kyc.idCardCapture.captureTitle', { side: currentSide === 'front' ? locale === 'en' ? 'Front' : 'Recto' : locale === 'en' ? 'Back' : 'Verso' })}
|
|
526
526
|
</Text>
|
|
527
527
|
<Text style={{ fontSize: 14, color: '#666', textAlign: 'center', marginBottom: 16, lineHeight: 22 }}>
|
|
528
528
|
{getLocalizedText(component.instructions)}
|
package/src/i18n/en/index.ts
CHANGED
|
@@ -86,7 +86,8 @@ export const en = {
|
|
|
86
86
|
usePhotoButton: 'Use This Photo',
|
|
87
87
|
processing: 'Processing image...',
|
|
88
88
|
success: 'ID captured successfully',
|
|
89
|
-
error: 'Failed to capture ID. Please try again.'
|
|
89
|
+
error: 'Failed to capture ID. Please try again.',
|
|
90
|
+
captureTitle: '%{side} side of your government document',
|
|
90
91
|
},
|
|
91
92
|
|
|
92
93
|
// Selfie Capture
|
package/src/i18n/fr/index.ts
CHANGED
|
@@ -86,7 +86,8 @@ export const fr = {
|
|
|
86
86
|
usePhotoButton: 'Utiliser Cette Photo',
|
|
87
87
|
processing: 'Traitement de l\'image...',
|
|
88
88
|
success: 'Document d\'identité capturé avec succès',
|
|
89
|
-
error: 'Échec de la capture du document. Veuillez réessayer.'
|
|
89
|
+
error: 'Échec de la capture du document. Veuillez réessayer.',
|
|
90
|
+
captureTitle: '%{side} de votre document d\'identité',
|
|
90
91
|
},
|
|
91
92
|
|
|
92
93
|
// Selfie Capture
|
|
@@ -3,8 +3,7 @@ import { Camera, CameraDevice, CameraPermissionStatus, PhotoFile } from 'react-n
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Backward-compatible file copy function
|
|
6
|
-
* Tries new File API first (Expo SDK 54+), then
|
|
7
|
-
* Never uses the deprecated regular import to avoid errors
|
|
6
|
+
* Tries new File API first (Expo SDK 54+), then legacy API, then regular import for SDK 53
|
|
8
7
|
*/
|
|
9
8
|
async function copyFileCompat(from: string, to: string): Promise<void> {
|
|
10
9
|
// Try new File API first (Expo SDK 54+)
|
|
@@ -33,17 +32,38 @@ async function copyFileCompat(from: string, to: string): Promise<void> {
|
|
|
33
32
|
return;
|
|
34
33
|
}
|
|
35
34
|
} catch (error) {
|
|
36
|
-
//
|
|
35
|
+
// Legacy not available (SDK 53 or earlier), fall through to regular import
|
|
36
|
+
// Check if it's a "module not found" error (SDK 53) vs other error
|
|
37
37
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
38
|
-
|
|
38
|
+
if (errorMessage.includes('Cannot find module') || errorMessage.includes('Module not found')) {
|
|
39
|
+
// SDK 53 or earlier - use regular import as fallback
|
|
40
|
+
// This will show a deprecation warning on SDK 54+, but is necessary for SDK 53 compatibility
|
|
41
|
+
} else {
|
|
42
|
+
// Other error, re-throw
|
|
43
|
+
throw new Error(`Unable to copy file: legacy FileSystem API error. Error: ${errorMessage}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Fallback to regular import for SDK 53 and earlier
|
|
48
|
+
// Note: This will show a deprecation warning on SDK 54+, but is necessary for backward compatibility
|
|
49
|
+
try {
|
|
50
|
+
// @ts-ignore
|
|
51
|
+
const FileSystem = require('expo-file-system');
|
|
52
|
+
if (FileSystem && FileSystem.copyAsync && typeof FileSystem.copyAsync === 'function') {
|
|
53
|
+
await FileSystem.copyAsync({ from, to });
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
} catch (error) {
|
|
57
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
58
|
+
throw new Error(`Unable to copy file: all FileSystem APIs failed. Last error: ${errorMessage}`);
|
|
39
59
|
}
|
|
40
60
|
|
|
41
|
-
throw new Error('Unable to copy file:
|
|
61
|
+
throw new Error('Unable to copy file: no compatible FileSystem API found');
|
|
42
62
|
}
|
|
43
63
|
|
|
44
64
|
/**
|
|
45
65
|
* Get document directory path in a backward-compatible way
|
|
46
|
-
*
|
|
66
|
+
* Supports SDK 53 (regular import) and SDK 54+ (legacy or new API)
|
|
47
67
|
*/
|
|
48
68
|
function getDocumentDirectory(): string {
|
|
49
69
|
try {
|
|
@@ -66,12 +86,30 @@ function getDocumentDirectory(): string {
|
|
|
66
86
|
return LegacyFileSystem.documentDirectory;
|
|
67
87
|
}
|
|
68
88
|
} catch (error) {
|
|
69
|
-
// Legacy
|
|
89
|
+
// Legacy not available (SDK 53 or earlier), fall through to regular import
|
|
90
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
91
|
+
if (errorMessage.includes('Cannot find module') || errorMessage.includes('Module not found')) {
|
|
92
|
+
// SDK 53 or earlier - use regular import as fallback
|
|
93
|
+
// This will show a deprecation warning on SDK 54+, but is necessary for SDK 53 compatibility
|
|
94
|
+
} else {
|
|
95
|
+
// Other error, continue to fallback
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Fallback to regular import for SDK 53 and earlier
|
|
100
|
+
// Note: This will show a deprecation warning on SDK 54+, but is necessary for backward compatibility
|
|
101
|
+
try {
|
|
102
|
+
// @ts-ignore
|
|
103
|
+
const FileSystem = require('expo-file-system');
|
|
104
|
+
if (FileSystem && FileSystem.documentDirectory) {
|
|
105
|
+
return FileSystem.documentDirectory;
|
|
106
|
+
}
|
|
107
|
+
} catch (error) {
|
|
70
108
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
71
|
-
throw new Error(`Unable to get document directory:
|
|
109
|
+
throw new Error(`Unable to get document directory: all FileSystem APIs failed. Last error: ${errorMessage}`);
|
|
72
110
|
}
|
|
73
111
|
|
|
74
|
-
throw new Error('Unable to get document directory:
|
|
112
|
+
throw new Error('Unable to get document directory: no compatible FileSystem API found');
|
|
75
113
|
}
|
|
76
114
|
|
|
77
115
|
export interface CameraCaptureResult {
|
|
@@ -9,17 +9,31 @@ export async function pathToBase64(uri: string): Promise<string> {
|
|
|
9
9
|
|
|
10
10
|
// Try Expo FileSystem if available (React Native + Expo)
|
|
11
11
|
try {
|
|
12
|
-
//
|
|
12
|
+
// Try legacy API from expo-file-system/legacy first (Expo SDK 54+)
|
|
13
13
|
// This is the recommended way to avoid deprecation warnings
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
try {
|
|
15
|
+
// @ts-ignore - legacy export might not be in types
|
|
16
|
+
const LegacyFileSystem = require('expo-file-system/legacy');
|
|
17
|
+
if (LegacyFileSystem?.readAsStringAsync) {
|
|
18
|
+
const base64 = await LegacyFileSystem.readAsStringAsync(uri, { encoding: LegacyFileSystem.EncodingType.Base64 });
|
|
19
|
+
if (base64) return base64;
|
|
20
|
+
}
|
|
21
|
+
} catch (legacyError) {
|
|
22
|
+
// Legacy not available (SDK 53 or earlier), try regular import
|
|
23
|
+
const errorMessage = legacyError instanceof Error ? legacyError.message : String(legacyError);
|
|
24
|
+
if (errorMessage.includes('Cannot find module') || errorMessage.includes('Module not found')) {
|
|
25
|
+
// SDK 53 or earlier - use regular import as fallback
|
|
26
|
+
// @ts-ignore
|
|
27
|
+
const FileSystem = require('expo-file-system');
|
|
28
|
+
if (FileSystem?.readAsStringAsync) {
|
|
29
|
+
const base64 = await FileSystem.readAsStringAsync(uri, { encoding: FileSystem.EncodingType.Base64 });
|
|
30
|
+
if (base64) return base64;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
// If it's a different error, continue to other strategies
|
|
20
34
|
}
|
|
21
35
|
} catch (_) {
|
|
22
|
-
//
|
|
36
|
+
// All FileSystem APIs failed, fall back to other strategies (fetch + FileReader)
|
|
23
37
|
}
|
|
24
38
|
|
|
25
39
|
// Generic fetch + FileReader strategy (works on web; often works on RN for file:// URIs)
|