@regulaforensics/vp-frontend-face-components 7.1.1640-rc → 7.1.1651-rc

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/README.md CHANGED
@@ -256,6 +256,109 @@ component.settings = {
256
256
 
257
257
  ```
258
258
 
259
+ ### CSS Parts
260
+ To customize the appearance, use the part attribute and define the desired CSS properties. (Note: The specificity of the ::part styles is greater than that of the styles set via settings). Examples:
261
+
262
+ ```css
263
+
264
+ /** general component overlay */
265
+ face-liveness {
266
+ background-color: #e6e6e6;
267
+ }
268
+
269
+ /** web component container */
270
+ face-liveness::part(wc-container) {
271
+ box-shadow: none;
272
+ border-radius: 0;
273
+ }
274
+
275
+ /** instruction screen */
276
+ face-liveness::part(onboarding-screen-title) {
277
+ text-decoration: underline;
278
+ }
279
+ face-liveness::part(onboarding-screen-subtitle) {
280
+ text-decoration: underline;
281
+ }
282
+ face-liveness::part(onboarding-screen-start-button) {
283
+ background-color: #7c7c7c;
284
+ }
285
+ face-liveness::part(onboarding-screen-start-button):hover {
286
+ background-color: #bd7dff;
287
+ }
288
+ face-liveness::part(onboarding-screen-start-button) {
289
+ color: #000;
290
+ }
291
+ face-liveness::part(onboarding-screen-start-button):hover {
292
+ color: #000;
293
+ }
294
+
295
+ /** instruction screen icons */
296
+ /** you can set any image from url */
297
+ face-liveness::part(onboarding-screen-illumination) {
298
+ background: #000;
299
+ }
300
+ face-liveness::part(onboarding-screen-accessories) {
301
+ background: #000;
302
+ }
303
+ face-liveness::part(onboarding-screen-camera-level) {
304
+ background: #000;
305
+ }
306
+
307
+ /** camera mode svg's */
308
+ face-liveness::part(camera-screen-sector-target) {
309
+ border-left-color: #000;
310
+ }
311
+ face-liveness::part(camera-screen-stroke-normal) {
312
+ stroke: #000;
313
+ }
314
+ face-liveness::part(camera-screen-sector-active) {
315
+ stroke: #000;
316
+ }
317
+
318
+ /** message plate */
319
+ face-liveness::part(camera-screen-front-hint-label) {
320
+ background: #000;
321
+ color: yellow;
322
+ }
323
+
324
+ /** spinner */
325
+ face-liveness::part(processing-screen-progress)::before {
326
+ border-top-color: #000;
327
+ }
328
+ /** success image */
329
+ face-liveness::part(success-screen-image) {
330
+ background: #000;
331
+ }
332
+
333
+ /** retry screen */
334
+ face-liveness::part(retry-screen-environment-text) {
335
+ text-decoration: underline;
336
+ }
337
+ face-liveness::part(retry-screen-environment-image) {
338
+ background: rgb(88, 82, 82);
339
+ }
340
+ face-liveness::part(retry-screen-person-text) {
341
+ text-decoration: underline;
342
+ }
343
+ face-liveness::part(retry-screen-person-image) {
344
+ background: rgb(88, 82, 82);
345
+ }
346
+ /** retry button */
347
+ face-liveness::part(retry-screen-retry-button) {
348
+ background: rgb(88, 82, 82);
349
+ }
350
+ face-liveness::part(retry-screen-title-text) {
351
+ color: rgb(88, 82, 82);
352
+ text-decoration: underline;
353
+ }
354
+ face-liveness::part(retry-screen-subtitle-text) {
355
+ color: rgb(88, 82, 82);
356
+ text-decoration: underline;
357
+ }
358
+ ```
359
+
360
+ For more details about ::part() CSS pseudo-elements, see the article at [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/CSS/::part).
361
+
259
362
 
260
363
  ## Events
261
364
 
@@ -661,6 +764,10 @@ The list of labels used in the component:
661
764
  | **noAccessories** | No accessories: glasses, mask, hat, etc. | `face-liveness`, `face-capture` |
662
765
  | **getReady** | Get ready | `face-liveness`, `face-capture` |
663
766
  | **removeOcclusion** | Remove items covering your face | `face-liveness`, `face-capture` |
767
+ | **turnHeadUp** | Turn head up a bit to look straight | `face-liveness`, `face-capture` |
768
+ | **turnHeadDown** | Turn head down a bit to look straight | `face-liveness`, `face-capture` |
769
+ | **turnHeadLeft** | Turn head left a bit to look straight | `face-liveness`, `face-capture` |
770
+ | **turnHeadRight** | Turn head right a bit to look straight | `face-liveness`, `face-capture` |
664
771
 
665
772
 
666
773
  ## Examples
package/dist/index.d.ts CHANGED
@@ -42,7 +42,26 @@ export declare interface DetailEvent<A, R> {
42
42
  data: CustomEventDataType<R> | null;
43
43
  }
44
44
 
45
- export declare type ErrorTypes = 'WASM_ERROR' | 'UNKNOWN_ERROR' | 'NOT_SUPPORTED' | 'CAMERA_UNKNOWN_ERROR' | 'CAMERA_PERMISSION_DENIED' | 'NO_CAMERA' | 'INCORRECT_CAMERA_ID' | 'CONNECTION_ERROR' | 'LANDSCAPE_MODE_RESTRICTED' | 'TIMEOUT_ERROR' | 'CHANGE_CAMERA' | 'DEVICE_ROTATE' | 'APP_INACTIVE' | 'HTTP_NOT_SUPPORTED';
45
+ export declare const ErrorTypes: {
46
+ readonly WASM_ERROR: "WASM_ERROR";
47
+ readonly UNKNOWN_ERROR: "UNKNOWN_ERROR";
48
+ readonly NOT_SUPPORTED: "NOT_SUPPORTED";
49
+ readonly CAMERA_UNKNOWN_ERROR: "CAMERA_UNKNOWN_ERROR";
50
+ readonly CAMERA_PERMISSION_DENIED: "CAMERA_PERMISSION_DENIED";
51
+ readonly NO_CAMERA: "NO_CAMERA";
52
+ readonly INCORRECT_CAMERA_ID: "INCORRECT_CAMERA_ID";
53
+ readonly CONNECTION_ERROR: "CONNECTION_ERROR";
54
+ readonly LANDSCAPE_MODE_RESTRICTED: "LANDSCAPE_MODE_RESTRICTED";
55
+ readonly TIMEOUT_ERROR: "TIMEOUT_ERROR";
56
+ readonly CHANGE_CAMERA: "CHANGE_CAMERA";
57
+ readonly DEVICE_ROTATE: "DEVICE_ROTATE";
58
+ readonly APP_INACTIVE: "APP_INACTIVE";
59
+ readonly HTTP_NOT_SUPPORTED: "HTTP_NOT_SUPPORTED";
60
+ readonly WEBSERVICE_NOT_COMPATIBLE: "WEBSERVICE_NOT_COMPATIBLE";
61
+ readonly CANCELLED: "CANCELLED";
62
+ };
63
+
64
+ export declare type ErrorTypes = (typeof ErrorTypes)[keyof typeof ErrorTypes];
46
65
 
47
66
  export declare type FaceCaptureDetailType = Omit<DetailEvent<FaceEventActions, FaceDetectionResponseType>, 'transactionId'>;
48
67
 
@@ -90,21 +109,40 @@ export declare class FaceDetectionWebComponent extends HTMLElement {
90
109
 
91
110
  export declare type FaceDictionaries = Partial<Record<Locales, FaceTranslations>>;
92
111
 
93
- export declare type FaceEventActions = 'ELEMENT_VISIBLE' | 'PRESS_START_BUTTON' | 'PRESS_RETRY_BUTTON' | 'CLOSE' | 'PROCESS_FINISHED' | 'SERVICE_INITIALIZED' | 'RETRY_COUNTER_EXCEEDED';
112
+ export declare const FaceEventActions: {
113
+ readonly ELEMENT_VISIBLE: "ELEMENT_VISIBLE";
114
+ readonly PRESS_START_BUTTON: "PRESS_START_BUTTON";
115
+ readonly PRESS_RETRY_BUTTON: "PRESS_RETRY_BUTTON";
116
+ readonly CLOSE: "CLOSE";
117
+ readonly PROCESS_FINISHED: "PROCESS_FINISHED";
118
+ readonly SERVICE_INITIALIZED: "SERVICE_INITIALIZED";
119
+ readonly RETRY_COUNTER_EXCEEDED: "RETRY_COUNTER_EXCEEDED";
120
+ };
121
+
122
+ export declare type FaceEventActions = (typeof FaceEventActions)[keyof typeof FaceEventActions];
94
123
 
95
124
  export declare type FaceLivenessDetailType = DetailEvent<FaceEventActions, FaceLivenessResponseType>;
96
125
 
126
+ /** web component response */
97
127
  export declare type FaceLivenessResponseType = {
98
128
  images: Array<string>;
99
129
  code: number;
100
130
  metadata: Record<string, any>;
101
131
  estimatedAge: number | null;
102
132
  tag: string;
103
- status: number;
133
+ status: FaceLivenessResultStatus;
104
134
  transactionId: string;
105
135
  type: number;
106
136
  };
107
137
 
138
+ export declare const FaceLivenessResultStatus: {
139
+ readonly CONFIRMED: 0;
140
+ readonly NOT_CONFIRMED: 1;
141
+ readonly UNKNOWN: 2;
142
+ };
143
+
144
+ export declare type FaceLivenessResultStatus = (typeof FaceLivenessResultStatus)[keyof typeof FaceLivenessResultStatus];
145
+
108
146
  export declare interface FaceLivenessSettings extends Omit<FaceDetectionSettings, 'holdStillDuration' | 'timeoutInterval' | 'showFaceAnimation'> {
109
147
  url?: string;
110
148
  deviceOrientation?: boolean;
@@ -117,10 +155,12 @@ export declare interface FaceLivenessSettings extends Omit<FaceDetectionSettings
117
155
  livenessType?: FaceLivenessType;
118
156
  }
119
157
 
120
- export declare enum FaceLivenessType {
121
- ACTIVE = 0,
122
- PASSIVE = 1
123
- }
158
+ export declare const FaceLivenessType: {
159
+ readonly ACTIVE: 0;
160
+ readonly PASSIVE: 1;
161
+ };
162
+
163
+ export declare type FaceLivenessType = (typeof FaceLivenessType)[keyof typeof FaceLivenessType];
124
164
 
125
165
  export declare class FaceLivenessWebComponent extends HTMLElement {
126
166
  private _root;
@@ -205,37 +245,63 @@ export declare interface IFaceLiveness extends IFaceDetection {
205
245
 
206
246
  export declare type Locales = 'ru' | 'en' | 'de' | 'pl' | 'it' | 'hu' | 'zh' | 'sk' | 'uk' | 'fr' | 'es' | 'pt' | 'ar' | 'nl' | 'id' | 'vi' | 'ko' | 'ms' | 'ro' | 'el' | 'tr' | 'ja' | 'cs' | 'th' | 'hi' | 'bn' | 'he' | 'fi' | 'sv' | 'da' | 'hr' | 'no' | string;
207
247
 
208
- export declare enum RecordingProcess {
209
- ASYNCHRONOUS_UPLOAD = 0,
210
- SYNCHRONOUS_UPLOAD = 1,
211
- NOT_UPLOAD = 2
212
- }
248
+ export declare const RecordingProcess: {
249
+ readonly ASYNCHRONOUS_UPLOAD: 0;
250
+ readonly SYNCHRONOUS_UPLOAD: 1;
251
+ readonly NOT_UPLOAD: 2;
252
+ };
213
253
 
214
- declare enum ResponseCode {
215
- EMPTY = -1,
216
- ERROR = 0,
217
- OK = 1,
218
- TIMEOUT = 2
219
- }
254
+ export declare type RecordingProcess = (typeof RecordingProcess)[keyof typeof RecordingProcess];
255
+
256
+ export declare const ResponseCode: {
257
+ readonly EMPTY: -1;
258
+ readonly ERROR: 0;
259
+ readonly OK: 1;
260
+ };
261
+
262
+ export declare type ResponseCode = (typeof ResponseCode)[keyof typeof ResponseCode];
220
263
 
221
264
  export { }
222
265
 
223
266
 
267
+
224
268
  declare global {
269
+ const FACE_WASM_S3_PATH: string;
270
+
271
+ namespace React.JSX {
272
+ interface IntrinsicElements {
273
+ 'face-liveness': React.DetailedHTMLProps<
274
+ IFaceLiveness & React.HTMLAttributes<FaceLivenessWebComponent>,
275
+ FaceLivenessWebComponent
276
+ >;
277
+ 'face-capture': React.DetailedHTMLProps<
278
+ IFaceDetection & React.HTMLAttributes<FaceDetectionWebComponent>,
279
+ FaceDetectionWebComponent
280
+ >;
281
+ 'fullscreen-container': React.DetailedHTMLProps<
282
+ React.HTMLAttributes<FullScreenContainer>,
283
+ FullScreenContainer
284
+ >;
285
+ }
286
+ }
287
+
225
288
  interface HTMLElementEventMap {
226
289
  'face-liveness': CustomEvent<FaceLivenessDetailType>;
227
290
  'face-capture': CustomEvent<FaceCaptureDetailType>;
228
291
  }
229
292
  }
230
293
 
231
-
232
- declare namespace v3 {
233
- var DNS: string;
234
- var URL: string;
294
+ declare global {
295
+ const VERSION: string;
296
+ const ENV: string;
235
297
  }
236
298
 
299
+ declare module 'react' {
300
+ interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
301
+ part?: string;
302
+ }
237
303
 
238
- declare namespace v5 {
239
- var DNS: string;
240
- var URL: string;
304
+ interface SVGAttributes<T> extends AriaAttributes, DOMAttributes<T> {
305
+ part?: string;
306
+ }
241
307
  }