@hexar/biometric-identity-sdk-react-native 1.16.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":"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.16.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",
@@ -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();