@hexar/biometric-identity-sdk-react-native 1.3.0 → 1.4.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.
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FacePositioningGuide.d.ts","sourceRoot":"","sources":["../../src/components/FacePositioningGuide.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAOL,SAAS,
|
|
1
|
+
{"version":3,"file":"FacePositioningGuide.d.ts","sourceRoot":"","sources":["../../src/components/FacePositioningGuide.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAOL,SAAS,EAEV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAA2B,MAAM,oCAAoC,CAAC;AAI7G,MAAM,WAAW,yBAAyB;IACxC,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,SAAS,CAAC;QACtB,OAAO,CAAC,EAAE,SAAS,CAAC;KACrB,CAAC;CACH;AAED,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAwEpE,CAAC;AA+FF,eAAe,oBAAoB,CAAC"}
|
|
@@ -13,6 +13,7 @@ exports.FacePositioningGuide = void 0;
|
|
|
13
13
|
const react_1 = __importDefault(require("react"));
|
|
14
14
|
const react_native_1 = require("react-native");
|
|
15
15
|
const biometric_identity_sdk_core_1 = require("@hexar/biometric-identity-sdk-core");
|
|
16
|
+
const FACE_GUIDE_IMAGE = require('../assets/images/face-biometry.png');
|
|
16
17
|
const FacePositioningGuide = ({ theme, language, onContinue, onCancel, styles: customStyles, }) => {
|
|
17
18
|
if (language) {
|
|
18
19
|
(0, biometric_identity_sdk_core_1.setLanguage)(language);
|
|
@@ -40,45 +41,15 @@ const FacePositioningGuide = ({ theme, language, onContinue, onCancel, styles: c
|
|
|
40
41
|
react_1.default.createElement(react_native_1.ScrollView, { contentContainerStyle: [styles.scrollContent, customStyles?.content], showsVerticalScrollIndicator: false },
|
|
41
42
|
react_1.default.createElement(react_native_1.Text, { style: [styles.title, { color: textColor }] }, title),
|
|
42
43
|
react_1.default.createElement(react_native_1.Text, { style: [styles.description, { color: secondaryTextColor }] }, description),
|
|
43
|
-
react_1.default.createElement(react_native_1.View, { style: styles.
|
|
44
|
-
react_1.default.createElement(react_native_1.View, { style:
|
|
45
|
-
react_1.default.createElement(
|
|
44
|
+
react_1.default.createElement(react_native_1.View, { style: styles.imageWrapper },
|
|
45
|
+
react_1.default.createElement(react_native_1.View, { style: styles.imageShadowContainer },
|
|
46
|
+
react_1.default.createElement(react_native_1.Image, { source: FACE_GUIDE_IMAGE, style: styles.guideImage, resizeMode: "contain" }))),
|
|
46
47
|
react_1.default.createElement(react_native_1.View, { style: [styles.tipBox, { borderColor: primaryColor + '30', backgroundColor: primaryColor + '08' }] },
|
|
47
48
|
react_1.default.createElement(react_native_1.Text, { style: [styles.tipText, { color: secondaryTextColor }] }, tip)),
|
|
48
49
|
react_1.default.createElement(react_native_1.TouchableOpacity, { style: [styles.continueButton, { backgroundColor: primaryColor }], onPress: onContinue, activeOpacity: 0.85 },
|
|
49
50
|
react_1.default.createElement(react_native_1.Text, { style: styles.continueButtonText }, continueLabel)))));
|
|
50
51
|
};
|
|
51
52
|
exports.FacePositioningGuide = FacePositioningGuide;
|
|
52
|
-
/** Simple geometric face icon (head + eyes) when react-native-svg is not used */
|
|
53
|
-
const FaceIcon = ({ color }) => (react_1.default.createElement(react_native_1.View, { style: faceIconStyles.container },
|
|
54
|
-
react_1.default.createElement(react_native_1.View, { style: [faceIconStyles.head, { backgroundColor: color }] }),
|
|
55
|
-
react_1.default.createElement(react_native_1.View, { style: faceIconStyles.eyes },
|
|
56
|
-
react_1.default.createElement(react_native_1.View, { style: [faceIconStyles.eye, { backgroundColor: color }] }),
|
|
57
|
-
react_1.default.createElement(react_native_1.View, { style: [faceIconStyles.eye, { backgroundColor: color }] }))));
|
|
58
|
-
const faceIconStyles = react_native_1.StyleSheet.create({
|
|
59
|
-
container: {
|
|
60
|
-
alignItems: 'center',
|
|
61
|
-
justifyContent: 'center',
|
|
62
|
-
},
|
|
63
|
-
head: {
|
|
64
|
-
width: 80,
|
|
65
|
-
height: 100,
|
|
66
|
-
borderRadius: 50,
|
|
67
|
-
opacity: 0.4,
|
|
68
|
-
},
|
|
69
|
-
eyes: {
|
|
70
|
-
flexDirection: 'row',
|
|
71
|
-
justifyContent: 'space-between',
|
|
72
|
-
width: 44,
|
|
73
|
-
marginTop: -70,
|
|
74
|
-
opacity: 0.5,
|
|
75
|
-
},
|
|
76
|
-
eye: {
|
|
77
|
-
width: 12,
|
|
78
|
-
height: 12,
|
|
79
|
-
borderRadius: 6,
|
|
80
|
-
},
|
|
81
|
-
});
|
|
82
53
|
const createStyles = (vars) => react_native_1.StyleSheet.create({
|
|
83
54
|
container: {
|
|
84
55
|
flex: 1,
|
|
@@ -113,18 +84,27 @@ const createStyles = (vars) => react_native_1.StyleSheet.create({
|
|
|
113
84
|
marginBottom: 28,
|
|
114
85
|
paddingHorizontal: 8,
|
|
115
86
|
},
|
|
116
|
-
|
|
87
|
+
imageWrapper: {
|
|
117
88
|
marginBottom: 24,
|
|
89
|
+
alignItems: 'center',
|
|
90
|
+
justifyContent: 'center',
|
|
118
91
|
},
|
|
119
|
-
|
|
92
|
+
imageShadowContainer: {
|
|
120
93
|
width: 260,
|
|
121
94
|
height: 320,
|
|
122
|
-
borderRadius:
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
95
|
+
borderRadius: 130,
|
|
96
|
+
backgroundColor: 'transparent',
|
|
97
|
+
shadowColor: '#000',
|
|
98
|
+
shadowOffset: { width: 0, height: 8 },
|
|
99
|
+
shadowOpacity: 0.25,
|
|
100
|
+
shadowRadius: 12,
|
|
101
|
+
elevation: 12,
|
|
126
102
|
overflow: 'hidden',
|
|
127
103
|
},
|
|
104
|
+
guideImage: {
|
|
105
|
+
width: '100%',
|
|
106
|
+
height: '100%',
|
|
107
|
+
},
|
|
128
108
|
tipBox: {
|
|
129
109
|
paddingVertical: 14,
|
|
130
110
|
paddingHorizontal: 20,
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hexar/biometric-identity-sdk-react-native",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "React Native wrapper for Biometric Identity SDK",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"private": false,
|
|
8
8
|
"scripts": {
|
|
9
|
-
"build": "tsc",
|
|
9
|
+
"build": "tsc && cp -r src/assets dist/",
|
|
10
10
|
"dev": "tsc --watch",
|
|
11
11
|
"clean": "rm -rf dist"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"@hexar/biometric-identity-sdk-core": ">=1.
|
|
14
|
+
"@hexar/biometric-identity-sdk-core": ">=1.3.0",
|
|
15
15
|
"react": ">=18.0.0",
|
|
16
16
|
"react-native": ">=0.70.0",
|
|
17
17
|
"react-native-permissions": ">=4.0.0",
|
|
Binary file
|
|
@@ -14,9 +14,12 @@ import {
|
|
|
14
14
|
ScrollView,
|
|
15
15
|
SafeAreaView,
|
|
16
16
|
ViewStyle,
|
|
17
|
+
Image,
|
|
17
18
|
} from 'react-native';
|
|
18
19
|
import { ThemeConfig, SupportedLanguage, getStrings, setLanguage } from '@hexar/biometric-identity-sdk-core';
|
|
19
20
|
|
|
21
|
+
const FACE_GUIDE_IMAGE = require('../assets/images/face-biometry.png');
|
|
22
|
+
|
|
20
23
|
export interface FacePositioningGuideProps {
|
|
21
24
|
theme?: ThemeConfig;
|
|
22
25
|
language?: SupportedLanguage;
|
|
@@ -76,10 +79,13 @@ export const FacePositioningGuide: React.FC<FacePositioningGuideProps> = ({
|
|
|
76
79
|
{description}
|
|
77
80
|
</Text>
|
|
78
81
|
|
|
79
|
-
{
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
<View style={styles.imageWrapper}>
|
|
83
|
+
<View style={styles.imageShadowContainer}>
|
|
84
|
+
<Image
|
|
85
|
+
source={FACE_GUIDE_IMAGE}
|
|
86
|
+
style={styles.guideImage}
|
|
87
|
+
resizeMode="contain"
|
|
88
|
+
/>
|
|
83
89
|
</View>
|
|
84
90
|
</View>
|
|
85
91
|
|
|
@@ -99,42 +105,6 @@ export const FacePositioningGuide: React.FC<FacePositioningGuideProps> = ({
|
|
|
99
105
|
);
|
|
100
106
|
};
|
|
101
107
|
|
|
102
|
-
/** Simple geometric face icon (head + eyes) when react-native-svg is not used */
|
|
103
|
-
const FaceIcon: React.FC<{ color: string }> = ({ color }) => (
|
|
104
|
-
<View style={faceIconStyles.container}>
|
|
105
|
-
<View style={[faceIconStyles.head, { backgroundColor: color }]} />
|
|
106
|
-
<View style={faceIconStyles.eyes}>
|
|
107
|
-
<View style={[faceIconStyles.eye, { backgroundColor: color }]} />
|
|
108
|
-
<View style={[faceIconStyles.eye, { backgroundColor: color }]} />
|
|
109
|
-
</View>
|
|
110
|
-
</View>
|
|
111
|
-
);
|
|
112
|
-
|
|
113
|
-
const faceIconStyles = StyleSheet.create({
|
|
114
|
-
container: {
|
|
115
|
-
alignItems: 'center',
|
|
116
|
-
justifyContent: 'center',
|
|
117
|
-
},
|
|
118
|
-
head: {
|
|
119
|
-
width: 80,
|
|
120
|
-
height: 100,
|
|
121
|
-
borderRadius: 50,
|
|
122
|
-
opacity: 0.4,
|
|
123
|
-
},
|
|
124
|
-
eyes: {
|
|
125
|
-
flexDirection: 'row',
|
|
126
|
-
justifyContent: 'space-between',
|
|
127
|
-
width: 44,
|
|
128
|
-
marginTop: -70,
|
|
129
|
-
opacity: 0.5,
|
|
130
|
-
},
|
|
131
|
-
eye: {
|
|
132
|
-
width: 12,
|
|
133
|
-
height: 12,
|
|
134
|
-
borderRadius: 6,
|
|
135
|
-
},
|
|
136
|
-
});
|
|
137
|
-
|
|
138
108
|
const createStyles = (vars: {
|
|
139
109
|
primaryColor: string;
|
|
140
110
|
textColor: string;
|
|
@@ -175,18 +145,27 @@ const createStyles = (vars: {
|
|
|
175
145
|
marginBottom: 28,
|
|
176
146
|
paddingHorizontal: 8,
|
|
177
147
|
},
|
|
178
|
-
|
|
148
|
+
imageWrapper: {
|
|
179
149
|
marginBottom: 24,
|
|
150
|
+
alignItems: 'center',
|
|
151
|
+
justifyContent: 'center',
|
|
180
152
|
},
|
|
181
|
-
|
|
153
|
+
imageShadowContainer: {
|
|
182
154
|
width: 260,
|
|
183
155
|
height: 320,
|
|
184
|
-
borderRadius:
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
156
|
+
borderRadius: 130,
|
|
157
|
+
backgroundColor: 'transparent',
|
|
158
|
+
shadowColor: '#000',
|
|
159
|
+
shadowOffset: { width: 0, height: 8 },
|
|
160
|
+
shadowOpacity: 0.25,
|
|
161
|
+
shadowRadius: 12,
|
|
162
|
+
elevation: 12,
|
|
188
163
|
overflow: 'hidden',
|
|
189
164
|
},
|
|
165
|
+
guideImage: {
|
|
166
|
+
width: '100%',
|
|
167
|
+
height: '100%',
|
|
168
|
+
},
|
|
190
169
|
tipBox: {
|
|
191
170
|
paddingVertical: 14,
|
|
192
171
|
paddingHorizontal: 20,
|