@idmission/websdk-ui 0.2.0-rc.2 → 0.5.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/README.md +168 -56
- package/dist/DocumentCaptureView.d.ts +44 -5
- package/dist/DocumentCaptureView.d.ts.map +1 -1
- package/dist/DocumentCaptureView.js +517 -30
- package/dist/FaceLivenessView.d.ts +3 -3
- package/dist/FaceLivenessView.d.ts.map +1 -1
- package/dist/FaceLivenessView.js +82 -40
- package/dist/IdCaptureView.d.ts +33 -20
- package/dist/IdCaptureView.d.ts.map +1 -1
- package/dist/IdCaptureView.js +196 -33
- package/dist/SelfieCaptureView.d.ts +19 -2
- package/dist/SelfieCaptureView.d.ts.map +1 -1
- package/dist/SelfieCaptureView.js +17 -5
- package/dist/SignatureCaptureView.d.ts +23 -2
- package/dist/SignatureCaptureView.d.ts.map +1 -1
- package/dist/SignatureCaptureView.js +138 -22
- package/dist/VideoIdCaptureView.d.ts +15 -3
- package/dist/VideoIdCaptureView.d.ts.map +1 -1
- package/dist/VideoIdCaptureView.js +35 -8
- package/dist/bindings/useDocumentCapture.d.ts.map +1 -1
- package/dist/bindings/useDocumentCapture.js +2 -1
- package/dist/bindings/useIdCapture.d.ts.map +1 -1
- package/dist/bindings/useIdCapture.js +2 -1
- package/dist/bindings/useSelfieCapture.d.ts.map +1 -1
- package/dist/bindings/useSelfieCapture.js +2 -1
- package/dist/bindings/useSignatureCapture.d.ts.map +1 -1
- package/dist/bindings/useSignatureCapture.js +2 -1
- package/dist/bindings/useVideoIdCapture.d.ts.map +1 -1
- package/dist/bindings/useVideoIdCapture.js +2 -1
- package/dist/components/CameraFeed.d.ts +11 -3
- package/dist/components/CameraFeed.d.ts.map +1 -1
- package/dist/components/CameraFeed.js +24 -4
- package/dist/components/barcode/BarcodeGuideOverlay.d.ts +7 -1
- package/dist/components/barcode/BarcodeGuideOverlay.d.ts.map +1 -1
- package/dist/components/barcode/BarcodeGuideOverlay.js +2 -2
- package/dist/components/common/BrowserEdgeTint.d.ts +63 -0
- package/dist/components/common/BrowserEdgeTint.d.ts.map +1 -0
- package/dist/components/common/BrowserEdgeTint.js +111 -0
- package/dist/components/common/LoaderButton.d.ts +9 -0
- package/dist/components/common/LoaderButton.d.ts.map +1 -1
- package/dist/components/common/LoaderButton.js +44 -321
- package/dist/components/common/ScreenReaderStatus.d.ts +8 -0
- package/dist/components/common/ScreenReaderStatus.d.ts.map +1 -0
- package/dist/components/common/ScreenReaderStatus.js +18 -0
- package/dist/components/common/overlay.d.ts +6 -0
- package/dist/components/common/overlay.d.ts.map +1 -1
- package/dist/components/common/overlay.js +7 -1
- package/dist/components/debug/debug.d.ts +10 -4
- package/dist/components/debug/debug.d.ts.map +1 -1
- package/dist/components/debug/debug.js +5 -1
- package/dist/components/document/DocumentCaptureAutoCaptureDebugLayer.d.ts +29 -0
- package/dist/components/document/DocumentCaptureAutoCaptureDebugLayer.d.ts.map +1 -0
- package/dist/components/document/DocumentCaptureAutoCaptureDebugLayer.js +273 -0
- package/dist/components/document/DocumentCaptureAutoCaptureGuidance.d.ts +56 -0
- package/dist/components/document/DocumentCaptureAutoCaptureGuidance.d.ts.map +1 -0
- package/dist/components/document/DocumentCaptureAutoCaptureGuidance.js +128 -0
- package/dist/components/document/DocumentCaptureGuideOverlay.d.ts +31 -1
- package/dist/components/document/DocumentCaptureGuideOverlay.d.ts.map +1 -1
- package/dist/components/document/DocumentCaptureGuideOverlay.js +121 -2
- package/dist/components/document/DocumentCaptureReviewScreen.d.ts +44 -0
- package/dist/components/document/DocumentCaptureReviewScreen.d.ts.map +1 -0
- package/dist/components/document/DocumentCaptureReviewScreen.js +40 -0
- package/dist/components/document/types.d.ts +25 -0
- package/dist/components/document/types.d.ts.map +1 -1
- package/dist/components/document/types.js +18 -1
- package/dist/components/error/CameraAccessDeniedOverlay.d.ts +8 -1
- package/dist/components/error/CameraAccessDeniedOverlay.d.ts.map +1 -1
- package/dist/components/error/useCameraAccessDeniedReport.d.ts +12 -0
- package/dist/components/error/useCameraAccessDeniedReport.d.ts.map +1 -0
- package/dist/components/error/useCameraAccessDeniedReport.js +31 -0
- package/dist/components/face_liveness/FaceLivenessFailure.d.ts +4 -1
- package/dist/components/face_liveness/FaceLivenessFailure.d.ts.map +1 -1
- package/dist/components/face_liveness/FaceLivenessFailure.js +4 -2
- package/dist/components/face_liveness/FaceLivenessSuccess.d.ts +4 -1
- package/dist/components/face_liveness/FaceLivenessSuccess.d.ts.map +1 -1
- package/dist/components/face_liveness/FaceLivenessSuccess.js +6 -2
- package/dist/components/guides/IdCaptureFitGuide.d.ts +2 -0
- package/dist/components/guides/IdCaptureFitGuide.d.ts.map +1 -1
- package/dist/components/guides/IdCaptureFitGuide.js +4 -1
- package/dist/components/guides/IdCaptureGuideOverlay.d.ts +2 -0
- package/dist/components/guides/IdCaptureGuideOverlay.d.ts.map +1 -1
- package/dist/components/guides/IdCaptureGuideOverlay.js +3 -1
- package/dist/components/guides/IdCaptureGuides.d.ts +14 -0
- package/dist/components/guides/IdCaptureGuides.d.ts.map +1 -1
- package/dist/components/guides/IdCaptureGuides.js +23 -9
- package/dist/components/guides/IdCaptureGuidesCommon.d.ts.map +1 -1
- package/dist/components/guides/IdCaptureGuidesCommon.js +12 -7
- package/dist/components/loading/IdCaptureLoadingOverlayDefault.d.ts +9 -0
- package/dist/components/loading/IdCaptureLoadingOverlayDefault.d.ts.map +1 -1
- package/dist/components/loading/IdCaptureLoadingOverlayDefault.js +26 -4
- package/dist/components/loading/RingIntroScreen.d.ts.map +1 -1
- package/dist/components/loading/RingIntroScreen.js +4 -34
- package/dist/components/review/ReviewScreen.d.ts +10 -1
- package/dist/components/review/ReviewScreen.d.ts.map +1 -1
- package/dist/components/review/ReviewScreen.js +8 -8
- package/dist/components/review/SignatureCaptureDiagnostics.d.ts +54 -0
- package/dist/components/review/SignatureCaptureDiagnostics.d.ts.map +1 -0
- package/dist/components/review/SignatureCaptureDiagnostics.js +144 -0
- package/dist/components/selfie/FaceCaptureGuideOverlay.d.ts +9 -2
- package/dist/components/selfie/FaceCaptureGuideOverlay.d.ts.map +1 -1
- package/dist/components/selfie/FaceCaptureGuideOverlay.js +10 -4
- package/dist/components/selfie/SelfieCaptureAnimatedMask.d.ts +8 -1
- package/dist/components/selfie/SelfieCaptureAnimatedMask.d.ts.map +1 -1
- package/dist/components/selfie/SelfieCaptureAnimatedMask.js +55 -21
- package/dist/components/selfie/SelfieCaptureSurface.d.ts +19 -3
- package/dist/components/selfie/SelfieCaptureSurface.d.ts.map +1 -1
- package/dist/components/selfie/SelfieCaptureSurface.js +78 -14
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayDefault.d.ts +9 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayDefault.d.ts.map +1 -1
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayDefault.js +26 -4
- package/dist/components/videoId/VideoIdCaptureGuides.d.ts +4 -1
- package/dist/components/videoId/VideoIdCaptureGuides.d.ts.map +1 -1
- package/dist/components/videoId/VideoIdCaptureGuides.js +2 -2
- package/dist/flows/AuthStateContext.d.ts.map +1 -1
- package/dist/flows/AuthStateContext.js +2 -1
- package/dist/flows/CaptureProgress.d.ts +14 -0
- package/dist/flows/CaptureProgress.d.ts.map +1 -0
- package/dist/flows/CaptureProgress.js +51 -0
- package/dist/flows/CompositeWizard.d.ts +5 -0
- package/dist/flows/CompositeWizard.d.ts.map +1 -1
- package/dist/flows/CompositeWizard.js +6 -1
- package/dist/flows/CustomerBiometricsEnrollmentFlow.d.ts +1 -1
- package/dist/flows/CustomerBiometricsEnrollmentFlow.d.ts.map +1 -1
- package/dist/flows/CustomerBiometricsEnrollmentFlow.js +6 -3
- package/dist/flows/CustomerIdAndBiometricsEnrollmentFlow.d.ts +1 -1
- package/dist/flows/CustomerIdAndBiometricsEnrollmentFlow.d.ts.map +1 -1
- package/dist/flows/CustomerIdAndBiometricsEnrollmentFlow.js +5 -2
- package/dist/flows/DocumentCaptureFlow.d.ts +2 -2
- package/dist/flows/DocumentCaptureFlow.d.ts.map +1 -1
- package/dist/flows/DocumentCaptureFlow.js +6 -6
- package/dist/flows/FaceValidationFlow.d.ts +2 -2
- package/dist/flows/FaceValidationFlow.d.ts.map +1 -1
- package/dist/flows/FaceValidationFlow.js +2 -2
- package/dist/flows/FlowChassis.d.ts +3 -1
- package/dist/flows/FlowChassis.d.ts.map +1 -1
- package/dist/flows/FlowChassis.js +23 -4
- package/dist/flows/IdAndFaceValidationFlow.d.ts +1 -1
- package/dist/flows/IdAndFaceValidationFlow.d.ts.map +1 -1
- package/dist/flows/IdAndFaceValidationFlow.js +5 -2
- package/dist/flows/IdValidationFlow.d.ts +1 -1
- package/dist/flows/IdValidationFlow.d.ts.map +1 -1
- package/dist/flows/IdValidationFlow.js +18 -4
- package/dist/flows/SignatureKYCFlow.d.ts +18 -3
- package/dist/flows/SignatureKYCFlow.d.ts.map +1 -1
- package/dist/flows/SignatureKYCFlow.js +94 -11
- package/dist/flows/SubmissionProvider.d.ts.map +1 -1
- package/dist/flows/SubmissionProvider.js +10 -5
- package/dist/flows/VideoIdValidationFlow.d.ts +1 -1
- package/dist/flows/VideoIdValidationFlow.d.ts.map +1 -1
- package/dist/flows/VideoIdValidationFlow.js +6 -3
- package/dist/flows/additionalDocuments.d.ts.map +1 -1
- package/dist/flows/additionalDocuments.js +3 -6
- package/dist/flows/approval.d.ts +2 -0
- package/dist/flows/approval.d.ts.map +1 -0
- package/dist/flows/approval.js +1 -0
- package/dist/flows/artifacts.d.ts +1 -1
- package/dist/flows/artifacts.d.ts.map +1 -1
- package/dist/flows/artifacts.js +29 -9
- package/dist/flows/autoCaptureMountGuard.d.ts +22 -0
- package/dist/flows/autoCaptureMountGuard.d.ts.map +1 -0
- package/dist/flows/autoCaptureMountGuard.js +61 -0
- package/dist/flows/customerMatch/CustomerMatchFlow.d.ts +1 -1
- package/dist/flows/customerMatch/CustomerMatchFlow.d.ts.map +1 -1
- package/dist/flows/customerMatch/CustomerMatchFlow.js +5 -6
- package/dist/flows/ringScreens.d.ts +1 -3
- package/dist/flows/ringScreens.d.ts.map +1 -1
- package/dist/flows/ringScreens.js +19 -5
- package/dist/flows/types.d.ts +17 -3
- package/dist/flows/types.d.ts.map +1 -1
- package/dist/guidance/selfieStrings.d.ts +9 -1
- package/dist/guidance/selfieStrings.d.ts.map +1 -1
- package/dist/guidance/selfieStrings.js +67 -24
- package/dist/guidance/strings.d.ts +34 -1
- package/dist/guidance/strings.d.ts.map +1 -1
- package/dist/guidance/strings.js +39 -0
- package/dist/i18n/index.d.ts +28 -1177
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +58 -22
- package/dist/i18n/locales/threeOh.d.ts +4 -0
- package/dist/i18n/locales/threeOh.d.ts.map +1 -0
- package/dist/i18n/locales/threeOh.js +159 -0
- package/dist/index.d.ts +12 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/testing/autoCaptureFrames.d.ts +23 -0
- package/dist/testing/autoCaptureFrames.d.ts.map +1 -0
- package/dist/testing/autoCaptureFrames.js +193 -0
- package/dist/testing/buildSelfieState.d.ts.map +1 -1
- package/dist/testing/buildSelfieState.js +5 -0
- package/dist/testing/classNamesLeaves.js +1 -1
- package/dist/testing/fakeDocumentController.d.ts +7 -1
- package/dist/testing/fakeDocumentController.d.ts.map +1 -1
- package/dist/testing/fakeDocumentController.js +10 -2
- package/dist/testing/fakeSelfieController.d.ts.map +1 -1
- package/dist/testing/fakeSelfieController.js +7 -0
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +1 -0
- package/dist/theme/index.d.ts +10 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/useDocumentUpload.d.ts +63 -0
- package/dist/useDocumentUpload.d.ts.map +1 -0
- package/dist/useDocumentUpload.js +45 -0
- package/dist/useIdmissionClient.d.ts +29 -0
- package/dist/useIdmissionClient.d.ts.map +1 -0
- package/dist/useIdmissionClient.js +44 -0
- package/dist/utils/canvas.d.ts.map +1 -1
- package/dist/utils/canvas.js +41 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/package.json +9 -7
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useCaptureProgressController, useDisplayedGuidance } from './flows/CaptureProgress';
|
|
2
3
|
import { useCallback, useEffect, useRef, useState, } from "react";
|
|
3
4
|
import SignaturePad from "signature_pad";
|
|
4
5
|
import { styled } from "styled-components";
|
|
@@ -6,11 +7,14 @@ import { SignatureCaptureGuidanceCode, } from "@idmission/websdk-core/signatureC
|
|
|
6
7
|
import { useSignatureCapture } from "./bindings/useSignatureCapture";
|
|
7
8
|
import { CameraVideoTag } from "./components/CameraFeed";
|
|
8
9
|
import { ButtonsRow } from "./components/common/ButtonsRow";
|
|
9
|
-
import { LoaderButton } from "./components/common/LoaderButton";
|
|
10
|
+
import { LoaderButton, } from "./components/common/LoaderButton";
|
|
10
11
|
import { ExitCaptureButton } from "./components/ExitCaptureButton";
|
|
12
|
+
import { GuidanceMessage } from "./components/GuidanceMessage";
|
|
13
|
+
import { CameraDebugStatus } from "./components/debug/debug";
|
|
14
|
+
import { SignatureCaptureDiagnostics } from "./components/review/SignatureCaptureDiagnostics";
|
|
11
15
|
import { FaceCaptureGuideOverlay, } from "./components/selfie/FaceCaptureGuideOverlay";
|
|
12
16
|
import { SelfieCaptureAnimatedMaskWithStatus } from "./components/selfie/SelfieCaptureAnimatedMask";
|
|
13
|
-
import { useLanguage, useTranslations, } from "./i18n";
|
|
17
|
+
import { SdkLanguageProvider, useLanguage, useTranslations, } from "./i18n";
|
|
14
18
|
import useResizeObserver from "./layout/useResizeObserver";
|
|
15
19
|
import { useShowSuccessScreen, } from "./flows/useShowSuccessScreen";
|
|
16
20
|
import { MicrophoneAccessDeniedOverlay, } from "./flows/overlays";
|
|
@@ -49,10 +53,14 @@ function updateVideoRef(ref, node) {
|
|
|
49
53
|
function handledByState(action) {
|
|
50
54
|
void action.catch(() => { });
|
|
51
55
|
}
|
|
52
|
-
export function SignatureCaptureView(
|
|
56
|
+
export function SignatureCaptureView(props) {
|
|
57
|
+
return (_jsx(SdkLanguageProvider, { lang: props.lang ?? "auto", children: _jsx(SignatureCaptureViewContent, { ...props }) }));
|
|
58
|
+
}
|
|
59
|
+
function SignatureCaptureViewContent({ controller, sessionReady = true, lang = "auto", autoStart = true, skipSuccessScreen = false, onExit, onCompleted, verbiage, classNames = {}, colors = {}, assets = {}, videoRef: providedVideoRef, onVideoElementChange, forceCameraFeed = false, headTrackingSatisfied = true, headTrackingStatus = "off", showFaceGuideThenSignaturePad = false, legacyVideoLayout = false, showCaptureDiagnostics = false, faceGuideStatus = "ready", onRestartRequested, recordingInterruptedComponent: RecordingInterruptedScreen, }) {
|
|
53
60
|
useLanguage(lang);
|
|
54
61
|
const text = useTranslations(verbiage, FALLBACKS);
|
|
55
62
|
const state = useSignatureCapture(controller);
|
|
63
|
+
useCaptureProgressController(controller);
|
|
56
64
|
const micDenied = state.error?.code === "MICROPHONE_PERMISSION_DENIED";
|
|
57
65
|
const recordingInterrupted = state.error?.code === "RECORDING_INTERRUPTED";
|
|
58
66
|
/**
|
|
@@ -69,6 +77,22 @@ export function SignatureCaptureView({ controller, sessionReady = true, lang = "
|
|
|
69
77
|
const internalVideoRef = useRef(null);
|
|
70
78
|
const videoRef = providedVideoRef ?? internalVideoRef;
|
|
71
79
|
const [videoNode, setVideoNode] = useState(null);
|
|
80
|
+
const [cameraResolution, setCameraResolution] = useState({ width: 0, height: 0 });
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
if (!showCaptureDiagnostics || !videoNode)
|
|
83
|
+
return;
|
|
84
|
+
const update = () => setCameraResolution({
|
|
85
|
+
width: videoNode.videoWidth,
|
|
86
|
+
height: videoNode.videoHeight,
|
|
87
|
+
});
|
|
88
|
+
update();
|
|
89
|
+
videoNode.addEventListener("loadedmetadata", update);
|
|
90
|
+
videoNode.addEventListener("resize", update);
|
|
91
|
+
return () => {
|
|
92
|
+
videoNode.removeEventListener("loadedmetadata", update);
|
|
93
|
+
videoNode.removeEventListener("resize", update);
|
|
94
|
+
};
|
|
95
|
+
}, [showCaptureDiagnostics, videoNode]);
|
|
72
96
|
const setVideoRef = useCallback((node) => {
|
|
73
97
|
updateVideoRef(videoRef, node);
|
|
74
98
|
setVideoNode(node);
|
|
@@ -199,23 +223,42 @@ export function SignatureCaptureView({ controller, sessionReady = true, lang = "
|
|
|
199
223
|
else
|
|
200
224
|
handledByState(controller.actions.retry());
|
|
201
225
|
}, [controller, onRestartRequested]);
|
|
202
|
-
|
|
226
|
+
// NONE and SIGN_HERE both render the sign-here copy, so the emitted code
|
|
227
|
+
// resolves to SIGN_HERE for either -- `data-guidance-code` names the message
|
|
228
|
+
// on screen, not the state that produced it, or a stylesheet targeting
|
|
229
|
+
// SIGN_HERE would miss half the frames it is displayed in.
|
|
230
|
+
const guidanceCode = state.guidance.code === SignatureCaptureGuidanceCode.KEEP_SIGNING ||
|
|
231
|
+
state.guidance.code === SignatureCaptureGuidanceCode.READY_TO_ACCEPT ||
|
|
232
|
+
state.guidance.code === SignatureCaptureGuidanceCode.PROCESSING
|
|
233
|
+
? state.guidance.code
|
|
234
|
+
: SignatureCaptureGuidanceCode.SIGN_HERE;
|
|
235
|
+
const guidance = guidanceCode === SignatureCaptureGuidanceCode.KEEP_SIGNING
|
|
203
236
|
? text.keepSigningText
|
|
204
|
-
:
|
|
237
|
+
: guidanceCode === SignatureCaptureGuidanceCode.READY_TO_ACCEPT
|
|
205
238
|
? text.readyText
|
|
206
|
-
:
|
|
239
|
+
: guidanceCode === SignatureCaptureGuidanceCode.PROCESSING
|
|
207
240
|
? text.processingText
|
|
208
241
|
: text.signHereText;
|
|
209
242
|
const capturedSignatureAltText = typeof text.capturedSignatureAltText === "string"
|
|
210
243
|
? text.capturedSignatureAltText
|
|
211
244
|
: FALLBACKS.capturedSignatureAltText;
|
|
212
245
|
const signatureDisabled = legacyVideoLayout && (!sessionReady || state.phase !== "capturing");
|
|
246
|
+
const showLiveDiagnostics = showCaptureDiagnostics &&
|
|
247
|
+
sessionReady &&
|
|
248
|
+
state.captureMode === "video" &&
|
|
249
|
+
(state.phase === "capturing" || state.phase === "processing");
|
|
213
250
|
const displayEmptyState = !signatureDisabled &&
|
|
214
251
|
state.pointCount === 0 &&
|
|
215
252
|
!emptyContentDismissed &&
|
|
216
253
|
Boolean(text.signaturePadEmptyText);
|
|
217
254
|
const showLegacyFaceGuide = legacyVideoLayout && (!showFaceGuideThenSignaturePad || !sessionReady);
|
|
218
255
|
const showLegacySignaturePad = !legacyVideoLayout || !showFaceGuideThenSignaturePad || sessionReady;
|
|
256
|
+
const signaturePromptVisible = !legacyVideoLayout
|
|
257
|
+
? (state.phase === "capturing" || state.phase === "processing") && (!showFaceGuideThenSignaturePad || headTrackingSatisfied) && Boolean(guidance)
|
|
258
|
+
: state.phase === "capturing" && !signatureDisabled && showLegacySignaturePad && ((!text.signaturePadEmptyText && headTrackingSatisfied) || emptyContentDismissed) && Boolean(text.signHereText);
|
|
259
|
+
useDisplayedGuidance(signaturePromptVisible
|
|
260
|
+
? { kind: 'displayed', message: { family: 'signature', code: legacyVideoLayout ? SignatureCaptureGuidanceCode.SIGN_HERE : guidanceCode } }
|
|
261
|
+
: { kind: 'no-prompt' });
|
|
219
262
|
const handleDone = useCallback(() => {
|
|
220
263
|
controller.actions.done();
|
|
221
264
|
}, [controller]);
|
|
@@ -226,12 +269,21 @@ export function SignatureCaptureView({ controller, sessionReady = true, lang = "
|
|
|
226
269
|
type,
|
|
227
270
|
pointerType: event.pointerType,
|
|
228
271
|
pressure: event.pressure,
|
|
272
|
+
// Contact, so the controller can tell a stroke from a pointer that is
|
|
273
|
+
// only passing over the pad. Reported per event rather than tracked,
|
|
274
|
+
// because a stroke released outside the panel never fires onPointerUp.
|
|
275
|
+
buttons: event.buttons,
|
|
276
|
+
// The panel is bigger than the pad and its overlays sit ON TOP of the
|
|
277
|
+
// canvas — the empty-state hint takes the tap that dismisses it, and
|
|
278
|
+
// SignHereText occupies the bottom strip. Only what reaches the canvas
|
|
279
|
+
// can become a stroke, so only that can start the signature.
|
|
280
|
+
onSigningSurface: event.target === canvasRef.current,
|
|
229
281
|
x: event.clientX - rect.left,
|
|
230
282
|
y: event.clientY - rect.top,
|
|
231
283
|
at: event.timeStamp,
|
|
232
284
|
});
|
|
233
285
|
}
|
|
234
|
-
const signaturePanel = (_jsxs(SignaturePanel, { ref: signaturePanelRef, className: classNames.signaturePanel, "$empty": displayEmptyState, "$headTrackingSatisfied": headTrackingSatisfied, "$legacyVideoLayout": legacyVideoLayout, onPointerDown: (event) => pointerSignal("down", event), onPointerMove: (event) => pointerSignal("move", event), onPointerUp: (event) => pointerSignal("up", event), onPointerCancel: (event) => pointerSignal("cancel", event), children: [_jsx("canvas", { ref: setCanvasRef, width: canvasDimensions?.width, height: canvasDimensions?.height, className: classNames.canvas, "aria-label": "Signature pad", "aria-hidden": !showLegacySignaturePad
|
|
286
|
+
const signaturePanel = (_jsxs(SignaturePanel, { ref: signaturePanelRef, className: classNames.signaturePanel, "$disabled": signatureDisabled, "$empty": displayEmptyState, "$headTrackingSatisfied": headTrackingSatisfied, "$legacyVideoLayout": legacyVideoLayout, onPointerDown: (event) => pointerSignal("down", event), onPointerMove: (event) => pointerSignal("move", event), onPointerUp: (event) => pointerSignal("up", event), onPointerCancel: (event) => pointerSignal("cancel", event), children: [_jsx("canvas", { ref: setCanvasRef, width: canvasDimensions?.width, height: canvasDimensions?.height, className: classNames.canvas, "aria-label": "Signature pad", "aria-hidden": !showLegacySignaturePad
|
|
235
287
|
? true
|
|
236
288
|
: !legacyVideoLayout &&
|
|
237
289
|
showFaceGuideThenSignaturePad &&
|
|
@@ -240,7 +292,11 @@ export function SignatureCaptureView({ controller, sessionReady = true, lang = "
|
|
|
240
292
|
: undefined }), !headTrackingSatisfied && text.headTrackingUnsatisfiedText ? (_jsx(SignaturePanelContent, { className: classNames.headTrackingUnsatisfiedContentContainer, "$legacyVideoLayout": legacyVideoLayout, children: _jsx(SignaturePanelContentInner, { className: classNames.headTrackingUnsatisfiedContentInner, children: text.headTrackingUnsatisfiedText }) })) : displayEmptyState ? (_jsx(SignaturePanelContent, { className: classNames.emptyContentContainer, "$legacyVideoLayout": legacyVideoLayout, onClick: () => setEmptyContentDismissed(true), children: _jsx(SignaturePanelContentInner, { className: classNames.emptyContentInner, children: text.signaturePadEmptyText }) })) : null, legacyVideoLayout &&
|
|
241
293
|
!signatureDisabled &&
|
|
242
294
|
((!text.signaturePadEmptyText && headTrackingSatisfied) ||
|
|
243
|
-
emptyContentDismissed) ? (
|
|
295
|
+
emptyContentDismissed) ? (
|
|
296
|
+
// The literal, NOT `guidanceCode`: this legacy-layout element renders
|
|
297
|
+
// `signHereText` unconditionally, so the live code would label "Sign
|
|
298
|
+
// here" as PROCESSING. The attribute names the message on screen.
|
|
299
|
+
_jsx(SignHereText, { "data-guidance-code": SignatureCaptureGuidanceCode.SIGN_HERE, children: text.signHereText })) : null] }));
|
|
244
300
|
const signatureButtons = (_jsxs(SignatureButtonsRow, { className: classNames.buttonsRow, "$legacyVideoLayout": legacyVideoLayout, children: [_jsx(LoaderButton, { variant: "secondary", finished: true, className: classNames.clearBtn, disabled: signatureDisabled ||
|
|
245
301
|
!headTrackingSatisfied ||
|
|
246
302
|
state.pointCount === 0 ||
|
|
@@ -251,20 +307,28 @@ export function SignatureCaptureView({ controller, sessionReady = true, lang = "
|
|
|
251
307
|
!headTrackingSatisfied ||
|
|
252
308
|
!state.guidance.satisfied ||
|
|
253
309
|
state.phase !== "capturing", onClick: () => handledByState(controller.actions.accept()), children: text.acceptBtnText })] }));
|
|
254
|
-
return (_jsxs(Root, { className: classNames.container, children: [onExit && state.phase !== "reviewing" && state.phase !== "completed" ? (_jsx(ExitCaptureButton, { onClick: onExit, className: classNames.exitBtn })) : null, _jsx(CameraLayer, { "$visible": forceCameraFeed || state.captureMode === "video", children: _jsx(CameraVideoTag, { ref: setVideoRef, isRearFacing: state.camera.isRearFacing, className: classNames.cameraFeed }) }), _jsxs(
|
|
310
|
+
return (_jsxs(Root, { className: classNames.container, children: [onExit && state.phase !== "reviewing" && state.phase !== "completed" ? (_jsx(ExitCaptureButton, { onClick: onExit, className: classNames.exitBtn })) : null, _jsx(CameraLayer, { "$visible": forceCameraFeed || state.captureMode === "video", children: _jsx(CameraVideoTag, { ref: setVideoRef, isRearFacing: state.camera.isRearFacing, className: classNames.cameraFeed }) }), showLiveDiagnostics ? (_jsxs(LiveDiagnostics, { "data-testid": "signature-live-diagnostics", children: [_jsx("span", { children: _jsx(CameraDebugStatus, { ready: state.camera.ready, width: cameraResolution.width, height: cameraResolution.height }) }), _jsxs("span", { children: ["Recording:", " ", state.recording.active
|
|
311
|
+
? state.recording.firstChunkReceived
|
|
312
|
+
? "active"
|
|
313
|
+
: "starting"
|
|
314
|
+
: "stopped"] }), _jsxs("span", { children: ["Head tracking:", " ", headTrackingStatus === "satisfied"
|
|
315
|
+
? "OK"
|
|
316
|
+
: headTrackingStatus === "unsatisfied"
|
|
317
|
+
? "outside"
|
|
318
|
+
: headTrackingStatus] })] })) : null, _jsxs(CaptureContent, { "$visible": (legacyVideoLayout && !sessionReady) ||
|
|
255
319
|
state.phase === "capturing" ||
|
|
256
|
-
state.phase === "processing", "$legacyVideoLayout": legacyVideoLayout, children: [!legacyVideoLayout &&
|
|
320
|
+
state.phase === "processing", "$legacyVideoLayout": legacyVideoLayout, "$reserveDebugSpace": showLiveDiagnostics, children: [!legacyVideoLayout &&
|
|
257
321
|
showFaceGuideThenSignaturePad &&
|
|
258
322
|
!headTrackingSatisfied ? (_jsx(FaceCaptureGuideOverlay, { status: faceGuideStatus })) : null, _jsxs(SignatureControls, { "$visible": legacyVideoLayout ||
|
|
259
323
|
!showFaceGuideThenSignaturePad ||
|
|
260
|
-
headTrackingSatisfied, "$legacyVideoLayout": legacyVideoLayout, className: classNames.guidesContainer, children: [text.headingText ? (_jsx(SignatureHeading, { className: classNames.heading, "$legacyVideoLayout": legacyVideoLayout, children: text.headingText })) : null, !legacyVideoLayout ? (_jsx(Guidance, { role: "status", "aria-live": "polite", className: classNames.guidance, children: guidance })) : null, legacyVideoLayout ? (_jsxs(LegacyGuidesInner, { className: classNames.guidesInner, children: [_jsx(LegacyFaceGuideContainer, { className: classNames.faceGuideContainer, "$visible": showLegacyFaceGuide, children: _jsx(LegacyFaceGuide, { className: classNames.faceGuide, status: sessionReady ? "success" : faceGuideStatus, verticalAlign: "bottom" }) }), _jsx(LegacySignaturePadContainer, { className: classNames.signaturePadContainer, "$visible": showLegacySignaturePad, children: _jsxs(LegacySignatureCanvasContainer, { className: `${classNames.signatureCanvasContainer ?? ""}${signatureDisabled &&
|
|
324
|
+
headTrackingSatisfied, "$legacyVideoLayout": legacyVideoLayout, className: classNames.guidesContainer, children: [text.headingText && (!legacyVideoLayout || sessionReady) ? (_jsx(SignatureHeading, { as: "h1", className: classNames.heading, "$background": colors.headingBackgroundColor, "$textColor": colors.headingTextColor, "$legacyVideoLayout": legacyVideoLayout, children: text.headingText })) : null, !legacyVideoLayout ? (_jsx(Guidance, { role: "status", "aria-live": "polite", className: classNames.guidance, "data-guidance-code": guidanceCode, children: guidance })) : null, legacyVideoLayout ? (_jsxs(LegacyGuidesInner, { className: classNames.guidesInner, children: [_jsx(LegacyFaceGuideContainer, { className: classNames.faceGuideContainer, "$visible": showLegacyFaceGuide, children: _jsx(LegacyFaceGuide, { className: classNames.faceGuide, status: sessionReady ? "success" : faceGuideStatus, verticalAlign: "bottom" }) }), _jsx(LegacySignaturePadContainer, { className: classNames.signaturePadContainer, "$visible": showLegacySignaturePad, children: _jsxs(LegacySignatureCanvasContainer, { className: `${classNames.signatureCanvasContainer ?? ""}${signatureDisabled &&
|
|
261
325
|
classNames.signatureCanvasContainerDisabled
|
|
262
326
|
? ` ${classNames.signatureCanvasContainerDisabled}`
|
|
263
327
|
: ""}`, "$disabled": signatureDisabled, "$headTrackingSatisfied": headTrackingSatisfied, children: [signaturePanel, signatureButtons] }) })] })) : (_jsxs(_Fragment, { children: [signaturePanel, signatureButtons] }))] })] }), (state.phase === "reviewing" || state.phase === "completed") &&
|
|
264
|
-
showSuccessScreen ? (_jsxs(Review, { className: classNames.review, children: [assets.successIcon ? _jsx("img", { src: assets.successIcon, alt: "" }) : null, _jsx("h1", { className: classNames.successHeading, children: text.successHeadingText }), previewUrl ? (_jsx("video", { src: previewUrl, className: classNames.reviewMedia, controls: true, playsInline: true })) : null, !previewUrl && state.artifact ? (_jsx("img", { src: state.artifact.imageDataUrl, alt: capturedSignatureAltText, className: classNames.reviewMedia })) : null, state.phase === "reviewing" ? (_jsxs(ButtonsRow, { className: classNames.buttonsRow, children: [_jsx(LoaderButton, { variant: "warning", finished: true, className: classNames.retryBtn, onClick: () => {
|
|
328
|
+
showSuccessScreen ? (_jsxs(Review, { className: classNames.review, children: [assets.successIcon ? _jsx("img", { src: assets.successIcon, alt: "" }) : null, _jsx("h1", { className: classNames.successHeading, children: text.successHeadingText }), previewUrl ? (_jsx("video", { src: previewUrl, className: classNames.reviewMedia, controls: true, playsInline: true })) : null, !previewUrl && state.artifact ? (_jsx("img", { src: state.artifact.imageDataUrl, alt: capturedSignatureAltText, className: classNames.reviewMedia })) : null, showCaptureDiagnostics && state.artifact ? (_jsx(SignatureCaptureDiagnostics, { artifact: state.artifact, cameraResolution: cameraResolution, className: classNames.captureDiagnostics })) : null, state.phase === "reviewing" ? (_jsxs(ButtonsRow, { className: classNames.buttonsRow, children: [_jsx(LoaderButton, { variant: "warning", finished: true, className: classNames.retryBtn, colors: colors.retryBtn, onClick: () => {
|
|
265
329
|
padRef.current?.clear();
|
|
266
330
|
handledByState(controller.actions.retry());
|
|
267
|
-
}, children: text.retryBtnText }), _jsx(LoaderButton, { variant: "positive", finished: true, className: classNames.doneBtn, onClick: handleDone, children: text.doneBtnText })] })) : null] })) : null, micDenied ? (_jsx(MicrophoneAccessDeniedOverlay, { onRetry: () => handledByState(controller.actions.retry()), classNames: classNames.microphoneAccessDenied, verbiage: verbiage?.microphoneAccessDenied })) : null, state.phase === "error" &&
|
|
331
|
+
}, children: text.retryBtnText }), _jsx(LoaderButton, { variant: "positive", finished: true, className: classNames.doneBtn, colors: colors.doneBtn, onClick: handleDone, children: text.doneBtnText })] })) : null] })) : null, micDenied ? (_jsx(MicrophoneAccessDeniedOverlay, { onRetry: () => handledByState(controller.actions.retry()), classNames: classNames.microphoneAccessDenied, colors: colors.microphoneAccessDenied, verbiage: verbiage?.microphoneAccessDenied })) : null, state.phase === "error" &&
|
|
268
332
|
!micDenied &&
|
|
269
333
|
recordingInterrupted &&
|
|
270
334
|
!restarting &&
|
|
@@ -280,15 +344,51 @@ const Root = styled.div `
|
|
|
280
344
|
height: 100%;
|
|
281
345
|
min-height: 420px;
|
|
282
346
|
overflow: hidden;
|
|
347
|
+
container: signature-capture / inline-size;
|
|
283
348
|
background: ${(props) => props.theme.background ?? "#fff"};
|
|
284
349
|
color: ${(props) => props.theme.textColor ?? "#26332e"};
|
|
285
350
|
`;
|
|
351
|
+
/** Sits below the pad's stacking context and never receives signing input. */
|
|
352
|
+
const LiveDiagnostics = styled.div `
|
|
353
|
+
position: absolute;
|
|
354
|
+
z-index: 0;
|
|
355
|
+
top: 64px;
|
|
356
|
+
left: 20px;
|
|
357
|
+
display: grid;
|
|
358
|
+
padding: 8px;
|
|
359
|
+
color: limegreen;
|
|
360
|
+
background: rgba(0, 0, 0, 0.65);
|
|
361
|
+
font: 14px/20px monospace;
|
|
362
|
+
pointer-events: none;
|
|
363
|
+
|
|
364
|
+
@container signature-capture (max-width: 1024px) {
|
|
365
|
+
top: 12px;
|
|
366
|
+
left: 12px;
|
|
367
|
+
right: 12px;
|
|
368
|
+
grid-template-columns: repeat(2, max-content);
|
|
369
|
+
column-gap: 12px;
|
|
370
|
+
font-size: clamp(11px, 3cqw, 12px);
|
|
371
|
+
line-height: 18px;
|
|
372
|
+
|
|
373
|
+
> :first-child {
|
|
374
|
+
grid-column: 1 / -1;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
`;
|
|
378
|
+
/**
|
|
379
|
+
* Black behind the feed. WebKit snaps the mirrored front-camera video's layer
|
|
380
|
+
* to device pixels and can leave one column uncovered along an edge, which
|
|
381
|
+
* showed the view's white background as a hairline. Black reads as the
|
|
382
|
+
* screen's bezel and matches the letterbox bars the KYC flow shows while the
|
|
383
|
+
* camera is up.
|
|
384
|
+
*/
|
|
286
385
|
const CameraLayer = styled.div `
|
|
287
386
|
position: absolute;
|
|
288
387
|
inset: 0;
|
|
289
388
|
display: ${(props) => (props.$visible ? "flex" : "none")};
|
|
290
389
|
isolation: isolate;
|
|
291
390
|
overflow: hidden;
|
|
391
|
+
background: #000;
|
|
292
392
|
`;
|
|
293
393
|
const CaptureContent = styled.div `
|
|
294
394
|
position: absolute;
|
|
@@ -303,13 +403,11 @@ const CaptureContent = styled.div `
|
|
|
303
403
|
background: ${(props) => props.$legacyVideoLayout ? "transparent" : "rgba(0, 0, 0, 0.2)"};
|
|
304
404
|
box-sizing: border-box;
|
|
305
405
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
border-radius: 8px;
|
|
310
|
-
background: rgba(255, 255, 255, 0.92);
|
|
311
|
-
font-size: 1.25rem;
|
|
406
|
+
/* Reserve a band above the face guide on phones and narrow embeds. */
|
|
407
|
+
@container signature-capture (max-width: 1024px) {
|
|
408
|
+
top: ${(props) => (props.$reserveDebugSpace ? "76px" : "0")};
|
|
312
409
|
}
|
|
410
|
+
|
|
313
411
|
`;
|
|
314
412
|
const Guidance = styled.div `
|
|
315
413
|
padding: 8px 16px;
|
|
@@ -317,14 +415,17 @@ const Guidance = styled.div `
|
|
|
317
415
|
background: rgba(255, 255, 255, 0.92);
|
|
318
416
|
font-weight: 600;
|
|
319
417
|
`;
|
|
320
|
-
const SignatureHeading = styled
|
|
418
|
+
const SignatureHeading = styled(GuidanceMessage) `
|
|
419
|
+
margin: 0;
|
|
321
420
|
${(props) => props.$legacyVideoLayout
|
|
322
421
|
? `
|
|
323
422
|
position: absolute;
|
|
324
|
-
z-index: 1001;
|
|
325
423
|
top: 12px;
|
|
326
424
|
left: 50%;
|
|
327
425
|
transform: translateX(-50%);
|
|
426
|
+
width: max-content;
|
|
427
|
+
max-width: 80%;
|
|
428
|
+
box-sizing: border-box;
|
|
328
429
|
`
|
|
329
430
|
: ""}
|
|
330
431
|
`;
|
|
@@ -427,7 +528,13 @@ const SignaturePanel = styled.div `
|
|
|
427
528
|
? (props.theme.signatureCapture?.canvas?.emptyTextColor ?? "black")
|
|
428
529
|
: "inherit"};
|
|
429
530
|
touch-action: none;
|
|
430
|
-
|
|
531
|
+
/* Matches LegacySignatureCanvasContainer. The canvas inside already refuses
|
|
532
|
+
a pointer while the pad is disabled, so a touch during the pre-session
|
|
533
|
+
face guide drew nothing — but the panel still fired its handlers, and
|
|
534
|
+
recordPointerSignal read that as the signature starting. The two have to
|
|
535
|
+
agree on when the pad is live, or the signing window opens before the pad
|
|
536
|
+
will take a stroke. */
|
|
537
|
+
pointer-events: ${(props) => props.$disabled || !props.$headTrackingSatisfied ? "none" : "auto"};
|
|
431
538
|
|
|
432
539
|
canvas {
|
|
433
540
|
width: 100%;
|
|
@@ -489,7 +596,16 @@ const Review = styled.div `
|
|
|
489
596
|
display: flex;
|
|
490
597
|
flex-direction: column;
|
|
491
598
|
align-items: center;
|
|
599
|
+
/* The safe keyword keeps centred content from overflowing past the scroll
|
|
600
|
+
origin, so the heading stays reachable when the column is taller than the
|
|
601
|
+
screen. Declared after the plain value: a browser that does not know it
|
|
602
|
+
keeps the first, which is the pre-existing behaviour. */
|
|
492
603
|
justify-content: center;
|
|
604
|
+
justify-content: safe center;
|
|
605
|
+
/* Root clips, and the buttons are the LAST child. Without this the
|
|
606
|
+
diagnostics table pushes them outside a container that cannot scroll and
|
|
607
|
+
the capture cannot be completed. */
|
|
608
|
+
overflow-y: auto;
|
|
493
609
|
gap: 20px;
|
|
494
610
|
padding: 32px;
|
|
495
611
|
background: ${(props) => props.theme.background ?? "#fff"};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type RefObject } from 'react';
|
|
2
2
|
import { type VideoIdCaptureController } from '@idmission/websdk-core/videoIdCapture';
|
|
3
3
|
import type { SubmissionArtifacts } from '@idmission/websdk-core/client';
|
|
4
|
-
import { type
|
|
5
|
-
import { type
|
|
4
|
+
import { type LoaderButtonColors } from './components/common/LoaderButton';
|
|
5
|
+
import { type FlowOverlayClassNames, type FlowOverlayColors, type FlowOverlayVerbiage } from './flows/overlays';
|
|
6
|
+
import { type IdCaptureLoadingOverlayAssets, type IdCaptureLoadingOverlayClassNames, type IdCaptureLoadingOverlayColors, type IdCaptureLoadingOverlayMode, type IdCaptureLoadingOverlayVerbiage } from './components/loading/IdCaptureLoadingOverlay';
|
|
6
7
|
import { type IdCaptureGuideImages } from './components/guide_images';
|
|
7
8
|
import type { FlipIdPromptClassNames } from './components/guides/FlipIdPrompt';
|
|
8
9
|
import { type CustomerSuppliedVerbiage, type LangOption } from './i18n';
|
|
@@ -63,6 +64,16 @@ export type VideoIdCaptureViewClassNames = {
|
|
|
63
64
|
loadingOverlay?: IdCaptureLoadingOverlayClassNames;
|
|
64
65
|
microphoneAccessDenied?: FlowOverlayClassNames;
|
|
65
66
|
};
|
|
67
|
+
/** Button and overlay colours, keyed like `classNames`. The guides take theirs
|
|
68
|
+
* from `theme.idVideoCapture`. */
|
|
69
|
+
export type VideoIdCaptureViewColors = {
|
|
70
|
+
readTextDoneBtn?: LoaderButtonColors;
|
|
71
|
+
/** The review screen's buttons. */
|
|
72
|
+
retryBtn?: LoaderButtonColors;
|
|
73
|
+
doneBtn?: LoaderButtonColors;
|
|
74
|
+
loadingOverlay?: IdCaptureLoadingOverlayColors;
|
|
75
|
+
microphoneAccessDenied?: FlowOverlayColors;
|
|
76
|
+
};
|
|
66
77
|
export type VideoIdCaptureViewProps = {
|
|
67
78
|
controller: VideoIdCaptureController;
|
|
68
79
|
sessionReady?: boolean;
|
|
@@ -76,6 +87,7 @@ export type VideoIdCaptureViewProps = {
|
|
|
76
87
|
onCompleted?: (artifacts: SubmissionArtifacts) => void;
|
|
77
88
|
verbiage?: VideoIdCaptureViewVerbiage;
|
|
78
89
|
classNames?: VideoIdCaptureViewClassNames;
|
|
90
|
+
colors?: VideoIdCaptureViewColors;
|
|
79
91
|
guideImages?: IdCaptureGuideImages;
|
|
80
92
|
loadingOverlayAssets?: IdCaptureLoadingOverlayAssets;
|
|
81
93
|
videoRef?: RefObject<HTMLVideoElement | null>;
|
|
@@ -100,5 +112,5 @@ export type VideoIdCaptureViewProps = {
|
|
|
100
112
|
*/
|
|
101
113
|
onMicrophoneAccessDenied?: () => void;
|
|
102
114
|
};
|
|
103
|
-
export declare function VideoIdCaptureView(
|
|
115
|
+
export declare function VideoIdCaptureView(props: VideoIdCaptureViewProps): import("react/jsx-runtime").JSX.Element;
|
|
104
116
|
//# sourceMappingURL=VideoIdCaptureView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoIdCaptureView.d.ts","sourceRoot":"","sources":["../src/VideoIdCaptureView.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAA;AAEd,OAAO,EAEL,KAAK,wBAAwB,EAE9B,MAAM,uCAAuC,CAAA;AAC9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;
|
|
1
|
+
{"version":3,"file":"VideoIdCaptureView.d.ts","sourceRoot":"","sources":["../src/VideoIdCaptureView.tsx"],"names":[],"mappings":"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"}
|
|
@@ -6,17 +6,20 @@ import { useVideoIdCapture } from './bindings/useVideoIdCapture';
|
|
|
6
6
|
import { CameraVideoTag } from './components/CameraFeed';
|
|
7
7
|
import { ExitCaptureButton } from './components/ExitCaptureButton';
|
|
8
8
|
import { ButtonsRow } from './components/common/ButtonsRow';
|
|
9
|
-
import { LoaderButton } from './components/common/LoaderButton';
|
|
9
|
+
import { LoaderButton, } from './components/common/LoaderButton';
|
|
10
10
|
import { MicrophoneAccessDeniedOverlay, } from './flows/overlays';
|
|
11
11
|
import { IdCaptureLoadingOverlay, } from './components/loading/IdCaptureLoadingOverlay';
|
|
12
12
|
import { defaultIdCaptureGuideImages, } from './components/guide_images';
|
|
13
13
|
import { VideoIdCaptureGuides } from './components/videoId/VideoIdCaptureGuides';
|
|
14
|
-
import { useLanguage, useTranslations, useVerbiage, } from './i18n';
|
|
14
|
+
import { SdkLanguageProvider, useLanguage, useTranslations, useVerbiage, } from './i18n';
|
|
15
15
|
import { VIDEO_ID_FALLBACKS } from './guidance/videoIdStrings';
|
|
16
|
-
import { DebugBoundingBoxOverlay, DebugStatsPane, IdCaptureDetectedObjectDebugBox, useDebugScalingDetails, } from './components/debug/debug';
|
|
16
|
+
import { DebugBoundingBoxOverlay, CameraDebugStatus, DebugStatsPane, IdCaptureDetectedObjectDebugBox, useDebugScalingDetails, } from './components/debug/debug';
|
|
17
17
|
import useResizeObserver from './layout/useResizeObserver';
|
|
18
18
|
import { useSessionReady } from './flows/AuthStateContext';
|
|
19
|
-
export function VideoIdCaptureView(
|
|
19
|
+
export function VideoIdCaptureView(props) {
|
|
20
|
+
return (_jsx(SdkLanguageProvider, { lang: props.lang ?? 'auto', children: _jsx(VideoIdCaptureViewContent, { ...props }) }));
|
|
21
|
+
}
|
|
22
|
+
function VideoIdCaptureViewContent({ controller, sessionReady: sessionReadyProp, autoStart = true, loadingOverlayMode = 'default', autoContinueAfterLoading = false, showIntroScreen = false, transitionFromFaceCapture = false, lang = 'auto', onExit, onCompleted, readTextPrompt, onReadingFinished, onMicrophoneAccessDenied, verbiage, classNames = {}, colors = {}, guideImages = defaultIdCaptureGuideImages, loadingOverlayAssets, videoRef: providedVideoRef, debugMode = false, }) {
|
|
20
23
|
// Omitted means "follow the session": mounted inside a flow this view now
|
|
21
24
|
// renders during session validation, so its own loading overlay is the one
|
|
22
25
|
// loading surface (2.x behaviour — see useSessionReady). An explicit prop
|
|
@@ -107,6 +110,23 @@ export function VideoIdCaptureView({ controller, sessionReady: sessionReadyProp,
|
|
|
107
110
|
? 'SHOW_PASSPORT'
|
|
108
111
|
: 'FLIP_ID';
|
|
109
112
|
const capturing = state.phase === 'capturing';
|
|
113
|
+
// `CameraLayer` hides the feed with `display: none`, which pauses the
|
|
114
|
+
// element. The controller attaches ONCE and holds that exact node, and only
|
|
115
|
+
// a camera acquisition writes a stream into it — so the review screen's
|
|
116
|
+
// Retry, which restarts the attempt WITHOUT re-attaching (its detach/attach
|
|
117
|
+
// branch is for the error path only), un-hides an element nothing has asked
|
|
118
|
+
// to play again. Same reasoning, and same fix, as IdCaptureView's resume.
|
|
119
|
+
const feedVisible = capturing || state.phase === 'ready';
|
|
120
|
+
useEffect(() => {
|
|
121
|
+
if (!feedVisible)
|
|
122
|
+
return;
|
|
123
|
+
const el = videoRef.current;
|
|
124
|
+
// Nothing to resume on an element with no stream (pre-attach, or a
|
|
125
|
+
// deferred acquisition that has not happened yet) — see IdCaptureView.
|
|
126
|
+
if (!el?.srcObject)
|
|
127
|
+
return;
|
|
128
|
+
void Promise.resolve(el.play()).catch(() => { });
|
|
129
|
+
}, [feedVisible, videoRef]);
|
|
110
130
|
const showLoadingOverlay = !overlayDismissed &&
|
|
111
131
|
(state.phase === 'idle' ||
|
|
112
132
|
state.phase === 'loading' ||
|
|
@@ -132,7 +152,7 @@ export function VideoIdCaptureView({ controller, sessionReady: sessionReadyProp,
|
|
|
132
152
|
const backImageAlt = typeof text.backImageAlt === 'string'
|
|
133
153
|
? text.backImageAlt
|
|
134
154
|
: VIDEO_ID_FALLBACKS.backImageAlt;
|
|
135
|
-
return (_jsxs(Root, { ref: rootRef, className: classNames.container, children: [onExit && capturing ? (_jsx(ExitCaptureButton, { onClick: onExit, className: classNames.exitBtn })) : null, _jsx(CameraLayer, { "$visible":
|
|
155
|
+
return (_jsxs(Root, { ref: rootRef, className: classNames.container, children: [onExit && capturing ? (_jsx(ExitCaptureButton, { onClick: onExit, className: classNames.exitBtn })) : null, _jsx(CameraLayer, { "$visible": feedVisible, children: _jsx(CameraVideoTag, { ref: videoRef, isRearFacing: state.camera.isRearFacing, className: classNames.cameraFeed }) }), capturing ? (_jsx(VideoIdCaptureGuides, { classNames: {
|
|
136
156
|
container: classNames.guides,
|
|
137
157
|
instructions: classNames.guidance,
|
|
138
158
|
instructionsContainer: classNames.guidanceContainer,
|
|
@@ -143,10 +163,17 @@ export function VideoIdCaptureView({ controller, sessionReady: sessionReadyProp,
|
|
|
143
163
|
idCardGuideImageContainer: classNames.idCardGuideImageContainer,
|
|
144
164
|
idCardGuideImage: classNames.idCardGuideImage,
|
|
145
165
|
flipIdPrompt: classNames.flipIdPrompt,
|
|
146
|
-
}, images: guideImages, requestedAction: guideAction, idDocumentType: state.documentType, instruction: instruction, isMirrored: !state.camera.isRearFacing, satisfied: state.guidance === VideoIdCaptureGuidanceCode.HOLD_STEADY, idCardGuideStatus: state.countdownRemaining === null ? 'ready' : 'capturing', idCardCaptureProgress: state.countdownRemaining === null ? 0 : 1 })) : null, state.countdownRemaining !== null ? (_jsx(Countdown, { "aria-live": "assertive", className: classNames.countdown, children: state.countdownRemaining })) : null, state.reading.active ? (_jsxs(ReadTextPrompt, { role: "status", "aria-live": "polite", className: classNames.readTextPrompt, children: [_jsx(ReadTextHeading, { className: classNames.readTextHeading, children: readTextHeading }), _jsx(ReadTextSentence, { className: classNames.readTextSentence, children: readTextPromptText }), _jsx(LoaderButton, { variant: "positive", finished: true, disabled: !state.reading.canFinish, className: classNames.readTextDoneBtn, onClick: () => {
|
|
166
|
+
}, images: guideImages, requestedAction: guideAction, idDocumentType: state.documentType, instruction: instruction, guidanceCode: state.guidance, isMirrored: !state.camera.isRearFacing, satisfied: state.guidance === VideoIdCaptureGuidanceCode.HOLD_STEADY, idCardGuideStatus: state.countdownRemaining === null ? 'ready' : 'capturing', idCardCaptureProgress: state.countdownRemaining === null ? 0 : 1 })) : null, state.countdownRemaining !== null ? (_jsx(Countdown, { "aria-live": "assertive", className: classNames.countdown, children: state.countdownRemaining })) : null, state.reading.active ? (_jsxs(ReadTextPrompt, { role: "status", "aria-live": "polite", className: classNames.readTextPrompt, children: [_jsx(ReadTextHeading, { className: classNames.readTextHeading, children: readTextHeading }), _jsx(ReadTextSentence, { className: classNames.readTextSentence, children: readTextPromptText }), _jsx(LoaderButton, { variant: "positive", finished: true, disabled: !state.reading.canFinish, className: classNames.readTextDoneBtn, colors: colors.readTextDoneBtn, onClick: () => {
|
|
147
167
|
onReadingFinished?.();
|
|
148
168
|
void controller.actions.finishReading();
|
|
149
|
-
}, children: doneReadingText })] })) : null, debugMode && capturing ? (_jsx(VideoIdCaptureDebugLayer, { state: state, pageWidth: rootWidth, pageHeight: rootHeight })) : null, showLoadingOverlay ? (_jsx(IdCaptureLoadingOverlay, { state: state, mode: loadingOverlayMode, sessionReady: sessionReady, autoContinueAfterLoading: autoContinueAfterLoading, showIntroScreen: showIntroScreen, transitionFromPreviousStage: transitionFromFaceCapture, assets: loadingOverlayAssets, classNames: classNames.loadingOverlay, verbiage: loadingOverlayVerbiage, onDismissed: () => setOverlayDismissed(true), onUserCancel: onExit, onRequestCamera: () => controller.actions.requestCamera() })) : null, state.phase === 'reviewing' || state.phase === 'completed' ? (_jsxs(Review, { className: classNames.review, children: [_jsx("h1", { className: classNames.reviewHeading, children: text.headingText }), previewUrl ? (_jsx("video", { src: previewUrl, className: classNames.video, controls: true, playsInline: true, preload: "metadata" })) : null, _jsxs(CapturedFrames, { children: [state.artifact ? (_jsx("img", { src: state.artifact.frontImage, alt: frontImageAlt, className: classNames.frontImage })) : null, state.artifact?.backImage ? (_jsx("img", { src: state.artifact.backImage, alt: backImageAlt, className: classNames.backImage })) : null] }), state.phase === 'reviewing' ? (_jsxs(ButtonsRow, { className: classNames.buttonsRow, children: [_jsx(LoaderButton, { finished: true, variant: "warning", className: classNames.retryBtn, onClick: () => void controller.actions.retry(), children: text.retryBtnText }), _jsx(LoaderButton, { finished: true, variant: "positive", className: classNames.doneBtn, onClick: controller.actions.done, children: text.doneBtnText })] })) : null] })) : null, micDenied ? (_jsx(MicrophoneAccessDeniedOverlay, { onRetry: () => void controller.actions.retry(), classNames: classNames.microphoneAccessDenied, verbiage: verbiage?.microphoneAccessDenied })) : null, state.phase === 'error' && !micDenied ? (_jsxs(ErrorPanel, { role: "alert", className: classNames.error, children: [_jsx("h1", { children: text.errorHeadingText }), _jsx("p", { children: state.error?.message }), state.error?.recoverable ? (_jsx(LoaderButton, { finished: true,
|
|
169
|
+
}, children: doneReadingText })] })) : null, debugMode && capturing ? (_jsx(VideoIdCaptureDebugLayer, { state: state, pageWidth: rootWidth, pageHeight: rootHeight })) : null, showLoadingOverlay ? (_jsx(IdCaptureLoadingOverlay, { state: state, mode: loadingOverlayMode, sessionReady: sessionReady, autoContinueAfterLoading: autoContinueAfterLoading, showIntroScreen: showIntroScreen, transitionFromPreviousStage: transitionFromFaceCapture, assets: loadingOverlayAssets, classNames: classNames.loadingOverlay, colors: colors.loadingOverlay, verbiage: loadingOverlayVerbiage, onDismissed: () => setOverlayDismissed(true), onUserCancel: onExit, onRequestCamera: () => controller.actions.requestCamera() })) : null, state.phase === 'reviewing' || state.phase === 'completed' ? (_jsxs(Review, { className: classNames.review, children: [_jsx("h1", { className: classNames.reviewHeading, children: text.headingText }), previewUrl ? (_jsx("video", { src: previewUrl, className: classNames.video, controls: true, playsInline: true, preload: "metadata" })) : null, _jsxs(CapturedFrames, { children: [state.artifact ? (_jsx("img", { src: state.artifact.frontImage, alt: frontImageAlt, className: classNames.frontImage })) : null, state.artifact?.backImage ? (_jsx("img", { src: state.artifact.backImage, alt: backImageAlt, className: classNames.backImage })) : null] }), state.phase === 'reviewing' ? (_jsxs(ButtonsRow, { className: classNames.buttonsRow, children: [_jsx(LoaderButton, { finished: true, variant: "warning", className: classNames.retryBtn, colors: colors.retryBtn, onClick: () => void controller.actions.retry(), children: text.retryBtnText }), _jsx(LoaderButton, { finished: true, variant: "positive", className: classNames.doneBtn, colors: colors.doneBtn, onClick: controller.actions.done, children: text.doneBtnText })] })) : null] })) : null, micDenied ? (_jsx(MicrophoneAccessDeniedOverlay, { onRetry: () => void controller.actions.retry(), classNames: classNames.microphoneAccessDenied, colors: colors.microphoneAccessDenied, verbiage: verbiage?.microphoneAccessDenied })) : null, state.phase === 'error' && !micDenied ? (_jsxs(ErrorPanel, { role: "alert", className: classNames.error, children: [_jsx("h1", { children: text.errorHeadingText }), _jsx("p", { children: state.error?.message }), state.error?.recoverable ? (_jsx(LoaderButton, { finished: true,
|
|
170
|
+
// This panel is the video-ID stage's camera-denied screen too;
|
|
171
|
+
// sdk2 coloured that screen's retry from the loading overlay bag.
|
|
172
|
+
// An unavailable camera was the same 2.x screen (see ErrorScreen).
|
|
173
|
+
colors: state.error.code === 'CAMERA_PERMISSION_DENIED' ||
|
|
174
|
+
state.error.code === 'CAMERA_UNAVAILABLE'
|
|
175
|
+
? colors.loadingOverlay?.cameraAccessDenied?.retryBtn
|
|
176
|
+
: undefined, onClick: () => void controller.actions.retry(), children: text.retryBtnText })) : null] })) : null] }));
|
|
150
177
|
}
|
|
151
178
|
function VideoIdCaptureDebugLayer({ state, pageWidth, pageHeight, }) {
|
|
152
179
|
const isRearFacing = state.camera.isRearFacing;
|
|
@@ -168,7 +195,7 @@ function VideoIdCaptureDebugLayer({ state, pageWidth, pageHeight, }) {
|
|
|
168
195
|
const waitingForDwell = state.stage !== 'back' &&
|
|
169
196
|
state.goodFramesCount >= state.goodFramesThreshold &&
|
|
170
197
|
state.countdownRemaining === null;
|
|
171
|
-
return (_jsxs(_Fragment, { children: [_jsx(DebugBoundingBoxOverlay, { "$flipX": !isRearFacing, scaling: scaling, children: state.detectedObjects.map((object, index) => (_jsx(IdCaptureDetectedObjectDebugBox, { obj: object, scaling: scaling, flipX: !isRearFacing }, `${object.label}-${index}`))) }), _jsxs(DebugStatsPane, { children: [_jsx("strong", { children: "Video ID Debug" }), _jsx("br", {}), "Phase: ", state.phase, _jsx("br", {}), "Stage: ", state.stage, _jsx("br", {}), "Guidance: ", state.guidance, _jsx("br", {}), state.models.ready ? '✅' : '❌', " Models ready", _jsx("br", {}), state.recording.active ? '✅' : '❌', " Recording active", _jsx("br", {}),
|
|
198
|
+
return (_jsxs(_Fragment, { children: [_jsx(DebugBoundingBoxOverlay, { "$flipX": !isRearFacing, scaling: scaling, children: state.detectedObjects.map((object, index) => (_jsx(IdCaptureDetectedObjectDebugBox, { obj: object, scaling: scaling, flipX: !isRearFacing }, `${object.label}-${index}`))) }), _jsxs(DebugStatsPane, { children: [_jsx("strong", { children: "Video ID Debug" }), _jsx("br", {}), _jsx(CameraDebugStatus, { ready: state.camera.ready, width: state.frameWidth, height: state.frameHeight }), _jsx("br", {}), "Phase: ", state.phase, _jsx("br", {}), "Stage: ", state.stage, _jsx("br", {}), "Guidance: ", state.guidance, _jsx("br", {}), state.models.ready ? '✅' : '❌', " Models ready", _jsx("br", {}), state.recording.active ? '✅' : '❌', " Recording active", _jsx("br", {}), stageDocumentDetected ? '✅' : '❌', " Stage document detected:", ' ', state.detectedDocumentType, _jsx("br", {}), "Detection Score: ", state.detectionScore.toFixed(3), _jsx("br", {}), "Recent Stage Peak (2s): ", state.recentPeakDetectionScore.toFixed(3), _jsx("br", {}), "ID Front Score: ", state.idCardFrontDetectionScore.toFixed(3), _jsx("br", {}), "ID Back Score: ", state.idCardBackDetectionScore.toFixed(3), _jsx("br", {}), "Focus Score: ", state.focusScore.toFixed(3), _jsx("br", {}), state.documentInBounds ? '✅' : '❌', " Document in bounds", _jsx("br", {}), state.documentTooClose ? '❌' : '✅', " Document not too close", _jsx("br", {}), state.documentIsStable ? '✅' : '❌', " Document stable", _jsx("br", {}), state.focusThresholdMet ? '✅' : '❌', " Focus gate passed", _jsx("br", {}), qualifyingFrame ? '✅' : '❌', " Qualifying Frames:", ' ', state.goodFramesCount, "/", state.goodFramesThreshold, _jsx("br", {}), "Controller Progress: ", Math.round(state.progress * 100), "%", _jsx("br", {}), "Timing Gate:", ' ', waitingForDwell ? 'waiting for dwell' : 'ready or inactive', _jsx("br", {}), "Countdown: ", state.countdownRemaining ?? 'not started'] })] }));
|
|
172
199
|
}
|
|
173
200
|
const Root = styled.div `
|
|
174
201
|
position: absolute;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDocumentCapture.d.ts","sourceRoot":"","sources":["../../src/bindings/useDocumentCapture.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDocumentCapture.d.ts","sourceRoot":"","sources":["../../src/bindings/useDocumentCapture.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,yBAAyB,EACzB,8BAA8B,EAC/B,MAAM,wCAAwC,CAAA;AAG/C,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,yBAAyB,GACpC,8BAA8B,CAUhC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { useCallback
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { useSyncExternalStore } from 'use-sync-external-store/shim';
|
|
2
3
|
import { guard } from './useSelfieCapture';
|
|
3
4
|
export function useDocumentCapture(controller) {
|
|
4
5
|
const subscribe = useCallback((onStoreChange) => controller.subscribe(guard(onStoreChange)), [controller]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIdCapture.d.ts","sourceRoot":"","sources":["../../src/bindings/useIdCapture.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useIdCapture.d.ts","sourceRoot":"","sources":["../../src/bindings/useIdCapture.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,kCAAkC,CAAA;AAgBzC,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAUhD;AAED,wBAAgB,YAAY,CAAC,UAAU,EAAE,mBAAmB,GAAG,wBAAwB,CAMtF;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,UAAU,EAAE,mBAAmB,EAC/B,QAAQ,EAAE,CAAC,CAAC,EAAE,wBAAwB,KAAK,CAAC,EAC5C,OAAO,GAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,OAAmB,GAC3C,CAAC,CAuBH"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { useCallback, useRef
|
|
1
|
+
import { useCallback, useRef } from 'react';
|
|
2
|
+
import { useSyncExternalStore } from 'use-sync-external-store/shim';
|
|
2
3
|
// A listener that throws would propagate into core's frame loop and kill
|
|
3
4
|
// detection (plan-3 carry-note). Rethrow asynchronously instead: the error
|
|
4
5
|
// still surfaces (uncaughtException / window.onerror) without unwinding the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSelfieCapture.d.ts","sourceRoot":"","sources":["../../src/bindings/useSelfieCapture.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSelfieCapture.d.ts","sourceRoot":"","sources":["../../src/bindings/useSelfieCapture.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,uBAAuB,EACvB,4BAA4B,EAC7B,MAAM,sCAAsC,CAAA;AAgB7C,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAUhD;AAED,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,uBAAuB,GAClC,4BAA4B,CAM9B;AAED,wBAAgB,wBAAwB,CAAC,CAAC,EACxC,UAAU,EAAE,uBAAuB,EACnC,QAAQ,EAAE,CAAC,CAAC,EAAE,4BAA4B,KAAK,CAAC,EAChD,OAAO,GAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,OAAmB,GAC3C,CAAC,CAyBH"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { useCallback, useRef
|
|
1
|
+
import { useCallback, useRef } from 'react';
|
|
2
|
+
import { useSyncExternalStore } from 'use-sync-external-store/shim';
|
|
2
3
|
// A listener that throws would propagate into core's frame loop and kill
|
|
3
4
|
// detection (plan-3 carry-note). Rethrow asynchronously instead: the error
|
|
4
5
|
// still surfaces (uncaughtException / window.onerror) without unwinding the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignatureCapture.d.ts","sourceRoot":"","sources":["../../src/bindings/useSignatureCapture.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSignatureCapture.d.ts","sourceRoot":"","sources":["../../src/bindings/useSignatureCapture.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,0BAA0B,EAC1B,+BAA+B,EAChC,MAAM,yCAAyC,CAAA;AAGhD,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,0BAA0B,GACrC,+BAA+B,CAUjC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { useCallback
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { useSyncExternalStore } from 'use-sync-external-store/shim';
|
|
2
3
|
import { guard } from './useSelfieCapture';
|
|
3
4
|
export function useSignatureCapture(controller) {
|
|
4
5
|
const subscribe = useCallback((onStoreChange) => controller.subscribe(guard(onStoreChange)), [controller]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useVideoIdCapture.d.ts","sourceRoot":"","sources":["../../src/bindings/useVideoIdCapture.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useVideoIdCapture.d.ts","sourceRoot":"","sources":["../../src/bindings/useVideoIdCapture.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,wBAAwB,EACxB,6BAA6B,EAC9B,MAAM,uCAAuC,CAAA;AAG9C,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,wBAAwB,GACnC,6BAA6B,CAU/B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { useCallback
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { useSyncExternalStore } from 'use-sync-external-store/shim';
|
|
2
3
|
import { guard } from './useSelfieCapture';
|
|
3
4
|
export function useVideoIdCapture(controller) {
|
|
4
5
|
const subscribe = useCallback((onStoreChange) => controller.subscribe(guard(onStoreChange)), [controller]);
|
|
@@ -7,21 +7,29 @@ export declare const CameraVideoTag: import("react").ForwardRefExoticComponent<O
|
|
|
7
7
|
isRearFacing?: boolean;
|
|
8
8
|
} & import("react").RefAttributes<HTMLVideoElement>>;
|
|
9
9
|
export type CameraFeedMode = 'snapToGuides' | 'fullscreen';
|
|
10
|
-
export declare const CameraFeedWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$mode" | "$x" | "$y" | "$w" | "$h" | "$radius"> & {
|
|
10
|
+
export declare const CameraFeedWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$mode" | "$x" | "$y" | "$w" | "$h" | "$radius" | "$hidden"> & {
|
|
11
11
|
$mode: CameraFeedMode;
|
|
12
12
|
$x: number;
|
|
13
13
|
$y: number;
|
|
14
14
|
$w: number;
|
|
15
15
|
$h: number;
|
|
16
16
|
$radius?: number;
|
|
17
|
-
|
|
17
|
+
$hidden?: boolean;
|
|
18
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$mode" | "$x" | "$y" | "$w" | "$h" | "$radius" | "$hidden"> & {
|
|
18
19
|
$mode: CameraFeedMode;
|
|
19
20
|
$x: number;
|
|
20
21
|
$y: number;
|
|
21
22
|
$w: number;
|
|
22
23
|
$h: number;
|
|
23
24
|
$radius?: number;
|
|
25
|
+
$hidden?: boolean;
|
|
24
26
|
}, never>>> & string;
|
|
27
|
+
/**
|
|
28
|
+
* Whether the feed is hidden in this phase. Hiding pauses the element, so the
|
|
29
|
+
* owner of the <video> — the one holding the ref it attached with — has to ask
|
|
30
|
+
* it to play again on the way back; `IdCaptureView` does, keyed on this.
|
|
31
|
+
*/
|
|
32
|
+
export declare function isCameraFeedHidden(phase: CapturePhase): boolean;
|
|
25
33
|
export type ScalingCameraFeedProps = {
|
|
26
34
|
videoRef: Ref<HTMLVideoElement>;
|
|
27
35
|
phase: CapturePhase;
|
|
@@ -32,5 +40,5 @@ export type ScalingCameraFeedProps = {
|
|
|
32
40
|
/** 2.x parity: sdk2's `classNames.cameraFeed` on the ID/selfie wizards. */
|
|
33
41
|
className?: string;
|
|
34
42
|
};
|
|
35
|
-
export declare function ScalingCameraFeed({ videoRef, phase, isRearFacing, cameraFeedMode, className, }: ScalingCameraFeedProps): ReactElement
|
|
43
|
+
export declare function ScalingCameraFeed({ videoRef, phase, isRearFacing, cameraFeedMode, className, }: ScalingCameraFeedProps): ReactElement;
|
|
36
44
|
//# sourceMappingURL=CameraFeed.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CameraFeed.d.ts","sourceRoot":"","sources":["../../src/components/CameraFeed.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CameraFeed.d.ts","sourceRoot":"","sources":["../../src/components/CameraFeed.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAc,SAAS,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAEhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAGpE,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE,KAAK,CAAC,GAAG;IAC3E,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAA;AAED,eAAO,MAAM,cAAc;mBAHV,OAAO;oDAgBvB,CAAA;AAgBD,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG,YAAY,CAAA;AAE1D,eAAO,MAAM,iBAAiB;WACrB,cAAc;QACjB,MAAM;QACN,MAAM;QACN,MAAM;QACN,MAAM;cACA,MAAM;cACN,OAAO;;WANV,cAAc;QACjB,MAAM;QACN,MAAM;QACN,MAAM;QACN,MAAM;cACA,MAAM;cACN,OAAO;oBA4BlB,CAAA;AAuBD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAE/D;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAA;IAC/B,KAAK,EAAE,YAAY,CAAA;IACnB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;0EACsE;IACtE,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,2EAA2E;IAC3E,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,KAAK,EACL,YAAY,EACZ,cAA+B,EAC/B,SAAS,GACV,EAAE,sBAAsB,GAAG,YAAY,CAoBvC"}
|