omnipay-reactnative-sdk 1.2.3-beta.8 → 1.2.3

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.
Files changed (58) hide show
  1. package/README.md +42 -102
  2. package/android/build.gradle +4 -15
  3. package/android/src/main/java/com/omniretail/omnipay/OmnipayActivityPackage.java +0 -5
  4. package/lib/commonjs/components/OmnipayProvider.js +91 -18
  5. package/lib/commonjs/components/OmnipayProvider.js.map +1 -1
  6. package/lib/module/components/OmnipayProvider.js +92 -19
  7. package/lib/module/components/OmnipayProvider.js.map +1 -1
  8. package/lib/module/components/OmnipayView.js.map +1 -1
  9. package/lib/module/components/views/BvnVerification.js.map +1 -1
  10. package/lib/module/components/views/PaylaterAgreement.js.map +1 -1
  11. package/lib/module/components/views/Registration.js.map +1 -1
  12. package/lib/typescript/components/OmnipayProvider.d.ts +3 -2
  13. package/lib/typescript/components/OmnipayProvider.d.ts.map +1 -1
  14. package/lib/typescript/hooks/useOmnipay.d.ts +2 -1
  15. package/lib/typescript/hooks/useOmnipay.d.ts.map +1 -1
  16. package/package.json +12 -29
  17. package/src/components/OmnipayProvider.tsx +133 -21
  18. package/src/components/OmnipayView.tsx +1 -1
  19. package/src/components/views/BvnVerification.tsx +1 -1
  20. package/src/components/views/PaylaterAgreement.tsx +1 -1
  21. package/src/components/views/Registration.tsx +1 -1
  22. package/src/hooks/useOmnipay.tsx +1 -1
  23. package/android/src/main/java/com/omniretail/omnipay/FaceVerificationFrameProcessor.kt +0 -111
  24. package/ios/FaceVerificationFrameProcessor.swift +0 -138
  25. package/ios/FaceVerificationFrameProcessorPlugin.m +0 -10
  26. package/ios/OmnipayReactnativeSdk.m +0 -5
  27. package/ios/OmnipayReactnativeSdk.swift +0 -10
  28. package/ios/omnipay-reactnative-sdk-Bridging-Header.h +0 -8
  29. package/ios/omnipay_reactnative_sdk.h +0 -6
  30. package/lib/commonjs/components/Button.js +0 -68
  31. package/lib/commonjs/components/Button.js.map +0 -1
  32. package/lib/commonjs/components/biometrics/FaceVerification.js +0 -380
  33. package/lib/commonjs/components/biometrics/FaceVerification.js.map +0 -1
  34. package/lib/commonjs/components/biometrics/useFaceVerification.js +0 -85
  35. package/lib/commonjs/components/biometrics/useFaceVerification.js.map +0 -1
  36. package/lib/commonjs/components/biometrics/useFaceVerificationFlow.js +0 -157
  37. package/lib/commonjs/components/biometrics/useFaceVerificationFlow.js.map +0 -1
  38. package/lib/module/components/Button.js +0 -61
  39. package/lib/module/components/Button.js.map +0 -1
  40. package/lib/module/components/biometrics/FaceVerification.js +0 -372
  41. package/lib/module/components/biometrics/FaceVerification.js.map +0 -1
  42. package/lib/module/components/biometrics/useFaceVerification.js +0 -78
  43. package/lib/module/components/biometrics/useFaceVerification.js.map +0 -1
  44. package/lib/module/components/biometrics/useFaceVerificationFlow.js +0 -150
  45. package/lib/module/components/biometrics/useFaceVerificationFlow.js.map +0 -1
  46. package/lib/typescript/components/Button.d.ts +0 -17
  47. package/lib/typescript/components/Button.d.ts.map +0 -1
  48. package/lib/typescript/components/biometrics/FaceVerification.d.ts +0 -9
  49. package/lib/typescript/components/biometrics/FaceVerification.d.ts.map +0 -1
  50. package/lib/typescript/components/biometrics/useFaceVerification.d.ts +0 -38
  51. package/lib/typescript/components/biometrics/useFaceVerification.d.ts.map +0 -1
  52. package/lib/typescript/components/biometrics/useFaceVerificationFlow.d.ts +0 -29
  53. package/lib/typescript/components/biometrics/useFaceVerificationFlow.d.ts.map +0 -1
  54. package/omnipay_reactnative_sdk.podspec +0 -50
  55. package/src/components/Button.tsx +0 -86
  56. package/src/components/biometrics/FaceVerification.tsx +0 -429
  57. package/src/components/biometrics/useFaceVerification.ts +0 -120
  58. package/src/components/biometrics/useFaceVerificationFlow.ts +0 -224
@@ -1,380 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _reactNative = require("react-native");
9
- var _reactNativeVisionCamera = require("react-native-vision-camera");
10
- var _Button = _interopRequireDefault(require("../Button"));
11
- var _useFaceVerification = require("./useFaceVerification");
12
- var _useFaceVerificationFlow = require("./useFaceVerificationFlow");
13
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
15
- const FaceVerification = ({
16
- onClose,
17
- onSuccess,
18
- primaryColor
19
- }) => {
20
- const device = (0, _reactNativeVisionCamera.useCameraDevice)('front');
21
- const {
22
- hasPermission,
23
- requestPermission
24
- } = (0, _reactNativeVisionCamera.useCameraPermission)();
25
- const [isRequestingPermission, setIsRequestingPermission] = (0, _react.useState)(false);
26
-
27
- // Face verification flow
28
- const {
29
- state: flowState,
30
- resetFlow,
31
- isCompleted,
32
- isFailed
33
- } = (0, _useFaceVerificationFlow.useFaceVerificationFlow)();
34
-
35
- // Frame processor
36
- const frameProcessor = (0, _useFaceVerification.useFaceVerification)();
37
-
38
- // Handle completion
39
- (0, _react.useEffect)(() => {
40
- if (isCompleted) {
41
- setTimeout(() => {
42
- onSuccess();
43
- }, 1000); // Show success message briefly
44
- }
45
- }, [isCompleted, onSuccess]);
46
- const handleRequestPermission = async () => {
47
- setIsRequestingPermission(true);
48
- try {
49
- await requestPermission();
50
- } catch (error) {
51
- console.error('Error requesting camera permission:', error);
52
- } finally {
53
- setIsRequestingPermission(false);
54
- }
55
- };
56
- const renderPermissionRequest = () => /*#__PURE__*/_react.default.createElement(_reactNative.View, {
57
- style: styles.permissionContainer
58
- }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
59
- style: styles.permissionIconContainer
60
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
61
- style: styles.permissionIcon
62
- }, "\uD83D\uDCF7")), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
63
- style: styles.permissionTitle
64
- }, "Camera Permission Required"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
65
- style: styles.permissionDescription
66
- }, "To verify your identity, we need access to your camera. This allows us to capture your face for secure verification."), /*#__PURE__*/_react.default.createElement(_Button.default, {
67
- title: "Allow Camera Access",
68
- onPress: handleRequestPermission,
69
- backgroundColor: primaryColor,
70
- loading: isRequestingPermission
71
- }));
72
- const renderNoDevice = () => /*#__PURE__*/_react.default.createElement(_reactNative.View, {
73
- style: styles.errorContainer
74
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
75
- style: styles.errorTitle
76
- }, "Camera Not Available"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
77
- style: styles.errorSubtitle
78
- }, "No front camera detected on this device. Face verification requires a front-facing camera."));
79
- const renderCamera = () => {
80
- if (!device) return null;
81
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
82
- style: styles.cameraContainer
83
- }, /*#__PURE__*/_react.default.createElement(_reactNativeVisionCamera.Camera, {
84
- device: device,
85
- style: styles.camera,
86
- isActive: true,
87
- frameProcessor: frameProcessor
88
- }), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
89
- style: styles.cameraOverlay
90
- }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
91
- style: styles.faceFrame
92
- }), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
93
- style: styles.progressContainer
94
- }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
95
- style: [styles.progressBar, {
96
- width: `${flowState.progress}%`,
97
- backgroundColor: primaryColor
98
- }]
99
- })), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
100
- style: styles.instructionText
101
- }, flowState.instruction), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
102
- style: styles.stepIndicator
103
- }, "Step ", flowState.completedSteps.length + 1, " of 5"), isCompleted && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
104
- style: [styles.statusContainer, {
105
- backgroundColor: primaryColor
106
- }]
107
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
108
- style: styles.statusText
109
- }, "\u2713 Verification Complete!")), isFailed && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
110
- style: [styles.statusContainer, styles.statusContainerError]
111
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
112
- style: styles.statusText
113
- }, "\u2717 Verification Failed"), /*#__PURE__*/_react.default.createElement(_Button.default, {
114
- title: "Try Again",
115
- onPress: resetFlow,
116
- backgroundColor: "white",
117
- textColor: "#ff4444",
118
- style: styles.retryButton
119
- }))));
120
- };
121
- console.log(onSuccess, primaryColor);
122
- return /*#__PURE__*/_react.default.createElement(_reactNative.Modal, {
123
- visible: true,
124
- transparent: true,
125
- onRequestClose: onClose,
126
- style: styles.modal
127
- }, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
128
- style: styles.backdrop,
129
- activeOpacity: 1,
130
- onPress: onClose
131
- }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
132
- style: [styles.container]
133
- }, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
134
- style: styles.close,
135
- onPress: onClose
136
- }, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
137
- source: require('../../assets/cancel.png'),
138
- style: styles.closeIcon
139
- })), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
140
- style: styles.contentContainer
141
- }, !hasPermission && renderPermissionRequest(), hasPermission && !device && renderNoDevice(), hasPermission && device && renderCamera()))));
142
- };
143
- var _default = exports.default = FaceVerification;
144
- const styles = _reactNative.StyleSheet.create({
145
- hide: {
146
- display: 'none'
147
- },
148
- full: {
149
- flex: 1,
150
- width: '100%',
151
- height: '100%'
152
- },
153
- webview: {
154
- flex: 1,
155
- width: '100%',
156
- height: _reactNative.Dimensions.get('window').height - 40,
157
- backgroundColor: 'white',
158
- borderTopRightRadius: 20,
159
- borderTopLeftRadius: 20,
160
- paddingTop: 150
161
- },
162
- webviewLoader: {
163
- zIndex: 3,
164
- backgroundColor: 'white',
165
- alignItems: 'center',
166
- justifyContent: 'center',
167
- flex: 1,
168
- width: '100%',
169
- height: '100%',
170
- position: 'absolute',
171
- top: 0,
172
- left: 0,
173
- borderTopRightRadius: 20,
174
- borderTopLeftRadius: 20
175
- },
176
- backdrop: {
177
- backgroundColor: 'rgba(0,0,0,0.3)',
178
- flex: 1,
179
- justifyContent: 'flex-end',
180
- position: 'relative',
181
- height: '100%'
182
- },
183
- container: {
184
- backgroundColor: 'white',
185
- borderTopRightRadius: 20,
186
- borderTopLeftRadius: 20,
187
- maxHeight: _reactNative.Dimensions.get('window').height - 120,
188
- flex: 1,
189
- position: 'relative',
190
- ...(_reactNative.Platform.OS === 'android' && {
191
- overflow: 'hidden'
192
- })
193
- },
194
- modal: {
195
- flex: 1,
196
- backgroundColor: 'rgba(0,0,0,0.48)',
197
- height: '100%',
198
- width: '100%'
199
- },
200
- close: {
201
- position: 'absolute',
202
- top: 10,
203
- right: 10,
204
- backgroundColor: 'white',
205
- height: 24,
206
- width: 24,
207
- borderRadius: 1000,
208
- alignItems: 'center',
209
- justifyContent: 'center',
210
- zIndex: 2
211
- },
212
- closeIcon: {
213
- height: 12,
214
- width: 12
215
- },
216
- contentContainer: {
217
- height: '100%',
218
- position: 'relative',
219
- borderTopRightRadius: 20,
220
- borderTopLeftRadius: 20,
221
- padding: 16
222
- },
223
- testContent: {
224
- paddingTop: 30,
225
- paddingLeft: 16
226
- },
227
- testTwoContent: {
228
- paddingTop: 10,
229
- paddingLeft: 16
230
- },
231
- errorSubtitle: {
232
- textAlign: 'center',
233
- fontSize: 14,
234
- color: '#5e7079',
235
- marginBottom: 20,
236
- paddingHorizontal: 8,
237
- marginTop: 14
238
- },
239
- errorContainer: {
240
- flex: 1,
241
- justifyContent: 'center',
242
- alignItems: 'center',
243
- width: _reactNative.Dimensions.get('window').width,
244
- height: _reactNative.Dimensions.get('window').height,
245
- zIndex: 2,
246
- backgroundColor: 'white'
247
- },
248
- camera: {
249
- width: '100%',
250
- height: 400
251
- },
252
- // Permission request styles
253
- permissionContainer: {
254
- flex: 1,
255
- justifyContent: 'center',
256
- alignItems: 'center',
257
- paddingHorizontal: 24,
258
- paddingVertical: 40
259
- },
260
- permissionIconContainer: {
261
- width: 80,
262
- height: 80,
263
- borderRadius: 40,
264
- backgroundColor: '#f0f0f0',
265
- justifyContent: 'center',
266
- alignItems: 'center',
267
- marginBottom: 24
268
- },
269
- permissionIcon: {
270
- fontSize: 40
271
- },
272
- permissionTitle: {
273
- fontSize: 20,
274
- fontWeight: '600',
275
- color: '#1a1a1a',
276
- textAlign: 'center',
277
- marginBottom: 12
278
- },
279
- permissionDescription: {
280
- fontSize: 16,
281
- color: '#666',
282
- textAlign: 'center',
283
- lineHeight: 22,
284
- marginBottom: 32
285
- },
286
- // Error styles
287
- errorTitle: {
288
- fontSize: 18,
289
- fontWeight: '600',
290
- color: '#1a1a1a',
291
- textAlign: 'center',
292
- marginBottom: 8
293
- },
294
- // Camera styles
295
- cameraContainer: {
296
- flex: 1,
297
- position: 'relative',
298
- marginTop: 60
299
- },
300
- cameraOverlay: {
301
- position: 'absolute',
302
- top: 0,
303
- left: 0,
304
- right: 0,
305
- bottom: 0,
306
- justifyContent: 'center',
307
- alignItems: 'center'
308
- },
309
- faceFrame: {
310
- width: 200,
311
- height: 250,
312
- borderWidth: 3,
313
- borderColor: 'white',
314
- borderRadius: 100,
315
- borderStyle: 'dashed',
316
- backgroundColor: 'transparent'
317
- },
318
- instructionText: {
319
- color: 'white',
320
- fontSize: 16,
321
- fontWeight: '500',
322
- textAlign: 'center',
323
- marginTop: 20,
324
- backgroundColor: 'rgba(0,0,0,0.7)',
325
- paddingHorizontal: 16,
326
- paddingVertical: 8,
327
- borderRadius: 20
328
- },
329
- // Verification flow styles
330
- progressContainer: {
331
- position: 'absolute',
332
- top: 20,
333
- left: 20,
334
- right: 20,
335
- height: 4,
336
- backgroundColor: 'rgba(255,255,255,0.3)',
337
- borderRadius: 2,
338
- overflow: 'hidden'
339
- },
340
- progressBar: {
341
- height: '100%',
342
- borderRadius: 2
343
- },
344
- stepIndicator: {
345
- color: 'white',
346
- fontSize: 14,
347
- fontWeight: '400',
348
- textAlign: 'center',
349
- marginTop: 8,
350
- backgroundColor: 'rgba(0,0,0,0.5)',
351
- paddingHorizontal: 12,
352
- paddingVertical: 4,
353
- borderRadius: 12,
354
- alignSelf: 'center'
355
- },
356
- statusContainer: {
357
- position: 'absolute',
358
- bottom: 40,
359
- left: 20,
360
- right: 20,
361
- padding: 20,
362
- borderRadius: 12,
363
- alignItems: 'center'
364
- },
365
- statusContainerError: {
366
- backgroundColor: '#ff4444'
367
- },
368
- statusText: {
369
- color: 'white',
370
- fontSize: 18,
371
- fontWeight: '600',
372
- textAlign: 'center',
373
- marginBottom: 8
374
- },
375
- retryButton: {
376
- marginTop: 12,
377
- minWidth: 120
378
- }
379
- });
380
- //# sourceMappingURL=FaceVerification.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeVisionCamera","_Button","_interopRequireDefault","_useFaceVerification","_useFaceVerificationFlow","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","FaceVerification","onClose","onSuccess","primaryColor","device","useCameraDevice","hasPermission","requestPermission","useCameraPermission","isRequestingPermission","setIsRequestingPermission","useState","state","flowState","resetFlow","isCompleted","isFailed","useFaceVerificationFlow","frameProcessor","useFaceVerification","useEffect","setTimeout","handleRequestPermission","error","console","renderPermissionRequest","createElement","View","style","styles","permissionContainer","permissionIconContainer","Text","permissionIcon","permissionTitle","permissionDescription","title","onPress","backgroundColor","loading","renderNoDevice","errorContainer","errorTitle","errorSubtitle","renderCamera","cameraContainer","Camera","camera","isActive","cameraOverlay","faceFrame","progressContainer","progressBar","width","progress","instructionText","instruction","stepIndicator","completedSteps","length","statusContainer","statusText","statusContainerError","textColor","retryButton","log","Modal","visible","transparent","onRequestClose","modal","TouchableOpacity","backdrop","activeOpacity","container","close","Image","source","closeIcon","contentContainer","_default","exports","StyleSheet","create","hide","display","full","flex","height","webview","Dimensions","borderTopRightRadius","borderTopLeftRadius","paddingTop","webviewLoader","zIndex","alignItems","justifyContent","position","top","left","maxHeight","Platform","OS","overflow","right","borderRadius","padding","testContent","paddingLeft","testTwoContent","textAlign","fontSize","color","marginBottom","paddingHorizontal","marginTop","paddingVertical","fontWeight","lineHeight","bottom","borderWidth","borderColor","borderStyle","alignSelf","minWidth"],"sourceRoot":"../../../../src","sources":["components/biometrics/FaceVerification.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAUA,IAAAE,wBAAA,GAAAF,OAAA;AAKA,IAAAG,OAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,oBAAA,GAAAL,OAAA;AACA,IAAAM,wBAAA,GAAAN,OAAA;AAAoE,SAAAI,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAR,wBAAAQ,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAZ,uBAAA,YAAAA,CAAAQ,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAR,OAAA,EAAAF,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Z9E,eAAe,EAAE,iBAAiB;IAClC6E,iBAAiB,EAAE,EAAE;IACrBE,eAAe,EAAE,CAAC;IAClBX,YAAY,EAAE,EAAE;IAChBkB,SAAS,EAAE;EACb,CAAC;EACDhE,eAAe,EAAE;IACfsC,QAAQ,EAAE,UAAU;IACpBsB,MAAM,EAAE,EAAE;IACVpB,IAAI,EAAE,EAAE;IACRK,KAAK,EAAE,EAAE;IACTE,OAAO,EAAE,EAAE;IACXD,YAAY,EAAE,EAAE;IAChBV,UAAU,EAAE;EACd,CAAC;EACDlC,oBAAoB,EAAE;IACpBxB,eAAe,EAAE;EACnB,CAAC;EACDuB,UAAU,EAAE;IACVoD,KAAK,EAAE,OAAO;IACdD,QAAQ,EAAE,EAAE;IACZM,UAAU,EAAE,KAAK;IACjBP,SAAS,EAAE,QAAQ;IACnBG,YAAY,EAAE;EAChB,CAAC;EACDlD,WAAW,EAAE;IACXoD,SAAS,EAAE,EAAE;IACbS,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
@@ -1,85 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useFaceVerification = exports.FaceVerificationUtils = void 0;
7
- var _reactNativeVisionCamera = require("react-native-vision-camera");
8
- // Note: For production use, you would typically use shared values or state management
9
- // to communicate results from the worklet back to the React component.
10
- // This simplified version just logs results for debugging.
11
-
12
- // Initialize the plugin
13
- const plugin = _reactNativeVisionCamera.VisionCameraProxy.initFrameProcessorPlugin('detectFaces', {});
14
- const useFaceVerification = () => {
15
- const frameProcessor = (0, _reactNativeVisionCamera.useFrameProcessor)(frame => {
16
- 'worklet';
17
-
18
- try {
19
- if (plugin == null) {
20
- console.error('Failed to load Frame Processor Plugin "detectFaces"!');
21
- return null;
22
- }
23
- const result = plugin.call(frame, {});
24
-
25
- // For debugging - this works in worklets
26
- if (result && result.faceDetected) {
27
- console.log('Face detected:', result);
28
- }
29
- return result;
30
- } catch (error) {
31
- console.error('Face verification error:', error);
32
- return {
33
- faceDetected: false,
34
- error: error instanceof Error ? error.message : 'Unknown error'
35
- };
36
- }
37
- }, []);
38
- return frameProcessor;
39
- };
40
-
41
- // Utility functions for interpreting results
42
- exports.useFaceVerification = useFaceVerification;
43
- const FaceVerificationUtils = exports.FaceVerificationUtils = {
44
- // Check if head is turned left (yaw > 20 degrees)
45
- isHeadTurnedLeft: result => {
46
- var _result$headPose;
47
- return (_result$headPose = result.headPose) !== null && _result$headPose !== void 0 && _result$headPose.yaw ? result.headPose.yaw > 20 : false;
48
- },
49
- // Check if head is turned right (yaw < -20 degrees)
50
- isHeadTurnedRight: result => {
51
- var _result$headPose2;
52
- return (_result$headPose2 = result.headPose) !== null && _result$headPose2 !== void 0 && _result$headPose2.yaw ? result.headPose.yaw < -20 : false;
53
- },
54
- // Check if head is tilted up (pitch > 10 degrees)
55
- isHeadTiltedUp: result => {
56
- var _result$headPose3;
57
- return (_result$headPose3 = result.headPose) !== null && _result$headPose3 !== void 0 && _result$headPose3.pitch ? result.headPose.pitch > 10 : false;
58
- },
59
- // Check if head is tilted down (pitch < -10 degrees)
60
- isHeadTiltedDown: result => {
61
- var _result$headPose4;
62
- return (_result$headPose4 = result.headPose) !== null && _result$headPose4 !== void 0 && _result$headPose4.pitch ? result.headPose.pitch < -10 : false;
63
- },
64
- // Check if face is centered (within ±10 degrees)
65
- isFaceCentered: result => {
66
- if (!result.headPose) return false;
67
- const {
68
- yaw,
69
- pitch
70
- } = result.headPose;
71
- return Math.abs(yaw) <= 10 && Math.abs(pitch) <= 10;
72
- },
73
- // Check if smile is confident (high probability)
74
- isConfidentSmile: result => {
75
- return result.smileProbability ? result.smileProbability > 0.8 : result.isSmiling || false;
76
- },
77
- // Check if both eyes are confidently closed
78
- isConfidentBlink: result => {
79
- if (result.leftEyeOpenProbability !== undefined && result.rightEyeOpenProbability !== undefined) {
80
- return result.leftEyeOpenProbability < 0.2 && result.rightEyeOpenProbability < 0.2;
81
- }
82
- return result.isBlinking || false;
83
- }
84
- };
85
- //# sourceMappingURL=useFaceVerification.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_reactNativeVisionCamera","require","plugin","VisionCameraProxy","initFrameProcessorPlugin","useFaceVerification","frameProcessor","useFrameProcessor","frame","console","error","result","call","faceDetected","log","Error","message","exports","FaceVerificationUtils","isHeadTurnedLeft","_result$headPose","headPose","yaw","isHeadTurnedRight","_result$headPose2","isHeadTiltedUp","_result$headPose3","pitch","isHeadTiltedDown","_result$headPose4","isFaceCentered","Math","abs","isConfidentSmile","smileProbability","isSmiling","isConfidentBlink","leftEyeOpenProbability","undefined","rightEyeOpenProbability","isBlinking"],"sourceRoot":"../../../../src","sources":["components/biometrics/useFaceVerification.ts"],"mappings":";;;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AAiCA;AACA;AACA;;AAEA;AACA,MAAMC,MAAM,GAAGC,0CAAiB,CAACC,wBAAwB,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;AAErE,MAAMC,mBAAmB,GAAGA,CAAA,KAAM;EACvC,MAAMC,cAAc,GAAG,IAAAC,0CAAiB,EAAEC,KAAK,IAAK;IAClD,SAAS;;IAET,IAAI;MACF,IAAIN,MAAM,IAAI,IAAI,EAAE;QAClBO,OAAO,CAACC,KAAK,CAAC,sDAAsD,CAAC;QACrE,OAAO,IAAI;MACb;MAEA,MAAMC,MAAM,GAAGT,MAAM,CAACU,IAAI,CAACJ,KAAK,EAAE,CAAC,CAAC,CAAQ;;MAE5C;MACA,IAAIG,MAAM,IAAIA,MAAM,CAACE,YAAY,EAAE;QACjCJ,OAAO,CAACK,GAAG,CAAC,gBAAgB,EAAEH,MAAM,CAAC;MACvC;MAEA,OAAOA,MAAM;IACf,CAAC,CAAC,OAAOD,KAAK,EAAE;MACdD,OAAO,CAACC,KAAK,CAAC,0BAA0B,EAAEA,KAAK,CAAC;MAChD,OAAO;QACLG,YAAY,EAAE,KAAK;QACnBH,KAAK,EAAEA,KAAK,YAAYK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AACU,QAAQ,EAAE,OAAO,KAAK;IAClC,MAAM;MAAEC,GAAG;MAAEK;IAAM,CAAC,GAAGhB,MAAM,CAACU,QAAQ;IACtC,OAAOU,IAAI,CAACC,GAAG,CAACV,GAAG,CAAC,IAAI,EAAE,IAAIS,IAAI,CAACC,GAAG,CAACL,KAAK,CAAC,IAAI,EAAE;EACrD,CAAC;EAED;EACAM,gBAAgB,EAAGtB,MAA8B,IAAc;IAC7D,OAAOA,MAAM,CAACuB,gBAAgB,GAC1BvB,MAAM,CAACuB,gBAAgB,GAAG,GAAG,GAC7BvB,MAAM,CAACwB,SAAS,IAAI,KAAK;EAC/B,CAAC;EAED;EACAC,gBAAgB,EAAGzB,MAA8B,IAAc;IAC7D,IACEA,MAAM,CAAC0B,sBAAsB,KAAKC,SAAS,IAC3C3B,MAAM,CAAC4B,uBAAuB,KAAKD,SAAS,EAC5C;MACA,OACE3B,MAAM,CAAC0B,sBAAsB,GAAG,GAAG,IACnC1B,MAAM,CAAC4B,uBAAuB,GAAG,GAAG;IAExC;IACA,OAAO5B,MAAM,CAAC6B,UAAU,IAAI,KAAK;EACnC;AACF,CAAC","ignoreList":[]}
@@ -1,157 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useFaceVerificationFlow = void 0;
7
- var _react = require("react");
8
- var _useFaceVerification = require("./useFaceVerification");
9
- const DEFAULT_CONFIG = {
10
- stepTimeout: 10000,
11
- // 10 seconds per step
12
- totalTimeout: 60000,
13
- // 1 minute total
14
- confirmationFrames: 5,
15
- // 5 consecutive frames
16
- requiredSteps: ['position_face', 'smile', 'blink', 'turn_left', 'turn_right']
17
- };
18
- const STEP_INSTRUCTIONS = {
19
- position_face: 'Position your face in the center of the frame',
20
- smile: 'Please smile for the camera',
21
- blink: 'Please blink your eyes',
22
- turn_left: 'Slowly turn your head to the left',
23
- turn_right: 'Slowly turn your head to the right',
24
- completed: 'Verification completed successfully!',
25
- failed: 'Verification failed. Please try again.'
26
- };
27
- const useFaceVerificationFlow = (config = {}) => {
28
- const fullConfig = {
29
- ...DEFAULT_CONFIG,
30
- ...config
31
- };
32
- const [state, setState] = (0, _react.useState)({
33
- currentStep: 'position_face',
34
- completedSteps: [],
35
- stepStartTime: Date.now(),
36
- totalStartTime: Date.now(),
37
- isProcessing: false,
38
- progress: 0,
39
- instruction: STEP_INSTRUCTIONS.position_face
40
- });
41
- const [confirmationCount, setConfirmationCount] = (0, _react.useState)(0);
42
-
43
- // Reset verification flow
44
- const resetFlow = (0, _react.useCallback)(() => {
45
- const now = Date.now();
46
- setState({
47
- currentStep: 'position_face',
48
- completedSteps: [],
49
- stepStartTime: now,
50
- totalStartTime: now,
51
- isProcessing: false,
52
- progress: 0,
53
- instruction: STEP_INSTRUCTIONS.position_face
54
- });
55
- setConfirmationCount(0);
56
- }, []);
57
-
58
- // Check if current step is completed based on face detection result
59
- const checkStepCompletion = (0, _react.useCallback)(result => {
60
- if (!result.faceDetected) return false;
61
- switch (state.currentStep) {
62
- case 'position_face':
63
- return _useFaceVerification.FaceVerificationUtils.isFaceCentered(result);
64
- case 'smile':
65
- return _useFaceVerification.FaceVerificationUtils.isConfidentSmile(result);
66
- case 'blink':
67
- return _useFaceVerification.FaceVerificationUtils.isConfidentBlink(result);
68
- case 'turn_left':
69
- return _useFaceVerification.FaceVerificationUtils.isHeadTurnedLeft(result);
70
- case 'turn_right':
71
- return _useFaceVerification.FaceVerificationUtils.isHeadTurnedRight(result);
72
- default:
73
- return false;
74
- }
75
- }, [state.currentStep]);
76
-
77
- // Get next step in sequence
78
- const getNextStep = (0, _react.useCallback)(currentStep => {
79
- const currentIndex = fullConfig.requiredSteps.indexOf(currentStep);
80
- if (currentIndex === -1 || currentIndex === fullConfig.requiredSteps.length - 1) {
81
- return 'completed';
82
- }
83
- const nextStep = fullConfig.requiredSteps[currentIndex + 1];
84
- return nextStep || 'completed';
85
- }, [fullConfig.requiredSteps]);
86
-
87
- // Process face detection result
88
- const processFaceResult = (0, _react.useCallback)(result => {
89
- if (state.currentStep === 'completed' || state.currentStep === 'failed') {
90
- return;
91
- }
92
- const now = Date.now();
93
-
94
- // Check for timeouts
95
- if (now - state.totalStartTime > fullConfig.totalTimeout) {
96
- setState(prev => ({
97
- ...prev,
98
- currentStep: 'failed',
99
- instruction: 'Verification timed out. Please try again.',
100
- error: 'Total verification timeout exceeded'
101
- }));
102
- return;
103
- }
104
- if (now - state.stepStartTime > fullConfig.stepTimeout) {
105
- setState(prev => ({
106
- ...prev,
107
- currentStep: 'failed',
108
- instruction: 'Step timed out. Please try again.',
109
- error: 'Step timeout exceeded'
110
- }));
111
- return;
112
- }
113
-
114
- // Check if current step is completed
115
- const stepCompleted = checkStepCompletion(result);
116
- if (stepCompleted) {
117
- setConfirmationCount(prev => prev + 1);
118
-
119
- // Require multiple consecutive confirmations
120
- if (confirmationCount + 1 >= fullConfig.confirmationFrames) {
121
- const nextStep = getNextStep(state.currentStep);
122
- const newCompletedSteps = [...state.completedSteps, state.currentStep];
123
- const newProgress = newCompletedSteps.length / fullConfig.requiredSteps.length * 100;
124
- setState(prev => ({
125
- ...prev,
126
- currentStep: nextStep,
127
- completedSteps: newCompletedSteps,
128
- stepStartTime: now,
129
- progress: newProgress,
130
- instruction: STEP_INSTRUCTIONS[nextStep],
131
- isProcessing: nextStep === 'completed'
132
- }));
133
- setConfirmationCount(0);
134
- }
135
- } else {
136
- // Reset confirmation count if step not completed
137
- setConfirmationCount(0);
138
- }
139
- }, [state, fullConfig.totalTimeout, fullConfig.stepTimeout, fullConfig.confirmationFrames, fullConfig.requiredSteps.length, confirmationCount, checkStepCompletion, getNextStep]);
140
-
141
- // Auto-reset on mount
142
- (0, _react.useEffect)(() => {
143
- resetFlow();
144
- }, [resetFlow]);
145
- return {
146
- state,
147
- processFaceResult,
148
- resetFlow,
149
- isCompleted: state.currentStep === 'completed',
150
- isFailed: state.currentStep === 'failed',
151
- isActive: state.currentStep !== 'completed' && state.currentStep !== 'failed',
152
- remainingTime: Math.max(0, fullConfig.stepTimeout - (Date.now() - state.stepStartTime)),
153
- totalRemainingTime: Math.max(0, fullConfig.totalTimeout - (Date.now() - state.totalStartTime))
154
- };
155
- };
156
- exports.useFaceVerificationFlow = useFaceVerificationFlow;
157
- //# sourceMappingURL=useFaceVerificationFlow.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","require","_useFaceVerification","DEFAULT_CONFIG","stepTimeout","totalTimeout","confirmationFrames","requiredSteps","STEP_INSTRUCTIONS","position_face","smile","blink","turn_left","turn_right","completed","failed","useFaceVerificationFlow","config","fullConfig","state","setState","useState","currentStep","completedSteps","stepStartTime","Date","now","totalStartTime","isProcessing","progress","instruction","confirmationCount","setConfirmationCount","resetFlow","useCallback","checkStepCompletion","result","faceDetected","FaceVerificationUtils","isFaceCentered","isConfidentSmile","isConfidentBlink","isHeadTurnedLeft","isHeadTurnedRight","getNextStep","currentIndex","indexOf","length","nextStep","processFaceResult","prev","error","stepCompleted","newCompletedSteps","newProgress","useEffect","isCompleted","isFailed","isActive","remainingTime","Math","max","totalRemainingTime","exports"],"sourceRoot":"../../../../src","sources":["components/biometrics/useFaceVerificationFlow.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAD,OAAA;AAgCA,MAAME,cAAsC,GAAG;EAC7CC,WAAW,EAAE,KAAK;EAAE;EACpBC,YAAY,EAAE,KAAK;EAAE;EACrBC,kBAAkB,EAAE,CAAC;EAAE;EACvBC,aAAa,EAAE,CAAC,eAAe,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY;AAC9E,CAAC;AAED,MAAMC,iBAAmD,GAAG;EAC1DC,aAAa,EAAE,+CAA+C;EAC9DC,KAAK,EAAE,6BAA6B;EACpCC,KAAK,EAAE,wBAAwB;EAC/BC,SAAS,EAAE,mCAAmC;EAC9CC,UAAU,EAAE,oCAAoC;EAChDC,SAAS,EAAE,sCAAsC;EACjDC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