@idmission/websdk-ui 0.1.0-rc.1
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 +189 -0
- package/dist/DocumentCaptureView.d.ts +111 -0
- package/dist/DocumentCaptureView.d.ts.map +1 -0
- package/dist/DocumentCaptureView.js +225 -0
- package/dist/FaceLivenessView.d.ts +88 -0
- package/dist/FaceLivenessView.d.ts.map +1 -0
- package/dist/FaceLivenessView.js +298 -0
- package/dist/IdCaptureView.d.ts +271 -0
- package/dist/IdCaptureView.d.ts.map +1 -0
- package/dist/IdCaptureView.js +454 -0
- package/dist/SelfieCaptureView.d.ts +119 -0
- package/dist/SelfieCaptureView.d.ts.map +1 -0
- package/dist/SelfieCaptureView.js +168 -0
- package/dist/SignatureCaptureView.d.ts +136 -0
- package/dist/SignatureCaptureView.d.ts.map +1 -0
- package/dist/SignatureCaptureView.js +521 -0
- package/dist/VideoIdCaptureView.d.ts +104 -0
- package/dist/VideoIdCaptureView.d.ts.map +1 -0
- package/dist/VideoIdCaptureView.js +253 -0
- package/dist/bindings/useDocumentCapture.d.ts +3 -0
- package/dist/bindings/useDocumentCapture.d.ts.map +1 -0
- package/dist/bindings/useDocumentCapture.js +6 -0
- package/dist/bindings/useIdCapture.d.ts +5 -0
- package/dist/bindings/useIdCapture.d.ts.map +1 -0
- package/dist/bindings/useIdCapture.js +53 -0
- package/dist/bindings/useSelfieCapture.d.ts +5 -0
- package/dist/bindings/useSelfieCapture.d.ts.map +1 -0
- package/dist/bindings/useSelfieCapture.js +53 -0
- package/dist/bindings/useSignatureCapture.d.ts +3 -0
- package/dist/bindings/useSignatureCapture.d.ts.map +1 -0
- package/dist/bindings/useSignatureCapture.js +6 -0
- package/dist/bindings/useVideoIdCapture.d.ts +3 -0
- package/dist/bindings/useVideoIdCapture.d.ts.map +1 -0
- package/dist/bindings/useVideoIdCapture.js +6 -0
- package/dist/components/CameraFeed.d.ts +36 -0
- package/dist/components/CameraFeed.d.ts.map +1 -0
- package/dist/components/CameraFeed.js +74 -0
- package/dist/components/ExitCaptureButton.d.ts +6 -0
- package/dist/components/ExitCaptureButton.d.ts.map +1 -0
- package/dist/components/ExitCaptureButton.js +32 -0
- package/dist/components/GuidanceMessage.d.ts +25 -0
- package/dist/components/GuidanceMessage.d.ts.map +1 -0
- package/dist/components/GuidanceMessage.js +39 -0
- package/dist/components/OverrideWrongDocumentTypeDialog.d.ts +20 -0
- package/dist/components/OverrideWrongDocumentTypeDialog.d.ts.map +1 -0
- package/dist/components/OverrideWrongDocumentTypeDialog.js +55 -0
- package/dist/components/additional_documents/AdditionalDocumentCapture.d.ts +41 -0
- package/dist/components/additional_documents/AdditionalDocumentCapture.d.ts.map +1 -0
- package/dist/components/additional_documents/AdditionalDocumentCapture.js +118 -0
- package/dist/components/additional_documents/AdditionalDocumentCaptureWizard.d.ts +18 -0
- package/dist/components/additional_documents/AdditionalDocumentCaptureWizard.d.ts.map +1 -0
- package/dist/components/additional_documents/AdditionalDocumentCaptureWizard.js +93 -0
- package/dist/components/additional_documents/sequence.d.ts +10 -0
- package/dist/components/additional_documents/sequence.d.ts.map +1 -0
- package/dist/components/additional_documents/sequence.js +11 -0
- package/dist/components/additional_documents/types.d.ts +15 -0
- package/dist/components/additional_documents/types.d.ts.map +1 -0
- package/dist/components/additional_documents/types.js +1 -0
- package/dist/components/barcode/BarcodeGuideOverlay.d.ts +23 -0
- package/dist/components/barcode/BarcodeGuideOverlay.d.ts.map +1 -0
- package/dist/components/barcode/BarcodeGuideOverlay.js +157 -0
- package/dist/components/barcode/BarcodeSuccessOverlay.d.ts +7 -0
- package/dist/components/barcode/BarcodeSuccessOverlay.d.ts.map +1 -0
- package/dist/components/barcode/BarcodeSuccessOverlay.js +58 -0
- package/dist/components/common/ButtonsRow.d.ts +2 -0
- package/dist/components/common/ButtonsRow.d.ts.map +1 -0
- package/dist/components/common/ButtonsRow.js +7 -0
- package/dist/components/common/CapturedDocumentImg.d.ts +7 -0
- package/dist/components/common/CapturedDocumentImg.d.ts.map +1 -0
- package/dist/components/common/CapturedDocumentImg.js +31 -0
- package/dist/components/common/Card.d.ts +9 -0
- package/dist/components/common/Card.d.ts.map +1 -0
- package/dist/components/common/Card.js +16 -0
- package/dist/components/common/LoaderButton.d.ts +31 -0
- package/dist/components/common/LoaderButton.d.ts.map +1 -0
- package/dist/components/common/LoaderButton.js +444 -0
- package/dist/components/common/LoadingListItemIndicator.d.ts +5 -0
- package/dist/components/common/LoadingListItemIndicator.d.ts.map +1 -0
- package/dist/components/common/LoadingListItemIndicator.js +8 -0
- package/dist/components/common/animation.d.ts +5 -0
- package/dist/components/common/animation.d.ts.map +1 -0
- package/dist/components/common/animation.js +35 -0
- package/dist/components/common/downloadingLabel.d.ts +10 -0
- package/dist/components/common/downloadingLabel.d.ts.map +1 -0
- package/dist/components/common/downloadingLabel.js +15 -0
- package/dist/components/common/overlay.d.ts +142 -0
- package/dist/components/common/overlay.d.ts.map +1 -0
- package/dist/components/common/overlay.js +183 -0
- package/dist/components/customer_match/CustomerMatchFailure.d.ts +37 -0
- package/dist/components/customer_match/CustomerMatchFailure.d.ts.map +1 -0
- package/dist/components/customer_match/CustomerMatchFailure.js +38 -0
- package/dist/components/customer_match/CustomerMatchSuccess.d.ts +35 -0
- package/dist/components/customer_match/CustomerMatchSuccess.d.ts.map +1 -0
- package/dist/components/customer_match/CustomerMatchSuccess.js +44 -0
- package/dist/components/debug/debug.d.ts +91 -0
- package/dist/components/debug/debug.d.ts.map +1 -0
- package/dist/components/debug/debug.js +270 -0
- package/dist/components/document/DocumentCaptureGuideOverlay.d.ts +15 -0
- package/dist/components/document/DocumentCaptureGuideOverlay.d.ts.map +1 -0
- package/dist/components/document/DocumentCaptureGuideOverlay.js +148 -0
- package/dist/components/document/guideRect.d.ts +11 -0
- package/dist/components/document/guideRect.d.ts.map +1 -0
- package/dist/components/document/guideRect.js +25 -0
- package/dist/components/document/types.d.ts +25 -0
- package/dist/components/document/types.d.ts.map +1 -0
- package/dist/components/document/types.js +1 -0
- package/dist/components/error/CameraAccessDeniedOverlay.d.ts +31 -0
- package/dist/components/error/CameraAccessDeniedOverlay.d.ts.map +1 -0
- package/dist/components/error/CameraAccessDeniedOverlay.js +45 -0
- package/dist/components/error/ErrorScreen.d.ts +60 -0
- package/dist/components/error/ErrorScreen.d.ts.map +1 -0
- package/dist/components/error/ErrorScreen.js +150 -0
- package/dist/components/face_liveness/FaceLivenessFailure.d.ts +35 -0
- package/dist/components/face_liveness/FaceLivenessFailure.d.ts.map +1 -0
- package/dist/components/face_liveness/FaceLivenessFailure.js +30 -0
- package/dist/components/face_liveness/FaceLivenessSuccess.d.ts +31 -0
- package/dist/components/face_liveness/FaceLivenessSuccess.d.ts.map +1 -0
- package/dist/components/face_liveness/FaceLivenessSuccess.js +56 -0
- package/dist/components/fallback/IdCaptureFallback.d.ts +58 -0
- package/dist/components/fallback/IdCaptureFallback.d.ts.map +1 -0
- package/dist/components/fallback/IdCaptureFallback.js +128 -0
- package/dist/components/fallback/IdCaptureOrUploadScreen.d.ts +75 -0
- package/dist/components/fallback/IdCaptureOrUploadScreen.d.ts.map +1 -0
- package/dist/components/fallback/IdCaptureOrUploadScreen.js +205 -0
- package/dist/components/fallback/SelfieCaptureFallback.d.ts +54 -0
- package/dist/components/fallback/SelfieCaptureFallback.d.ts.map +1 -0
- package/dist/components/fallback/SelfieCaptureFallback.js +106 -0
- package/dist/components/fallback/fallbackInstructionStep.d.ts +5 -0
- package/dist/components/fallback/fallbackInstructionStep.d.ts.map +1 -0
- package/dist/components/fallback/fallbackInstructionStep.js +18 -0
- package/dist/components/fallback/readFile.d.ts +2 -0
- package/dist/components/fallback/readFile.d.ts.map +1 -0
- package/dist/components/fallback/readFile.js +14 -0
- package/dist/components/guide_images/backToFront.d.ts +3 -0
- package/dist/components/guide_images/backToFront.d.ts.map +1 -0
- package/dist/components/guide_images/backToFront.js +17 -0
- package/dist/components/guide_images/byUrl.d.ts +3 -0
- package/dist/components/guide_images/byUrl.d.ts.map +1 -0
- package/dist/components/guide_images/byUrl.js +6 -0
- package/dist/components/guide_images/defaults.d.ts +37 -0
- package/dist/components/guide_images/defaults.d.ts.map +1 -0
- package/dist/components/guide_images/defaults.js +37 -0
- package/dist/components/guide_images/index.d.ts +7 -0
- package/dist/components/guide_images/index.d.ts.map +1 -0
- package/dist/components/guide_images/index.js +5 -0
- package/dist/components/guide_images/orientation.d.ts +2 -0
- package/dist/components/guide_images/orientation.d.ts.map +1 -0
- package/dist/components/guide_images/orientation.js +5 -0
- package/dist/components/guide_images/types.d.ts +15 -0
- package/dist/components/guide_images/types.d.ts.map +1 -0
- package/dist/components/guide_images/types.js +1 -0
- package/dist/components/guide_images/useGuideImages.d.ts +3 -0
- package/dist/components/guide_images/useGuideImages.d.ts.map +1 -0
- package/dist/components/guide_images/useGuideImages.js +19 -0
- package/dist/components/guides/FlipIdPrompt.d.ts +28 -0
- package/dist/components/guides/FlipIdPrompt.d.ts.map +1 -0
- package/dist/components/guides/FlipIdPrompt.js +54 -0
- package/dist/components/guides/IdCaptureFitGuide.d.ts +51 -0
- package/dist/components/guides/IdCaptureFitGuide.d.ts.map +1 -0
- package/dist/components/guides/IdCaptureFitGuide.js +199 -0
- package/dist/components/guides/IdCaptureGuideOverlay.d.ts +100 -0
- package/dist/components/guides/IdCaptureGuideOverlay.d.ts.map +1 -0
- package/dist/components/guides/IdCaptureGuideOverlay.js +137 -0
- package/dist/components/guides/IdCaptureGuides.d.ts +47 -0
- package/dist/components/guides/IdCaptureGuides.d.ts.map +1 -0
- package/dist/components/guides/IdCaptureGuides.js +136 -0
- package/dist/components/guides/IdCaptureGuidesCommon.d.ts +136 -0
- package/dist/components/guides/IdCaptureGuidesCommon.d.ts.map +1 -0
- package/dist/components/guides/IdCaptureGuidesCommon.js +123 -0
- package/dist/components/loading/IdCaptureLoadingGraphic.d.ts +9 -0
- package/dist/components/loading/IdCaptureLoadingGraphic.d.ts.map +1 -0
- package/dist/components/loading/IdCaptureLoadingGraphic.js +76 -0
- package/dist/components/loading/IdCaptureLoadingOverlay.d.ts +134 -0
- package/dist/components/loading/IdCaptureLoadingOverlay.d.ts.map +1 -0
- package/dist/components/loading/IdCaptureLoadingOverlay.js +13 -0
- package/dist/components/loading/IdCaptureLoadingOverlayDefault.d.ts +3 -0
- package/dist/components/loading/IdCaptureLoadingOverlayDefault.d.ts.map +1 -0
- package/dist/components/loading/IdCaptureLoadingOverlayDefault.js +196 -0
- package/dist/components/loading/IdCaptureLoadingOverlayLegacy.d.ts +4 -0
- package/dist/components/loading/IdCaptureLoadingOverlayLegacy.d.ts.map +1 -0
- package/dist/components/loading/IdCaptureLoadingOverlayLegacy.js +69 -0
- package/dist/components/loading/IdCaptureLoadingOverlayRing.d.ts +3 -0
- package/dist/components/loading/IdCaptureLoadingOverlayRing.d.ts.map +1 -0
- package/dist/components/loading/IdCaptureLoadingOverlayRing.js +260 -0
- package/dist/components/loading/RingIntroScreen.d.ts +39 -0
- package/dist/components/loading/RingIntroScreen.d.ts.map +1 -0
- package/dist/components/loading/RingIntroScreen.js +216 -0
- package/dist/components/loading/RingProgress.d.ts +9 -0
- package/dist/components/loading/RingProgress.d.ts.map +1 -0
- package/dist/components/loading/RingProgress.js +24 -0
- package/dist/components/loading/RingStageTransition.d.ts +27 -0
- package/dist/components/loading/RingStageTransition.d.ts.map +1 -0
- package/dist/components/loading/RingStageTransition.js +145 -0
- package/dist/components/loading/customerSpinner.d.ts +58 -0
- package/dist/components/loading/customerSpinner.d.ts.map +1 -0
- package/dist/components/loading/customerSpinner.js +69 -0
- package/dist/components/loading/ringIntro.d.ts +15 -0
- package/dist/components/loading/ringIntro.d.ts.map +1 -0
- package/dist/components/loading/ringIntro.js +5 -0
- package/dist/components/loading/ringStatus.d.ts +8 -0
- package/dist/components/loading/ringStatus.d.ts.map +1 -0
- package/dist/components/loading/ringStatus.js +13 -0
- package/dist/components/loading/useAutoContinueWhenReady.d.ts +8 -0
- package/dist/components/loading/useAutoContinueWhenReady.d.ts.map +1 -0
- package/dist/components/loading/useAutoContinueWhenReady.js +25 -0
- package/dist/components/review/ReviewDiagnosticsPanel.d.ts +27 -0
- package/dist/components/review/ReviewDiagnosticsPanel.d.ts.map +1 -0
- package/dist/components/review/ReviewDiagnosticsPanel.js +475 -0
- package/dist/components/review/ReviewScreen.d.ts +34 -0
- package/dist/components/review/ReviewScreen.d.ts.map +1 -0
- package/dist/components/review/ReviewScreen.js +91 -0
- package/dist/components/ring/RingFailureScreen.d.ts +41 -0
- package/dist/components/ring/RingFailureScreen.d.ts.map +1 -0
- package/dist/components/ring/RingFailureScreen.js +384 -0
- package/dist/components/ring/RingFinishingScreen.d.ts +27 -0
- package/dist/components/ring/RingFinishingScreen.d.ts.map +1 -0
- package/dist/components/ring/RingFinishingScreen.js +184 -0
- package/dist/components/ring/RingSuccessScreen.d.ts +33 -0
- package/dist/components/ring/RingSuccessScreen.d.ts.map +1 -0
- package/dist/components/ring/RingSuccessScreen.js +185 -0
- package/dist/components/selfie/FaceCaptureGuideOverlay.d.ts +17 -0
- package/dist/components/selfie/FaceCaptureGuideOverlay.d.ts.map +1 -0
- package/dist/components/selfie/FaceCaptureGuideOverlay.js +39 -0
- package/dist/components/selfie/SelfieCameraFeed.d.ts +8 -0
- package/dist/components/selfie/SelfieCameraFeed.d.ts.map +1 -0
- package/dist/components/selfie/SelfieCameraFeed.js +16 -0
- package/dist/components/selfie/SelfieCaptureAnimatedMask.d.ts +15 -0
- package/dist/components/selfie/SelfieCaptureAnimatedMask.d.ts.map +1 -0
- package/dist/components/selfie/SelfieCaptureAnimatedMask.js +111 -0
- package/dist/components/selfie/SelfieCaptureLoadingGraphic.d.ts +4 -0
- package/dist/components/selfie/SelfieCaptureLoadingGraphic.d.ts.map +1 -0
- package/dist/components/selfie/SelfieCaptureLoadingGraphic.js +28 -0
- package/dist/components/selfie/SelfieCaptureSurface.d.ts +126 -0
- package/dist/components/selfie/SelfieCaptureSurface.d.ts.map +1 -0
- package/dist/components/selfie/SelfieCaptureSurface.js +248 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlay.d.ts +136 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlay.d.ts.map +1 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlay.js +13 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayDefault.d.ts +3 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayDefault.d.ts.map +1 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayDefault.js +181 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayLegacy.d.ts +3 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayLegacy.d.ts.map +1 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayLegacy.js +67 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayRing.d.ts +3 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayRing.d.ts.map +1 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayRing.js +265 -0
- package/dist/components/videoId/VideoIdCaptureGuides.d.ts +42 -0
- package/dist/components/videoId/VideoIdCaptureGuides.d.ts.map +1 -0
- package/dist/components/videoId/VideoIdCaptureGuides.js +173 -0
- package/dist/flows/AuthStateContext.d.ts +33 -0
- package/dist/flows/AuthStateContext.d.ts.map +1 -0
- package/dist/flows/AuthStateContext.js +47 -0
- package/dist/flows/CompositeWizard.d.ts +76 -0
- package/dist/flows/CompositeWizard.d.ts.map +1 -0
- package/dist/flows/CompositeWizard.js +200 -0
- package/dist/flows/CustomerBiometricsEnrollmentFlow.d.ts +28 -0
- package/dist/flows/CustomerBiometricsEnrollmentFlow.d.ts.map +1 -0
- package/dist/flows/CustomerBiometricsEnrollmentFlow.js +138 -0
- package/dist/flows/CustomerIdAndBiometricsEnrollmentFlow.d.ts +47 -0
- package/dist/flows/CustomerIdAndBiometricsEnrollmentFlow.d.ts.map +1 -0
- package/dist/flows/CustomerIdAndBiometricsEnrollmentFlow.js +231 -0
- package/dist/flows/CustomerIdentificationFlow.d.ts +4 -0
- package/dist/flows/CustomerIdentificationFlow.d.ts.map +1 -0
- package/dist/flows/CustomerIdentificationFlow.js +11 -0
- package/dist/flows/CustomerVerificationFlow.d.ts +9 -0
- package/dist/flows/CustomerVerificationFlow.d.ts.map +1 -0
- package/dist/flows/CustomerVerificationFlow.js +17 -0
- package/dist/flows/DocumentCaptureFlow.d.ts +23 -0
- package/dist/flows/DocumentCaptureFlow.d.ts.map +1 -0
- package/dist/flows/DocumentCaptureFlow.js +116 -0
- package/dist/flows/FaceValidationFlow.d.ts +12 -0
- package/dist/flows/FaceValidationFlow.d.ts.map +1 -0
- package/dist/flows/FaceValidationFlow.js +53 -0
- package/dist/flows/FlowChassis.d.ts +39 -0
- package/dist/flows/FlowChassis.d.ts.map +1 -0
- package/dist/flows/FlowChassis.js +69 -0
- package/dist/flows/IdAndFaceValidationFlow.d.ts +36 -0
- package/dist/flows/IdAndFaceValidationFlow.d.ts.map +1 -0
- package/dist/flows/IdAndFaceValidationFlow.js +168 -0
- package/dist/flows/IdValidationFlow.d.ts +29 -0
- package/dist/flows/IdValidationFlow.d.ts.map +1 -0
- package/dist/flows/IdValidationFlow.js +106 -0
- package/dist/flows/OrbStatusScreen.d.ts +14 -0
- package/dist/flows/OrbStatusScreen.d.ts.map +1 -0
- package/dist/flows/OrbStatusScreen.js +60 -0
- package/dist/flows/RemoteDiagnosticsMount.d.ts +6 -0
- package/dist/flows/RemoteDiagnosticsMount.d.ts.map +1 -0
- package/dist/flows/RemoteDiagnosticsMount.js +57 -0
- package/dist/flows/SignatureKYCFlow.d.ts +33 -0
- package/dist/flows/SignatureKYCFlow.d.ts.map +1 -0
- package/dist/flows/SignatureKYCFlow.js +228 -0
- package/dist/flows/SubmissionProvider.d.ts +40 -0
- package/dist/flows/SubmissionProvider.d.ts.map +1 -0
- package/dist/flows/SubmissionProvider.js +136 -0
- package/dist/flows/SubmissionSuccess.d.ts +48 -0
- package/dist/flows/SubmissionSuccess.d.ts.map +1 -0
- package/dist/flows/SubmissionSuccess.js +488 -0
- package/dist/flows/VideoIdValidationFlow.d.ts +61 -0
- package/dist/flows/VideoIdValidationFlow.d.ts.map +1 -0
- package/dist/flows/VideoIdValidationFlow.js +171 -0
- package/dist/flows/additionalDocuments.d.ts +5 -0
- package/dist/flows/additionalDocuments.d.ts.map +1 -0
- package/dist/flows/additionalDocuments.js +26 -0
- package/dist/flows/artifacts.d.ts +8 -0
- package/dist/flows/artifacts.d.ts.map +1 -0
- package/dist/flows/artifacts.js +80 -0
- package/dist/flows/customerMatch/CustomerMatchCapture.d.ts +53 -0
- package/dist/flows/customerMatch/CustomerMatchCapture.d.ts.map +1 -0
- package/dist/flows/customerMatch/CustomerMatchCapture.js +211 -0
- package/dist/flows/customerMatch/CustomerMatchFlow.d.ts +94 -0
- package/dist/flows/customerMatch/CustomerMatchFlow.d.ts.map +1 -0
- package/dist/flows/customerMatch/CustomerMatchFlow.js +209 -0
- package/dist/flows/customerMatch/adapters.d.ts +34 -0
- package/dist/flows/customerMatch/adapters.d.ts.map +1 -0
- package/dist/flows/customerMatch/adapters.js +63 -0
- package/dist/flows/customerMatch/identificationReducer.d.ts +34 -0
- package/dist/flows/customerMatch/identificationReducer.d.ts.map +1 -0
- package/dist/flows/customerMatch/identificationReducer.js +75 -0
- package/dist/flows/customerMatch/verificationReducer.d.ts +34 -0
- package/dist/flows/customerMatch/verificationReducer.d.ts.map +1 -0
- package/dist/flows/customerMatch/verificationReducer.js +77 -0
- package/dist/flows/documentCapture.d.ts +5 -0
- package/dist/flows/documentCapture.d.ts.map +1 -0
- package/dist/flows/documentCapture.js +8 -0
- package/dist/flows/jsonHighlight.d.ts +19 -0
- package/dist/flows/jsonHighlight.d.ts.map +1 -0
- package/dist/flows/jsonHighlight.js +90 -0
- package/dist/flows/overlays.d.ts +91 -0
- package/dist/flows/overlays.d.ts.map +1 -0
- package/dist/flows/overlays.js +150 -0
- package/dist/flows/ringIntroImplications.d.ts +30 -0
- package/dist/flows/ringIntroImplications.d.ts.map +1 -0
- package/dist/flows/ringIntroImplications.js +58 -0
- package/dist/flows/ringScreens.d.ts +27 -0
- package/dist/flows/ringScreens.d.ts.map +1 -0
- package/dist/flows/ringScreens.js +18 -0
- package/dist/flows/sequencer.d.ts +12 -0
- package/dist/flows/sequencer.d.ts.map +1 -0
- package/dist/flows/sequencer.js +18 -0
- package/dist/flows/sharedCamera.d.ts +23 -0
- package/dist/flows/sharedCamera.d.ts.map +1 -0
- package/dist/flows/sharedCamera.js +64 -0
- package/dist/flows/signatureStep.d.ts +25 -0
- package/dist/flows/signatureStep.d.ts.map +1 -0
- package/dist/flows/signatureStep.js +99 -0
- package/dist/flows/types.d.ts +106 -0
- package/dist/flows/types.d.ts.map +1 -0
- package/dist/flows/types.js +1 -0
- package/dist/flows/useGeolocation.d.ts +24 -0
- package/dist/flows/useGeolocation.d.ts.map +1 -0
- package/dist/flows/useGeolocation.js +82 -0
- package/dist/flows/useShowSuccessScreen.d.ts +3 -0
- package/dist/flows/useShowSuccessScreen.d.ts.map +1 -0
- package/dist/flows/useShowSuccessScreen.js +51 -0
- package/dist/flows/useTimeout.d.ts +7 -0
- package/dist/flows/useTimeout.d.ts.map +1 -0
- package/dist/flows/useTimeout.js +68 -0
- package/dist/flows/videoIdSteps.d.ts +33 -0
- package/dist/flows/videoIdSteps.d.ts.map +1 -0
- package/dist/flows/videoIdSteps.js +54 -0
- package/dist/guidance/selfieStrings.d.ts +18 -0
- package/dist/guidance/selfieStrings.d.ts.map +1 -0
- package/dist/guidance/selfieStrings.js +97 -0
- package/dist/guidance/strings.d.ts +4 -0
- package/dist/guidance/strings.d.ts.map +1 -0
- package/dist/guidance/strings.js +43 -0
- package/dist/guidance/videoIdStrings.d.ts +23 -0
- package/dist/guidance/videoIdStrings.d.ts.map +1 -0
- package/dist/guidance/videoIdStrings.js +23 -0
- package/dist/i18n/index.d.ts +1221 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +92 -0
- package/dist/i18n/locales/de.d.ts +149 -0
- package/dist/i18n/locales/de.d.ts.map +1 -0
- package/dist/i18n/locales/de.js +147 -0
- package/dist/i18n/locales/en.d.ts +3 -0
- package/dist/i18n/locales/en.d.ts.map +1 -0
- package/dist/i18n/locales/en.js +1 -0
- package/dist/i18n/locales/es.d.ts +149 -0
- package/dist/i18n/locales/es.d.ts.map +1 -0
- package/dist/i18n/locales/es.js +147 -0
- package/dist/i18n/locales/fr.d.ts +149 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -0
- package/dist/i18n/locales/fr.js +147 -0
- package/dist/i18n/locales/it.d.ts +149 -0
- package/dist/i18n/locales/it.d.ts.map +1 -0
- package/dist/i18n/locales/it.js +147 -0
- package/dist/i18n/locales/ja.d.ts +149 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -0
- package/dist/i18n/locales/ja.js +147 -0
- package/dist/i18n/locales/pt.d.ts +149 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -0
- package/dist/i18n/locales/pt.js +147 -0
- package/dist/i18n/locales/ru.d.ts +149 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -0
- package/dist/i18n/locales/ru.js +147 -0
- package/dist/i18n/locales/zh.d.ts +149 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -0
- package/dist/i18n/locales/zh.js +147 -0
- package/dist/i18n/render.d.ts +3 -0
- package/dist/i18n/render.d.ts.map +1 -0
- package/dist/i18n/render.js +7 -0
- package/dist/index.d.ts +157 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +191 -0
- package/dist/layout/GuideLayoutContext.d.ts +24 -0
- package/dist/layout/GuideLayoutContext.d.ts.map +1 -0
- package/dist/layout/GuideLayoutContext.js +19 -0
- package/dist/layout/GuideOrientationContext.d.ts +16 -0
- package/dist/layout/GuideOrientationContext.d.ts.map +1 -0
- package/dist/layout/GuideOrientationContext.js +40 -0
- package/dist/layout/useResizeObserver.d.ts +11 -0
- package/dist/layout/useResizeObserver.d.ts.map +1 -0
- package/dist/layout/useResizeObserver.js +114 -0
- package/dist/testing/alignGlobals.d.ts +2 -0
- package/dist/testing/alignGlobals.d.ts.map +1 -0
- package/dist/testing/alignGlobals.js +25 -0
- package/dist/testing/buildDocumentState.d.ts +4 -0
- package/dist/testing/buildDocumentState.d.ts.map +1 -0
- package/dist/testing/buildDocumentState.js +19 -0
- package/dist/testing/buildSelfieState.d.ts +8 -0
- package/dist/testing/buildSelfieState.d.ts.map +1 -0
- package/dist/testing/buildSelfieState.js +84 -0
- package/dist/testing/buildSignatureState.d.ts +3 -0
- package/dist/testing/buildSignatureState.d.ts.map +1 -0
- package/dist/testing/buildSignatureState.js +12 -0
- package/dist/testing/buildState.d.ts +3 -0
- package/dist/testing/buildState.d.ts.map +1 -0
- package/dist/testing/buildState.js +34 -0
- package/dist/testing/buildVideoIdState.d.ts +3 -0
- package/dist/testing/buildVideoIdState.d.ts.map +1 -0
- package/dist/testing/buildVideoIdState.js +11 -0
- package/dist/testing/classNamesLeaves.d.ts +14 -0
- package/dist/testing/classNamesLeaves.d.ts.map +1 -0
- package/dist/testing/classNamesLeaves.js +144 -0
- package/dist/testing/fakeClient.d.ts +61 -0
- package/dist/testing/fakeClient.d.ts.map +1 -0
- package/dist/testing/fakeClient.js +142 -0
- package/dist/testing/fakeController.d.ts +18 -0
- package/dist/testing/fakeController.d.ts.map +1 -0
- package/dist/testing/fakeController.js +165 -0
- package/dist/testing/fakeDocumentController.d.ts +37 -0
- package/dist/testing/fakeDocumentController.d.ts.map +1 -0
- package/dist/testing/fakeDocumentController.js +104 -0
- package/dist/testing/fakeSelfieController.d.ts +15 -0
- package/dist/testing/fakeSelfieController.d.ts.map +1 -0
- package/dist/testing/fakeSelfieController.js +154 -0
- package/dist/testing/fakeSignatureController.d.ts +12 -0
- package/dist/testing/fakeSignatureController.d.ts.map +1 -0
- package/dist/testing/fakeSignatureController.js +58 -0
- package/dist/testing/fakeVideoIdController.d.ts +12 -0
- package/dist/testing/fakeVideoIdController.d.ts.map +1 -0
- package/dist/testing/fakeVideoIdController.js +50 -0
- package/dist/testing/index.d.ts +15 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +18 -0
- package/dist/testing/stubSignatureCanvas.d.ts +2 -0
- package/dist/testing/stubSignatureCanvas.d.ts.map +1 -0
- package/dist/testing/stubSignatureCanvas.js +26 -0
- package/dist/testing/stubVideoCaptureDom.d.ts +2 -0
- package/dist/testing/stubVideoCaptureDom.d.ts.map +1 -0
- package/dist/testing/stubVideoCaptureDom.js +36 -0
- package/dist/theme/color.d.ts +14 -0
- package/dist/theme/color.d.ts.map +1 -0
- package/dist/theme/color.js +1 -0
- package/dist/theme/index.d.ts +405 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +230 -0
- package/dist/utils/canvas.d.ts +3 -0
- package/dist/utils/canvas.d.ts.map +1 -0
- package/dist/utils/canvas.js +16 -0
- package/dist/utils/cdn.d.ts +2 -0
- package/dist/utils/cdn.d.ts.map +1 -0
- package/dist/utils/cdn.js +3 -0
- package/dist/utils/cropping.d.ts +4 -0
- package/dist/utils/cropping.d.ts.map +1 -0
- package/dist/utils/cropping.js +11 -0
- package/dist/utils/flowClock.d.ts +6 -0
- package/dist/utils/flowClock.d.ts.map +1 -0
- package/dist/utils/flowClock.js +22 -0
- package/dist/utils/isMobile.d.ts +3 -0
- package/dist/utils/isMobile.d.ts.map +1 -0
- package/dist/utils/isMobile.js +35 -0
- package/dist/utils/loadProgressHooks.d.ts +25 -0
- package/dist/utils/loadProgressHooks.d.ts.map +1 -0
- package/dist/utils/loadProgressHooks.js +79 -0
- package/dist/utils/logger.d.ts +18 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +38 -0
- package/dist/utils/merge.d.ts +3 -0
- package/dist/utils/merge.d.ts.map +1 -0
- package/dist/utils/merge.js +23 -0
- package/dist/utils/signaturePadStrokeGuard.d.ts +16 -0
- package/dist/utils/signaturePadStrokeGuard.d.ts.map +1 -0
- package/dist/utils/signaturePadStrokeGuard.js +70 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +3 -0
- package/package.json +71 -0
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Task 8 (iteration-4 selfie/liveness engine plan-4): the phase-switched
|
|
3
|
+
// assembly for the liveness-checked selfie flow — composes the same
|
|
4
|
+
// feed/mask/pill/loading-overlay/error plumbing SelfieCaptureView (task-7)
|
|
5
|
+
// uses (both now share `SelfieCaptureSurface`, extracted here) plus the
|
|
6
|
+
// liveness-specific message ladder and the two full-screen terminal
|
|
7
|
+
// screens, FaceLivenessSuccess/FaceLivenessFailure.
|
|
8
|
+
//
|
|
9
|
+
// Deltas from SelfieCaptureView, all sourced from sdk2's
|
|
10
|
+
// FaceLivenessCapture.tsx:864-935 (see this file's imports from
|
|
11
|
+
// guidance/selfieStrings.ts for the ported ladder helpers):
|
|
12
|
+
// - Message ladder: challenge prompt (with its "(N of M)" step suffix and
|
|
13
|
+
// untranslated blink-count suffix, sdk2 parity) beats
|
|
14
|
+
// `livenessStatusKey` (covering flags > FAILED/ERROR > validating) beats
|
|
15
|
+
// the plain held-guidance-code pill SelfieCaptureView uses on its own.
|
|
16
|
+
// Only ONE of the three ever supplies the pill's text per render --
|
|
17
|
+
// `entry` below tags which branch won, both for override-verbiage
|
|
18
|
+
// lookup and for knowing whether the count/step suffixes apply (they
|
|
19
|
+
// only ever apply to the challenge branch).
|
|
20
|
+
// - `maskStatus`: liveness `requestState` drives 'processing'/'failure'
|
|
21
|
+
// directly (sdk2's `guidesByRequestState`); only outside those states
|
|
22
|
+
// does it fall back to SelfieCaptureView's live-`faceReady` derivation
|
|
23
|
+
// (task-7 binding ruling) rather than sdk2's own 'ready' literal --
|
|
24
|
+
// an explicit task-8 deviation, not an oversight (see task-8 brief).
|
|
25
|
+
// - Terminal phases: 'completed' swaps the whole surface for
|
|
26
|
+
// FaceLivenessSuccess (or, with `skipSuccessScreen`, never renders it at
|
|
27
|
+
// all -- fires `onDone` once instead, same one-shot ref-guard shape as
|
|
28
|
+
// SelfieCaptureView's `onCaptured` effect).
|
|
29
|
+
// - A liveness FAILURE is NOT automatically terminal. sdk2's
|
|
30
|
+
// onFailureCallback never touches the wizard's captureState
|
|
31
|
+
// (FaceLivenessWizard.tsx:324-345): failures 1 and 2 are absorbed in
|
|
32
|
+
// place -- the capture component stays mounted and core's 1000ms
|
|
33
|
+
// reset-after-verdict re-arms it -- so the user simply keeps going. Only
|
|
34
|
+
// the failure-LIMIT denial (onDenied, :380-390) or the kick-out
|
|
35
|
+
// (onTimeoutCallback, :346-378) sets captureState 'FAILED' and renders
|
|
36
|
+
// the lockout screen. This view mirrors that: `showLockout` gates
|
|
37
|
+
// FaceLivenessFailure, and the capture surface stays up through the
|
|
38
|
+
// transient FAILED phase. Rendering the lockout screen on every FAILED
|
|
39
|
+
// (as this file first did) flashed a modal with an inert Retry button
|
|
40
|
+
// for one second on each miss.
|
|
41
|
+
// - The lockout screen's own retry budget is sdk2's WIZARD-level
|
|
42
|
+
// maxRetries/retryCount pair (:209,246,527), distinct from the liveness
|
|
43
|
+
// machine's ALLOWED_LIVENESS_FAILURES: each retry remounts the capture
|
|
44
|
+
// component for a whole fresh set of liveness attempts. Core's
|
|
45
|
+
// `actions.retry()` now performs that reset, so `maxRetries` here is the
|
|
46
|
+
// outer budget.
|
|
47
|
+
// - No `onCaptured` prop (SelfieCaptureViewProps's is `Omit`-ed out): the
|
|
48
|
+
// liveness flow's terminal signal is `onDone`, fired from the success
|
|
49
|
+
// screen (or immediately, if skipped) with the FINAL liveness-checked
|
|
50
|
+
// image, not the raw first capture.
|
|
51
|
+
// - Kickout (`onTimeout`) and denial (`onDenied`) hooks are controller
|
|
52
|
+
// config (`SelfieLivenessConfig`, passed to
|
|
53
|
+
// `createSelfieCaptureController`) -- this view does not re-expose or
|
|
54
|
+
// rewire them, per the ledger.
|
|
55
|
+
import { useEffect, useRef, useState, } from 'react';
|
|
56
|
+
import { styled } from 'styled-components';
|
|
57
|
+
import { ALLOWED_LIVENESS_FAILURES, SelfieGuidanceCode, } from '@idmission/websdk-core/selfieCapture';
|
|
58
|
+
import { useSelfieCapture } from './bindings/useSelfieCapture';
|
|
59
|
+
import { useLanguage, useVerbiage } from './i18n';
|
|
60
|
+
import { SelfieCaptureSurface } from './components/selfie/SelfieCaptureSurface';
|
|
61
|
+
import { challengePromptKey, livenessStatusKey, selfieGuidanceMessageKey, selfieGuidanceVariant, } from './guidance/selfieStrings';
|
|
62
|
+
import { GUIDANCE_VERBIAGE_FIELD, } from './SelfieCaptureView';
|
|
63
|
+
import { FaceLivenessSuccess, } from './components/face_liveness/FaceLivenessSuccess';
|
|
64
|
+
import { FaceLivenessFailure, } from './components/face_liveness/FaceLivenessFailure';
|
|
65
|
+
import { useSessionReady } from './flows/AuthStateContext';
|
|
66
|
+
// `challengePromptKey`/`livenessStatusKey`'s returned English key strings ->
|
|
67
|
+
// the FaceLivenessGuidanceVerbiage field that overrides them. Both helpers'
|
|
68
|
+
// keys ARE their English fallback text (guidance/selfieStrings.ts's own
|
|
69
|
+
// convention), so this is a plain string lookup, mirroring
|
|
70
|
+
// SelfieCaptureView's GUIDANCE_VERBIAGE_FIELD for the plain pill.
|
|
71
|
+
const LADDER_VERBIAGE_FIELD = {
|
|
72
|
+
'Turn your head left': 'challengeTurnLeftText',
|
|
73
|
+
'Turn your head right': 'challengeTurnRightText',
|
|
74
|
+
'Return to center': 'challengeReturnToCenterText',
|
|
75
|
+
'Blink twice': 'challengeBlinkTwiceText',
|
|
76
|
+
Blink: 'challengeBlinkText',
|
|
77
|
+
'Please remove your eye coverings (sunglasses, eye patch, etc.)...': 'guidanceRemoveEyeCoveringsText',
|
|
78
|
+
'Please remove your head coverings (hat, scarf, etc.)...': 'guidanceRemoveHeadCoveringsText',
|
|
79
|
+
'Please remove your mask...': 'guidanceRemoveMaskText',
|
|
80
|
+
"Let's try that again — please follow the prompts.": 'challengeTimeoutText',
|
|
81
|
+
'Could not verify your face.': 'guidanceLivenessCheckFailedText',
|
|
82
|
+
'An error occurred while verifying your face.': 'guidanceLivenessCheckErrorText',
|
|
83
|
+
'Photo captured, verifying...': 'guidanceValidatingText',
|
|
84
|
+
};
|
|
85
|
+
// requestStates sdk2's guidesByRequestState (FaceLivenessCapture.tsx:917-935)
|
|
86
|
+
// maps onto the mask's 'processing'/'failure' visuals, verbatim.
|
|
87
|
+
const LIVENESS_MASK_PROCESSING_STATES = new Set([
|
|
88
|
+
'IN_PROGRESS',
|
|
89
|
+
'CAPTURE_STARTED',
|
|
90
|
+
'GUIDANCE_SATISFIED',
|
|
91
|
+
'CAPTURED',
|
|
92
|
+
]);
|
|
93
|
+
const LIVENESS_MASK_FAILURE_STATES = new Set(['FAILED', 'ERROR']);
|
|
94
|
+
// The machine states where the capture path still owns the frame, and the
|
|
95
|
+
// live prediction is therefore what the mask and pill should follow. Outside
|
|
96
|
+
// them the face is either expected to move (the challenge prompts literally
|
|
97
|
+
// ask for it) or already committed (validating), so following `faceReady`
|
|
98
|
+
// there would strobe the oval and the pill from frame to frame -- core now
|
|
99
|
+
// keeps the prediction advancing through all of those states so the landmark
|
|
100
|
+
// mesh can track the face, and these two surfaces must not inherit that.
|
|
101
|
+
const LIVENESS_CAPTURE_PATH_STATES = new Set([
|
|
102
|
+
'CAPTURING',
|
|
103
|
+
'GUIDANCE_SATISFIED',
|
|
104
|
+
'CAPTURE_STARTED',
|
|
105
|
+
]);
|
|
106
|
+
// Phases where the mask/guidance-pill layer renders. Unlike
|
|
107
|
+
// SelfieCaptureView's own CAPTURE_SURFACE_PHASES, 'completed' is deliberately
|
|
108
|
+
// EXCLUDED here: this view swaps the whole surface for FaceLivenessSuccess
|
|
109
|
+
// once it lands, so the mask/pill underneath would be visual noise (the same
|
|
110
|
+
// "full-bleed screen owns the phase" rationale SelfieCaptureView applies to
|
|
111
|
+
// 'error').
|
|
112
|
+
//
|
|
113
|
+
// 'failed' IS included: a non-terminal liveness failure keeps the user on the
|
|
114
|
+
// camera (see the header note), where the mask's 'failure' status and the
|
|
115
|
+
// pill's "could not verify your face" message carry the feedback -- exactly
|
|
116
|
+
// what sdk2 shows while its own 1000ms reset re-arms capture. Membership here
|
|
117
|
+
// is therefore NOT sufficient on its own: `showCaptureSurface` ANDs this set
|
|
118
|
+
// with `!showLockout`, so the terminal screen still owns the phase.
|
|
119
|
+
const CAPTURE_SURFACE_PHASES = new Set([
|
|
120
|
+
'capturing',
|
|
121
|
+
'challenge',
|
|
122
|
+
'processing',
|
|
123
|
+
'checking',
|
|
124
|
+
'failed',
|
|
125
|
+
]);
|
|
126
|
+
const Container = styled.div `
|
|
127
|
+
position: relative;
|
|
128
|
+
width: 100%;
|
|
129
|
+
height: 100%;
|
|
130
|
+
/* sdk2 applied theme.fontFamily at the flow-level SdkPage wrapper
|
|
131
|
+
(SdkPage.tsx:59: a font-family declaration reading props.theme.fontFamily,
|
|
132
|
+
conditional on it being set) -- SdkPage itself is flow-level and was
|
|
133
|
+
never ported to this package, so this view's own root carries it
|
|
134
|
+
instead. */
|
|
135
|
+
${(props) => props.theme?.fontFamily ? `font-family: ${props.theme.fontFamily};` : ''}
|
|
136
|
+
`;
|
|
137
|
+
export function FaceLivenessView({ controller, loadingOverlayMode = 'default', sessionReady: sessionReadyProp, lang = 'auto', autoContinueAfterLoading = false, showIntroScreen = false, transitionFromIdCapture = false, debugMode = false, showFaceLandmarks = false, debugShowSamplePoints, onLoadingStarted, onLoadingProgress, onLoadingCompleted, onLoadingFailed, onLoadingOverlayDismissed, onCameraAccessDenied, onModelError, onCameraTamperingDetected, onExitAfterTamperSealPopped, onUserCancel, customOverlayContent, allowManualSelfieCaptureOnLoadingError = false, onExit, onExitAfterFailure, onRetry, onDone, skipSuccessScreen = false, maxRetries = 2, allowLivenessFailure = false, videoRef, renderCameraFeed = true, renderFaceGuide = true, verbiage = {}, classNames = {}, colors = {}, assets = {}, }) {
|
|
138
|
+
// Omitted means "follow the session": mounted inside a flow this view now
|
|
139
|
+
// renders during session validation, so its own loading overlay is the one
|
|
140
|
+
// loading surface (2.x behaviour — see useSessionReady). An explicit prop
|
|
141
|
+
// still wins, which is what Storybook and the headless demo pass.
|
|
142
|
+
const sessionFromContext = useSessionReady();
|
|
143
|
+
const sessionReady = sessionReadyProp ?? sessionFromContext;
|
|
144
|
+
useLanguage(lang);
|
|
145
|
+
const state = useSelfieCapture(controller);
|
|
146
|
+
// The lockout screen's outer retry budget (sdk2 FaceLivenessWizard's
|
|
147
|
+
// `retryCount`). Lives here rather than in the controller because it counts
|
|
148
|
+
// whole capture RUNS, and each retry resets the controller's own state.
|
|
149
|
+
const [retryCount, setRetryCount] = useState(0);
|
|
150
|
+
// sdk2's two terminal conditions, and ONLY those: the failure-limit denial
|
|
151
|
+
// and the kick-out. A plain FAILED is absorbed in place.
|
|
152
|
+
const livenessDenied = (state.liveness?.timesLivenessCheckFailed ?? 0) > ALLOWED_LIVENESS_FAILURES;
|
|
153
|
+
const showLockout = livenessDenied || state.livenessTimedOut;
|
|
154
|
+
// Derived ONCE, with the lockout folded in, because more than the surface
|
|
155
|
+
// reads it -- the guidance pill does too, and it renders through a portal,
|
|
156
|
+
// so a stale `true` here escapes the lockout screen's own subtree and floats
|
|
157
|
+
// the last capture message ("Could not verify your face") over it.
|
|
158
|
+
const showCaptureSurface = CAPTURE_SURFACE_PHASES.has(state.phase) && !showLockout;
|
|
159
|
+
// maskStatus (task-8 brief / sdk2 guidesByRequestState): liveness
|
|
160
|
+
// requestState wins when it says 'processing'/'failure' outright;
|
|
161
|
+
// otherwise fall back to task-7's live-faceReady derivation.
|
|
162
|
+
const requestState = state.liveness?.requestState;
|
|
163
|
+
// Only the capture-path states let the live prediction decide (see
|
|
164
|
+
// LIVENESS_CAPTURE_PATH_STATES); CHALLENGE pins to 'processing', which is
|
|
165
|
+
// what the oval showed there before the prediction started advancing
|
|
166
|
+
// through the challenge (it froze on the faceReady frame that opened it).
|
|
167
|
+
const predictionDrivesGuides = !requestState || LIVENESS_CAPTURE_PATH_STATES.has(requestState);
|
|
168
|
+
const maskStatus = requestState && LIVENESS_MASK_PROCESSING_STATES.has(requestState)
|
|
169
|
+
? 'processing'
|
|
170
|
+
: requestState && LIVENESS_MASK_FAILURE_STATES.has(requestState)
|
|
171
|
+
? 'failure'
|
|
172
|
+
: requestState === 'CHALLENGE'
|
|
173
|
+
? 'processing'
|
|
174
|
+
: state.prediction?.faceReady
|
|
175
|
+
? 'processing'
|
|
176
|
+
: 'ready';
|
|
177
|
+
// Message ladder (sdk2 FaceLivenessCapture.tsx:889-912): challenge prompt
|
|
178
|
+
// beats livenessStatusKey (covering/FAILED/ERROR/validating) beats the
|
|
179
|
+
// plain held-guidance-code pill. `challengeSnapshot` is only consulted
|
|
180
|
+
// while actually in the 'challenge' phase (selfieStrings.ts's own
|
|
181
|
+
// documented precondition).
|
|
182
|
+
const challengeSnapshot = state.phase === 'challenge' ? state.challenge : null;
|
|
183
|
+
const challengePrompt = challengeSnapshot
|
|
184
|
+
? challengePromptKey(challengeSnapshot)
|
|
185
|
+
: null;
|
|
186
|
+
let entry = null;
|
|
187
|
+
if (challengePrompt) {
|
|
188
|
+
entry = {
|
|
189
|
+
key: challengePrompt.key,
|
|
190
|
+
source: 'challenge',
|
|
191
|
+
blinkCount: challengePrompt.blinkCount,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
else if (state.liveness) {
|
|
195
|
+
const key = livenessStatusKey(state.liveness);
|
|
196
|
+
if (key)
|
|
197
|
+
entry = { key, source: 'liveness' };
|
|
198
|
+
}
|
|
199
|
+
if (!entry) {
|
|
200
|
+
const key = selfieGuidanceMessageKey(state.guidance.code);
|
|
201
|
+
if (key !== '')
|
|
202
|
+
entry = { key, source: 'guidance' };
|
|
203
|
+
}
|
|
204
|
+
const guidanceOverride = entry?.source === 'challenge' || entry?.source === 'liveness'
|
|
205
|
+
? verbiage.liveness?.[LADDER_VERBIAGE_FIELD[entry.key]]
|
|
206
|
+
: entry?.source === 'guidance' &&
|
|
207
|
+
state.guidance.code !== SelfieGuidanceCode.NONE
|
|
208
|
+
? verbiage.guidance?.[GUIDANCE_VERBIAGE_FIELD[state.guidance.code]]
|
|
209
|
+
: undefined;
|
|
210
|
+
// useVerbiage (not useTranslations): exactly one ladder entry drives the
|
|
211
|
+
// pill at a time, same "held event -> one resolved string" shape as
|
|
212
|
+
// SelfieCaptureView's own guidance pill.
|
|
213
|
+
const baseLadderText = useVerbiage(guidanceOverride, entry?.key ?? '');
|
|
214
|
+
const manualCaptureText = useVerbiage(verbiage.guidance?.guidanceManualCaptureText, 'Position your face in the circle and click to capture.');
|
|
215
|
+
const manualCaptureButtonText = useVerbiage(verbiage.guidance?.manualCaptureBtnText, 'Capture');
|
|
216
|
+
// Count/step suffixes are RAW, untranslated appends onto the already-
|
|
217
|
+
// translated base text -- sdk2 parity (guidance/selfieStrings.ts's own
|
|
218
|
+
// documented rationale), and only ever apply to the challenge branch.
|
|
219
|
+
let guidanceText = baseLadderText;
|
|
220
|
+
if (entry?.source === 'challenge' && typeof guidanceText === 'string') {
|
|
221
|
+
if (entry.blinkCount !== undefined) {
|
|
222
|
+
guidanceText = `${guidanceText} ${entry.blinkCount} times`;
|
|
223
|
+
}
|
|
224
|
+
if (challengeSnapshot && challengeSnapshot.stepCount > 1) {
|
|
225
|
+
guidanceText = `${guidanceText} (${challengeSnapshot.stepIndex + 1} of ${challengeSnapshot.stepCount})`;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
const showGuidancePill = showCaptureSurface && entry !== null;
|
|
229
|
+
const negative = Boolean(state.liveness?.eyeCoveringDetected ||
|
|
230
|
+
state.liveness?.headCoveringDetected ||
|
|
231
|
+
state.liveness?.maskDetected ||
|
|
232
|
+
state.liveness?.requestState === 'FAILED' ||
|
|
233
|
+
state.liveness?.requestState === 'ERROR');
|
|
234
|
+
const guidanceVariant = selfieGuidanceVariant({
|
|
235
|
+
// Same pin as the mask: off the capture path the pill holds the variant
|
|
236
|
+
// it had before core kept the prediction live -- positive through the
|
|
237
|
+
// challenge (which is entered on a satisfied face), neutral while the
|
|
238
|
+
// check is in flight. FAILED/ERROR go negative via `negative` regardless.
|
|
239
|
+
satisfied: predictionDrivesGuides
|
|
240
|
+
? Boolean(state.prediction?.faceReady)
|
|
241
|
+
: requestState === 'CHALLENGE',
|
|
242
|
+
negative,
|
|
243
|
+
});
|
|
244
|
+
const completedImageUrl = state.liveness?.imageUrl ??
|
|
245
|
+
state.capturedImageUrl ??
|
|
246
|
+
state.capturedSelfie?.dataUrl ??
|
|
247
|
+
'';
|
|
248
|
+
const allowedFailureDoneRef = useRef(false);
|
|
249
|
+
useEffect(() => {
|
|
250
|
+
if (!allowLivenessFailure || !showLockout || !completedImageUrl) {
|
|
251
|
+
allowedFailureDoneRef.current = false;
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
if (allowedFailureDoneRef.current)
|
|
255
|
+
return;
|
|
256
|
+
allowedFailureDoneRef.current = true;
|
|
257
|
+
onDone?.(completedImageUrl);
|
|
258
|
+
}, [allowLivenessFailure, completedImageUrl, onDone, showLockout]);
|
|
259
|
+
// `skipSuccessScreen`: fire onDone exactly once on entering 'completed',
|
|
260
|
+
// without the success screen ever rendering -- same one-shot ref-guard
|
|
261
|
+
// shape as SelfieCaptureView's onCaptured effect. Reset when the phase
|
|
262
|
+
// leaves 'completed' so a later retry -> re-pass fires again.
|
|
263
|
+
const skippedDoneRef = useRef(false);
|
|
264
|
+
useEffect(() => {
|
|
265
|
+
if (state.phase !== 'completed') {
|
|
266
|
+
skippedDoneRef.current = false;
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
if (!skipSuccessScreen || skippedDoneRef.current)
|
|
270
|
+
return;
|
|
271
|
+
skippedDoneRef.current = true;
|
|
272
|
+
onDone?.(completedImageUrl);
|
|
273
|
+
}, [state.phase, skipSuccessScreen, completedImageUrl, onDone]);
|
|
274
|
+
// sdk2 hands the SAME onRetryCallback to both terminal screens
|
|
275
|
+
// (FaceLivenessWizard.tsx:514 and :528), so a voluntary redo from the
|
|
276
|
+
// success screen spends an outer retry exactly as a lockout retry does.
|
|
277
|
+
// Only the failure screen consults the budget before offering the button.
|
|
278
|
+
const restartRun = () => {
|
|
279
|
+
// retryCount is the number of retries taken SO FAR, so the run about to
|
|
280
|
+
// start is retryCount + 2 (the initial run is 1). sdk2 computes the same
|
|
281
|
+
// number the same way (FaceLivenessWizard.tsx:403).
|
|
282
|
+
onRetry?.(retryCount + 2);
|
|
283
|
+
setRetryCount((n) => n + 1);
|
|
284
|
+
controller.actions.retry();
|
|
285
|
+
};
|
|
286
|
+
const canRetryFailure = maxRetries > -1 && retryCount < maxRetries;
|
|
287
|
+
return (_jsxs(Container, { className: classNames.container, children: [_jsx(SelfieCaptureSurface
|
|
288
|
+
// Never on the liveness stage: a supplied image cannot pass a liveness
|
|
289
|
+
// check, so offering it would complete the stage with a photo nothing
|
|
290
|
+
// verified. sdk2 scoped its fallback to the plain selfie component for
|
|
291
|
+
// the same reason. Core refuses the commit too (captureManually).
|
|
292
|
+
, {
|
|
293
|
+
// Never on the liveness stage: a supplied image cannot pass a liveness
|
|
294
|
+
// check, so offering it would complete the stage with a photo nothing
|
|
295
|
+
// verified. sdk2 scoped its fallback to the plain selfie component for
|
|
296
|
+
// the same reason. Core refuses the commit too (captureManually).
|
|
297
|
+
fallbackCapture: false, controller: controller, state: state, loadingOverlayMode: loadingOverlayMode, sessionReady: sessionReady, autoContinueAfterLoading: autoContinueAfterLoading, showIntroScreen: showIntroScreen, transitionFromIdCapture: transitionFromIdCapture, onExit: onExit, onLoadingStarted: onLoadingStarted, onLoadingProgress: onLoadingProgress, onLoadingCompleted: onLoadingCompleted, onLoadingFailed: onLoadingFailed, onLoadingOverlayDismissed: onLoadingOverlayDismissed, onCameraAccessDenied: onCameraAccessDenied, onModelError: onModelError, onCameraTamperingDetected: onCameraTamperingDetected, onExitAfterTamperSealPopped: onExitAfterTamperSealPopped, onUserCancel: onUserCancel, customOverlayContent: customOverlayContent, allowManualSelfieCaptureOnLoadingError: allowManualSelfieCaptureOnLoadingError, manualCaptureText: manualCaptureText, manualCaptureButtonText: manualCaptureButtonText, videoRef: videoRef, renderCameraFeed: renderCameraFeed, renderFaceGuide: renderFaceGuide, showCaptureSurface: showCaptureSurface, maskStatus: maskStatus, showGuidancePill: showGuidancePill, guidanceText: guidanceText, guidanceVariant: guidanceVariant, debugMode: debugMode, showFaceLandmarks: showFaceLandmarks, debugShowSamplePoints: debugShowSamplePoints, verbiage: verbiage, classNames: classNames, colors: colors, assets: assets }), state.phase === 'completed' && !skipSuccessScreen && (_jsx(FaceLivenessSuccess, { imageUrl: completedImageUrl, onDoneClick: () => onDone?.(completedImageUrl), onRetryClick: restartRun, verbiage: verbiage.success, classNames: classNames.success, colors: colors.success })), showLockout && !allowLivenessFailure && (_jsx(FaceLivenessFailure, { canRetry: canRetryFailure, onRetryClick: restartRun, onExitClick: onExitAfterFailure ?? onExit, assets: assets.failure, verbiage: verbiage.failure, classNames: classNames.failure, colors: colors.failure }))] }));
|
|
298
|
+
}
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { ReactElement, type ReactNode } from 'react';
|
|
2
|
+
import type { CapturedDocumentType, IdCaptureController } from '@idmission/websdk-core/idCapture';
|
|
3
|
+
import type { SubmissionArtifacts, SubmissionResponse } from '@idmission/websdk-core/client';
|
|
4
|
+
import { type LangOption } from './i18n';
|
|
5
|
+
import { type CameraFeedMode } from './components/CameraFeed';
|
|
6
|
+
import { type IdCaptureGuideType, type IdCaptureGuidesClassNames, type IdCaptureGuidesVerbiage } from './components/guides/IdCaptureGuides';
|
|
7
|
+
import { type OverrideWrongDocumentTypeDialogClassNames, type OverrideWrongDocumentTypeDialogVerbiage } from './components/OverrideWrongDocumentTypeDialog';
|
|
8
|
+
import { type IdCaptureLoadingOverlayAssets, type IdCaptureLoadingOverlayClassNames, type IdCaptureLoadingOverlayColors, type IdCaptureLoadingOverlayMode, type IdCaptureLoadingOverlayVerbiage } from './components/loading/IdCaptureLoadingOverlay';
|
|
9
|
+
import { type ReviewScreenClassNames, type ReviewScreenVerbiage } from './components/review/ReviewScreen';
|
|
10
|
+
import { type ErrorScreenClassNames, type ErrorScreenVerbiage } from './components/error/ErrorScreen';
|
|
11
|
+
import type { IdCaptureGuideImages } from './components/guide_images';
|
|
12
|
+
import { type IdCaptureFallbackClassNames, type IdCaptureFallbackColors, type IdCaptureFallbackVerbiage } from './components/fallback/IdCaptureFallback';
|
|
13
|
+
import { type IdCaptureOrUploadScreenClassNames, type IdCaptureOrUploadScreenColors, type IdCaptureOrUploadScreenVerbiage } from './components/fallback/IdCaptureOrUploadScreen';
|
|
14
|
+
import { type SkipSuccessScreen } from './flows/useShowSuccessScreen';
|
|
15
|
+
export type IdCaptureViewVerbiage = {
|
|
16
|
+
guides?: IdCaptureGuidesVerbiage;
|
|
17
|
+
loadingOverlay?: IdCaptureLoadingOverlayVerbiage;
|
|
18
|
+
review?: ReviewScreenVerbiage;
|
|
19
|
+
/** Verbiage for the flip interstitial's ReviewScreen (`flipReview: true`).
|
|
20
|
+
* `submitText` defaults to 'Continue' (not ReviewScreen's own 'Done'
|
|
21
|
+
* default) since that submit advances the flip step rather than finishing
|
|
22
|
+
* capture; merged on top of that default, so any field left unset here
|
|
23
|
+
* still falls through to ReviewScreen's own defaults. */
|
|
24
|
+
reviewFlip?: ReviewScreenVerbiage;
|
|
25
|
+
error?: ErrorScreenVerbiage;
|
|
26
|
+
overrideWrongDocumentType?: OverrideWrongDocumentTypeDialogVerbiage;
|
|
27
|
+
fallback?: IdCaptureFallbackVerbiage;
|
|
28
|
+
uploadOrCaptureScreen?: IdCaptureOrUploadScreenVerbiage;
|
|
29
|
+
};
|
|
30
|
+
export type IdCaptureViewClassNames = {
|
|
31
|
+
guides?: IdCaptureGuidesClassNames;
|
|
32
|
+
loadingOverlay?: IdCaptureLoadingOverlayClassNames;
|
|
33
|
+
review?: ReviewScreenClassNames;
|
|
34
|
+
error?: ErrorScreenClassNames;
|
|
35
|
+
overrideWrongDocumentType?: OverrideWrongDocumentTypeDialogClassNames;
|
|
36
|
+
exitBtn?: string;
|
|
37
|
+
fallback?: IdCaptureFallbackClassNames;
|
|
38
|
+
uploadOrCaptureScreen?: IdCaptureOrUploadScreenClassNames;
|
|
39
|
+
guidanceMessageContainer?: string;
|
|
40
|
+
guidanceMessage?: string;
|
|
41
|
+
cameraFeed?: string;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* The one screen in this view whose 2.x colors have a per-screen destination.
|
|
45
|
+
*
|
|
46
|
+
* sdk2's `IdCaptureWizardColors` also carried `guideBox*`/`guidanceMessages*`
|
|
47
|
+
* (now theme fields — `theme.idCapture.guideBox`, `theme.guidanceMessages`)
|
|
48
|
+
* and `success` button colors (now the ReviewScreen's `variant`-driven
|
|
49
|
+
* `theme.buttons`), so those reach this view through the theme instead. The
|
|
50
|
+
* loading overlay kept its own `colors` bag, so it is exposed here.
|
|
51
|
+
*/
|
|
52
|
+
export type IdCaptureViewColors = {
|
|
53
|
+
loadingOverlay?: IdCaptureLoadingOverlayColors;
|
|
54
|
+
fallback?: IdCaptureFallbackColors;
|
|
55
|
+
uploadOrCaptureScreen?: IdCaptureOrUploadScreenColors;
|
|
56
|
+
};
|
|
57
|
+
export type IdCaptureViewAssets = {
|
|
58
|
+
guideImages?: IdCaptureGuideImages;
|
|
59
|
+
loadingOverlay?: IdCaptureLoadingOverlayAssets;
|
|
60
|
+
};
|
|
61
|
+
export type IdCaptureViewProps = {
|
|
62
|
+
controller: IdCaptureController;
|
|
63
|
+
/** Default 'fit', mirroring IdCaptureGuides' own default (which mirrors
|
|
64
|
+
* sdk2's wizard default guide type). */
|
|
65
|
+
guideType?: IdCaptureGuideType;
|
|
66
|
+
/** Which loading overlay variant renders. sdk2 PR #259's
|
|
67
|
+
* `loadingOverlayMode` wizard prop. Defaults to 'default'. */
|
|
68
|
+
loadingOverlayMode?: IdCaptureLoadingOverlayMode;
|
|
69
|
+
/** Controls whether the camera feed is constrained to the capture guides
|
|
70
|
+
* or fills the available screen space. Defaults to 'snapToGuides'. sdk2
|
|
71
|
+
* PR #269's `cameraFeedMode` wizard prop. */
|
|
72
|
+
cameraFeedMode?: CameraFeedMode;
|
|
73
|
+
/** When true, hides the outer guide-box SVG stack while preserving guide
|
|
74
|
+
* geometry and detection. Defaults to false. sdk2 PR #269's
|
|
75
|
+
* `guideBoxDisabled` wizard prop. */
|
|
76
|
+
guideBoxDisabled?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Replaces guided capture with the stock-camera fallback screen outright —
|
|
79
|
+
* sdk2's `forceFallbackMode`. The fallback ALSO takes over on its own when
|
|
80
|
+
* the models fail to load, which is sdk2's `isFallbackMode = forceFallbackMode
|
|
81
|
+
* || modelError` (IdCaptureWizard.tsx:535); this prop is the deliberate half.
|
|
82
|
+
*/
|
|
83
|
+
forceFallbackMode?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Drops the fallback screen's "We're having some trouble" heading and
|
|
86
|
+
* description, so a fallback the integrator EXPECTED does not read as an
|
|
87
|
+
* apology. sdk2's `silentFallback`.
|
|
88
|
+
*/
|
|
89
|
+
silentFallback?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Offers "capture with camera" or "upload from storage" before capture
|
|
92
|
+
* starts — sdk2's `allowUploadingDocumentsFromStorage`. Uploaded images are
|
|
93
|
+
* committed through `captureManually` under sdk2's 'Upload' capture mode.
|
|
94
|
+
*/
|
|
95
|
+
allowUploadingDocumentsFromStorage?: boolean;
|
|
96
|
+
/** sdk2's wizard prop of the same name (default true): on a portrait
|
|
97
|
+
* viewport the guide art stands the ID card up. False keeps the landscape
|
|
98
|
+
* guides in every orientation. */
|
|
99
|
+
portraitGuidesOnMobile?: boolean;
|
|
100
|
+
/** sdk2's wizard prop of the same name (default true): rotates the loading
|
|
101
|
+
* overlay's instruction image a quarter turn on a portrait viewport, so it
|
|
102
|
+
* matches the portrait guides. Only ever applies together with
|
|
103
|
+
* `portraitGuidesOnMobile`, exactly as sdk2 gated it. */
|
|
104
|
+
rotateLoadingOverlayImageWhenPortrait?: boolean;
|
|
105
|
+
/** Fit guides only: draw the guide box on the mask's own rect so the two always agree, and show the mask over a fullscreen feed. Defaults to false. */
|
|
106
|
+
guideBoxFollowsMask?: boolean;
|
|
107
|
+
/** Default false. True renders phase 'requestingFlip' as a ReviewScreen
|
|
108
|
+
* interstitial (sdk2's `separateIdCardCaptureSequence`) whose submit
|
|
109
|
+
* calls `actions.confirmFlip()` instead of showing the flip-prompt guide
|
|
110
|
+
* art. */
|
|
111
|
+
flipReview?: boolean;
|
|
112
|
+
/** Default true. Gates ReviewScreen's submit button and the loading
|
|
113
|
+
* overlay's session-checking line — same seam those components already
|
|
114
|
+
* expose (see their own prop docs). */
|
|
115
|
+
sessionReady?: boolean;
|
|
116
|
+
/** Skips the final ID review/success screen and completes automatically.
|
|
117
|
+
* Defaults to false. */
|
|
118
|
+
skipSuccessScreen?: SkipSuccessScreen;
|
|
119
|
+
lang?: LangOption;
|
|
120
|
+
/** When true, the loading overlay auto-dismisses 400ms after
|
|
121
|
+
* session/models/camera are ready instead of waiting for the continue
|
|
122
|
+
* button. sdk2 PR #255's `autoContinueAfterLoading` flow prop. Default
|
|
123
|
+
* false. */
|
|
124
|
+
autoContinueAfterLoading?: boolean;
|
|
125
|
+
/** Ring mode only (`loadingOverlayMode: 'ring'`): shows a priming intro
|
|
126
|
+
* page first and defers the camera permission request to its "Enable
|
|
127
|
+
* camera & start" button instead of the ring rendering immediately.
|
|
128
|
+
* Default false. Meaningful only when `controller` was created with
|
|
129
|
+
* `deferCameraAcquisition: true` — otherwise `attach()` acquires the
|
|
130
|
+
* camera eagerly and `state.camera.accessRequested` latches before the
|
|
131
|
+
* intro ever gets a chance to render, so the overlay goes straight to the
|
|
132
|
+
* ring regardless of this flag. sdk2 PR #261's `showIntroScreen`. */
|
|
133
|
+
showIntroScreen?: boolean;
|
|
134
|
+
/** Renders sdk2's detection debug overlays (per-frame detected-object boxes
|
|
135
|
+
* + the DebugStatsPane score readout, `components/debug/debug.tsx` — see
|
|
136
|
+
* sdk2 IdCapture.tsx:333-353,386-467). Default false; dev/QA tooling only,
|
|
137
|
+
* never enabled by a customer-facing story. */
|
|
138
|
+
debugMode?: boolean;
|
|
139
|
+
onExit?: () => void;
|
|
140
|
+
/**
|
|
141
|
+
* Cancel affordance on the loading overlay, distinct from `onExit`: sdk2's
|
|
142
|
+
* `onUserCancel` abandons the flow *while models/camera are still loading*,
|
|
143
|
+
* whereas `onExit` leaves an already-running capture
|
|
144
|
+
* (sdk2 IdCaptureWizard.tsx:1636 hands this straight to the overlay).
|
|
145
|
+
*
|
|
146
|
+
* All three overlay variants already render their cancel button only when
|
|
147
|
+
* this is bound (`IdCaptureLoadingOverlay{Default,Ring,Legacy}.tsx`), so
|
|
148
|
+
* leaving it undefined shows no button — do NOT pass an
|
|
149
|
+
* unconditionally-wrapped callback.
|
|
150
|
+
*/
|
|
151
|
+
onUserCancel?: () => void;
|
|
152
|
+
/** Loading-overlay lifecycle notifications preserved for 2.x-compatible
|
|
153
|
+
* hosts. These are forwarded to the active overlay variant. */
|
|
154
|
+
onLoadingStarted?: () => void;
|
|
155
|
+
onLoadingProgress?: (progress: number) => void;
|
|
156
|
+
onLoadingCompleted?: () => void;
|
|
157
|
+
onLoadingFailed?: (error?: Error) => void;
|
|
158
|
+
/** Fires after Continue (or auto-continue) dismisses the loading overlay. */
|
|
159
|
+
onLoadingOverlayDismissed?: () => void;
|
|
160
|
+
/** Replaces the stock loading-overlay heading and graphic. */
|
|
161
|
+
customOverlayContent?: ReactNode;
|
|
162
|
+
/**
|
|
163
|
+
* Extra content rendered inside the loading overlay, below the instruction
|
|
164
|
+
* graphic and above the progress bar — sdk2's `instructions` wizard prop,
|
|
165
|
+
* which reached the same slot in the same overlay
|
|
166
|
+
* (IdCaptureWizard.tsx:1631). Unlike `customOverlayContent` this ADDS to the
|
|
167
|
+
* stock overlay rather than replacing it.
|
|
168
|
+
*/
|
|
169
|
+
instructions?: ReactNode;
|
|
170
|
+
/**
|
|
171
|
+
* Fires once when the controller reports `CAMERA_TAMPERING_SUSPECTED` —
|
|
172
|
+
* sdk2's `onCameraTamperingDetected`. A pure notification: the view renders
|
|
173
|
+
* the tampering screen either way.
|
|
174
|
+
*
|
|
175
|
+
* Fires again only if the error clears and a later attach re-detects
|
|
176
|
+
* tampering, so a host counting these counts detections, not renders.
|
|
177
|
+
*/
|
|
178
|
+
onCameraTamperingDetected?: () => void;
|
|
179
|
+
/**
|
|
180
|
+
* Fires once when the controller reports `CAMERA_PERMISSION_DENIED` —
|
|
181
|
+
* sdk2's `onCameraAccessDenied`, which the selfie stage
|
|
182
|
+
* (`SelfieCaptureSurface`) has always honoured and the ID stage did not.
|
|
183
|
+
* A pure notification: the view renders its denial/error screen either way.
|
|
184
|
+
*
|
|
185
|
+
* Latched like `onCameraTamperingDetected`: it fires again only if the
|
|
186
|
+
* error clears and a later attempt is denied again, so a host counting
|
|
187
|
+
* these counts denials, not renders.
|
|
188
|
+
*/
|
|
189
|
+
onCameraAccessDenied?: () => void;
|
|
190
|
+
/**
|
|
191
|
+
* Fires once with the underlying Error when a model fails to load (or times
|
|
192
|
+
* out) — sdk2's `onModelError` / `onIdCaptureModelError`. Distinct from
|
|
193
|
+
* `onLoadingFailed`, which is the loading OVERLAY's lifecycle notification
|
|
194
|
+
* and carries no error object.
|
|
195
|
+
*
|
|
196
|
+
* The error reaches the view as the controller's `MODEL_LOAD_FAILED`
|
|
197
|
+
* state, both for an attach-time failure and for a post-attach one, so
|
|
198
|
+
* either route reports.
|
|
199
|
+
*/
|
|
200
|
+
onModelError?: (error: Error) => void;
|
|
201
|
+
/**
|
|
202
|
+
* Renders an exit button on the tampering screen, which is otherwise a dead
|
|
203
|
+
* end (`CAMERA_TAMPERING_SUSPECTED` is `recoverable: false`, so `ErrorScreen`
|
|
204
|
+
* offers no Retry). Ports sdk2's `onExitAfterTamperSealPopped`, including its
|
|
205
|
+
* "only renders the button when bound" gate.
|
|
206
|
+
*/
|
|
207
|
+
onExitAfterTamperSealPopped?: () => void;
|
|
208
|
+
/**
|
|
209
|
+
* Fires once per document as it is committed to the capture, whatever the
|
|
210
|
+
* route (camera, flip, recapture). Ports sdk2's `onDocumentStored`, added in
|
|
211
|
+
* PR #279 to feed the `document.captured` journey event.
|
|
212
|
+
*
|
|
213
|
+
* Distinct from the controller-config `onDocumentCaptured`, which fires per
|
|
214
|
+
* capture ATTEMPT and carries frame metadata rather than saying which
|
|
215
|
+
* document was stored.
|
|
216
|
+
*
|
|
217
|
+
* Documents handed in via the controller's `precapturedDocuments` are NOT
|
|
218
|
+
* reported: the caller already has them and never captured them.
|
|
219
|
+
*/
|
|
220
|
+
onDocumentStored?: (documentType: CapturedDocumentType) => void;
|
|
221
|
+
/**
|
|
222
|
+
* Fires when the user restarts capture, before the controller resets. Ports
|
|
223
|
+
* sdk2's `onRetry` (PR #279), which fed `capture.retried`.
|
|
224
|
+
*
|
|
225
|
+
* Both restart affordances reach this: `ReviewScreen`'s Retry (discard the
|
|
226
|
+
* captured document and shoot again) AND `ErrorScreen`'s Retry on a
|
|
227
|
+
* recoverable error (camera unavailable, model load failed, a retryable
|
|
228
|
+
* submission failure). Both call `controller.actions.retry()`, so a host
|
|
229
|
+
* counting retries counts every restart, not only the deliberate redos.
|
|
230
|
+
*/
|
|
231
|
+
onRetry?: () => void;
|
|
232
|
+
/** Fires with the SubmissionResponse after ReviewScreen's submit calls
|
|
233
|
+
* `actions.submit()` and it resolves. Ignored (never called) when
|
|
234
|
+
* `onCollected` is also provided — see `onCollected`'s doc for why the two
|
|
235
|
+
* are mutually exclusive. */
|
|
236
|
+
onSubmitted?: (response: SubmissionResponse) => void;
|
|
237
|
+
/**
|
|
238
|
+
* When provided, ReviewScreen's submit calls `controller.collectArtifacts()`
|
|
239
|
+
* (a pure, synchronous read — no network I/O, no state transition) and
|
|
240
|
+
* hands the result to this callback INSTEAD of calling
|
|
241
|
+
* `controller.actions.submit()`. Mutually exclusive with `onSubmitted`:
|
|
242
|
+
* when both are set, only `onCollected` fires and `actions.submit()` is
|
|
243
|
+
* never called.
|
|
244
|
+
*
|
|
245
|
+
* Why this exists: sdk2's `IdCaptureWizard.onSubmitClick` never submits to
|
|
246
|
+
* the network itself, in any flow — it stores captured images into
|
|
247
|
+
* `SubmissionProvider` state and fires `onSuccess(submission)`
|
|
248
|
+
* (sdk2/src/components/id_capture/IdCaptureWizard.tsx:965-1045). The ONE
|
|
249
|
+
* real submission fires higher up, in the composing layer:
|
|
250
|
+
* `CompositeWizard.tsx:257-265` calls `submit()` exactly once after every
|
|
251
|
+
* stage (ID + selfie, when present) has completed. `onCollected` is this
|
|
252
|
+
* view's equivalent seam for a host composing ID capture with another
|
|
253
|
+
* stage (e.g. selfie liveness) into a single combined submission.
|
|
254
|
+
*
|
|
255
|
+
* Unlike the submit path above (guarded by `state.submission ===
|
|
256
|
+
* 'submitting'`), this view applies no debouncing to the collect handoff —
|
|
257
|
+
* `collectArtifacts()` never transitions controller state, so nothing
|
|
258
|
+
* disables ReviewScreen's submit button between calls; a host that keeps
|
|
259
|
+
* this view mounted after collecting (rather than unmounting/advancing
|
|
260
|
+
* immediately, the typical composer pattern) must guard against repeat
|
|
261
|
+
* invocations itself, and the eventual combined submission should carry
|
|
262
|
+
* its own single-fire guard.
|
|
263
|
+
*/
|
|
264
|
+
onCollected?: (artifacts: SubmissionArtifacts) => void;
|
|
265
|
+
verbiage?: IdCaptureViewVerbiage;
|
|
266
|
+
classNames?: IdCaptureViewClassNames;
|
|
267
|
+
colors?: IdCaptureViewColors;
|
|
268
|
+
assets?: IdCaptureViewAssets;
|
|
269
|
+
};
|
|
270
|
+
export declare function IdCaptureView({ controller, guideType, loadingOverlayMode, cameraFeedMode, guideBoxDisabled, forceFallbackMode, silentFallback, allowUploadingDocumentsFromStorage, portraitGuidesOnMobile, rotateLoadingOverlayImageWhenPortrait, guideBoxFollowsMask, flipReview, sessionReady: sessionReadyProp, skipSuccessScreen, lang, autoContinueAfterLoading, showIntroScreen, debugMode, onExit, onUserCancel, onLoadingStarted, onLoadingProgress, onLoadingCompleted, onLoadingFailed, onLoadingOverlayDismissed, customOverlayContent, instructions, onCameraTamperingDetected, onCameraAccessDenied, onModelError, onExitAfterTamperSealPopped, onDocumentStored, onRetry, onSubmitted, onCollected, verbiage, classNames, colors, assets, }: IdCaptureViewProps): ReactElement;
|
|
271
|
+
//# sourceMappingURL=IdCaptureView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdCaptureView.d.ts","sourceRoot":"","sources":["../src/IdCaptureView.tsx"],"names":[],"mappings":"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"}
|