@sanctum-key/react-native-sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +278 -0
- package/android/build/.transforms/f62cb96b2d1f78ca96ab35932dd530dc/results.bin +1 -0
- package/android/build/.transforms/f62cb96b2d1f78ca96ab35932dd530dc/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/generated/source/buildConfig/debug/kyc/transfergratis/com/BuildConfig.java +10 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +69 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
- package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
- package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +1 -0
- package/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/xml_file_paths.xml.flat +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +2 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
- package/android/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/transfergratis-react-native-sdk_debug.kotlin_module +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/kyc/transfergratis/com/BuildConfig.class +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +3 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +110 -0
- package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +69 -0
- package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
- package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
- package/android/build/intermediates/packaged_res/debug/packageDebugResources/xml/file_paths.xml +15 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +2 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +2 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +101 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/transfergratis-react-native-sdk_debug.kotlin_module +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$1$5$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$1$5$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$3.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$4.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$5.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$6.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$3.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$4.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$View$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$lambda$4$$inlined$Prop$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$lambda$4$$inlined$Prop$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkView.class +0 -0
- package/android/build.gradle +43 -0
- package/android/src/main/AndroidManifest.xml +49 -0
- package/android/src/main/java/kyc/transfergratis/com/TransfergratisSdkModule.kt +131 -0
- package/android/src/main/java/kyc/transfergratis/com/TransfergratisSdkView.kt +161 -0
- package/android/src/main/res/xml/file_paths.xml +15 -0
- package/build/App.d.ts +3 -0
- package/build/App.d.ts.map +1 -0
- package/build/App.js +9 -0
- package/build/App.js.map +1 -0
- package/build/TransfergratisSdk.types.d.ts +32 -0
- package/build/TransfergratisSdk.types.d.ts.map +1 -0
- package/build/TransfergratisSdk.types.js +2 -0
- package/build/TransfergratisSdk.types.js.map +1 -0
- package/build/TransfergratisSdkModule.d.ts +21 -0
- package/build/TransfergratisSdkModule.d.ts.map +1 -0
- package/build/TransfergratisSdkModule.js +4 -0
- package/build/TransfergratisSdkModule.js.map +1 -0
- package/build/TransfergratisSdkModule.web.d.ts +20 -0
- package/build/TransfergratisSdkModule.web.d.ts.map +1 -0
- package/build/TransfergratisSdkModule.web.js +25 -0
- package/build/TransfergratisSdkModule.web.js.map +1 -0
- package/build/TransfergratisSdkView.d.ts +4 -0
- package/build/TransfergratisSdkView.d.ts.map +1 -0
- package/build/TransfergratisSdkView.js +7 -0
- package/build/TransfergratisSdkView.js.map +1 -0
- package/build/TransfergratisSdkView.web.d.ts +4 -0
- package/build/TransfergratisSdkView.web.d.ts.map +1 -0
- package/build/TransfergratisSdkView.web.js +11 -0
- package/build/TransfergratisSdkView.web.js.map +1 -0
- package/build/api/axios.d.ts +30 -0
- package/build/api/axios.d.ts.map +1 -0
- package/build/api/axios.js +92 -0
- package/build/api/axios.js.map +1 -0
- package/build/components/Camera/index.d.ts +2 -0
- package/build/components/Camera/index.d.ts.map +1 -0
- package/build/components/Camera/index.js +2 -0
- package/build/components/Camera/index.js.map +1 -0
- package/build/components/Camera/index.web.d.ts +2 -0
- package/build/components/Camera/index.web.d.ts.map +1 -0
- package/build/components/Camera/index.web.js +2 -0
- package/build/components/Camera/index.web.js.map +1 -0
- package/build/components/Camera/types.d.ts +2 -0
- package/build/components/Camera/types.d.ts.map +1 -0
- package/build/components/Camera/types.js +2 -0
- package/build/components/Camera/types.js.map +1 -0
- package/build/components/ConfigurableKYCFlow.d.ts +11 -0
- package/build/components/ConfigurableKYCFlow.d.ts.map +1 -0
- package/build/components/ConfigurableKYCFlow.js +257 -0
- package/build/components/ConfigurableKYCFlow.js.map +1 -0
- package/build/components/CustomCameraExample.d.ts +10 -0
- package/build/components/CustomCameraExample.d.ts.map +1 -0
- package/build/components/CustomCameraExample.js +232 -0
- package/build/components/CustomCameraExample.js.map +1 -0
- package/build/components/EnhancedCameraView.d.ts +4 -0
- package/build/components/EnhancedCameraView.d.ts.map +1 -0
- package/build/components/EnhancedCameraView.js +393 -0
- package/build/components/EnhancedCameraView.js.map +1 -0
- package/build/components/EnhancedCameraView.web.d.ts +4 -0
- package/build/components/EnhancedCameraView.web.d.ts.map +1 -0
- package/build/components/EnhancedCameraView.web.js +499 -0
- package/build/components/EnhancedCameraView.web.js.map +1 -0
- package/build/components/FileUpload.d.ts +13 -0
- package/build/components/FileUpload.d.ts.map +1 -0
- package/build/components/FileUpload.js +216 -0
- package/build/components/FileUpload.js.map +1 -0
- package/build/components/KYCElementRenderer.d.ts +14 -0
- package/build/components/KYCElementRenderer.d.ts.map +1 -0
- package/build/components/KYCElementRenderer.js +31 -0
- package/build/components/KYCElementRenderer.js.map +1 -0
- package/build/components/KYCElements/AdditionalDocumentsTemplate.d.ts +12 -0
- package/build/components/KYCElements/AdditionalDocumentsTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/AdditionalDocumentsTemplate.js +283 -0
- package/build/components/KYCElements/AdditionalDocumentsTemplate.js.map +1 -0
- package/build/components/KYCElements/CameraCapture.d.ts +11 -0
- package/build/components/KYCElements/CameraCapture.d.ts.map +1 -0
- package/build/components/KYCElements/CameraCapture.js +219 -0
- package/build/components/KYCElements/CameraCapture.js.map +1 -0
- package/build/components/KYCElements/CompletionStep.d.ts +10 -0
- package/build/components/KYCElements/CompletionStep.d.ts.map +1 -0
- package/build/components/KYCElements/CompletionStep.js +147 -0
- package/build/components/KYCElements/CompletionStep.js.map +1 -0
- package/build/components/KYCElements/CountrySelection.d.ts +11 -0
- package/build/components/KYCElements/CountrySelection.d.ts.map +1 -0
- package/build/components/KYCElements/CountrySelection.js +147 -0
- package/build/components/KYCElements/CountrySelection.js.map +1 -0
- package/build/components/KYCElements/CountrySelectionTemplate.d.ts +15 -0
- package/build/components/KYCElements/CountrySelectionTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/CountrySelectionTemplate.js +438 -0
- package/build/components/KYCElements/CountrySelectionTemplate.js.map +1 -0
- package/build/components/KYCElements/DocumentTypeSelection.d.ts +11 -0
- package/build/components/KYCElements/DocumentTypeSelection.d.ts.map +1 -0
- package/build/components/KYCElements/DocumentTypeSelection.js +143 -0
- package/build/components/KYCElements/DocumentTypeSelection.js.map +1 -0
- package/build/components/KYCElements/EmailVerificationTemplate.d.ts +12 -0
- package/build/components/KYCElements/EmailVerificationTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/EmailVerificationTemplate.js +212 -0
- package/build/components/KYCElements/EmailVerificationTemplate.js.map +1 -0
- package/build/components/KYCElements/FileUpload.d.ts +11 -0
- package/build/components/KYCElements/FileUpload.d.ts.map +1 -0
- package/build/components/KYCElements/FileUpload.js +268 -0
- package/build/components/KYCElements/FileUpload.js.map +1 -0
- package/build/components/KYCElements/FileUploadTemplate.d.ts +12 -0
- package/build/components/KYCElements/FileUploadTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/FileUploadTemplate.js +331 -0
- package/build/components/KYCElements/FileUploadTemplate.js.map +1 -0
- package/build/components/KYCElements/IDCardCapture.d.ts +19 -0
- package/build/components/KYCElements/IDCardCapture.d.ts.map +1 -0
- package/build/components/KYCElements/IDCardCapture.js +877 -0
- package/build/components/KYCElements/IDCardCapture.js.map +1 -0
- package/build/components/KYCElements/InitializationStep.d.ts +5 -0
- package/build/components/KYCElements/InitializationStep.d.ts.map +1 -0
- package/build/components/KYCElements/InitializationStep.js +41 -0
- package/build/components/KYCElements/InitializationStep.js.map +1 -0
- package/build/components/KYCElements/LocationCaptureTemplate.d.ts +20 -0
- package/build/components/KYCElements/LocationCaptureTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/LocationCaptureTemplate.js +318 -0
- package/build/components/KYCElements/LocationCaptureTemplate.js.map +1 -0
- package/build/components/KYCElements/OrientationVideoCapture.d.ts +14 -0
- package/build/components/KYCElements/OrientationVideoCapture.d.ts.map +1 -0
- package/build/components/KYCElements/OrientationVideoCapture.js +534 -0
- package/build/components/KYCElements/OrientationVideoCapture.js.map +1 -0
- package/build/components/KYCElements/OrientationVideoCaptureEnhanced.d.ts +14 -0
- package/build/components/KYCElements/OrientationVideoCaptureEnhanced.d.ts.map +1 -0
- package/build/components/KYCElements/OrientationVideoCaptureEnhanced.js +504 -0
- package/build/components/KYCElements/OrientationVideoCaptureEnhanced.js.map +1 -0
- package/build/components/KYCElements/OrientationVideoCaptureFinal.d.ts +14 -0
- package/build/components/KYCElements/OrientationVideoCaptureFinal.d.ts.map +1 -0
- package/build/components/KYCElements/OrientationVideoCaptureFinal.js +430 -0
- package/build/components/KYCElements/OrientationVideoCaptureFinal.js.map +1 -0
- package/build/components/KYCElements/PersonalInformationTemplate.d.ts +12 -0
- package/build/components/KYCElements/PersonalInformationTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/PersonalInformationTemplate.js +120 -0
- package/build/components/KYCElements/PersonalInformationTemplate.js.map +1 -0
- package/build/components/KYCElements/PhoneVerificationTemplate.d.ts +12 -0
- package/build/components/KYCElements/PhoneVerificationTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/PhoneVerificationTemplate.js +185 -0
- package/build/components/KYCElements/PhoneVerificationTemplate.js.map +1 -0
- package/build/components/KYCElements/ReviewSubmitTemplate.d.ts +12 -0
- package/build/components/KYCElements/ReviewSubmitTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/ReviewSubmitTemplate.js +171 -0
- package/build/components/KYCElements/ReviewSubmitTemplate.js.map +1 -0
- package/build/components/KYCElements/SelfieCapture.d.ts +11 -0
- package/build/components/KYCElements/SelfieCapture.d.ts.map +1 -0
- package/build/components/KYCElements/SelfieCapture.js +236 -0
- package/build/components/KYCElements/SelfieCapture.js.map +1 -0
- package/build/components/KYCElements/SelfieCaptureTemplate.d.ts +16 -0
- package/build/components/KYCElements/SelfieCaptureTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/SelfieCaptureTemplate.js +568 -0
- package/build/components/KYCElements/SelfieCaptureTemplate.js.map +1 -0
- package/build/components/KYCElements/VerificationProgressTemplate.d.ts +12 -0
- package/build/components/KYCElements/VerificationProgressTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/VerificationProgressTemplate.js +195 -0
- package/build/components/KYCElements/VerificationProgressTemplate.js.map +1 -0
- package/build/components/KYCElements/VerificationStep.d.ts +10 -0
- package/build/components/KYCElements/VerificationStep.d.ts.map +1 -0
- package/build/components/KYCElements/VerificationStep.js +199 -0
- package/build/components/KYCElements/VerificationStep.js.map +1 -0
- package/build/components/KYCElements/WelcomeTemplate.d.ts +12 -0
- package/build/components/KYCElements/WelcomeTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/WelcomeTemplate.js +244 -0
- package/build/components/KYCElements/WelcomeTemplate.js.map +1 -0
- package/build/components/KYCExample.d.ts +3 -0
- package/build/components/KYCExample.d.ts.map +1 -0
- package/build/components/KYCExample.js +247 -0
- package/build/components/KYCExample.js.map +1 -0
- package/build/components/KYCFlow.d.ts +3 -0
- package/build/components/KYCFlow.d.ts.map +1 -0
- package/build/components/KYCFlow.js +308 -0
- package/build/components/KYCFlow.js.map +1 -0
- package/build/components/NativeCameraView.d.ts +11 -0
- package/build/components/NativeCameraView.d.ts.map +1 -0
- package/build/components/NativeCameraView.js +27 -0
- package/build/components/NativeCameraView.js.map +1 -0
- package/build/components/OverLay/IdCard.d.ts +4 -0
- package/build/components/OverLay/IdCard.d.ts.map +1 -0
- package/build/components/OverLay/IdCard.js +185 -0
- package/build/components/OverLay/IdCard.js.map +1 -0
- package/build/components/OverLay/SelfieOverlay.d.ts +4 -0
- package/build/components/OverLay/SelfieOverlay.d.ts.map +1 -0
- package/build/components/OverLay/SelfieOverlay.js +169 -0
- package/build/components/OverLay/SelfieOverlay.js.map +1 -0
- package/build/components/OverLay/StepOverlay.d.ts +9 -0
- package/build/components/OverLay/StepOverlay.d.ts.map +1 -0
- package/build/components/OverLay/StepOverlay.js +53 -0
- package/build/components/OverLay/StepOverlay.js.map +1 -0
- package/build/components/OverLay/type.d.ts +98 -0
- package/build/components/OverLay/type.d.ts.map +1 -0
- package/build/components/OverLay/type.js +2 -0
- package/build/components/OverLay/type.js.map +1 -0
- package/build/components/ProgressIndicator.d.ts +8 -0
- package/build/components/ProgressIndicator.d.ts.map +1 -0
- package/build/components/ProgressIndicator.js +48 -0
- package/build/components/ProgressIndicator.js.map +1 -0
- package/build/components/SelfieCapture.d.ts +3 -0
- package/build/components/SelfieCapture.d.ts.map +1 -0
- package/build/components/SelfieCapture.js +197 -0
- package/build/components/SelfieCapture.js.map +1 -0
- package/build/components/SimpleExample.d.ts +3 -0
- package/build/components/SimpleExample.d.ts.map +1 -0
- package/build/components/SimpleExample.js +89 -0
- package/build/components/SimpleExample.js.map +1 -0
- package/build/components/Svgs/GpsIcon.d.ts +3 -0
- package/build/components/Svgs/GpsIcon.d.ts.map +1 -0
- package/build/components/Svgs/GpsIcon.js +9 -0
- package/build/components/Svgs/GpsIcon.js.map +1 -0
- package/build/components/Svgs/Schield.d.ts +3 -0
- package/build/components/Svgs/Schield.d.ts.map +1 -0
- package/build/components/Svgs/Schield.js +22 -0
- package/build/components/Svgs/Schield.js.map +1 -0
- package/build/components/Svgs/directionArrow.gif +0 -0
- package/build/components/Svgs/frontSelfieIcon.d.ts +3 -0
- package/build/components/Svgs/frontSelfieIcon.d.ts.map +1 -0
- package/build/components/Svgs/frontSelfieIcon.js +11 -0
- package/build/components/Svgs/frontSelfieIcon.js.map +1 -0
- package/build/components/Svgs/scanningLine.d.ts +9 -0
- package/build/components/Svgs/scanningLine.d.ts.map +1 -0
- package/build/components/Svgs/scanningLine.js +61 -0
- package/build/components/Svgs/scanningLine.js.map +1 -0
- package/build/components/Svgs/sideSelfieIcon.d.ts +3 -0
- package/build/components/Svgs/sideSelfieIcon.d.ts.map +1 -0
- package/build/components/Svgs/sideSelfieIcon.js +9 -0
- package/build/components/Svgs/sideSelfieIcon.js.map +1 -0
- package/build/components/TemplateKYCExample.d.ts +22 -0
- package/build/components/TemplateKYCExample.d.ts.map +1 -0
- package/build/components/TemplateKYCExample.js +155 -0
- package/build/components/TemplateKYCExample.js.map +1 -0
- package/build/components/TemplateKYCFlowRefactored.d.ts +26 -0
- package/build/components/TemplateKYCFlowRefactored.d.ts.map +1 -0
- package/build/components/TemplateKYCFlowRefactored.js +359 -0
- package/build/components/TemplateKYCFlowRefactored.js.map +1 -0
- package/build/components/VisionCameraView.d.ts +22 -0
- package/build/components/VisionCameraView.d.ts.map +1 -0
- package/build/components/VisionCameraView.js +142 -0
- package/build/components/VisionCameraView.js.map +1 -0
- package/build/components/example/CameraCaptureEx.d.ts +4 -0
- package/build/components/example/CameraCaptureEx.d.ts.map +1 -0
- package/build/components/example/CameraCaptureEx.js +219 -0
- package/build/components/example/CameraCaptureEx.js.map +1 -0
- package/build/components/example/CameraCaptureExAdvanced.d.ts +3 -0
- package/build/components/example/CameraCaptureExAdvanced.d.ts.map +1 -0
- package/build/components/example/CameraCaptureExAdvanced.js +229 -0
- package/build/components/example/CameraCaptureExAdvanced.js.map +1 -0
- package/build/components/example/CameraCaptureExScan.d.ts +3 -0
- package/build/components/example/CameraCaptureExScan.d.ts.map +1 -0
- package/build/components/example/CameraCaptureExScan.js +213 -0
- package/build/components/example/CameraCaptureExScan.js.map +1 -0
- package/build/components/example/CameraCaptureExSimple.d.ts +3 -0
- package/build/components/example/CameraCaptureExSimple.d.ts.map +1 -0
- package/build/components/example/CameraCaptureExSimple.js +138 -0
- package/build/components/example/CameraCaptureExSimple.js.map +1 -0
- package/build/components/example/DynamicTemplateExample.d.ts +10 -0
- package/build/components/example/DynamicTemplateExample.d.ts.map +1 -0
- package/build/components/example/DynamicTemplateExample.js +241 -0
- package/build/components/example/DynamicTemplateExample.js.map +1 -0
- package/build/components/example/OrientationVideoExample.d.ts +4 -0
- package/build/components/example/OrientationVideoExample.d.ts.map +1 -0
- package/build/components/example/OrientationVideoExample.js +325 -0
- package/build/components/example/OrientationVideoExample.js.map +1 -0
- package/build/components/example/SelfieCaptureEx.d.ts +4 -0
- package/build/components/example/SelfieCaptureEx.d.ts.map +1 -0
- package/build/components/example/SelfieCaptureEx.js +238 -0
- package/build/components/example/SelfieCaptureEx.js.map +1 -0
- package/build/components/ui/Button.d.ts +37 -0
- package/build/components/ui/Button.d.ts.map +1 -0
- package/build/components/ui/Button.js +194 -0
- package/build/components/ui/Button.js.map +1 -0
- package/build/components/ui/ButtonExample.d.ts +4 -0
- package/build/components/ui/ButtonExample.d.ts.map +1 -0
- package/build/components/ui/ButtonExample.js +209 -0
- package/build/components/ui/ButtonExample.js.map +1 -0
- package/build/components/ui/ButtonStyles.d.ts +521 -0
- package/build/components/ui/ButtonStyles.d.ts.map +1 -0
- package/build/components/ui/ButtonStyles.js +429 -0
- package/build/components/ui/ButtonStyles.js.map +1 -0
- package/build/config/KYCConfig.d.ts +14 -0
- package/build/config/KYCConfig.d.ts.map +1 -0
- package/build/config/KYCConfig.js +26 -0
- package/build/config/KYCConfig.js.map +1 -0
- package/build/config/KYCConfigs.d.ts +7 -0
- package/build/config/KYCConfigs.d.ts.map +1 -0
- package/build/config/KYCConfigs.js +516 -0
- package/build/config/KYCConfigs.js.map +1 -0
- package/build/config/allowedDomains.d.ts +30 -0
- package/build/config/allowedDomains.d.ts.map +1 -0
- package/build/config/allowedDomains.js +112 -0
- package/build/config/allowedDomains.js.map +1 -0
- package/build/config/countriesData.d.ts +3 -0
- package/build/config/countriesData.d.ts.map +1 -0
- package/build/config/countriesData.js +80 -0
- package/build/config/countriesData.js.map +1 -0
- package/build/config/region_mapping.d.ts +3 -0
- package/build/config/region_mapping.d.ts.map +1 -0
- package/build/config/region_mapping.js +736 -0
- package/build/config/region_mapping.js.map +1 -0
- package/build/hooks/useI18n.d.ts +11 -0
- package/build/hooks/useI18n.d.ts.map +1 -0
- package/build/hooks/useI18n.js +37 -0
- package/build/hooks/useI18n.js.map +1 -0
- package/build/hooks/useKYC.d.ts +15 -0
- package/build/hooks/useKYC.d.ts.map +1 -0
- package/build/hooks/useKYC.js +103 -0
- package/build/hooks/useKYC.js.map +1 -0
- package/build/hooks/useKYCFlow.d.ts +3 -0
- package/build/hooks/useKYCFlow.d.ts.map +1 -0
- package/build/hooks/useKYCFlow.js +221 -0
- package/build/hooks/useKYCFlow.js.map +1 -0
- package/build/hooks/useLocation.d.ts +32 -0
- package/build/hooks/useLocation.d.ts.map +1 -0
- package/build/hooks/useLocation.js +165 -0
- package/build/hooks/useLocation.js.map +1 -0
- package/build/hooks/useOrientationVideo.d.ts +10 -0
- package/build/hooks/useOrientationVideo.d.ts.map +1 -0
- package/build/hooks/useOrientationVideo.js +118 -0
- package/build/hooks/useOrientationVideo.js.map +1 -0
- package/build/hooks/useRealtimeVerifier.d.ts +28 -0
- package/build/hooks/useRealtimeVerifier.d.ts.map +1 -0
- package/build/hooks/useRealtimeVerifier.js +91 -0
- package/build/hooks/useRealtimeVerifier.js.map +1 -0
- package/build/hooks/useTemplateKYCFlow.d.ts +48 -0
- package/build/hooks/useTemplateKYCFlow.d.ts.map +1 -0
- package/build/hooks/useTemplateKYCFlow.js +910 -0
- package/build/hooks/useTemplateKYCFlow.js.map +1 -0
- package/build/hooks/useTemplateLoader.d.ts +14 -0
- package/build/hooks/useTemplateLoader.d.ts.map +1 -0
- package/build/hooks/useTemplateLoader.js +85 -0
- package/build/hooks/useTemplateLoader.js.map +1 -0
- package/build/i18n/en/index.d.ts +233 -0
- package/build/i18n/en/index.d.ts.map +1 -0
- package/build/i18n/en/index.js +261 -0
- package/build/i18n/en/index.js.map +1 -0
- package/build/i18n/fr/index.d.ts +219 -0
- package/build/i18n/fr/index.d.ts.map +1 -0
- package/build/i18n/fr/index.js +246 -0
- package/build/i18n/fr/index.js.map +1 -0
- package/build/i18n/index.d.ts +10 -0
- package/build/i18n/index.d.ts.map +1 -0
- package/build/i18n/index.js +56 -0
- package/build/i18n/index.js.map +1 -0
- package/build/i18n/types.d.ts +162 -0
- package/build/i18n/types.d.ts.map +1 -0
- package/build/i18n/types.js +3 -0
- package/build/i18n/types.js.map +1 -0
- package/build/i18n/usage-example.d.ts +4 -0
- package/build/i18n/usage-example.d.ts.map +1 -0
- package/build/i18n/usage-example.js +189 -0
- package/build/i18n/usage-example.js.map +1 -0
- package/build/index.d.ts +11 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +17 -0
- package/build/index.js.map +1 -0
- package/build/modules/api/CardAuthentification.d.ts +72 -0
- package/build/modules/api/CardAuthentification.d.ts.map +1 -0
- package/build/modules/api/CardAuthentification.js +487 -0
- package/build/modules/api/CardAuthentification.js.map +1 -0
- package/build/modules/api/KYCService.d.ts +116 -0
- package/build/modules/api/KYCService.d.ts.map +1 -0
- package/build/modules/api/KYCService.js +526 -0
- package/build/modules/api/KYCService.js.map +1 -0
- package/build/modules/api/SelfieVerification.d.ts +5 -0
- package/build/modules/api/SelfieVerification.d.ts.map +1 -0
- package/build/modules/api/SelfieVerification.js +25 -0
- package/build/modules/api/SelfieVerification.js.map +1 -0
- package/build/modules/api/TemplateService.d.ts +44 -0
- package/build/modules/api/TemplateService.d.ts.map +1 -0
- package/build/modules/api/TemplateService.js +146 -0
- package/build/modules/api/TemplateService.js.map +1 -0
- package/build/modules/api/backendApi.d.ts +2 -0
- package/build/modules/api/backendApi.d.ts.map +1 -0
- package/build/modules/api/backendApi.js +6 -0
- package/build/modules/api/backendApi.js.map +1 -0
- package/build/modules/api/types.d.ts +53 -0
- package/build/modules/api/types.d.ts.map +1 -0
- package/build/modules/api/types.js +2 -0
- package/build/modules/api/types.js.map +1 -0
- package/build/modules/camera/NativeCameraModule.d.ts +52 -0
- package/build/modules/camera/NativeCameraModule.d.ts.map +1 -0
- package/build/modules/camera/NativeCameraModule.js +149 -0
- package/build/modules/camera/NativeCameraModule.js.map +1 -0
- package/build/modules/camera/UnifiedCameraModule.d.ts +70 -0
- package/build/modules/camera/UnifiedCameraModule.d.ts.map +1 -0
- package/build/modules/camera/UnifiedCameraModule.js +125 -0
- package/build/modules/camera/UnifiedCameraModule.js.map +1 -0
- package/build/modules/camera/VisionCameraModule.d.ts +62 -0
- package/build/modules/camera/VisionCameraModule.d.ts.map +1 -0
- package/build/modules/camera/VisionCameraModule.js +313 -0
- package/build/modules/camera/VisionCameraModule.js.map +1 -0
- package/build/modules/camera/VisionCameraModule.web.d.ts +145 -0
- package/build/modules/camera/VisionCameraModule.web.d.ts.map +1 -0
- package/build/modules/camera/VisionCameraModule.web.js +589 -0
- package/build/modules/camera/VisionCameraModule.web.js.map +1 -0
- package/build/modules/camera/index.d.ts +5 -0
- package/build/modules/camera/index.d.ts.map +1 -0
- package/build/modules/camera/index.js +4 -0
- package/build/modules/camera/index.js.map +1 -0
- package/build/stores/kycStore.d.ts +55 -0
- package/build/stores/kycStore.d.ts.map +1 -0
- package/build/stores/kycStore.js +98 -0
- package/build/stores/kycStore.js.map +1 -0
- package/build/types/KYC.types.d.ts +643 -0
- package/build/types/KYC.types.d.ts.map +1 -0
- package/build/types/KYC.types.js +25 -0
- package/build/types/KYC.types.js.map +1 -0
- package/build/types/env.types.d.ts +13 -0
- package/build/types/env.types.d.ts.map +1 -0
- package/build/types/env.types.js +2 -0
- package/build/types/env.types.js.map +1 -0
- package/build/utils/cropByObb.d.ts +37 -0
- package/build/utils/cropByObb.d.ts.map +1 -0
- package/build/utils/cropByObb.js +215 -0
- package/build/utils/cropByObb.js.map +1 -0
- package/build/utils/deviceDetection.d.ts +6 -0
- package/build/utils/deviceDetection.d.ts.map +1 -0
- package/build/utils/deviceDetection.js +12 -0
- package/build/utils/deviceDetection.js.map +1 -0
- package/build/utils/get-document-type-info.d.ts +13 -0
- package/build/utils/get-document-type-info.d.ts.map +1 -0
- package/build/utils/get-document-type-info.js +59 -0
- package/build/utils/get-document-type-info.js.map +1 -0
- package/build/utils/logger.d.ts +12 -0
- package/build/utils/logger.d.ts.map +1 -0
- package/build/utils/logger.js +45 -0
- package/build/utils/logger.js.map +1 -0
- package/build/utils/pathToBase64.d.ts +3 -0
- package/build/utils/pathToBase64.d.ts.map +1 -0
- package/build/utils/pathToBase64.js +65 -0
- package/build/utils/pathToBase64.js.map +1 -0
- package/build/utils/platformAlert.d.ts +20 -0
- package/build/utils/platformAlert.d.ts.map +1 -0
- package/build/utils/platformAlert.js +67 -0
- package/build/utils/platformAlert.js.map +1 -0
- package/build/utils/remove-duplicate.d.ts +2 -0
- package/build/utils/remove-duplicate.d.ts.map +1 -0
- package/build/utils/remove-duplicate.js +4 -0
- package/build/utils/remove-duplicate.js.map +1 -0
- package/build/utils/template-transformer.d.ts +10 -0
- package/build/utils/template-transformer.d.ts.map +1 -0
- package/build/utils/template-transformer.js +365 -0
- package/build/utils/template-transformer.js.map +1 -0
- package/build/web/WebKYCEntry.d.ts +9 -0
- package/build/web/WebKYCEntry.d.ts.map +1 -0
- package/build/web/WebKYCEntry.js +288 -0
- package/build/web/WebKYCEntry.js.map +1 -0
- package/build/web/index.d.ts +2 -0
- package/build/web/index.d.ts.map +1 -0
- package/build/web/index.js +2 -0
- package/build/web/index.js.map +1 -0
- package/expo-module.config.json +9 -0
- package/ios/TransfergratisSdk.podspec +31 -0
- package/ios/TransfergratisSdkModule.swift +409 -0
- package/package.json +71 -0
- package/plugin/build/index.d.ts +5 -0
- package/plugin/build/index.js +12 -0
- package/plugin/build/withLocation.d.ts +9 -0
- package/plugin/build/withLocation.js +77 -0
- package/plugin/build/withRemovePermissions.d.ts +3 -0
- package/plugin/build/withRemovePermissions.js +67 -0
- package/plugin/build/withVisionCamera.d.ts +8 -0
- package/plugin/build/withVisionCamera.js +68 -0
- package/plugin/src/index.ts +5 -0
- package/plugin/src/withLocation.ts +109 -0
- package/plugin/src/withRemovePermissions.js +85 -0
- package/plugin/src/withRemovePermissions.ts +83 -0
- package/plugin/src/withVisionCamera.js +88 -0
- package/plugin/src/withVisionCamera.ts +97 -0
- package/plugin/tsconfig.json +17 -0
- package/plugin/tsconfig.tsbuildinfo +1 -0
- package/plugin.js +19 -0
- package/src/App.tsx +9 -0
- package/src/TransfergratisSdk.types.ts +30 -0
- package/src/TransfergratisSdkModule.ts +16 -0
- package/src/TransfergratisSdkModule.web.ts +31 -0
- package/src/TransfergratisSdkView.tsx +11 -0
- package/src/TransfergratisSdkView.web.tsx +15 -0
- package/src/api/axios.ts +144 -0
- package/src/components/Camera/index.tsx +0 -0
- package/src/components/Camera/index.web.tsx +0 -0
- package/src/components/Camera/types.ts +0 -0
- package/src/components/ConfigurableKYCFlow.tsx +334 -0
- package/src/components/CustomCameraExample.tsx +274 -0
- package/src/components/EnhancedCameraView.tsx +482 -0
- package/src/components/EnhancedCameraView.web.tsx +597 -0
- package/src/components/FileUpload.tsx +249 -0
- package/src/components/KYCElementRenderer.tsx +106 -0
- package/src/components/KYCElements/AdditionalDocumentsTemplate.tsx +346 -0
- package/src/components/KYCElements/CameraCapture.tsx +268 -0
- package/src/components/KYCElements/CompletionStep.tsx +161 -0
- package/src/components/KYCElements/CountrySelection.tsx +177 -0
- package/src/components/KYCElements/CountrySelectionTemplate.tsx +526 -0
- package/src/components/KYCElements/DocumentTypeSelection.tsx +173 -0
- package/src/components/KYCElements/EmailVerificationTemplate.tsx +278 -0
- package/src/components/KYCElements/FileUpload.tsx +318 -0
- package/src/components/KYCElements/FileUploadTemplate.tsx +395 -0
- package/src/components/KYCElements/IDCardCapture.tsx +1053 -0
- package/src/components/KYCElements/InitializationStep.tsx +53 -0
- package/src/components/KYCElements/LocationCaptureTemplate.tsx +378 -0
- package/src/components/KYCElements/OrientationVideoCapture.tsx +649 -0
- package/src/components/KYCElements/OrientationVideoCaptureEnhanced.tsx +616 -0
- package/src/components/KYCElements/OrientationVideoCaptureFinal.tsx +534 -0
- package/src/components/KYCElements/PersonalInformationTemplate.tsx +158 -0
- package/src/components/KYCElements/PhoneVerificationTemplate.tsx +253 -0
- package/src/components/KYCElements/ReviewSubmitTemplate.tsx +201 -0
- package/src/components/KYCElements/SelfieCapture.tsx +284 -0
- package/src/components/KYCElements/SelfieCaptureTemplate.tsx +662 -0
- package/src/components/KYCElements/VerificationProgressTemplate.tsx +247 -0
- package/src/components/KYCElements/VerificationStep.tsx +234 -0
- package/src/components/KYCElements/WelcomeTemplate.tsx +290 -0
- package/src/components/KYCExample.tsx +297 -0
- package/src/components/KYCFlow.tsx +377 -0
- package/src/components/NativeCameraView.tsx +47 -0
- package/src/components/OverLay/IdCard.tsx +277 -0
- package/src/components/OverLay/SelfieOverlay.tsx +211 -0
- package/src/components/OverLay/StepOverlay.tsx +64 -0
- package/src/components/OverLay/type.ts +91 -0
- package/src/components/ProgressIndicator.tsx +62 -0
- package/src/components/SelfieCapture.tsx +244 -0
- package/src/components/SimpleExample.tsx +92 -0
- package/src/components/Svgs/GpsIcon.tsx +12 -0
- package/src/components/Svgs/Schield.tsx +26 -0
- package/src/components/Svgs/directionArrow.gif +0 -0
- package/src/components/Svgs/frontSelfieIcon.tsx +13 -0
- package/src/components/Svgs/scanningLine.tsx +88 -0
- package/src/components/Svgs/sideSelfieIcon.tsx +10 -0
- package/src/components/TemplateKYCExample.tsx +194 -0
- package/src/components/TemplateKYCFlowRefactored.tsx +473 -0
- package/src/components/VisionCameraView.tsx +197 -0
- package/src/components/example/CameraCaptureEx.tsx +335 -0
- package/src/components/example/CameraCaptureExAdvanced.tsx +357 -0
- package/src/components/example/CameraCaptureExScan.tsx +336 -0
- package/src/components/example/CameraCaptureExSimple.tsx +215 -0
- package/src/components/example/DynamicTemplateExample.tsx +289 -0
- package/src/components/example/OrientationVideoExample.tsx +380 -0
- package/src/components/example/SelfieCaptureEx.tsx +358 -0
- package/src/components/ui/Button.tsx +328 -0
- package/src/components/ui/ButtonExample.tsx +318 -0
- package/src/components/ui/ButtonStyles.ts +465 -0
- package/src/config/KYCConfig.ts +34 -0
- package/src/config/KYCConfigs.ts +528 -0
- package/src/config/allowedDomains.ts +133 -0
- package/src/config/countriesData.ts +85 -0
- package/src/config/region_mapping.json +735 -0
- package/src/config/region_mapping.ts +737 -0
- package/src/hooks/useI18n.ts +53 -0
- package/src/hooks/useKYC.ts +131 -0
- package/src/hooks/useKYCFlow.ts +248 -0
- package/src/hooks/useLocation.ts +221 -0
- package/src/hooks/useOrientationVideo.ts +149 -0
- package/src/hooks/useRealtimeVerifier.ts +128 -0
- package/src/hooks/useTemplateKYCFlow.tsx +1051 -0
- package/src/hooks/useTemplateLoader.ts +102 -0
- package/src/i18n/README.md +288 -0
- package/src/i18n/en/index.ts +275 -0
- package/src/i18n/fr/index.ts +260 -0
- package/src/i18n/index.ts +65 -0
- package/src/i18n/types.ts +182 -0
- package/src/i18n/usage-example.tsx +202 -0
- package/src/index.ts +25 -0
- package/src/modules/api/CardAuthentification.ts +589 -0
- package/src/modules/api/KYCService.ts +666 -0
- package/src/modules/api/SelfieVerification.ts +33 -0
- package/src/modules/api/TemplateService.ts +168 -0
- package/src/modules/api/backendApi.ts +8 -0
- package/src/modules/api/types.ts +59 -0
- package/src/modules/camera/NativeCameraModule.ts +170 -0
- package/src/modules/camera/UnifiedCameraModule.ts +160 -0
- package/src/modules/camera/VisionCameraModule.ts +334 -0
- package/src/modules/camera/VisionCameraModule.web.ts +679 -0
- package/src/modules/camera/index.ts +6 -0
- package/src/stores/kycStore.ts +161 -0
- package/src/types/KYC.types.ts +837 -0
- package/src/types/env.types.ts +13 -0
- package/src/utils/cropByObb.ts +254 -0
- package/src/utils/deviceDetection.ts +11 -0
- package/src/utils/get-document-type-info.ts +62 -0
- package/src/utils/logger.ts +48 -0
- package/src/utils/pathToBase64.ts +63 -0
- package/src/utils/platformAlert.ts +86 -0
- package/src/utils/remove-duplicate.ts +3 -0
- package/src/utils/template-transformer.ts +445 -0
- package/src/web/WebKYCEntry.tsx +375 -0
- package/src/web/index.ts +1 -0
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { View, StyleSheet, TouchableOpacity, Text, Platform } from 'react-native';
|
|
3
|
+
import { useI18n } from '../hooks/useI18n';
|
|
4
|
+
export const EnhancedCameraView = ({ instructions = 'Position yourself in the frame and tap the capture button', showCamera, cameraType: initialCameraType = 'front', style, onCapture, onError, onClose, enableFlash = false, enableHdr = false, quality = 'high', showCaptureButton = true, showSwitchCamera = true, overlayComponent, bbox, canFlip = true, enableVideo = false, isRecording = false, onVideoRecordingStart, onVideoRecordingStop, videoDuration = 10, onSilentCapture, silentCaptureResult, captureStabilizationDelayMs = 2500, }) => {
|
|
5
|
+
const { t } = useI18n();
|
|
6
|
+
// Vérification de plateforme - ce composant est uniquement pour le web
|
|
7
|
+
if (Platform.OS !== 'web') {
|
|
8
|
+
console.warn('EnhancedCameraView.web.tsx should only be used on web platform');
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
const videoRef = useRef(null);
|
|
12
|
+
const canvasRef = useRef(null);
|
|
13
|
+
const [cameraType, setCameraType] = useState(initialCameraType);
|
|
14
|
+
const [hasPermission, setHasPermission] = useState(false);
|
|
15
|
+
const [isInitialized, setIsInitialized] = useState(false);
|
|
16
|
+
const [flash, setFlash] = useState('off');
|
|
17
|
+
const [stream, setStream] = useState(null);
|
|
18
|
+
const [isRecordingVideo, setIsRecordingVideo] = useState(false);
|
|
19
|
+
const [mediaRecorder, setMediaRecorder] = useState(null);
|
|
20
|
+
const [recordedChunks, setRecordedChunks] = useState([]);
|
|
21
|
+
console.log('cameraType', cameraType, recordedChunks);
|
|
22
|
+
// Check permissions on component mount
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (showCamera) {
|
|
25
|
+
checkPermissions();
|
|
26
|
+
}
|
|
27
|
+
}, [showCamera]);
|
|
28
|
+
// Cleanup stream on unmount
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
return () => {
|
|
31
|
+
if (stream) {
|
|
32
|
+
stream.getTracks().forEach(track => track.stop());
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}, [stream]);
|
|
36
|
+
// Build video constraints for quality (min + ideal improve Android/Samsung web quality; higher ideal for documents)
|
|
37
|
+
const getVideoConstraints = useCallback(() => {
|
|
38
|
+
const isHigh = quality === 'high';
|
|
39
|
+
const isMedium = quality === 'medium';
|
|
40
|
+
return {
|
|
41
|
+
facingMode: cameraType === 'front' ? 'user' : 'environment',
|
|
42
|
+
// min forces Android Chrome to use at least this resolution (avoids 640x480 default)
|
|
43
|
+
width: {
|
|
44
|
+
min: isHigh ? 1280 : isMedium ? 960 : 640,
|
|
45
|
+
ideal: isHigh ? 2560 : isMedium ? 1280 : 640,
|
|
46
|
+
},
|
|
47
|
+
height: {
|
|
48
|
+
min: isHigh ? 720 : isMedium ? 540 : 480,
|
|
49
|
+
ideal: isHigh ? 1440 : isMedium ? 720 : 480,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
}, [cameraType, quality]);
|
|
53
|
+
const checkPermissions = async () => {
|
|
54
|
+
try {
|
|
55
|
+
if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {
|
|
56
|
+
onError?.({ message: 'Camera not supported in this browser' });
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
// Use same constraints as startCamera so Android Chrome doesn't cache low resolution (e.g. 640x480)
|
|
60
|
+
const stream = await navigator.mediaDevices.getUserMedia({
|
|
61
|
+
video: getVideoConstraints(),
|
|
62
|
+
audio: enableVideo,
|
|
63
|
+
});
|
|
64
|
+
stream.getTracks().forEach(track => track.stop());
|
|
65
|
+
setHasPermission(true);
|
|
66
|
+
await startCamera();
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
console.error('Error checking permissions:', error);
|
|
70
|
+
onError?.({ message: 'Camera permissions not granted' });
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
const startCamera = async () => {
|
|
74
|
+
try {
|
|
75
|
+
if (stream) {
|
|
76
|
+
stream.getTracks().forEach(track => track.stop());
|
|
77
|
+
}
|
|
78
|
+
const constraints = {
|
|
79
|
+
video: getVideoConstraints(),
|
|
80
|
+
audio: enableVideo,
|
|
81
|
+
};
|
|
82
|
+
let newStream;
|
|
83
|
+
try {
|
|
84
|
+
newStream = await navigator.mediaDevices.getUserMedia(constraints);
|
|
85
|
+
}
|
|
86
|
+
catch (err) {
|
|
87
|
+
const name = err instanceof Error ? err.name : '';
|
|
88
|
+
// On some Android devices, min constraints can fail; fallback to ideal only
|
|
89
|
+
if (name === 'OverconstrainedError') {
|
|
90
|
+
const fallbackConstraints = {
|
|
91
|
+
video: {
|
|
92
|
+
facingMode: cameraType === 'front' ? 'user' : 'environment',
|
|
93
|
+
width: { ideal: quality === 'high' ? 2560 : quality === 'medium' ? 1280 : 640 },
|
|
94
|
+
height: { ideal: quality === 'high' ? 1440 : quality === 'medium' ? 720 : 480 },
|
|
95
|
+
},
|
|
96
|
+
audio: enableVideo,
|
|
97
|
+
};
|
|
98
|
+
newStream = await navigator.mediaDevices.getUserMedia(fallbackConstraints);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
throw err;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
setStream(newStream);
|
|
105
|
+
if (videoRef.current) {
|
|
106
|
+
videoRef.current.srcObject = newStream;
|
|
107
|
+
videoRef.current.onloadedmetadata = () => {
|
|
108
|
+
setIsInitialized(true);
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
console.error('Error starting camera:', error);
|
|
114
|
+
onError?.({ message: 'Failed to start camera' });
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
const onInitialized = useCallback(() => {
|
|
118
|
+
console.log('Camera initialized!');
|
|
119
|
+
setIsInitialized(true);
|
|
120
|
+
}, []);
|
|
121
|
+
const onCameraError = useCallback((error) => {
|
|
122
|
+
console.error('Camera error:', error);
|
|
123
|
+
onError?.({ message: error.message || 'Camera error occurred' });
|
|
124
|
+
}, [onError]);
|
|
125
|
+
console.log('isInitialized', onInitialized, onCameraError);
|
|
126
|
+
const capturePhoto = useCallback(async () => {
|
|
127
|
+
try {
|
|
128
|
+
onCapture && onCapture({
|
|
129
|
+
success: true
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
console.error('Error taking photo:', error);
|
|
134
|
+
onCapture?.({
|
|
135
|
+
success: false,
|
|
136
|
+
error: error instanceof Error ? error.message : 'Failed to capture photo',
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}, [isInitialized, onCapture, onError]);
|
|
140
|
+
const captureSilentPhoto = useCallback(async () => {
|
|
141
|
+
try {
|
|
142
|
+
if (!videoRef.current || !canvasRef.current || !isInitialized) {
|
|
143
|
+
onError?.({ message: 'Camera not ready' });
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
const video = videoRef.current;
|
|
147
|
+
const canvas = canvasRef.current;
|
|
148
|
+
const context = canvas.getContext('2d');
|
|
149
|
+
if (!context) {
|
|
150
|
+
onError?.({ message: 'Canvas context not available' });
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
// Set canvas dimensions to match video
|
|
154
|
+
canvas.width = video.videoWidth;
|
|
155
|
+
canvas.height = video.videoHeight;
|
|
156
|
+
// For front camera: draw flipped so captured image matches non-mirrored preview (no mirror confusion)
|
|
157
|
+
if (cameraType === 'front') {
|
|
158
|
+
context.save();
|
|
159
|
+
context.translate(canvas.width, 0);
|
|
160
|
+
context.scale(-1, 1);
|
|
161
|
+
context.drawImage(video, 0, 0);
|
|
162
|
+
context.restore();
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
context.drawImage(video, 0, 0);
|
|
166
|
+
}
|
|
167
|
+
// Convert to base64 (0.95 for document/ID capture clarity; backend can exploit text better)
|
|
168
|
+
const imageDataUrl = canvas.toDataURL('image/jpeg', 0.95);
|
|
169
|
+
onSilentCapture?.({
|
|
170
|
+
success: true,
|
|
171
|
+
path: imageDataUrl,
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
catch (error) {
|
|
175
|
+
console.error('Error taking photo:', error);
|
|
176
|
+
onCapture?.({
|
|
177
|
+
success: false,
|
|
178
|
+
error: error instanceof Error ? error.message : 'Failed to capture photo',
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}, [isInitialized, cameraType, onError, onSilentCapture]);
|
|
182
|
+
// Stabilization delay then auto-capture every 5s; stop as soon as capture is validated (no more new captures)
|
|
183
|
+
useEffect(() => {
|
|
184
|
+
if (!showCamera || !isInitialized || silentCaptureResult?.success) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
const delayMs = Math.max(0, captureStabilizationDelayMs);
|
|
188
|
+
const intervalMs = 5000;
|
|
189
|
+
let intervalId = null;
|
|
190
|
+
const timeoutId = setTimeout(() => {
|
|
191
|
+
captureSilentPhoto();
|
|
192
|
+
intervalId = setInterval(captureSilentPhoto, intervalMs);
|
|
193
|
+
}, delayMs);
|
|
194
|
+
return () => {
|
|
195
|
+
clearTimeout(timeoutId);
|
|
196
|
+
if (intervalId)
|
|
197
|
+
clearInterval(intervalId);
|
|
198
|
+
};
|
|
199
|
+
}, [showCamera, isInitialized, captureStabilizationDelayMs, captureSilentPhoto, silentCaptureResult?.success]);
|
|
200
|
+
const startVideoRecording = useCallback(async () => {
|
|
201
|
+
try {
|
|
202
|
+
if (!stream || !isInitialized) {
|
|
203
|
+
onError?.({ message: 'Camera not ready' });
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
const chunks = [];
|
|
207
|
+
setRecordedChunks(chunks);
|
|
208
|
+
const recorder = new MediaRecorder(stream, {
|
|
209
|
+
mimeType: 'video/webm;codecs=vp9',
|
|
210
|
+
});
|
|
211
|
+
recorder.ondataavailable = (event) => {
|
|
212
|
+
if (event.data.size > 0) {
|
|
213
|
+
chunks.push(event.data);
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
recorder.onstop = () => {
|
|
217
|
+
const blob = new Blob(chunks, { type: 'video/webm' });
|
|
218
|
+
const url = URL.createObjectURL(blob);
|
|
219
|
+
onVideoRecordingStop?.({
|
|
220
|
+
success: true,
|
|
221
|
+
path: url,
|
|
222
|
+
});
|
|
223
|
+
setRecordedChunks([]);
|
|
224
|
+
setIsRecordingVideo(false);
|
|
225
|
+
};
|
|
226
|
+
recorder.onerror = (event) => {
|
|
227
|
+
console.error('Recording error:', event);
|
|
228
|
+
onVideoRecordingStop?.({
|
|
229
|
+
success: false,
|
|
230
|
+
error: 'Failed to record video',
|
|
231
|
+
});
|
|
232
|
+
setIsRecordingVideo(false);
|
|
233
|
+
};
|
|
234
|
+
setMediaRecorder(recorder);
|
|
235
|
+
recorder.start();
|
|
236
|
+
setIsRecordingVideo(true);
|
|
237
|
+
onVideoRecordingStart?.();
|
|
238
|
+
// Auto-stop after videoDuration seconds
|
|
239
|
+
setTimeout(() => {
|
|
240
|
+
if (recorder.state === 'recording') {
|
|
241
|
+
recorder.stop();
|
|
242
|
+
}
|
|
243
|
+
}, videoDuration * 1000);
|
|
244
|
+
}
|
|
245
|
+
catch (error) {
|
|
246
|
+
console.error('Error starting video recording:', error);
|
|
247
|
+
onVideoRecordingStop?.({
|
|
248
|
+
success: false,
|
|
249
|
+
error: error instanceof Error ? error.message : 'Failed to start video recording',
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
}, [isInitialized, stream, videoDuration, onVideoRecordingStart, onVideoRecordingStop, onError]);
|
|
253
|
+
const stopVideoRecording = useCallback(async () => {
|
|
254
|
+
try {
|
|
255
|
+
if (mediaRecorder && mediaRecorder.state === 'recording') {
|
|
256
|
+
mediaRecorder.stop();
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
catch (error) {
|
|
260
|
+
console.error('Error stopping video recording:', error);
|
|
261
|
+
onError?.({ message: 'Failed to stop video recording' });
|
|
262
|
+
}
|
|
263
|
+
}, [mediaRecorder, onError]);
|
|
264
|
+
const switchCamera = useCallback(async () => {
|
|
265
|
+
setCameraType(current => current === 'front' ? 'back' : 'front');
|
|
266
|
+
// Restart camera with new facing mode
|
|
267
|
+
await startCamera();
|
|
268
|
+
}, [cameraType]);
|
|
269
|
+
const toggleFlash = useCallback(() => {
|
|
270
|
+
setFlash(current => {
|
|
271
|
+
switch (current) {
|
|
272
|
+
case 'off': return 'on';
|
|
273
|
+
case 'on': return 'auto';
|
|
274
|
+
case 'auto': return 'off';
|
|
275
|
+
default: return 'off';
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
}, []);
|
|
279
|
+
if (!hasPermission) {
|
|
280
|
+
return (<View style={[styles.container, style]}>
|
|
281
|
+
<Text style={styles.permissionMessage}>
|
|
282
|
+
Camera permission required. Please grant permission to continue.
|
|
283
|
+
</Text>
|
|
284
|
+
</View>);
|
|
285
|
+
}
|
|
286
|
+
if (!showCamera) {
|
|
287
|
+
return <View style={[styles.container, style]}/>;
|
|
288
|
+
}
|
|
289
|
+
return (<View style={[styles.container, style]}>
|
|
290
|
+
{/* Video element; no mirror for front camera so preview matches final photo and doesn't confuse users */}
|
|
291
|
+
<video ref={videoRef} style={{
|
|
292
|
+
position: 'absolute',
|
|
293
|
+
width: '100%',
|
|
294
|
+
height: '100%',
|
|
295
|
+
objectFit: 'cover',
|
|
296
|
+
transform: cameraType === 'front' ? 'scaleX(-1)' : undefined,
|
|
297
|
+
}} autoPlay playsInline muted/>
|
|
298
|
+
|
|
299
|
+
{/* Hidden canvas for photo capture */}
|
|
300
|
+
<canvas ref={canvasRef} style={{
|
|
301
|
+
position: 'absolute',
|
|
302
|
+
left: '-9999px',
|
|
303
|
+
top: '-9999px',
|
|
304
|
+
}}/>
|
|
305
|
+
|
|
306
|
+
{/* Instructions */}
|
|
307
|
+
{/* {instructions && (
|
|
308
|
+
<View style={styles.instructionsOverlay}>
|
|
309
|
+
<Text style={styles.instructions}>{instructions}</Text>
|
|
310
|
+
</View>
|
|
311
|
+
)} */}
|
|
312
|
+
|
|
313
|
+
{/* Custom overlay component */}
|
|
314
|
+
{overlayComponent}
|
|
315
|
+
|
|
316
|
+
{/* Bounding box overlay */}
|
|
317
|
+
{bbox && (<View style={styles.bboxOverlay}>
|
|
318
|
+
<View style={[
|
|
319
|
+
styles.bbox,
|
|
320
|
+
{
|
|
321
|
+
left: `${bbox.xMin}%`,
|
|
322
|
+
top: `${bbox.yMin}%`,
|
|
323
|
+
width: `${bbox.xMax - bbox.xMin}%`,
|
|
324
|
+
height: `${bbox.yMax - bbox.yMin}%`,
|
|
325
|
+
borderColor: bbox.borderColor || '#2DBD60',
|
|
326
|
+
borderWidth: bbox.borderWidth || 3,
|
|
327
|
+
borderRadius: bbox.cornerRadius || 8,
|
|
328
|
+
}
|
|
329
|
+
]}/>
|
|
330
|
+
</View>)}
|
|
331
|
+
|
|
332
|
+
{/* Analyzing indicator - Same as mobile */}
|
|
333
|
+
{silentCaptureResult?.isAnalyzing && (<View style={styles.analyzingContainer}>
|
|
334
|
+
<Text style={styles.analyzingText}>{t('camera.analyzing')}</Text>
|
|
335
|
+
</View>)}
|
|
336
|
+
|
|
337
|
+
{/* Camera controls */}
|
|
338
|
+
<View style={styles.controlsContainer}>
|
|
339
|
+
{/* Flash button */}
|
|
340
|
+
{enableFlash && (<TouchableOpacity style={styles.controlButton} onPress={toggleFlash}>
|
|
341
|
+
<Text style={styles.controlButtonText}>
|
|
342
|
+
{flash === 'off' ? '⚡' : flash === 'on' ? '⚡️' : '✨'}
|
|
343
|
+
</Text>
|
|
344
|
+
</TouchableOpacity>)}
|
|
345
|
+
|
|
346
|
+
{/* Capture button */}
|
|
347
|
+
{showCaptureButton && !enableVideo && silentCaptureResult?.success && (<TouchableOpacity style={styles.captureButton} onPress={capturePhoto} disabled={!isInitialized}>
|
|
348
|
+
<View style={[
|
|
349
|
+
styles.captureButtonInner,
|
|
350
|
+
!isInitialized && styles.captureButtonDisabled
|
|
351
|
+
]}/>
|
|
352
|
+
</TouchableOpacity>)}
|
|
353
|
+
|
|
354
|
+
{/* Video recording button */}
|
|
355
|
+
{showCaptureButton && enableVideo && (<TouchableOpacity style={[
|
|
356
|
+
styles.captureButton,
|
|
357
|
+
isRecordingVideo && styles.recordingButton
|
|
358
|
+
]} onPress={isRecordingVideo ? stopVideoRecording : startVideoRecording} disabled={!isInitialized}>
|
|
359
|
+
<View style={[
|
|
360
|
+
styles.captureButtonInner,
|
|
361
|
+
!isInitialized && styles.captureButtonDisabled,
|
|
362
|
+
isRecordingVideo && styles.recordingButtonInner
|
|
363
|
+
]}/>
|
|
364
|
+
</TouchableOpacity>)}
|
|
365
|
+
|
|
366
|
+
{/* Switch camera button */}
|
|
367
|
+
{showSwitchCamera && canFlip && (<TouchableOpacity style={styles.controlButton} onPress={switchCamera}>
|
|
368
|
+
<Text style={styles.controlButtonText}>🔄</Text>
|
|
369
|
+
</TouchableOpacity>)}
|
|
370
|
+
</View>
|
|
371
|
+
</View>);
|
|
372
|
+
};
|
|
373
|
+
const styles = StyleSheet.create({
|
|
374
|
+
container: {
|
|
375
|
+
flex: 1,
|
|
376
|
+
backgroundColor: 'black',
|
|
377
|
+
},
|
|
378
|
+
instructionsOverlay: {
|
|
379
|
+
position: 'absolute',
|
|
380
|
+
top: 60,
|
|
381
|
+
left: 20,
|
|
382
|
+
right: 20,
|
|
383
|
+
backgroundColor: 'rgba(0, 0, 0, 0.7)',
|
|
384
|
+
padding: 15,
|
|
385
|
+
borderRadius: 10,
|
|
386
|
+
zIndex: 1,
|
|
387
|
+
},
|
|
388
|
+
instructions: {
|
|
389
|
+
color: 'white',
|
|
390
|
+
fontSize: 16,
|
|
391
|
+
textAlign: 'center',
|
|
392
|
+
fontWeight: '500',
|
|
393
|
+
},
|
|
394
|
+
closeButton: {
|
|
395
|
+
position: 'absolute',
|
|
396
|
+
top: 50,
|
|
397
|
+
right: 20,
|
|
398
|
+
backgroundColor: 'rgba(0, 0, 0, 0.7)',
|
|
399
|
+
width: 40,
|
|
400
|
+
height: 40,
|
|
401
|
+
borderRadius: 20,
|
|
402
|
+
justifyContent: 'center',
|
|
403
|
+
alignItems: 'center',
|
|
404
|
+
zIndex: 2,
|
|
405
|
+
},
|
|
406
|
+
closeButtonText: {
|
|
407
|
+
color: 'white',
|
|
408
|
+
fontSize: 20,
|
|
409
|
+
fontWeight: 'bold',
|
|
410
|
+
},
|
|
411
|
+
controlsContainer: {
|
|
412
|
+
position: 'absolute',
|
|
413
|
+
bottom: 40,
|
|
414
|
+
left: 0,
|
|
415
|
+
right: 0,
|
|
416
|
+
flexDirection: 'row',
|
|
417
|
+
justifyContent: 'space-around',
|
|
418
|
+
alignItems: 'center',
|
|
419
|
+
paddingHorizontal: 40,
|
|
420
|
+
zIndex: 1,
|
|
421
|
+
},
|
|
422
|
+
controlButton: {
|
|
423
|
+
backgroundColor: 'rgba(0, 0, 0, 0.7)',
|
|
424
|
+
width: 50,
|
|
425
|
+
height: 50,
|
|
426
|
+
borderRadius: 25,
|
|
427
|
+
justifyContent: 'center',
|
|
428
|
+
alignItems: 'center',
|
|
429
|
+
},
|
|
430
|
+
controlButtonText: {
|
|
431
|
+
fontSize: 24,
|
|
432
|
+
},
|
|
433
|
+
captureButton: {
|
|
434
|
+
backgroundColor: 'rgba(255, 255, 255, 0.3)',
|
|
435
|
+
width: 80,
|
|
436
|
+
height: 80,
|
|
437
|
+
borderRadius: 40,
|
|
438
|
+
justifyContent: 'center',
|
|
439
|
+
alignItems: 'center',
|
|
440
|
+
borderWidth: 3,
|
|
441
|
+
borderColor: 'white',
|
|
442
|
+
},
|
|
443
|
+
captureButtonInner: {
|
|
444
|
+
backgroundColor: 'white',
|
|
445
|
+
width: 60,
|
|
446
|
+
height: 60,
|
|
447
|
+
borderRadius: 30,
|
|
448
|
+
},
|
|
449
|
+
captureButtonDisabled: {
|
|
450
|
+
backgroundColor: 'rgba(255, 255, 255, 0.5)',
|
|
451
|
+
},
|
|
452
|
+
recordingButton: {
|
|
453
|
+
backgroundColor: 'rgba(255, 59, 48, 0.3)',
|
|
454
|
+
borderColor: '#FF3B30',
|
|
455
|
+
},
|
|
456
|
+
recordingButtonInner: {
|
|
457
|
+
backgroundColor: '#FF3B30',
|
|
458
|
+
},
|
|
459
|
+
permissionMessage: {
|
|
460
|
+
color: 'white',
|
|
461
|
+
fontSize: 16,
|
|
462
|
+
textAlign: 'center',
|
|
463
|
+
margin: 20,
|
|
464
|
+
},
|
|
465
|
+
errorMessage: {
|
|
466
|
+
color: 'red',
|
|
467
|
+
fontSize: 16,
|
|
468
|
+
textAlign: 'center',
|
|
469
|
+
margin: 20,
|
|
470
|
+
},
|
|
471
|
+
bboxOverlay: {
|
|
472
|
+
position: 'absolute',
|
|
473
|
+
top: 0,
|
|
474
|
+
left: 0,
|
|
475
|
+
right: 0,
|
|
476
|
+
bottom: 0,
|
|
477
|
+
pointerEvents: 'none',
|
|
478
|
+
},
|
|
479
|
+
bbox: {
|
|
480
|
+
position: 'absolute',
|
|
481
|
+
borderStyle: 'solid',
|
|
482
|
+
backgroundColor: 'transparent',
|
|
483
|
+
},
|
|
484
|
+
analyzingContainer: {
|
|
485
|
+
position: 'absolute',
|
|
486
|
+
bottom: 100,
|
|
487
|
+
alignSelf: 'center',
|
|
488
|
+
backgroundColor: 'rgba(0, 0, 0, 0.7)',
|
|
489
|
+
padding: 10,
|
|
490
|
+
borderRadius: 10,
|
|
491
|
+
zIndex: 1000,
|
|
492
|
+
},
|
|
493
|
+
analyzingText: {
|
|
494
|
+
color: 'white',
|
|
495
|
+
fontSize: 16,
|
|
496
|
+
fontWeight: 'bold',
|
|
497
|
+
},
|
|
498
|
+
});
|
|
499
|
+
//# sourceMappingURL=EnhancedCameraView.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnhancedCameraView.web.js","sourceRoot":"","sources":["../../src/components/EnhancedCameraView.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAElF,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,MAAM,CAAC,MAAM,kBAAkB,GAAsC,CAAC,EACpE,YAAY,GAAG,2DAA2D,EAC1E,UAAU,EACV,UAAU,EAAE,iBAAiB,GAAG,OAAO,EACvC,KAAK,EACL,SAAS,EACT,OAAO,EACP,OAAO,EACP,WAAW,GAAG,KAAK,EACnB,SAAS,GAAG,KAAK,EACjB,OAAO,GAAG,MAAM,EAChB,iBAAiB,GAAG,IAAI,EACxB,gBAAgB,GAAG,IAAI,EACvB,gBAAgB,EAChB,IAAI,EACJ,OAAO,GAAG,IAAI,EACd,WAAW,GAAG,KAAK,EACnB,WAAW,GAAG,KAAK,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,aAAa,GAAG,EAAE,EAClB,eAAe,EACf,mBAAmB,EACnB,2BAA2B,GAAG,IAAI,GACn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BAAwB;QACzC,WAAW,EAAE,SAAS;KACvB;IACD,oBAAoB,EAAE;QACpB,eAAe,EAAE,SAAS;KAC3B;IACD,iBAAiB,EAAE;QACjB,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,QAAQ;QACnB,MAAM,EAAE,EAAE;KACX;IACD,YAAY,EAAE;QACZ,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,QAAQ;QACnB,MAAM,EAAE,EAAE;KACX;IACD,WAAW,EAAE;QACX,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;QACT,aAAa,EAAE,MAAM;KACtB;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,UAAU;QACpB,WAAW,EAAE,OAAO;QACpB,eAAe,EAAE,aAAa;KAC/B;IACD,kBAAkB,EAAE;QAClB,QAAQ,EAAE,UAAU;QACpB,MAAM,EAAE,GAAG;QACX,SAAS,EAAE,QAAQ;QACnB,eAAe,EAAE,oBAAoB;QACrC,OAAO,EAAE,EAAE;QACX,YAAY,EAAE,EAAE;QAChB,MAAM,EAAE,IAAI;KACb;IACD,aAAa,EAAE;QACb,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,MAAM;KACnB;CACF,CAAC,CAAC","sourcesContent":["import React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { View, StyleSheet, TouchableOpacity, Text, Platform } from 'react-native';\nimport { EnhancedCameraViewProps } from './OverLay/type';\nimport { useI18n } from '../hooks/useI18n';\n\n\nexport const EnhancedCameraView: React.FC<EnhancedCameraViewProps> = ({\n instructions = 'Position yourself in the frame and tap the capture button',\n showCamera,\n cameraType: initialCameraType = 'front',\n style,\n onCapture,\n onError,\n onClose,\n enableFlash = false,\n enableHdr = false,\n quality = 'high',\n showCaptureButton = true,\n showSwitchCamera = true,\n overlayComponent,\n bbox,\n canFlip = true,\n enableVideo = false,\n isRecording = false,\n onVideoRecordingStart,\n onVideoRecordingStop,\n videoDuration = 10,\n onSilentCapture,\n silentCaptureResult,\n captureStabilizationDelayMs = 2500,\n}) => {\n const { t } = useI18n();\n \n // Vérification de plateforme - ce composant est uniquement pour le web\n if (Platform.OS !== 'web') {\n console.warn('EnhancedCameraView.web.tsx should only be used on web platform');\n return null;\n }\n const videoRef = useRef<HTMLVideoElement>(null);\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const [cameraType, setCameraType] = useState<'front' | 'back'>(initialCameraType);\n const [hasPermission, setHasPermission] = useState(false);\n const [isInitialized, setIsInitialized] = useState(false);\n const [flash, setFlash] = useState<'off' | 'on' | 'auto'>('off');\n const [stream, setStream] = useState<MediaStream | null>(null);\n const [isRecordingVideo, setIsRecordingVideo] = useState(false);\n const [mediaRecorder, setMediaRecorder] = useState<MediaRecorder | null>(null);\n const [recordedChunks, setRecordedChunks] = useState<Blob[]>([]);\n\n console.log('cameraType', cameraType, recordedChunks);\n // Check permissions on component mount\n useEffect(() => {\n if (showCamera) {\n checkPermissions();\n }\n }, [showCamera]);\n\n // Cleanup stream on unmount\n useEffect(() => {\n return () => {\n if (stream) {\n stream.getTracks().forEach(track => track.stop());\n }\n };\n }, [stream]);\n\n // Build video constraints for quality (min + ideal improve Android/Samsung web quality; higher ideal for documents)\n const getVideoConstraints = useCallback((): MediaTrackConstraints => {\n const isHigh = quality === 'high';\n const isMedium = quality === 'medium';\n return {\n facingMode: cameraType === 'front' ? 'user' : 'environment',\n // min forces Android Chrome to use at least this resolution (avoids 640x480 default)\n width: {\n min: isHigh ? 1280 : isMedium ? 960 : 640,\n ideal: isHigh ? 2560 : isMedium ? 1280 : 640,\n },\n height: {\n min: isHigh ? 720 : isMedium ? 540 : 480,\n ideal: isHigh ? 1440 : isMedium ? 720 : 480,\n },\n };\n }, [cameraType, quality]);\n\n const checkPermissions = async () => {\n try {\n if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {\n onError?.({ message: 'Camera not supported in this browser' });\n return;\n }\n\n // Use same constraints as startCamera so Android Chrome doesn't cache low resolution (e.g. 640x480)\n const stream = await navigator.mediaDevices.getUserMedia({\n video: getVideoConstraints(),\n audio: enableVideo,\n });\n stream.getTracks().forEach(track => track.stop());\n\n setHasPermission(true);\n await startCamera();\n } catch (error) {\n console.error('Error checking permissions:', error);\n onError?.({ message: 'Camera permissions not granted' });\n }\n };\n\n const startCamera = async () => {\n try {\n if (stream) {\n stream.getTracks().forEach(track => track.stop());\n }\n\n const constraints: MediaStreamConstraints = {\n video: getVideoConstraints(),\n audio: enableVideo,\n };\n\n let newStream: MediaStream;\n try {\n newStream = await navigator.mediaDevices.getUserMedia(constraints);\n } catch (err) {\n const name = err instanceof Error ? err.name : '';\n // On some Android devices, min constraints can fail; fallback to ideal only\n if (name === 'OverconstrainedError') {\n const fallbackConstraints: MediaStreamConstraints = {\n video: {\n facingMode: cameraType === 'front' ? 'user' : 'environment',\n width: { ideal: quality === 'high' ? 2560 : quality === 'medium' ? 1280 : 640 },\n height: { ideal: quality === 'high' ? 1440 : quality === 'medium' ? 720 : 480 },\n },\n audio: enableVideo,\n };\n newStream = await navigator.mediaDevices.getUserMedia(fallbackConstraints);\n } else {\n throw err;\n }\n }\n\n setStream(newStream);\n\n if (videoRef.current) {\n videoRef.current.srcObject = newStream;\n videoRef.current.onloadedmetadata = () => {\n setIsInitialized(true);\n };\n }\n } catch (error) {\n console.error('Error starting camera:', error);\n onError?.({ message: 'Failed to start camera' });\n }\n };\n\n const onInitialized = useCallback(() => {\n console.log('Camera initialized!');\n setIsInitialized(true);\n }, []);\n\n const onCameraError = useCallback((error: any) => {\n console.error('Camera error:', error);\n onError?.({ message: error.message || 'Camera error occurred' });\n }, [onError]);\n\n console.log('isInitialized', onInitialized, onCameraError);\n\n const capturePhoto = useCallback(async () => {\n try {\n onCapture && onCapture({\n success: true\n })\n } catch (error) {\n console.error('Error taking photo:', error);\n onCapture?.({\n success: false,\n error: error instanceof Error ? error.message : 'Failed to capture photo',\n });\n }\n }, [isInitialized, onCapture, onError]);\n\n\n const captureSilentPhoto = useCallback(async () => {\n try {\n if (!videoRef.current || !canvasRef.current || !isInitialized) {\n onError?.({ message: 'Camera not ready' });\n return;\n }\n\n const video = videoRef.current;\n const canvas = canvasRef.current;\n const context = canvas.getContext('2d');\n\n if (!context) {\n onError?.({ message: 'Canvas context not available' });\n return;\n }\n\n // Set canvas dimensions to match video\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n\n // For front camera: draw flipped so captured image matches non-mirrored preview (no mirror confusion)\n if (cameraType === 'front') {\n context.save();\n context.translate(canvas.width, 0);\n context.scale(-1, 1);\n context.drawImage(video, 0, 0);\n context.restore();\n } else {\n context.drawImage(video, 0, 0);\n }\n\n // Convert to base64 (0.95 for document/ID capture clarity; backend can exploit text better)\n const imageDataUrl = canvas.toDataURL('image/jpeg', 0.95);\n\n onSilentCapture?.({\n success: true,\n path: imageDataUrl,\n });\n } catch (error) {\n console.error('Error taking photo:', error);\n onCapture?.({\n success: false,\n error: error instanceof Error ? error.message : 'Failed to capture photo',\n });\n }\n }, [isInitialized, cameraType, onError, onSilentCapture]);\n\n\n // Stabilization delay then auto-capture every 5s; stop as soon as capture is validated (no more new captures)\n useEffect(() => {\n if (!showCamera || !isInitialized || silentCaptureResult?.success) {\n return;\n }\n\n const delayMs = Math.max(0, captureStabilizationDelayMs);\n const intervalMs = 5000;\n let intervalId: ReturnType<typeof setInterval> | null = null;\n\n const timeoutId = setTimeout(() => {\n captureSilentPhoto();\n intervalId = setInterval(captureSilentPhoto, intervalMs);\n }, delayMs);\n\n return () => {\n clearTimeout(timeoutId);\n if (intervalId) clearInterval(intervalId);\n };\n }, [showCamera, isInitialized, captureStabilizationDelayMs, captureSilentPhoto, silentCaptureResult?.success]);\n\n const startVideoRecording = useCallback(async () => {\n try {\n if (!stream || !isInitialized) {\n onError?.({ message: 'Camera not ready' });\n return;\n }\n\n const chunks: Blob[] = [];\n setRecordedChunks(chunks);\n\n const recorder = new MediaRecorder(stream, {\n mimeType: 'video/webm;codecs=vp9',\n });\n\n recorder.ondataavailable = (event) => {\n if (event.data.size > 0) {\n chunks.push(event.data);\n }\n };\n\n recorder.onstop = () => {\n const blob = new Blob(chunks, { type: 'video/webm' });\n const url = URL.createObjectURL(blob);\n\n onVideoRecordingStop?.({\n success: true,\n path: url,\n });\n\n setRecordedChunks([]);\n setIsRecordingVideo(false);\n };\n\n recorder.onerror = (event) => {\n console.error('Recording error:', event);\n onVideoRecordingStop?.({\n success: false,\n error: 'Failed to record video',\n });\n setIsRecordingVideo(false);\n };\n\n setMediaRecorder(recorder);\n recorder.start();\n setIsRecordingVideo(true);\n onVideoRecordingStart?.();\n\n // Auto-stop after videoDuration seconds\n setTimeout(() => {\n if (recorder.state === 'recording') {\n recorder.stop();\n }\n }, videoDuration * 1000);\n\n } catch (error) {\n console.error('Error starting video recording:', error);\n onVideoRecordingStop?.({\n success: false,\n error: error instanceof Error ? error.message : 'Failed to start video recording',\n });\n }\n }, [isInitialized, stream, videoDuration, onVideoRecordingStart, onVideoRecordingStop, onError]);\n\n const stopVideoRecording = useCallback(async () => {\n try {\n if (mediaRecorder && mediaRecorder.state === 'recording') {\n mediaRecorder.stop();\n }\n } catch (error) {\n console.error('Error stopping video recording:', error);\n onError?.({ message: 'Failed to stop video recording' });\n }\n }, [mediaRecorder, onError]);\n\n const switchCamera = useCallback(async () => {\n setCameraType(current => current === 'front' ? 'back' : 'front');\n // Restart camera with new facing mode\n await startCamera();\n }, [cameraType]);\n\n const toggleFlash = useCallback(() => {\n setFlash(current => {\n switch (current) {\n case 'off': return 'on';\n case 'on': return 'auto';\n case 'auto': return 'off';\n default: return 'off';\n }\n });\n }, []);\n\n if (!hasPermission) {\n return (\n <View style={[styles.container, style]}>\n <Text style={styles.permissionMessage}>\n Camera permission required. Please grant permission to continue.\n </Text>\n </View>\n );\n }\n\n if (!showCamera) {\n return <View style={[styles.container, style]} />;\n }\n\n return (\n <View style={[styles.container, style]}>\n {/* Video element; no mirror for front camera so preview matches final photo and doesn't confuse users */}\n <video\n ref={videoRef}\n style={{\n position: 'absolute',\n width: '100%',\n height: '100%',\n objectFit: 'cover',\n transform: cameraType === 'front' ? 'scaleX(-1)' : undefined,\n }}\n autoPlay\n playsInline\n muted\n />\n\n {/* Hidden canvas for photo capture */}\n <canvas\n ref={canvasRef}\n style={{\n position: 'absolute',\n left: '-9999px',\n top: '-9999px',\n }}\n />\n\n {/* Instructions */}\n {/* {instructions && (\n <View style={styles.instructionsOverlay}>\n <Text style={styles.instructions}>{instructions}</Text>\n </View>\n )} */}\n\n {/* Custom overlay component */}\n {overlayComponent}\n\n {/* Bounding box overlay */}\n {bbox && (\n <View style={styles.bboxOverlay}>\n <View\n style={[\n styles.bbox,\n {\n left: `${bbox.xMin}%`,\n top: `${bbox.yMin}%`,\n width: `${bbox.xMax - bbox.xMin}%`,\n height: `${bbox.yMax - bbox.yMin}%`,\n borderColor: bbox.borderColor || '#2DBD60',\n borderWidth: bbox.borderWidth || 3,\n borderRadius: bbox.cornerRadius || 8,\n }\n ]}\n />\n </View>\n )}\n\n {/* Analyzing indicator - Same as mobile */}\n {silentCaptureResult?.isAnalyzing && (\n <View style={styles.analyzingContainer}>\n <Text style={styles.analyzingText}>{t('camera.analyzing')}</Text>\n </View>\n )}\n\n {/* Camera controls */}\n <View style={styles.controlsContainer}>\n {/* Flash button */}\n {enableFlash && (\n <TouchableOpacity style={styles.controlButton} onPress={toggleFlash}>\n <Text style={styles.controlButtonText}>\n {flash === 'off' ? '⚡' : flash === 'on' ? '⚡️' : '✨'}\n </Text>\n </TouchableOpacity>\n )}\n\n {/* Capture button */}\n {showCaptureButton && !enableVideo && silentCaptureResult?.success && (\n <TouchableOpacity\n style={styles.captureButton}\n onPress={capturePhoto}\n disabled={!isInitialized}\n >\n <View style={[\n styles.captureButtonInner,\n !isInitialized && styles.captureButtonDisabled\n ]} />\n </TouchableOpacity>\n )}\n\n {/* Video recording button */}\n {showCaptureButton && enableVideo && (\n <TouchableOpacity\n style={[\n styles.captureButton,\n isRecordingVideo && styles.recordingButton\n ]}\n onPress={isRecordingVideo ? stopVideoRecording : startVideoRecording}\n disabled={!isInitialized}\n >\n <View style={[\n styles.captureButtonInner,\n !isInitialized && styles.captureButtonDisabled,\n isRecordingVideo && styles.recordingButtonInner\n ]} />\n </TouchableOpacity>\n )}\n\n {/* Switch camera button */}\n {showSwitchCamera && canFlip && (\n <TouchableOpacity style={styles.controlButton} onPress={switchCamera}>\n <Text style={styles.controlButtonText}>🔄</Text>\n </TouchableOpacity>\n )}\n </View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n backgroundColor: 'black',\n },\n instructionsOverlay: {\n position: 'absolute',\n top: 60,\n left: 20,\n right: 20,\n backgroundColor: 'rgba(0, 0, 0, 0.7)',\n padding: 15,\n borderRadius: 10,\n zIndex: 1,\n },\n instructions: {\n color: 'white',\n fontSize: 16,\n textAlign: 'center',\n fontWeight: '500',\n },\n closeButton: {\n position: 'absolute',\n top: 50,\n right: 20,\n backgroundColor: 'rgba(0, 0, 0, 0.7)',\n width: 40,\n height: 40,\n borderRadius: 20,\n justifyContent: 'center',\n alignItems: 'center',\n zIndex: 2,\n },\n closeButtonText: {\n color: 'white',\n fontSize: 20,\n fontWeight: 'bold',\n },\n controlsContainer: {\n position: 'absolute',\n bottom: 40,\n left: 0,\n right: 0,\n flexDirection: 'row',\n justifyContent: 'space-around',\n alignItems: 'center',\n paddingHorizontal: 40,\n zIndex: 1,\n },\n controlButton: {\n backgroundColor: 'rgba(0, 0, 0, 0.7)',\n width: 50,\n height: 50,\n borderRadius: 25,\n justifyContent: 'center',\n alignItems: 'center',\n },\n controlButtonText: {\n fontSize: 24,\n },\n captureButton: {\n backgroundColor: 'rgba(255, 255, 255, 0.3)',\n width: 80,\n height: 80,\n borderRadius: 40,\n justifyContent: 'center',\n alignItems: 'center',\n borderWidth: 3,\n borderColor: 'white',\n },\n captureButtonInner: {\n backgroundColor: 'white',\n width: 60,\n height: 60,\n borderRadius: 30,\n },\n captureButtonDisabled: {\n backgroundColor: 'rgba(255, 255, 255, 0.5)',\n },\n recordingButton: {\n backgroundColor: 'rgba(255, 59, 48, 0.3)',\n borderColor: '#FF3B30',\n },\n recordingButtonInner: {\n backgroundColor: '#FF3B30',\n },\n permissionMessage: {\n color: 'white',\n fontSize: 16,\n textAlign: 'center',\n margin: 20,\n },\n errorMessage: {\n color: 'red',\n fontSize: 16,\n textAlign: 'center',\n margin: 20,\n },\n bboxOverlay: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n pointerEvents: 'none',\n },\n bbox: {\n position: 'absolute',\n borderStyle: 'solid',\n backgroundColor: 'transparent',\n },\n analyzingContainer: {\n position: 'absolute',\n bottom: 100,\n alignSelf: 'center',\n backgroundColor: 'rgba(0, 0, 0, 0.7)',\n padding: 10,\n borderRadius: 10,\n zIndex: 1000,\n },\n analyzingText: {\n color: 'white',\n fontSize: 16,\n fontWeight: 'bold',\n },\n}); "]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface FileUploadProps {
|
|
3
|
+
allowedTypes?: string[];
|
|
4
|
+
maxFiles?: number;
|
|
5
|
+
onFilesSelected?: (files: Array<{
|
|
6
|
+
uri: string;
|
|
7
|
+
path: string;
|
|
8
|
+
name: string;
|
|
9
|
+
}>) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const FileUpload: React.FC<FileUploadProps>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=FileUpload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileUpload.d.ts","sourceRoot":"","sources":["../../src/components/FileUpload.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAKxC,UAAU,eAAe;IACvB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,KAAK,IAAI,CAAC;CACvF;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAiIhD,CAAC"}
|