@getyoti/react-face-capture 2.0.0 → 2.2.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.
- package/CHANGELOG.md +48 -0
- package/README.md +13 -11
- package/index.d.ts +39 -10
- package/index.js +7 -7
- package/index.js.LICENSE.txt +1 -1
- package/package.json +2 -2
- package/vanilla/index.js +17 -18
- package/vanilla/index.js.LICENSE.txt +4 -40
- package/vanilla/index.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,53 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## v2.2.0
|
|
4
|
+
|
|
5
|
+
### New features
|
|
6
|
+
|
|
7
|
+
- New capture mode:
|
|
8
|
+
|
|
9
|
+
- Additional `allowBackgroundFaces` configuration property that allows faces
|
|
10
|
+
to be present in the background when the image is being captured. The face
|
|
11
|
+
capture will return a cropped image with the main face when set to `true`.
|
|
12
|
+
Note: This feature is designed for retail terminals and unsuitable for
|
|
13
|
+
online user's face capture.
|
|
14
|
+
- Additional `faceSelectionMethod` configuration property to select where the
|
|
15
|
+
main face can be placed, in the center or anywhere in the image. Note: This
|
|
16
|
+
feature is designed for retail terminals and unsuitable for online user's
|
|
17
|
+
face capture.
|
|
18
|
+
|
|
19
|
+
**Note:** It is recommend to enable `allowBackgroundFaces` when `faceSelectionMethod` is set to `area`.
|
|
20
|
+
|
|
21
|
+
- User feedback added and localized for the new `faceSelectionMethod`.
|
|
22
|
+
|
|
23
|
+
### Fixes
|
|
24
|
+
|
|
25
|
+
- Recalibration on the face validations order to improve the user experience
|
|
26
|
+
when capturing the face in challenging light conditions.
|
|
27
|
+
|
|
28
|
+
## v2.1.0
|
|
29
|
+
|
|
30
|
+
### New features
|
|
31
|
+
|
|
32
|
+
- Improve security checks.
|
|
33
|
+
- UI improvements on help dialogue.
|
|
34
|
+
- Change feedback message for `OVERCONSTRAINED` and `NO_CAMERA` errors from
|
|
35
|
+
`Please try again` to `Please try using a different device`.
|
|
36
|
+
|
|
37
|
+
### Fixes
|
|
38
|
+
|
|
39
|
+
- Remove the duplication of `Preparing camera` message when the FCM loads.
|
|
40
|
+
- Fix video layout bug on iOS's 17.X version.
|
|
41
|
+
- Improve the `scale` feature to fit better the whole container when the FCM is
|
|
42
|
+
scaled.
|
|
43
|
+
- Mute Help dialogue video stream.
|
|
44
|
+
- Adjust the distribution of icons and text of `Help` to avoid visual bugs
|
|
45
|
+
in certain languages.
|
|
46
|
+
|
|
47
|
+
#### Peer dependencies updates
|
|
48
|
+
|
|
49
|
+
- Update `axios` dependency from `1.6.2` to `1.6.5`.
|
|
50
|
+
|
|
3
51
|
## v2.0.0
|
|
4
52
|
|
|
5
53
|
See section [v2.0.0-beta.1](#v200-beta1) with previous changes for version
|
package/README.md
CHANGED
|
@@ -24,12 +24,12 @@ The package depends on the following peer dependencies
|
|
|
24
24
|
|
|
25
25
|
| Browser | Versions |
|
|
26
26
|
| ------- | ------------------- |
|
|
27
|
-
| and_chr |
|
|
28
|
-
| chrome |
|
|
29
|
-
| edge |
|
|
30
|
-
| firefox |
|
|
31
|
-
| ios_saf | 17.
|
|
32
|
-
| safari | 17.
|
|
27
|
+
| and_chr | 123 |
|
|
28
|
+
| chrome | 123,122,121,120 |
|
|
29
|
+
| edge | 123,122 |
|
|
30
|
+
| firefox | 124,123,122,121 |
|
|
31
|
+
| ios_saf | 17.4,17.3,17.2 |
|
|
32
|
+
| safari | 17.4,17.3,17.2,17.1 |
|
|
33
33
|
|
|
34
34
|
</browserSupportTable>
|
|
35
35
|
|
|
@@ -107,7 +107,7 @@ The CSS custom properties must be defined using the `:root` CSS selector. Here i
|
|
|
107
107
|
| ------------------------ | ------------------------------------- | ---------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
108
108
|
| captureMethod | String `manual/auto` | `auto` | - | Capture method to take the photo: by clicking a button or auto-capture. |
|
|
109
109
|
| manualCaptureFallback | Boolean | `true` | - | In `auto` capture method, allow the use of `manual` capture mode as fallback. This would be triggered only when low performance conditions are detected, usually on very old devices. NOTE: If this option is turned off, some users might not be able to successfully submit an image. |
|
|
110
|
-
| secure | Boolean | `true` | - |
|
|
110
|
+
| secure | Boolean | `true` | - | Use the [secure mode](#secure-mode) |
|
|
111
111
|
| clientSdkId | String | - | Yes\* | Identifies your Yoti Hub application. This value can be found in the Hub, within your application section, in the keys tab. |
|
|
112
112
|
| onSuccess | Function(payload, base64PreviewImage) | - | Yes | Callback called once the result (payload) is complete. The content of capture will vary when using secure or non-secure mode (See [secure mode section](#secure-mode)). The second argument `base64PreviewImage` will only be provided if `returnPreviewImage` is set to `true`. |
|
|
113
113
|
| onError | Function | - | - | Callback called when there is an error. See Appendix for the list of error codes we currently support. |
|
|
@@ -119,14 +119,16 @@ The CSS custom properties must be defined using the `:root` CSS selector. Here i
|
|
|
119
119
|
| qualityType | String `high/medium/low` | `high` | - | Sets the image quality of jpeg format images only. High (1) - Medium (0.96) - Low (0.90). |
|
|
120
120
|
| language | Language code \*\* | `en` | - | The language code to set the Face Capture language. |
|
|
121
121
|
| a11yLiveRegionMode | String `assertive/polite` | `polite` | - | Determines the [politeness setting of the live region](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions#live_regions) used to read out prompts for screen reader users |
|
|
122
|
-
| showInitialGuidance | Boolean | `true` | - |
|
|
122
|
+
| showInitialGuidance | Boolean | `true` | - | Show the initial help guidance. |
|
|
123
123
|
| faceCaptureAssetsRootUrl | String | `assets/face-capture/` | - | Root url where the face detection assets are located. See [copy assets](#copy-assets) section for assets configuration. |
|
|
124
124
|
| loadTimeout | Number | 15000 milliseconds | - | Sets the time (ms) the Face Capture will use to notify through the `onError` callback about downloading taking too long. The Face Capture will keep downloading after the notification. |
|
|
125
|
-
| showGetHelpButton | Boolean | `true` | - |
|
|
125
|
+
| showGetHelpButton | Boolean | `true` | - | Show the Get Help button. |
|
|
126
126
|
| autoSessionReload | Boolean | `true` | - | Automatically renews sessions after they expire. |
|
|
127
127
|
| userRetryError | Boolean | `true` | - | Gives the possibility to users to retry several times when an error occurs. |
|
|
128
|
-
| returnPreviewImage | Boolean | `false` | - |
|
|
129
|
-
| encryptImage | Boolean | `true` | - |
|
|
128
|
+
| returnPreviewImage | Boolean | `false` | - | Provide the image captured (`base64PreviewImage`) in the `onSuccess` callback. |
|
|
129
|
+
| encryptImage | Boolean | `true` | - | Encrypt the image inside the payload argument on the `onSuccess` callback when it runs the secure mode. |
|
|
130
|
+
| allowBackgroundFaces | Boolean | `false` | - | Allows faces to be present in the background when the image is being captured. The face capture will return a cropped image with the main face when set to `true`. Note: This feature is designed for retail terminals and unsuitable for online user's face capture. |
|
|
131
|
+
| faceSelectionMethod | String `center/area` | `center` | - | Defines where the main face can be placed, in the center or anywhere in the image. Note: This feature is designed for retail terminals and unsuitable for online user's face capture. It is recommend to enable `allowBackgroundFaces` when `faceSelectionMethod` is set to `area`. |
|
|
130
132
|
|
|
131
133
|
**(\*)**
|
|
132
134
|
This field is only mandatory when using the secure mode. (secure = true)
|
package/index.d.ts
CHANGED
|
@@ -69,6 +69,20 @@ declare module '@getyoti/react-face-capture' {
|
|
|
69
69
|
FULL_HD = 'full_hd',
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
/**
|
|
73
|
+
* How the face captures will detect the main face.
|
|
74
|
+
*/
|
|
75
|
+
export enum FACE_SELECTION_METHOD {
|
|
76
|
+
/**
|
|
77
|
+
* The face must be in the center of the frame.
|
|
78
|
+
*/
|
|
79
|
+
CENTER = 'center',
|
|
80
|
+
/**
|
|
81
|
+
* The face could be in any place of the frame.
|
|
82
|
+
*/
|
|
83
|
+
AREA = 'area',
|
|
84
|
+
}
|
|
85
|
+
|
|
72
86
|
/**
|
|
73
87
|
* Languages supported by the Face Capture.
|
|
74
88
|
*/
|
|
@@ -176,11 +190,12 @@ declare module '@getyoti/react-face-capture' {
|
|
|
176
190
|
* Face Capture properties.
|
|
177
191
|
*/
|
|
178
192
|
export interface FaceCaptureProps {
|
|
179
|
-
/** Root URL where assets for the face detection are located.
|
|
193
|
+
/** Root URL where assets for the face detection are located.
|
|
194
|
+
* (default:'assets/face-capture/') */
|
|
180
195
|
faceCaptureAssetsRootUrl?: string;
|
|
181
196
|
/** Capture method to take the photo: by clicking a button or auto-capture. (default:auto) */
|
|
182
197
|
captureMethod?: CAPTURE_METHOD;
|
|
183
|
-
/**
|
|
198
|
+
/** Use the secure mode. (default:true) */
|
|
184
199
|
secure?: boolean;
|
|
185
200
|
/** Callback called once the result (capture) is complete. */
|
|
186
201
|
onSuccess: (payload: FCMPayload, base64PreviewImage?: string) => void;
|
|
@@ -203,25 +218,39 @@ declare module '@getyoti/react-face-capture' {
|
|
|
203
218
|
language?: LANGUAGE_CODE;
|
|
204
219
|
/** Determines the politeness setting of the live region used to read out prompts for screen reader users. (default:polite) */
|
|
205
220
|
a11yLiveRegionMode?: A11Y_LIVE_REGION_MODE;
|
|
206
|
-
/**
|
|
221
|
+
/** Show the initial help guidance. (default:true) */
|
|
207
222
|
showInitialGuidance?: boolean;
|
|
208
223
|
/** Indicates if the face capture will use the manual capture method because of slow performance. (default:true) */
|
|
209
224
|
manualCaptureFallback?: boolean;
|
|
210
|
-
/** Indicates the time (in milliseconds) to call the onError callback if the
|
|
225
|
+
/** Indicates the time (in milliseconds) to call the onError callback if the
|
|
226
|
+
* module takes that time to load (default: 15000) */
|
|
211
227
|
loadTimeout?: number;
|
|
212
228
|
/** Identifies your Yoti Hub application. */
|
|
213
229
|
clientSdkId?: string;
|
|
214
|
-
/**
|
|
230
|
+
/** Show the Get Help button. (default:true) */
|
|
215
231
|
showGetHelpButton?: boolean;
|
|
216
|
-
/** Automatically renews sessions after they expire. */
|
|
232
|
+
/** Automatically renews sessions after they expire. (default:true) */
|
|
217
233
|
autoSessionReload?: boolean;
|
|
218
|
-
/** Gives the possibility to users to retry several times when an error
|
|
234
|
+
/** Gives the possibility to users to retry several times when an error
|
|
235
|
+
* occurs. (default:true) */
|
|
219
236
|
userRetryError?: boolean;
|
|
220
|
-
/**
|
|
237
|
+
/** Provide the image captured ('base64PreviewImage') in the 'onSuccess'
|
|
238
|
+
* callback. (default:false) */
|
|
221
239
|
returnPreviewImage?: boolean;
|
|
222
|
-
/**
|
|
223
|
-
*
|
|
240
|
+
/** Encrypt the image inside the payload argument on the 'onSuccess'
|
|
241
|
+
* callback when it runs the secure mode. (default:true) */
|
|
224
242
|
encryptImage?: boolean;
|
|
243
|
+
/** Allows faces to be present in the background when the image is being
|
|
244
|
+
* captured. The face capture will return a cropped image with the main face
|
|
245
|
+
* when set to 'true'. Note: This feature is designed for retail terminals
|
|
246
|
+
* and unsuitable for online user's face capture. (default:false) */
|
|
247
|
+
allowBackgroundFaces?: boolean;
|
|
248
|
+
/** Defines where the main face can be placed, in the center or anywhere in
|
|
249
|
+
* the image. Note: This feature is designed for retail terminals and
|
|
250
|
+
* unsuitable for online user's face capture. It is recommend to enable
|
|
251
|
+
* 'allowBackgroundFaces' when 'faceSelectionMethod' is set to 'area'.
|
|
252
|
+
* (default:center) */
|
|
253
|
+
faceSelectionMethod?: FACE_SELECTION_METHOD;
|
|
225
254
|
}
|
|
226
255
|
|
|
227
256
|
/**
|