@hexar/biometric-identity-sdk-react-native 1.0.28 → 1.0.29

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ValidationProgress.d.ts","sourceRoot":"","sources":["../../src/components/ValidationProgress.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEpF,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAmFhE,CAAC;AAqHF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"ValidationProgress.d.ts","sourceRoot":"","sources":["../../src/components/ValidationProgress.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAoB,MAAM,OAAO,CAAC;AAOzC,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAA2B,MAAM,oCAAoC,CAAC;AAE7G,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAwFhE,CAAC;AAqHF,eAAe,kBAAkB,CAAC"}
@@ -3,29 +3,64 @@
3
3
  * Validation Progress Component
4
4
  * Shows AI validation progress
5
5
  */
6
- var __importDefault = (this && this.__importDefault) || function (mod) {
7
- return (mod && mod.__esModule) ? mod : { "default": mod };
8
- };
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
19
+ }) : function(o, v) {
20
+ o["default"] = v;
21
+ });
22
+ var __importStar = (this && this.__importStar) || (function () {
23
+ var ownKeys = function(o) {
24
+ ownKeys = Object.getOwnPropertyNames || function (o) {
25
+ var ar = [];
26
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
27
+ return ar;
28
+ };
29
+ return ownKeys(o);
30
+ };
31
+ return function (mod) {
32
+ if (mod && mod.__esModule) return mod;
33
+ var result = {};
34
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
35
+ __setModuleDefault(result, mod);
36
+ return result;
37
+ };
38
+ })();
9
39
  Object.defineProperty(exports, "__esModule", { value: true });
10
40
  exports.ValidationProgress = void 0;
11
- const react_1 = __importDefault(require("react"));
41
+ const react_1 = __importStar(require("react"));
12
42
  const react_native_1 = require("react-native");
43
+ const biometric_identity_sdk_core_1 = require("@hexar/biometric-identity-sdk-core");
13
44
  const ValidationProgress = ({ progress, theme, language = 'en', }) => {
45
+ (0, react_1.useEffect)(() => {
46
+ if (language) {
47
+ (0, biometric_identity_sdk_core_1.setLanguage)(language);
48
+ }
49
+ }, [language]);
50
+ const strings = (0, biometric_identity_sdk_core_1.getStrings)();
14
51
  const getStatusText = () => {
15
52
  if (progress < 80)
16
- return language === 'es' ? 'Extrayendo datos del documento...' : 'Extracting document data...';
53
+ return strings.validation.checkingDocument || 'Extracting document data...';
17
54
  if (progress < 85)
18
- return language === 'es' ? 'Validando presencia vital...' : 'Validating liveness...';
19
- if (progress < 90)
20
- return language === 'es' ? 'Detectando rostro en documento...' : 'Detecting face in document...';
55
+ return strings.validation.checkingLiveness || 'Validating liveness...';
21
56
  if (progress < 95)
22
- return language === 'es' ? 'Comparando rostros...' : 'Comparing faces...';
23
- return language === 'es' ? 'Validando autenticidad del documento...' : 'Validating document authenticity...';
57
+ return strings.validation.matchingFaces || 'Comparing faces...';
58
+ return strings.validation.almostDone || 'Validating document authenticity...';
24
59
  };
25
60
  return (react_1.default.createElement(react_native_1.View, { style: styles.container },
26
61
  react_1.default.createElement(react_native_1.View, { style: styles.content },
27
62
  react_1.default.createElement(react_native_1.ActivityIndicator, { size: "large", color: theme?.primaryColor || '#6366F1' }),
28
- react_1.default.createElement(react_native_1.Text, { style: [styles.title, { color: theme?.textColor || '#000000' }] }, language === 'es' ? 'Validando Identidad' : 'Validating Identity'),
63
+ react_1.default.createElement(react_native_1.Text, { style: [styles.title, { color: theme?.textColor || '#000000' }] }, strings.validation.title || 'Validating Identity'),
29
64
  react_1.default.createElement(react_native_1.Text, { style: [styles.statusText, { color: theme?.secondaryTextColor || '#6B7280' }] }, getStatusText()),
30
65
  react_1.default.createElement(react_native_1.View, { style: styles.progressBarContainer },
31
66
  react_1.default.createElement(react_native_1.View, { style: styles.progressBar },
@@ -40,13 +75,11 @@ const ValidationProgress = ({ progress, theme, language = 'en', }) => {
40
75
  Math.round(progress),
41
76
  "%")),
42
77
  react_1.default.createElement(react_native_1.View, { style: styles.stepsContainer },
43
- react_1.default.createElement(ValidationStep, { icon: "\u2713", text: language === 'es' ? 'Extracción OCR' : 'OCR Extraction', completed: progress >= 80, theme: theme }),
44
- react_1.default.createElement(ValidationStep, { icon: "\u2713", text: language === 'es' ? 'Detección de Presencia Vital' : 'Liveness Detection', completed: progress >= 85, theme: theme }),
45
- react_1.default.createElement(ValidationStep, { icon: "\u2713", text: language === 'es' ? 'Coincidencia Facial' : 'Face Matching', completed: progress >= 95, theme: theme }),
46
- react_1.default.createElement(ValidationStep, { icon: "\u2713", text: language === 'es' ? 'Validación de Documento' : 'Document Validation', completed: progress >= 100, theme: theme })),
47
- react_1.default.createElement(react_native_1.Text, { style: styles.bottomText }, language === 'es'
48
- ? 'Esto puede tomar unos segundos...'
49
- : 'This may take a few seconds...'))));
78
+ react_1.default.createElement(ValidationStep, { icon: "\u2713", text: strings.validation.checkingDocument || 'OCR Extraction', completed: progress >= 80, theme: theme }),
79
+ react_1.default.createElement(ValidationStep, { icon: "\u2713", text: strings.validation.checkingLiveness || 'Liveness Detection', completed: progress >= 85, theme: theme }),
80
+ react_1.default.createElement(ValidationStep, { icon: "\u2713", text: strings.validation.matchingFaces || 'Face Matching', completed: progress >= 95, theme: theme }),
81
+ react_1.default.createElement(ValidationStep, { icon: "\u2713", text: strings.validation.checkingDocument || 'Document Validation', completed: progress >= 100, theme: theme })),
82
+ react_1.default.createElement(react_native_1.Text, { style: styles.bottomText }, strings.validation.almostDone || 'This may take a few seconds...'))));
50
83
  };
51
84
  exports.ValidationProgress = ValidationProgress;
52
85
  const ValidationStep = ({ icon, text, completed, theme, }) => (react_1.default.createElement(react_native_1.View, { style: stepStyles.container },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hexar/biometric-identity-sdk-react-native",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "description": "React Native wrapper for Biometric Identity SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -3,14 +3,14 @@
3
3
  * Shows AI validation progress
4
4
  */
5
5
 
6
- import React from 'react';
6
+ import React, { useEffect } from 'react';
7
7
  import {
8
8
  View,
9
9
  Text,
10
10
  StyleSheet,
11
11
  ActivityIndicator,
12
12
  } from 'react-native';
13
- import { ThemeConfig, SupportedLanguage } from '@hexar/biometric-identity-sdk-core';
13
+ import { ThemeConfig, SupportedLanguage, getStrings, setLanguage } from '@hexar/biometric-identity-sdk-core';
14
14
 
15
15
  export interface ValidationProgressProps {
16
16
  progress: number;
@@ -23,12 +23,19 @@ export const ValidationProgress: React.FC<ValidationProgressProps> = ({
23
23
  theme,
24
24
  language = 'en',
25
25
  }) => {
26
+ useEffect(() => {
27
+ if (language) {
28
+ setLanguage(language);
29
+ }
30
+ }, [language]);
31
+
32
+ const strings = getStrings();
33
+
26
34
  const getStatusText = () => {
27
- if (progress < 80) return language === 'es' ? 'Extrayendo datos del documento...' : 'Extracting document data...';
28
- if (progress < 85) return language === 'es' ? 'Validando presencia vital...' : 'Validating liveness...';
29
- if (progress < 90) return language === 'es' ? 'Detectando rostro en documento...' : 'Detecting face in document...';
30
- if (progress < 95) return language === 'es' ? 'Comparando rostros...' : 'Comparing faces...';
31
- return language === 'es' ? 'Validando autenticidad del documento...' : 'Validating document authenticity...';
35
+ if (progress < 80) return strings.validation.checkingDocument || 'Extracting document data...';
36
+ if (progress < 85) return strings.validation.checkingLiveness || 'Validating liveness...';
37
+ if (progress < 95) return strings.validation.matchingFaces || 'Comparing faces...';
38
+ return strings.validation.almostDone || 'Validating document authenticity...';
32
39
  };
33
40
 
34
41
  return (
@@ -40,7 +47,7 @@ export const ValidationProgress: React.FC<ValidationProgressProps> = ({
40
47
  />
41
48
 
42
49
  <Text style={[styles.title, { color: theme?.textColor || '#000000' }]}>
43
- {language === 'es' ? 'Validando Identidad' : 'Validating Identity'}
50
+ {strings.validation.title || 'Validating Identity'}
44
51
  </Text>
45
52
 
46
53
  <Text style={[styles.statusText, { color: theme?.secondaryTextColor || '#6B7280' }]}>
@@ -69,34 +76,32 @@ export const ValidationProgress: React.FC<ValidationProgressProps> = ({
69
76
  <View style={styles.stepsContainer}>
70
77
  <ValidationStep
71
78
  icon="✓"
72
- text={language === 'es' ? 'Extracción OCR' : 'OCR Extraction'}
79
+ text={strings.validation.checkingDocument || 'OCR Extraction'}
73
80
  completed={progress >= 80}
74
81
  theme={theme}
75
82
  />
76
83
  <ValidationStep
77
84
  icon="✓"
78
- text={language === 'es' ? 'Detección de Presencia Vital' : 'Liveness Detection'}
85
+ text={strings.validation.checkingLiveness || 'Liveness Detection'}
79
86
  completed={progress >= 85}
80
87
  theme={theme}
81
88
  />
82
89
  <ValidationStep
83
90
  icon="✓"
84
- text={language === 'es' ? 'Coincidencia Facial' : 'Face Matching'}
91
+ text={strings.validation.matchingFaces || 'Face Matching'}
85
92
  completed={progress >= 95}
86
93
  theme={theme}
87
94
  />
88
95
  <ValidationStep
89
96
  icon="✓"
90
- text={language === 'es' ? 'Validación de Documento' : 'Document Validation'}
97
+ text={strings.validation.checkingDocument || 'Document Validation'}
91
98
  completed={progress >= 100}
92
99
  theme={theme}
93
100
  />
94
101
  </View>
95
102
 
96
103
  <Text style={styles.bottomText}>
97
- {language === 'es'
98
- ? 'Esto puede tomar unos segundos...'
99
- : 'This may take a few seconds...'}
104
+ {strings.validation.almostDone || 'This may take a few seconds...'}
100
105
  </Text>
101
106
  </View>
102
107
  </View>