@trustchex/react-native-sdk 1.163.7 → 1.163.10
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/TrustchexSDK.podspec +0 -1
- package/ios/VisionCameraPlugins/BarcodeScanner/BarcodeScannerFrameProcessorPlugin-Bridging-Header.h +9 -0
- package/ios/VisionCameraPlugins/BarcodeScanner/BarcodeScannerFrameProcessorPlugin.swift +173 -157
- package/lib/module/Shared/Components/QrCodeScannerCamera.js +15 -3
- package/lib/module/Shared/EIDReader/constants/eidConstants.js +65 -0
- package/lib/module/Shared/EIDReader/data/country.js +21 -44
- package/lib/module/Shared/EIDReader/data/countryInterface.js +1 -0
- package/lib/module/Shared/EIDReader/data/countryRegistry.js +65 -0
- package/lib/module/Shared/EIDReader/data/isoCountry.js +5 -1
- package/lib/module/Shared/EIDReader/data/unicodeCountry.js +5 -1
- package/lib/module/Shared/EIDReader/defaultFileSystem.js +4 -4
- package/lib/module/Shared/EIDReader/eidService.js +52 -51
- package/lib/module/Shared/EIDReader/lds/cvcaFile.js +2 -2
- package/lib/module/Shared/EIDReader/tlv/tlvCore.js +161 -0
- package/lib/module/Shared/EIDReader/tlv/tlvInputStream.js +4 -4
- package/lib/module/Shared/EIDReader/tlv/tlvOutputState.js +4 -4
- package/lib/module/Shared/EIDReader/tlv/tlvOutputStream.js +13 -11
- package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/index.js +0 -2
- package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/scanCodes.js +2 -0
- package/lib/typescript/src/Shared/Components/QrCodeScannerCamera.d.ts.map +1 -1
- package/lib/typescript/src/Shared/EIDReader/constants/eidConstants.d.ts +58 -0
- package/lib/typescript/src/Shared/EIDReader/constants/eidConstants.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/data/country.d.ts +4 -5
- package/lib/typescript/src/Shared/EIDReader/data/country.d.ts.map +1 -1
- package/lib/typescript/src/Shared/EIDReader/data/countryInterface.d.ts +21 -0
- package/lib/typescript/src/Shared/EIDReader/data/countryInterface.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/data/countryRegistry.d.ts +14 -0
- package/lib/typescript/src/Shared/EIDReader/data/countryRegistry.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/data/isoCountry.d.ts.map +1 -1
- package/lib/typescript/src/Shared/EIDReader/data/unicodeCountry.d.ts.map +1 -1
- package/lib/typescript/src/Shared/EIDReader/eidService.d.ts.map +1 -1
- package/lib/typescript/src/Shared/EIDReader/tlv/tlvCore.d.ts +22 -0
- package/lib/typescript/src/Shared/EIDReader/tlv/tlvCore.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/tlv/tlvOutputStream.d.ts +2 -2
- package/lib/typescript/src/Shared/EIDReader/tlv/tlvOutputStream.d.ts.map +1 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/index.d.ts +0 -2
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/index.d.ts.map +1 -1
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/scanCodes.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Shared/Components/QrCodeScannerCamera.tsx +15 -2
- package/src/Shared/EIDReader/constants/eidConstants.ts +67 -0
- package/src/Shared/EIDReader/data/country.ts +16 -47
- package/src/Shared/EIDReader/data/countryInterface.ts +21 -0
- package/src/Shared/EIDReader/data/countryRegistry.ts +73 -0
- package/src/Shared/EIDReader/data/isoCountry.ts +4 -0
- package/src/Shared/EIDReader/data/unicodeCountry.ts +4 -0
- package/src/Shared/EIDReader/defaultFileSystem.ts +4 -4
- package/src/Shared/EIDReader/eidService.ts +58 -53
- package/src/Shared/EIDReader/lds/cvcaFile.ts +2 -2
- package/src/Shared/EIDReader/tlv/tlvCore.ts +170 -0
- package/src/Shared/EIDReader/tlv/tlvInputStream.ts +4 -4
- package/src/Shared/EIDReader/tlv/tlvOutputState.ts +4 -4
- package/src/Shared/EIDReader/tlv/tlvOutputStream.ts +13 -12
- package/src/Shared/VisionCameraPlugins/BarcodeScanner/index.ts +0 -4
- package/src/Shared/VisionCameraPlugins/BarcodeScanner/scanCodes.ts +2 -0
- package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/components/BarcodeCamera.js +0 -66
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/components/BarcodeCamera.d.ts +0 -13
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/components/BarcodeCamera.d.ts.map +0 -1
- package/src/Shared/VisionCameraPlugins/BarcodeScanner/components/BarcodeCamera.tsx +0 -85
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useState } from 'react';
|
|
2
|
-
import { StyleSheet, View } from 'react-native';
|
|
3
|
-
import {
|
|
4
|
-
Camera,
|
|
5
|
-
useCameraDevices,
|
|
6
|
-
type Frame,
|
|
7
|
-
} from 'react-native-vision-camera';
|
|
8
|
-
import {
|
|
9
|
-
useBarcodeScanner,
|
|
10
|
-
useCameraPermissions,
|
|
11
|
-
type Barcode,
|
|
12
|
-
type UseBarcodeScannerOptions,
|
|
13
|
-
} from '../index';
|
|
14
|
-
|
|
15
|
-
export interface BarcodeCameraProps extends UseBarcodeScannerOptions {
|
|
16
|
-
style?: any;
|
|
17
|
-
isActive?: boolean;
|
|
18
|
-
device?: 'back' | 'front';
|
|
19
|
-
enableZoomGesture?: boolean;
|
|
20
|
-
onInitialized?: () => void;
|
|
21
|
-
onError?: (error: Error) => void;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export const BarcodeCamera: React.FC<BarcodeCameraProps> = ({
|
|
25
|
-
style,
|
|
26
|
-
isActive = true,
|
|
27
|
-
device = 'back',
|
|
28
|
-
enableZoomGesture = true,
|
|
29
|
-
onBarcodeScanned,
|
|
30
|
-
onError,
|
|
31
|
-
onInitialized,
|
|
32
|
-
...barcodeScannerOptions
|
|
33
|
-
}) => {
|
|
34
|
-
const devices = useCameraDevices();
|
|
35
|
-
const cameraDevice = devices.find((d) =>
|
|
36
|
-
device === 'back' ? d.position === 'back' : d.position === 'front'
|
|
37
|
-
);
|
|
38
|
-
const { hasPermission, requestPermission } = useCameraPermissions();
|
|
39
|
-
const [isCameraInitialized, setIsCameraInitialized] = useState(false);
|
|
40
|
-
|
|
41
|
-
const { scanBarcodes } = useBarcodeScanner({
|
|
42
|
-
...barcodeScannerOptions,
|
|
43
|
-
onBarcodeScanned,
|
|
44
|
-
onError,
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
const handleCameraInitialized = useCallback(() => {
|
|
48
|
-
setIsCameraInitialized(true);
|
|
49
|
-
onInitialized?.();
|
|
50
|
-
}, [onInitialized]);
|
|
51
|
-
|
|
52
|
-
// Request permission if not granted
|
|
53
|
-
React.useEffect(() => {
|
|
54
|
-
if (!hasPermission) {
|
|
55
|
-
requestPermission();
|
|
56
|
-
}
|
|
57
|
-
}, [hasPermission, requestPermission]);
|
|
58
|
-
|
|
59
|
-
if (!hasPermission || !cameraDevice) {
|
|
60
|
-
return <View style={[styles.container, style]} />;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return (
|
|
64
|
-
<Camera
|
|
65
|
-
style={[styles.camera, style]}
|
|
66
|
-
device={cameraDevice}
|
|
67
|
-
isActive={isActive && isCameraInitialized}
|
|
68
|
-
enableZoomGesture={enableZoomGesture}
|
|
69
|
-
onInitialized={handleCameraInitialized}
|
|
70
|
-
onError={onError}
|
|
71
|
-
/>
|
|
72
|
-
);
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
const styles = StyleSheet.create({
|
|
76
|
-
container: {
|
|
77
|
-
flex: 1,
|
|
78
|
-
backgroundColor: 'black',
|
|
79
|
-
},
|
|
80
|
-
camera: {
|
|
81
|
-
flex: 1,
|
|
82
|
-
},
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
export default BarcodeCamera;
|