@regulaforensics/vp-frontend-face-components 1.1.0 → 1.4.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.
Files changed (73) hide show
  1. package/README.md +346 -30
  2. package/dist/main.js +1 -1
  3. package/dist/main.js.LICENSE.txt +42 -0
  4. package/lib/common/BackCameraIcon.d.ts +6 -0
  5. package/lib/common/Button.d.ts +7 -0
  6. package/lib/common/CameraChangeIcon.d.ts +6 -0
  7. package/lib/common/CameraIcon.d.ts +6 -0
  8. package/lib/common/CheckIcon.d.ts +6 -0
  9. package/lib/common/CrossIcon.d.ts +6 -0
  10. package/lib/common/DocReaderCameraDisabled.d.ts +5 -0
  11. package/lib/common/DocReaderCameraPreparing.d.ts +5 -0
  12. package/lib/common/DocReaderFlip.d.ts +5 -0
  13. package/lib/common/DocReaderProcessing.d.ts +5 -0
  14. package/lib/common/DocReaderProcessingError.d.ts +5 -0
  15. package/lib/common/DocReaderProcessingFinished.d.ts +6 -0
  16. package/lib/common/DocReaderSearch.d.ts +5 -0
  17. package/lib/common/ErrorIcon.d.ts +6 -0
  18. package/lib/common/FromCameraIcon.d.ts +5 -0
  19. package/lib/common/FromGalleryIcon.d.ts +5 -0
  20. package/lib/common/FrontCameraIcon.d.ts +6 -0
  21. package/lib/common/FullscreenExitIcon.d.ts +6 -0
  22. package/lib/common/FullscreenIcon.d.ts +6 -0
  23. package/lib/common/Icon.d.ts +7 -0
  24. package/lib/common/InstructionIconFaceDetection.d.ts +5 -0
  25. package/lib/common/InstructionIconFaceLiveness.d.ts +5 -0
  26. package/lib/common/Message.d.ts +7 -0
  27. package/lib/common/NoGlareIcon.d.ts +5 -0
  28. package/lib/common/NoSmilingIcon.d.ts +5 -0
  29. package/lib/common/RegulaLogo.d.ts +6 -0
  30. package/lib/common/SnapshotIcon.d.ts +6 -0
  31. package/lib/common/Spinner.d.ts +3 -0
  32. package/lib/common/SquareIcon.d.ts +6 -0
  33. package/lib/common/StopIcon.d.ts +6 -0
  34. package/lib/common/VerifiedIcon.d.ts +6 -0
  35. package/lib/components/ErrorBoundary.d.ts +17 -0
  36. package/lib/components/FaceCapture.d.ts +17 -0
  37. package/lib/components/FaceDetection.d.ts +2 -0
  38. package/lib/components/FaceFullScreenOverlay.d.ts +11 -0
  39. package/lib/components/FaceLayout.d.ts +19 -0
  40. package/lib/components/FaceLiveness.d.ts +2 -0
  41. package/lib/components/InfoScreen.d.ts +10 -0
  42. package/lib/components/InstructionScreen.d.ts +9 -0
  43. package/lib/components/ProcessScreen.d.ts +6 -0
  44. package/lib/components/RetryScreen.d.ts +7 -0
  45. package/lib/components/WebCamera.d.ts +20 -0
  46. package/lib/constants.d.ts +366 -0
  47. package/lib/contexts/FaceAttributesContext.d.ts +24 -0
  48. package/lib/hoc/withFaceAttributesContext.d.ts +4 -0
  49. package/lib/hoc/withLocalize.d.ts +7 -0
  50. package/lib/hooks/useDebounce.d.ts +2 -0
  51. package/lib/hooks/useFaceLiveness.d.ts +33 -0
  52. package/lib/hooks/useInterval.d.ts +3 -0
  53. package/lib/hooks/useOrientationChange.d.ts +10 -0
  54. package/lib/hooks/useStream.d.ts +16 -0
  55. package/lib/hooks/useUserAgent.d.ts +3 -0
  56. package/lib/hooks/useWindowBlur.d.ts +2 -0
  57. package/lib/i18n/dictionaries/_dictionaries.d.ts +2051 -0
  58. package/lib/index-face.d.ts +1 -0
  59. package/lib/models/CameraModel.d.ts +9 -0
  60. package/lib/models/ImageModel.d.ts +7 -0
  61. package/lib/services/DebugService.d.ts +13 -0
  62. package/lib/services/DocumentReaderService.d.ts +39 -0
  63. package/lib/services/EventEmitter.d.ts +9 -0
  64. package/lib/services/FaceLivenessService.d.ts +46 -0
  65. package/lib/services/FaceService.d.ts +11 -0
  66. package/lib/services/WasmFeatureDetectService.d.ts +4 -0
  67. package/lib/types.d.ts +219 -0
  68. package/lib/utils.d.ts +65 -0
  69. package/lib/web-components/FaceDetection.d.ts +11 -0
  70. package/lib/web-components/FaceLiveness.d.ts +14 -0
  71. package/lib/web-components/FullScreenContainer.d.ts +4 -0
  72. package/lib/web-components.d.ts +47 -0
  73. package/package.json +37 -37
@@ -0,0 +1 @@
1
+ import '@webcomponents/webcomponentsjs/webcomponents-bundle.js';
@@ -0,0 +1,9 @@
1
+ import { FacingModeType } from '../types';
2
+ declare class CameraModel {
3
+ readonly deviceId: string;
4
+ readonly facing: FacingModeType;
5
+ readonly groupId: string;
6
+ readonly label: string;
7
+ constructor(mdi: MediaDeviceInfo, facing: FacingModeType);
8
+ }
9
+ export default CameraModel;
@@ -0,0 +1,7 @@
1
+ declare class ImageModel {
2
+ readonly mimeType: string;
3
+ readonly raw: string;
4
+ readonly extension: string;
5
+ constructor(dataURL: string);
6
+ }
7
+ export default ImageModel;
@@ -0,0 +1,13 @@
1
+ import { logLevels } from '../constants';
2
+ declare class DebugService {
3
+ private readonly logLvl;
4
+ constructor(logLvl: logLevels);
5
+ private log;
6
+ private time;
7
+ debug(message: string, ...optionalParams: Array<any>): void;
8
+ info(message: string, ...optionalParams: Array<any>): void;
9
+ warn(message: string, ...optionalParams: Array<any>): void;
10
+ error(message: string, ...optionalParams: Array<any>): void;
11
+ }
12
+ declare const _default: DebugService;
13
+ export default _default;
@@ -0,0 +1,39 @@
1
+ import EventEmitter from './EventEmitter';
2
+ import { ImageInputParamType, InitDataType } from '../types';
3
+ declare class DocumentReaderService {
4
+ initialized: boolean;
5
+ processing: boolean;
6
+ prepared: boolean;
7
+ workerResponded: boolean;
8
+ worker: Worker | null;
9
+ eventEmitter: EventEmitter;
10
+ initData: InitDataType | null;
11
+ constructor();
12
+ subscribe(listener: (data: any) => void): void;
13
+ unsubscribe(listener: (data: any) => void): void;
14
+ prepare(listener?: (data: any) => void): Promise<void>;
15
+ initialize({ license }: {
16
+ license: string | undefined;
17
+ }): void;
18
+ private postCustomMessage;
19
+ private emit;
20
+ private print;
21
+ private printErr;
22
+ private onWorkerMessage;
23
+ shutdown(): void;
24
+ processImage(base64ImagesArray: string[], options: {
25
+ scenario: string;
26
+ multipageProcessing: boolean;
27
+ imageInputParam?: ImageInputParamType;
28
+ }): void;
29
+ process(Uint8ImagesArray: Uint8ClampedArray[], options: {
30
+ scenario: string;
31
+ multipageProcessing: boolean;
32
+ imageInputParam?: ImageInputParamType;
33
+ width: number;
34
+ height: number;
35
+ }): void;
36
+ startNewPage(): void;
37
+ startNewDocument(): void;
38
+ }
39
+ export default DocumentReaderService;
@@ -0,0 +1,9 @@
1
+ declare class EventEmitter {
2
+ callbacks: Record<string, any>;
3
+ constructor();
4
+ on(event: string, cb: (data: any) => any): void;
5
+ emit(event: string, data: any): void;
6
+ unsubscribe(event: string, listener: any): void;
7
+ unsubscribeAll(): void;
8
+ }
9
+ export default EventEmitter;
@@ -0,0 +1,46 @@
1
+ import { FrameObject, UserAgentType } from '../types';
2
+ import EventEmitter from './EventEmitter';
3
+ import CameraModel from '../models/CameraModel';
4
+ declare type MetadataType = {
5
+ metadata: {
6
+ hostAppId: string;
7
+ sdkVersion: string;
8
+ deviceModel: string;
9
+ camera: CameraModel;
10
+ };
11
+ try_id?: number;
12
+ guid?: string;
13
+ userAgent: UserAgentType;
14
+ mode?: number;
15
+ };
16
+ declare class FaceLivenessService {
17
+ initialized: boolean;
18
+ processing: boolean;
19
+ prepared: boolean;
20
+ worker: Worker | null;
21
+ params: {
22
+ width: number;
23
+ height: number;
24
+ metadata?: MetadataType;
25
+ };
26
+ eventEmitter: EventEmitter;
27
+ constructor();
28
+ prepare(listener: (data: any) => void): Promise<void>;
29
+ initialize(params: {
30
+ width: number;
31
+ height: number;
32
+ metadata: MetadataType;
33
+ debug?: boolean;
34
+ }): void;
35
+ private postCustomMessage;
36
+ private emit;
37
+ private print;
38
+ private printErr;
39
+ private onWorkerMessage;
40
+ shutdown(): void;
41
+ processImage({ videoFrame, sourceCaptureFrame, }: {
42
+ videoFrame: Uint8ClampedArray;
43
+ sourceCaptureFrame: FrameObject;
44
+ }): void;
45
+ }
46
+ export default FaceLivenessService;
@@ -0,0 +1,11 @@
1
+ import { FaceLivenessResultType } from '../types';
2
+ declare function getLivenessResult(encryptedBody: Uint8Array, { backendURL, uuid, try_id, headers, }: {
3
+ backendURL?: string;
4
+ uuid: string;
5
+ try_id: number;
6
+ headers?: Record<string, string>;
7
+ }): Promise<FaceLivenessResultType | undefined>;
8
+ declare const _default: {
9
+ getLivenessResult: typeof getLivenessResult;
10
+ };
11
+ export default _default;
@@ -0,0 +1,4 @@
1
+ export declare function getWasmFeaturesArray(): Promise<Array<{
2
+ feature: string;
3
+ supported: boolean;
4
+ }>>;
package/lib/types.d.ts ADDED
@@ -0,0 +1,219 @@
1
+ import { Response } from '@regulaforensics/document-reader-webclient';
2
+ import { documentEventActions, faceEventActions, responseCode, streamStatus, WebComponentsError } from './constants';
3
+ import CameraModel from './models/CameraModel';
4
+ export declare type FrameObject = {
5
+ left: number;
6
+ top: number;
7
+ width: number;
8
+ height: number;
9
+ };
10
+ export declare type VideoParamsType = {
11
+ videoParams: {
12
+ width: number;
13
+ height: number;
14
+ };
15
+ videoContainerParams: {
16
+ width: number;
17
+ height: number;
18
+ };
19
+ };
20
+ export declare type FacingModeType = 'user' | 'environment' | undefined;
21
+ export declare type VideoStatusParamsType = {
22
+ videoStatus: streamStatus;
23
+ camera: CameraModel;
24
+ twoFacingModesAvailable: boolean;
25
+ };
26
+ export declare type CaptureFrameType = {
27
+ capture: Uint8ClampedArray;
28
+ raw: string;
29
+ mimeType: string;
30
+ };
31
+ export declare type CaptureType = Array<Omit<CaptureFrameType, 'capture'>>;
32
+ export declare type CodeType = {
33
+ code: number;
34
+ images?: null;
35
+ };
36
+ export declare type UserAgentType = {
37
+ appCodeName: string;
38
+ appName: string;
39
+ appVersion: string;
40
+ language: string;
41
+ languages: readonly string[];
42
+ platform: string;
43
+ product: string;
44
+ productSub: string;
45
+ userAgent: string;
46
+ vendor: string;
47
+ vendorSub: string;
48
+ };
49
+ declare type FaceLivenessEyesType = {
50
+ predLeft: number;
51
+ predRight: number;
52
+ probLeft: number;
53
+ probRight: number;
54
+ };
55
+ declare type FaceLivenessOcclusionType = {
56
+ foreheadGlasses: boolean;
57
+ glasses: boolean;
58
+ hat: boolean;
59
+ medicineMask: boolean;
60
+ occlusion: boolean;
61
+ openedMouth: boolean;
62
+ sunglasses: boolean;
63
+ };
64
+ declare type FaceLivenessQualityType = {
65
+ blur: number;
66
+ brightness: number;
67
+ noise: number;
68
+ };
69
+ export declare type FaceLivenessServiceResponseType = {
70
+ code: number;
71
+ msg: string;
72
+ results: {
73
+ faceIdx: number;
74
+ livenessStatus: number;
75
+ metadata: {
76
+ ageNear: string;
77
+ ageNormal: string;
78
+ distance: number;
79
+ evaluationTime: number;
80
+ eyesNear: FaceLivenessEyesType;
81
+ eyesNormal: FaceLivenessEyesType;
82
+ faceQuality: {
83
+ details: Array<{
84
+ attribute: string;
85
+ score: number;
86
+ }>;
87
+ score: number;
88
+ };
89
+ faceTrackBreak: number;
90
+ occlusionNear: FaceLivenessOcclusionType;
91
+ occlusionNormal: FaceLivenessOcclusionType;
92
+ predArtMaskNear: number;
93
+ predArtMaskNormal: number;
94
+ predElectronicDeviceNear: number;
95
+ predElectronicDeviceNormal: number;
96
+ predGeometryClassifier: number;
97
+ predLivenessViewNear: number;
98
+ predLivenessViewNormal: number;
99
+ predOpticalFlow: number;
100
+ predShadesNear: number;
101
+ predShadesNormal: number;
102
+ predTotal: number;
103
+ probArtMaskNear: number;
104
+ probArtMaskNormal: number;
105
+ probElectronicDeviceNear: number;
106
+ probElectronicDeviceNormal: number;
107
+ probGeometryClassifier: number;
108
+ probOpticalFlow: number;
109
+ probShadesNear: number;
110
+ probShadesNormal: number;
111
+ qualityNear: FaceLivenessQualityType;
112
+ qualityNormal: FaceLivenessQualityType;
113
+ smileNear: string;
114
+ smileNormal: string;
115
+ symNear: number;
116
+ symNormal: number;
117
+ };
118
+ };
119
+ versionDescriptor: string;
120
+ versionSDK: string;
121
+ images: Array<string>;
122
+ };
123
+ export declare type FaceLivenessResultType = Omit<FaceLivenessServiceResponseType, 'images'>;
124
+ export declare type FaceLivenessResponseType = FaceLivenessServiceResponseType | {
125
+ code: number;
126
+ };
127
+ export declare type FaceDetectionResponseType = {
128
+ capture: Array<string>;
129
+ };
130
+ export declare type DocumentReaderResponseType = Response | {
131
+ code: number;
132
+ };
133
+ export declare type CameraSnapshotResponseType = Array<{
134
+ raw: string;
135
+ mimeType: string;
136
+ }>;
137
+ export declare type CustomErrorObjectType = {
138
+ type: WebComponentsError;
139
+ error?: Record<string, any> | string;
140
+ };
141
+ export declare type ScenarioParamsType = {
142
+ UVTorch?: number;
143
+ barcodeExt?: number;
144
+ caption: string;
145
+ desc: string;
146
+ faceExt?: number;
147
+ frameKWHDoublePageSpreadLandscape: string;
148
+ frameKWHDoublePageSpreadPortrait: string;
149
+ frameKWHLandscape: string;
150
+ frameKWHPortrait: string;
151
+ frameOrientation: number;
152
+ manualCrop?: number;
153
+ multiPageOff?: number;
154
+ name: string;
155
+ seriesProcessMode?: number;
156
+ };
157
+ export declare type InitDataType = {
158
+ scenario: Array<ScenarioParamsType>;
159
+ };
160
+ export declare type UserFrameType = {
161
+ frameBottom: number;
162
+ frameLeft: number;
163
+ frameRight: number;
164
+ frameTop: number;
165
+ width: number;
166
+ height: number;
167
+ };
168
+ export declare type ImageInputParamType = {
169
+ frameBottom: number;
170
+ frameLeft: number;
171
+ frameRight: number;
172
+ frameTop: number;
173
+ light: number;
174
+ resolutionType: number;
175
+ };
176
+ export declare type FrameParamsType = {
177
+ userFrame: UserFrameType;
178
+ serviceFrame: ImageInputParamType;
179
+ } | null;
180
+ export declare type ImageQualityCheck = {
181
+ featureType: number;
182
+ mean: number;
183
+ probability: number;
184
+ result: number;
185
+ std_dev: number;
186
+ type: number;
187
+ };
188
+ export declare type SupportedBrowserVersions = {
189
+ Chrome: number;
190
+ Firefox: number;
191
+ Safari: number;
192
+ Opera?: number;
193
+ Edge?: number;
194
+ Chromium?: number;
195
+ IE?: number;
196
+ 'Internet Explorer'?: number;
197
+ 'Mobile Safari'?: number;
198
+ 'Samsung Browser'?: number;
199
+ };
200
+ export declare type SupportedBrowserVersionsByOsType = {
201
+ iOS: SupportedBrowserVersions;
202
+ Android: SupportedBrowserVersions;
203
+ desktop: SupportedBrowserVersions;
204
+ };
205
+ declare type CustomEventDataType<R> = {
206
+ status: responseCode;
207
+ reason?: WebComponentsError;
208
+ response?: R;
209
+ };
210
+ interface DetailEvent<A, R> {
211
+ manual: boolean;
212
+ action: A;
213
+ data: CustomEventDataType<R> | null;
214
+ }
215
+ export declare type FaceLivenessDetailType = DetailEvent<faceEventActions, FaceLivenessResponseType>;
216
+ export declare type FaceCaptureDetailType = DetailEvent<faceEventActions, FaceDetectionResponseType>;
217
+ export declare type DocumentReaderDetailType = DetailEvent<documentEventActions, DocumentReaderResponseType>;
218
+ export declare type CameraSnapshotDetailType = DetailEvent<documentEventActions, CameraSnapshotResponseType>;
219
+ export {};
package/lib/utils.d.ts ADDED
@@ -0,0 +1,65 @@
1
+ import CameraModel from './models/CameraModel';
2
+ export declare function contains(a: {
3
+ x1: number;
4
+ x2: number;
5
+ y1: number;
6
+ y2: number;
7
+ }, b: {
8
+ x1: number;
9
+ x2: number;
10
+ y1: number;
11
+ y2: number;
12
+ }): boolean;
13
+ export declare function overlaps(a: {
14
+ x1: number;
15
+ x2: number;
16
+ y1: number;
17
+ y2: number;
18
+ }, b: {
19
+ x1: number;
20
+ x2: number;
21
+ y1: number;
22
+ y2: number;
23
+ }): boolean;
24
+ export declare function touches(a: {
25
+ x1: number;
26
+ x2: number;
27
+ y1: number;
28
+ y2: number;
29
+ }, b: {
30
+ x1: number;
31
+ x2: number;
32
+ y1: number;
33
+ y2: number;
34
+ }): boolean;
35
+ export declare function geTwoCorners({ top, left, height, width, }: {
36
+ top: number;
37
+ left: number;
38
+ height: number;
39
+ width: number;
40
+ }): {
41
+ x1: number;
42
+ x2: number;
43
+ y1: number;
44
+ y2: number;
45
+ };
46
+ export declare function uint8ArrayToBase64(arr: Uint8ClampedArray, videoFrame: {
47
+ width: number;
48
+ height: number;
49
+ }): string;
50
+ export declare function downloadBase64Image(base64: string, name: string | number): void;
51
+ export declare function saveByteArray(data: Uint8ClampedArray, name: string | number): void;
52
+ export declare const convertBooleanAttributeParam: (attributeValue: string | null) => boolean | undefined;
53
+ export declare const convertNumberAttributeParam: (attributeValue: string | null) => number | undefined;
54
+ export declare function compose(...argsA: any): any;
55
+ export declare function translateDetectionParams(captureFrameWidth: number, captureFrameHeight: number, captureFrameLeft: number, captureFrameTop: number, videoElementWidth: number, videoElementHeight: number, containerWidth: number, containerHeight: number, debug?: boolean): {
56
+ width: number;
57
+ height: number;
58
+ left: number;
59
+ top: number;
60
+ };
61
+ export declare function getByteCount(b64: Array<string> | string): number;
62
+ export declare function base64ToArrayBuffer(base64: string): ArrayBuffer;
63
+ export declare function getBase64(files: FileList, maxImageWidthAndHeight: number, maxImageSizeWithoutResize: number, maxInputFilesSize: number, resizeValue: number, compression: number): Promise<Array<Promise<string>>>;
64
+ export declare function generateEvent<T>(type: string, detail: T): CustomEvent;
65
+ export declare const getAvailableCameras: (cameraPool: CameraModel[], preferredCameraId?: string | undefined) => CameraModel | undefined;
@@ -0,0 +1,11 @@
1
+ export default class FaceDetectionWebComponent extends HTMLElement {
2
+ root: ShadowRoot;
3
+ mounted: boolean;
4
+ initialStyles: string;
5
+ constructor();
6
+ static get observedAttributes(): Array<string>;
7
+ attributeChangedCallback(name: string): void;
8
+ connectedCallback(): void;
9
+ render(): void;
10
+ disconnectedCallback(): void;
11
+ }
@@ -0,0 +1,14 @@
1
+ export default class FaceLivenessWebComponent extends HTMLElement {
2
+ root: ShadowRoot;
3
+ mounted: boolean;
4
+ requestHeaders: Record<string, string>;
5
+ initialStyles: string;
6
+ constructor();
7
+ static get observedAttributes(): Array<string>;
8
+ attributeChangedCallback(name: string): void;
9
+ connectedCallback(): void;
10
+ set headers(headersData: Record<string, string>);
11
+ get headers(): Record<string, string>;
12
+ render(): void;
13
+ disconnectedCallback(): void;
14
+ }
@@ -0,0 +1,4 @@
1
+ export default class FullScreenContainer extends HTMLElement {
2
+ root: ShadowRoot;
3
+ constructor();
4
+ }
@@ -0,0 +1,47 @@
1
+ import React from 'react';
2
+ import { FaceLivenessDetailType, FaceCaptureDetailType, DocumentReaderDetailType, CameraSnapshotDetailType } from './types';
3
+ export declare global {
4
+ namespace JSX {
5
+ interface IntrinsicElements {
6
+ 'face-liveness': IFaceLiveness;
7
+ 'face-capture': IFaceDetection;
8
+ 'document-reader': IDocumentReader;
9
+ 'camera-snapshot': ICameraSnapshot;
10
+ 'fullscreen-container': IBaseComponent;
11
+ }
12
+ }
13
+ interface IBaseComponent extends React.RefAttributes<Node>, React.AllHTMLAttributes<string | number | boolean>, Pick<Element, any> {
14
+ locale?: string;
15
+ copyright?: boolean;
16
+ 'camera-id'?: string;
17
+ }
18
+ interface IDocumentBaseComponent extends IBaseComponent {
19
+ 'start-screen'?: boolean;
20
+ multiple?: boolean;
21
+ }
22
+ interface IFaceLiveness extends Omit<IBaseComponent, 'headers'> {
23
+ url?: string;
24
+ debug?: boolean;
25
+ mode?: number;
26
+ headers?: string | {
27
+ [key: string]: string;
28
+ };
29
+ }
30
+ interface IDocumentReader extends IDocumentBaseComponent {
31
+ 'internal-scenario'?: string;
32
+ 'multipage-processing'?: boolean;
33
+ license?: string;
34
+ url?: string;
35
+ }
36
+ interface IFaceDetection extends IBaseComponent {
37
+ debug?: boolean;
38
+ }
39
+ type ICameraSnapshot = IDocumentBaseComponent;
40
+ }
41
+ export interface ICustomEventListener<T> extends EventListener {
42
+ (evt: CustomEvent<T>): void;
43
+ }
44
+ export interface ICustomEvent<T = any> extends Event {
45
+ readonly detail?: T;
46
+ }
47
+ export type { FaceLivenessDetailType, FaceCaptureDetailType, DocumentReaderDetailType, CameraSnapshotDetailType };
package/package.json CHANGED
@@ -1,55 +1,55 @@
1
1
  {
2
2
  "name": "@regulaforensics/vp-frontend-face-components",
3
- "version": "1.1.0",
3
+ "version": "1.4.0",
4
4
  "description": "Regula framework agnostic web components to work with webcamera",
5
+ "types": "lib/web-components.d.ts",
5
6
  "main": "dist/main.js",
6
7
  "files": [
7
- "./dist/*"
8
+ "dist/*",
9
+ "lib/*"
8
10
  ],
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/regulaforensics/vp-frontend-components.git"
12
- },
13
11
  "author": "Regula Forensics, Inc.",
14
12
  "license": "MIT",
15
- "bugs": {
16
- "url": "https://github.com/regulaforensics/vp-frontend-components/issues"
17
- },
18
- "homepage": "https://storybook.regulaforensics.com/",
13
+ "homepage": "https://storybook-face.regulaforensics.com/",
19
14
  "scripts": {
20
15
  "start": "webpack serve --config webpack.dev.js",
21
16
  "build": "webpack --config webpack.prod.js",
22
- "build-face": "webpack --config webpack.face.js",
23
- "build-document": "webpack --config webpack.document.js",
24
- "storybook": "start-storybook -p 6006 -c .storybook-development",
17
+ "build-face": "npm run clean-lib && npm run generate-face-types && webpack --config webpack.face.js",
18
+ "build-document": "npm run clean-lib && npm run generate-document-types && webpack --config webpack.document.js",
19
+ "storybook": "start-storybook -p 6006 -c .storybook-development -h localhost",
25
20
  "build-storybook-development": "build-storybook -c .storybook-development",
26
21
  "build-storybook-nightly": "build-storybook -c .storybook-nightly",
27
22
  "build-storybook-face-rc": "build-storybook -c .storybook-rc/face",
28
23
  "build-storybook-document-rc": "build-storybook -c .storybook-rc/document",
29
24
  "build-storybook-face-release": "build-storybook -c .storybook-release/face",
30
25
  "build-storybook-document-release": "build-storybook -c .storybook-release/document",
31
- "generate-dictionaries": "node scripts/xml-dictionary-parser/index.js Translator.xml src/i18n/dictionaries"
26
+ "generate-dictionaries": "node scripts/xml-dictionary-parser/index.js Translator.xml src/i18n/dictionaries",
27
+ "clean-lib": "rm -rf ./lib",
28
+ "generate-face-types": "tsc --project ./configs/face.tsconfig.json",
29
+ "generate-document-types": "tsc --project ./configs/document.tsconfig.json"
32
30
  },
33
31
  "husky": {
34
32
  "hooks": {
35
- "pre-commit": "lint-staged"
33
+ "pre-commit": "lint-staged && tsc --noEmit"
36
34
  }
37
35
  },
38
36
  "lint-staged": {
39
- "*.{js,ts,tsx}": "eslint --cache --fix"
37
+ "*.{js,ts,tsx}": "eslint --fix"
40
38
  },
41
39
  "dependencies": {
42
- "@regulaforensics/document-reader-webclient": "^5.6.6",
43
- "@regulaforensics/facesdk-webclient": "^3.1.0",
44
- "@webcomponents/webcomponentsjs": "^2.5.0",
40
+ "@regulaforensics/document-reader-webclient": "^6.3.1",
41
+ "@regulaforensics/facesdk-webclient": "^3.1.2",
42
+ "@storybook/manager-webpack5": "^6.4.22",
43
+ "@webcomponents/webcomponentsjs": "^2.6.0",
45
44
  "axios": "^0.21.1",
46
45
  "base64-arraybuffer": "^0.2.0",
47
46
  "localize-react": "^1.7.1",
48
- "react": "^17.0.1",
49
- "react-device-detect": "^2.0.1",
50
- "react-dom": "^17.0.1",
47
+ "react": "^17.0.2",
48
+ "react-device-detect": "^2.1.2",
49
+ "react-dom": "^17.0.2",
51
50
  "react-json-view": "^1.21.3",
52
- "uuid": "^8.3.2"
51
+ "uuid": "^8.3.2",
52
+ "wasm-feature-detect": "^1.2.11"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@babel/core": "^7.12.10",
@@ -64,16 +64,15 @@
64
64
  "@regulaforensics/vp-frontend-face-components": "*",
65
65
  "@regulaforensics/vp-frontend-face-components-nightly": "*",
66
66
  "@regulaforensics/vp-frontend-face-components-rc": "*",
67
- "@storybook/addon-actions": "6.2.9",
68
- "@storybook/addon-essentials": "6.2.9",
69
- "@storybook/addon-links": "6.2.9",
70
- "@storybook/builder-webpack5": "^6.3.0-beta.4",
71
- "@storybook/react": "6.2.9",
72
- "@types/react": "^17.0.0",
73
- "@types/react-dom": "^17.0.0",
67
+ "@storybook/addon-actions": "6.4.22",
68
+ "@storybook/addon-essentials": "6.4.22",
69
+ "@storybook/addon-links": "6.4.22",
70
+ "@storybook/builder-webpack5": "6.4.22",
71
+ "@storybook/react": "^6.4.22",
72
+ "@types/pako": "^1.0.3",
73
+ "@types/react": "^17.0.2",
74
+ "@types/react-dom": "^17.0.2",
74
75
  "@types/uuid": "^8.3.0",
75
- "@types/webpack": "^4.41.26",
76
- "@types/webpack-dev-server": "^3.11.1",
77
76
  "@typescript-eslint/eslint-plugin": "^4.14.0",
78
77
  "@typescript-eslint/parser": "^4.14.0",
79
78
  "babel-loader": "^8.2.2",
@@ -85,19 +84,20 @@
85
84
  "eslint-plugin-react": "^7.22.0",
86
85
  "fast-xml-parser": "^3.19.0",
87
86
  "he": "^1.2.0",
88
- "html-webpack-plugin": "^5.3.1",
87
+ "html-webpack-plugin": "^5.5.0",
89
88
  "husky": "^4.3.8",
90
89
  "lint-staged": "^10.5.3",
91
90
  "prettier": "^2.2.1",
92
91
  "style-loader": "^2.0.0",
92
+ "terser-webpack-plugin": "^5.3.0",
93
93
  "to-string-loader": "^1.1.6",
94
94
  "ts-loader": "^8.0.14",
95
95
  "typescript": "^4.1.3",
96
96
  "url-loader": "^4.1.1",
97
- "webpack": "^5.17.0",
98
- "webpack-cli": "^4.4.0",
99
- "webpack-dev-server": "^3.11.2",
100
- "webpack-merge": "^5.7.3",
97
+ "webpack": "^5.72.0",
98
+ "webpack-cli": "^4.9.2",
99
+ "webpack-dev-server": "^4.8.1",
100
+ "webpack-merge": "^5.8.0",
101
101
  "worker-loader": "^3.0.8"
102
102
  }
103
103
  }