@hexar/biometric-identity-sdk-react-native 1.15.0 → 1.17.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.
@@ -1 +1 @@
1
- {"version":3,"file":"ProfilePictureCapture.d.ts","sourceRoot":"","sources":["../../src/components/ProfilePictureCapture.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAYxE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAmC,cAAc,EAAsB,MAAM,oCAAoC,CAAC;AAGzJ,MAAM,WAAW,8BAA8B;IAC7C,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,0BAA0B;IACzC,UAAU,EAAE,CAAC,MAAM,EAAE,8BAA8B,KAAK,IAAI,CAAC;IAC7D,OAAO,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAsZtE,CAAC;AA4EF,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"ProfilePictureCapture.d.ts","sourceRoot":"","sources":["../../src/components/ProfilePictureCapture.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAaxE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAmC,cAAc,EAAsB,MAAM,oCAAoC,CAAC;AAGzJ,MAAM,WAAW,8BAA8B;IAC7C,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,0BAA0B;IACzC,UAAU,EAAE,CAAC,MAAM,EAAE,8BAA8B,KAAK,IAAI,CAAC;IAC7D,OAAO,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAuZtE,CAAC;AA4EF,eAAe,qBAAqB,CAAC"}
@@ -172,10 +172,11 @@ const ProfilePictureCapture = ({ onComplete, onError, onCancel, theme, language,
172
172
  hasStartedAnimation.current = true;
173
173
  animatedProgress.setValue(0);
174
174
  setDisplayProgress(0);
175
- // Slow cosmetic fill to 80% over 45 seconds — real progress snaps ahead when it arrives
175
+ // Steady linear fill to 90% over 35 seconds — feels like real progress
176
176
  animationRef.current = react_native_1.Animated.timing(animatedProgress, {
177
- toValue: 80,
178
- duration: 45000,
177
+ toValue: 90,
178
+ duration: 35000,
179
+ easing: react_native_1.Easing.linear,
179
180
  useNativeDriver: false,
180
181
  });
181
182
  animationRef.current.start();
@@ -1 +1 @@
1
- {"version":3,"file":"ValidationProgress.d.ts","sourceRoot":"","sources":["../../src/components/ValidationProgress.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAsC,MAAM,OAAO,CAAC;AAQ3D,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,CAyGhE,CAAC;AA2DF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"ValidationProgress.d.ts","sourceRoot":"","sources":["../../src/components/ValidationProgress.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAsC,MAAM,OAAO,CAAC;AAQ3D,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,CA0GhE,CAAC;AA2DF,eAAe,kBAAkB,CAAC"}
@@ -52,36 +52,38 @@ const ValidationProgress = ({ progress, theme, language = 'en', }) => {
52
52
  }
53
53
  }, [language]);
54
54
  (0, react_1.useEffect)(() => {
55
- // Animate to whichever is higher: the fake "filling" target or real progress.
56
- // The fake fill reaches 80% in 60s so the bar never looks stuck even if the
57
- // backend is slow, but real progress always takes precedence.
55
+ const listener = animatedProgress.addListener(({ value }) => {
56
+ setDisplayProgress(Math.round(value));
57
+ });
58
+ return () => {
59
+ animatedProgress.removeListener(listener);
60
+ };
61
+ }, [animatedProgress]);
62
+ (0, react_1.useEffect)(() => {
63
+ // Smooth cosmetic fill: 0% → 95% over 35 seconds.
64
+ // The bar advances steadily so the user always sees progress,
65
+ // even while the backend is processing (10-30s typical).
66
+ // When real progress >= 95 arrives, we snap to the final value.
58
67
  if (!hasStartedAnimation.current) {
59
68
  hasStartedAnimation.current = true;
60
- // Slow fill to 80% over 60 seconds — purely cosmetic
61
69
  animationRef.current = react_native_1.Animated.timing(animatedProgress, {
62
- toValue: 80,
63
- duration: 60000,
70
+ toValue: 95,
71
+ duration: 35000,
64
72
  useNativeDriver: false,
65
73
  });
66
74
  animationRef.current.start();
67
75
  }
68
- // When real progress arrives and exceeds the current animated value, snap to it
69
- if (progress > 0) {
76
+ // When backend returns final result (progress >= 95), snap to it
77
+ if (progress >= 95) {
70
78
  if (animationRef.current) {
71
79
  animationRef.current.stop();
72
80
  }
73
81
  react_native_1.Animated.timing(animatedProgress, {
74
- toValue: Math.max(progress, 80), // never go backwards
75
- duration: progress >= 90 ? 500 : 300,
82
+ toValue: progress,
83
+ duration: 500,
76
84
  useNativeDriver: false,
77
85
  }).start();
78
86
  }
79
- const listener = animatedProgress.addListener(({ value }) => {
80
- setDisplayProgress(Math.round(value));
81
- });
82
- return () => {
83
- animatedProgress.removeListener(listener);
84
- };
85
87
  }, [progress, animatedProgress]);
86
88
  const strings = (0, biometric_identity_sdk_core_1.getStrings)();
87
89
  const progressWidth = animatedProgress.interpolate({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hexar/biometric-identity-sdk-react-native",
3
- "version": "1.15.0",
3
+ "version": "1.17.0",
4
4
  "description": "React Native wrapper for Biometric Identity SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -6,6 +6,7 @@ import {
6
6
  ActivityIndicator,
7
7
  SafeAreaView,
8
8
  Animated,
9
+ Easing,
9
10
  TouchableOpacity,
10
11
  } from 'react-native';
11
12
  import { VideoRecorder, VideoRecordingResult } from './VideoRecorder';
@@ -185,10 +186,11 @@ export const ProfilePictureCapture: React.FC<ProfilePictureCaptureProps> = ({
185
186
  animatedProgress.setValue(0);
186
187
  setDisplayProgress(0);
187
188
 
188
- // Slow cosmetic fill to 80% over 45 seconds — real progress snaps ahead when it arrives
189
+ // Steady linear fill to 90% over 35 seconds — feels like real progress
189
190
  animationRef.current = Animated.timing(animatedProgress, {
190
- toValue: 80,
191
- duration: 45000,
191
+ toValue: 90,
192
+ duration: 35000,
193
+ easing: Easing.linear,
192
194
  useNativeDriver: false,
193
195
  });
194
196
 
@@ -36,40 +36,41 @@ export const ValidationProgress: React.FC<ValidationProgressProps> = ({
36
36
  }, [language]);
37
37
 
38
38
  useEffect(() => {
39
- // Animate to whichever is higher: the fake "filling" target or real progress.
40
- // The fake fill reaches 80% in 60s so the bar never looks stuck even if the
41
- // backend is slow, but real progress always takes precedence.
39
+ const listener = animatedProgress.addListener(({ value }) => {
40
+ setDisplayProgress(Math.round(value));
41
+ });
42
+ return () => {
43
+ animatedProgress.removeListener(listener);
44
+ };
45
+ }, [animatedProgress]);
46
+
47
+ useEffect(() => {
48
+ // Smooth cosmetic fill: 0% → 95% over 35 seconds.
49
+ // The bar advances steadily so the user always sees progress,
50
+ // even while the backend is processing (10-30s typical).
51
+ // When real progress >= 95 arrives, we snap to the final value.
42
52
  if (!hasStartedAnimation.current) {
43
53
  hasStartedAnimation.current = true;
44
54
 
45
- // Slow fill to 80% over 60 seconds — purely cosmetic
46
55
  animationRef.current = Animated.timing(animatedProgress, {
47
- toValue: 80,
48
- duration: 60000,
56
+ toValue: 95,
57
+ duration: 35000,
49
58
  useNativeDriver: false,
50
59
  });
51
60
  animationRef.current.start();
52
61
  }
53
62
 
54
- // When real progress arrives and exceeds the current animated value, snap to it
55
- if (progress > 0) {
63
+ // When backend returns final result (progress >= 95), snap to it
64
+ if (progress >= 95) {
56
65
  if (animationRef.current) {
57
66
  animationRef.current.stop();
58
67
  }
59
68
  Animated.timing(animatedProgress, {
60
- toValue: Math.max(progress, 80), // never go backwards
61
- duration: progress >= 90 ? 500 : 300,
69
+ toValue: progress,
70
+ duration: 500,
62
71
  useNativeDriver: false,
63
72
  }).start();
64
73
  }
65
-
66
- const listener = animatedProgress.addListener(({ value }) => {
67
- setDisplayProgress(Math.round(value));
68
- });
69
-
70
- return () => {
71
- animatedProgress.removeListener(listener);
72
- };
73
74
  }, [progress, animatedProgress]);
74
75
 
75
76
  const strings = getStrings();