@hexar/biometric-identity-sdk-react-native 1.0.27 → 1.0.28
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/dist/components/BiometricIdentityFlow.d.ts.map +1 -1
- package/dist/components/BiometricIdentityFlow.js +2 -0
- package/dist/components/VideoRecorder.d.ts.map +1 -1
- package/dist/components/VideoRecorder.js +30 -12
- package/package.json +2 -2
- package/src/components/BiometricIdentityFlow.tsx +2 -0
- package/src/components/VideoRecorder.tsx +30 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BiometricIdentityFlow.d.ts","sourceRoot":"","sources":["../../src/components/BiometricIdentityFlow.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAmD,MAAM,OAAO,CAAC;AACxE,OAAO,EAOL,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,cAAc,EAKd,iBAAiB,EAElB,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"BiometricIdentityFlow.d.ts","sourceRoot":"","sources":["../../src/components/BiometricIdentityFlow.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAmD,MAAM,OAAO,CAAC;AACxE,OAAO,EAOL,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,cAAc,EAKd,iBAAiB,EAElB,MAAM,oCAAoC,CAAC;AA8B5C,MAAM,WAAW,0BAA0B;IACzC,oBAAoB,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACzD,OAAO,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IACzC,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,SAAS,CAAC;QACtB,OAAO,CAAC,EAAE,SAAS,CAAC;KACrB,CAAC;CACH;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAuatE,CAAC;AA8NF,eAAe,qBAAqB,CAAC"}
|
|
@@ -53,6 +53,8 @@ const getInstructionMap = (strings) => {
|
|
|
53
53
|
look_right: { text: strings.liveness.instructions.lookRight || 'Slowly turn your head RIGHT' },
|
|
54
54
|
look_up: { text: strings.liveness.instructions.lookUp || 'Look UP' },
|
|
55
55
|
look_down: { text: strings.liveness.instructions.lookDown || 'Look DOWN' },
|
|
56
|
+
turn_left: { text: strings.liveness.instructions.turnHeadLeft || strings.liveness.instructions.lookLeft || 'Turn your head LEFT' },
|
|
57
|
+
turn_right: { text: strings.liveness.instructions.turnHeadRight || strings.liveness.instructions.lookRight || 'Turn your head RIGHT' },
|
|
56
58
|
turn_head_left: { text: strings.liveness.instructions.turnHeadLeft || 'Turn your head LEFT' },
|
|
57
59
|
turn_head_right: { text: strings.liveness.instructions.turnHeadRight || 'Turn your head RIGHT' },
|
|
58
60
|
smile: { text: strings.liveness.instructions.smile || 'Smile' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoRecorder.d.ts","sourceRoot":"","sources":["../../src/components/VideoRecorder.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAmD,MAAM,OAAO,CAAC;AAaxE,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,iBAAiB,EAAmC,MAAM,oCAAoC,CAAC;AAE1I,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,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|
|
82
|
-
|
|
83
|
-
}
|
|
72
|
+
const getInstructionMap = (strings) => {
|
|
73
|
+
if (!strings || !strings.liveness || !strings.liveness.instructions) {
|
|
74
|
+
return {};
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
look_left: { text: strings.liveness.instructions.lookLeft || 'Slowly turn your head LEFT' },
|
|
78
|
+
look_right: { text: strings.liveness.instructions.lookRight || 'Slowly turn your head RIGHT' },
|
|
79
|
+
look_up: { text: strings.liveness.instructions.lookUp || 'Look UP' },
|
|
80
|
+
look_down: { text: strings.liveness.instructions.lookDown || 'Look DOWN' },
|
|
81
|
+
turn_left: { text: strings.liveness.instructions.turnHeadLeft || strings.liveness.instructions.lookLeft || 'Turn your head LEFT' },
|
|
82
|
+
turn_right: { text: strings.liveness.instructions.turnHeadRight || strings.liveness.instructions.lookRight || 'Turn your head RIGHT' },
|
|
83
|
+
turn_head_left: { text: strings.liveness.instructions.turnHeadLeft || 'Turn your head LEFT' },
|
|
84
|
+
turn_head_right: { text: strings.liveness.instructions.turnHeadRight || 'Turn your head RIGHT' },
|
|
85
|
+
smile: { text: strings.liveness.instructions.smile || 'Smile' },
|
|
86
|
+
blink: { text: strings.liveness.instructions.blink || 'Blink your eyes naturally' },
|
|
87
|
+
open_mouth: { text: strings.liveness.instructions.openMouth || 'Open your mouth slightly' },
|
|
88
|
+
stay_still: { text: strings.liveness.instructions.stayStill || 'Look at the camera and follow the instructions' },
|
|
89
|
+
};
|
|
90
|
+
};
|
|
84
91
|
const VideoRecorder = ({ theme, language, duration, instructions, challenges: propChallenges, sessionId, smartMode = true, onComplete, onCancel, onFetchChallenges, }) => {
|
|
85
92
|
(0, react_1.useEffect)(() => {
|
|
86
93
|
if (language) {
|
|
@@ -145,9 +152,20 @@ const VideoRecorder = ({ theme, language, duration, instructions, challenges: pr
|
|
|
145
152
|
(0, react_1.useEffect)(() => {
|
|
146
153
|
const initChallenges = async () => {
|
|
147
154
|
try {
|
|
155
|
+
if (language) {
|
|
156
|
+
(0, biometric_identity_sdk_core_1.setLanguage)(language);
|
|
157
|
+
}
|
|
148
158
|
let challengeList;
|
|
149
159
|
const currentStrings = (0, biometric_identity_sdk_core_1.getStrings)();
|
|
150
160
|
const instructionMap = getInstructionMap(currentStrings);
|
|
161
|
+
biometric_identity_sdk_core_1.logger.info('Initializing challenges', {
|
|
162
|
+
language,
|
|
163
|
+
hasStrings: !!currentStrings,
|
|
164
|
+
hasInstructions: !!currentStrings?.liveness?.instructions,
|
|
165
|
+
instructionMapKeys: Object.keys(instructionMap),
|
|
166
|
+
turnLeftTranslation: instructionMap['turn_left']?.text,
|
|
167
|
+
turnRightTranslation: instructionMap['turn_right']?.text
|
|
168
|
+
});
|
|
151
169
|
if (propChallenges && propChallenges.length > 0) {
|
|
152
170
|
challengeList = propChallenges.map(challenge => ({
|
|
153
171
|
...challenge,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hexar/biometric-identity-sdk-react-native",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.28",
|
|
4
4
|
"description": "React Native wrapper for Biometric Identity SDK",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"clean": "rm -rf dist"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"@hexar/biometric-identity-sdk-core": ">=1.0.
|
|
14
|
+
"@hexar/biometric-identity-sdk-core": ">=1.0.18",
|
|
15
15
|
"react": ">=18.0.0",
|
|
16
16
|
"react-native": ">=0.70.0",
|
|
17
17
|
"react-native-permissions": ">=4.0.0",
|
|
@@ -38,6 +38,8 @@ const getInstructionMap = (strings: any): Record<string, { text: string; icon?:
|
|
|
38
38
|
look_right: { text: strings.liveness.instructions.lookRight || 'Slowly turn your head RIGHT' },
|
|
39
39
|
look_up: { text: strings.liveness.instructions.lookUp || 'Look UP' },
|
|
40
40
|
look_down: { text: strings.liveness.instructions.lookDown || 'Look DOWN' },
|
|
41
|
+
turn_left: { text: strings.liveness.instructions.turnHeadLeft || strings.liveness.instructions.lookLeft || 'Turn your head LEFT' },
|
|
42
|
+
turn_right: { text: strings.liveness.instructions.turnHeadRight || strings.liveness.instructions.lookRight || 'Turn your head RIGHT' },
|
|
41
43
|
turn_head_left: { text: strings.liveness.instructions.turnHeadLeft || 'Turn your head LEFT' },
|
|
42
44
|
turn_head_right: { text: strings.liveness.instructions.turnHeadRight || 'Turn your head RIGHT' },
|
|
43
45
|
smile: { text: strings.liveness.instructions.smile || 'Smile' },
|
|
@@ -83,18 +83,25 @@ const getDefaultChallenges = (strings: any): ChallengeAction[] => [
|
|
|
83
83
|
},
|
|
84
84
|
];
|
|
85
85
|
|
|
86
|
-
const getInstructionMap = (strings: any): Record<string, { text: string; icon?: string }> =>
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
86
|
+
const getInstructionMap = (strings: any): Record<string, { text: string; icon?: string }> => {
|
|
87
|
+
if (!strings || !strings.liveness || !strings.liveness.instructions) {
|
|
88
|
+
return {};
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
look_left: { text: strings.liveness.instructions.lookLeft || 'Slowly turn your head LEFT' },
|
|
92
|
+
look_right: { text: strings.liveness.instructions.lookRight || 'Slowly turn your head RIGHT' },
|
|
93
|
+
look_up: { text: strings.liveness.instructions.lookUp || 'Look UP' },
|
|
94
|
+
look_down: { text: strings.liveness.instructions.lookDown || 'Look DOWN' },
|
|
95
|
+
turn_left: { text: strings.liveness.instructions.turnHeadLeft || strings.liveness.instructions.lookLeft || 'Turn your head LEFT' },
|
|
96
|
+
turn_right: { text: strings.liveness.instructions.turnHeadRight || strings.liveness.instructions.lookRight || 'Turn your head RIGHT' },
|
|
97
|
+
turn_head_left: { text: strings.liveness.instructions.turnHeadLeft || 'Turn your head LEFT' },
|
|
98
|
+
turn_head_right: { text: strings.liveness.instructions.turnHeadRight || 'Turn your head RIGHT' },
|
|
99
|
+
smile: { text: strings.liveness.instructions.smile || 'Smile' },
|
|
100
|
+
blink: { text: strings.liveness.instructions.blink || 'Blink your eyes naturally' },
|
|
101
|
+
open_mouth: { text: strings.liveness.instructions.openMouth || 'Open your mouth slightly' },
|
|
102
|
+
stay_still: { text: strings.liveness.instructions.stayStill || 'Look at the camera and follow the instructions' },
|
|
103
|
+
};
|
|
104
|
+
};
|
|
98
105
|
|
|
99
106
|
export const VideoRecorder: React.FC<VideoRecorderProps> = ({
|
|
100
107
|
theme,
|
|
@@ -184,9 +191,20 @@ export const VideoRecorder: React.FC<VideoRecorderProps> = ({
|
|
|
184
191
|
useEffect(() => {
|
|
185
192
|
const initChallenges = async () => {
|
|
186
193
|
try {
|
|
194
|
+
if (language) {
|
|
195
|
+
setLanguage(language);
|
|
196
|
+
}
|
|
187
197
|
let challengeList: ChallengeAction[];
|
|
188
198
|
const currentStrings = getStrings();
|
|
189
199
|
const instructionMap = getInstructionMap(currentStrings);
|
|
200
|
+
logger.info('Initializing challenges', {
|
|
201
|
+
language,
|
|
202
|
+
hasStrings: !!currentStrings,
|
|
203
|
+
hasInstructions: !!currentStrings?.liveness?.instructions,
|
|
204
|
+
instructionMapKeys: Object.keys(instructionMap),
|
|
205
|
+
turnLeftTranslation: instructionMap['turn_left']?.text,
|
|
206
|
+
turnRightTranslation: instructionMap['turn_right']?.text
|
|
207
|
+
});
|
|
190
208
|
|
|
191
209
|
if (propChallenges && propChallenges.length > 0) {
|
|
192
210
|
challengeList = propChallenges.map(challenge => ({
|