@smileid/web-components 2.0.2 → 10.0.2
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/dist/esm/DocumentCaptureScreens-ChpBVvNE.js +1532 -0
- package/dist/esm/DocumentCaptureScreens-ChpBVvNE.js.map +1 -0
- package/dist/esm/EndUserConsent-CMHp-34-.js +715 -0
- package/dist/esm/EndUserConsent-CMHp-34-.js.map +1 -0
- package/dist/esm/Navigation-juBE4qOw.js +136 -0
- package/dist/esm/Navigation-juBE4qOw.js.map +1 -0
- package/dist/esm/PoweredBySmileId-CxbaihMu.js +33 -0
- package/dist/esm/PoweredBySmileId-CxbaihMu.js.map +1 -0
- package/dist/esm/SelfieCaptureScreens-DMo-z-32.js +7618 -0
- package/dist/esm/SelfieCaptureScreens-DMo-z-32.js.map +1 -0
- package/dist/esm/SignaturePad-C7MtmT8m.js +324 -0
- package/dist/esm/SignaturePad-C7MtmT8m.js.map +1 -0
- package/dist/esm/TotpConsent-CQU5jQi4.js +730 -0
- package/dist/esm/TotpConsent-CQU5jQi4.js.map +1 -0
- package/dist/esm/combobox.js +300 -0
- package/dist/esm/combobox.js.map +1 -0
- package/dist/esm/document.js +5 -0
- package/dist/esm/document.js.map +1 -0
- package/dist/esm/end-user-consent.js +5 -0
- package/dist/esm/end-user-consent.js.map +1 -0
- package/dist/esm/main.js +22 -0
- package/dist/esm/main.js.map +1 -0
- package/dist/esm/navigation.js +5 -0
- package/dist/esm/navigation.js.map +1 -0
- package/dist/esm/package-D_4zJ9ck.js +105 -0
- package/dist/esm/package-D_4zJ9ck.js.map +1 -0
- package/dist/esm/selfie.js +5 -0
- package/dist/esm/selfie.js.map +1 -0
- package/dist/esm/signature-pad.js +5 -0
- package/dist/esm/signature-pad.js.map +1 -0
- package/dist/esm/smart-camera-web.js +302 -0
- package/dist/esm/smart-camera-web.js.map +1 -0
- package/dist/esm/styles-D2i3GFLK.js +405 -0
- package/dist/esm/styles-D2i3GFLK.js.map +1 -0
- package/dist/esm/totp-consent.js +5 -0
- package/dist/esm/totp-consent.js.map +1 -0
- package/dist/smart-camera-web.js +4130 -0
- package/dist/smart-camera-web.js.map +1 -0
- package/dist/types/combobox.d.ts +21 -0
- package/dist/types/document.d.ts +21 -0
- package/dist/types/end-user-consent.d.ts +21 -0
- package/dist/types/main.d.ts +331 -0
- package/dist/types/navigation.d.ts +21 -0
- package/dist/types/selfie.d.ts +21 -0
- package/dist/types/signature-pad.d.ts +21 -0
- package/dist/types/smart-camera-web.d.ts +21 -0
- package/dist/types/totp-consent.d.ts +21 -0
- package/{src → lib}/components/camera-permission/CameraPermission.js +0 -1
- package/{src → lib}/components/document/src/document-capture/DocumentCapture.js +0 -1
- package/{src → lib}/components/document/src/document-capture-review/DocumentCaptureReview.js +0 -1
- package/{src → lib}/components/selfie/src/SelfieCaptureScreens.js +188 -37
- package/{src → lib}/components/selfie/src/index.js +0 -2
- package/{src → lib}/components/selfie/src/selfie-capture/SelfieCapture.js +3 -4
- package/{src → lib}/components/selfie/src/selfie-capture-instructions/SelfieCaptureInstructions.js +0 -1
- package/{src → lib}/components/selfie/src/selfie-capture-review/SelfieCaptureReview.js +0 -8
- package/lib/components/selfie/src/selfie-capture-wrapper/SelfieCaptureWrapper.tsx +226 -0
- package/lib/components/selfie/src/selfie-capture-wrapper/index.ts +1 -0
- package/lib/components/selfie/src/smartselfie-capture/OvalProgress.tsx +81 -0
- package/lib/components/selfie/src/smartselfie-capture/SmartSelfieCapture.tsx +223 -0
- package/lib/components/selfie/src/smartselfie-capture/components/AlertDisplay.tsx +34 -0
- package/lib/components/selfie/src/smartselfie-capture/components/CameraPreview.tsx +97 -0
- package/lib/components/selfie/src/smartselfie-capture/components/CaptureControls.tsx +74 -0
- package/lib/components/selfie/src/smartselfie-capture/components/index.ts +3 -0
- package/lib/components/selfie/src/smartselfie-capture/constants.ts +23 -0
- package/lib/components/selfie/src/smartselfie-capture/hooks/index.ts +2 -0
- package/lib/components/selfie/src/smartselfie-capture/hooks/useCamera.ts +94 -0
- package/lib/components/selfie/src/smartselfie-capture/hooks/useFaceCapture.ts +558 -0
- package/lib/components/selfie/src/smartselfie-capture/index.ts +1 -0
- package/lib/components/selfie/src/smartselfie-capture/utils/alertMessages.ts +12 -0
- package/lib/components/selfie/src/smartselfie-capture/utils/canvas.ts +105 -0
- package/lib/components/selfie/src/smartselfie-capture/utils/faceDetection.ts +129 -0
- package/lib/components/selfie/src/smartselfie-capture/utils/imageCapture.ts +65 -0
- package/lib/components/selfie/src/smartselfie-capture/utils/index.ts +4 -0
- package/lib/components/selfie/src/smartselfie-capture/utils/mediapipeManager.ts +60 -0
- package/{src → lib}/components/signature-pad/package.json +1 -1
- package/{src → lib}/components/smart-camera-web/src/README.md +0 -1
- package/{src → lib}/styles/src/styles.js +0 -1
- package/package.json +76 -24
- package/src/index.js +0 -5
- /package/{src → lib}/components/README.md +0 -0
- /package/{src → lib}/components/attribution/PoweredBySmileId.js +0 -0
- /package/{src → lib}/components/camera-permission/CameraPermission.stories.js +0 -0
- /package/{src → lib}/components/combobox/src/Combobox.js +0 -0
- /package/{src → lib}/components/combobox/src/index.js +0 -0
- /package/{src → lib}/components/document/src/DocumentCaptureScreens.js +0 -0
- /package/{src → lib}/components/document/src/DocumentCaptureScreens.stories.js +0 -0
- /package/{src → lib}/components/document/src/README.md +0 -0
- /package/{src → lib}/components/document/src/document-capture/DocumentCapture.stories.js +0 -0
- /package/{src → lib}/components/document/src/document-capture/README.md +0 -0
- /package/{src → lib}/components/document/src/document-capture/index.js +0 -0
- /package/{src → lib}/components/document/src/document-capture-instructions/DocumentCaptureInstructions.js +0 -0
- /package/{src → lib}/components/document/src/document-capture-instructions/DocumentCaptureInstructions.stories.js +0 -0
- /package/{src → lib}/components/document/src/document-capture-instructions/README.md +0 -0
- /package/{src → lib}/components/document/src/document-capture-instructions/index.js +0 -0
- /package/{src → lib}/components/document/src/document-capture-review/DocumentCaptureReview.stories.js +0 -0
- /package/{src → lib}/components/document/src/document-capture-review/README.md +0 -0
- /package/{src → lib}/components/document/src/document-capture-review/index.js +0 -0
- /package/{src → lib}/components/document/src/index.js +0 -0
- /package/{src → lib}/components/end-user-consent/src/EndUserConsent.js +0 -0
- /package/{src → lib}/components/end-user-consent/src/EndUserConsent.stories.js +0 -0
- /package/{src → lib}/components/end-user-consent/src/index.js +0 -0
- /package/{src → lib}/components/navigation/src/Navigation.js +0 -0
- /package/{src → lib}/components/navigation/src/Navigation.stories.js +0 -0
- /package/{src → lib}/components/navigation/src/index.js +0 -0
- /package/{src → lib}/components/selfie/README.md +0 -0
- /package/{src → lib}/components/selfie/src/SelfieCaptureScreens.stories.js +0 -0
- /package/{src → lib}/components/selfie/src/selfie-capture/SelfieCapture.stories.js +0 -0
- /package/{src → lib}/components/selfie/src/selfie-capture/index.js +0 -0
- /package/{src → lib}/components/selfie/src/selfie-capture-instructions/SelfieCaptureInstructions.stories.js +0 -0
- /package/{src → lib}/components/selfie/src/selfie-capture-instructions/index.js +0 -0
- /package/{src → lib}/components/selfie/src/selfie-capture-review/SelfieCaptureReview.stories.js +0 -0
- /package/{src → lib}/components/selfie/src/selfie-capture-review/index.js +0 -0
- /package/{src → lib}/components/signature-pad/package-lock.json +0 -0
- /package/{src → lib}/components/signature-pad/src/SignaturePad.js +0 -0
- /package/{src → lib}/components/signature-pad/src/SignaturePad.stories.js +0 -0
- /package/{src → lib}/components/signature-pad/src/index.js +0 -0
- /package/{src → lib}/components/smart-camera-web/src/SmartCameraWeb.js +0 -0
- /package/{src → lib}/components/smart-camera-web/src/SmartCameraWeb.stories.js +0 -0
- /package/{src → lib}/components/totp-consent/src/TotpConsent.js +0 -0
- /package/{src → lib}/components/totp-consent/src/index.js +0 -0
- /package/{src → lib}/domain/camera/src/README.md +0 -0
- /package/{src → lib}/domain/camera/src/SmartCamera.js +0 -0
- /package/{src → lib}/domain/constants/src/Constants.js +0 -0
- /package/{src → lib}/domain/file-upload/README.md +0 -0
- /package/{src → lib}/domain/file-upload/src/SmartFileUpload.js +0 -0
- /package/{src → lib}/styles/README.md +0 -0
- /package/{src → lib}/styles/src/typography.js +0 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculate the size of a face relative to the video frame
|
|
3
|
+
*/
|
|
4
|
+
export const calculateFaceSize = (landmarks: any): number => {
|
|
5
|
+
if (!landmarks || landmarks.length === 0) return 0;
|
|
6
|
+
|
|
7
|
+
const face = landmarks[0];
|
|
8
|
+
|
|
9
|
+
if (!face || face.length === 0) return 0;
|
|
10
|
+
|
|
11
|
+
// Get bounding box of face landmarks
|
|
12
|
+
let minX = 1;
|
|
13
|
+
let maxX = 0;
|
|
14
|
+
let minY = 1;
|
|
15
|
+
let maxY = 0;
|
|
16
|
+
|
|
17
|
+
face.forEach((landmark: any) => {
|
|
18
|
+
if (
|
|
19
|
+
landmark &&
|
|
20
|
+
typeof landmark.x === 'number' &&
|
|
21
|
+
typeof landmark.y === 'number'
|
|
22
|
+
) {
|
|
23
|
+
minX = Math.min(minX, landmark.x);
|
|
24
|
+
maxX = Math.max(maxX, landmark.x);
|
|
25
|
+
minY = Math.min(minY, landmark.y);
|
|
26
|
+
maxY = Math.max(maxY, landmark.y);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// Calculate face size as percentage of video area
|
|
31
|
+
const faceWidth = maxX - minX;
|
|
32
|
+
const faceHeight = maxY - minY;
|
|
33
|
+
const faceSize = Math.max(faceWidth, faceHeight);
|
|
34
|
+
|
|
35
|
+
return faceSize;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Check if a face is positioned within the oval bounds
|
|
40
|
+
*/
|
|
41
|
+
export const isFaceInBounds = (
|
|
42
|
+
landmarks: any,
|
|
43
|
+
videoAspectRatio: number,
|
|
44
|
+
): boolean => {
|
|
45
|
+
if (!landmarks || landmarks.length === 0) return false;
|
|
46
|
+
|
|
47
|
+
const face = landmarks[0];
|
|
48
|
+
|
|
49
|
+
let minX = 1;
|
|
50
|
+
let maxX = 0;
|
|
51
|
+
let minY = 1;
|
|
52
|
+
let maxY = 0;
|
|
53
|
+
face.forEach((landmark: any) => {
|
|
54
|
+
minX = Math.min(minX, landmark.x);
|
|
55
|
+
maxX = Math.max(maxX, landmark.x);
|
|
56
|
+
minY = Math.min(minY, landmark.y);
|
|
57
|
+
maxY = Math.max(maxY, landmark.y);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const ovalCenterX = 0.5;
|
|
61
|
+
const ovalCenterY = 0.6;
|
|
62
|
+
|
|
63
|
+
const isLandscape = videoAspectRatio > 1;
|
|
64
|
+
let ovalWidth;
|
|
65
|
+
let ovalHeight;
|
|
66
|
+
if (isLandscape) {
|
|
67
|
+
ovalWidth = 0.4;
|
|
68
|
+
ovalHeight = 0.3;
|
|
69
|
+
} else {
|
|
70
|
+
ovalWidth = 0.35;
|
|
71
|
+
ovalHeight = 0.5;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const faceCenterX = (minX + maxX) / 2;
|
|
75
|
+
const faceCenterY = (minY + maxY) / 2;
|
|
76
|
+
|
|
77
|
+
const centerTolerance = 0.2;
|
|
78
|
+
const centerOvalWidth = ovalWidth * (1 + centerTolerance);
|
|
79
|
+
const centerOvalHeight = ovalHeight * (1 + centerTolerance);
|
|
80
|
+
|
|
81
|
+
const checkPointInCenterOval = (x: number, y: number) => {
|
|
82
|
+
const dx = (x - ovalCenterX) / centerOvalWidth;
|
|
83
|
+
const dy = (y - ovalCenterY) / centerOvalHeight;
|
|
84
|
+
return dx * dx + dy * dy <= 1;
|
|
85
|
+
};
|
|
86
|
+
const centerInBounds = checkPointInCenterOval(faceCenterX, faceCenterY);
|
|
87
|
+
|
|
88
|
+
const toleranceX = 0.2;
|
|
89
|
+
const toleranceY = 0.1;
|
|
90
|
+
const adjustedOvalWidth = ovalWidth * (1 + toleranceX);
|
|
91
|
+
const adjustedOvalHeight = ovalHeight * (1 + toleranceY);
|
|
92
|
+
|
|
93
|
+
const checkPointInExpandedOval = (x: number, y: number) => {
|
|
94
|
+
const dx = (x - ovalCenterX) / adjustedOvalWidth;
|
|
95
|
+
const dy = (y - ovalCenterY) / adjustedOvalHeight;
|
|
96
|
+
return dx * dx + dy * dy <= 1;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const topLeft = checkPointInExpandedOval(minX, minY);
|
|
100
|
+
const topRight = checkPointInExpandedOval(maxX, minY);
|
|
101
|
+
const bottomLeft = checkPointInExpandedOval(minX, maxY);
|
|
102
|
+
const bottomRight = checkPointInExpandedOval(maxX, maxY);
|
|
103
|
+
|
|
104
|
+
return centerInBounds && topLeft && topRight && bottomLeft && bottomRight;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Calculate mouth opening using face landmarks
|
|
109
|
+
*/
|
|
110
|
+
export const calculateMouthOpening = (landmarks: any): number => {
|
|
111
|
+
if (!landmarks || landmarks.length === 0) return 0;
|
|
112
|
+
|
|
113
|
+
const face = landmarks[0];
|
|
114
|
+
if (!face || face.length === 0) return 0;
|
|
115
|
+
|
|
116
|
+
// MediaPipe face landmark indices for mouth
|
|
117
|
+
const upperLipCenter = face[13]; // Upper lip center
|
|
118
|
+
const lowerLipCenter = face[14]; // Lower lip center
|
|
119
|
+
|
|
120
|
+
if (!upperLipCenter || !lowerLipCenter) return 0;
|
|
121
|
+
|
|
122
|
+
const mouthHeight = Math.abs(lowerLipCenter.y - upperLipCenter.y);
|
|
123
|
+
|
|
124
|
+
const faceTop = Math.min(...face.map((p: any) => p.y));
|
|
125
|
+
const faceBottom = Math.max(...face.map((p: any) => p.y));
|
|
126
|
+
const faceHeight = faceBottom - faceTop;
|
|
127
|
+
|
|
128
|
+
return faceHeight > 0 ? mouthHeight / faceHeight : 0;
|
|
129
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export const captureImageFromVideo = (
|
|
2
|
+
videoElement: HTMLVideoElement,
|
|
3
|
+
isReference: boolean = false,
|
|
4
|
+
): string | null => {
|
|
5
|
+
const canvas = document.createElement('canvas');
|
|
6
|
+
const ctx = canvas.getContext('2d');
|
|
7
|
+
if (!ctx) return null;
|
|
8
|
+
|
|
9
|
+
const isPortrait = videoElement.videoHeight > videoElement.videoWidth;
|
|
10
|
+
|
|
11
|
+
if (isReference) {
|
|
12
|
+
if (isPortrait) {
|
|
13
|
+
canvas.width = 480;
|
|
14
|
+
canvas.height = Math.max(
|
|
15
|
+
640,
|
|
16
|
+
(canvas.width * videoElement.videoHeight) / videoElement.videoWidth,
|
|
17
|
+
);
|
|
18
|
+
} else {
|
|
19
|
+
canvas.width = 640;
|
|
20
|
+
canvas.height = Math.max(
|
|
21
|
+
480,
|
|
22
|
+
(canvas.width * videoElement.videoHeight) / videoElement.videoWidth,
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
} else if (isPortrait) {
|
|
26
|
+
canvas.width = 240;
|
|
27
|
+
canvas.height = Math.max(
|
|
28
|
+
320,
|
|
29
|
+
(canvas.width * videoElement.videoHeight) / videoElement.videoWidth,
|
|
30
|
+
);
|
|
31
|
+
} else {
|
|
32
|
+
canvas.width = 320;
|
|
33
|
+
canvas.height = Math.max(
|
|
34
|
+
240,
|
|
35
|
+
(canvas.width * videoElement.videoHeight) / videoElement.videoWidth,
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// capture more of the user's head and avoid clipping
|
|
40
|
+
// zoom out only for high resolution (>720p) webcams
|
|
41
|
+
const zoomOutFactor = videoElement.videoHeight > 720 ? 1.3 : 1.0;
|
|
42
|
+
const sourceWidth = videoElement.videoWidth * zoomOutFactor;
|
|
43
|
+
const sourceHeight = videoElement.videoHeight * zoomOutFactor;
|
|
44
|
+
|
|
45
|
+
// center the zoomed out area
|
|
46
|
+
const offsetX = (sourceWidth - videoElement.videoWidth) / 2;
|
|
47
|
+
const offsetY = (sourceHeight - videoElement.videoHeight) / 2;
|
|
48
|
+
|
|
49
|
+
// vertical offset to shift up and capture full head
|
|
50
|
+
const verticalOffset = videoElement.videoHeight * 0.05;
|
|
51
|
+
|
|
52
|
+
ctx.drawImage(
|
|
53
|
+
videoElement,
|
|
54
|
+
-offsetX,
|
|
55
|
+
-offsetY - verticalOffset,
|
|
56
|
+
sourceWidth,
|
|
57
|
+
sourceHeight,
|
|
58
|
+
0,
|
|
59
|
+
0,
|
|
60
|
+
canvas.width,
|
|
61
|
+
canvas.height,
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
return canvas.toDataURL('image/jpeg');
|
|
65
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { FaceLandmarker, FilesetResolver } from '@mediapipe/tasks-vision';
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
interface Window {
|
|
5
|
+
__smileIdentityMediapipe?: {
|
|
6
|
+
instance: FaceLandmarker | null;
|
|
7
|
+
loading: Promise<FaceLandmarker> | null;
|
|
8
|
+
loaded: boolean;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const getMediapipeInstance = async (): Promise<FaceLandmarker> => {
|
|
14
|
+
if (!window.__smileIdentityMediapipe) {
|
|
15
|
+
window.__smileIdentityMediapipe = {
|
|
16
|
+
instance: null,
|
|
17
|
+
loading: null,
|
|
18
|
+
loaded: false,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const mediapipeGlobal = window.__smileIdentityMediapipe;
|
|
23
|
+
|
|
24
|
+
if (mediapipeGlobal.loaded && mediapipeGlobal.instance) {
|
|
25
|
+
return mediapipeGlobal.instance;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (mediapipeGlobal.loading) {
|
|
29
|
+
return mediapipeGlobal.loading;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
mediapipeGlobal.loading = (async () => {
|
|
33
|
+
try {
|
|
34
|
+
const vision = await FilesetResolver.forVisionTasks(
|
|
35
|
+
'https://web-models.smileidentity.com/mediapipe-tasks-vision-wasm',
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
const faceLandmarker = await FaceLandmarker.createFromOptions(vision, {
|
|
39
|
+
baseOptions: {
|
|
40
|
+
modelAssetPath: `https://web-models.smileidentity.com/face_landmarker/face_landmarker.task`,
|
|
41
|
+
delegate: 'GPU',
|
|
42
|
+
},
|
|
43
|
+
outputFaceBlendshapes: true,
|
|
44
|
+
runningMode: 'VIDEO',
|
|
45
|
+
numFaces: 2,
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
mediapipeGlobal.instance = faceLandmarker;
|
|
49
|
+
mediapipeGlobal.loaded = true;
|
|
50
|
+
mediapipeGlobal.loading = null;
|
|
51
|
+
|
|
52
|
+
return faceLandmarker;
|
|
53
|
+
} catch (error) {
|
|
54
|
+
mediapipeGlobal.loading = null;
|
|
55
|
+
throw error;
|
|
56
|
+
}
|
|
57
|
+
})();
|
|
58
|
+
|
|
59
|
+
return mediapipeGlobal.loading;
|
|
60
|
+
};
|
package/package.json
CHANGED
|
@@ -1,36 +1,70 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smileid/web-components",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
3
|
+
"version": "10.0.2",
|
|
4
|
+
"private": false,
|
|
5
|
+
"main": "dist/esm/main.js",
|
|
6
|
+
"module": "dist/esm/main.js",
|
|
7
|
+
"types": "dist/types/main.d.ts",
|
|
5
8
|
"exports": {
|
|
6
|
-
".":
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"./
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"./
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/types/main.d.ts",
|
|
11
|
+
"import": "./dist/esm/main.js"
|
|
12
|
+
},
|
|
13
|
+
"./combobox": {
|
|
14
|
+
"types": "./dist/types/combobox.d.ts",
|
|
15
|
+
"import": "./dist/esm/combobox.js"
|
|
16
|
+
},
|
|
17
|
+
"./document-capture": {
|
|
18
|
+
"types": "./dist/types/document.d.ts",
|
|
19
|
+
"import": "./dist/esm/document.js"
|
|
20
|
+
},
|
|
21
|
+
"./end-user-consent": {
|
|
22
|
+
"types": "./dist/types/end-user-consent.d.ts",
|
|
23
|
+
"import": "./dist/esm/end-user-consent.js"
|
|
24
|
+
},
|
|
25
|
+
"./navigation": {
|
|
26
|
+
"types": "./dist/types/navigation.d.ts",
|
|
27
|
+
"import": "./dist/esm/navigation.js"
|
|
28
|
+
},
|
|
29
|
+
"./selfie-capture": {
|
|
30
|
+
"types": "./dist/types/selfie.d.ts",
|
|
31
|
+
"import": "./dist/esm/selfie.js"
|
|
32
|
+
},
|
|
33
|
+
"./signature-pad": {
|
|
34
|
+
"types": "./dist/types/signature-pad.d.ts",
|
|
35
|
+
"import": "./dist/esm/signature-pad.js"
|
|
36
|
+
},
|
|
37
|
+
"./totp-consent": {
|
|
38
|
+
"types": "./dist/types/totp-consent.d.ts",
|
|
39
|
+
"import": "./dist/esm/totp-consent.js"
|
|
40
|
+
},
|
|
41
|
+
"./smart-camera-web": {
|
|
42
|
+
"types": "./dist/types/smart-camera-web.d.ts",
|
|
43
|
+
"import": "./dist/esm/smart-camera-web.js"
|
|
44
|
+
}
|
|
15
45
|
},
|
|
16
46
|
"files": [
|
|
17
|
-
"./
|
|
18
|
-
"./
|
|
19
|
-
"./
|
|
47
|
+
"./lib/components/",
|
|
48
|
+
"./lib/domain/",
|
|
49
|
+
"./lib/styles/",
|
|
50
|
+
"./dist/",
|
|
20
51
|
"./README.md",
|
|
21
|
-
"index.js",
|
|
22
52
|
"package.json"
|
|
23
53
|
],
|
|
24
54
|
"scripts": {
|
|
25
|
-
"build": "
|
|
26
|
-
"build:
|
|
27
|
-
"
|
|
55
|
+
"build": "npm run build:iife && npm run build:esm",
|
|
56
|
+
"build:esm": "vite build",
|
|
57
|
+
"build:iife": "cross-env BUILD_FORMAT=iife vite build",
|
|
58
|
+
"build:stats": "cross-env GENERATE_STATS=true vite build --mode=production && echo Bundle analysis generated at dist/bundle-analysis.html",
|
|
59
|
+
"dev": "vite",
|
|
60
|
+
"preview": "vite preview",
|
|
28
61
|
"prepublishOnly": "npm run build",
|
|
29
|
-
"lint:fix": "eslint . --ext .js --fix",
|
|
62
|
+
"lint:fix": "eslint . --ext .js,.ts,.tsx --fix",
|
|
30
63
|
"lint:html": "npx prettier --write $(git ls-files '*.html')",
|
|
31
|
-
"lint": "eslint . --ext .js",
|
|
32
|
-
"start": "
|
|
33
|
-
"test": "npx cypress run"
|
|
64
|
+
"lint": "eslint . --ext .js,.ts,.tsx",
|
|
65
|
+
"start": "vite build --watch",
|
|
66
|
+
"test": "npx cypress run",
|
|
67
|
+
"type-check": "tsc --noEmit"
|
|
34
68
|
},
|
|
35
69
|
"description": "A collection of Web Components used by SmileID",
|
|
36
70
|
"keywords": [
|
|
@@ -39,20 +73,38 @@
|
|
|
39
73
|
"type": "module",
|
|
40
74
|
"author": "SmileID <support@usesmileid.com> (https://usesmileid.com)",
|
|
41
75
|
"dependencies": {
|
|
76
|
+
"@mediapipe/tasks-vision": "^0.10.22-rc.20250304",
|
|
77
|
+
"@preact/signals": "^2.1.1",
|
|
78
|
+
"@tabler/icons-preact": "^3.34.0",
|
|
79
|
+
"preact": "^10.26.9",
|
|
80
|
+
"preact-custom-element": "^4.3.0",
|
|
81
|
+
"preact-router": "^4.1.2",
|
|
42
82
|
"signature_pad": "^5.0.2",
|
|
43
83
|
"validate.js": "^0.13.1"
|
|
44
84
|
},
|
|
45
85
|
"devDependencies": {
|
|
86
|
+
"@preact/preset-vite": "^2.10.2",
|
|
87
|
+
"@types/node": "^20.11.24",
|
|
88
|
+
"@types/preact-custom-element": "^4.0.4",
|
|
89
|
+
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
90
|
+
"@typescript-eslint/parser": "^7.18.0",
|
|
46
91
|
"cross-env": "^7.0.3",
|
|
47
92
|
"cypress": "^13.15.0",
|
|
48
|
-
"esbuild": "^0.24.0",
|
|
49
93
|
"eslint": "^8.57.0",
|
|
50
94
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
95
|
+
"eslint-config-airbnb-typescript": "^18.0.0",
|
|
51
96
|
"eslint-config-prettier": "^9.1.0",
|
|
97
|
+
"eslint-import-resolver-typescript": "^3.6.1",
|
|
52
98
|
"eslint-plugin-cypress": "^3.3.0",
|
|
53
99
|
"eslint-plugin-import": "^2.29.1",
|
|
54
100
|
"eslint-plugin-jest": "^28.8.3",
|
|
55
101
|
"eslint-plugin-prettier": "^5.2.1",
|
|
56
|
-
"
|
|
102
|
+
"glob": "^10.3.10",
|
|
103
|
+
"prettier": "^3.6.2",
|
|
104
|
+
"rollup-plugin-visualizer": "^6.0.3",
|
|
105
|
+
"typescript": "^5.8.3",
|
|
106
|
+
"vite": "^7.0.1",
|
|
107
|
+
"vite-plugin-dts": "^4.5.4",
|
|
108
|
+
"vite-plugin-tsconfig-paths": "^1.4.1"
|
|
57
109
|
}
|
|
58
110
|
}
|
package/src/index.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import DocumentCaptureScreens from './components/document/src';
|
|
2
|
-
import SelfieCaptureScreens from './components/selfie/src';
|
|
3
|
-
import SmartCameraWeb from './components/smart-camera-web/src/SmartCameraWeb';
|
|
4
|
-
|
|
5
|
-
export { DocumentCaptureScreens, SelfieCaptureScreens, SmartCameraWeb };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{src → lib}/components/selfie/src/selfie-capture-review/SelfieCaptureReview.stories.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|